menuVue.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. /**
  2. * [ONEMAP.M.projectController]
  3. * @return {[object]}
  4. */
  5. define(function () {
  6. var app = null
  7. $('#vue-menu').html('')
  8. var vectorFunc, rasterFunc, modelFunc, coorTransformFunc, targetPointFunc, addressSearchFunc, advancedAddressSearchFunc, calcDistanceFunc, pathPlanningFunc, gridInfoByLonlatFunc, shpAGeojsonMutualismFunc;
  9. require(['modDir/layerVue/vector'], function (obj) {
  10. vectorFunc = obj;
  11. });
  12. require(['modDir/layerVue/raster'], function (obj) {
  13. rasterFunc = obj;
  14. });
  15. require(['modDir/layerVue/model'], function (obj) {
  16. modelFunc = obj;
  17. });
  18. require(['modDir/menu/baseCalc/coorTransform'], function (obj) {
  19. coorTransformFunc = obj
  20. });
  21. require(['modDir/menu/baseCalc/targetPoint'], function (obj) {
  22. targetPointFunc = obj
  23. });
  24. require(['modDir/menu/baseCalc/addressSearch'], function (obj) {
  25. addressSearchFunc = obj
  26. });
  27. require(['modDir/menu/baseCalc/advancedAddressSearch'], function (obj) {
  28. advancedAddressSearchFunc = obj
  29. });
  30. require(['modDir/menu/baseCalc/calcDistance'], function (obj) {
  31. calcDistanceFunc = obj
  32. });
  33. require(['modDir/menu/baseCalc/pathPlanning'], function (obj) {
  34. pathPlanningFunc = obj
  35. });
  36. require(['modDir/menu/baseCalc/gridInfoByLonlat'], function (obj) {
  37. gridInfoByLonlatFunc = obj
  38. });
  39. require(['modDir/menu/baseCalc/shpAGeojsonMutualism'], function (obj) {
  40. shpAGeojsonMutualismFunc = obj
  41. });
  42. // 目录初始化
  43. app = new Vue({
  44. el: '#vuemenu',
  45. data: {
  46. keyWord: "",
  47. treeData: [],
  48. defaultProps: {
  49. children: 'children',
  50. label: 'label',
  51. isLeaf: 'leaf',
  52. disabled: function (data, node) {
  53. if (data.label == "暂无数据") {
  54. return true
  55. }
  56. }
  57. },
  58. // leafArr: [
  59. // {
  60. // "id": 2296,
  61. // "title": "流转看管地块提取_polyline"
  62. // },
  63. // {
  64. // "id": 2295,
  65. // "title": "流转看管地块提取_polygon"
  66. // },
  67. // {
  68. // "id": 2294,
  69. // "title": "流转看管地块提取_multipatch"
  70. // },
  71. // {
  72. // "id": 2293,
  73. // "title": "流转看管地块提取_annotation"
  74. // },
  75. // {
  76. // "id": 2255,
  77. // "title": "X核减量化地块_第三批"
  78. // },
  79. // {
  80. // "id": 2254,
  81. // "title": "评估地块层_第三批"
  82. // },
  83. // {
  84. // "id": 2252,
  85. // "title": "建设用地疑似林地_朱家角镇_Polyline"
  86. // },
  87. // {
  88. // "id": 2251,
  89. // "title": "建设用地疑似林地_朱家角镇_Polygon"
  90. // },
  91. // {
  92. // "id": 2250,
  93. // "title": "建设用地疑似林地_朱家角镇_Annotation"
  94. // },
  95. // {
  96. // "id": 2249,
  97. // "title": "建设用地疑似林地_重固镇_Polyline"
  98. // },
  99. // {
  100. // "id": 2248,
  101. // "title": "建设用地疑似林地_重固镇_Polygon"
  102. // },
  103. // {
  104. // "id": 2247,
  105. // "title": "建设用地疑似林地_重固镇_Annotation"
  106. // },
  107. // {
  108. // "id": 2246,
  109. // "title": "建设用地疑似林地_赵巷镇_Polyline"
  110. // },
  111. // {
  112. // "id": 2245,
  113. // "title": "建设用地疑似林地_赵巷镇_Polygon"
  114. // },
  115. // {
  116. // "id": 2244,
  117. // "title": "建设用地疑似林地_赵巷镇_Annotation"
  118. // },
  119. // {
  120. // "id": 2243,
  121. // "title": "建设用地疑似林地_徐泾镇_Polyline"
  122. // },
  123. // {
  124. // "id": 2242,
  125. // "title": "建设用地疑似林地_徐泾镇_Polygon"
  126. // },
  127. // {
  128. // "id": 2241,
  129. // "title": "建设用地疑似林地_徐泾镇_Annotation"
  130. // },
  131. // {
  132. // "id": 2240,
  133. // "title": "建设用地疑似林地_香花桥街道_Polyline"
  134. // },
  135. // {
  136. // "id": 2239,
  137. // "title": "建设用地疑似林地_香花桥街道_Polygon"
  138. // },
  139. // {
  140. // "id": 2238,
  141. // "title": "建设用地疑似林地_香花桥街道_Annotation"
  142. // },
  143. // {
  144. // "id": 2237,
  145. // "title": "建设用地疑似林地_夏阳街道_Polyline"
  146. // },
  147. // {
  148. // "id": 2236,
  149. // "title": "建设用地疑似林地_夏阳街道_Polygon"
  150. // },
  151. // {
  152. // "id": 2235,
  153. // "title": "建设用地疑似林地_夏阳街道_Annotation"
  154. // },
  155. // {
  156. // "id": 2234,
  157. // "title": "建设用地疑似林地_练塘镇_Polyline"
  158. // },
  159. // {
  160. // "id": 2233,
  161. // "title": "建设用地疑似林地_练塘镇_Polygon"
  162. // },
  163. // {
  164. // "id": 2232,
  165. // "title": "建设用地疑似林地_练塘镇_Annotation"
  166. // },
  167. // {
  168. // "id": 2231,
  169. // "title": "建设用地疑似林地_金泽镇_Polyline"
  170. // },
  171. // {
  172. // "id": 2230,
  173. // "title": "建设用地疑似林地_金泽镇_Polygon"
  174. // },
  175. // {
  176. // "id": 2229,
  177. // "title": "建设用地疑似林地_金泽镇_Annotation"
  178. // },
  179. // {
  180. // "id": 2228,
  181. // "title": "建设用地疑似林地_华新镇_Polyline"
  182. // },
  183. // {
  184. // "id": 2227,
  185. // "title": "建设用地疑似林地_华新镇_Polygon"
  186. // },
  187. // {
  188. // "id": 2226,
  189. // "title": "建设用地疑似林地_华新镇_Annotation"
  190. // },
  191. // {
  192. // "id": 2225,
  193. // "title": "建设用地疑似林地_白鹤镇_Polyline"
  194. // },
  195. // {
  196. // "id": 2224,
  197. // "title": "建设用地疑似林地_白鹤镇_Polygon"
  198. // },
  199. // {
  200. // "id": 2223,
  201. // "title": "建设用地疑似林地_白鹤镇_Annotation"
  202. // },
  203. // {
  204. // "id": 2288,
  205. // "title": "违法用地综合整治21-23-polyline-裁切"
  206. // },
  207. // {
  208. // "id": 2287,
  209. // "title": "违法用地综合整治21-23-polygon-裁剪"
  210. // },
  211. // {
  212. // "id": 2258,
  213. // "title": "违法用地综合整治21-23-annotation-裁剪"
  214. // },
  215. // {
  216. // "id": 2197,
  217. // "title": "违法用地综合整治21-23-polyline"
  218. // },
  219. // {
  220. // "id": 2196,
  221. // "title": "违法用地综合整治21-23-annotation"
  222. // },
  223. // {
  224. // "id": 2195,
  225. // "title": "违法用地综合整治-21-23-polygon"
  226. // },
  227. // {
  228. // "id": 2187,
  229. // "title": "青浦区2024减量化地块"
  230. // },
  231. // {
  232. // "id": 2186,
  233. // "title": "青浦区2023减量化地块"
  234. // },
  235. // {
  236. // "id": 2185,
  237. // "title": "青浦区2022减量化地块"
  238. // },
  239. // {
  240. // "id": 2184,
  241. // "title": "青浦区2021减量化地块"
  242. // },
  243. // {
  244. // "id": 2183,
  245. // "title": "青浦区2020年减量化地块"
  246. // },
  247. // {
  248. // "id": 2135,
  249. // "title": "2024减量化潜力空间"
  250. // },
  251. // {
  252. // "id": 2136,
  253. // "title": "2023减量化潜力空间"
  254. // },
  255. // {
  256. // "id": 2181,
  257. // "title": "23年部卫片矢量"
  258. // },
  259. // {
  260. // "id": 2179,
  261. // "title": "2024年卫片执法图斑矢量-polyline"
  262. // },
  263. // {
  264. // "id": 2178,
  265. // "title": "2024年卫片执法图斑矢量-plygon"
  266. // },
  267. // {
  268. // "id": 2177,
  269. // "title": "2024年卫片执法图斑矢量-annotation"
  270. // },
  271. // {
  272. // "id": 2176,
  273. // "title": "青浦2023督察-polyline"
  274. // },
  275. // {
  276. // "id": 2175,
  277. // "title": "青浦2023督察-polygon"
  278. // },
  279. // {
  280. // "id": 2174,
  281. // "title": "青浦2023督察-annotation"
  282. // },
  283. // {
  284. // "id": 2173,
  285. // "title": "青浦2024督察-polyline"
  286. // },
  287. // {
  288. // "id": 2172,
  289. // "title": "青浦2024督察-polygon"
  290. // },
  291. // {
  292. // "id": 2171,
  293. // "title": "青浦2024督察-annotation"
  294. // },
  295. // {
  296. // "id": 2154,
  297. // "title": "annotation"
  298. // },
  299. // {
  300. // "id": 2153,
  301. // "title": "polyline"
  302. // },
  303. // {
  304. // "id": 2151,
  305. // "title": "polygon"
  306. // },
  307. // {
  308. // "id": 2150,
  309. // "title": "point"
  310. // },
  311. // {
  312. // "id": 2149,
  313. // "title": "multipatch"
  314. // },
  315. // {
  316. // "id": 2134,
  317. // "title": "24年报部项目"
  318. // },
  319. // {
  320. // "id": 2133,
  321. // "title": "23年报部项目"
  322. // },
  323. // {
  324. // "id": 2132,
  325. // "title": "T2024减量化0210"
  326. // }
  327. // ],
  328. // leafInfo: []
  329. },
  330. mounted() {
  331. let that = this;
  332. let layerArr = onemapUrlConfig.columnConfig;
  333. // this.getInfo(0)
  334. // 获取树状结构
  335. $.ajax({
  336. type: "POST",
  337. headers: {
  338. token: localStorage.getItem("systemToken"),
  339. },
  340. data: {
  341. conditionsList: JSON.stringify(layerArr),
  342. },
  343. dataType: "json",
  344. url: onemapUrlConfig.DMS_URL + '/dms/column/getColumnListByConditionsList',
  345. success: function (result) {
  346. if (result.code == 200) {
  347. let obj = result.content;
  348. for (let i = 0; i < layerArr.length; i++) {
  349. const layer = layerArr[i];
  350. let item = obj[layer.columnId][0]
  351. let newlayer = {
  352. id: item.id,
  353. label: layer.label,
  354. layerType: layer.layerType
  355. }
  356. if (item.dataList.length > 0) {
  357. newlayer.children = handleData(item.dataList, layer.layerType)
  358. } else {
  359. newlayer.children = [{ label: '暂无数据', leaf: true }]
  360. }
  361. that.treeData.push(newlayer)
  362. }
  363. let baseCalcConfig = {
  364. label: '基础时空专题服务', layerType: "service", id: "4f", children: [
  365. // {
  366. // label: '坐标转换', layerType: "coordinate", id: "4f-1", children: [
  367. // { label: 'WGS84 转 火星坐标', layerType: "coordinate", coorKey: "wgs84ToGcj02", id: "4f-1-1", leaf: true, },
  368. // { label: '火星坐标 转 WGS84', layerType: "coordinate", coorKey: "gcj02ToWgs84", id: "4f-1-2", leaf: true, },
  369. // { label: 'WGS84 转 百度坐标', layerType: "coordinate", coorKey: "wgs84ToBD09", id: "4f-1-3", leaf: true, },
  370. // { label: '百度坐标 转 WGS84', layerType: "coordinate", coorKey: "bd09ToWgs84", id: "4f-1-4", leaf: true, },
  371. // { label: 'WGS84 转 上海2000', layerType: "coordinate", coorKey: "wgs84ToSh2000", id: "4f-1-5", leaf: true, },
  372. // { label: '上海2000 转 WGS84', layerType: "coordinate", coorKey: "sh2000ToWgs84", id: "4f-1-6", leaf: true, },
  373. // { label: 'WGS84 转 上海2000投影', layerType: "coordinate", coorKey: "wgs84ToSh2000xy", id: "4f-1-7", leaf: true, },
  374. // { label: '上海2000投影 转 WGS84', layerType: "coordinate", coorKey: "sh2000xyToWgs84", id: "4f-1-8", leaf: true, },
  375. // ]
  376. // },
  377. { label: '路径规划', layerType: "route", id: "4f-2", leaf: true },
  378. // { label: '距离计算', layerType: "distance", id: "4f-3", leaf: true },
  379. // { label: '目标点计算', layerType: "targetPoint", id: "4f-4", leaf: true },
  380. { label: '地名搜索', layerType: "addressSearch", id: "4f-5", leaf: true },
  381. // { label: '高级地名搜索', layerType: "advancedAddressSearch", id: "4f-6", leaf: true },
  382. // { label: '经纬度获取村居/网格/微格网信息', layerType: "gridInfoByLonlat", id: "4f-7", leaf: true },
  383. // { label: 'shape与geojson转换', layerType: "shpAGeojsonMutualism", id: "4f-8", leaf: true },
  384. ]
  385. }
  386. that.treeData.push(baseCalcConfig)
  387. }
  388. // columnList 分级栏目
  389. function handleData(arr, layerType) {
  390. return arr.map(function (item) {
  391. item.label = item.title || item.c_name;
  392. item.layerType = layerType
  393. if (item.dataList != undefined && item.dataList.length != 0) {
  394. item.children = handleData(item.dataList, layerType);
  395. } else {
  396. // 0 分级栏目 1 内容栏目 -1内容
  397. if (item.type == 0) {
  398. item.children = [{ label: '暂无数据', leaf: true }]
  399. } else {
  400. item.leaf = true;
  401. }
  402. }
  403. return item
  404. })
  405. }
  406. }
  407. })
  408. },
  409. methods: {
  410. getInfo(index) {
  411. let that = this
  412. fetch(onemapUrlConfig.DMS_URL + '/dms/content/getVectorData', {
  413. method: "POST",
  414. headers: {
  415. "Content-Type": "application/x-www-form-urlencoded",
  416. "token": localStorage.getItem("systemToken"),
  417. },
  418. mode: "cors",
  419. body: "columnId=" + this.leafArr[index].id + "&token=" + localStorage.getItem("systemToken")
  420. // body: "columnId=" + modelData.layerInfo.id
  421. }).then(resp => resp.json()).then(function (result) {
  422. let total = 0
  423. result.features.map(function (feature) {
  424. total = total + feature.geometry.coordinates.join(",").split(",").length / 2
  425. })
  426. that.leafInfo.push({
  427. id: that.leafArr[index].id,
  428. title: that.leafArr[index].title,
  429. pointNum: total
  430. })
  431. if (index == that.leafArr.length - 1) {
  432. console.log(JSON.stringify(that.leafInfo))
  433. let TT = 0
  434. that.leafInfo.map(function (item) {
  435. TT += item.pointNum
  436. })
  437. console.log("总数:", TT)
  438. } else {
  439. that.getInfo(index + 1)
  440. }
  441. })
  442. },
  443. handleOpen() { console.log('handleOpen') },
  444. handleClose() { console.log('handleClose') },
  445. // handleNodeClick(data, node, self) {
  446. // if (data.leaf) {
  447. // if (data.layerType == "vector") {
  448. // if (data.type == 1) {
  449. // }
  450. // } else if (data.layerType == "raster") {
  451. // } else if (data.layerType == "model") {
  452. // modelFunc.add(data);
  453. // }
  454. // }
  455. // },
  456. handleCheck(data, checkedNodedObj) {
  457. // data.id
  458. // checkedNodedObj.checkedKeys
  459. if (data.leaf == false || data.leaf == undefined) return;
  460. if (checkedNodedObj.checkedKeys.indexOf(data.id) > -1) {
  461. // 选中
  462. if (data.layerType == "vector") {
  463. vectorFunc.add(data, this.setTreeChecked);
  464. }
  465. else if (data.layerType == "raster") {
  466. rasterFunc.add(data, this.setTreeChecked);
  467. }
  468. else if (data.layerType == "model") {
  469. modelFunc.add(data, this.setTreeChecked);
  470. }
  471. } else {
  472. // 取消选中
  473. if (data.layerType == "vector") {
  474. vectorFunc.remove(data);
  475. }
  476. else if (data.layerType == "raster") {
  477. rasterFunc.remove(data);
  478. }
  479. else if (data.layerType == "model") {
  480. modelFunc.remove(data);
  481. }
  482. }
  483. if (data.layerType == "coordinate") {
  484. coorTransformFunc.open(data);
  485. }
  486. else if (data.layerType == "route") {
  487. pathPlanningFunc.open(data);
  488. }
  489. else if (data.layerType == "distance") {
  490. calcDistanceFunc.open(data)
  491. }
  492. else if (data.layerType == "targetPoint") {
  493. targetPointFunc.open(data);
  494. }
  495. else if (data.layerType == "addressSearch") {
  496. addressSearchFunc.open(data)
  497. }
  498. else if (data.layerType == "advancedAddressSearch") {
  499. advancedAddressSearchFunc.open(data)
  500. }
  501. else if (data.layerType == "gridInfoByLonlat") {
  502. gridInfoByLonlatFunc.open(data)
  503. }
  504. else if (data.layerType == "shpAGeojsonMutualism") {
  505. shpAGeojsonMutualismFunc.open(data)
  506. }
  507. },
  508. setTreeChecked(id) {
  509. this.$refs.menuTree.setChecked(id, false, false);
  510. },
  511. filterNode(value, data, treeObj) {
  512. if (!value) return true
  513. return data.label.includes(value) || this.judgeTreeParent(value, treeObj.parent)
  514. },
  515. judgeTreeParent(value, obj) {
  516. if (obj) {
  517. let judge1
  518. if (obj.data.length) {
  519. judge1 = obj.data.includes(function (item) {
  520. return item.label == value;
  521. })
  522. } else {
  523. judge1 = obj.data.label.includes(value)
  524. }
  525. let judge2 = this.judgeTreeParent(value, obj.parent)
  526. return judge1 || judge2
  527. } else {
  528. return false
  529. }
  530. },
  531. // foldTree() {
  532. // let that = this;
  533. // this.treeData.forEach((el) => {
  534. // that.$refs.menuTree.store.nodesMap[el.id].expanded = false;
  535. // el.children && el.children.length > 0
  536. // ? that.foldTree(el.children)
  537. // : ""; // 子级递归
  538. // });
  539. // },
  540. // 以前的方法
  541. loadNode(node, resolve) {
  542. if (node.level === 0) {
  543. return resolve([
  544. { label: '矢量数据', type: 0, layerType: "vector", id: onemapUrlConfig.columnConfig.vector.id },
  545. { label: '二维地图服务', type: 0, layerType: "raster", id: onemapUrlConfig.columnConfig.raster.id },
  546. { label: '三维地图服务', type: 0, layerType: "model", id: onemapUrlConfig.columnConfig.model.id },
  547. { label: '基础时空专题服务', type: 0, layerType: "service", id: 5 },
  548. ]);
  549. }
  550. if (!localStorage.getItem("systemToken")) {
  551. ONEMAP.C.publisher.publish({
  552. type: 'warning',
  553. message: '用户尚未登录!'
  554. }, 'noteBar::add');
  555. return resolve([{ label: '暂无数据', leaf: true }]);
  556. }
  557. if (node.data.layerType == "vector") {
  558. $.ajax({
  559. type: "POST",
  560. headers: {
  561. token: localStorage.getItem("systemToken"),
  562. },
  563. data: {
  564. id: node.data.id,
  565. },
  566. dataType: "json",
  567. url: onemapUrlConfig.DMS_URL + '/dms/column/selectChild',
  568. success: function (result) {
  569. if (result.code == 200) {
  570. const list = result.content.map(function (item) {
  571. item.label = item.title;
  572. item.layerType = node.data.layerType;
  573. if (item.type == 1) {
  574. item.leaf = true
  575. }
  576. return item
  577. })
  578. resolve(list);
  579. } else {
  580. return resolve([{ label: '暂无数据', leaf: true }]);
  581. }
  582. }
  583. })
  584. }
  585. else if (node.data.layerType == "service") {
  586. return resolve([
  587. { label: '坐标转换', type: 0, layerType: "coordinate", id: node.data.layerType + 1 },
  588. { label: '路径规划', type: 2, layerType: "route", id: node.data.layerType + 2, leaf: true },
  589. { label: '距离计算', type: 2, layerType: "distance", id: node.data.layerType + 3, leaf: true },
  590. { label: '目标点计算', type: 2, layerType: "targetPoint", id: node.data.layerType + 4, leaf: true },
  591. { label: '地名搜索', type: 2, layerType: "addressSearch", id: node.data.layerType + 5, leaf: true },
  592. { label: '高级地名搜索', type: 2, layerType: "advancedAddressSearch", id: node.data.layerType + 6, leaf: true },
  593. { label: '经纬度获取村居/网格/微格网信息', type: 2, layerType: "gridInfoByLonlat", id: node.data.layerType + 7, leaf: true },
  594. { label: 'shape与geojson转换', type: 2, layerType: "shpAGeojsonMutualism", id: node.data.layerType + 8, leaf: true },
  595. ]);
  596. }
  597. else if (node.data.layerType == "coordinate") {
  598. return resolve([
  599. { label: 'WGS84 转 火星坐标', type: 2, layerType: "coordinate", beforeLabel: "WGS84", afterLabel: "火星坐标", coorKey: "wgs84ToGcj02", id: node.data.layerType + 1, leaf: true, },
  600. { label: '火星坐标 转 WGS84', type: 2, layerType: "coordinate", beforeLabel: "火星坐标", afterLabel: "WGS84", coorKey: "gcj02ToWgs84", id: node.data.layerType + 2, leaf: true, },
  601. { label: 'WGS84 转 百度坐标', type: 2, layerType: "coordinate", beforeLabel: "WGS84", afterLabel: "百度坐标", coorKey: "wgs84ToBD09", id: node.data.layerType + 3, leaf: true, },
  602. { label: '百度坐标 转 WGS84', type: 2, layerType: "coordinate", beforeLabel: "百度坐标", afterLabel: "WGS84", coorKey: "bd09ToWgs84", id: node.data.layerType + 4, leaf: true, },
  603. { label: 'WGS84 转 上海2000', type: 2, layerType: "coordinate", beforeLabel: "WGS84", afterLabel: "上海2000", coorKey: "wgs84ToSh2000", id: node.data.layerType + 5, leaf: true, },
  604. { label: '上海2000 转 WGS84', type: 2, layerType: "coordinate", beforeLabel: "上海2000", afterLabel: "WGS84", coorKey: "sh2000ToWgs84", id: node.data.layerType + 6, leaf: true, },
  605. { label: 'WGS84 转 上海2000投影', type: 2, layerType: "coordinate", beforeLabel: "WGS84", afterLabel: "上海2000投影", coorKey: "wgs84ToSh2000xy", id: node.data.layerType + 7, leaf: true, },
  606. { label: '上海2000投影 转 WGS84', type: 2, layerType: "coordinate", beforeLabel: "上海2000投影", afterLabel: "WGS84", coorKey: "sh2000xyToWgs84", id: node.data.layerType + 8, leaf: true, },
  607. ]);
  608. }
  609. else {
  610. if (node.data.type == 0) {
  611. $.ajax({
  612. type: "POST",
  613. headers: {
  614. token: localStorage.getItem("systemToken"),
  615. },
  616. data: {
  617. id: node.data.id,
  618. },
  619. dataType: "json",
  620. url: onemapUrlConfig.DMS_URL + '/dms/column/selectChild',
  621. success: function (result) {
  622. if (result.code == 200) {
  623. const list = result.content.map(function (item) {
  624. item.label = item.title;
  625. item.layerType = node.data.layerType;
  626. return item
  627. })
  628. resolve(list);
  629. } else {
  630. return resolve([{ label: '暂无数据', leaf: true }]);
  631. }
  632. },
  633. error: function (result) {
  634. console.log(result);
  635. }
  636. })
  637. }
  638. if (node.data.type == 1) {
  639. $.ajax({
  640. type: "POST",
  641. headers: {
  642. token: localStorage.getItem("systemToken"),
  643. },
  644. data: {
  645. columnId: node.data.id,
  646. states: "1,2,3",
  647. pageSize: 1000,
  648. page: 0,
  649. },
  650. dataType: "json",
  651. url: onemapUrlConfig.DMS_URL + '/dms/content/selectContentList',
  652. success: function (result) {
  653. if (result.code == 200) {
  654. const list = result.content.data.map(function (item) {
  655. item.label = item.title;
  656. item.layerType = node.data.layerType;
  657. item.leaf = true
  658. return item
  659. })
  660. resolve(list);
  661. } else {
  662. return resolve([{ label: '暂无数据', leaf: true }]);
  663. }
  664. },
  665. error: function (result) {
  666. console.log(result);
  667. }
  668. })
  669. }
  670. if (node.data.type == 2) {
  671. }
  672. }
  673. },
  674. },
  675. watch: {
  676. keyWord(newVal, oldVal) {
  677. this.$refs.menuTree.filter(newVal)
  678. // if (newVal == "") this.foldTree()
  679. if (newVal == "") this.$refs.menuTree.store._getAllNodes().forEach(v => v.expanded = false);
  680. }
  681. }
  682. })
  683. return ONEMAP.M.menuVue = {
  684. vueObj: app
  685. }
  686. });