index.js 9.6 KB

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