index.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. let status_time = 24 * 60 * 60 * 1000
  5. export default new Vuex.Store({
  6. state: {
  7. token: "",
  8. userState: false,
  9. userInfo: null,
  10. menuListDeafaultTotal:
  11. [
  12. {
  13. label: "综合展示",
  14. name: "ComprehensiveDisplay",
  15. index: "1",
  16. permission: 10,
  17. },
  18. {
  19. label: "数据图层",
  20. name: "DataLayer",
  21. index: "2",
  22. permission: 20,
  23. children: [
  24. {
  25. label: "图标库管理",
  26. name: "IconLibraryManagement",
  27. index: "1",
  28. permission: 21,
  29. },
  30. {
  31. label: "图层管理",
  32. name: "LayerManagement",
  33. index: "2",
  34. permission: 22,
  35. },
  36. ],
  37. },
  38. {
  39. label: "数据质检",
  40. name: "DataQualityInspection",
  41. index: "3",
  42. permission: 30,
  43. children: [
  44. {
  45. label: "质检规则",
  46. name: "QualityInspectionRules",
  47. index: "1",
  48. permission: 31,
  49. children: [
  50. {
  51. label: "图层质检规则",
  52. index: "1",
  53. },
  54. {
  55. label: "单条数据规则",
  56. index: "2",
  57. },
  58. {
  59. label: "数据导入规则",
  60. index: "3",
  61. children: [
  62. {
  63. label: "Excel导入规则",
  64. index: "1",
  65. },
  66. {
  67. label: "Shapefile导入规则",
  68. index: "2",
  69. },
  70. {
  71. label: "Geojson导入规则",
  72. index: "3",
  73. },
  74. ]
  75. },
  76. {
  77. label: "数据完整性检查",
  78. index: "4",
  79. },
  80. ]
  81. },
  82. {
  83. label: "质检流程管理",
  84. name: "QualityInspectionProcessManagement",
  85. index: "2",
  86. permission: 32,
  87. children: [
  88. {
  89. label: "质检流程图",
  90. index: "1",
  91. children: [
  92. {
  93. label: "接口接入质检流程图",
  94. index: "1",
  95. },
  96. {
  97. label: "附件流程图",
  98. index: "2",
  99. },
  100. ],
  101. },
  102. {
  103. label: "附件质检",
  104. index: "2",
  105. children: [
  106. {
  107. label: "Excel质检",
  108. index: "1",
  109. },
  110. {
  111. label: "Shapefile质检",
  112. index: "2",
  113. },
  114. {
  115. label: "Geojson质检",
  116. index: "3",
  117. },
  118. ],
  119. },
  120. ]
  121. },
  122. ],
  123. },
  124. {
  125. label: "数据接入",
  126. name: "DataAccess",
  127. index: "4",
  128. permission: 40,
  129. children: [
  130. {
  131. label: "数据录入",
  132. name: "DataTable",
  133. index: "1", permission: 41,
  134. },
  135. {
  136. label: "数据导入",
  137. name: "DataTable",
  138. index: "2", permission: 42,
  139. },
  140. {
  141. label: "数据日志",
  142. name: "DataLog",
  143. index: "3", permission: 43,
  144. },
  145. {
  146. label: "结果反馈",
  147. name: "ResultFeedback",
  148. index: "4", permission: 44,
  149. },
  150. ],
  151. },
  152. {
  153. label: "数据展示",
  154. name: "DataDisplay",
  155. index: "5",
  156. permission: 50,
  157. children: [
  158. {
  159. label: "入库数据展示",
  160. name: "DataTable",
  161. index: "1",
  162. permission: 51,
  163. },
  164. {
  165. label: "GIS图层展示",
  166. name: "LayerDisplay",
  167. index: "2",
  168. permission: 52,
  169. },
  170. ],
  171. },
  172. {
  173. label: "数据服务",
  174. name: "DataServices",
  175. index: "6",
  176. permission: 60,
  177. children: [
  178. {
  179. label: "数据发布",
  180. name: "DataTable",
  181. index: "1", permission: 61,
  182. },
  183. {
  184. label: "数据服务接口",
  185. name: "DataService",
  186. index: "2", permission: 62,
  187. },
  188. {
  189. label: "瓦片服务接口",
  190. name: "TileSerivce",
  191. index: "3", permission: 63,
  192. },
  193. {
  194. label: "服务监控",
  195. name: "ServiceMonitoring",
  196. index: "4", permission: 64,
  197. },
  198. ],
  199. },
  200. {
  201. label: "实用工具",
  202. name: "Utilities",
  203. index: "7",
  204. permission: 70,
  205. children: [
  206. {
  207. label: "地址转换工具",
  208. name: "AddressTranslationTool",
  209. index: "1", permission: 71,
  210. },
  211. {
  212. label: "坐标转换工具",
  213. name: "CoordinateConversionTool",
  214. index: "2", permission: 72,
  215. },
  216. {
  217. label: "手动落图工具",
  218. name: "ManualDrawingTool",
  219. index: "3", permission: 73,
  220. },
  221. {
  222. label: "图形绘制工具",
  223. name: "GraphicsDrawingTool",
  224. index: "4", permission: 74,
  225. },
  226. {
  227. label: "测量工具",
  228. name: "MeasureTool",
  229. index: "5", permission: 75,
  230. },
  231. ],
  232. },
  233. {
  234. label: "二次开发",
  235. name: "SecondaryDevelopment",
  236. index: "8",
  237. permission: 80,
  238. children: [
  239. {
  240. label: "手动落图工具",
  241. name: "ManualDrawingTool",
  242. index: "1", permission: 81,
  243. },
  244. {
  245. label: "图形绘制工具",
  246. name: "GraphicsDrawingTool",
  247. index: "2", permission: 82,
  248. },
  249. {
  250. label: "测量工具",
  251. name: "MeasureTool",
  252. index: "3", permission: 83,
  253. },
  254. {
  255. label: "加载瓦片服务",
  256. name: "AddTileService",
  257. index: "4", permission: 84,
  258. },
  259. ],
  260. },
  261. {
  262. label: "系统管理",
  263. name: "SystemManagement",
  264. index: "9",
  265. permission: 90,
  266. children: [
  267. {
  268. label: "用户管理",
  269. name: "UserManagement",
  270. index: "1",
  271. permission: 91,
  272. },
  273. {
  274. label: "角色管理",
  275. name: "RoleManagement",
  276. index: "2",
  277. permission: 92,
  278. },
  279. ],
  280. },
  281. ],
  282. menuListTotal: [],
  283. isShowChart: false,
  284. layers: [],
  285. layerList: [],
  286. iconList: [],
  287. mouseLocation: [0, 0],
  288. nowZoom: 6
  289. },
  290. getters: {
  291. getToken: function (state) {
  292. return Vue.ls.get("token")
  293. },
  294. getUserState: function (state) {
  295. return Vue.ls.get("userState")
  296. },
  297. getUserInfo: function (state) {
  298. return JSON.parse(Vue.ls.get("userInfo"))
  299. },
  300. getMenuListTotal: function (state) {
  301. return state.menuListTotal
  302. },
  303. getMenuListDeafaultTotal: function (state) {
  304. return state.menuListDeafaultTotal
  305. },
  306. },
  307. mutations: {
  308. setToken(state, str) {
  309. state.token = str;
  310. Vue.ls.set("token", str, status_time);
  311. },
  312. setUserState(state, bool) {
  313. state.userState = bool;
  314. Vue.ls.set("userState", bool, status_time);
  315. },
  316. setUserInfo(state, obj) {
  317. state.userInfo = obj;
  318. Vue.ls.set("userInfo", JSON.stringify(obj), status_time);
  319. },
  320. setLayerList(state, arr) {
  321. state.layerList = arr.concat([]);
  322. },
  323. setIconList(state, arr) {
  324. state.iconList = arr.concat([]);
  325. },
  326. setMouseLocation(state, arr) {
  327. state.mouseLocation = arr;
  328. },
  329. setZoom(state, zoom) {
  330. state.nowZoom = zoom;
  331. },
  332. addLayer(state, obj) {
  333. state.layers.unshift(obj);
  334. },
  335. removeLayer(state, obj) {
  336. state.layers = state.layers.filter(function (item) {
  337. return item.layerId != obj.layerId;
  338. })
  339. },
  340. resetLayer(state, arr) {
  341. state.layers = arr.concat([])
  342. },
  343. setChartIsShow(state, bool) {
  344. state.isShowChart = bool
  345. },
  346. setMenuListTotal(state, obj) {
  347. state.menuListTotal = JSON.parse(JSON.stringify(obj))
  348. }
  349. },
  350. actions: {
  351. addLayerControl(context, obj) {
  352. context.commit('addLayer', obj)
  353. },
  354. removeLayerControl(context, obj) {
  355. context.commit('removeLayer', obj)
  356. },
  357. resetLayerControl(context, arr) {
  358. context.commit('resetLayer', arr)
  359. },
  360. },
  361. modules: {},
  362. })