ComprehensiveAnalysis.vue 68 KB

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