ComprehensiveAnalysis.vue 120 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865
  1. <!-- 综合分析页面 -->
  2. <template>
  3. <div
  4. class="comprehensive-analysis"
  5. v-loading="layerLoading"
  6. element-loading-text="拼命加载中"
  7. element-loading-spinner="el-icon-loading"
  8. element-loading-background="rgba(0, 0, 0, 0.8)"
  9. >
  10. <div class="comprehensive-analysis-basemapswitch">
  11. <div
  12. class="basemapBox"
  13. :style="{
  14. backgroundImage: 'url(' + baseMapCollectionArr[0].imgUrl + ')',
  15. }"
  16. @mouseenter="showMapList(baseMapCollectionArr[0].type)"
  17. >
  18. <div class="basemapBox-titlebox">
  19. {{ baseMapCollectionArr[0].type }}
  20. </div>
  21. <div
  22. class="basemapBox-panel"
  23. v-show="satImgChecked"
  24. @mouseleave="closePanelEvent"
  25. >
  26. <div
  27. class="panel-item"
  28. v-for="item in mapList[baseMapCollectionArr[0].type]"
  29. :key="item.mapName"
  30. @click="changeBaseMap(item)"
  31. >
  32. {{ item.abbr }}
  33. </div>
  34. </div>
  35. </div>
  36. <div
  37. class="basemapBox"
  38. :style="{
  39. backgroundImage: 'url(' + baseMapCollectionArr[1].imgUrl + ')',
  40. }"
  41. @mouseenter="showMapList(baseMapCollectionArr[1].type)"
  42. >
  43. <div class="basemapBox-titlebox">
  44. {{ baseMapCollectionArr[1].type }}
  45. </div>
  46. <div
  47. class="basemapBox-panel"
  48. v-show="airImgChecked"
  49. @mouseleave="closePanelEvent"
  50. >
  51. <div
  52. class="panel-item"
  53. v-for="item in mapList[baseMapCollectionArr[1].type]"
  54. :key="item.mapName"
  55. @click="changeBaseMap(item)"
  56. >
  57. {{ item.abbr }}
  58. </div>
  59. </div>
  60. </div>
  61. <div
  62. class="basemapBox"
  63. :style="{
  64. backgroundImage: 'url(' + baseMapCollectionArr[2].imgUrl + ')',
  65. }"
  66. @mouseenter="showMapList(baseMapCollectionArr[2].type)"
  67. >
  68. <div class="basemapBox-titlebox">
  69. {{ baseMapCollectionArr[2].type }}
  70. </div>
  71. <div
  72. class="basemapBox-panel"
  73. v-show="otherChecked"
  74. @mouseleave="closePanelEvent"
  75. >
  76. <div
  77. class="panel-item"
  78. v-for="item in mapList[baseMapCollectionArr[2].type]"
  79. :key="item.mapName"
  80. @click="changeBaseMap(item)"
  81. >
  82. {{ item.abbr }}
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <LawPopup class="comprehensive-analysis-law-popup" />
  88. <LabelCasePopup
  89. class="comprehensive-analysis-label-popup"
  90. style="left: 40%"
  91. v-if="updateCasePopupShow"
  92. :targetArea="targetArea"
  93. :targetDistance="targetDistance"
  94. ref="updateLabelRef"
  95. @close="closeLabelEvent"
  96. @save="modifyLabelEvent"
  97. />
  98. <div
  99. class="comprehensive-analysis-backbtn"
  100. @click="backEvent"
  101. v-if="$store.state.backMenu.index && $store.state.backMenu.subIndex"
  102. >
  103. <div class="left-arrow"></div>
  104. <div class="title">返回上级</div>
  105. </div>
  106. <div class="comprehensive-analysis-searchbox">
  107. <el-input
  108. placeholder="请输入地名地址"
  109. clearable
  110. v-model="addressInput"
  111. style="background: rgba(0, 47, 86, 0.4)"
  112. >
  113. <el-button
  114. type="primary"
  115. slot="append"
  116. icon="el-icon-search"
  117. style="vertical-align: bottom"
  118. @click="getTargetAddress"
  119. ></el-button>
  120. </el-input>
  121. </div>
  122. <div
  123. class="comprehensive-analysis-searchresult"
  124. v-show="searchAddress.show"
  125. >
  126. <div
  127. class="comprehensive-analysis-searchresult-item"
  128. v-for="item in searchAddress.result"
  129. :key="item.num"
  130. @click="goToPoint(item.location)"
  131. >
  132. <div class="icon">{{ item.num }}</div>
  133. <div class="title">{{ item.title }}</div>
  134. <div class="address">{{ item.address }}</div>
  135. </div>
  136. </div>
  137. <div class="comprehensive-analysis-infobox">
  138. 当前显示的疑点数 : &nbsp;<span>{{ currentTotal }}</span>
  139. </div>
  140. <div class="comprehensive-analysis-leftjuanlianInfo" @click="changeBase(1)">
  141. <div class="top"></div>
  142. <div class="bottom"></div>
  143. <div class="mapTitle">
  144. <div>
  145. <div></div>
  146. <div></div>
  147. <div></div>
  148. </div>
  149. <div></div>
  150. <div :class="basemap == 1 ? 'mapTitlective' : 'unMapTitlective'">
  151. {{ basemapName }}
  152. </div>
  153. </div>
  154. </div>
  155. <div
  156. class="comprehensive-analysis-rightjuanlianInfo"
  157. v-show="showJLInfo"
  158. @click="changeBase(2)"
  159. >
  160. <div class="top"></div>
  161. <div class="bottom"></div>
  162. <div class="mapTitle">
  163. <div>
  164. <div></div>
  165. <div></div>
  166. <div></div>
  167. </div>
  168. <div></div>
  169. <div :class="basemap == 2 ? 'mapTitlective' : 'unMapTitlective'">
  170. {{ basemapName2 }}
  171. </div>
  172. </div>
  173. </div>
  174. <!-- 属性弹窗 -->
  175. <AttributePopup
  176. class="comprehensive-analysis-popup"
  177. v-if="attrTableShow"
  178. :boxWidth="boxWidth"
  179. :boxHeight="boxHeight"
  180. :tableType="tableType"
  181. :tableData="tableData"
  182. @close="closeEvent"
  183. />
  184. <!-- 图例 -->
  185. <Legend
  186. v-show="legendShow"
  187. class="comprehensive-analysis-legendbox"
  188. :class="{ closePanel: rightBoxBtn }"
  189. @deleteLegend="deleteLegend"
  190. :legendData="{
  191. deleteLegendEdit: true,
  192. boxWidth: '230',
  193. boxHeight: legendHeight,
  194. menuIndex: '3',
  195. legendIcon: legendIcon,
  196. legendTitle: legendTitle,
  197. leftWidth: '30%',
  198. rightWidth: '70%',
  199. rightItemWidth: '120',
  200. }"
  201. />
  202. <!-- 开启左边面板的控制按钮 -->
  203. <div class="comprehensive-analysis-leftopenbox" v-show="leftBoxBtn">
  204. <div @click="leftPanelDisplay('show')"><div></div></div>
  205. </div>
  206. <!-- 开启右边面板的控制按钮 -->
  207. <div class="comprehensive-analysis-rightopenbox" v-show="rightBoxBtn">
  208. <div @click="rightPanelDisplay('show')"><div></div></div>
  209. </div>
  210. <!-- 左侧面板的显示与隐藏 -->
  211. <transition name="fade-left">
  212. <div class="comprehensive-analysis-left" v-show="showLeftBox">
  213. <div class="close-btnbox">
  214. <div @click="leftPanelDisplay('hide')"><div></div></div>
  215. </div>
  216. <div class="control-container">
  217. <el-input
  218. class="control-container-input"
  219. v-model="filterText"
  220. placeholder="请输入搜索内容"
  221. ></el-input>
  222. <NewSelect
  223. class="control-container-select"
  224. :placeholder="'请选择街镇'"
  225. v-model="townSelectVal"
  226. :options="townOptions"
  227. :value="townSelectVal"
  228. @selectEvent="changeTownEvent"
  229. />
  230. <el-tooltip
  231. effect="light"
  232. :content="isLeftLock ? '解锁面板' : '锁定面板'"
  233. placement="bottom-end"
  234. >
  235. <div
  236. :class="{ 'lock-style': isLeftLock }"
  237. class="control-container-pin-btn"
  238. @click="leftPanelLock"
  239. ></div>
  240. </el-tooltip>
  241. </div>
  242. <div class="contant-container">
  243. <div class="contant-container-innerbox">
  244. <el-tree
  245. :data="modelData"
  246. :props="defaultProps"
  247. @check-change="handleCheckChange"
  248. node-key="id"
  249. ref="tree"
  250. :filter-node-method="filterNode"
  251. :default-expanded-keys="expandedKeys"
  252. >
  253. <span class="custom-tree-node" slot-scope="{ node }">
  254. <template
  255. v-if="
  256. node.data.mainType === '所有图层' ||
  257. node.data.mainType === '我的模型' ||
  258. node.data.mainType === '疑点问题' ||
  259. node.data.mainType === '我的图层'
  260. "
  261. >
  262. <el-checkbox
  263. v-model="node.checked"
  264. style="position: relative; width: 100%"
  265. >
  266. <el-tooltip
  267. class="item"
  268. effect="light"
  269. :content="node.label"
  270. placement="top-start"
  271. >
  272. <div class="custom-tree-node-item">
  273. {{ node.data.label }}
  274. </div>
  275. </el-tooltip>
  276. <span
  277. ><el-button
  278. size="normal"
  279. type="text"
  280. icon="el-icon-location"
  281. @click="locateEvent(node)"
  282. style="position: absolute; right: -30px; top: -12px"
  283. ></el-button
  284. ></span>
  285. <span style="position: absolute; right: -80px; top: -9px">
  286. <el-button
  287. v-if="node.parent.label === '我的模型'"
  288. size="small"
  289. type="text"
  290. icon="el-icon-edit"
  291. @click="handleUpdate(node)"
  292. ></el-button>
  293. <el-button
  294. v-if="node.parent.label === '我的模型'"
  295. size="small"
  296. type="text"
  297. icon="el-icon-delete"
  298. @click="handleDelete(node)"
  299. ></el-button>
  300. </span>
  301. </el-checkbox>
  302. </template>
  303. <template v-else-if="node.data.mainType === '预设模型'">
  304. <el-checkbox
  305. v-model="node.checked"
  306. :disabled="
  307. node.data.disabled ||
  308. (caseAuditEventStatus == true &&
  309. $store.state.preModelLayerMap.length > 0 &&
  310. $store.state.preModelLayerMap.indexOf(node.data.id) ==
  311. -1) ||
  312. (node.data.label.indexOf('林地与基本农田冲突') == -1 &&
  313. townSelectVal !== '惠南镇') ||
  314. (node.data.label.indexOf('林地与基本农田冲突') !== -1 &&
  315. townSelectVal !== '浦东新区')
  316. "
  317. style="position: relative; width: 100%"
  318. >
  319. <el-tooltip class="item" effect="light" placement="top-end">
  320. <div slot="content">
  321. 模型名称:{{ node.data.label }}<br /><br />
  322. 图层构成:{{
  323. preLayerCompMap.get(node.data.label)
  324. .c_layer_component || "--"
  325. }}<br /><br />
  326. 备注: {{ preLayerCompMap.get(node.data.label).c_extra }}
  327. </div>
  328. <div class="custom-tree-node-item">
  329. {{ node.data.label }}
  330. </div>
  331. </el-tooltip>
  332. <span
  333. ><el-button
  334. size="normal"
  335. type="text"
  336. icon="el-icon-location"
  337. @click="locateEvent(node)"
  338. style="position: absolute; right: -30px; top: -12px"
  339. ></el-button
  340. ></span>
  341. </el-checkbox>
  342. </template>
  343. <template v-else>
  344. <div
  345. :class="{
  346. 'tree-arrow': !node.expanded,
  347. 'tree-arrow-expanded': node.expanded,
  348. }"
  349. ></div>
  350. <span>{{ node.label }}</span>
  351. </template>
  352. </span>
  353. </el-tree>
  354. </div>
  355. </div>
  356. </div>
  357. </transition>
  358. <!-- 右侧面板的显示与隐藏 -->
  359. <transition name="fade-right">
  360. <div class="comprehensive-analysis-right" v-show="showRightBox">
  361. <div class="close-btnbox">
  362. <div @click="rightPanelDisplay('hide')"><div></div></div>
  363. </div>
  364. <div class="control-container">
  365. <el-tooltip
  366. effect="light"
  367. :content="isRightLock ? '解锁面板' : '锁定面板'"
  368. placement="bottom-start"
  369. >
  370. <div
  371. :class="{ 'lock-style': isRightLock }"
  372. @click="rightPanelLock"
  373. ></div>
  374. </el-tooltip>
  375. </div>
  376. <div class="contant-container">
  377. <div class="contant-container-innerbox">
  378. <el-collapse v-model="activeNames">
  379. <el-collapse-item
  380. v-for="key in Object.keys(originalData)"
  381. :key="key"
  382. :name="key"
  383. >
  384. <template slot="title">
  385. <div class="status-select" @mouseenter="panelMouseEnter(key)">
  386. <el-tooltip
  387. effect="light"
  388. :content="key"
  389. placement="bottom-start"
  390. ><div class="title">{{ key }}</div></el-tooltip
  391. >
  392. <NewSelect
  393. v-if="isSortCaseObj[key] === '预设模型'"
  394. style="width: 100px"
  395. :placeholder="'请选择排序方式'"
  396. v-model="statusSelectVal"
  397. :options="statusOptions"
  398. :value="statusSelectVal"
  399. @selectEvent="changeSortMethod"
  400. />
  401. </div>
  402. </template>
  403. <div
  404. class="panel-list-item"
  405. v-for="(v, i) in originalData[key]"
  406. :key="v.id"
  407. @dblclick="locateCase(v)"
  408. >
  409. <div class="title-section">
  410. {{
  411. v.title +
  412. "_" +
  413. ((paginationData.currentPage - 1) * currentPageSize +
  414. (i + 1))
  415. }}
  416. </div>
  417. <span class="normal-icon">
  418. <span
  419. v-if="v.mainType === '预设模型' && v.c_boolean === '疑点'"
  420. style="color: rgb(0, 230, 255)"
  421. >{{ v.c_boolean }}</span
  422. >
  423. <span
  424. v-else-if="
  425. v.mainType === '预设模型' && v.c_boolean === '非疑点'
  426. "
  427. style="color: rgb(0, 100, 240)"
  428. >{{ v.c_boolean }}</span
  429. >
  430. <span
  431. v-else-if="
  432. v.mainType === '预设模型' && v.c_boolean === '未标记'
  433. "
  434. >{{ v.c_boolean }}</span
  435. >
  436. <el-button
  437. size="normal"
  438. type="text"
  439. icon="el-icon-location"
  440. @click.stop="locateCase(v)"
  441. ></el-button
  442. ><el-button
  443. size="normal"
  444. type="text"
  445. icon="el-icon-more"
  446. @click.stop="listItemClick('default', v)"
  447. ></el-button>
  448. </span>
  449. <!-- {{ v.column_name + "_" + (i + 1) }} -->
  450. </div>
  451. <div class="panel-footer" @mouseenter="panelMouseEnter(key)">
  452. <Pagination :paginationData="paginationData" />
  453. </div>
  454. </el-collapse-item>
  455. <el-collapse-item name="myLabel">
  456. <template slot="title">
  457. 我的标记
  458. <div class="all-icon">
  459. <div
  460. class="all-icon-locate"
  461. @click.stop="labelAllLocate"
  462. ></div>
  463. <div
  464. class="all-icon-visible"
  465. :class="{ click: labelAllVisibleChecked }"
  466. @click.stop="labelAllVisible"
  467. ></div>
  468. </div>
  469. </template>
  470. <div
  471. class="panel-list-item"
  472. v-for="(item, index) in rightLabelData"
  473. :key="item.id"
  474. >
  475. <div
  476. class="title-section"
  477. @click="listItemClick('new', item)"
  478. >
  479. {{ item.name ? item.name : `疑点${index}` }}
  480. </div>
  481. <span class="operation-icon"
  482. ><el-button
  483. size="normal"
  484. type="text"
  485. icon="el-icon-edit"
  486. @click="updateLabel(item)"
  487. ></el-button
  488. ><el-button
  489. size="normal"
  490. type="text"
  491. icon="el-icon-delete"
  492. @click="deleteLabel(item.id)"
  493. ></el-button
  494. ></span>
  495. <span
  496. class="visible-icon"
  497. :class="{ click: item.geometryChecked }"
  498. @click="controlLabel(item)"
  499. ></span>
  500. </div>
  501. </el-collapse-item>
  502. </el-collapse>
  503. </div>
  504. </div>
  505. </div>
  506. </transition>
  507. </div>
  508. </template>
  509. <script>
  510. // 综合分析 this.$store.state.leftMenuTitle
  511. import MenuCard from "@/components/layout/MenuCard.vue";
  512. import Legend from "@/components/map/Legend.vue";
  513. import Pagination from "@/components/common/Pagination.vue";
  514. import NewSelect from "@/components/common/NewSelect.vue";
  515. import publicFun from "@/utils/publicFunction.js";
  516. import AttributePopup from "@/components/popup/AttributePopup.vue";
  517. import LabelCasePopup from "@/components/popup/LabelCasePopup.vue";
  518. import LawPopup from "@/components/popup/LawPopup.vue";
  519. import coordinate from "@/utils/coordinate";
  520. import X2js from "x2js";
  521. export default {
  522. name: "ComprehensiveAnalysis",
  523. components: {
  524. MenuCard,
  525. Legend,
  526. AttributePopup,
  527. LawPopup,
  528. LabelCasePopup,
  529. Pagination,
  530. NewSelect,
  531. },
  532. data() {
  533. return {
  534. searchAddress: {
  535. result: [
  536. {
  537. num: 1,
  538. title: "人民广场",
  539. address: "黄浦区",
  540. location: [255.447, -436.948],
  541. },
  542. {
  543. num: 2,
  544. title: "人民广场地下变电站",
  545. address: "黄浦区",
  546. location: [458.232, -491.819],
  547. },
  548. ],
  549. show: false,
  550. },
  551. targetArea: "",
  552. targetDistance: "",
  553. uploadNodeChildren: [],
  554. // 判断是否显示疑点筛选弹窗
  555. isSortCaseObj: {},
  556. // 存储图层构成信息
  557. preLayerCompMap: new Map(),
  558. displaySortSelect: false,
  559. basemapName: "air-2022",
  560. basemapName2: "sat2022-s2",
  561. basemap: 1,
  562. caseAuditEventStatus: false,
  563. satImgChecked: false,
  564. airImgChecked: false,
  565. otherChecked: false,
  566. basemapChecked: "",
  567. mapList: {
  568. 卫星影像: [],
  569. 航空影像: [],
  570. 其他: [],
  571. },
  572. baseMapCollectionArr: [
  573. {
  574. id: 1,
  575. type: "卫星影像",
  576. imgUrl: require("../assets/map/sat_img.png"),
  577. },
  578. {
  579. id: 2,
  580. type: "航空影像",
  581. imgUrl: require("../assets/map/air_img.png"),
  582. },
  583. {
  584. id: 3,
  585. type: "其他",
  586. imgUrl: require("../assets/map/others.png"),
  587. },
  588. ],
  589. showJLInfo: false,
  590. // 存储图斑颜色
  591. collectColorMapIndex: 0,
  592. collectColorMap: new Map(),
  593. targetLayerPage: {},
  594. targetLayerTotal: {},
  595. currentTotal: 0,
  596. layerLoading: false,
  597. expandedKeys: [],
  598. // 我的模型id集合
  599. myModelIdMap: new Map(),
  600. // 第一层数据集合
  601. firstLevelIdMap: new Map(),
  602. problemIdMap: new Map(),
  603. // 下拉框镇集合
  604. townSelectTreeMap: new Map(),
  605. // 所有图层 -- 根据镇域划分的数据集合
  606. allLayersByTownMap: new Map(),
  607. labelAllVisibleChecked: true,
  608. townSelectVal: "老港镇",
  609. townOptions: [],
  610. statusSelectVal: "",
  611. statusOptions: [
  612. {
  613. value: "未标记",
  614. label: "未标记",
  615. },
  616. {
  617. value: "疑点",
  618. label: "疑点",
  619. },
  620. {
  621. value: "非疑点",
  622. label: "非疑点",
  623. },
  624. ],
  625. enteredPanelId: "",
  626. enteredColumnId: "",
  627. enteredMainType: "",
  628. enteredSourceType: "",
  629. uploadBaseUrl: "/dms",
  630. classTextToIndex: {},
  631. addressInput: "",
  632. legendShow: false,
  633. tableType: "normal",
  634. tableData: [],
  635. legendHeight: "0",
  636. boxWidth: "600",
  637. boxHeight: "400",
  638. activeNames: ["myLabel"],
  639. rightPanelTitle: "",
  640. rightPanelDataMap: new Map(),
  641. originalData: {},
  642. originalDataMap: new Map(),
  643. rightLabelData: [],
  644. showLeftBox: true,
  645. showRightBox: true,
  646. leftBoxBtn: false,
  647. rightBoxBtn: false,
  648. modelData: [],
  649. defaultProps: {
  650. children: "children",
  651. label: "label",
  652. },
  653. legendIcon: [],
  654. legendTitle: [],
  655. // 我的模型相关数据
  656. myModel: null,
  657. filterText: "",
  658. // 存放对应图层的坐标
  659. treeCoordMap: new Map(),
  660. layerIdMap: new Map(),
  661. isLeftLock: true,
  662. isRightLock: true,
  663. currentPage: 1,
  664. currentPageSize: 10,
  665. paginationData: {
  666. pageSize: 10,
  667. pagerCount: 5,
  668. currentPage: 1,
  669. pageSizes: [5, 10, 20, 30],
  670. total: 50,
  671. currentChange: (val) => {
  672. let columnId = this.enteredColumnId;
  673. let currentPageSize = this.currentPageSize;
  674. let panelId = this.enteredPanelId;
  675. let mainType = this.enteredMainType;
  676. let sourceType = this.enteredSourceType;
  677. this.changeSingleLayer(val, currentPageSize, panelId);
  678. },
  679. handleSizeChange: (val) => {
  680. this.handleSizeChange(val);
  681. },
  682. },
  683. };
  684. },
  685. computed: {
  686. // 监听卷帘对比状态
  687. getJLStatus() {
  688. return this.$store.state.jlActiveState;
  689. },
  690. // 监听底部菜单栏状态 -- 仅针对疑点审计
  691. getAuditBtnStatus() {
  692. let _index = this.$store.state.bottomMenuIndexs.index;
  693. let _subIndex = this.$store.state.bottomMenuIndexs.subIndex;
  694. return {
  695. index: _index,
  696. subIndex: _subIndex,
  697. };
  698. },
  699. getLeftMenuTitle() {
  700. return this.$store.state.leftMenuTitle;
  701. },
  702. getMyLabelData() {
  703. return this.$store.getters.myLabelPointsArr;
  704. },
  705. getMyPoints() {
  706. return map2DViewer.myLabels;
  707. },
  708. attrTableShow: {
  709. get() {
  710. return this.$store.state.attrTableShow;
  711. },
  712. set(val) {
  713. this.$store.state.attrTableShow = val;
  714. },
  715. },
  716. updateCasePopupShow: {
  717. get() {
  718. return this.$store.state.updateCasePopupShow;
  719. },
  720. set(val) {
  721. this.$store.state.updateCasePopupShow = val;
  722. },
  723. },
  724. uploadDataArr() {
  725. return uploadDataIdArr;
  726. },
  727. },
  728. watch: {
  729. addressInput(val) {
  730. if (val === "") {
  731. this.searchAddress.show = false;
  732. map2DViewer.analysisGroups["address"].clearLayers();
  733. }
  734. },
  735. townSelectVal: {
  736. handler(val) {
  737. // console.log(val, "综合分析当前选中的值");
  738. },
  739. immediate: true,
  740. },
  741. // 监听底部菜单栏
  742. getJLStatus(val) {
  743. if (val) {
  744. this.showJLInfo = true;
  745. } else {
  746. this.basemap = 1;
  747. this.showJLInfo = false;
  748. }
  749. },
  750. // 控制全选的显示或隐藏
  751. labelAllVisibleChecked(val) {
  752. if (this.rightLabelData.length > 0) {
  753. this.rightLabelData.forEach((item) => {
  754. this.controlLabel(item);
  755. });
  756. if (val) {
  757. this.labelAllLocate();
  758. }
  759. }
  760. },
  761. "$store.state.navSelect": {
  762. handler(val, oldVal) {
  763. if (val.index === "1" || val.index === "2") {
  764. // 不进入综合分析页面 -- 切换回暗黑地图
  765. if (!map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"])) {
  766. map2DViewer.map.hasLayer(map2DViewer.layers["imagery"]) &&
  767. map2DViewer.map.removeLayer(map2DViewer.layers["imagery"]);
  768. map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"]) &&
  769. map2DViewer.map.removeLayer(map2DViewer.layers["imagery2"]);
  770. map2DViewer.map.addLayer(map2DViewer.layers["darkmap"]);
  771. }
  772. this.clearAllData();
  773. this.labelAllVisibleChecked = false;
  774. }
  775. if (val.index === "3") {
  776. // 默认切换为最新航空影像图
  777. if (!map2DViewer.map.hasLayer(map2DViewer.layers["imagery"])) {
  778. map2DViewer.map.hasLayer(map2DViewer.layers["darkmap"]) &&
  779. map2DViewer.map.removeLayer(map2DViewer.layers["darkmap"]);
  780. map2DViewer.map.hasLayer(map2DViewer.layers["imagery2"]) &&
  781. map2DViewer.map.removeLayer(map2DViewer.layers["imagery2"]);
  782. map2DViewer.map.addLayer(map2DViewer.layers["imagery"]);
  783. }
  784. // console.log("进入综合分析页面 -- 默认展开老港镇数据");
  785. setTimeout(() => {
  786. this.changeTownEvent(this.townSelectVal);
  787. }, 1000);
  788. // 如果没有初始化设置
  789. if (!map2DViewer.groups["我的标记图层组"]) {
  790. this.getUserMarkers();
  791. this.activeNames = ["myLabel"];
  792. }
  793. this.labelAllVisibleChecked = true;
  794. // 进入该页面后监听地图移动事件
  795. map2DViewer.map.on("move", (e) => {
  796. if (!this.isLeftLock) {
  797. this.showLeftBox = false;
  798. this.leftBoxBtn = true;
  799. }
  800. if (!this.isRightLock) {
  801. this.showRightBox = false;
  802. this.rightBoxBtn = true;
  803. }
  804. });
  805. }
  806. },
  807. deep: true,
  808. },
  809. uploadDataArr: {
  810. handler(val) {
  811. if (val.length > 0) {
  812. // console.log(val, "uploadDataIdArr");
  813. }
  814. },
  815. immediate: true,
  816. deep: true,
  817. },
  818. getLeftMenuTitle: {
  819. handler(val) {
  820. this.$nextTick(() => {
  821. // 从疑点筛查进入综合分析页面默认勾选
  822. if (defaultModelNameMap.has(val)) {
  823. setTimeout(() => {
  824. this.expandedKeys.push(defaultModelNameMap.get(val));
  825. // 设置默认勾选项
  826. this.$refs.tree.setCheckedKeys([defaultModelNameMap.get(val)]);
  827. this.$refs.tree.setCurrentKey(defaultModelNameMap.get(val));
  828. let nodeData = this.$refs.tree.getCurrentNode();
  829. this.handleCheckChange(nodeData, true);
  830. }, 1000);
  831. }
  832. });
  833. },
  834. immediate: true,
  835. },
  836. legendTitle(val) {
  837. // console.log(val, "监听当前图例item数量");
  838. if (val.length === 0) {
  839. this.legendShow = false;
  840. }
  841. if (val.length > 0 && val.length <= 10) {
  842. this.legendShow = true;
  843. this.legendHeight = 50 * val.length + 50 + "";
  844. }
  845. },
  846. filterText(val) {
  847. this.$refs.tree.filter(val);
  848. },
  849. getMyLabelData: {
  850. handler(val) {
  851. // console.log("标记点保存事件成功,允许开始定位");
  852. this.rightLabelData = [];
  853. if (val.length > 0) {
  854. let _myLabelPointsItem = {};
  855. let _myLabelPointsItemState = false;
  856. this.rightLabelData = val.map((v, i) => {
  857. let data = JSON.parse(v.geojson);
  858. if (
  859. sessionStorage.getItem("myLabelPointsId") &&
  860. sessionStorage.getItem("myLabelPointsId") == v.id
  861. ) {
  862. sessionStorage.removeItem("myLabelPointsId");
  863. _myLabelPointsItemState = true;
  864. _myLabelPointsItem = {
  865. id: v.id,
  866. name: data.properties.name,
  867. coord: data.geometry.coordinates[0][0],
  868. type: data.properties.title,
  869. des: data.properties.desc,
  870. geojson: v.geojson,
  871. geometryChecked: false,
  872. featureType: data.properties.featureType,
  873. };
  874. return _myLabelPointsItem;
  875. }
  876. return {
  877. id: v.id,
  878. name: data.properties.name,
  879. coord: data.geometry.coordinates[0][0],
  880. type: data.properties.title,
  881. des: data.properties.desc,
  882. geojson: v.geojson,
  883. geometryChecked: false,
  884. featureType: data.properties.featureType,
  885. };
  886. });
  887. this.$store.state.rightLabelData = this.rightLabelData;
  888. if (_myLabelPointsItemState) {
  889. setTimeout(() => {
  890. this.controlLabel(_myLabelPointsItem);
  891. if (map2DViewer.groups["我的标记图层组"]) {
  892. map2DViewer.map.fitBounds(
  893. map2DViewer.groups["我的标记图层组"].getBounds()
  894. );
  895. }
  896. }, 300);
  897. } else {
  898. setTimeout(() => {
  899. if (this.rightLabelData.length > 0) {
  900. this.rightLabelData.forEach((item) => {
  901. this.controlLabel(item);
  902. });
  903. if (map2DViewer.groups["我的标记图层组"]) {
  904. map2DViewer.map.fitBounds(
  905. map2DViewer.groups["我的标记图层组"].getBounds()
  906. );
  907. }
  908. }
  909. }, 300);
  910. }
  911. // console.log(this.rightLabelData, "rightLabelData");
  912. }
  913. },
  914. deep: true,
  915. // immediate: true,
  916. },
  917. },
  918. created() {
  919. this.townOptions = [];
  920. this.classDictQuery("0", "c_task_type", "任务类型");
  921. this.classDictQuery("0", "浦东新区行政区划", "浦东新区行政区划");
  922. setTimeout(() => {
  923. this.getPreLayerApi();
  924. }, 50);
  925. setTimeout(() => {
  926. this.getColumnList();
  927. }, 500);
  928. },
  929. mounted() {
  930. // 上传数据后更新我的图层节点
  931. this.$bus.$off("addUploadLayerEvent");
  932. this.$bus.$on("addUploadLayerEvent", (data) => {
  933. if (this.$refs.tree) {
  934. if (this.uploadNodeChildren.length > 0) {
  935. this.uploadNodeChildren.forEach((v) => {
  936. this.handleCheckChange(v, false);
  937. });
  938. }
  939. setTimeout(() => {
  940. let obj = {
  941. id: data.id,
  942. label: data.label,
  943. mainType: "我的图层",
  944. data: data.data,
  945. children: [],
  946. };
  947. this.rightPanelDataMap.set(data.id, obj);
  948. this.uploadNodeChildren.push(obj);
  949. this.$refs.tree.updateKeyChildren(
  950. this.firstLevelIdMap.get("我的图层").id,
  951. this.uploadNodeChildren
  952. );
  953. this.expandedKeys.push(this.firstLevelIdMap.get("我的图层").id);
  954. this.$refs.tree.setCheckedKeys([data.id]);
  955. this.$refs.tree.setCurrentKey(data.id);
  956. this.handleCheckChange(obj, true);
  957. }, 500);
  958. }
  959. });
  960. this.$bus.$off("viewDetailsPopup");
  961. this.$bus.$on("viewDetailsPopup", (data) => {
  962. this.viewDetailsPopup(data);
  963. });
  964. // 我的任务页面,用户点击已审核的任务时:
  965. this.$bus.$off("openMyTask");
  966. this.$bus.$on("openMyTask", (data) => {
  967. console.log(
  968. `监听到用户点击任务!任务类型Code:${data[0]},所属街道Code:${data[1]}!`
  969. );
  970. this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
  971. if (v === data[1]) {
  972. // console.log(i, "当前所属街镇选中");
  973. this.townSelectVal = i;
  974. this.changeTownEvent(i);
  975. }
  976. });
  977. });
  978. // 全流程详细页面,用户点击整改中的某个数据时:
  979. this.$bus.$off("openMyView");
  980. this.$bus.$on("openMyView", (data) => {
  981. if (this.problemIdMap.has("疑点问题")) {
  982. console.log(
  983. this.problemIdMap.get("疑点问题"),
  984. "疑点问题 -- 老港全流程管理"
  985. );
  986. setTimeout(() => {
  987. console.log(
  988. `监听到用户点击全流程详细页面,用户点击整改中的某个数据时:!任务类型Code:${data[0]},所属街道Code:${data[1]}!`
  989. );
  990. this.expandedKeys.push(this.problemIdMap.get("疑点问题").id);
  991. this.$refs.tree.setCheckedKeys([
  992. this.problemIdMap.get("疑点问题").id,
  993. ]);
  994. this.$refs.tree.setCurrentKey(this.problemIdMap.get("疑点问题").id);
  995. let nodeData = this.$refs.tree.getCurrentNode();
  996. this.handleCheckChange(nodeData, true);
  997. }, 1000);
  998. }
  999. });
  1000. this.$bus.$off("caseAuditEvent2");
  1001. this.$bus.$on("caseAuditEvent2", () => {
  1002. this.caseAuditEvent();
  1003. });
  1004. this.$store.state.mapMethodsCollection.set("METHODS", {
  1005. // 统计标记的疑点或非疑点数并排序
  1006. changeSortMethod: this.changeSortMethod,
  1007. changeCaseBoolean: this.changeCaseBoolean,
  1008. // 更新左侧我的模型节点
  1009. getMyModelData: this.getMyModelData,
  1010. });
  1011. },
  1012. destroy() {
  1013. // 当容器销毁时,需要停止监听该事件
  1014. this.$bus.$off("viewDetailsPopup");
  1015. this.$bus.$off("openMyTask");
  1016. this.$bus.$off("openMyView");
  1017. this.$bus.$off("caseAuditEvent2");
  1018. this.$bus.$off("addUploadLayerEvent");
  1019. },
  1020. methods: {
  1021. goToPoint(location) {
  1022. let newLocation = this.latLngsTransform(location);
  1023. console.log(newLocation);
  1024. this.$store.state.mapMethodsCollection
  1025. .get("RENDER")
  1026. .setView(newLocation.reverse(), 6);
  1027. },
  1028. createSinglePoint(data) {
  1029. let coord = data.location;
  1030. coord = this.latLngsTransform(coord);
  1031. console.log(coord, "转换后的坐标");
  1032. let point = L.marker(coord.reverse(), {
  1033. opacity: 1,
  1034. }).addTo(map2DViewer.analysisGroups["address"]);
  1035. },
  1036. /**
  1037. * 获取地名地址服务
  1038. */
  1039. getTargetAddress() {
  1040. console.log(this.addressInput);
  1041. if (this.addressInput !== "") {
  1042. this.searchAddress.show = true;
  1043. this.searchAddress.result = [];
  1044. if (!map2DViewer.analysisGroups["address"]) {
  1045. map2DViewer.analysisGroups["address"] = L.featureGroup();
  1046. map2DViewer.analysisGroups["address"].addTo(map2DViewer.map);
  1047. } else {
  1048. map2DViewer.analysisGroups["address"].clearLayers();
  1049. }
  1050. const x2js = new X2js();
  1051. this.$GetAddress(
  1052. `${this.urlsCollection.getAddressService}?vSearch_word=${this.addressInput}&vResult_count=10`
  1053. ).then((response) => {
  1054. let data = x2js.xml2js(response);
  1055. let finalTable = data.DZ_Result.DZ_Table.diffgram.NewDataSet.Table;
  1056. if (finalTable && finalTable.length > 0) {
  1057. this.searchAddress.result = finalTable.map((v, i) => {
  1058. return {
  1059. num: i + 1,
  1060. title: v.POI,
  1061. address: v.REGION_QX,
  1062. location: [parseFloat(v.POINT_X), parseFloat(v.POINT_Y)],
  1063. };
  1064. });
  1065. this.searchAddress.result.forEach((v) => {
  1066. this.createSinglePoint(v);
  1067. });
  1068. map2DViewer.map.fitBounds(
  1069. map2DViewer.analysisGroups["address"].getBounds()
  1070. );
  1071. }
  1072. });
  1073. }
  1074. },
  1075. deleteLegend(item) {
  1076. let data = {
  1077. id: item,
  1078. mainType: "所有图层",
  1079. };
  1080. this.handleCheckChange(data, false);
  1081. },
  1082. /**
  1083. * 关闭所有图层数据
  1084. *
  1085. * 使用场景 -- 叠置分析,切换镇域
  1086. */
  1087. closeAllRelatedLayers() {
  1088. // 每次切换镇的时候都清空面板仅针对所有图层,预设模型
  1089. if (this.rightPanelDataMap.size > 0) {
  1090. this.rightPanelDataMap.forEach((v, i) => {
  1091. if (map2DViewer.analysisGroups[i]) {
  1092. this.handleCheckChange(v, false);
  1093. delete map2DViewer.analysisGroups[i];
  1094. }
  1095. });
  1096. this.$refs.tree.setCheckedKeys([]);
  1097. }
  1098. },
  1099. /**
  1100. * 疑点数据中增加数据来源以及id
  1101. * @data
  1102. * @mainType 判断是主目录类型
  1103. * @uniqueId id
  1104. */
  1105. addLayerDataSource(data, mainType, layerName, townType) {
  1106. let targetGeometry = JSON.parse(data);
  1107. if (targetGeometry) {
  1108. let properties = targetGeometry.properties;
  1109. let id = targetGeometry.id;
  1110. targetGeometry.properties["id"] = id;
  1111. // 添加数据来源
  1112. if (!targetGeometry.properties["数据来源"]) {
  1113. targetGeometry.properties["数据来源"] = "规资";
  1114. }
  1115. // 缺少的镇域名称补充
  1116. if (townType && townType != "") {
  1117. targetGeometry.properties["镇域名称"] = townType;
  1118. }
  1119. // 添加图层构成
  1120. if (
  1121. mainType === "预设模型" &&
  1122. layerName &&
  1123. this.preLayerCompMap.has(layerName)
  1124. ) {
  1125. if (!targetGeometry.properties["图层构成"]) {
  1126. targetGeometry.properties["图层构成"] =
  1127. this.preLayerCompMap.get(layerName).c_layer_component;
  1128. }
  1129. }
  1130. return JSON.stringify(targetGeometry);
  1131. }
  1132. },
  1133. /**
  1134. * 上海2000高斯投影坐标转上海2000经纬度坐标
  1135. */
  1136. latLngsTransform(latlngsAry) {
  1137. // 深拷贝
  1138. let tempLatlngsAry = JSON.parse(JSON.stringify(latlngsAry));
  1139. if (typeof tempLatlngsAry[0] === "number") {
  1140. if (tempLatlngsAry.length < 3 && tempLatlngsAry.length > 0) {
  1141. tempLatlngsAry = coordinate.shcj_to_wgs84(
  1142. tempLatlngsAry[0],
  1143. tempLatlngsAry[1]
  1144. );
  1145. tempLatlngsAry = [
  1146. tempLatlngsAry[0] - 0.19195,
  1147. tempLatlngsAry[1] + 0.00011,
  1148. ];
  1149. return tempLatlngsAry;
  1150. }
  1151. if (tempLatlngsAry.length === 3) {
  1152. tempLatlngsAry = coordinate.shcj_to_wgs84(
  1153. tempLatlngsAry[0],
  1154. tempLatlngsAry[1]
  1155. );
  1156. tempLatlngsAry = [
  1157. tempLatlngsAry[0] - 0.19195,
  1158. tempLatlngsAry[1] + 0.00011,
  1159. ];
  1160. return tempLatlngsAry;
  1161. }
  1162. } else {
  1163. for (var i = 0, l = tempLatlngsAry.length; i < l; i++) {
  1164. tempLatlngsAry[i] = this.latLngsTransform(tempLatlngsAry[i]);
  1165. }
  1166. }
  1167. return tempLatlngsAry;
  1168. },
  1169. /**
  1170. * 叠置分析数据标准化
  1171. */
  1172. overlayStandardGeojson(data) {
  1173. if (data) {
  1174. let geojson = {
  1175. type: "Feature",
  1176. geometry: data,
  1177. };
  1178. return geojson;
  1179. }
  1180. },
  1181. // 获取预设模型图层构成接口数据
  1182. getPreLayerApi() {
  1183. let params = new FormData();
  1184. params.append("columnId", 1404);
  1185. params.append("states", "0,1,2,3");
  1186. params.append("pageSize", 100);
  1187. params.append("page", 0);
  1188. this.$Post(this.urlsCollection.selectContentList, params).then((res) => {
  1189. if (res.code === 200 && res.content.data.length > 0) {
  1190. res.content.data.forEach((v, i) => {
  1191. if (!this.preLayerCompMap.has(v.c_layer_name)) {
  1192. this.preLayerCompMap.set(v.c_layer_name, {
  1193. c_first_level: v.c_first_level,
  1194. c_layer_component: v.c_layer_component,
  1195. c_town: v.c_town,
  1196. c_model_name: v.c_model_name,
  1197. c_extra: v.c_extra,
  1198. });
  1199. }
  1200. });
  1201. }
  1202. });
  1203. },
  1204. //设置图层图例 -- 图例名称及对应的id
  1205. setLayerLegend(title, uniqueId) {
  1206. // 生成图例时设置初始化图层颜色 -- 叠置分析的图层
  1207. if (targetColor.length > this.collectColorMapIndex + 1) {
  1208. this.collectColorMapIndex++;
  1209. } else {
  1210. this.collectColorMapIndex = 0;
  1211. }
  1212. this.collectColorMap.set(
  1213. this.collectColorMapIndex,
  1214. `rgb(${targetColor[this.collectColorMapIndex][0]},${
  1215. targetColor[this.collectColorMapIndex][1]
  1216. },${targetColor[this.collectColorMapIndex][2]})`
  1217. );
  1218. // 图例
  1219. this.legendTitle.push({
  1220. name: title,
  1221. info: title,
  1222. uniqueId: uniqueId,
  1223. });
  1224. this.legendIcon.push({
  1225. uniqueId: uniqueId,
  1226. name: title,
  1227. background: "transparent",
  1228. border: `1px solid ${this.collectColorMap.get(
  1229. this.collectColorMapIndex
  1230. )}`,
  1231. });
  1232. },
  1233. // 修改数据中的疑点
  1234. changeCaseBoolean(val, status) {
  1235. if (this.enteredPanelId) {
  1236. let data = this.originalDataMap.get(this.enteredPanelId);
  1237. let index;
  1238. data.forEach((v, i) => {
  1239. if (v.id === val) {
  1240. index = i;
  1241. }
  1242. });
  1243. data[index]["c_boolean"] = status;
  1244. this.originalDataMap.set(this.enteredPanelId, data);
  1245. console.log(data, "修改疑点布尔值");
  1246. }
  1247. },
  1248. // 选择排序方式
  1249. changeSortMethod(val) {
  1250. if (this.enteredPanelId) {
  1251. let data = this.originalDataMap.get(this.enteredPanelId);
  1252. let arr1 = data.filter((v) => {
  1253. return v.c_boolean === "未标记";
  1254. });
  1255. let arr2 = data.filter((v) => {
  1256. return v.c_boolean === "疑点";
  1257. });
  1258. let arr3 = data.filter((v) => {
  1259. return v.c_boolean === "非疑点";
  1260. });
  1261. switch (val) {
  1262. case "未标记":
  1263. this.originalDataMap.set(this.enteredPanelId, [
  1264. ...arr1,
  1265. ...arr2,
  1266. ...arr3,
  1267. ]);
  1268. break;
  1269. case "疑点":
  1270. this.originalDataMap.set(this.enteredPanelId, [
  1271. ...arr2,
  1272. ...arr3,
  1273. ...arr1,
  1274. ]);
  1275. break;
  1276. case "非疑点":
  1277. this.originalDataMap.set(this.enteredPanelId, [
  1278. ...arr3,
  1279. ...arr2,
  1280. ...arr1,
  1281. ]);
  1282. break;
  1283. }
  1284. this.changeSingleLayer(1, this.currentPageSize, this.enteredPanelId);
  1285. }
  1286. },
  1287. // 得到底部菜单疑点审计开启状态
  1288. caseAuditEvent() {
  1289. this.caseAuditEventStatus = !this.caseAuditEventStatus;
  1290. },
  1291. closePanelEvent() {
  1292. this.satImgChecked = false;
  1293. this.airImgChecked = false;
  1294. this.otherChecked = false;
  1295. },
  1296. changeBase(val) {
  1297. this.basemap = val;
  1298. if (this.$store.state.jlActiveState) {
  1299. this.$message.success("选中" + (val == 1 ? "左侧" : "右侧") + "地图!");
  1300. }
  1301. },
  1302. changeBaseMap(data) {
  1303. console.log(data);
  1304. if (this.basemap == 2 && map2DViewer.map.hasLayer(map2DViewer.jlMap)) {
  1305. map2DViewer.map.removeLayer(map2DViewer.jlMap);
  1306. map2DViewer.jlMap = this.$store.state.mapMethodsCollection
  1307. .get("RENDER")
  1308. .addTiledMapLayer(data.mapUrl);
  1309. map2DViewer.map.addLayer(map2DViewer.jlMap);
  1310. this.$store.state.JLControlRightMapUrl = data.mapUrl;
  1311. this.basemapName2 = data.abbr;
  1312. } else if (map2DViewer.map.hasLayer(map2DViewer.layers["imagery"])) {
  1313. map2DViewer.map.removeLayer(map2DViewer.layers["imagery"]);
  1314. map2DViewer.layers["imagery"] = this.$store.state.mapMethodsCollection
  1315. .get("RENDER")
  1316. .addTiledMapLayer(data.mapUrl);
  1317. map2DViewer.map.addLayer(map2DViewer.layers["imagery"]);
  1318. this.basemapName = data.abbr;
  1319. }
  1320. this.$bus.$emit("reJLControl");
  1321. this.satImgChecked = false;
  1322. this.airImgChecked = false;
  1323. this.otherChecked = false;
  1324. },
  1325. // 勾选镇时默认展开当前镇
  1326. changeTownEvent(val) {
  1327. this.closeAllRelatedLayers();
  1328. if (this.townSelectTreeMap.has(val)) {
  1329. let children = [];
  1330. let data = this.townSelectTreeMap.get(val).data;
  1331. if (data.length > 0) {
  1332. children = data.map((item1) => {
  1333. return {
  1334. id: `${item1.title}_${item1.id}`,
  1335. label: item1.title,
  1336. children:
  1337. !item1.columnList || item1.columnList.length === 0
  1338. ? []
  1339. : item1.columnList.map((item2) => {
  1340. this.rightPanelDataMap.set(`${item2.title}_${item2.id}`, {
  1341. // id: item2.id,
  1342. // mainType: "所有图层",
  1343. // sourceType: item1.title,
  1344. id: `${item2.title}_${item2.id}`,
  1345. label: item2.title,
  1346. columnId: item2.id,
  1347. townId: this.townSelectTreeMap.get(val).id,
  1348. townType: val,
  1349. sourceId: item1.id,
  1350. sourceType: item1.title,
  1351. mainType: "所有图层",
  1352. color: publicFun.getRGBColor(),
  1353. children: [],
  1354. });
  1355. return {
  1356. id: `${item2.title}_${item2.id}`,
  1357. label: item2.title,
  1358. columnId: item2.id,
  1359. townId: this.townSelectTreeMap.get(val).id,
  1360. townType: val,
  1361. sourceId: item1.id,
  1362. sourceType: item1.title,
  1363. mainType: "所有图层",
  1364. color: publicFun.getRGBColor(),
  1365. children: [],
  1366. };
  1367. }),
  1368. };
  1369. });
  1370. }
  1371. if (this.$refs.tree) {
  1372. this.$refs.tree.updateKeyChildren(
  1373. this.firstLevelIdMap.get("所有图层").id,
  1374. children
  1375. );
  1376. this.$store.state.legendTree = children;
  1377. this.expandedKeys.push(this.firstLevelIdMap.get("所有图层").id);
  1378. }
  1379. }
  1380. },
  1381. showMapList(val) {
  1382. if (val === "卫星影像" && map2DViewer.baseMapCollection.length > 0) {
  1383. this.mapList["卫星影像"] = map2DViewer.baseMapCollection.filter((v) => {
  1384. return v.basemapType === "1";
  1385. });
  1386. this.satImgChecked = true;
  1387. this.otherChecked = false;
  1388. this.airImgChecked = false;
  1389. }
  1390. if (val === "航空影像" && map2DViewer.baseMapCollection.length > 0) {
  1391. this.mapList["航空影像"] = map2DViewer.baseMapCollection.filter((v) => {
  1392. return v.basemapType === "2";
  1393. });
  1394. this.satImgChecked = false;
  1395. this.otherChecked = false;
  1396. this.airImgChecked = true;
  1397. }
  1398. if (val === "其他" && map2DViewer.baseMapCollection.length > 0) {
  1399. this.mapList["其他"] = map2DViewer.baseMapCollection.filter((v) => {
  1400. return v.basemapType === "3";
  1401. });
  1402. this.satImgChecked = false;
  1403. this.airImgChecked = false;
  1404. this.otherChecked = true;
  1405. }
  1406. },
  1407. // 清除页面所有数据
  1408. clearAllData() {
  1409. this.currentTotal = 0;
  1410. this.paginationData.total = 0;
  1411. this.targetLayerTotal = {};
  1412. this.targetLayerPage = {};
  1413. this.originalDataMap.clear();
  1414. this.originalData = {};
  1415. this.isSortCaseObj = {};
  1416. this.searchAddress.show = false;
  1417. this.addressInput = "";
  1418. map2DViewer.map.off("move");
  1419. // 所有图层或预设模型全部删除
  1420. if (Object.getOwnPropertyNames(map2DViewer.analysisGroups).length > 0) {
  1421. for (let group in map2DViewer.analysisGroups) {
  1422. // 仅从地图上删除对应图层组
  1423. this.$store.state.mapMethodsCollection
  1424. .get("RENDER")
  1425. .deleteGroupFromMap(group);
  1426. }
  1427. this.$refs.tree.setCheckedKeys([]);
  1428. }
  1429. // map2DViewer.analysisGroups = {};
  1430. map2DViewer.polygons = {};
  1431. this.attrTableShow = false;
  1432. this.updateCasePopupShow = false;
  1433. map2DViewer.map.closePopup();
  1434. },
  1435. // 右侧分页栏图斑定位
  1436. locateCase(data) {
  1437. console.log(data, "右侧分页栏图斑定位locateCase");
  1438. // 将当前点定位到中心位置
  1439. if (map2DViewer.polygons[data.id]) {
  1440. map2DViewer.polygons[data.id].setStyle({
  1441. color: "red",
  1442. fillColor: "red",
  1443. fillOpacity: 0.35,
  1444. });
  1445. map2DViewer.map.fitBounds(map2DViewer.polygons[data.id].getBounds());
  1446. }
  1447. },
  1448. labelAllLocate() {
  1449. if (map2DViewer.groups["我的标记图层组"]) {
  1450. map2DViewer.map.fitBounds(
  1451. map2DViewer.groups["我的标记图层组"].getBounds()
  1452. );
  1453. }
  1454. },
  1455. labelAllVisible() {
  1456. this.labelAllVisibleChecked = !this.labelAllVisibleChecked;
  1457. },
  1458. panelMouseEnter(val) {
  1459. if (this.rightPanelDataMap.has(val)) {
  1460. this.enteredPanelId = val;
  1461. this.enteredColumnId = this.rightPanelDataMap.get(val).columnId;
  1462. this.enteredMainType = this.rightPanelDataMap.get(val).mainType;
  1463. this.enteredSourceType = this.rightPanelDataMap.get(val).sourceType;
  1464. }
  1465. },
  1466. handleSizeChange(val) {
  1467. console.log(`每页 ${val} 条`);
  1468. this.currentPageSize = val;
  1469. this.changeSingleLayer(
  1470. this.currentPage,
  1471. this.currentPageSize,
  1472. this.enteredPanelId
  1473. );
  1474. },
  1475. /**
  1476. * 渲染上传的疑点数据
  1477. * 1. 根据unique更新我的图层节点;
  1478. * 2. 默认打开该图层;
  1479. * 3. 显示疑点数目,属性数据,分页数据等信息
  1480. */
  1481. renderUploadedData(data) {
  1482. let uniqueId = data.id;
  1483. this.layerIdMap.set(uniqueId, uniqueId);
  1484. // 图层未初始化
  1485. if (!map2DViewer.analysisGroups[uniqueId]) {
  1486. // 生成图例时设置初始图层颜色
  1487. this.setLayerLegend(uniqueId, uniqueId);
  1488. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  1489. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1490. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  1491. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  1492. }
  1493. let caseArr = JSON.parse(data.data).map((ele) => {
  1494. // 坐标转换
  1495. let coordinates = ele.geometry.coordinates;
  1496. if (coordinates.length > 0) {
  1497. ele.geometry.coordinates = this.latLngsTransform(coordinates);
  1498. return {
  1499. id: publicFun.buildGuid(uniqueId),
  1500. c_boolean: "未标记",
  1501. title: data.label,
  1502. mainType: "我的图层",
  1503. c_content: JSON.stringify(ele),
  1504. };
  1505. }
  1506. });
  1507. if (!this.originalDataMap.has(uniqueId)) {
  1508. this.originalDataMap.set(uniqueId, caseArr);
  1509. }
  1510. // 该图层疑点总数
  1511. this.targetLayerTotal[uniqueId] = caseArr.length;
  1512. // 分页组件total
  1513. this.paginationData.total = caseArr.length;
  1514. this.currentTotal += caseArr.length;
  1515. console.log(caseArr, "即将渲染的上传图层数据");
  1516. caseArr.forEach((ele) => {
  1517. let cid = ele.id;
  1518. let geometry = this.addLayerDataSource(
  1519. ele.c_content,
  1520. ele.mainType,
  1521. data.label
  1522. );
  1523. let defaultStatus = ele.c_boolean;
  1524. let color = this.collectColorMap.get(this.collectColorMapIndex);
  1525. this.$store.state.mapMethodsCollection
  1526. .get("RENDER")
  1527. .addSinglePolygon(
  1528. geometry,
  1529. cid,
  1530. color,
  1531. uniqueId,
  1532. data.mainType,
  1533. "",
  1534. defaultStatus,
  1535. "",
  1536. ""
  1537. );
  1538. });
  1539. // 激活当前展开面板
  1540. this.activeNames = ["myLabel", uniqueId];
  1541. // 用于分页数据
  1542. this.originalData[uniqueId] = this.originalDataMap.get(uniqueId);
  1543. this.isSortCaseObj[uniqueId] = data.mainType;
  1544. // 进行分页列表展示
  1545. this.changeSingleLayer(1, this.currentPageSize, uniqueId);
  1546. }
  1547. },
  1548. getMapData(uniqueId, columnId, mainType, sourceType, layerName, townType) {
  1549. let layerParams = new FormData();
  1550. layerParams = {
  1551. columnId: columnId,
  1552. states: "0,1,2,3",
  1553. pageSize: 500,
  1554. page: this.targetLayerPage[uniqueId],
  1555. };
  1556. if (mainType === "预设模型") {
  1557. this.enteredPanelId = uniqueId;
  1558. let searchParam = [];
  1559. let paramTown = {
  1560. field: "c_xzqh",
  1561. // 等值查询
  1562. searchType: "1",
  1563. content: {
  1564. value: this.classTextToIndex["浦东新区行政区划"].get(
  1565. this.townSelectVal || "老港镇"
  1566. ),
  1567. },
  1568. };
  1569. searchParam.push(paramTown);
  1570. layerParams.search = JSON.stringify(searchParam);
  1571. }
  1572. this.$Post(this.urlsCollection.selectContentList, layerParams).then(
  1573. (res) => {
  1574. if (res.code === 202 && res.content === "数据不存在") {
  1575. this.layerLoading = false;
  1576. // 初始化请求 page为0时,提示无数据
  1577. if (this.targetLayerPage[uniqueId] === 0) {
  1578. this.$message.info("暂无数据!");
  1579. }
  1580. }
  1581. if (res.code === 200) {
  1582. this.layerLoading = false;
  1583. }
  1584. if (res.code === 200 && res.content.data.length > 0) {
  1585. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  1586. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  1587. }
  1588. // 初始化时将请求到的疑点数据中是否疑点全部改为未标记,疑点,非疑点三种状态
  1589. let changeCaseStatusArr = res.content.data.map((ele) => {
  1590. let targetBoolean = "未标记";
  1591. // 预设模型下的targetBoolean默认是undefined
  1592. if (mainType == "预设模型" && ele.c_boolean == true) {
  1593. targetBoolean = "疑点";
  1594. }
  1595. if (mainType == "预设模型" && ele.c_boolean == false) {
  1596. targetBoolean = "非疑点";
  1597. }
  1598. return {
  1599. id: ele.id,
  1600. column_name: ele.column_name,
  1601. c_boolean: targetBoolean,
  1602. c_xzqh: ele.c_xzqh,
  1603. c_content: ele.c_content,
  1604. c_date_time: ele.c_date_time,
  1605. title: ele.title,
  1606. model_id: ele.model_id,
  1607. column_id: ele.column_id,
  1608. content: ele.content,
  1609. secret_level: ele.secret_level,
  1610. mainType: mainType,
  1611. };
  1612. });
  1613. // 存储请求到的疑点数据
  1614. if (!this.originalDataMap.has(uniqueId)) {
  1615. this.originalDataMap.set(uniqueId, changeCaseStatusArr);
  1616. } else {
  1617. let arr = this.originalDataMap
  1618. .get(uniqueId)
  1619. .concat(changeCaseStatusArr);
  1620. this.originalDataMap.set(uniqueId, arr);
  1621. }
  1622. // 该图层疑点总数
  1623. this.targetLayerTotal[uniqueId] = res.content.count;
  1624. // 分页组件total
  1625. this.paginationData.total =
  1626. this.originalDataMap.get(uniqueId).length;
  1627. // 当前图层id存在
  1628. if (
  1629. map2DViewer.analysisGroups[uniqueId] &&
  1630. this.originalDataMap.get(uniqueId).length > 0 &&
  1631. res.content.data.length > 0
  1632. ) {
  1633. // 统计所有图斑数
  1634. this.currentTotal += res.content.data.length;
  1635. // 请求到数据后直接渲染点
  1636. changeCaseStatusArr.forEach((ele) => {
  1637. let cid = ele.id;
  1638. let geometry = this.addLayerDataSource(
  1639. ele.c_content,
  1640. mainType,
  1641. layerName,
  1642. townType
  1643. );
  1644. let defaultStatus = ele.c_boolean;
  1645. let modelId = ele.model_id;
  1646. let columnId = ele.column_id;
  1647. let color = this.collectColorMap.get(this.collectColorMapIndex);
  1648. if (defaultStatus === "疑点") {
  1649. color = `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`;
  1650. }
  1651. if (defaultStatus === "非疑点") {
  1652. color = `rgb(${caseColorChange["notPointColor"][0]},${caseColorChange["notPointColor"][1]},${caseColorChange["notPointColor"][2]})`;
  1653. }
  1654. this.$store.state.mapMethodsCollection
  1655. .get("RENDER")
  1656. .addSinglePolygon(
  1657. geometry,
  1658. cid,
  1659. color,
  1660. uniqueId,
  1661. mainType,
  1662. sourceType,
  1663. defaultStatus,
  1664. modelId,
  1665. columnId
  1666. );
  1667. });
  1668. // 激活当前展开面板
  1669. this.activeNames = ["myLabel", uniqueId];
  1670. // 用于分页数据
  1671. this.originalData[uniqueId] = this.originalDataMap.get(uniqueId);
  1672. this.isSortCaseObj[uniqueId] = mainType;
  1673. // 进行分页列表展示
  1674. this.changeSingleLayer(1, this.currentPageSize, uniqueId);
  1675. // 当前图斑数小于数据库中的图斑总数时,递归请求图斑
  1676. if (
  1677. this.originalDataMap.get(uniqueId).length <=
  1678. this.targetLayerTotal[uniqueId]
  1679. ) {
  1680. this.targetLayerPage[uniqueId]++;
  1681. this.getMapData(
  1682. uniqueId,
  1683. columnId,
  1684. mainType,
  1685. sourceType,
  1686. townType
  1687. );
  1688. }
  1689. }
  1690. }
  1691. },
  1692. (error) => {
  1693. this.layerLoading = false;
  1694. if (this.targetLayerPage[uniqueId]) {
  1695. this.$message.error("请求错误!");
  1696. }
  1697. }
  1698. );
  1699. },
  1700. /**
  1701. * 获取图层信息 -- 所有模型和预设模型
  1702. * @columnId
  1703. * @id label_columnId
  1704. * @mainType 所有图层/预设模型
  1705. * @sourceType 土地资源/林地资源/生态资源/水资源/全部
  1706. * @layerName 图层名称
  1707. * @townType
  1708. */
  1709. displaySingleLayer(
  1710. columnId,
  1711. id,
  1712. mainType,
  1713. sourceType,
  1714. layerName,
  1715. townType
  1716. ) {
  1717. let uniqueId = id;
  1718. this.layerIdMap.set(uniqueId, uniqueId);
  1719. // 图层未初始化
  1720. if (!map2DViewer.analysisGroups[uniqueId]) {
  1721. // 生成图例时设置初始图层颜色
  1722. this.setLayerLegend(uniqueId, uniqueId);
  1723. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  1724. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1725. this.targetLayerPage[uniqueId] = 0;
  1726. if (!this.layerLoading && this.targetLayerPage[uniqueId] === 0) {
  1727. this.layerLoading = true;
  1728. }
  1729. this.getMapData(
  1730. uniqueId,
  1731. columnId,
  1732. mainType,
  1733. sourceType,
  1734. layerName,
  1735. townType
  1736. );
  1737. }
  1738. },
  1739. /**
  1740. * 切换页时改变图层数据
  1741. * @val 当前页
  1742. * @currentPageSize 当前面板pageSize
  1743. * @id label_columnId
  1744. * @mainType 所有图层/预设模型
  1745. * @sourceType 土地资源,水资源,林地资源,全部
  1746. */
  1747. changeSingleLayer(val, currentPageSize, id) {
  1748. let uniqueId = id;
  1749. if (map2DViewer.analysisGroups[uniqueId]) {
  1750. this.paginationData.currentPage = val;
  1751. this.originalData[uniqueId] = [];
  1752. let oldData = this.originalDataMap.get(uniqueId);
  1753. this.originalData[uniqueId] = oldData.slice(
  1754. (val - 1) * currentPageSize,
  1755. val * currentPageSize
  1756. );
  1757. // 激活当前展开面板
  1758. // this.activeNames = ["myLabel", uniqueId];
  1759. }
  1760. },
  1761. // 数据字典查询 -- 根据内容获取对应的index
  1762. // this.classTextToIndex["任务类型"]
  1763. classDictQuery(type, cName, keyName) {
  1764. let params = new FormData();
  1765. params = {
  1766. type: type,
  1767. cName: cName,
  1768. };
  1769. this.$Post(this.urlsCollection.selectByCNameAType, params).then((res) => {
  1770. if (res.code === 200 && res.content.length > 0) {
  1771. this.classTextToIndex[keyName] = new Map();
  1772. res.content.forEach((v) => {
  1773. this.classTextToIndex[keyName].set(v.name, v.index + "");
  1774. });
  1775. }
  1776. });
  1777. },
  1778. // 获取分级栏目列表
  1779. getColumnList() {
  1780. this.modelData = [];
  1781. this.$Post(this.urlsCollection.getColumnList).then((res) => {
  1782. if (res.code === 200 && res.content.length > 0) {
  1783. let data = res.content.map((item1) => {
  1784. if (item1.title === "所有图层" && item1.columnList.length > 0) {
  1785. this.firstLevelIdMap.set(item1.title, {
  1786. id: `${item1.title}_${item1.id}`,
  1787. label: item1.title,
  1788. });
  1789. if (item1.columnList && item1.columnList.length > 0) {
  1790. item1.columnList.map((item2) => {
  1791. if (item2.columnList && item2.columnList.length > 0) {
  1792. //存储所有镇相关的数据
  1793. this.townSelectTreeMap.set(item2.title, {
  1794. id: item2.id,
  1795. data:
  1796. !item2.columnList || item2.columnList.length === 0
  1797. ? []
  1798. : item2.columnList,
  1799. });
  1800. }
  1801. });
  1802. }
  1803. return {
  1804. id: `${item1.title}_${item1.id}`,
  1805. label: item1.title,
  1806. children: [],
  1807. };
  1808. }
  1809. if (item1.title === "预设模型" && item1.columnList.length > 0) {
  1810. this.firstLevelIdMap.set(item1.title, {
  1811. id: `${item1.title}_${item1.id}`,
  1812. label: item1.title,
  1813. });
  1814. return {
  1815. id: `${item1.title}_${item1.id}`,
  1816. label: item1.title,
  1817. children:
  1818. !item1.columnList || item1.columnList.length === 0
  1819. ? []
  1820. : item1.columnList.map((item2) => {
  1821. return {
  1822. id: `${item2.title}_${item2.id}`,
  1823. label: item2.title,
  1824. children:
  1825. !item2.columnList || item2.columnList.length === 0
  1826. ? []
  1827. : item2.columnList.map((item3) => {
  1828. this.rightPanelDataMap.set(
  1829. `${item3.title}_${item3.id}`,
  1830. {
  1831. id: `${item3.title}_${item3.id}`,
  1832. label: item3.title,
  1833. sourceType: item2.title,
  1834. mainType: item1.title,
  1835. columnId: item3.id,
  1836. children: [],
  1837. disabled: false,
  1838. }
  1839. );
  1840. defaultModelNameMap.set(
  1841. item3.title,
  1842. `${item3.title}_${item3.id}`
  1843. );
  1844. return {
  1845. id: `${item3.title}_${item3.id}`,
  1846. label: item3.title,
  1847. sourceType: item2.title,
  1848. mainType: item1.title,
  1849. columnId: item3.id,
  1850. children: [],
  1851. disabled: false,
  1852. };
  1853. }),
  1854. };
  1855. }),
  1856. };
  1857. }
  1858. if (item1.title === "我的模型") {
  1859. this.firstLevelIdMap.set(item1.title, {
  1860. id: `${item1.title}_${item1.id}`,
  1861. label: item1.title,
  1862. });
  1863. this.myModelIdMap.set(
  1864. `${item1.title}_${item1.id}`,
  1865. `${item1.title}_${item1.id}`
  1866. );
  1867. return {
  1868. id: `${item1.title}_${item1.id}`,
  1869. children: [],
  1870. label: item1.title,
  1871. };
  1872. }
  1873. if (item1.title === "疑点问题" || item1.title === "我的图层") {
  1874. this.firstLevelIdMap.set(item1.title, {
  1875. id: `${item1.title}_${item1.id}`,
  1876. label: item1.title,
  1877. });
  1878. return {
  1879. id: `${item1.title}_${item1.id}`,
  1880. label: item1.title,
  1881. children:
  1882. !item1.columnList || item1.columnList.length === 0
  1883. ? []
  1884. : item1.columnList.map((item2) => {
  1885. // 疑点问题
  1886. this.problemIdMap.set(item1.title, {
  1887. id: `${item2.title}_${item2.id}`,
  1888. label: item2.title,
  1889. });
  1890. this.rightPanelDataMap.set(
  1891. `${item2.title}_${item2.id}`,
  1892. {
  1893. id: `${item2.title}_${item2.id}`,
  1894. label: item2.title,
  1895. mainType: item1.title,
  1896. columnId: item2.id,
  1897. modelId: item2.modelId,
  1898. sourceType: "土地资源",
  1899. children: [],
  1900. }
  1901. );
  1902. return {
  1903. id: `${item2.title}_${item2.id}`,
  1904. label: item2.title,
  1905. mainType: item1.title,
  1906. columnId: item2.id,
  1907. modelId: item2.modelId,
  1908. sourceType: "土地资源",
  1909. children: [],
  1910. };
  1911. }),
  1912. };
  1913. }
  1914. });
  1915. data.forEach((v) => {
  1916. if (v) {
  1917. this.modelData.push(v);
  1918. }
  1919. });
  1920. // 获取我的模型数据
  1921. let oldOptions = [];
  1922. this.getMyModelData(false, "");
  1923. this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
  1924. if (this.townSelectTreeMap.has(i)) {
  1925. oldOptions.push({
  1926. value: i,
  1927. label: i,
  1928. });
  1929. }
  1930. });
  1931. let arrDistrict = oldOptions.filter((v) => {
  1932. if (v.value.indexOf("区") > -1) {
  1933. return v;
  1934. }
  1935. });
  1936. let arrTown1 = oldOptions.filter((v) => {
  1937. if (v.value.indexOf("镇") > -1 && v.value === "老港镇") {
  1938. return v;
  1939. }
  1940. });
  1941. let arrTown2 = oldOptions.filter((v) => {
  1942. if (v.value.indexOf("镇") > -1 && v.value === "泥城镇") {
  1943. return v;
  1944. }
  1945. });
  1946. let arrTown3 = oldOptions.filter((v) => {
  1947. if (
  1948. v.value.indexOf("镇") > -1 &&
  1949. v.value !== "老港镇" &&
  1950. v.value !== "泥城镇"
  1951. ) {
  1952. return v;
  1953. }
  1954. });
  1955. let arrStreet = oldOptions.filter((v) => {
  1956. if (v.value.indexOf("道") > -1) {
  1957. return v;
  1958. }
  1959. });
  1960. this.townOptions = [
  1961. ...arrDistrict,
  1962. ...arrTown1,
  1963. ...arrTown2,
  1964. ...arrTown3,
  1965. ...arrStreet,
  1966. ];
  1967. }
  1968. });
  1969. },
  1970. /**
  1971. *@isShow 是否显示我的模型中特定节点的图层数据
  1972. *@treeKeyId 具体是哪个节点
  1973. */
  1974. getMyModelData(isShow, treeKeyId) {
  1975. let params = new FormData();
  1976. params = {
  1977. columnId: 49,
  1978. states: "0,1,2,3",
  1979. pageSize: 20,
  1980. page: 0,
  1981. };
  1982. // 如果刚执行完自定义模型叠置功能 -- 更新节点后需要显示叠置的数据,指定需要的变量
  1983. let uniqueKeyId = "";
  1984. let uniqueKeyChild = "";
  1985. this.$Post(this.urlsCollection.selectContentList, params)
  1986. .then((res) => {
  1987. if (res.code === 200 && res.content.data.length > 0) {
  1988. let children = res.content.data.map((ele) => {
  1989. // 如果刚执行完自定义模型叠置功能 -- 更新节点后需要显示叠置的数据
  1990. if (isShow && ele.id === treeKeyId) {
  1991. uniqueKeyId = `${ele.title}_${ele.id}`;
  1992. uniqueKeyChild = {
  1993. id: `${ele.title}_${ele.id}`,
  1994. label: ele.title,
  1995. modelId: ele.id,
  1996. children: [],
  1997. column_id: ele.column_id,
  1998. model_name: ele.model_name,
  1999. model_id: ele.model_id,
  2000. state: ele.state,
  2001. mainType: "我的模型",
  2002. c_bind_layer: ele.c_bind_layer,
  2003. c_layer_name: ele.c_layer_name,
  2004. c_dzfx_file: ele.c_dzfx_file || "",
  2005. };
  2006. }
  2007. customModelIdMap.set(ele.title, {
  2008. column_id: ele.column_id,
  2009. id: `${ele.title}_${ele.id}`,
  2010. modelId: ele.id,
  2011. });
  2012. this.rightPanelDataMap.set(`${ele.title}_${ele.id}`, {
  2013. id: `${ele.title}_${ele.id}`,
  2014. mainType: "我的模型",
  2015. sourceType: "",
  2016. label: ele.title,
  2017. children: [],
  2018. column_id: ele.column_id,
  2019. model_name: ele.model_name,
  2020. model_id: ele.model_id,
  2021. state: ele.state,
  2022. mainType: "我的模型",
  2023. c_bind_layer: ele.c_bind_layer,
  2024. c_layer_name: ele.c_layer_name,
  2025. c_dzfx_file: ele.c_dzfx_file || "",
  2026. });
  2027. return {
  2028. id: `${ele.title}_${ele.id}`,
  2029. label: ele.title,
  2030. modelId: ele.id,
  2031. children: [],
  2032. sourceType: "",
  2033. column_id: ele.column_id,
  2034. model_name: ele.model_name,
  2035. model_id: ele.model_id,
  2036. state: ele.state,
  2037. mainType: "我的模型",
  2038. c_bind_layer: ele.c_bind_layer,
  2039. c_layer_name: ele.c_layer_name,
  2040. c_dzfx_file: ele.c_dzfx_file || "",
  2041. };
  2042. });
  2043. if (this.modelData.length > 0) {
  2044. if (this.$refs.tree) {
  2045. this.$refs.tree.updateKeyChildren(
  2046. this.firstLevelIdMap.get("我的模型").id,
  2047. children
  2048. );
  2049. if (isShow) {
  2050. // // 所有图层或预设模型全部删除 -- 同时删除所有相关内容
  2051. this.closeAllRelatedLayers();
  2052. console.log("开始更新我的模型节点了!!!");
  2053. this.expandedKeys.push(
  2054. this.firstLevelIdMap.get("我的模型").id
  2055. );
  2056. console.log(
  2057. treeKeyId,
  2058. "显示特定节点的我的模型数据",
  2059. uniqueKeyId
  2060. );
  2061. console.log(uniqueKeyChild, "uniqueKeyChild");
  2062. this.$refs.tree.setCheckedKeys([uniqueKeyId]);
  2063. this.$refs.tree.setCurrentKey(uniqueKeyId);
  2064. // 延迟显示数据
  2065. setTimeout(() => {
  2066. this.handleCheckChange(uniqueKeyChild, true);
  2067. }, 800);
  2068. }
  2069. }
  2070. }
  2071. }
  2072. })
  2073. .catch((err) => {
  2074. console.log(err, "getMyModelData");
  2075. });
  2076. },
  2077. // 调用我的标记接口
  2078. getUserMarkers() {
  2079. if (localStorage.getItem("USER_ID")) {
  2080. let paramData = new FormData();
  2081. paramData = {
  2082. userId: Number(localStorage.getItem("USER_ID")),
  2083. sourceId: 0,
  2084. pageSize: 10,
  2085. };
  2086. if (!map2DViewer.groups["我的标记图层组"]) {
  2087. map2DViewer.groups["我的标记图层组"] = L.featureGroup();
  2088. map2DViewer.groups["我的标记图层组"].addTo(map2DViewer.map);
  2089. }
  2090. this.$Post(this.urlsCollection.selectByUser, paramData).then((res) => {
  2091. if (res.code === 200 && res.content.length >= 1) {
  2092. console.log(res.content);
  2093. this.$store.state.myLabelPointsArr = [];
  2094. this.$store.state.myLabelPointsArr = res.content.map((v) => {
  2095. let data = JSON.parse(v.geojson);
  2096. let name = data.properties.name;
  2097. myLabelNameMap.set(name, v.geojson);
  2098. return {
  2099. id: v.id,
  2100. geojson: v.geojson,
  2101. type: v.type,
  2102. };
  2103. });
  2104. }
  2105. // res.content 返回数据为空
  2106. if (res.code === 205) {
  2107. this.$store.state.myLabelPointsArr = [];
  2108. }
  2109. });
  2110. }
  2111. },
  2112. // 回退事件
  2113. backEvent() {
  2114. if (
  2115. this.$store.state.backMenu.index &&
  2116. this.$store.state.backMenu.subIndex
  2117. ) {
  2118. this.$store.commit("changeNavSelect", {
  2119. index: this.$store.state.backMenu.index,
  2120. subIndex: this.$store.state.backMenu.subIndex,
  2121. name: this.$store.state.backMenu.name
  2122. ? this.$store.state.backMenu.name
  2123. : "",
  2124. });
  2125. }
  2126. },
  2127. // 左侧面板的显示与隐藏
  2128. leftPanelDisplay(val) {
  2129. if (val === "show") {
  2130. this.showLeftBox = true;
  2131. this.leftBoxBtn = false;
  2132. }
  2133. if (val === "hide") {
  2134. this.showLeftBox = false;
  2135. this.leftBoxBtn = true;
  2136. }
  2137. },
  2138. // 右侧面板的显示与隐藏
  2139. rightPanelDisplay(val) {
  2140. if (val === "show") {
  2141. this.showRightBox = true;
  2142. this.rightBoxBtn = false;
  2143. }
  2144. if (val === "hide") {
  2145. this.showRightBox = false;
  2146. this.rightBoxBtn = true;
  2147. }
  2148. },
  2149. leftPanelLock() {
  2150. this.isLeftLock = !this.isLeftLock;
  2151. },
  2152. rightPanelLock() {
  2153. this.isRightLock = !this.isRightLock;
  2154. },
  2155. // 节点过滤事件
  2156. filterNode(value, data) {
  2157. if (!value) return true;
  2158. return data.label.indexOf(value) !== -1;
  2159. },
  2160. // 定位功能失效
  2161. locateEvent(node) {
  2162. if (this.layerIdMap.has(node.data.id)) {
  2163. this.layerIdMap.get(node.data.id);
  2164. if (map2DViewer.analysisGroups[node.data.id].getBounds()) {
  2165. map2DViewer.map.fitBounds(
  2166. map2DViewer.analysisGroups[node.data.id].getBounds()
  2167. );
  2168. }
  2169. }
  2170. },
  2171. handleUpdate(node) {
  2172. this.$bus.$emit("updateModel", node);
  2173. },
  2174. handleDelete(node) {
  2175. let deleteParams = {
  2176. id: customModelIdMap.get(node.data.label).modelId,
  2177. columnId: 49,
  2178. state: 4,
  2179. };
  2180. this.$Post(this.urlsCollection.updateAudit, deleteParams).then((res) => {
  2181. if (res.code === 200) {
  2182. this.$message.info("模型已删除!");
  2183. if (map2DViewer.analysisGroups[node.data.id]) {
  2184. this.handleCheckChange(node.data, false);
  2185. }
  2186. this.getMyModelData(false, "");
  2187. }
  2188. });
  2189. },
  2190. // 节点change事件
  2191. handleCheckChange(data, checked) {
  2192. if (data.mainType && data.mainType !== "我的模型") {
  2193. if (checked) {
  2194. this.showRightBox = true;
  2195. // 第一级菜单是所有图层
  2196. if (data.mainType === "所有图层") {
  2197. this.rightPanelTitle = data.id;
  2198. let searchParam = [];
  2199. let targetTown = this.classTextToIndex["浦东新区行政区划"].get(
  2200. data.townType
  2201. );
  2202. let targetType = this.classTextToIndex["任务类型"].get(
  2203. data.sourceType
  2204. );
  2205. this.$store.state.treeDataCollection.set(data.id, {
  2206. // mainType: data.mainType,
  2207. townId: data.townId,
  2208. townType: data.townType,
  2209. sourceId: data.sourceId,
  2210. sourceType: data.sourceType,
  2211. layerId: data.id,
  2212. layerName: data.label,
  2213. });
  2214. let paramUser = {
  2215. field: "c_user_id",
  2216. searchType: "1",
  2217. content: {
  2218. value: localStorage.getItem("USER_ID"),
  2219. },
  2220. };
  2221. searchParam.push(paramUser);
  2222. let paramTown = {
  2223. field: "c_area_code",
  2224. searchType: "1",
  2225. content: {
  2226. value: targetTown,
  2227. },
  2228. };
  2229. searchParam.push(paramTown);
  2230. let paramType = {
  2231. field: "c_task_type",
  2232. searchType: "1",
  2233. content: {
  2234. value: targetType,
  2235. },
  2236. };
  2237. searchParam.push(paramType);
  2238. let params = new FormData();
  2239. params = {
  2240. columnId: 48,
  2241. states: "2,3",
  2242. pageSize: 10,
  2243. page: 0,
  2244. search: JSON.stringify(searchParam),
  2245. };
  2246. this.$Post(this.urlsCollection.selectContentList, params).then(
  2247. (res) => {
  2248. // 暂不设置权限要求
  2249. layerAuthorityMap.set(data.id, "有权限");
  2250. this.displaySingleLayer(
  2251. data.columnId,
  2252. data.id,
  2253. data.mainType,
  2254. data.sourceType ? data.sourceType : "",
  2255. data.label,
  2256. data.townType ? data.townType : ""
  2257. );
  2258. // if (res.code === 202 && res.content === "数据不存在") {
  2259. // this.$message.info("当前用户无权限!");
  2260. // layerAuthorityMap.set(data.id, "无权限");
  2261. // }
  2262. // if (res.code === 200 && res.content.data.length > 0) {
  2263. // layerAuthorityMap.set(data.id, "有权限");
  2264. // this.displaySingleLayer(data.columnId, data.id, data.mainType, data.sourceType ? data.sourceType : "");
  2265. // }
  2266. }
  2267. );
  2268. }
  2269. // 第一级菜单是预设模型
  2270. if (data.mainType === "预设模型") {
  2271. layerAuthorityMap.set(data.id, "有权限");
  2272. this.$store.state.preModelLayerMap.push(data.id);
  2273. this.rightPanelTitle = data.id;
  2274. this.displaySingleLayer(
  2275. data.columnId,
  2276. data.id,
  2277. data.mainType,
  2278. data.sourceType ? data.sourceType : "",
  2279. data.label
  2280. );
  2281. }
  2282. // 第一级菜单是疑点问题
  2283. if (data.mainType === "疑点问题") {
  2284. layerAuthorityMap.set(data.id, "有权限");
  2285. this.rightPanelTitle = data.id;
  2286. this.displaySingleLayer(
  2287. data.columnId,
  2288. data.id,
  2289. data.mainType,
  2290. data.sourceType ? data.sourceType : "",
  2291. data.label
  2292. );
  2293. }
  2294. // 第一级菜单是我的图层 -- 不请求接口
  2295. if (data.mainType === "我的图层") {
  2296. layerAuthorityMap.set(data.id, "有权限");
  2297. this.rightPanelTitle = data.label;
  2298. this.renderUploadedData(data);
  2299. }
  2300. } else {
  2301. if (
  2302. this.$store.state.selectSelectDataMap["singlePolygon"] &&
  2303. this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
  2304. ) {
  2305. delete this.$store.state.selectSelectDataMap["singlePolygon"][
  2306. data.id
  2307. ];
  2308. }
  2309. // 取消勾选当前图层勾选,图斑数改变, 如果是所有图层数据移除折叠面板
  2310. if (
  2311. this.originalDataMap &&
  2312. this.originalDataMap.has(data.id) &&
  2313. this.currentTotal > 0
  2314. ) {
  2315. this.currentTotal -= this.originalDataMap.get(data.id).length;
  2316. this.originalDataMap.delete(data.id);
  2317. if (this.originalData && this.originalData[data.id]) {
  2318. delete this.originalData[data.id];
  2319. }
  2320. }
  2321. if (
  2322. data.mainType === "预设模型" &&
  2323. this.$store.state.preModelLayerMap.includes(data.id)
  2324. ) {
  2325. this.$store.state.preModelLayerMap.splice(
  2326. this.$store.state.preModelLayerMap.indexOf(data.id),
  2327. 1
  2328. );
  2329. }
  2330. // 统计后小于0改为0
  2331. if (this.currentTotal < 0) {
  2332. this.currentTotal = 0;
  2333. }
  2334. map2DViewer.map.closePopup();
  2335. // 移除图例
  2336. if (this.legendTitle.length > 0) {
  2337. this.legendTitle = this.legendTitle.filter((v) => {
  2338. return v.uniqueId !== data.id;
  2339. });
  2340. this.legendIcon = this.legendIcon.filter((v) => {
  2341. return v.uniqueId !== data.id;
  2342. });
  2343. }
  2344. this.layerIdMap.has(data.id) && this.layerIdMap.delete(data.id);
  2345. //关联自定义模型
  2346. this.$store.state.treeDataCollection.has(data.id) &&
  2347. this.$store.state.treeDataCollection.delete(data.id);
  2348. // 只激活我的标记
  2349. this.activeNames = ["myLabel"];
  2350. this.$store.state.mapMethodsCollection
  2351. .get("RENDER")
  2352. .deleteGroupFromMap(data.id);
  2353. // 移除图层id
  2354. if (map2DViewer.analysisGroups[data.id]) {
  2355. delete this.targetLayerTotal[data.id];
  2356. delete map2DViewer.analysisGroups[data.id];
  2357. }
  2358. }
  2359. }
  2360. // 第一级菜单是我的模型
  2361. if (data.mainType && data.mainType === "我的模型") {
  2362. // 显示叠置分析的数据
  2363. checked ? this.displayMyModelData(data) : this.deleteMyModelData(data);
  2364. }
  2365. },
  2366. // 显示我的模型数据
  2367. displayMyModelData(data) {
  2368. this.$nextTick(() => {
  2369. if (this.$refs.tree) {
  2370. this.$refs.tree.setCheckedKeys([data.id]);
  2371. }
  2372. });
  2373. let uniqueId = data.id;
  2374. // 我的模型图层组初始化
  2375. if (!map2DViewer.analysisGroups[uniqueId]) {
  2376. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  2377. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  2378. this.layerIdMap.set(uniqueId, uniqueId);
  2379. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  2380. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  2381. }
  2382. // 如果有叠置分析文件 -- 呈现叠置分析内容
  2383. if (data.c_dzfx_file) {
  2384. this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(
  2385. (response) => {
  2386. if (response.geometries.length === 0) {
  2387. this.$message.info("未发现叠置的几何体!");
  2388. }
  2389. if (response.geometries.length > 0) {
  2390. if (map2DViewer.analysisGroups[uniqueId]) {
  2391. let uniqueIdList = [];
  2392. if (
  2393. this.$store.state.selectSelectDataMap["singlePolygon"][
  2394. uniqueId
  2395. ]
  2396. ) {
  2397. uniqueIdList =
  2398. this.$store.state.selectSelectDataMap["singlePolygon"][
  2399. uniqueId
  2400. ];
  2401. }
  2402. // 生成图例时设置初始化图层颜色 -- 叠置分析的图层
  2403. this.setLayerLegend(`叠置-${uniqueId}`, uniqueId);
  2404. // 清除当前图层组内所有图层,并读取GeoJSON数据
  2405. map2DViewer.analysisGroups[uniqueId].clearLayers();
  2406. // 叠置分析图斑数统计
  2407. this.targetLayerTotal[uniqueId] = response.geometries.length;
  2408. this.currentTotal += response.geometries.length;
  2409. // 存储请求到的疑点数据
  2410. this.originalDataMap.set(uniqueId, response.geometries);
  2411. // 存储叠置分析中所有的面
  2412. let statesArr = [];
  2413. let color = this.collectColorMap.get(
  2414. this.collectColorMapIndex
  2415. );
  2416. // 仅显示面数据
  2417. response.geometries.forEach((v) => {
  2418. if (
  2419. v.type != "" &&
  2420. v.type != "Point" &&
  2421. v.type != "LineString" &&
  2422. v.coordinates.length > 0
  2423. ) {
  2424. let geoData = this.overlayStandardGeojson(v);
  2425. let singlePolygonItem = {
  2426. uniqueId: `overlay_${uniqueId}`,
  2427. geometry: JSON.stringify(geoData),
  2428. cid: publicFun.buildGuid(data.label),
  2429. color: color,
  2430. };
  2431. uniqueIdList.push(singlePolygonItem);
  2432. this.$store.state.selectSelectDataMap["singlePolygon"][
  2433. uniqueId
  2434. ] = uniqueIdList;
  2435. statesArr.push(geoData);
  2436. }
  2437. });
  2438. this.readGeojson(statesArr, data.id, color);
  2439. }
  2440. }
  2441. }
  2442. );
  2443. } else {
  2444. this.layerLoading = true;
  2445. let params = new FormData();
  2446. params = {
  2447. modelId: data.modelId,
  2448. userId: localStorage.getItem("USER_ID"),
  2449. };
  2450. // 调用我的模型查看接口读取所有图层数据
  2451. this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(
  2452. (res) => {
  2453. if (res.code !== 201 && res.code !== 200) {
  2454. this.layerLoading = false;
  2455. this.$message.info("数据请求失败,请重新请求!");
  2456. }
  2457. if (res.code === 201 && res.message === "未申请任务权限") {
  2458. this.layerLoading = false;
  2459. this.$message.info("暂无数据!");
  2460. }
  2461. if (res.code === 200) {
  2462. this.layerLoading = false;
  2463. }
  2464. if (res.code === 200 && res.content.length > 0) {
  2465. // 清除当前图层组内所有图层,并读取GeoJSON数据
  2466. map2DViewer.analysisGroups[uniqueId].clearLayers();
  2467. // 判断我的模型中目前有多少个图层
  2468. let layerTotalArr = [];
  2469. let layerLegendColorMap = new Map();
  2470. let changeCaseStatusArr = res.content.map((ele) => {
  2471. if (!layerTotalArr.includes(ele.column_name)) {
  2472. layerTotalArr.push(ele.column_name);
  2473. this.setLayerLegend(ele.column_name, uniqueId);
  2474. layerLegendColorMap.set(
  2475. ele.column_name,
  2476. this.collectColorMap.get(this.collectColorMapIndex)
  2477. );
  2478. }
  2479. return {
  2480. id: ele.id,
  2481. column_name: ele.column_name,
  2482. c_boolean: "未标记",
  2483. c_xzqh: ele.c_xzqh,
  2484. c_content: ele.c_content,
  2485. c_date_time: ele.c_date_time,
  2486. title: ele.title,
  2487. model_id: ele.model_id,
  2488. column_id: ele.column_id,
  2489. content: ele.content,
  2490. secret_level: ele.secret_level,
  2491. mainType: data.mainType,
  2492. };
  2493. });
  2494. // 存储请求到的疑点数据
  2495. this.originalDataMap.set(uniqueId, changeCaseStatusArr);
  2496. // 该图层疑点总数
  2497. this.targetLayerTotal[uniqueId] = res.content.length;
  2498. // 分页组件total
  2499. this.paginationData.total =
  2500. this.originalDataMap.get(uniqueId).length;
  2501. // 当前图层的id存在
  2502. if (
  2503. map2DViewer.analysisGroups[uniqueId] &&
  2504. this.originalDataMap.get(uniqueId).length > 0 &&
  2505. changeCaseStatusArr.length > 0
  2506. ) {
  2507. // 统计所有图斑数
  2508. this.currentTotal += changeCaseStatusArr.length;
  2509. // 请求到数据后直接渲染点
  2510. changeCaseStatusArr.forEach((ele) => {
  2511. let cid = ele.id;
  2512. let geometry = this.addLayerDataSource(
  2513. ele.c_content,
  2514. data.mainType,
  2515. data.label
  2516. );
  2517. let modelId = ele.model_id;
  2518. let columnId = ele.column_id;
  2519. this.$store.state.mapMethodsCollection
  2520. .get("RENDER")
  2521. .addSinglePolygon(
  2522. geometry,
  2523. cid,
  2524. layerLegendColorMap.get(ele.column_name),
  2525. uniqueId,
  2526. data.mainType,
  2527. "",
  2528. "",
  2529. modelId,
  2530. columnId
  2531. );
  2532. });
  2533. }
  2534. // 激活当前展开面板
  2535. this.activeNames = ["myLabel", uniqueId];
  2536. // 我的模型数据进行分页列表展示
  2537. this.originalData[uniqueId] =
  2538. this.originalDataMap.get(uniqueId);
  2539. this.isSortCaseObj[uniqueId] = data.mainType;
  2540. // 进行分页列表展示
  2541. this.changeSingleLayer(1, this.currentPageSize, uniqueId);
  2542. }
  2543. }
  2544. );
  2545. }
  2546. }
  2547. },
  2548. // geojson直接读取的坐标顺序是经纬度
  2549. readGeojson(geojsonArr, uniqueId, color) {
  2550. let geojsonData = L.geoJSON(geojsonArr, {
  2551. style: function (feature) {
  2552. return { color: color };
  2553. },
  2554. }).addTo(map2DViewer.map);
  2555. map2DViewer.analysisGroups[uniqueId] = geojsonData;
  2556. },
  2557. // 我的模型图层取消勾选
  2558. deleteMyModelData(data) {
  2559. // 直接删除图层组中的数据
  2560. if (map2DViewer.analysisGroups[data.id]) {
  2561. map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
  2562. }
  2563. if (
  2564. this.$store.state.selectSelectDataMap["singlePolygon"] &&
  2565. this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
  2566. ) {
  2567. delete this.$store.state.selectSelectDataMap["singlePolygon"][data.id];
  2568. }
  2569. // 取消勾选当前图层勾选,图斑数改变, 如果是所有图层数据移除折叠面板
  2570. if (
  2571. this.originalDataMap &&
  2572. this.originalDataMap.has(data.id) &&
  2573. this.currentTotal > 0
  2574. ) {
  2575. this.currentTotal -= this.originalDataMap.get(data.id).length;
  2576. this.originalDataMap.delete(data.id);
  2577. if (this.originalData && this.originalData[data.id]) {
  2578. delete this.originalData[data.id];
  2579. delete this.isSortCaseObj[data.id];
  2580. }
  2581. }
  2582. // 统计后小于0改为0
  2583. if (this.currentTotal < 0) {
  2584. this.currentTotal = 0;
  2585. }
  2586. map2DViewer.map.closePopup();
  2587. // 移除图例
  2588. if (this.legendTitle.length > 0) {
  2589. this.legendTitle = this.legendTitle.filter((v) => {
  2590. return v.uniqueId !== data.id;
  2591. });
  2592. this.legendIcon = this.legendIcon.filter((v) => {
  2593. return v.uniqueId !== data.id;
  2594. });
  2595. }
  2596. this.layerIdMap.has(data.id) && this.layerIdMap.delete(data.id);
  2597. // 只激活我的标记
  2598. this.activeNames = ["myLabel"];
  2599. this.$store.state.mapMethodsCollection
  2600. .get("RENDER")
  2601. .deleteGroupFromMap(data.id);
  2602. // 移除图层id
  2603. if (map2DViewer.analysisGroups[data.id]) {
  2604. delete this.targetLayerTotal[data.id];
  2605. delete map2DViewer.analysisGroups[data.id];
  2606. }
  2607. },
  2608. //显示详细信息
  2609. viewDetailsPopup(data) {
  2610. this.$store.state.bottomMenuIndexs.index = -1;
  2611. this.$store.state.bottomMenuIndexs.subIndex = -1;
  2612. this.updateCasePopupShow = false;
  2613. this.tableType = "normal";
  2614. this.boxWidth = "600";
  2615. this.boxHeight = "600";
  2616. this.tableData = [];
  2617. let obj = JSON.parse(data).properties;
  2618. this.tableData.push(obj);
  2619. this.attrTableShow = true;
  2620. },
  2621. // 右侧面板项点击事件
  2622. listItemClick(type, data) {
  2623. this.$store.state.bottomMenuIndexs.index = -1;
  2624. this.$store.state.bottomMenuIndexs.subIndex = -1;
  2625. this.updateCasePopupShow = false;
  2626. this.tableData = [];
  2627. if (type === "default") {
  2628. this.tableType = "normal";
  2629. this.boxWidth = "600";
  2630. this.boxHeight = "600";
  2631. if (data.c_content) {
  2632. let obj = JSON.parse(data.c_content).properties;
  2633. this.tableData.push(obj);
  2634. }
  2635. }
  2636. if (type === "new") {
  2637. this.rightLabelData.forEach((item) => {
  2638. if (item.id == data.id) {
  2639. item.geometryChecked = false;
  2640. this.controlLabel(item);
  2641. }
  2642. });
  2643. if (data.featureType === "点") {
  2644. this.$store.state.mapMethodsCollection
  2645. .get("RENDER")
  2646. .setView(data.coord, 6);
  2647. } else {
  2648. map2DViewer.map.fitBounds(
  2649. map2DViewer.myLabels[`label_${data.id}`].getBounds()
  2650. );
  2651. }
  2652. let geojsonData = JSON.parse(data.geojson);
  2653. let geoType = geojsonData.properties.featureType;
  2654. let area = geojsonData.properties.area;
  2655. let distance = "";
  2656. if (geojsonData.properties.distance === "") {
  2657. distance = "";
  2658. } else if (geojsonData.properties.distance > 1000) {
  2659. distance =
  2660. parseFloat(geojsonData.properties.distance / 1000).toFixed(2) +
  2661. " 公里";
  2662. } else if (geojsonData.properties.distance < 1000) {
  2663. distance =
  2664. parseFloat(geojsonData.properties.distance).toFixed(2) + " 米";
  2665. }
  2666. this.$store.state.mapMethodsCollection
  2667. .get("RENDER")
  2668. .drawGeometry(geoType, data);
  2669. this.tableType = "personal";
  2670. this.boxWidth = "300";
  2671. this.boxHeight = "300";
  2672. this.tableData.push({
  2673. 名称: data.name,
  2674. 类别: data.type,
  2675. 描述: data.des,
  2676. 距离: distance,
  2677. 面积: area,
  2678. });
  2679. }
  2680. this.attrTableShow = true;
  2681. },
  2682. closeEvent() {
  2683. this.attrTableShow = false;
  2684. },
  2685. // 关闭修改标记弹窗
  2686. closeLabelEvent() {
  2687. this.updateCasePopupShow = false;
  2688. },
  2689. modifyLabelEvent() {
  2690. this.$nextTick(() => {
  2691. let selectType = this.$refs.updateLabelRef.selectVal;
  2692. let desContent = this.$refs.updateLabelRef.textContent;
  2693. let currentNameInput = this.$refs.updateLabelRef.nameInput;
  2694. let geojson = JSON.parse(this.$refs.updateLabelRef.geojson);
  2695. let geometryType = geojson.properties.featureTypeIndex;
  2696. if (
  2697. myLabelNameMap.has(currentNameInput) &&
  2698. currentNameInput !== geojson.properties.name
  2699. ) {
  2700. this.$message.info("该名称已存在,请重新输入!");
  2701. } else {
  2702. let id = this.$refs.updateLabelRef.id;
  2703. let params = new FormData();
  2704. let nameInput = this.$refs.updateLabelRef.nameInput;
  2705. // 修改标题和描述
  2706. geojson.properties.title = selectType;
  2707. geojson.properties.desc = desContent;
  2708. geojson.properties.name = nameInput;
  2709. params = {
  2710. userId: Number(localStorage.getItem("USER_ID")),
  2711. sourceId: 0,
  2712. type: geometryType,
  2713. geojson: JSON.stringify(geojson),
  2714. id: id,
  2715. };
  2716. this.$Post(this.urlsCollection.updateConllection, params).then(
  2717. (res) => {
  2718. if (res.code === 200) {
  2719. this.updateCasePopupShow = false;
  2720. this.getUserMarkers();
  2721. this.$message.success("修改成功!");
  2722. }
  2723. },
  2724. (error) => {
  2725. this.$message.error("保存失败");
  2726. console.log(error);
  2727. }
  2728. );
  2729. }
  2730. });
  2731. },
  2732. // 修改标记 -- 仅支持修改类型和描述
  2733. updateLabel(val) {
  2734. this.$store.state.bottomMenuIndexs.index = -1;
  2735. this.$store.state.bottomMenuIndexs.subIndex = -1;
  2736. this.updateCasePopupShow = true;
  2737. this.attrTableShow = false;
  2738. this.targetArea = JSON.parse(val.geojson).properties.area;
  2739. this.targetDistance = JSON.parse(val.geojson).properties.distance;
  2740. if (this.updateCasePopupShow) {
  2741. this.$nextTick(() => {
  2742. this.$refs.updateLabelRef.menuData.title = "修改标记";
  2743. this.$refs.updateLabelRef.nameInput = val.name;
  2744. this.$refs.updateLabelRef.selectVal = val.type;
  2745. this.$refs.updateLabelRef.textContent = val.des;
  2746. this.$refs.updateLabelRef.id = val.id;
  2747. this.$refs.updateLabelRef.geojson = val.geojson;
  2748. });
  2749. }
  2750. },
  2751. // 删除标记
  2752. deleteLabel(id) {
  2753. if (localStorage.getItem("USER_ID")) {
  2754. let params = new FormData();
  2755. this.$store.state.mapMethodsCollection
  2756. .get("RENDER")
  2757. .deleteGeometry(map2DViewer.myLabels[`label_${id}`]);
  2758. map2DViewer.myLabels[`label_${id}`] = null;
  2759. params = {
  2760. userId: Number(localStorage.getItem("USER_ID")),
  2761. sourceId: 0,
  2762. id: id,
  2763. };
  2764. this.$Post(this.urlsCollection.deleteConllection, params).then(
  2765. (res) => {
  2766. if (res.code === 200) {
  2767. // console.log("疑点删除成功");
  2768. this.getUserMarkers();
  2769. }
  2770. }
  2771. );
  2772. }
  2773. },
  2774. // 控制标记的显示与隐藏
  2775. controlLabel(val) {
  2776. val.geometryChecked = !val.geometryChecked;
  2777. if (
  2778. map2DViewer.myLabels[
  2779. `label_${this.$store.state.map2DViewerPolygonsCid.newCid}`
  2780. ]
  2781. ) {
  2782. map2DViewer.myLabels[
  2783. `label_${this.$store.state.map2DViewerPolygonsCid.newCid}`
  2784. ].setStyle({
  2785. color: this.$store.state.map2DViewerPolygonsCid.oldColor,
  2786. fillOpacity: 0,
  2787. });
  2788. this.$store.state.map2DViewerPolygonsCid = {
  2789. newCid: null,
  2790. oldColor: null,
  2791. };
  2792. }
  2793. if (
  2794. map2DViewer.polygons[this.$store.state.map2DViewerPolygonsCid.newCid]
  2795. ) {
  2796. map2DViewer.polygons[
  2797. this.$store.state.map2DViewerPolygonsCid.newCid
  2798. ].setStyle({
  2799. color: this.$store.state.map2DViewerPolygonsCid.oldColor,
  2800. fillOpacity: 0,
  2801. });
  2802. this.$store.state.map2DViewerPolygonsCid = {
  2803. newCid: null,
  2804. oldColor: null,
  2805. };
  2806. }
  2807. // 判断是否是重复点击,不是的话高亮,是的话不操作。
  2808. setTimeout(() => {
  2809. this.polygonOnClick = false;
  2810. if (val.id != this.$store.state.map2DViewerPolygonsCid.newCid) {
  2811. this.$store.state.map2DViewerPolygonsCid = {
  2812. newCid: val.id,
  2813. oldColor: "red",
  2814. };
  2815. if (
  2816. map2DViewer.polygons[
  2817. this.$store.state.map2DViewerPolygonsCid.newCid
  2818. ]
  2819. ) {
  2820. map2DViewer.polygons[
  2821. this.$store.state.map2DViewerPolygonsCid.newCid
  2822. ].setStyle({
  2823. color: "red",
  2824. fillColor: "red",
  2825. fillOpacity: 0.35,
  2826. });
  2827. }
  2828. // map2DViewer.polygons[
  2829. // this.$store.state.map2DViewerPolygonsCid.newCid
  2830. // ].setStyle({
  2831. // color: "red",
  2832. // fillColor: "red",
  2833. // fillOpacity: 0.35,
  2834. // });
  2835. // polygon.setStyle({
  2836. // color: "red",
  2837. // fillColor: "red",
  2838. // fillOpacity: 0.35,
  2839. // });
  2840. } else {
  2841. this.$store.state.map2DViewerPolygonsCid = {
  2842. newCid: null,
  2843. oldColor: null,
  2844. };
  2845. }
  2846. }, 200);
  2847. // 已经绘制了几何体
  2848. if (map2DViewer.myLabels[`label_${val.id}`]) {
  2849. if (val.featureType === "点") {
  2850. map2DViewer.myLabels[`label_${val.id}`].setOpacity(
  2851. val.geometryChecked ? 1 : 0
  2852. );
  2853. }
  2854. if (val.featureType !== "点") {
  2855. map2DViewer.myLabels[`label_${val.id}`].setStyle(
  2856. val.geometryChecked
  2857. ? {
  2858. opacity: 1,
  2859. fillOpacity: 0.35,
  2860. }
  2861. : {
  2862. opacity: 0,
  2863. fillOpacity: 0,
  2864. }
  2865. );
  2866. }
  2867. } else {
  2868. // 未绘制几何体
  2869. // console.log(val, "未绘制几何体");
  2870. if (val.geometryChecked && val.geojson) {
  2871. let geoType = JSON.parse(val.geojson).properties.featureType;
  2872. this.$store.state.mapMethodsCollection
  2873. .get("RENDER")
  2874. .drawGeometry(geoType, val);
  2875. }
  2876. }
  2877. },
  2878. },
  2879. };
  2880. </script>
  2881. <style lang="less" scoped>
  2882. @commonBorderColor: #00aaff64;
  2883. @mapTitleBgColor: #00476b;
  2884. .comprehensive-analysis {
  2885. &-law-popup {
  2886. position: fixed;
  2887. left: 0;
  2888. right: 0;
  2889. margin: 100px auto;
  2890. pointer-events: auto;
  2891. z-index: 99;
  2892. }
  2893. &-label-popup {
  2894. position: absolute;
  2895. top: 15%;
  2896. left: 35%;
  2897. pointer-events: auto;
  2898. z-index: 99;
  2899. }
  2900. .el-checkbox {
  2901. color: #fff;
  2902. /deep/.el-checkbox__input.is-checked + .el-checkbox__label {
  2903. color: rgba(116, 255, 255, 1);
  2904. }
  2905. /deep/.el-checkbox__input.is-checked .el-checkbox__inner::after {
  2906. width: 70%;
  2907. height: 70%;
  2908. background: #74ffff;
  2909. border-radius: 0;
  2910. transform: rotate(0deg) scaleY(1);
  2911. position: static;
  2912. }
  2913. /deep/.el-checkbox__inner {
  2914. border: 1px solid #dcdfe6;
  2915. background: rgba(0, 170, 255, 0);
  2916. display: flex;
  2917. align-items: center;
  2918. justify-content: center;
  2919. position: static;
  2920. &::after {
  2921. transition: 0ms;
  2922. }
  2923. }
  2924. /deep/.el-checkbox__label {
  2925. padding-left: 0;
  2926. font-size: 15px;
  2927. position: absolute;
  2928. top: 1px;
  2929. left: 25px;
  2930. }
  2931. }
  2932. &-infobox {
  2933. width: 250px;
  2934. height: 40px;
  2935. display: flex;
  2936. align-items: center;
  2937. justify-content: center;
  2938. position: absolute;
  2939. border: none;
  2940. right: 10%;
  2941. top: 15px;
  2942. pointer-events: auto;
  2943. color: #fff;
  2944. font-size: 20px;
  2945. }
  2946. &-leftjuanlianInfo {
  2947. position: absolute;
  2948. width: 250px;
  2949. border-left: 5px solid #2fb8ff;
  2950. left: 0px;
  2951. top: 15px;
  2952. pointer-events: auto;
  2953. color: #e6a23c;
  2954. font-size: 20px;
  2955. background-image: linear-gradient(90deg, @mapTitleBgColor, #00000000);
  2956. padding: 5px 10px;
  2957. -moz-user-select: none;
  2958. -webkit-user-select: none;
  2959. -ms-user-select: none;
  2960. -khtml-user-select: none;
  2961. user-select: none;
  2962. cursor: pointer;
  2963. }
  2964. &-leftjuanlianInfo .top {
  2965. position: absolute;
  2966. height: 3px;
  2967. left: -5px;
  2968. width: 100%;
  2969. top: -6px;
  2970. background-image: linear-gradient(90deg, @mapTitleBgColor, #00000000);
  2971. border-left: 5px solid #2fb8ff;
  2972. }
  2973. &-leftjuanlianInfo .bottom {
  2974. position: absolute;
  2975. height: 3px;
  2976. left: -5px;
  2977. width: 100%;
  2978. bottom: -6px;
  2979. background-image: linear-gradient(90deg, @mapTitleBgColor, #00000000);
  2980. border-left: 5px solid #2fb8ff;
  2981. }
  2982. &-leftjuanlianInfo .mapTitle {
  2983. display: flex;
  2984. flex-direction: row;
  2985. flex-wrap: nowrap;
  2986. align-content: center;
  2987. align-items: center;
  2988. & > div:nth-child(1) {
  2989. display: flex;
  2990. flex-direction: column;
  2991. flex-wrap: nowrap;
  2992. align-content: space-around;
  2993. justify-content: space-evenly;
  2994. align-items: center;
  2995. & div {
  2996. width: 3px;
  2997. height: 3px;
  2998. background-color: #2fb8ff;
  2999. transform: rotate(45deg);
  3000. margin: 3px;
  3001. }
  3002. }
  3003. & > div:nth-child(2) {
  3004. width: 6px;
  3005. height: 6px;
  3006. background-color: #2fb8ff;
  3007. transform: rotate(45deg);
  3008. margin: 6px;
  3009. }
  3010. & > div:nth-child(3) {
  3011. font-size: 25px;
  3012. letter-spacing: 2px;
  3013. font-weight: bold;
  3014. font-family: zhihun181;
  3015. }
  3016. }
  3017. &-rightjuanlianInfo .mapTitle {
  3018. display: flex;
  3019. flex-direction: row-reverse;
  3020. flex-wrap: nowrap;
  3021. align-content: center;
  3022. align-items: center;
  3023. & > div:nth-child(1) {
  3024. display: flex;
  3025. flex-direction: column;
  3026. flex-wrap: nowrap;
  3027. align-content: space-around;
  3028. justify-content: space-evenly;
  3029. align-items: center;
  3030. & div {
  3031. width: 3px;
  3032. height: 3px;
  3033. background-color: #2fb8ff;
  3034. transform: rotate(45deg);
  3035. margin: 3px;
  3036. }
  3037. }
  3038. & > div:nth-child(2) {
  3039. width: 6px;
  3040. height: 6px;
  3041. background-color: #2fb8ff;
  3042. transform: rotate(45deg);
  3043. margin: 6px;
  3044. }
  3045. & > div:nth-child(3) {
  3046. font-size: 25px;
  3047. letter-spacing: 2px;
  3048. font-weight: bold;
  3049. font-family: zhihun181;
  3050. }
  3051. }
  3052. .unMapTitlective {
  3053. color: #2fb8ff;
  3054. }
  3055. .mapTitlective {
  3056. background-image: linear-gradient(0deg, #33eeff, #ffffff);
  3057. background-clip: text;
  3058. color: transparent;
  3059. }
  3060. &-rightjuanlianInfo .top {
  3061. position: absolute;
  3062. height: 3px;
  3063. right: -5px;
  3064. width: 100%;
  3065. top: -6px;
  3066. background-image: linear-gradient(-90deg, @mapTitleBgColor, #00000000);
  3067. border-right: 5px solid #2fb8ff;
  3068. }
  3069. &-rightjuanlianInfo .bottom {
  3070. position: absolute;
  3071. height: 3px;
  3072. right: -5px;
  3073. width: 100%;
  3074. bottom: -6px;
  3075. background-image: linear-gradient(-90deg, @mapTitleBgColor, #00000000);
  3076. border-right: 5px solid #2fb8ff;
  3077. }
  3078. &-rightjuanlianInfo {
  3079. position: absolute;
  3080. width: 250px;
  3081. border-right: 5px solid #2fb8ff;
  3082. right: 0;
  3083. top: 15px;
  3084. pointer-events: auto;
  3085. color: #303133;
  3086. font-size: 20px;
  3087. background-image: linear-gradient(-90deg, @mapTitleBgColor, #00000000);
  3088. padding: 5px 10px;
  3089. -moz-user-select: none;
  3090. -webkit-user-select: none;
  3091. -ms-user-select: none;
  3092. -khtml-user-select: none;
  3093. user-select: none;
  3094. cursor: pointer;
  3095. }
  3096. &-searchbox {
  3097. width: 300px;
  3098. height: 40px;
  3099. display: flex;
  3100. align-items: center;
  3101. justify-content: center;
  3102. position: absolute;
  3103. left: 22%;
  3104. top: 30px;
  3105. pointer-events: auto;
  3106. /deep/.el-input-group__append,
  3107. .el-input-group__prepend {
  3108. background-color: transparent;
  3109. color: #fff;
  3110. border-left: none;
  3111. }
  3112. /deep/.el-input-group--append .el-input__inner,
  3113. .el-input-group__prepend {
  3114. border-right: none;
  3115. }
  3116. }
  3117. &-searchresult {
  3118. width: 300px;
  3119. height: 400px;
  3120. overflow: auto;
  3121. position: absolute;
  3122. left: 22%;
  3123. top: 90px;
  3124. pointer-events: auto;
  3125. border-radius: 4px;
  3126. outline: none;
  3127. box-sizing: border-box;
  3128. border: 1px solid rgb(243, 237, 237, 0.6);
  3129. padding: 5px;
  3130. text-align: left;
  3131. background: rgba(0, 47, 86, 0.4);
  3132. &-item {
  3133. cursor: pointer;
  3134. width: 100%;
  3135. height: 70px;
  3136. text-align: left;
  3137. display: flex;
  3138. flex-direction: column;
  3139. justify-content: center;
  3140. align-items: center;
  3141. border-bottom: 1px solid rgba(0, 47, 86, 0.2);
  3142. &:hover {
  3143. background: rgba(0, 238, 255, 0.2);
  3144. }
  3145. .icon {
  3146. position: relative;
  3147. top: 22px;
  3148. left: -130px;
  3149. height: 24px;
  3150. width: 24px;
  3151. background: @commonBorderColor;
  3152. //margin-right: 8px;
  3153. font-size: 12px;
  3154. color: #fff;
  3155. text-align: center;
  3156. line-height: 24px;
  3157. font-weight: 400;
  3158. border-radius: 50%;
  3159. }
  3160. .title {
  3161. width: 90%;
  3162. height: 30px;
  3163. font-size: 14px;
  3164. font-weight: 600;
  3165. position: relative;
  3166. top: -10px;
  3167. left: 22px;
  3168. text-overflow: ellipsis;
  3169. color: #fff;
  3170. }
  3171. .address {
  3172. position: relative;
  3173. left: 22px;
  3174. width: 90%;
  3175. height: 35px;
  3176. font-size: 12px;
  3177. margin-top: -1px;
  3178. color: #fff;
  3179. }
  3180. }
  3181. }
  3182. &-basemapswitch {
  3183. width: 310px;
  3184. height: 80px;
  3185. // border: 1px solid black;
  3186. position: absolute;
  3187. right: 420px;
  3188. bottom: 20px;
  3189. display: flex;
  3190. align-items: center;
  3191. justify-content: space-around;
  3192. pointer-events: auto;
  3193. .basemapBox {
  3194. cursor: pointer;
  3195. border-radius: 5px;
  3196. width: 90px;
  3197. height: 70px;
  3198. border: 1px solid rgba(255, 255, 255, 0.6);
  3199. background-repeat: no-repeat;
  3200. background-size: 99% 98%;
  3201. position: relative;
  3202. &-titlebox {
  3203. width: 70px;
  3204. height: 30px;
  3205. position: absolute;
  3206. right: 0;
  3207. bottom: 0;
  3208. background: rgba(20, 20, 20, 0.5);
  3209. display: flex;
  3210. align-items: center;
  3211. justify-content: center;
  3212. color: rgba(255, 255, 255, 0.7);
  3213. font-size: 14px;
  3214. }
  3215. &-panel {
  3216. width: 90px;
  3217. height: 150px;
  3218. border: 1px solid rgba(255, 255, 255, 0.6);
  3219. position: absolute;
  3220. left: 0;
  3221. top: -160px;
  3222. background: url("../assets/map/basemap-list-back.png") no-repeat center;
  3223. overflow: auto;
  3224. .panel-item {
  3225. width: 100%;
  3226. height: 30px;
  3227. color: rgba(255, 255, 255, 0.6);
  3228. display: flex;
  3229. align-items: center;
  3230. justify-content: center;
  3231. border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  3232. font-size: 14px;
  3233. &:hover {
  3234. color: rgb(0, 170, 255, 0.4);
  3235. }
  3236. }
  3237. }
  3238. &:hover {
  3239. box-shadow: 0 2px 15px 3px rgb(0, 170, 255, 0.6);
  3240. & > div:nth-child(2) {
  3241. border: 1px solid rgb(0, 170, 255, 0.4);
  3242. }
  3243. & > div:nth-child(1) {
  3244. background: rgb(0, 170, 255, 0.4);
  3245. color: rgba(20, 20, 20, 1);
  3246. font-weight: bold;
  3247. }
  3248. }
  3249. }
  3250. }
  3251. &-backbtn {
  3252. width: 120px;
  3253. height: 35px;
  3254. background: @commonBorderColor;
  3255. color: #fff;
  3256. border-radius: 3px;
  3257. position: absolute;
  3258. left: 15px;
  3259. bottom: 15px;
  3260. pointer-events: auto;
  3261. transition: 0.6s;
  3262. cursor: pointer;
  3263. z-index: 999;
  3264. .left-arrow {
  3265. width: 7px;
  3266. height: 7px;
  3267. border-top: 2px solid #ffffff;
  3268. border-right: 2px solid #ffffff;
  3269. transform: translate(-50%, -50%) rotate(225deg);
  3270. position: absolute;
  3271. top: 16.5px;
  3272. left: 25px;
  3273. }
  3274. .title {
  3275. width: 80px;
  3276. height: 35px;
  3277. line-height: 35px;
  3278. position: absolute;
  3279. left: 34px;
  3280. }
  3281. &:hover {
  3282. background: #00aaff;
  3283. }
  3284. }
  3285. &-legendbox {
  3286. position: absolute;
  3287. right: 410px;
  3288. top: 40px;
  3289. z-index: 1;
  3290. &.closePanel {
  3291. right: 30px;
  3292. }
  3293. }
  3294. /* 弹窗 */
  3295. &-popup {
  3296. position: fixed;
  3297. left: 0;
  3298. right: 0;
  3299. margin: 100px auto;
  3300. pointer-events: auto;
  3301. z-index: 99;
  3302. }
  3303. /* 左侧面板开启按钮 */
  3304. &-leftopenbox {
  3305. position: absolute;
  3306. left: 5px;
  3307. width: 50px;
  3308. height: 100%;
  3309. display: flex;
  3310. flex-direction: column;
  3311. justify-content: center;
  3312. & > div {
  3313. pointer-events: auto;
  3314. width: 40px;
  3315. height: 40px;
  3316. border-radius: 50%;
  3317. background: rgba(102, 203, 255, 1);
  3318. position: relative;
  3319. cursor: pointer;
  3320. & > div {
  3321. position: absolute;
  3322. top: 8px;
  3323. left: 16px;
  3324. display: inline-block;
  3325. width: 0px;
  3326. height: 0px;
  3327. border: 12px solid transparent;
  3328. border-left-color: #fff;
  3329. }
  3330. }
  3331. }
  3332. /* 右侧面板开启按钮 */
  3333. &-rightopenbox {
  3334. position: absolute;
  3335. right: 0;
  3336. width: 50px;
  3337. height: 100%;
  3338. display: flex;
  3339. flex-direction: column;
  3340. justify-content: center;
  3341. & > div {
  3342. pointer-events: auto;
  3343. width: 40px;
  3344. height: 40px;
  3345. border-radius: 50%;
  3346. cursor: pointer;
  3347. position: relative;
  3348. background: rgba(102, 203, 255, 1);
  3349. & > div {
  3350. position: absolute;
  3351. top: 8px;
  3352. right: 16px;
  3353. display: inline-block;
  3354. width: 0px;
  3355. height: 0px;
  3356. border: 12px solid transparent;
  3357. border-right-color: #fff;
  3358. }
  3359. }
  3360. }
  3361. /* 左边树状面板 */
  3362. &-left {
  3363. width: 400px;
  3364. height: 85%;
  3365. position: absolute;
  3366. top: 60px;
  3367. left: 0;
  3368. background: url("../assets/image/tree_background.png") no-repeat center;
  3369. background-size: 100% 100%;
  3370. pointer-events: auto;
  3371. .close-btnbox {
  3372. position: absolute;
  3373. right: -20px;
  3374. height: 100%;
  3375. width: 40px;
  3376. display: flex;
  3377. flex-direction: column;
  3378. justify-content: center;
  3379. & > div {
  3380. pointer-events: auto;
  3381. width: 40px;
  3382. height: 40px;
  3383. border-radius: 50%;
  3384. cursor: pointer;
  3385. position: relative;
  3386. background: rgba(102, 203, 255, 1);
  3387. & > div {
  3388. position: absolute;
  3389. top: 8px;
  3390. right: 16px;
  3391. display: inline-block;
  3392. width: 0px;
  3393. height: 0px;
  3394. border: 12px solid transparent;
  3395. border-right-color: #fff;
  3396. }
  3397. }
  3398. }
  3399. .control-container {
  3400. width: 100%;
  3401. height: 8%;
  3402. display: flex;
  3403. justify-content: flex-end;
  3404. align-items: center;
  3405. position: relative;
  3406. &-pin-btn {
  3407. width: 30px;
  3408. height: 30px;
  3409. background: url("../assets/image/panel_unlock.png") no-repeat center;
  3410. position: absolute;
  3411. top: 0;
  3412. right: 3px;
  3413. cursor: pointer;
  3414. &.lock-style {
  3415. background: url("../assets/image/panel_lock.png") no-repeat center;
  3416. }
  3417. }
  3418. &-input {
  3419. width: 200px;
  3420. position: absolute;
  3421. bottom: 5px;
  3422. left: 30px;
  3423. /deep/.el-input__inner {
  3424. font-size: 15px;
  3425. height: 35px;
  3426. }
  3427. }
  3428. &-select {
  3429. width: 130px;
  3430. position: absolute;
  3431. bottom: 7px;
  3432. right: 35px;
  3433. }
  3434. }
  3435. .contant-container {
  3436. width: 100%;
  3437. height: 92%;
  3438. overflow: auto;
  3439. display: flex;
  3440. align-items: center;
  3441. justify-content: center;
  3442. &-innerbox {
  3443. width: 90%;
  3444. height: 98%;
  3445. .tree-arrow {
  3446. position: relative;
  3447. top: 0;
  3448. left: 0;
  3449. display: inline-block;
  3450. width: 0px;
  3451. height: 0px;
  3452. border: 7px solid transparent;
  3453. border-left-color: #fff;
  3454. }
  3455. .tree-arrow-expanded {
  3456. position: relative;
  3457. top: 4px;
  3458. left: -3px;
  3459. display: inline-block;
  3460. width: 0px;
  3461. height: 0px;
  3462. border: 7px solid transparent;
  3463. border-top-color: #fff;
  3464. }
  3465. .custom-tree-node {
  3466. position: relative;
  3467. width: 250px;
  3468. .el-checkbox {
  3469. width: 100%;
  3470. }
  3471. &-item {
  3472. max-width: 220px;
  3473. overflow: hidden;
  3474. white-space: nowrap;
  3475. text-overflow: ellipsis;
  3476. }
  3477. }
  3478. }
  3479. }
  3480. }
  3481. /* 右面板 -- 显示标记疑点 */
  3482. &-right {
  3483. width: 400px;
  3484. height: 85%;
  3485. position: absolute;
  3486. top: 60px;
  3487. right: 0;
  3488. background: url("../assets/image/tree_background.png") no-repeat center;
  3489. background-size: 100% 100%;
  3490. pointer-events: auto;
  3491. z-index: 2;
  3492. // 关闭折叠面板
  3493. .close-btnbox {
  3494. position: absolute;
  3495. left: -20px;
  3496. height: 100%;
  3497. width: 40px;
  3498. display: flex;
  3499. flex-direction: column;
  3500. justify-content: center;
  3501. & > div {
  3502. pointer-events: auto;
  3503. width: 40px;
  3504. height: 40px;
  3505. border-radius: 50%;
  3506. background: rgba(102, 203, 255, 1);
  3507. position: relative;
  3508. cursor: pointer;
  3509. & > div {
  3510. position: absolute;
  3511. top: 8px;
  3512. left: 16px;
  3513. display: inline-block;
  3514. width: 0px;
  3515. height: 0px;
  3516. border: 12px solid transparent;
  3517. border-left-color: #fff;
  3518. }
  3519. }
  3520. }
  3521. .control-container {
  3522. width: 100%;
  3523. height: 5%;
  3524. position: relative;
  3525. & > div {
  3526. width: 30px;
  3527. height: 30px;
  3528. background: url("../assets/image/panel_unlock.png") no-repeat center;
  3529. position: absolute;
  3530. top: 0;
  3531. left: 3px;
  3532. cursor: pointer;
  3533. &.lock-style {
  3534. background: url("../assets/image/panel_lock.png") no-repeat center;
  3535. }
  3536. }
  3537. }
  3538. .contant-container {
  3539. width: 100%;
  3540. height: 95%;
  3541. overflow: auto;
  3542. display: flex;
  3543. align-items: center;
  3544. justify-content: center;
  3545. &-innerbox {
  3546. width: 90%;
  3547. height: 98%;
  3548. .el-collapse-item__header {
  3549. .status-select {
  3550. width: 300px;
  3551. height: 30px;
  3552. display: flex;
  3553. align-items: center;
  3554. justify-content: flex-start;
  3555. font-size: 15px;
  3556. .title {
  3557. width: 200px;
  3558. height: 30px;
  3559. line-height: 30px;
  3560. overflow: hidden;
  3561. white-space: nowrap;
  3562. text-overflow: ellipsis;
  3563. }
  3564. /deep/.el-input__suffix {
  3565. right: -15px;
  3566. }
  3567. }
  3568. .all-icon {
  3569. position: relative;
  3570. left: 10px;
  3571. display: flex;
  3572. align-items: center;
  3573. justify-content: space-around;
  3574. width: 100px;
  3575. & > div {
  3576. width: 30px;
  3577. height: 30px;
  3578. }
  3579. &-locate {
  3580. background: url("../assets/map/white_locate.png") no-repeat center;
  3581. }
  3582. &-visible {
  3583. background: url("../assets/map/white_hide.png") no-repeat center;
  3584. &.click {
  3585. background: url("../assets/map/white_display.png") no-repeat
  3586. center;
  3587. }
  3588. }
  3589. }
  3590. }
  3591. .panel-list-item {
  3592. position: relative;
  3593. margin: 0 auto;
  3594. width: 80%;
  3595. height: auto;
  3596. background: #00aaff;
  3597. font-family: "PingFangSC SC";
  3598. font-weight: 400;
  3599. font-size: 18px;
  3600. line-height: 40px;
  3601. background: rgba(0, 47, 86, 0.3);
  3602. color: #fff;
  3603. padding-left: 20px;
  3604. border-left: 1px solid rgba(207, 222, 255, 0.2);
  3605. border-right: 1px solid rgba(207, 222, 255, 0.2);
  3606. border-bottom: 1px solid rgba(207, 222, 255, 0.2);
  3607. cursor: pointer;
  3608. .title-section {
  3609. max-width: 160px;
  3610. overflow: hidden;
  3611. white-space: nowrap;
  3612. text-overflow: ellipsis;
  3613. font-size: 14px;
  3614. }
  3615. .normal-icon {
  3616. position: absolute;
  3617. right: 20px;
  3618. top: 0;
  3619. display: flex;
  3620. align-items: center;
  3621. justify-content: space-around;
  3622. width: 120px;
  3623. color: #666666;
  3624. }
  3625. .operation-icon {
  3626. position: absolute;
  3627. right: 60px;
  3628. top: 0;
  3629. display: flex;
  3630. align-items: center;
  3631. justify-content: space-around;
  3632. width: 75px;
  3633. // background: red;
  3634. }
  3635. .visible-icon {
  3636. position: absolute;
  3637. right: 20px;
  3638. top: 9.5px;
  3639. width: 20px;
  3640. height: 20px;
  3641. background: url("../assets/map/eye_invisible.png") no-repeat center;
  3642. &.click {
  3643. background: url("../assets/map/eye_visible.png") no-repeat center;
  3644. }
  3645. }
  3646. }
  3647. .panel-footer {
  3648. border: none;
  3649. width: 100%;
  3650. height: 50px;
  3651. margin-top: 10px;
  3652. overflow-x: auto;
  3653. }
  3654. }
  3655. }
  3656. }
  3657. /* 侧边栏收缩动画效果 */
  3658. /* 左边 */
  3659. .fade-left-enter-from {
  3660. opacity: 0;
  3661. transform: translateX(-300px);
  3662. }
  3663. .fade-left-enter-to {
  3664. opacity: 1;
  3665. transform: translateX(0);
  3666. }
  3667. /* 主动输入控住过渡的持续时间和缓动曲线 */
  3668. .fade-left-enter-active {
  3669. transition: all 0.3s ease;
  3670. }
  3671. .fade-left-leave-from {
  3672. opacity: 1;
  3673. transform: translateX(0);
  3674. }
  3675. .fade-left-leave-to {
  3676. opacity: 0;
  3677. transform: translateX(-300px);
  3678. }
  3679. .fade-left-leave-active {
  3680. transition: all 0.3s ease;
  3681. }
  3682. /* 右边 */
  3683. .fade-right-enter-from {
  3684. opacity: 0;
  3685. transform: translateX(300px);
  3686. }
  3687. .fade-right-enter-to {
  3688. opacity: 1;
  3689. transform: translateX(0);
  3690. }
  3691. .fade-right-enter-active {
  3692. transition: all 0.3s ease;
  3693. }
  3694. .fade-right-leave-from {
  3695. opacity: 1;
  3696. transform: translateX(0);
  3697. }
  3698. .fade-right-leave-to {
  3699. opacity: 0;
  3700. transform: translateX(300px);
  3701. }
  3702. .fade-right-leave-active {
  3703. transition: all 0.3s ease;
  3704. }
  3705. }
  3706. </style>