ComprehensiveAnalysis.vue 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518
  1. <template>
  2. <div
  3. class="comprehensive-analysis"
  4. v-loading="layerLoading"
  5. element-loading-text="拼命加载中"
  6. element-loading-spinner="el-icon-loading"
  7. element-loading-background="rgba(0, 0, 0, 0.8)"
  8. >
  9. <BasemapChange style="pointer-events: auto" />
  10. <LawPopup class="comprehensive-analysis-law-popup" />
  11. <LabelCasePopup
  12. class="comprehensive-analysis-label-popup"
  13. style="left: 40%"
  14. v-if="updateCasePopupShow"
  15. ref="updateLabelRef"
  16. @close="closeLabelEvent"
  17. @save="modifyLabelEvent"
  18. />
  19. <div
  20. class="comprehensive-analysis-backbtn"
  21. @click="backEvent"
  22. v-if="$store.state.backMenu.index && $store.state.backMenu.subIndex"
  23. >
  24. <div class="left-arrow"></div>
  25. <div class="title">返回上级</div>
  26. </div>
  27. <div class="comprehensive-analysis-searchbox">
  28. <el-input placeholder="请输入地名地址" v-model="addressInput">
  29. <el-button
  30. type="primary"
  31. slot="append"
  32. icon="el-icon-search"
  33. style="vertical-align: bottom"
  34. ></el-button>
  35. </el-input>
  36. </div>
  37. <div class="comprehensive-analysis-infobox">
  38. 当前显示的疑点数 : &nbsp;<span>{{ currentTotal }}</span>
  39. </div>
  40. <div class="comprehensive-analysis-leftjuanlianInfo" v-show="showJLInfo">
  41. sat2019-s1
  42. </div>
  43. <div class="comprehensive-analysis-rightjuanlianInfo" v-show="showJLInfo">
  44. sat2022-s1
  45. </div>
  46. <!-- 属性弹窗 -->
  47. <AttributePopup
  48. class="comprehensive-analysis-popup"
  49. v-if="attrTableShow"
  50. :boxWidth="boxWidth"
  51. :boxHeight="boxHeight"
  52. :tableType="tableType"
  53. :tableData="tableData"
  54. @close="closeEvent"
  55. />
  56. <!-- 图例 -->
  57. <Legend
  58. v-show="legendShow"
  59. class="comprehensive-analysis-legendbox"
  60. :legendData="{
  61. boxWidth: '230',
  62. boxHeight: legendHeight,
  63. menuIndex: '3',
  64. legendIcon: legendIcon,
  65. legendTitle: legendTitle,
  66. leftWidth: '30%',
  67. rightWidth: '70%',
  68. rightItemWidth: '120',
  69. }"
  70. />
  71. <!-- 开启左边面板的控制按钮 -->
  72. <div class="comprehensive-analysis-leftopenbox" v-show="leftBoxBtn">
  73. <div @click="leftPanelDisplay('show')"><div></div></div>
  74. </div>
  75. <!-- 开启右边面板的控制按钮 -->
  76. <div class="comprehensive-analysis-rightopenbox" v-show="rightBoxBtn">
  77. <div @click="rightPanelDisplay('show')"><div></div></div>
  78. </div>
  79. <!-- 左侧面板的显示与隐藏 -->
  80. <transition name="fade-left">
  81. <div class="comprehensive-analysis-left" v-show="showLeftBox">
  82. <div class="close-btnbox">
  83. <div @click="leftPanelDisplay('hide')"><div></div></div>
  84. </div>
  85. <div class="control-container">
  86. <el-input
  87. class="control-container-input"
  88. v-model="filterText"
  89. placeholder="请输入搜索内容"
  90. ></el-input>
  91. <NewSelect
  92. class="control-container-select"
  93. :placeholder="'请选择街镇'"
  94. v-model="townSelectVal"
  95. :options="townOptions"
  96. :value="townSelectVal"
  97. @selectEvent="changeTownEvent"
  98. />
  99. <el-tooltip
  100. effect="light"
  101. :content="isLeftLock ? '解锁面板' : '锁定面板'"
  102. placement="bottom-end"
  103. >
  104. <div
  105. :class="{ 'lock-style': isLeftLock }"
  106. class="control-container-pin-btn"
  107. @click="leftPanelLock"
  108. ></div>
  109. </el-tooltip>
  110. </div>
  111. <div class="contant-container">
  112. <div class="contant-container-innerbox">
  113. <el-tree
  114. :data="modelData"
  115. :props="defaultProps"
  116. @check-change="handleCheckChange"
  117. node-key="id"
  118. ref="tree"
  119. :filter-node-method="filterNode"
  120. :default-expanded-keys="expandedKeys"
  121. >
  122. <span class="custom-tree-node" slot-scope="{ node }">
  123. <template
  124. v-if="
  125. node.data.mainType === '所有图层' ||
  126. node.data.mainType === '我的模型' ||
  127. node.data.mainType === '预设模型' ||
  128. node.data.mainType === '疑点问题' ||
  129. node.data.mainType === '我的图层'
  130. "
  131. >
  132. <el-checkbox
  133. v-model="node.checked"
  134. style="position: relative; width: 100%"
  135. >
  136. <el-tooltip
  137. class="item"
  138. effect="light"
  139. :content="node.label"
  140. placement="top-start"
  141. >
  142. <div class="custom-tree-node-item">
  143. {{ node.label }}
  144. </div>
  145. </el-tooltip>
  146. <span
  147. ><el-button
  148. size="normal"
  149. type="text"
  150. icon="el-icon-location"
  151. @click="locateEvent(node)"
  152. style="position: absolute; right: -30px; top: -12px"
  153. ></el-button
  154. ></span>
  155. <span style="position: absolute; right: -80px; top: -9px">
  156. <el-button
  157. v-if="node.parent.label === '我的模型'"
  158. size="small"
  159. type="text"
  160. icon="el-icon-edit"
  161. @click="handleUpdate(node)"
  162. ></el-button>
  163. <el-button
  164. v-if="node.parent.label === '我的模型'"
  165. size="small"
  166. type="text"
  167. icon="el-icon-delete"
  168. @click="handleDelete(node)"
  169. ></el-button>
  170. </span>
  171. </el-checkbox>
  172. </template>
  173. <template v-else>
  174. <div
  175. :class="{
  176. 'tree-arrow': !node.expanded,
  177. 'tree-arrow-expanded': node.expanded,
  178. }"
  179. ></div>
  180. <span>{{ node.label }}</span>
  181. </template>
  182. </span>
  183. </el-tree>
  184. </div>
  185. </div>
  186. </div>
  187. </transition>
  188. <!-- 右侧面板的显示与隐藏 -->
  189. <transition name="fade-right">
  190. <div class="comprehensive-analysis-right" v-show="showRightBox">
  191. <div class="close-btnbox">
  192. <div @click="rightPanelDisplay('hide')"><div></div></div>
  193. </div>
  194. <div class="control-container">
  195. <el-tooltip
  196. effect="light"
  197. :content="isRightLock ? '解锁面板' : '锁定面板'"
  198. placement="bottom-start"
  199. >
  200. <div
  201. :class="{ 'lock-style': isRightLock }"
  202. @click="rightPanelLock"
  203. ></div>
  204. </el-tooltip>
  205. </div>
  206. <div class="contant-container">
  207. <div class="contant-container-innerbox">
  208. <el-collapse v-model="activeNames">
  209. <el-collapse-item
  210. v-for="key in Object.keys(originalData)"
  211. :key="key"
  212. :title="key"
  213. :name="key"
  214. >
  215. <div
  216. class="panel-list-item"
  217. v-for="(v, i) in originalData[key]"
  218. :key="v.id"
  219. >
  220. <div>
  221. {{
  222. v.title +
  223. "_" +
  224. ((paginationData.currentPage - 1) * currentPageSize +
  225. (i + 1))
  226. }}
  227. </div>
  228. <span class="normal-icon">
  229. <el-button
  230. size="normal"
  231. type="text"
  232. icon="el-icon-location"
  233. @click.stop="locateCase(v)"
  234. ></el-button
  235. ><el-button
  236. size="normal"
  237. type="text"
  238. icon="el-icon-more"
  239. @click.stop="listItemClick('default', v)"
  240. ></el-button>
  241. </span>
  242. <!-- {{ v.column_name + "_" + (i + 1) }} -->
  243. </div>
  244. <div class="panel-footer" @mouseenter="mouseenter(key)">
  245. <Pagination :paginationData="paginationData" />
  246. </div>
  247. </el-collapse-item>
  248. <el-collapse-item name="myLabel">
  249. <template slot="title">
  250. 我的标记
  251. <div class="all-icon">
  252. <div
  253. class="all-icon-locate"
  254. @click.stop="labelAllLocate"
  255. ></div>
  256. <div
  257. class="all-icon-visible"
  258. :class="{ click: labelAllVisibleChecked }"
  259. @click.stop="labelAllVisible"
  260. ></div>
  261. </div>
  262. </template>
  263. <div
  264. class="panel-list-item"
  265. v-for="(item, index) in rightLabelData"
  266. :key="item.id"
  267. >
  268. <div @click="listItemClick('new', item)">
  269. {{ item.name ? item.name : `疑点${index}` }}
  270. </div>
  271. <span class="operation-icon"
  272. ><el-button
  273. size="normal"
  274. type="text"
  275. icon="el-icon-edit"
  276. @click="updateLabel(item)"
  277. ></el-button
  278. ><el-button
  279. size="normal"
  280. type="text"
  281. icon="el-icon-delete"
  282. @click="deleteLabel(item.id)"
  283. ></el-button
  284. ></span>
  285. <span
  286. class="visible-icon"
  287. :class="{ click: item.geometryChecked }"
  288. @click="controlLabel(item)"
  289. ></span>
  290. </div>
  291. </el-collapse-item>
  292. </el-collapse>
  293. </div>
  294. </div>
  295. </div>
  296. </transition>
  297. </div>
  298. </template>
  299. <script>
  300. // 综合分析 this.$store.state.leftMenuTitle
  301. import MenuCard from "@/components/layout/MenuCard.vue";
  302. import Legend from "@/components/map/Legend.vue";
  303. import Pagination from "@/components/common/Pagination.vue";
  304. import NewSelect from "@/components/common/NewSelect.vue";
  305. import publicFun from "@/utils/publicFunction.js";
  306. import AttributePopup from "@/components/popup/AttributePopup.vue";
  307. import LabelCasePopup from "@/components/popup/LabelCasePopup.vue";
  308. import LawPopup from "@/components/popup/LawPopup.vue";
  309. import BasemapChange from "@/components/map/BasemapChange.vue";
  310. import { nextTick } from "vue";
  311. export default {
  312. name: "ComprehensiveAnalysis",
  313. components: {
  314. MenuCard,
  315. Legend,
  316. AttributePopup,
  317. LawPopup,
  318. LabelCasePopup,
  319. Pagination,
  320. NewSelect,
  321. BasemapChange,
  322. },
  323. data() {
  324. return {
  325. showJLInfo: false,
  326. // 存储图斑颜色
  327. collectColorMap: new Map(),
  328. targetLayerPage: {},
  329. targetLayerTotal: {},
  330. currentTotal: 0,
  331. layerLoading: false,
  332. expandedKeys: [],
  333. // 我的模型id集合
  334. myModelIdMap: new Map(),
  335. // 第一层数据集合
  336. firstLevelIdMap: new Map(),
  337. problemIdMap: new Map(),
  338. // 下拉框镇集合
  339. townSelectTreeMap: new Map(),
  340. // 所有图层 -- 根据镇域划分的数据集合
  341. allLayersByTownMap: new Map(),
  342. labelAllVisibleChecked: true,
  343. townSelectVal: "老港镇",
  344. townOptions: [],
  345. enteredPanelId: "",
  346. enteredColumnId: "",
  347. enteredMainType: "",
  348. enteredSourceType: "",
  349. uploadBaseUrl: "/dms",
  350. classTextToIndex: {},
  351. addressInput: "",
  352. legendShow: false,
  353. tableType: "normal",
  354. tableData: [],
  355. legendHeight: "0",
  356. boxWidth: "600",
  357. boxHeight: "400",
  358. activeNames: ["myLabel"],
  359. rightPanelTitle: "",
  360. rightPanelDataMap: new Map(),
  361. originalData: {},
  362. originalDataMap: new Map(),
  363. rightLabelData: [],
  364. showLeftBox: true,
  365. showRightBox: true,
  366. leftBoxBtn: false,
  367. rightBoxBtn: false,
  368. modelData: [],
  369. defaultProps: {
  370. children: "children",
  371. label: "label",
  372. },
  373. legendIcon: [],
  374. legendTitle: [],
  375. // 我的模型相关数据
  376. myModel: null,
  377. filterText: "",
  378. // 存放对应图层的坐标
  379. treeCoordMap: new Map(),
  380. layerIdMap: new Map(),
  381. isLeftLock: true,
  382. isRightLock: true,
  383. currentPage: 1,
  384. currentPageSize: 10,
  385. paginationData: {
  386. pageSize: 10,
  387. pagerCount: 5,
  388. currentPage: 1,
  389. pageSizes: [5, 10, 20, 30],
  390. total: 50,
  391. currentChange: (val) => {
  392. let columnId = this.enteredColumnId;
  393. let currentPageSize = this.currentPageSize;
  394. let panelId = this.enteredPanelId;
  395. let mainType = this.enteredMainType;
  396. let sourceType = this.enteredSourceType;
  397. this.changeSingleLayer(
  398. val,
  399. currentPageSize,
  400. columnId,
  401. panelId,
  402. mainType,
  403. sourceType
  404. );
  405. },
  406. handleSizeChange: (val) => {
  407. this.handleSizeChange(val);
  408. },
  409. },
  410. };
  411. },
  412. computed: {
  413. // 监听底部菜单栏的状态 -- 监听卷帘对比状态
  414. getJLStatus() {
  415. let _index = this.$store.state.bottomMenuIndexs.index;
  416. let _subIndex = this.$store.state.bottomMenuIndexs.subIndex;
  417. return this.$store.state.jlActiveState;
  418. },
  419. getCustomModel() {
  420. return this.$store.state.customModelsArr;
  421. },
  422. getLeftMenuTitle() {
  423. return this.$store.state.leftMenuTitle;
  424. },
  425. getMyLabelData() {
  426. return this.$store.getters.myLabelPointsArr;
  427. },
  428. getMyPoints() {
  429. return map2DViewer.myLabels;
  430. },
  431. attrTableShow: {
  432. get() {
  433. return this.$store.state.attrTableShow;
  434. },
  435. set(val) {
  436. this.$store.state.attrTableShow = val;
  437. },
  438. },
  439. updateCasePopupShow: {
  440. get() {
  441. return this.$store.state.updateCasePopupShow;
  442. },
  443. set(val) {
  444. this.$store.state.updateCasePopupShow = val;
  445. },
  446. },
  447. uploadDataArr() {
  448. return uploadDataIdArr;
  449. },
  450. },
  451. watch: {
  452. townSelectVal: {
  453. handler(val) {
  454. // console.log(val, "综合分析当前选中的值");
  455. },
  456. immediate: true,
  457. },
  458. // 监听底部菜单栏
  459. getJLStatus(val) {
  460. console.log("监听底部菜单栏 ----- 卷帘对比", val);
  461. if (val) {
  462. this.showJLInfo = true;
  463. } else {
  464. this.showJLInfo = false;
  465. }
  466. },
  467. // 控制全选的显示或隐藏
  468. labelAllVisibleChecked(val) {
  469. if (this.rightLabelData.length > 0) {
  470. this.rightLabelData.forEach((item) => {
  471. this.controlLabel(item);
  472. });
  473. if (val) {
  474. this.labelAllLocate();
  475. }
  476. }
  477. },
  478. "$store.state.navSelect": {
  479. handler(val, oldVal) {
  480. if (
  481. (val.index === "1" || val.index === "2") &&
  482. oldVal.index &&
  483. oldVal.index === "3"
  484. ) {
  485. // 不进入综合分析页面 -- 切换回暗黑地图
  486. if (!map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"])) {
  487. map2DViewer.map.hasLayer(map2DViewer.layers["imagery"]) &&
  488. map2DViewer.map.removeLayer(map2DViewer.layers["imagery"]);
  489. map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"]) &&
  490. map2DViewer.map.removeLayer(map2DViewer.layers["imagery2"]);
  491. map2DViewer.map.addLayer(map2DViewer.layers["darkmap"]);
  492. }
  493. this.clearAllData();
  494. this.labelAllVisibleChecked = false;
  495. }
  496. if (val.index === "3") {
  497. // 默认切换为最新航空影像图
  498. if (!map2DViewer.map.hasLayer(map2DViewer.layers["imagery"])) {
  499. map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"]) &&
  500. map2DViewer.map.removeLayer(map2DViewer.layers["darkmap"]);
  501. map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"]) &&
  502. map2DViewer.map.removeLayer(map2DViewer.layers["imagery2"]);
  503. map2DViewer.map.addLayer(map2DViewer.layers["imagery"]);
  504. }
  505. // console.log("进入综合分析页面 -- 默认展开老港镇数据");
  506. setTimeout(() => {
  507. this.changeTownEvent(this.townSelectVal);
  508. }, 1000);
  509. // 如果没有初始化设置
  510. if (!map2DViewer.groups["我的标记图层组"]) {
  511. this.getUserMarkers();
  512. this.activeNames = ["myLabel"];
  513. }
  514. this.labelAllVisibleChecked = true;
  515. // 进入该页面后监听地图移动事件
  516. map2DViewer.map.on("move", (e) => {
  517. if (!this.isLeftLock) {
  518. this.showLeftBox = false;
  519. this.leftBoxBtn = true;
  520. }
  521. if (!this.isRightLock) {
  522. this.showRightBox = false;
  523. this.rightBoxBtn = true;
  524. }
  525. });
  526. }
  527. },
  528. deep: true,
  529. },
  530. uploadDataArr: {
  531. handler(val) {
  532. if (val.length > 0) {
  533. // console.log(val, "uploadDataIdArr");
  534. }
  535. },
  536. immediate: true,
  537. deep: true,
  538. },
  539. getLeftMenuTitle: {
  540. handler(val) {
  541. this.$nextTick(() => {
  542. // 从疑点筛查进入综合分析页面默认勾选
  543. if (defaultModelNameMap.has(val)) {
  544. setTimeout(() => {
  545. this.expandedKeys.push(defaultModelNameMap.get(val));
  546. // 设置默认勾选项
  547. this.$refs.tree.setCheckedKeys([defaultModelNameMap.get(val)]);
  548. this.$refs.tree.setCurrentKey(defaultModelNameMap.get(val));
  549. let nodeData = this.$refs.tree.getCurrentNode();
  550. this.handleCheckChange(nodeData, true);
  551. }, 1000);
  552. }
  553. });
  554. },
  555. immediate: true,
  556. },
  557. legendTitle(val) {
  558. // console.log(val, "监听当前图例item数量");
  559. if (val.length === 0) {
  560. this.legendShow = false;
  561. }
  562. if (val.length > 0 && val.length <= 10) {
  563. this.legendShow = true;
  564. this.legendHeight = 50 * val.length + 50 + "";
  565. }
  566. },
  567. filterText(val) {
  568. this.$refs.tree.filter(val);
  569. },
  570. getCustomModel: {
  571. handler(val) {
  572. // console.log(val, "目前存在的自定义模型");
  573. this.getMyModelData();
  574. },
  575. deep: true,
  576. },
  577. getMyLabelData: {
  578. handler(val) {
  579. // console.log("标记点保存事件成功,允许开始定位");
  580. this.rightLabelData = [];
  581. if (val.length > 0) {
  582. let _myLabelPointsItem = {};
  583. let _myLabelPointsItemState = false;
  584. this.rightLabelData = val.map((v, i) => {
  585. let data = JSON.parse(v.geojson);
  586. if (
  587. sessionStorage.getItem("myLabelPointsId") &&
  588. sessionStorage.getItem("myLabelPointsId") == v.id
  589. ) {
  590. sessionStorage.removeItem("myLabelPointsId");
  591. _myLabelPointsItemState = true;
  592. _myLabelPointsItem = {
  593. id: v.id,
  594. name: data.properties.name,
  595. coord: data.geometry.coordinates[0][0],
  596. type: data.properties.title,
  597. des: data.properties.desc,
  598. geojson: v.geojson,
  599. geometryChecked: false,
  600. featureType: data.properties.featureType,
  601. };
  602. return _myLabelPointsItem;
  603. }
  604. return {
  605. id: v.id,
  606. name: data.properties.name,
  607. coord: data.geometry.coordinates[0][0],
  608. type: data.properties.title,
  609. des: data.properties.desc,
  610. geojson: v.geojson,
  611. geometryChecked: false,
  612. featureType: data.properties.featureType,
  613. };
  614. });
  615. if (_myLabelPointsItemState) {
  616. setTimeout(() => {
  617. this.controlLabel(_myLabelPointsItem);
  618. if (map2DViewer.groups["我的标记图层组"]) {
  619. map2DViewer.map.fitBounds(
  620. map2DViewer.groups["我的标记图层组"].getBounds()
  621. );
  622. }
  623. }, 300);
  624. } else {
  625. setTimeout(() => {
  626. if (this.rightLabelData.length > 0) {
  627. this.rightLabelData.forEach((item) => {
  628. this.controlLabel(item);
  629. });
  630. if (map2DViewer.groups["我的标记图层组"]) {
  631. map2DViewer.map.fitBounds(
  632. map2DViewer.groups["我的标记图层组"].getBounds()
  633. );
  634. }
  635. }
  636. }, 300);
  637. }
  638. // console.log(this.rightLabelData, "rightLabelData");
  639. }
  640. },
  641. deep: true,
  642. // immediate: true,
  643. },
  644. },
  645. created() {
  646. this.townOptions = [];
  647. this.classDictQuery("0", "c_task_type", "任务类型");
  648. this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
  649. setTimeout(() => {
  650. this.getColumnList();
  651. }, 500);
  652. },
  653. mounted() {
  654. // 上传数据后更新我的图层节点
  655. this.$bus.$off("addUploadLayerEvent");
  656. this.$bus.$on("addUploadLayerEvent", (data) => {
  657. if (this.$refs.tree) {
  658. let children = [
  659. {
  660. id: data.id,
  661. label: data.label,
  662. mainType: "我的图层",
  663. children: [],
  664. },
  665. ];
  666. this.$refs.tree.updateKeyChildren(
  667. this.firstLevelIdMap.get("我的图层").id,
  668. children
  669. );
  670. this.expandedKeys.push(this.firstLevelIdMap.get("我的图层").id);
  671. this.$refs.tree.setCheckedKeys([data.id]);
  672. this.$refs.tree.setCurrentKey(data.id);
  673. let nodeData = this.$refs.tree.getCurrentNode();
  674. this.handleCheckChange(nodeData, true);
  675. }
  676. });
  677. this.$bus.$off("viewDetailsPopup");
  678. this.$bus.$on("viewDetailsPopup", (data) => {
  679. this.viewDetailsPopup(data);
  680. });
  681. // 我的任务页面,用户点击已审核的任务时:
  682. this.$bus.$off("openMyTask");
  683. this.$bus.$on("openMyTask", (data) => {
  684. console.log(
  685. `监听到用户点击任务!任务类型Code:${data[0]},所属街道Code:${data[1]}!`
  686. );
  687. this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
  688. if (v === data[1]) {
  689. // console.log(i, "当前所属街镇选中");
  690. this.townSelectVal = i;
  691. this.changeTownEvent(i);
  692. }
  693. });
  694. });
  695. // 全流程详细页面,用户点击整改中的某个数据时:
  696. this.$bus.$off("openMyView");
  697. this.$bus.$on("openMyView", (data) => {
  698. if (this.problemIdMap.has("疑点问题")) {
  699. console.log(
  700. this.problemIdMap.get("疑点问题"),
  701. "疑点问题 -- 老港全流程管理"
  702. );
  703. setTimeout(() => {
  704. console.log(
  705. `监听到用户点击全流程详细页面,用户点击整改中的某个数据时:!任务类型Code:${data[0]},所属街道Code:${data[1]}!`
  706. );
  707. this.expandedKeys.push(this.problemIdMap.get("疑点问题").id);
  708. this.$refs.tree.setCheckedKeys([
  709. this.problemIdMap.get("疑点问题").id,
  710. ]);
  711. this.$refs.tree.setCurrentKey(this.problemIdMap.get("疑点问题").id);
  712. let nodeData = this.$refs.tree.getCurrentNode();
  713. this.handleCheckChange(nodeData, true);
  714. }, 1000);
  715. }
  716. });
  717. },
  718. destroy() {
  719. // 当容器销毁时,需要停止监听该事件
  720. this.$bus.$off("viewDetailsPopup");
  721. this.$bus.$off("openMyTask");
  722. this.$bus.$off("openMyView");
  723. },
  724. methods: {
  725. // 勾选镇时默认展开当前镇
  726. changeTownEvent(val) {
  727. if (this.townSelectTreeMap.has(val)) {
  728. let children = [];
  729. let data = this.townSelectTreeMap.get(val).data;
  730. if (data.length > 0) {
  731. children = data.map((item1) => {
  732. return {
  733. id: `${item1.title}_${item1.id}`,
  734. label: item1.title,
  735. children:
  736. !item1.columnList || item1.columnList.length === 0
  737. ? []
  738. : item1.columnList.map((item2) => {
  739. this.rightPanelDataMap.set(`${item2.title}_${item2.id}`, {
  740. id: item2.id,
  741. mainType: "所有图层",
  742. sourceType: item1.title,
  743. });
  744. return {
  745. id: `${item2.title}_${item2.id}`,
  746. label: item2.title,
  747. columnId: item2.id,
  748. townId: this.townSelectTreeMap.get(val).id,
  749. townType: val,
  750. sourceId: item1.id,
  751. sourceType: item1.title,
  752. mainType: "所有图层",
  753. color: publicFun.getRGBColor(),
  754. children: [],
  755. };
  756. }),
  757. };
  758. });
  759. }
  760. if (this.$refs.tree) {
  761. this.$refs.tree.updateKeyChildren(
  762. this.firstLevelIdMap.get("所有图层").id,
  763. children
  764. );
  765. this.expandedKeys.push(this.firstLevelIdMap.get("所有图层").id);
  766. }
  767. }
  768. },
  769. // 清除页面所有数据
  770. clearAllData() {
  771. this.currentTotal = 0;
  772. this.paginationData.total = 0;
  773. this.targetLayerTotal = {};
  774. this.targetLayerPage = {};
  775. this.originalDataMap.clear();
  776. this.originalData = {};
  777. map2DViewer.map.off("move");
  778. // 所有图层或预设模型全部删除
  779. if (Object.getOwnPropertyNames(map2DViewer.analysisGroups).length > 0) {
  780. for (let group in map2DViewer.analysisGroups) {
  781. // 仅从地图上删除对应图层组
  782. this.$store.state.mapMethodsCollection
  783. .get("RENDER")
  784. .deleteGroupFromMap(group);
  785. }
  786. this.$refs.tree.setCheckedKeys([]);
  787. }
  788. // map2DViewer.analysisGroups = {};
  789. map2DViewer.polygons = {};
  790. this.attrTableShow = false;
  791. this.updateCasePopupShow = false;
  792. map2DViewer.map.closePopup();
  793. },
  794. // 右侧分页栏图斑定位
  795. locateCase(data) {
  796. console.log(data, "locateCase");
  797. if (map2DViewer.polygons[data.id]) {
  798. map2DViewer.map.fitBounds(map2DViewer.polygons[data.id].getBounds());
  799. }
  800. },
  801. labelAllLocate() {
  802. if (map2DViewer.groups["我的标记图层组"]) {
  803. map2DViewer.map.fitBounds(
  804. map2DViewer.groups["我的标记图层组"].getBounds()
  805. );
  806. }
  807. },
  808. labelAllVisible() {
  809. this.labelAllVisibleChecked = !this.labelAllVisibleChecked;
  810. },
  811. mouseenter(val) {
  812. if (this.rightPanelDataMap.has(val)) {
  813. // 方便获取
  814. this.enteredPanelId = val;
  815. this.enteredColumnId = this.rightPanelDataMap.get(val).id;
  816. this.enteredMainType = this.rightPanelDataMap.get(val).mainType;
  817. this.enteredSourceType = this.rightPanelDataMap.get(val).sourceType;
  818. }
  819. },
  820. handleSizeChange(val) {
  821. console.log(`每页 ${val} 条`);
  822. this.currentPageSize = val;
  823. this.changeSingleLayer(
  824. this.currentPage,
  825. this.currentPageSize,
  826. this.enteredColumnId,
  827. this.enteredPanelId,
  828. this.enteredMainType,
  829. this.enteredColumnId
  830. );
  831. },
  832. getMapData(uniqueId, columnId, mainType, sourceType) {
  833. let layerParams = new FormData();
  834. layerParams = {
  835. columnId: columnId,
  836. states: "0,1,2,3",
  837. pageSize: 500,
  838. page: this.targetLayerPage[uniqueId],
  839. };
  840. if (mainType === "预设模型") {
  841. let searchParam = [];
  842. let paramTown = {
  843. field: "c_xzqh",
  844. // 等值查询
  845. searchType: "1",
  846. content: {
  847. value: this.classTextToIndex["浦东新区行政区划"].get(
  848. this.townSelectVal || "老港镇"
  849. ),
  850. },
  851. };
  852. searchParam.push(paramTown);
  853. layerParams.search = JSON.stringify(searchParam);
  854. }
  855. this.$Post(this.urlsCollection.selectContentList, layerParams).then(
  856. (res) => {
  857. if (res.code === 202 && res.content === "数据不存在") {
  858. this.layerLoading = false;
  859. // 初始化请求 page为0时,提示无数据
  860. if (this.targetLayerPage[uniqueId] === 0) {
  861. this.$message.info("暂无数据!");
  862. }
  863. }
  864. if (res.code === 200) {
  865. this.layerLoading = false;
  866. }
  867. if (res.code === 200 && res.content.data.length > 0) {
  868. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  869. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  870. }
  871. // 存储请求到的疑点数据
  872. if (!this.originalDataMap.has(uniqueId)) {
  873. this.originalDataMap.set(uniqueId, res.content.data);
  874. } else {
  875. let arr = this.originalDataMap
  876. .get(uniqueId)
  877. .concat(res.content.data);
  878. this.originalDataMap.set(uniqueId, arr);
  879. }
  880. // 该图层疑点总数
  881. this.targetLayerTotal[uniqueId] = res.content.count;
  882. // 分页组件total
  883. this.paginationData.total =
  884. this.originalDataMap.get(uniqueId).length;
  885. // 当前图层id存在
  886. if (
  887. map2DViewer.analysisGroups[uniqueId] &&
  888. this.originalDataMap.get(uniqueId).length > 0 &&
  889. res.content.data.length > 0
  890. ) {
  891. // 统计所有图斑数
  892. this.currentTotal += res.content.data.length;
  893. // 请求到数据后直接渲染点
  894. res.content.data.forEach((ele) => {
  895. let cid = ele.id;
  896. let geometry = ele.c_content;
  897. this.$store.state.mapMethodsCollection
  898. .get("RENDER")
  899. .addSinglePolygon(
  900. geometry,
  901. cid,
  902. this.collectColorMap.get(this.collectColorMap.size - 1),
  903. uniqueId,
  904. mainType,
  905. sourceType
  906. );
  907. });
  908. // 所有数据均需要进行分页展示
  909. // 激活当前展开面板
  910. this.activeNames = ["myLabel", uniqueId];
  911. // 用于分页数据
  912. this.originalData[uniqueId] = this.originalDataMap
  913. .get(uniqueId)
  914. .map((ele) => {
  915. return {
  916. id: ele.id,
  917. // "垃圾堆放点"
  918. column_name: ele.column_name,
  919. // 是否疑点
  920. c_boolean: ele.c_boolean ? "是" : "否",
  921. // 行政区划
  922. c_xzqh: ele.c_xzqh,
  923. // 空间信息
  924. c_content: ele.c_content,
  925. // 疑点修改时间
  926. c_date_time: ele.c_date_time,
  927. // 修改人员名称
  928. // c_editor_name: ele.c_editor_name,
  929. // 标题
  930. title: ele.title,
  931. column_id: ele.column_id,
  932. content: ele.content,
  933. secret_level: ele.secret_level,
  934. };
  935. });
  936. // 进行分页列表展示
  937. this.changeSingleLayer(
  938. 1,
  939. this.currentPageSize,
  940. columnId,
  941. uniqueId,
  942. mainType,
  943. sourceType
  944. );
  945. // 当前图斑数小于数据库中的图斑总数时,递归请求图斑
  946. if (
  947. this.originalDataMap.get(uniqueId).length <=
  948. this.targetLayerTotal[uniqueId]
  949. ) {
  950. this.targetLayerPage[uniqueId]++;
  951. this.getMapData(uniqueId, columnId, mainType, sourceType);
  952. }
  953. }
  954. }
  955. },
  956. (error) => {
  957. this.layerLoading = false;
  958. if (this.targetLayerPage[uniqueId]) {
  959. this.$message.error("请求错误!");
  960. }
  961. }
  962. );
  963. },
  964. /**
  965. * 获取图层信息 -- 所有模型和预设模型
  966. * @columnId
  967. * @id label_columnId
  968. * @mainType 所有图层/预设模型
  969. * @sourceType 土地资源/林地资源/生态资源/水资源/全部
  970. */
  971. displaySingleLayer(columnId, id, mainType, sourceType) {
  972. let uniqueId = id;
  973. this.layerIdMap.set(uniqueId, uniqueId);
  974. // 图层未初始化
  975. if (!map2DViewer.analysisGroups[uniqueId]) {
  976. // 生成图例时设置初始图层颜色
  977. if (!this.collectColorMap.has(this.collectColorMap.size)) {
  978. let num = this.collectColorMap.size;
  979. this.collectColorMap.set(
  980. this.collectColorMap.size,
  981. `rgb(${targetColor[num][0]},${targetColor[num][1]},${targetColor[num][2]})`
  982. );
  983. console.log(this.collectColorMap, "图斑颜色设置");
  984. }
  985. // 图例
  986. this.legendTitle.push({
  987. name: uniqueId,
  988. info: uniqueId,
  989. });
  990. console.log(this.collectColorMap.get(this.collectColorMap.size - 1));
  991. this.legendIcon.push({
  992. name: uniqueId,
  993. background: "transparent",
  994. border: `1px solid ${this.collectColorMap.get(
  995. this.collectColorMap.size - 1
  996. )}`,
  997. });
  998. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  999. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1000. this.targetLayerPage[uniqueId] = 0;
  1001. if (!this.layerLoading && this.targetLayerPage[uniqueId] === 0) {
  1002. this.layerLoading = true;
  1003. }
  1004. this.getMapData(uniqueId, columnId, mainType, sourceType);
  1005. }
  1006. },
  1007. /**
  1008. * 切换页时改变图层数据
  1009. * @val 当前页
  1010. * @currentPageSize 当前面板pageSize
  1011. * @columnId
  1012. * @id label_columnId
  1013. * @mainType 所有图层/预设模型
  1014. * @sourceType 土地资源,水资源,林地资源,全部
  1015. */
  1016. changeSingleLayer(
  1017. val,
  1018. currentPageSize,
  1019. columnId,
  1020. id,
  1021. mainType,
  1022. sourceType
  1023. ) {
  1024. let uniqueId = id;
  1025. if (map2DViewer.analysisGroups[uniqueId]) {
  1026. this.paginationData.currentPage = val;
  1027. this.originalData[uniqueId] = [];
  1028. let oldData = this.originalDataMap.get(uniqueId);
  1029. this.originalData[uniqueId] = oldData.slice(
  1030. (val - 1) * currentPageSize,
  1031. val * currentPageSize
  1032. );
  1033. this.originalData[uniqueId] = this.originalData[uniqueId].map((ele) => {
  1034. return {
  1035. id: ele.id,
  1036. column_name: ele.column_name,
  1037. // 是否疑点
  1038. c_boolean: ele.c_boolean ? "是" : "否",
  1039. // 行政区划
  1040. c_xzqh: ele.c_xzqh,
  1041. // 空间信息
  1042. c_content: ele.c_content,
  1043. // 疑点修改时间
  1044. c_date_time: ele.c_date_time,
  1045. // 修改人员名称
  1046. // c_editor_name: ele.c_editor_name,
  1047. // 标题
  1048. title: ele.title,
  1049. column_id: ele.column_id,
  1050. content: ele.content,
  1051. secret_level: ele.secret_level,
  1052. };
  1053. });
  1054. // 激活当前展开面板
  1055. this.activeNames = ["myLabel", uniqueId];
  1056. }
  1057. },
  1058. // 数据字典查询 -- 根据内容获取对应的index
  1059. // this.classTextToIndex["任务类型"]
  1060. classDictQuery(type, cName, keyName) {
  1061. let params = new FormData();
  1062. params = {
  1063. type: type,
  1064. cName: cName,
  1065. };
  1066. this.$Post(this.urlsCollection.selectByCNameAType, params).then((res) => {
  1067. if (res.code === 200 && res.content.length > 0) {
  1068. this.classTextToIndex[keyName] = new Map();
  1069. res.content.forEach((v) => {
  1070. this.classTextToIndex[keyName].set(v.name, v.index + "");
  1071. });
  1072. }
  1073. });
  1074. },
  1075. // 获取分级栏目列表
  1076. getColumnList() {
  1077. this.modelData = [];
  1078. this.$Post(this.urlsCollection.getColumnList).then((res) => {
  1079. if (res.code === 200 && res.content.length > 0) {
  1080. let data = res.content.map((item1) => {
  1081. if (item1.title === "所有图层" && item1.columnList.length > 0) {
  1082. this.firstLevelIdMap.set(item1.title, {
  1083. id: `${item1.title}_${item1.id}`,
  1084. label: item1.title,
  1085. });
  1086. if (item1.columnList && item1.columnList.length > 0) {
  1087. item1.columnList.map((item2) => {
  1088. if (item2.columnList && item2.columnList.length > 0) {
  1089. //存储所有镇相关的数据
  1090. this.townSelectTreeMap.set(item2.title, {
  1091. id: item2.id,
  1092. data:
  1093. !item2.columnList || item2.columnList.length === 0
  1094. ? []
  1095. : item2.columnList,
  1096. });
  1097. }
  1098. });
  1099. }
  1100. return {
  1101. id: `${item1.title}_${item1.id}`,
  1102. label: item1.title,
  1103. children: [],
  1104. };
  1105. }
  1106. if (item1.title === "预设模型" && item1.columnList.length > 0) {
  1107. this.firstLevelIdMap.set(item1.title, {
  1108. id: `${item1.title}_${item1.id}`,
  1109. label: item1.title,
  1110. });
  1111. return {
  1112. id: `${item1.title}_${item1.id}`,
  1113. label: item1.title,
  1114. children:
  1115. !item1.columnList || item1.columnList.length === 0
  1116. ? []
  1117. : item1.columnList.map((item2) => {
  1118. return {
  1119. id: `${item2.title}_${item2.id}`,
  1120. label: item2.title,
  1121. children:
  1122. !item2.columnList || item2.columnList.length === 0
  1123. ? []
  1124. : item2.columnList.map((item3) => {
  1125. this.rightPanelDataMap.set(
  1126. `${item3.title}_${item3.id}`,
  1127. {
  1128. id: item3.id,
  1129. mainType: item1.title,
  1130. sourceType: item2.title,
  1131. }
  1132. );
  1133. defaultModelNameMap.set(
  1134. item3.title,
  1135. `${item3.title}_${item3.id}`
  1136. );
  1137. return {
  1138. id: `${item3.title}_${item3.id}`,
  1139. label: item3.title,
  1140. sourceType: item2.title,
  1141. mainType: item1.title,
  1142. columnId: item3.id,
  1143. children: [],
  1144. };
  1145. }),
  1146. };
  1147. }),
  1148. };
  1149. }
  1150. if (item1.title === "我的模型") {
  1151. this.firstLevelIdMap.set(item1.title, {
  1152. id: `${item1.title}_${item1.id}`,
  1153. label: item1.title,
  1154. });
  1155. this.myModelIdMap.set(
  1156. `${item1.title}_${item1.id}`,
  1157. `${item1.title}_${item1.id}`
  1158. );
  1159. return {
  1160. id: `${item1.title}_${item1.id}`,
  1161. children: [],
  1162. label: item1.title,
  1163. };
  1164. }
  1165. if (item1.title === "疑点问题" || item1.title === "我的图层") {
  1166. this.firstLevelIdMap.set(item1.title, {
  1167. id: `${item1.title}_${item1.id}`,
  1168. label: item1.title,
  1169. });
  1170. return {
  1171. id: `${item1.title}_${item1.id}`,
  1172. label: item1.title,
  1173. children:
  1174. !item1.columnList || item1.columnList.length === 0
  1175. ? []
  1176. : item1.columnList.map((item2) => {
  1177. // 疑点问题
  1178. this.problemIdMap.set(item1.title, {
  1179. id: `${item2.title}_${item2.id}`,
  1180. label: item2.title,
  1181. });
  1182. return {
  1183. id: `${item2.title}_${item2.id}`,
  1184. label: item2.title,
  1185. mainType: item1.title,
  1186. columnId: item2.id,
  1187. modelId: item2.modelId,
  1188. sourceType: "土地资源",
  1189. children: [],
  1190. };
  1191. }),
  1192. };
  1193. }
  1194. });
  1195. data.forEach((v) => {
  1196. if (v) {
  1197. this.modelData.push(v);
  1198. }
  1199. });
  1200. // 获取我的模型数据
  1201. let oldOptions = [];
  1202. this.getMyModelData();
  1203. this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
  1204. if (this.townSelectTreeMap.has(i)) {
  1205. oldOptions.push({
  1206. value: i,
  1207. label: i,
  1208. });
  1209. // this.townOptions.push({
  1210. // value: i,
  1211. // label: i,
  1212. // });
  1213. }
  1214. });
  1215. let arrDistrict = oldOptions.filter((v) => {
  1216. if (v.value.indexOf("区") > -1) {
  1217. return v;
  1218. }
  1219. });
  1220. let arrTown1 = oldOptions.filter((v) => {
  1221. if (v.value.indexOf("镇") > -1 && v.value === "老港镇") {
  1222. return v;
  1223. }
  1224. });
  1225. let arrTown2 = oldOptions.filter((v) => {
  1226. if (v.value.indexOf("镇") > -1 && v.value === "泥城镇") {
  1227. return v;
  1228. }
  1229. });
  1230. let arrTown3 = oldOptions.filter((v) => {
  1231. if (
  1232. v.value.indexOf("镇") > -1 &&
  1233. v.value !== "老港镇" &&
  1234. v.value !== "泥城镇"
  1235. ) {
  1236. return v;
  1237. }
  1238. });
  1239. let arrStreet = oldOptions.filter((v) => {
  1240. if (v.value.indexOf("道") > -1) {
  1241. return v;
  1242. }
  1243. });
  1244. this.townOptions = [
  1245. ...arrDistrict,
  1246. ...arrTown1,
  1247. ...arrTown2,
  1248. ...arrTown3,
  1249. ...arrStreet,
  1250. ];
  1251. }
  1252. });
  1253. },
  1254. getMyModelData() {
  1255. let params = new FormData();
  1256. params = {
  1257. columnId: 49,
  1258. states: "0,1,2,3",
  1259. pageSize: 10,
  1260. page: 0,
  1261. };
  1262. this.$Post(this.urlsCollection.selectContentList, params)
  1263. .then((res) => {
  1264. if (res.code === 200 && res.content.data.length > 0) {
  1265. let children = res.content.data.map((ele) => {
  1266. customModelIdMap.set(ele.title, {
  1267. column_id: ele.column_id,
  1268. id: ele.id,
  1269. });
  1270. return {
  1271. id: ele.id,
  1272. label: ele.title,
  1273. children: [],
  1274. column_id: ele.column_id,
  1275. model_name: ele.model_name,
  1276. model_id: ele.model_id,
  1277. state: ele.state,
  1278. mainType: "我的模型",
  1279. c_bind_layer: ele.c_bind_layer,
  1280. c_layer_name: ele.c_layer_name,
  1281. c_dzfx_file: ele.c_dzfx_file || "",
  1282. };
  1283. });
  1284. if (this.modelData.length > 0) {
  1285. if (this.$refs.tree) {
  1286. this.$refs.tree.updateKeyChildren(
  1287. this.firstLevelIdMap.get("我的模型").id,
  1288. children
  1289. );
  1290. }
  1291. // this.expandedKeys.push(this.firstLevelIdMap.get("我的模型").id);
  1292. // this.modelData.forEach((ele) => {
  1293. // if (ele.label == "我的模型") {
  1294. // ele.children = children;
  1295. // }
  1296. // });
  1297. }
  1298. }
  1299. })
  1300. .catch((err) => {
  1301. console.log(err, "getMyModelData");
  1302. });
  1303. },
  1304. // 调用我的标记接口
  1305. getUserMarkers() {
  1306. if (localStorage.getItem("USER_ID")) {
  1307. let paramData = new FormData();
  1308. paramData = {
  1309. userId: Number(localStorage.getItem("USER_ID")),
  1310. sourceId: 0,
  1311. pageSize: 10,
  1312. };
  1313. if (!map2DViewer.groups["我的标记图层组"]) {
  1314. map2DViewer.groups["我的标记图层组"] = L.featureGroup();
  1315. map2DViewer.groups["我的标记图层组"].addTo(map2DViewer.map);
  1316. }
  1317. this.$Post(this.urlsCollection.selectByUser, paramData).then((res) => {
  1318. if (res.code === 200 && res.content.length >= 1) {
  1319. this.$store.state.myLabelPointsArr = [];
  1320. this.$store.state.myLabelPointsArr = res.content.map((v) => {
  1321. let data = JSON.parse(v.geojson);
  1322. let name = data.properties.name;
  1323. myLabelNameMap.set(name, v.geojson);
  1324. return {
  1325. id: v.id,
  1326. geojson: v.geojson,
  1327. type: v.type,
  1328. };
  1329. });
  1330. }
  1331. // res.content 返回数据为空
  1332. if (res.code === 205) {
  1333. this.$store.state.myLabelPointsArr = [];
  1334. }
  1335. });
  1336. }
  1337. },
  1338. // 回退事件
  1339. backEvent() {
  1340. if (
  1341. this.$store.state.backMenu.index &&
  1342. this.$store.state.backMenu.subIndex
  1343. ) {
  1344. this.$store.commit("changeNavSelect", {
  1345. index: this.$store.state.backMenu.index,
  1346. subIndex: this.$store.state.backMenu.subIndex,
  1347. name: this.$store.state.backMenu.name
  1348. ? this.$store.state.backMenu.name
  1349. : "",
  1350. });
  1351. }
  1352. },
  1353. // 左侧面板的显示与隐藏
  1354. leftPanelDisplay(val) {
  1355. if (val === "show") {
  1356. this.showLeftBox = true;
  1357. this.leftBoxBtn = false;
  1358. }
  1359. if (val === "hide") {
  1360. this.showLeftBox = false;
  1361. this.leftBoxBtn = true;
  1362. }
  1363. },
  1364. // 右侧面板的显示与隐藏
  1365. rightPanelDisplay(val) {
  1366. if (val === "show") {
  1367. this.showRightBox = true;
  1368. this.rightBoxBtn = false;
  1369. }
  1370. if (val === "hide") {
  1371. this.showRightBox = false;
  1372. this.rightBoxBtn = true;
  1373. }
  1374. },
  1375. leftPanelLock() {
  1376. this.isLeftLock = !this.isLeftLock;
  1377. },
  1378. rightPanelLock() {
  1379. this.isRightLock = !this.isRightLock;
  1380. },
  1381. // 节点过滤事件
  1382. filterNode(value, data) {
  1383. if (!value) return true;
  1384. return data.label.indexOf(value) !== -1;
  1385. },
  1386. // 定位功能失效
  1387. locateEvent(node) {
  1388. // console.log(this.layerIdMap);
  1389. if (this.layerIdMap.has(node.data.id)) {
  1390. let layer = this.layerIdMap.get(node.data.id);
  1391. // console.log(layer, "layer");
  1392. map2DViewer.map.fitBounds(
  1393. map2DViewer.analysisGroups[node.data.id].getBounds()
  1394. );
  1395. }
  1396. },
  1397. handleUpdate(node) {
  1398. this.$bus.$emit("updateModel", node);
  1399. },
  1400. handleDelete(node) {
  1401. // debugger;
  1402. // console.log(node, "删除节点");
  1403. let deleteParams = {
  1404. id: customModelIdMap.get(node.data.label).id,
  1405. columnId: 49,
  1406. state: 4,
  1407. };
  1408. this.$Post(this.urlsCollection.updateAudit, deleteParams).then((res) => {
  1409. if (res.code === 200) {
  1410. this.$message.info("模型已删除!");
  1411. this.$store.state.customModelsArr =
  1412. this.$store.state.customModelsArr =
  1413. this.$store.state.customModelsArr.filter((v) => {
  1414. return v.name !== node.data.label;
  1415. });
  1416. // this.getMyModelData();
  1417. }
  1418. });
  1419. },
  1420. // 节点change事件
  1421. handleCheckChange(data, checked) {
  1422. if (data.mainType && data.mainType !== "我的模型") {
  1423. if (checked) {
  1424. this.showRightBox = true;
  1425. // 第一级菜单是所有图层
  1426. if (data.mainType === "所有图层") {
  1427. this.rightPanelTitle = data.id;
  1428. let searchParam = [];
  1429. let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
  1430. data.townType
  1431. );
  1432. let targetType = this.classTextToIndex["任务类型"].get(
  1433. data.sourceType
  1434. );
  1435. this.$store.state.treeDataCollection.set(data.id, {
  1436. // mainType: data.mainType,
  1437. townId: data.townId,
  1438. townType: data.townType,
  1439. sourceId: data.sourceId,
  1440. sourceType: data.sourceType,
  1441. layerId: data.id,
  1442. layerName: data.label,
  1443. });
  1444. let paramUser = {
  1445. field: "c_user_id",
  1446. searchType: "1",
  1447. content: {
  1448. value: localStorage.getItem("USER_ID"),
  1449. },
  1450. };
  1451. searchParam.push(paramUser);
  1452. let paramTown = {
  1453. field: "c_area_code",
  1454. searchType: "1",
  1455. content: {
  1456. value: targetTown,
  1457. },
  1458. };
  1459. searchParam.push(paramTown);
  1460. let paramType = {
  1461. field: "c_task_type",
  1462. searchType: "1",
  1463. content: {
  1464. value: targetType,
  1465. },
  1466. };
  1467. searchParam.push(paramType);
  1468. let params = new FormData();
  1469. params = {
  1470. columnId: 48,
  1471. states: "2,3",
  1472. pageSize: 10,
  1473. page: 0,
  1474. search: JSON.stringify(searchParam),
  1475. };
  1476. this.$Post(this.urlsCollection.selectContentList, params).then(
  1477. (res) => {
  1478. if (res.code === 202 && res.content === "数据不存在") {
  1479. this.$message.info("当前用户无权限!");
  1480. layerAuthorityMap.set(data.id, "无权限");
  1481. }
  1482. if (res.code === 200 && res.content.data.length > 0) {
  1483. layerAuthorityMap.set(data.id, "有权限");
  1484. this.displaySingleLayer(
  1485. data.columnId,
  1486. data.id,
  1487. data.mainType,
  1488. data.sourceType ? data.sourceType : ""
  1489. );
  1490. }
  1491. }
  1492. );
  1493. }
  1494. // 第一级菜单是预设模型
  1495. if (data.mainType === "预设模型") {
  1496. layerAuthorityMap.set(data.id, "有权限");
  1497. this.rightPanelTitle = data.id;
  1498. this.displaySingleLayer(
  1499. data.columnId,
  1500. data.id,
  1501. data.mainType,
  1502. data.sourceType ? data.sourceType : ""
  1503. );
  1504. }
  1505. // 第一级菜单是疑点问题
  1506. if (data.mainType === "疑点问题") {
  1507. layerAuthorityMap.set(data.id, "有权限");
  1508. this.rightPanelTitle = data.id;
  1509. this.displaySingleLayer(
  1510. data.columnId,
  1511. data.id,
  1512. data.mainType,
  1513. data.sourceType ? data.sourceType : ""
  1514. );
  1515. }
  1516. } else {
  1517. if (
  1518. this.$store.state.selectSelectDataMap["singlePolygon"] &&
  1519. this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
  1520. ) {
  1521. delete this.$store.state.selectSelectDataMap["singlePolygon"][
  1522. data.id
  1523. ];
  1524. }
  1525. // 取消勾选当前图层勾选,图斑数改变, 如果是所有图层数据移除折叠面板
  1526. if (
  1527. this.originalDataMap &&
  1528. this.originalDataMap.has(data.id) &&
  1529. this.currentTotal > 0
  1530. ) {
  1531. this.currentTotal -= this.originalDataMap.get(data.id).length;
  1532. this.originalDataMap.delete(data.id);
  1533. if (
  1534. // data.mainType === "所有图层" &&
  1535. this.originalData &&
  1536. this.originalData[data.id]
  1537. ) {
  1538. delete this.originalData[data.id];
  1539. }
  1540. }
  1541. // 统计后小于0改为0
  1542. if (this.currentTotal < 0) {
  1543. this.currentTotal = 0;
  1544. }
  1545. map2DViewer.map.closePopup();
  1546. // 移除图例
  1547. if (this.legendTitle.length > 0) {
  1548. this.collectColorMap.delete(this.collectColorMap.size - 1);
  1549. this.legendTitle = this.legendTitle.filter((v) => {
  1550. return v.name !== data.id;
  1551. });
  1552. this.legendIcon = this.legendIcon.filter((v) => {
  1553. return v.name !== data.id;
  1554. });
  1555. }
  1556. this.layerIdMap.has(data.id) && this.layerIdMap.delete(data.id);
  1557. //关联自定义模型
  1558. this.$store.state.treeDataCollection.has(data.id) &&
  1559. this.$store.state.treeDataCollection.delete(data.id);
  1560. // 只激活我的标记
  1561. this.activeNames = ["myLabel"];
  1562. this.$store.state.mapMethodsCollection
  1563. .get("RENDER")
  1564. .deleteGroupFromMap(data.id);
  1565. // 移除图层id
  1566. if (map2DViewer.analysisGroups[data.id]) {
  1567. delete this.targetLayerTotal[data.id];
  1568. delete map2DViewer.analysisGroups[data.id];
  1569. }
  1570. }
  1571. }
  1572. // 第一级菜单是我的模型
  1573. if (data.mainType && data.mainType === "我的模型") {
  1574. // 显示叠置分析的数据
  1575. checked ? this.displayMyModelData(data) : this.deleteMyModelData(data);
  1576. }
  1577. },
  1578. // 显示我的模型数据
  1579. displayMyModelData(data) {
  1580. this.$nextTick(() => {
  1581. if (this.$refs.tree) {
  1582. this.$refs.tree.setCheckedKeys([data.id]);
  1583. }
  1584. });
  1585. let uniqueId = data.id;
  1586. // 我的模型图层组初始化
  1587. if (!map2DViewer.analysisGroups[uniqueId]) {
  1588. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  1589. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1590. this.layerIdMap.set(uniqueId, uniqueId);
  1591. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  1592. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  1593. }
  1594. // 如果有叠置分析文件 -- 呈现叠置分析内容
  1595. if (data.c_dzfx_file) {
  1596. this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
  1597. (response) => {
  1598. if (response.features.length > 0) {
  1599. console.log("请求到的叠置分析的数据");
  1600. console.log(response.features);
  1601. if (map2DViewer.analysisGroups[uniqueId]) {
  1602. // 清除当前图层组内所有图层,并读取GeoJSON数据
  1603. map2DViewer.analysisGroups[uniqueId].clearLayers();
  1604. response.features.forEach((v) => {
  1605. let geojson = publicFun.standardGeojson(
  1606. v.geometry.coordinates
  1607. );
  1608. // 读取Geojson中的数据
  1609. // this.$store.state.mapMethodsCollection
  1610. // .get("RENDER")
  1611. // .addSinglePolygon(
  1612. // geometry,
  1613. // cid,
  1614. // "#ff0",
  1615. // uniqueId,
  1616. // data.mainType,
  1617. // ""
  1618. // );
  1619. //等叠置分析有结果后再进行调试
  1620. // console.log(geojson, "geojson")
  1621. // this.readGeojson(geojson, data.id);
  1622. });
  1623. }
  1624. }
  1625. }
  1626. );
  1627. } else {
  1628. let params = new FormData();
  1629. params = {
  1630. modelId: data.id,
  1631. userId: localStorage.getItem("USER_ID"),
  1632. };
  1633. // 调用我的模型查看接口读取所有图层数据
  1634. this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
  1635. (res) => {
  1636. if (res.code === 201 && res.message === "未申请任务权限") {
  1637. this.$message.info("暂无数据!");
  1638. }
  1639. if (res.code === 200 && res.content.length > 0) {
  1640. // console.log(res.content, "查看我的模型图层数据");
  1641. // 清除当前图层组内所有图层,并读取GeoJSON数据
  1642. map2DViewer.analysisGroups[uniqueId].clearLayers();
  1643. // 判断能用的数据
  1644. // 根据column_name或 column_id判断有几个图层
  1645. res.content.forEach((ele, index) => {
  1646. let cid = ele.id;
  1647. let geometry = ele.c_content;
  1648. this.$store.state.mapMethodsCollection
  1649. .get("RENDER")
  1650. .addSinglePolygon(
  1651. geometry,
  1652. cid,
  1653. "#ff0",
  1654. uniqueId,
  1655. data.mainType,
  1656. ""
  1657. );
  1658. });
  1659. }
  1660. }
  1661. );
  1662. }
  1663. }
  1664. // if (map2DViewer.analysisGroups[uniqueId]) {
  1665. // // 直接显示移除掉的图层
  1666. // map2DViewer.map.addLayer(map2DViewer.analysisGroups[uniqueId]);
  1667. // }
  1668. },
  1669. readGeojson(geojson, uniqueId) {
  1670. // debugger;
  1671. // 尽量与所有图层,预设模型读取几何数据的方式一样,
  1672. // let states = [];
  1673. // states.push(geojson);
  1674. // let geojsonData = L.geoJSON(states, {
  1675. // style: function (feature) {
  1676. // // console.log(feature);
  1677. // },
  1678. // }).addTo(map2DViewer.map);
  1679. // map2DViewer.analysisGroups[uniqueId] = geojsonData;
  1680. },
  1681. deleteMyModelData(data) {
  1682. // 直接删除图层组中的数据
  1683. if (map2DViewer.analysisGroups[data.id]) {
  1684. map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
  1685. }
  1686. // 如果有叠置分析文件,删除叠置分析图层
  1687. // if (data.c_dzfx_file) {
  1688. // if (map2DViewer.analysisGroups[data.id]) {
  1689. // map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
  1690. // }
  1691. // } else {
  1692. // // 删除绘制的图层数据
  1693. // }
  1694. },
  1695. //显示详细信息
  1696. viewDetailsPopup(data) {
  1697. this.$store.state.bottomMenuIndexs.index = -1;
  1698. this.$store.state.bottomMenuIndexs.subIndex = -1;
  1699. this.updateCasePopupShow = false;
  1700. this.tableType = "normal";
  1701. this.boxWidth = "600";
  1702. this.boxHeight = "600";
  1703. this.tableData = [];
  1704. let obj = JSON.parse(data).properties;
  1705. this.tableData.push(obj);
  1706. this.attrTableShow = true;
  1707. },
  1708. // 右侧面板项点击事件
  1709. listItemClick(type, data) {
  1710. this.$store.state.bottomMenuIndexs.index = -1;
  1711. this.$store.state.bottomMenuIndexs.subIndex = -1;
  1712. this.updateCasePopupShow = false;
  1713. this.tableData = [];
  1714. if (type === "default") {
  1715. this.tableType = "normal";
  1716. this.boxWidth = "600";
  1717. this.boxHeight = "600";
  1718. if (data.c_content) {
  1719. let obj = JSON.parse(data.c_content).properties;
  1720. console.log(obj);
  1721. this.tableData.push(obj);
  1722. }
  1723. }
  1724. if (type === "new") {
  1725. this.rightLabelData.forEach((item) => {
  1726. if (item.id == data.id) {
  1727. item.geometryChecked = false;
  1728. this.controlLabel(item);
  1729. }
  1730. });
  1731. if (data.featureType === "点") {
  1732. this.$store.state.mapMethodsCollection
  1733. .get("RENDER")
  1734. .setView(data.coord, 6);
  1735. } else {
  1736. map2DViewer.map.fitBounds(
  1737. map2DViewer.myLabels[`label_${data.id}`].getBounds()
  1738. );
  1739. }
  1740. let geoType = JSON.parse(data.geojson).properties.featureType;
  1741. this.$store.state.mapMethodsCollection
  1742. .get("RENDER")
  1743. .drawGeometry(geoType, data);
  1744. this.tableType = "personal";
  1745. this.boxWidth = "300";
  1746. this.boxHeight = "300";
  1747. this.tableData.push({
  1748. 名称: data.name,
  1749. 类别: data.type,
  1750. 描述: data.des,
  1751. });
  1752. }
  1753. this.attrTableShow = true;
  1754. },
  1755. closeEvent() {
  1756. this.attrTableShow = false;
  1757. },
  1758. // 关闭修改标记弹窗
  1759. closeLabelEvent() {
  1760. this.updateCasePopupShow = false;
  1761. },
  1762. modifyLabelEvent() {
  1763. this.$nextTick(() => {
  1764. let selectType = this.$refs.updateLabelRef.selectVal;
  1765. let desContent = this.$refs.updateLabelRef.textContent;
  1766. let currentNameInput = this.$refs.updateLabelRef.nameInput;
  1767. let geojson = JSON.parse(this.$refs.updateLabelRef.geojson);
  1768. let geometryType = geojson.properties.featureTypeIndex;
  1769. if (
  1770. myLabelNameMap.has(currentNameInput) &&
  1771. currentNameInput !== geojson.properties.name
  1772. ) {
  1773. this.$message.info("该名称已存在,请重新输入!");
  1774. } else {
  1775. let id = this.$refs.updateLabelRef.id;
  1776. let params = new FormData();
  1777. let nameInput = this.$refs.updateLabelRef.nameInput;
  1778. // 修改标题和描述
  1779. geojson.properties.title = selectType;
  1780. geojson.properties.desc = desContent;
  1781. geojson.properties.name = nameInput;
  1782. console.log(geojson, "修改后的geojson数据");
  1783. params = {
  1784. userId: Number(localStorage.getItem("USER_ID")),
  1785. sourceId: 0,
  1786. type: geometryType,
  1787. geojson: JSON.stringify(geojson),
  1788. id: id,
  1789. };
  1790. this.$Post(this.urlsCollection.updateConllection, params).then(
  1791. (res) => {
  1792. if (res.code === 200) {
  1793. // console.log("修改成功", res);
  1794. this.updateCasePopupShow = false;
  1795. this.getUserMarkers();
  1796. this.$message.success("修改成功!");
  1797. }
  1798. },
  1799. (error) => {
  1800. this.$message.error("保存失败");
  1801. console.log(error);
  1802. }
  1803. );
  1804. }
  1805. });
  1806. },
  1807. // 修改标记 -- 仅支持修改类型和描述
  1808. updateLabel(val) {
  1809. // console.log("修改标记", val);
  1810. this.$store.state.bottomMenuIndexs.index = -1;
  1811. this.$store.state.bottomMenuIndexs.subIndex = -1;
  1812. this.updateCasePopupShow = true;
  1813. this.attrTableShow = false;
  1814. if (this.updateCasePopupShow) {
  1815. this.$nextTick(() => {
  1816. this.$refs.updateLabelRef.menuData.title = "修改标记";
  1817. this.$refs.updateLabelRef.nameInput = val.name;
  1818. this.$refs.updateLabelRef.selectVal = val.type;
  1819. this.$refs.updateLabelRef.textContent = val.des;
  1820. this.$refs.updateLabelRef.id = val.id;
  1821. this.$refs.updateLabelRef.geojson = val.geojson;
  1822. });
  1823. }
  1824. },
  1825. // 删除标记
  1826. deleteLabel(id) {
  1827. if (localStorage.getItem("USER_ID")) {
  1828. // console.log("删除标记");
  1829. let params = new FormData();
  1830. this.$store.state.mapMethodsCollection
  1831. .get("RENDER")
  1832. .deleteGeometry(map2DViewer.myLabels[`label_${id}`]);
  1833. map2DViewer.myLabels[`label_${id}`] = null;
  1834. params = {
  1835. userId: Number(localStorage.getItem("USER_ID")),
  1836. sourceId: 0,
  1837. id: id,
  1838. };
  1839. this.$Post(this.urlsCollection.deleteConllection, params).then(
  1840. (res) => {
  1841. if (res.code === 200) {
  1842. // console.log("疑点删除成功");
  1843. this.getUserMarkers();
  1844. }
  1845. }
  1846. );
  1847. }
  1848. },
  1849. // 控制标记的显示与隐藏
  1850. controlLabel(val) {
  1851. val.geometryChecked = !val.geometryChecked;
  1852. // 已经绘制了几何体
  1853. if (map2DViewer.myLabels[`label_${val.id}`]) {
  1854. if (val.featureType === "点") {
  1855. map2DViewer.myLabels[`label_${val.id}`].setOpacity(
  1856. val.geometryChecked ? 1 : 0
  1857. );
  1858. }
  1859. if (val.featureType !== "点") {
  1860. map2DViewer.myLabels[`label_${val.id}`].setStyle(
  1861. val.geometryChecked
  1862. ? {
  1863. opacity: 1,
  1864. fillOpacity: 0.4,
  1865. }
  1866. : {
  1867. opacity: 0,
  1868. fillOpacity: 0,
  1869. }
  1870. );
  1871. }
  1872. } else {
  1873. // 未绘制几何体
  1874. // console.log(val, "未绘制几何体");
  1875. if (val.geometryChecked && val.geojson) {
  1876. let geoType = JSON.parse(val.geojson).properties.featureType;
  1877. this.$store.state.mapMethodsCollection
  1878. .get("RENDER")
  1879. .drawGeometry(geoType, val);
  1880. }
  1881. }
  1882. },
  1883. },
  1884. };
  1885. </script>
  1886. <style lang="less" scoped>
  1887. @commonBorderColor: rgb(0, 170, 255);
  1888. .comprehensive-analysis {
  1889. &-law-popup {
  1890. position: fixed;
  1891. left: 0;
  1892. right: 0;
  1893. margin: 100px auto;
  1894. pointer-events: auto;
  1895. z-index: 99;
  1896. }
  1897. &-label-popup {
  1898. position: absolute;
  1899. top: 15%;
  1900. left: 35%;
  1901. pointer-events: auto;
  1902. z-index: 99;
  1903. }
  1904. .el-checkbox {
  1905. color: #fff;
  1906. /deep/.el-checkbox__input.is-checked + .el-checkbox__label {
  1907. color: rgba(116, 255, 255, 1);
  1908. }
  1909. /deep/.el-checkbox__input.is-checked .el-checkbox__inner::after {
  1910. width: 70%;
  1911. height: 70%;
  1912. background: #74ffff;
  1913. border-radius: 0;
  1914. transform: rotate(0deg) scaleY(1);
  1915. position: static;
  1916. }
  1917. /deep/.el-checkbox__inner {
  1918. border: 1px solid #dcdfe6;
  1919. background: rgba(0, 170, 255, 0);
  1920. display: flex;
  1921. align-items: center;
  1922. justify-content: center;
  1923. position: static;
  1924. &::after {
  1925. transition: 0ms;
  1926. }
  1927. }
  1928. /deep/.el-checkbox__label {
  1929. padding-left: 0;
  1930. font-size: 15px;
  1931. position: absolute;
  1932. top: 1px;
  1933. left: 25px;
  1934. }
  1935. }
  1936. &-infobox {
  1937. width: 250px;
  1938. height: 40px;
  1939. display: flex;
  1940. align-items: center;
  1941. justify-content: center;
  1942. position: absolute;
  1943. border: none;
  1944. right: 10%;
  1945. top: 15px;
  1946. pointer-events: auto;
  1947. color: #fff;
  1948. font-size: 20px;
  1949. }
  1950. &-leftjuanlianInfo {
  1951. width: 150px;
  1952. height: 40px;
  1953. display: flex;
  1954. align-items: center;
  1955. justify-content: center;
  1956. position: absolute;
  1957. border: none;
  1958. left: 0.5%;
  1959. top: 15px;
  1960. pointer-events: auto;
  1961. color: #fff;
  1962. font-size: 20px;
  1963. }
  1964. &-rightjuanlianInfo {
  1965. width: 150px;
  1966. height: 40px;
  1967. display: flex;
  1968. align-items: center;
  1969. justify-content: center;
  1970. position: absolute;
  1971. border: none;
  1972. right: 0.5%;
  1973. top: 15px;
  1974. pointer-events: auto;
  1975. color: #fff;
  1976. font-size: 20px;
  1977. }
  1978. &-searchbox {
  1979. width: 300px;
  1980. height: 40px;
  1981. display: flex;
  1982. align-items: center;
  1983. justify-content: center;
  1984. position: absolute;
  1985. left: 21%;
  1986. top: 30px;
  1987. pointer-events: auto;
  1988. /deep/.el-input-group__append,
  1989. .el-input-group__prepend {
  1990. background-color: transparent;
  1991. color: #fff;
  1992. border-left: none;
  1993. }
  1994. /deep/.el-input-group--append .el-input__inner,
  1995. .el-input-group__prepend {
  1996. border-right: none;
  1997. }
  1998. }
  1999. &-backbtn {
  2000. width: 120px;
  2001. height: 35px;
  2002. background: @commonBorderColor;
  2003. color: #fff;
  2004. border-radius: 3px;
  2005. position: absolute;
  2006. left: 30px;
  2007. top: 15px;
  2008. pointer-events: auto;
  2009. cursor: pointer;
  2010. .left-arrow {
  2011. width: 7px;
  2012. height: 7px;
  2013. border-top: 2px solid #ffffff;
  2014. border-right: 2px solid #ffffff;
  2015. transform: translate(-50%, -50%) rotate(225deg);
  2016. position: absolute;
  2017. top: 16.5px;
  2018. left: 25px;
  2019. }
  2020. .title {
  2021. width: 80px;
  2022. height: 35px;
  2023. line-height: 35px;
  2024. position: absolute;
  2025. left: 34px;
  2026. }
  2027. }
  2028. &-legendbox {
  2029. position: absolute;
  2030. right: 410px;
  2031. top: 30px;
  2032. z-index: 1;
  2033. }
  2034. /* 弹窗 */
  2035. &-popup {
  2036. position: fixed;
  2037. left: 0;
  2038. right: 0;
  2039. margin: 100px auto;
  2040. pointer-events: auto;
  2041. z-index: 99;
  2042. }
  2043. /* 左侧面板开启按钮 */
  2044. &-leftopenbox {
  2045. position: absolute;
  2046. left: 5px;
  2047. width: 50px;
  2048. height: 100%;
  2049. display: flex;
  2050. flex-direction: column;
  2051. justify-content: center;
  2052. & > div {
  2053. pointer-events: auto;
  2054. width: 40px;
  2055. height: 40px;
  2056. border-radius: 50%;
  2057. background: rgba(102, 203, 255, 1);
  2058. position: relative;
  2059. cursor: pointer;
  2060. & > div {
  2061. position: absolute;
  2062. top: 8px;
  2063. left: 16px;
  2064. display: inline-block;
  2065. width: 0px;
  2066. height: 0px;
  2067. border: 12px solid transparent;
  2068. border-left-color: #fff;
  2069. }
  2070. }
  2071. }
  2072. /* 右侧面板开启按钮 */
  2073. &-rightopenbox {
  2074. position: absolute;
  2075. right: 0;
  2076. width: 50px;
  2077. height: 100%;
  2078. display: flex;
  2079. flex-direction: column;
  2080. justify-content: center;
  2081. & > div {
  2082. pointer-events: auto;
  2083. width: 40px;
  2084. height: 40px;
  2085. border-radius: 50%;
  2086. cursor: pointer;
  2087. position: relative;
  2088. background: rgba(102, 203, 255, 1);
  2089. & > div {
  2090. position: absolute;
  2091. top: 8px;
  2092. right: 16px;
  2093. display: inline-block;
  2094. width: 0px;
  2095. height: 0px;
  2096. border: 12px solid transparent;
  2097. border-right-color: #fff;
  2098. }
  2099. }
  2100. }
  2101. /* 左边树状面板 */
  2102. &-left {
  2103. width: 400px;
  2104. height: 85%;
  2105. position: absolute;
  2106. top: 60px;
  2107. left: 0;
  2108. background: url("../assets/image/tree_background.png") no-repeat center;
  2109. background-size: 100% 100%;
  2110. pointer-events: auto;
  2111. .close-btnbox {
  2112. position: absolute;
  2113. right: -20px;
  2114. height: 100%;
  2115. width: 40px;
  2116. display: flex;
  2117. flex-direction: column;
  2118. justify-content: center;
  2119. & > div {
  2120. pointer-events: auto;
  2121. width: 40px;
  2122. height: 40px;
  2123. border-radius: 50%;
  2124. cursor: pointer;
  2125. position: relative;
  2126. background: rgba(102, 203, 255, 1);
  2127. & > div {
  2128. position: absolute;
  2129. top: 8px;
  2130. right: 16px;
  2131. display: inline-block;
  2132. width: 0px;
  2133. height: 0px;
  2134. border: 12px solid transparent;
  2135. border-right-color: #fff;
  2136. }
  2137. }
  2138. }
  2139. .control-container {
  2140. width: 100%;
  2141. height: 8%;
  2142. display: flex;
  2143. justify-content: flex-end;
  2144. align-items: center;
  2145. position: relative;
  2146. &-pin-btn {
  2147. width: 30px;
  2148. height: 30px;
  2149. background: url("../assets/image/panel_unlock.png") no-repeat center;
  2150. position: absolute;
  2151. top: 0;
  2152. right: 3px;
  2153. cursor: pointer;
  2154. &.lock-style {
  2155. background: url("../assets/image/panel_lock.png") no-repeat center;
  2156. }
  2157. }
  2158. &-input {
  2159. width: 200px;
  2160. position: absolute;
  2161. bottom: 5px;
  2162. left: 30px;
  2163. /deep/.el-input__inner {
  2164. font-size: 15px;
  2165. height: 35px;
  2166. }
  2167. }
  2168. &-select {
  2169. width: 130px;
  2170. position: absolute;
  2171. bottom: 7px;
  2172. right: 35px;
  2173. }
  2174. }
  2175. .contant-container {
  2176. width: 100%;
  2177. height: 92%;
  2178. overflow: auto;
  2179. display: flex;
  2180. align-items: center;
  2181. justify-content: center;
  2182. &-innerbox {
  2183. width: 90%;
  2184. height: 98%;
  2185. .tree-arrow {
  2186. position: relative;
  2187. top: 0;
  2188. left: 0;
  2189. display: inline-block;
  2190. width: 0px;
  2191. height: 0px;
  2192. border: 7px solid transparent;
  2193. border-left-color: #fff;
  2194. }
  2195. .tree-arrow-expanded {
  2196. position: relative;
  2197. top: 4px;
  2198. left: -3px;
  2199. display: inline-block;
  2200. width: 0px;
  2201. height: 0px;
  2202. border: 7px solid transparent;
  2203. border-top-color: #fff;
  2204. }
  2205. .custom-tree-node {
  2206. position: relative;
  2207. width: 250px;
  2208. .el-checkbox {
  2209. width: 100%;
  2210. }
  2211. &-item {
  2212. max-width: 240px;
  2213. overflow: hidden;
  2214. white-space: nowrap;
  2215. text-overflow: ellipsis;
  2216. }
  2217. }
  2218. }
  2219. }
  2220. }
  2221. /* 右面板 -- 显示标记疑点 */
  2222. &-right {
  2223. width: 400px;
  2224. height: 85%;
  2225. position: absolute;
  2226. top: 60px;
  2227. right: 0;
  2228. background: url("../assets/image/tree_background.png") no-repeat center;
  2229. background-size: 100% 100%;
  2230. pointer-events: auto;
  2231. z-index: 2;
  2232. // 关闭折叠面板
  2233. .close-btnbox {
  2234. position: absolute;
  2235. left: -20px;
  2236. height: 100%;
  2237. width: 40px;
  2238. display: flex;
  2239. flex-direction: column;
  2240. justify-content: center;
  2241. & > div {
  2242. pointer-events: auto;
  2243. width: 40px;
  2244. height: 40px;
  2245. border-radius: 50%;
  2246. background: rgba(102, 203, 255, 1);
  2247. position: relative;
  2248. cursor: pointer;
  2249. & > div {
  2250. position: absolute;
  2251. top: 8px;
  2252. left: 16px;
  2253. display: inline-block;
  2254. width: 0px;
  2255. height: 0px;
  2256. border: 12px solid transparent;
  2257. border-left-color: #fff;
  2258. }
  2259. }
  2260. }
  2261. .control-container {
  2262. width: 100%;
  2263. height: 5%;
  2264. position: relative;
  2265. & > div {
  2266. width: 30px;
  2267. height: 30px;
  2268. background: url("../assets/image/panel_unlock.png") no-repeat center;
  2269. position: absolute;
  2270. top: 0;
  2271. left: 3px;
  2272. cursor: pointer;
  2273. &.lock-style {
  2274. background: url("../assets/image/panel_lock.png") no-repeat center;
  2275. }
  2276. }
  2277. }
  2278. .contant-container {
  2279. width: 100%;
  2280. height: 95%;
  2281. overflow: auto;
  2282. display: flex;
  2283. align-items: center;
  2284. justify-content: center;
  2285. &-innerbox {
  2286. width: 90%;
  2287. height: 98%;
  2288. .el-collapse-item__header {
  2289. .all-icon {
  2290. position: relative;
  2291. left: 10px;
  2292. display: flex;
  2293. align-items: center;
  2294. justify-content: space-around;
  2295. width: 100px;
  2296. & > div {
  2297. width: 30px;
  2298. height: 30px;
  2299. }
  2300. &-locate {
  2301. background: url("../assets/map/white_locate.png") no-repeat center;
  2302. }
  2303. &-visible {
  2304. background: url("../assets/map/white_hide.png") no-repeat center;
  2305. &.click {
  2306. background: url("../assets/map/white_display.png") no-repeat
  2307. center;
  2308. }
  2309. }
  2310. }
  2311. }
  2312. .panel-list-item {
  2313. position: relative;
  2314. margin: 0 auto;
  2315. width: 80%;
  2316. height: auto;
  2317. background: #00aaff;
  2318. font-family: "PingFangSC SC";
  2319. font-weight: 400;
  2320. font-size: 18px;
  2321. line-height: 40px;
  2322. background: rgba(0, 47, 86, 0.3);
  2323. color: #fff;
  2324. padding-left: 20px;
  2325. border-left: 1px solid rgba(207, 222, 255, 0.2);
  2326. border-right: 1px solid rgba(207, 222, 255, 0.2);
  2327. border-bottom: 1px solid rgba(207, 222, 255, 0.2);
  2328. cursor: pointer;
  2329. .normal-icon {
  2330. position: absolute;
  2331. right: 20px;
  2332. top: 0;
  2333. display: flex;
  2334. align-items: center;
  2335. justify-content: space-around;
  2336. width: 75px;
  2337. }
  2338. .operation-icon {
  2339. position: absolute;
  2340. right: 60px;
  2341. top: 0;
  2342. display: flex;
  2343. align-items: center;
  2344. justify-content: space-around;
  2345. width: 75px;
  2346. // background: red;
  2347. }
  2348. .visible-icon {
  2349. position: absolute;
  2350. right: 20px;
  2351. top: 9.5px;
  2352. width: 20px;
  2353. height: 20px;
  2354. background: url("../assets/map/eye_invisible.png") no-repeat center;
  2355. &.click {
  2356. background: url("../assets/map/eye_visible.png") no-repeat center;
  2357. }
  2358. }
  2359. }
  2360. .panel-footer {
  2361. border: none;
  2362. width: 100%;
  2363. height: 50px;
  2364. margin-top: 10px;
  2365. overflow-x: auto;
  2366. }
  2367. }
  2368. }
  2369. }
  2370. /* 侧边栏收缩动画效果 */
  2371. /* 左边 */
  2372. .fade-left-enter-from {
  2373. opacity: 0;
  2374. transform: translateX(-300px);
  2375. }
  2376. .fade-left-enter-to {
  2377. opacity: 1;
  2378. transform: translateX(0);
  2379. }
  2380. /* 主动输入控住过渡的持续时间和缓动曲线 */
  2381. .fade-left-enter-active {
  2382. transition: all 0.3s ease;
  2383. }
  2384. .fade-left-leave-from {
  2385. opacity: 1;
  2386. transform: translateX(0);
  2387. }
  2388. .fade-left-leave-to {
  2389. opacity: 0;
  2390. transform: translateX(-300px);
  2391. }
  2392. .fade-left-leave-active {
  2393. transition: all 0.3s ease;
  2394. }
  2395. /* 右边 */
  2396. .fade-right-enter-from {
  2397. opacity: 0;
  2398. transform: translateX(300px);
  2399. }
  2400. .fade-right-enter-to {
  2401. opacity: 1;
  2402. transform: translateX(0);
  2403. }
  2404. .fade-right-enter-active {
  2405. transition: all 0.3s ease;
  2406. }
  2407. .fade-right-leave-from {
  2408. opacity: 1;
  2409. transform: translateX(0);
  2410. }
  2411. .fade-right-leave-to {
  2412. opacity: 0;
  2413. transform: translateX(300px);
  2414. }
  2415. .fade-right-leave-active {
  2416. transition: all 0.3s ease;
  2417. }
  2418. }
  2419. </style>