ComprehensiveAnalysis.vue 105 KB

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