ComprehensiveAnalysis.vue 68 KB

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