index.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. },
  256. {
  257. label: "系统管理",
  258. name: "SystemManagement",
  259. index: "9",
  260. permission: 90,
  261. children: [
  262. {
  263. label: "用户管理",
  264. name: "UserManagement",
  265. index: "1",
  266. permission: 91,
  267. },
  268. {
  269. label: "权限管理",
  270. name: "AuthorityManagement",
  271. index: "2",
  272. permission: 92,
  273. },
  274. ],
  275. },
  276. ],
  277. menuListTotal: [],
  278. isShowChart: false,
  279. layers: [],
  280. layerList: [],
  281. iconList: [],
  282. mouseLocation: [0, 0],
  283. nowZoom: 0
  284. },
  285. getters: {
  286. getToken: function (state) {
  287. return Vue.ls.get("token")
  288. },
  289. getUserState: function (state) {
  290. return Vue.ls.get("userState")
  291. },
  292. getUserInfo: function (state) {
  293. return JSON.parse(Vue.ls.get("userInfo"))
  294. },
  295. getMenuListTotal: function (state) {
  296. return state.menuListTotal
  297. },
  298. getMenuListDeafaultTotal: function (state) {
  299. return state.menuListDeafaultTotal
  300. },
  301. },
  302. mutations: {
  303. setToken(state, str) {
  304. state.token = str;
  305. Vue.ls.set("token", str, status_time);
  306. },
  307. setUserState(state, bool) {
  308. state.userState = bool;
  309. Vue.ls.set("userState", bool, status_time);
  310. },
  311. setUserInfo(state, obj) {
  312. state.userInfo = obj;
  313. Vue.ls.set("userInfo", JSON.stringify(obj), status_time);
  314. },
  315. setLayerList(state, arr) {
  316. state.layerList = arr.concat([]);
  317. },
  318. setIconList(state, arr) {
  319. state.iconList = arr.concat([]);
  320. },
  321. setMouseLocation(state, arr) {
  322. state.mouseLocation = arr;
  323. },
  324. setZoom(state, zoom) {
  325. state.nowZoom = zoom;
  326. },
  327. addLayer(state, obj) {
  328. state.layers.unshift(obj);
  329. },
  330. removeLayer(state, obj) {
  331. state.layers = state.layers.filter(function (item) {
  332. return item.layerId != obj.layerId;
  333. })
  334. },
  335. resetLayer(state, arr) {
  336. state.layers = arr.concat([])
  337. },
  338. setChartIsShow(state, bool) {
  339. state.isShowChart = bool
  340. },
  341. setMenuListTotal(state, obj) {
  342. state.menuListTotal = JSON.parse(JSON.stringify(obj))
  343. }
  344. },
  345. actions: {
  346. addLayerControl(context, obj) {
  347. context.commit('addLayer', obj)
  348. },
  349. removeLayerControl(context, obj) {
  350. context.commit('removeLayer', obj)
  351. },
  352. resetLayerControl(context, arr) {
  353. context.commit('resetLayer', arr)
  354. },
  355. },
  356. modules: {},
  357. })