ComprehensiveAnalysis.vue 104 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182
  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.map.fitBounds(map2DViewer.polygons[data.id].getBounds());
  1116. }
  1117. },
  1118. labelAllLocate() {
  1119. if (map2DViewer.groups["我的标记图层组"]) {
  1120. map2DViewer.map.fitBounds(map2DViewer.groups["我的标记图层组"].getBounds());
  1121. }
  1122. },
  1123. labelAllVisible() {
  1124. this.labelAllVisibleChecked = !this.labelAllVisibleChecked;
  1125. },
  1126. panelMouseEnter(val) {
  1127. if (this.rightPanelDataMap.has(val)) {
  1128. this.enteredPanelId = val;
  1129. this.enteredColumnId = this.rightPanelDataMap.get(val).columnId;
  1130. this.enteredMainType = this.rightPanelDataMap.get(val).mainType;
  1131. this.enteredSourceType = this.rightPanelDataMap.get(val).sourceType;
  1132. }
  1133. },
  1134. handleSizeChange(val) {
  1135. console.log(`每页 ${val} 条`);
  1136. this.currentPageSize = val;
  1137. this.changeSingleLayer(this.currentPage, this.currentPageSize, this.enteredPanelId);
  1138. },
  1139. /**
  1140. * 渲染上传的疑点数据
  1141. * 1. 根据unique更新我的图层节点;
  1142. * 2. 默认打开该图层;
  1143. * 3. 显示疑点数目,属性数据,分页数据等信息
  1144. */
  1145. renderUploadedData(data) {
  1146. let uniqueId = data.id;
  1147. this.layerIdMap.set(uniqueId, uniqueId);
  1148. // 图层未初始化
  1149. if (!map2DViewer.analysisGroups[uniqueId]) {
  1150. // 生成图例时设置初始图层颜色
  1151. this.setLayerLegend(uniqueId, uniqueId);
  1152. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  1153. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1154. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  1155. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  1156. }
  1157. let caseArr = JSON.parse(data.data).map(ele => {
  1158. // 坐标转换
  1159. let coordinates = ele.geometry.coordinates;
  1160. if (coordinates.length > 0) {
  1161. ele.geometry.coordinates = this.latLngsTransform(coordinates);
  1162. return {
  1163. id: publicFun.buildGuid(uniqueId),
  1164. c_boolean: "未标记",
  1165. title: data.label,
  1166. mainType: "我的图层",
  1167. c_content: JSON.stringify(ele)
  1168. };
  1169. }
  1170. });
  1171. if (!this.originalDataMap.has(uniqueId)) {
  1172. this.originalDataMap.set(uniqueId, caseArr);
  1173. }
  1174. // 该图层疑点总数
  1175. this.targetLayerTotal[uniqueId] = caseArr.length;
  1176. // 分页组件total
  1177. this.paginationData.total = caseArr.length;
  1178. this.currentTotal += caseArr.length;
  1179. console.log(caseArr, "即将渲染的上传图层数据");
  1180. caseArr.forEach(ele => {
  1181. let cid = ele.id;
  1182. let geometry = this.addLayerDataSource(ele.c_content, ele.mainType, data.label);
  1183. let defaultStatus = ele.c_boolean;
  1184. let color = this.collectColorMap.get(this.collectColorMapIndex);
  1185. this.$store.state.mapMethodsCollection
  1186. .get("RENDER")
  1187. .addSinglePolygon(geometry, cid, color, uniqueId, data.mainType, "", defaultStatus, "", "");
  1188. });
  1189. // 激活当前展开面板
  1190. this.activeNames = ["myLabel", uniqueId];
  1191. // 用于分页数据
  1192. this.originalData[uniqueId] = this.originalDataMap.get(uniqueId);
  1193. this.isSortCaseObj[uniqueId] = data.mainType;
  1194. // 进行分页列表展示
  1195. this.changeSingleLayer(1, this.currentPageSize, uniqueId);
  1196. }
  1197. },
  1198. getMapData(uniqueId, columnId, mainType, sourceType, layerName) {
  1199. let layerParams = new FormData();
  1200. layerParams = {
  1201. columnId: columnId,
  1202. states: "0,1,2,3",
  1203. pageSize: 500,
  1204. page: this.targetLayerPage[uniqueId]
  1205. };
  1206. if (mainType === "预设模型") {
  1207. this.enteredPanelId = uniqueId;
  1208. let searchParam = [];
  1209. let paramTown = {
  1210. field: "c_xzqh",
  1211. // 等值查询
  1212. searchType: "1",
  1213. content: {
  1214. value: this.classTextToIndex["浦东新区行政区划"].get(this.townSelectVal || "老港镇")
  1215. }
  1216. };
  1217. searchParam.push(paramTown);
  1218. layerParams.search = JSON.stringify(searchParam);
  1219. }
  1220. this.$Post(this.urlsCollection.selectContentList, layerParams).then(
  1221. res => {
  1222. if (res.code === 202 && res.content === "数据不存在") {
  1223. this.layerLoading = false;
  1224. // 初始化请求 page为0时,提示无数据
  1225. if (this.targetLayerPage[uniqueId] === 0) {
  1226. this.$message.info("暂无数据!");
  1227. }
  1228. }
  1229. if (res.code === 200) {
  1230. this.layerLoading = false;
  1231. }
  1232. if (res.code === 200 && res.content.data.length > 0) {
  1233. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  1234. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  1235. }
  1236. // 初始化时将请求到的疑点数据中是否疑点全部改为未标记,疑点,非疑点三种状态
  1237. let changeCaseStatusArr = res.content.data.map(ele => {
  1238. let targetBoolean = "未标记";
  1239. // 预设模型下的targetBoolean默认是undefined
  1240. if (mainType == "预设模型" && ele.c_boolean == true) {
  1241. targetBoolean = "疑点";
  1242. }
  1243. if (mainType == "预设模型" && ele.c_boolean == false) {
  1244. targetBoolean = "非疑点";
  1245. }
  1246. return {
  1247. id: ele.id,
  1248. column_name: ele.column_name,
  1249. c_boolean: targetBoolean,
  1250. c_xzqh: ele.c_xzqh,
  1251. c_content: ele.c_content,
  1252. c_date_time: ele.c_date_time,
  1253. title: ele.title,
  1254. model_id: ele.model_id,
  1255. column_id: ele.column_id,
  1256. content: ele.content,
  1257. secret_level: ele.secret_level,
  1258. mainType: mainType
  1259. };
  1260. });
  1261. // 存储请求到的疑点数据
  1262. if (!this.originalDataMap.has(uniqueId)) {
  1263. this.originalDataMap.set(uniqueId, changeCaseStatusArr);
  1264. } else {
  1265. let arr = this.originalDataMap.get(uniqueId).concat(changeCaseStatusArr);
  1266. this.originalDataMap.set(uniqueId, arr);
  1267. }
  1268. // 该图层疑点总数
  1269. this.targetLayerTotal[uniqueId] = res.content.count;
  1270. // 分页组件total
  1271. this.paginationData.total = this.originalDataMap.get(uniqueId).length;
  1272. // 当前图层id存在
  1273. if (
  1274. map2DViewer.analysisGroups[uniqueId] &&
  1275. this.originalDataMap.get(uniqueId).length > 0 &&
  1276. res.content.data.length > 0
  1277. ) {
  1278. // 统计所有图斑数
  1279. this.currentTotal += res.content.data.length;
  1280. // 请求到数据后直接渲染点
  1281. changeCaseStatusArr.forEach(ele => {
  1282. let cid = ele.id;
  1283. let geometry = this.addLayerDataSource(ele.c_content, mainType, layerName);
  1284. let defaultStatus = ele.c_boolean;
  1285. let modelId = ele.model_id;
  1286. let columnId = ele.column_id;
  1287. let color = this.collectColorMap.get(this.collectColorMapIndex);
  1288. if (defaultStatus === "疑点") {
  1289. color = `rgb(${caseColorChange["isPointColor"][0]},${caseColorChange["isPointColor"][1]},${caseColorChange["isPointColor"][2]})`;
  1290. }
  1291. if (defaultStatus === "非疑点") {
  1292. color = `rgb(${caseColorChange["notPointColor"][0]},${caseColorChange["notPointColor"][1]},${caseColorChange["notPointColor"][2]})`;
  1293. }
  1294. this.$store.state.mapMethodsCollection
  1295. .get("RENDER")
  1296. .addSinglePolygon(geometry, cid, color, uniqueId, mainType, sourceType, defaultStatus, modelId, columnId);
  1297. });
  1298. // 激活当前展开面板
  1299. this.activeNames = ["myLabel", uniqueId];
  1300. // 用于分页数据
  1301. this.originalData[uniqueId] = this.originalDataMap.get(uniqueId);
  1302. this.isSortCaseObj[uniqueId] = mainType;
  1303. // 进行分页列表展示
  1304. this.changeSingleLayer(1, this.currentPageSize, uniqueId);
  1305. // 当前图斑数小于数据库中的图斑总数时,递归请求图斑
  1306. if (this.originalDataMap.get(uniqueId).length <= this.targetLayerTotal[uniqueId]) {
  1307. this.targetLayerPage[uniqueId]++;
  1308. this.getMapData(uniqueId, columnId, mainType, sourceType);
  1309. }
  1310. }
  1311. }
  1312. },
  1313. error => {
  1314. this.layerLoading = false;
  1315. if (this.targetLayerPage[uniqueId]) {
  1316. this.$message.error("请求错误!");
  1317. }
  1318. }
  1319. );
  1320. },
  1321. /**
  1322. * 获取图层信息 -- 所有模型和预设模型
  1323. * @columnId
  1324. * @id label_columnId
  1325. * @mainType 所有图层/预设模型
  1326. * @sourceType 土地资源/林地资源/生态资源/水资源/全部
  1327. * @layerName 图层名称
  1328. */
  1329. displaySingleLayer(columnId, id, mainType, sourceType, layerName) {
  1330. let uniqueId = id;
  1331. this.layerIdMap.set(uniqueId, uniqueId);
  1332. // 图层未初始化
  1333. if (!map2DViewer.analysisGroups[uniqueId]) {
  1334. // 生成图例时设置初始图层颜色
  1335. this.setLayerLegend(uniqueId, uniqueId);
  1336. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  1337. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1338. this.targetLayerPage[uniqueId] = 0;
  1339. if (!this.layerLoading && this.targetLayerPage[uniqueId] === 0) {
  1340. this.layerLoading = true;
  1341. }
  1342. this.getMapData(uniqueId, columnId, mainType, sourceType, layerName);
  1343. }
  1344. },
  1345. /**
  1346. * 切换页时改变图层数据
  1347. * @val 当前页
  1348. * @currentPageSize 当前面板pageSize
  1349. * @id label_columnId
  1350. * @mainType 所有图层/预设模型
  1351. * @sourceType 土地资源,水资源,林地资源,全部
  1352. */
  1353. changeSingleLayer(val, currentPageSize, id) {
  1354. let uniqueId = id;
  1355. if (map2DViewer.analysisGroups[uniqueId]) {
  1356. this.paginationData.currentPage = val;
  1357. this.originalData[uniqueId] = [];
  1358. let oldData = this.originalDataMap.get(uniqueId);
  1359. this.originalData[uniqueId] = oldData.slice((val - 1) * currentPageSize, val * currentPageSize);
  1360. // 激活当前展开面板
  1361. // this.activeNames = ["myLabel", uniqueId];
  1362. }
  1363. },
  1364. // 数据字典查询 -- 根据内容获取对应的index
  1365. // this.classTextToIndex["任务类型"]
  1366. classDictQuery(type, cName, keyName) {
  1367. let params = new FormData();
  1368. params = {
  1369. type: type,
  1370. cName: cName
  1371. };
  1372. this.$Post(this.urlsCollection.selectByCNameAType, params).then(res => {
  1373. if (res.code === 200 && res.content.length > 0) {
  1374. this.classTextToIndex[keyName] = new Map();
  1375. res.content.forEach(v => {
  1376. this.classTextToIndex[keyName].set(v.name, v.index + "");
  1377. });
  1378. }
  1379. });
  1380. },
  1381. // 获取分级栏目列表
  1382. getColumnList() {
  1383. this.modelData = [];
  1384. this.$Post(this.urlsCollection.getColumnList).then(res => {
  1385. if (res.code === 200 && res.content.length > 0) {
  1386. let data = res.content.map(item1 => {
  1387. if (item1.title === "所有图层" && item1.columnList.length > 0) {
  1388. this.firstLevelIdMap.set(item1.title, {
  1389. id: `${item1.title}_${item1.id}`,
  1390. label: item1.title
  1391. });
  1392. if (item1.columnList && item1.columnList.length > 0) {
  1393. item1.columnList.map(item2 => {
  1394. if (item2.columnList && item2.columnList.length > 0) {
  1395. //存储所有镇相关的数据
  1396. this.townSelectTreeMap.set(item2.title, {
  1397. id: item2.id,
  1398. data: !item2.columnList || item2.columnList.length === 0 ? [] : item2.columnList
  1399. });
  1400. }
  1401. });
  1402. }
  1403. return {
  1404. id: `${item1.title}_${item1.id}`,
  1405. label: item1.title,
  1406. children: []
  1407. };
  1408. }
  1409. if (item1.title === "预设模型" && item1.columnList.length > 0) {
  1410. this.firstLevelIdMap.set(item1.title, {
  1411. id: `${item1.title}_${item1.id}`,
  1412. label: item1.title
  1413. });
  1414. return {
  1415. id: `${item1.title}_${item1.id}`,
  1416. label: item1.title,
  1417. children:
  1418. !item1.columnList || item1.columnList.length === 0
  1419. ? []
  1420. : item1.columnList.map(item2 => {
  1421. return {
  1422. id: `${item2.title}_${item2.id}`,
  1423. label: item2.title,
  1424. children:
  1425. !item2.columnList || item2.columnList.length === 0
  1426. ? []
  1427. : item2.columnList.map(item3 => {
  1428. this.rightPanelDataMap.set(`${item3.title}_${item3.id}`, {
  1429. // id: item3.id,
  1430. // mainType: item1.title,
  1431. // sourceType: item2.title,
  1432. id: `${item3.title}_${item3.id}`,
  1433. label: item3.title,
  1434. sourceType: item2.title,
  1435. mainType: item1.title,
  1436. columnId: item3.id,
  1437. children: [],
  1438. disabled: false
  1439. });
  1440. defaultModelNameMap.set(item3.title, `${item3.title}_${item3.id}`);
  1441. return {
  1442. id: `${item3.title}_${item3.id}`,
  1443. label: item3.title,
  1444. sourceType: item2.title,
  1445. mainType: item1.title,
  1446. columnId: item3.id,
  1447. children: [],
  1448. disabled: false
  1449. };
  1450. })
  1451. };
  1452. })
  1453. };
  1454. }
  1455. if (item1.title === "我的模型") {
  1456. this.firstLevelIdMap.set(item1.title, {
  1457. id: `${item1.title}_${item1.id}`,
  1458. label: item1.title
  1459. });
  1460. this.myModelIdMap.set(`${item1.title}_${item1.id}`, `${item1.title}_${item1.id}`);
  1461. return {
  1462. id: `${item1.title}_${item1.id}`,
  1463. children: [],
  1464. label: item1.title
  1465. };
  1466. }
  1467. if (item1.title === "疑点问题" || item1.title === "我的图层") {
  1468. this.firstLevelIdMap.set(item1.title, {
  1469. id: `${item1.title}_${item1.id}`,
  1470. label: item1.title
  1471. });
  1472. return {
  1473. id: `${item1.title}_${item1.id}`,
  1474. label: item1.title,
  1475. children:
  1476. !item1.columnList || item1.columnList.length === 0
  1477. ? []
  1478. : item1.columnList.map(item2 => {
  1479. // 疑点问题
  1480. this.problemIdMap.set(item1.title, {
  1481. id: `${item2.title}_${item2.id}`,
  1482. label: item2.title
  1483. });
  1484. this.rightPanelDataMap.set(`${item2.title}_${item2.id}`, {
  1485. id: `${item2.title}_${item2.id}`,
  1486. label: item2.title,
  1487. mainType: item1.title,
  1488. columnId: item2.id,
  1489. modelId: item2.modelId,
  1490. sourceType: "土地资源",
  1491. children: []
  1492. });
  1493. return {
  1494. id: `${item2.title}_${item2.id}`,
  1495. label: item2.title,
  1496. mainType: item1.title,
  1497. columnId: item2.id,
  1498. modelId: item2.modelId,
  1499. sourceType: "土地资源",
  1500. children: []
  1501. };
  1502. })
  1503. };
  1504. }
  1505. });
  1506. data.forEach(v => {
  1507. if (v) {
  1508. this.modelData.push(v);
  1509. }
  1510. });
  1511. // 获取我的模型数据
  1512. let oldOptions = [];
  1513. this.getMyModelData(false, "");
  1514. this.classTextToIndex["浦东新区行政区划"].forEach((v, i) => {
  1515. if (this.townSelectTreeMap.has(i)) {
  1516. oldOptions.push({
  1517. value: i,
  1518. label: i
  1519. });
  1520. }
  1521. });
  1522. let arrDistrict = oldOptions.filter(v => {
  1523. if (v.value.indexOf("区") > -1) {
  1524. return v;
  1525. }
  1526. });
  1527. let arrTown1 = oldOptions.filter(v => {
  1528. if (v.value.indexOf("镇") > -1 && v.value === "老港镇") {
  1529. return v;
  1530. }
  1531. });
  1532. let arrTown2 = oldOptions.filter(v => {
  1533. if (v.value.indexOf("镇") > -1 && v.value === "泥城镇") {
  1534. return v;
  1535. }
  1536. });
  1537. let arrTown3 = oldOptions.filter(v => {
  1538. if (v.value.indexOf("镇") > -1 && v.value !== "老港镇" && v.value !== "泥城镇") {
  1539. return v;
  1540. }
  1541. });
  1542. let arrStreet = oldOptions.filter(v => {
  1543. if (v.value.indexOf("道") > -1) {
  1544. return v;
  1545. }
  1546. });
  1547. this.townOptions = [...arrDistrict, ...arrTown1, ...arrTown2, ...arrTown3, ...arrStreet];
  1548. }
  1549. });
  1550. },
  1551. /**
  1552. *@isShow 是否显示我的模型中特定节点的图层数据
  1553. *@treeKeyId 具体是哪个节点
  1554. */
  1555. getMyModelData(isShow, treeKeyId) {
  1556. let params = new FormData();
  1557. params = {
  1558. columnId: 49,
  1559. states: "0,1,2,3",
  1560. pageSize: 20,
  1561. page: 0
  1562. };
  1563. // 如果刚执行完自定义模型叠置功能 -- 更新节点后需要显示叠置的数据,指定需要的变量
  1564. let uniqueKeyId = "";
  1565. let uniqueKeyChild = "";
  1566. this.$Post(this.urlsCollection.selectContentList, params)
  1567. .then(res => {
  1568. if (res.code === 200 && res.content.data.length > 0) {
  1569. let children = res.content.data.map(ele => {
  1570. // 如果刚执行完自定义模型叠置功能 -- 更新节点后需要显示叠置的数据
  1571. if (isShow && ele.id === treeKeyId) {
  1572. uniqueKeyId = `${ele.title}_${ele.id}`;
  1573. uniqueKeyChild = {
  1574. id: `${ele.title}_${ele.id}`,
  1575. label: ele.title,
  1576. modelId: ele.id,
  1577. children: [],
  1578. column_id: ele.column_id,
  1579. model_name: ele.model_name,
  1580. model_id: ele.model_id,
  1581. state: ele.state,
  1582. mainType: "我的模型",
  1583. c_bind_layer: ele.c_bind_layer,
  1584. c_layer_name: ele.c_layer_name,
  1585. c_dzfx_file: ele.c_dzfx_file || ""
  1586. };
  1587. }
  1588. customModelIdMap.set(ele.title, {
  1589. column_id: ele.column_id,
  1590. id: `${ele.title}_${ele.id}`,
  1591. modelId: ele.id
  1592. });
  1593. this.rightPanelDataMap.set(`${ele.title}_${ele.id}`, {
  1594. id: `${ele.title}_${ele.id}`,
  1595. mainType: "我的模型",
  1596. sourceType: "",
  1597. label: ele.title,
  1598. children: [],
  1599. column_id: ele.column_id,
  1600. model_name: ele.model_name,
  1601. model_id: ele.model_id,
  1602. state: ele.state,
  1603. mainType: "我的模型",
  1604. c_bind_layer: ele.c_bind_layer,
  1605. c_layer_name: ele.c_layer_name,
  1606. c_dzfx_file: ele.c_dzfx_file || ""
  1607. });
  1608. return {
  1609. id: `${ele.title}_${ele.id}`,
  1610. label: ele.title,
  1611. modelId: ele.id,
  1612. children: [],
  1613. sourceType: "",
  1614. column_id: ele.column_id,
  1615. model_name: ele.model_name,
  1616. model_id: ele.model_id,
  1617. state: ele.state,
  1618. mainType: "我的模型",
  1619. c_bind_layer: ele.c_bind_layer,
  1620. c_layer_name: ele.c_layer_name,
  1621. c_dzfx_file: ele.c_dzfx_file || ""
  1622. };
  1623. });
  1624. if (this.modelData.length > 0) {
  1625. if (this.$refs.tree) {
  1626. this.$refs.tree.updateKeyChildren(this.firstLevelIdMap.get("我的模型").id, children);
  1627. if (isShow) {
  1628. // // 所有图层或预设模型全部删除 -- 同时删除所有相关内容
  1629. this.closeAllRelatedLayers();
  1630. console.log("开始更新我的模型节点了!!!");
  1631. this.expandedKeys.push(this.firstLevelIdMap.get("我的模型").id);
  1632. console.log(treeKeyId, "显示特定节点的我的模型数据", uniqueKeyId);
  1633. console.log(uniqueKeyChild, "uniqueKeyChild");
  1634. this.$refs.tree.setCheckedKeys([uniqueKeyId]);
  1635. this.$refs.tree.setCurrentKey(uniqueKeyId);
  1636. // 延迟显示数据
  1637. setTimeout(() => {
  1638. this.handleCheckChange(uniqueKeyChild, true);
  1639. }, 800);
  1640. }
  1641. }
  1642. }
  1643. }
  1644. })
  1645. .catch(err => {
  1646. console.log(err, "getMyModelData");
  1647. });
  1648. },
  1649. // 调用我的标记接口
  1650. getUserMarkers() {
  1651. if (localStorage.getItem("USER_ID")) {
  1652. let paramData = new FormData();
  1653. paramData = {
  1654. userId: Number(localStorage.getItem("USER_ID")),
  1655. sourceId: 0,
  1656. pageSize: 10
  1657. };
  1658. if (!map2DViewer.groups["我的标记图层组"]) {
  1659. map2DViewer.groups["我的标记图层组"] = L.featureGroup();
  1660. map2DViewer.groups["我的标记图层组"].addTo(map2DViewer.map);
  1661. }
  1662. this.$Post(this.urlsCollection.selectByUser, paramData).then(res => {
  1663. if (res.code === 200 && res.content.length >= 1) {
  1664. this.$store.state.myLabelPointsArr = [];
  1665. this.$store.state.myLabelPointsArr = res.content.map(v => {
  1666. let data = JSON.parse(v.geojson);
  1667. let name = data.properties.name;
  1668. myLabelNameMap.set(name, v.geojson);
  1669. return {
  1670. id: v.id,
  1671. geojson: v.geojson,
  1672. type: v.type
  1673. };
  1674. });
  1675. }
  1676. // res.content 返回数据为空
  1677. if (res.code === 205) {
  1678. this.$store.state.myLabelPointsArr = [];
  1679. }
  1680. });
  1681. }
  1682. },
  1683. // 回退事件
  1684. backEvent() {
  1685. if (this.$store.state.backMenu.index && this.$store.state.backMenu.subIndex) {
  1686. this.$store.commit("changeNavSelect", {
  1687. index: this.$store.state.backMenu.index,
  1688. subIndex: this.$store.state.backMenu.subIndex,
  1689. name: this.$store.state.backMenu.name ? this.$store.state.backMenu.name : ""
  1690. });
  1691. }
  1692. },
  1693. // 左侧面板的显示与隐藏
  1694. leftPanelDisplay(val) {
  1695. if (val === "show") {
  1696. this.showLeftBox = true;
  1697. this.leftBoxBtn = false;
  1698. }
  1699. if (val === "hide") {
  1700. this.showLeftBox = false;
  1701. this.leftBoxBtn = true;
  1702. }
  1703. },
  1704. // 右侧面板的显示与隐藏
  1705. rightPanelDisplay(val) {
  1706. if (val === "show") {
  1707. this.showRightBox = true;
  1708. this.rightBoxBtn = false;
  1709. }
  1710. if (val === "hide") {
  1711. this.showRightBox = false;
  1712. this.rightBoxBtn = true;
  1713. }
  1714. },
  1715. leftPanelLock() {
  1716. this.isLeftLock = !this.isLeftLock;
  1717. },
  1718. rightPanelLock() {
  1719. this.isRightLock = !this.isRightLock;
  1720. },
  1721. // 节点过滤事件
  1722. filterNode(value, data) {
  1723. if (!value) return true;
  1724. return data.label.indexOf(value) !== -1;
  1725. },
  1726. // 定位功能失效
  1727. locateEvent(node) {
  1728. if (this.layerIdMap.has(node.data.id)) {
  1729. this.layerIdMap.get(node.data.id);
  1730. if (map2DViewer.analysisGroups[node.data.id].getBounds()) {
  1731. map2DViewer.map.fitBounds(map2DViewer.analysisGroups[node.data.id].getBounds());
  1732. }
  1733. }
  1734. },
  1735. handleUpdate(node) {
  1736. this.$bus.$emit("updateModel", node);
  1737. },
  1738. handleDelete(node) {
  1739. let deleteParams = {
  1740. id: customModelIdMap.get(node.data.label).modelId,
  1741. columnId: 49,
  1742. state: 4
  1743. };
  1744. this.$Post(this.urlsCollection.updateAudit, deleteParams).then(res => {
  1745. if (res.code === 200) {
  1746. this.$message.info("模型已删除!");
  1747. if (map2DViewer.analysisGroups[node.data.id]) {
  1748. this.handleCheckChange(node.data, false);
  1749. }
  1750. this.getMyModelData(false, "");
  1751. }
  1752. });
  1753. },
  1754. // 节点change事件
  1755. handleCheckChange(data, checked) {
  1756. console.log(data, checked);
  1757. if (data.mainType && data.mainType !== "我的模型") {
  1758. if (checked) {
  1759. this.showRightBox = true;
  1760. // 第一级菜单是所有图层
  1761. if (data.mainType === "所有图层") {
  1762. this.rightPanelTitle = data.id;
  1763. let searchParam = [];
  1764. let targetTown = this.classTextToIndex["浦东新区行政区划"].get(data.townType);
  1765. let targetType = this.classTextToIndex["任务类型"].get(data.sourceType);
  1766. this.$store.state.treeDataCollection.set(data.id, {
  1767. // mainType: data.mainType,
  1768. townId: data.townId,
  1769. townType: data.townType,
  1770. sourceId: data.sourceId,
  1771. sourceType: data.sourceType,
  1772. layerId: data.id,
  1773. layerName: data.label
  1774. });
  1775. let paramUser = {
  1776. field: "c_user_id",
  1777. searchType: "1",
  1778. content: {
  1779. value: localStorage.getItem("USER_ID")
  1780. }
  1781. };
  1782. searchParam.push(paramUser);
  1783. let paramTown = {
  1784. field: "c_area_code",
  1785. searchType: "1",
  1786. content: {
  1787. value: targetTown
  1788. }
  1789. };
  1790. searchParam.push(paramTown);
  1791. let paramType = {
  1792. field: "c_task_type",
  1793. searchType: "1",
  1794. content: {
  1795. value: targetType
  1796. }
  1797. };
  1798. searchParam.push(paramType);
  1799. let params = new FormData();
  1800. params = {
  1801. columnId: 48,
  1802. states: "2,3",
  1803. pageSize: 10,
  1804. page: 0,
  1805. search: JSON.stringify(searchParam)
  1806. };
  1807. this.$Post(this.urlsCollection.selectContentList, params).then(res => {
  1808. // 暂不设置权限要求
  1809. layerAuthorityMap.set(data.id, "有权限");
  1810. this.displaySingleLayer(
  1811. data.columnId,
  1812. data.id,
  1813. data.mainType,
  1814. data.sourceType ? data.sourceType : "",
  1815. data.label
  1816. );
  1817. // if (res.code === 202 && res.content === "数据不存在") {
  1818. // this.$message.info("当前用户无权限!");
  1819. // layerAuthorityMap.set(data.id, "无权限");
  1820. // }
  1821. // if (res.code === 200 && res.content.data.length > 0) {
  1822. // layerAuthorityMap.set(data.id, "有权限");
  1823. // this.displaySingleLayer(data.columnId, data.id, data.mainType, data.sourceType ? data.sourceType : "");
  1824. // }
  1825. });
  1826. }
  1827. // 第一级菜单是预设模型
  1828. if (data.mainType === "预设模型") {
  1829. layerAuthorityMap.set(data.id, "有权限");
  1830. this.$store.state.preModelLayerMap.push(data.id);
  1831. this.rightPanelTitle = data.id;
  1832. this.displaySingleLayer(data.columnId, data.id, data.mainType, data.sourceType ? data.sourceType : "", data.label);
  1833. }
  1834. // 第一级菜单是疑点问题
  1835. if (data.mainType === "疑点问题") {
  1836. layerAuthorityMap.set(data.id, "有权限");
  1837. this.rightPanelTitle = data.id;
  1838. this.displaySingleLayer(data.columnId, data.id, data.mainType, data.sourceType ? data.sourceType : "", data.label);
  1839. }
  1840. // 第一级菜单是我的图层 -- 不请求接口
  1841. if (data.mainType === "我的图层") {
  1842. layerAuthorityMap.set(data.id, "有权限");
  1843. this.rightPanelTitle = data.label;
  1844. this.renderUploadedData(data);
  1845. }
  1846. } else {
  1847. if (
  1848. this.$store.state.selectSelectDataMap["singlePolygon"] &&
  1849. this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
  1850. ) {
  1851. delete this.$store.state.selectSelectDataMap["singlePolygon"][data.id];
  1852. }
  1853. // 取消勾选当前图层勾选,图斑数改变, 如果是所有图层数据移除折叠面板
  1854. if (this.originalDataMap && this.originalDataMap.has(data.id) && this.currentTotal > 0) {
  1855. this.currentTotal -= this.originalDataMap.get(data.id).length;
  1856. this.originalDataMap.delete(data.id);
  1857. if (this.originalData && this.originalData[data.id]) {
  1858. delete this.originalData[data.id];
  1859. }
  1860. }
  1861. if (data.mainType === "预设模型" && this.$store.state.preModelLayerMap.includes(data.id)) {
  1862. this.$store.state.preModelLayerMap.splice(this.$store.state.preModelLayerMap.indexOf(data.id), 1);
  1863. }
  1864. // 统计后小于0改为0
  1865. if (this.currentTotal < 0) {
  1866. this.currentTotal = 0;
  1867. }
  1868. map2DViewer.map.closePopup();
  1869. // 移除图例
  1870. if (this.legendTitle.length > 0) {
  1871. this.legendTitle = this.legendTitle.filter(v => {
  1872. return v.uniqueId !== data.id;
  1873. });
  1874. this.legendIcon = this.legendIcon.filter(v => {
  1875. return v.uniqueId !== data.id;
  1876. });
  1877. }
  1878. this.layerIdMap.has(data.id) && this.layerIdMap.delete(data.id);
  1879. //关联自定义模型
  1880. this.$store.state.treeDataCollection.has(data.id) && this.$store.state.treeDataCollection.delete(data.id);
  1881. // 只激活我的标记
  1882. this.activeNames = ["myLabel"];
  1883. this.$store.state.mapMethodsCollection.get("RENDER").deleteGroupFromMap(data.id);
  1884. // 移除图层id
  1885. if (map2DViewer.analysisGroups[data.id]) {
  1886. delete this.targetLayerTotal[data.id];
  1887. delete map2DViewer.analysisGroups[data.id];
  1888. }
  1889. }
  1890. }
  1891. // 第一级菜单是我的模型
  1892. if (data.mainType && data.mainType === "我的模型") {
  1893. // 显示叠置分析的数据
  1894. checked ? this.displayMyModelData(data) : this.deleteMyModelData(data);
  1895. }
  1896. },
  1897. // 显示我的模型数据
  1898. displayMyModelData(data) {
  1899. this.$nextTick(() => {
  1900. if (this.$refs.tree) {
  1901. this.$refs.tree.setCheckedKeys([data.id]);
  1902. }
  1903. });
  1904. let uniqueId = data.id;
  1905. // 我的模型图层组初始化
  1906. if (!map2DViewer.analysisGroups[uniqueId]) {
  1907. map2DViewer.analysisGroups[uniqueId] = L.featureGroup();
  1908. map2DViewer.analysisGroups[uniqueId].addTo(map2DViewer.map);
  1909. this.layerIdMap.set(uniqueId, uniqueId);
  1910. if (!this.$store.state.selectSelectDataMap["singlePolygon"]) {
  1911. this.$store.state.selectSelectDataMap["singlePolygon"] = [];
  1912. }
  1913. // 如果有叠置分析文件 -- 呈现叠置分析内容
  1914. if (data.c_dzfx_file) {
  1915. this.$Get(this.uploadBaseUrl + data.c_dzfx_file, "").then(response => {
  1916. if (response.geometries.length === 0) {
  1917. this.$message.info("未发现叠置的几何体!");
  1918. }
  1919. if (response.geometries.length > 0) {
  1920. if (map2DViewer.analysisGroups[uniqueId]) {
  1921. let uniqueIdList = [];
  1922. if (this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId]) {
  1923. uniqueIdList = this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId];
  1924. }
  1925. // 生成图例时设置初始化图层颜色 -- 叠置分析的图层
  1926. this.setLayerLegend(`叠置-${uniqueId}`, uniqueId);
  1927. // 清除当前图层组内所有图层,并读取GeoJSON数据
  1928. map2DViewer.analysisGroups[uniqueId].clearLayers();
  1929. // 叠置分析图斑数统计
  1930. this.targetLayerTotal[uniqueId] = response.geometries.length;
  1931. this.currentTotal += response.geometries.length;
  1932. // 存储请求到的疑点数据
  1933. this.originalDataMap.set(uniqueId, response.geometries);
  1934. // 存储叠置分析中所有的面
  1935. let statesArr = [];
  1936. let color = this.collectColorMap.get(this.collectColorMapIndex);
  1937. // 仅显示面数据
  1938. response.geometries.forEach(v => {
  1939. if (v.type != "" && v.type != "Point" && v.type != "LineString" && v.coordinates.length > 0) {
  1940. let geoData = this.overlayStandardGeojson(v);
  1941. let singlePolygonItem = {
  1942. uniqueId: `overlay_${uniqueId}`,
  1943. geometry: JSON.stringify(geoData),
  1944. cid: publicFun.buildGuid(data.label),
  1945. color: color
  1946. };
  1947. uniqueIdList.push(singlePolygonItem);
  1948. this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId] = uniqueIdList;
  1949. statesArr.push(geoData);
  1950. }
  1951. });
  1952. this.readGeojson(statesArr, data.id, color);
  1953. }
  1954. }
  1955. });
  1956. } else {
  1957. this.layerLoading = true;
  1958. let params = new FormData();
  1959. params = {
  1960. modelId: data.modelId,
  1961. userId: localStorage.getItem("USER_ID")
  1962. };
  1963. // 调用我的模型查看接口读取所有图层数据
  1964. this.$Post(this.urlsCollection.getModelCoverAgeInfo, params).then(res => {
  1965. if (res.code !== 201 && res.code !== 200) {
  1966. this.layerLoading = false;
  1967. this.$message.info("数据请求失败,请重新请求!");
  1968. }
  1969. if (res.code === 201 && res.message === "未申请任务权限") {
  1970. this.layerLoading = false;
  1971. this.$message.info("暂无数据!");
  1972. }
  1973. if (res.code === 200) {
  1974. this.layerLoading = false;
  1975. }
  1976. if (res.code === 200 && res.content.length > 0) {
  1977. // 清除当前图层组内所有图层,并读取GeoJSON数据
  1978. map2DViewer.analysisGroups[uniqueId].clearLayers();
  1979. // 判断我的模型中目前有多少个图层
  1980. let layerTotalArr = [];
  1981. let layerLegendColorMap = new Map();
  1982. let changeCaseStatusArr = res.content.map(ele => {
  1983. if (!layerTotalArr.includes(ele.column_name)) {
  1984. layerTotalArr.push(ele.column_name);
  1985. this.setLayerLegend(ele.column_name, uniqueId);
  1986. layerLegendColorMap.set(ele.column_name, this.collectColorMap.get(this.collectColorMapIndex));
  1987. }
  1988. return {
  1989. id: ele.id,
  1990. column_name: ele.column_name,
  1991. c_boolean: "未标记",
  1992. c_xzqh: ele.c_xzqh,
  1993. c_content: ele.c_content,
  1994. c_date_time: ele.c_date_time,
  1995. title: ele.title,
  1996. model_id: ele.model_id,
  1997. column_id: ele.column_id,
  1998. content: ele.content,
  1999. secret_level: ele.secret_level,
  2000. mainType: data.mainType
  2001. };
  2002. });
  2003. // 存储请求到的疑点数据
  2004. this.originalDataMap.set(uniqueId, changeCaseStatusArr);
  2005. // 该图层疑点总数
  2006. this.targetLayerTotal[uniqueId] = res.content.length;
  2007. // 分页组件total
  2008. this.paginationData.total = this.originalDataMap.get(uniqueId).length;
  2009. // 当前图层的id存在
  2010. if (
  2011. map2DViewer.analysisGroups[uniqueId] &&
  2012. this.originalDataMap.get(uniqueId).length > 0 &&
  2013. changeCaseStatusArr.length > 0
  2014. ) {
  2015. // 统计所有图斑数
  2016. this.currentTotal += changeCaseStatusArr.length;
  2017. // 请求到数据后直接渲染点
  2018. changeCaseStatusArr.forEach(ele => {
  2019. let cid = ele.id;
  2020. let geometry = this.addLayerDataSource(ele.c_content, data.mainType, data.label);
  2021. let modelId = ele.model_id;
  2022. let columnId = ele.column_id;
  2023. this.$store.state.mapMethodsCollection
  2024. .get("RENDER")
  2025. .addSinglePolygon(
  2026. geometry,
  2027. cid,
  2028. layerLegendColorMap.get(ele.column_name),
  2029. uniqueId,
  2030. data.mainType,
  2031. "",
  2032. "",
  2033. modelId,
  2034. columnId
  2035. );
  2036. });
  2037. }
  2038. // 激活当前展开面板
  2039. this.activeNames = ["myLabel", uniqueId];
  2040. // 我的模型数据进行分页列表展示
  2041. this.originalData[uniqueId] = this.originalDataMap.get(uniqueId);
  2042. this.isSortCaseObj[uniqueId] = data.mainType;
  2043. // 进行分页列表展示
  2044. this.changeSingleLayer(1, this.currentPageSize, uniqueId);
  2045. }
  2046. });
  2047. }
  2048. }
  2049. },
  2050. // geojson直接读取的坐标顺序是经纬度
  2051. readGeojson(geojsonArr, uniqueId, color) {
  2052. let geojsonData = L.geoJSON(geojsonArr, {
  2053. style: function (feature) {
  2054. return { color: color };
  2055. }
  2056. }).addTo(map2DViewer.map);
  2057. map2DViewer.analysisGroups[uniqueId] = geojsonData;
  2058. },
  2059. // 我的模型图层取消勾选
  2060. deleteMyModelData(data) {
  2061. // 直接删除图层组中的数据
  2062. if (map2DViewer.analysisGroups[data.id]) {
  2063. map2DViewer.map.removeLayer(map2DViewer.analysisGroups[data.id]);
  2064. }
  2065. if (
  2066. this.$store.state.selectSelectDataMap["singlePolygon"] &&
  2067. this.$store.state.selectSelectDataMap["singlePolygon"][data.id]
  2068. ) {
  2069. delete this.$store.state.selectSelectDataMap["singlePolygon"][data.id];
  2070. }
  2071. // 取消勾选当前图层勾选,图斑数改变, 如果是所有图层数据移除折叠面板
  2072. if (this.originalDataMap && this.originalDataMap.has(data.id) && this.currentTotal > 0) {
  2073. this.currentTotal -= this.originalDataMap.get(data.id).length;
  2074. this.originalDataMap.delete(data.id);
  2075. if (this.originalData && this.originalData[data.id]) {
  2076. delete this.originalData[data.id];
  2077. delete this.isSortCaseObj[data.id];
  2078. }
  2079. }
  2080. // 统计后小于0改为0
  2081. if (this.currentTotal < 0) {
  2082. this.currentTotal = 0;
  2083. }
  2084. map2DViewer.map.closePopup();
  2085. // 移除图例
  2086. if (this.legendTitle.length > 0) {
  2087. this.legendTitle = this.legendTitle.filter(v => {
  2088. return v.uniqueId !== data.id;
  2089. });
  2090. this.legendIcon = this.legendIcon.filter(v => {
  2091. return v.uniqueId !== data.id;
  2092. });
  2093. }
  2094. this.layerIdMap.has(data.id) && this.layerIdMap.delete(data.id);
  2095. // 只激活我的标记
  2096. this.activeNames = ["myLabel"];
  2097. this.$store.state.mapMethodsCollection.get("RENDER").deleteGroupFromMap(data.id);
  2098. // 移除图层id
  2099. if (map2DViewer.analysisGroups[data.id]) {
  2100. delete this.targetLayerTotal[data.id];
  2101. delete map2DViewer.analysisGroups[data.id];
  2102. }
  2103. },
  2104. //显示详细信息
  2105. viewDetailsPopup(data) {
  2106. this.$store.state.bottomMenuIndexs.index = -1;
  2107. this.$store.state.bottomMenuIndexs.subIndex = -1;
  2108. this.updateCasePopupShow = false;
  2109. this.tableType = "normal";
  2110. this.boxWidth = "600";
  2111. this.boxHeight = "600";
  2112. this.tableData = [];
  2113. let obj = JSON.parse(data).properties;
  2114. this.tableData.push(obj);
  2115. this.attrTableShow = true;
  2116. },
  2117. // 右侧面板项点击事件
  2118. listItemClick(type, data) {
  2119. this.$store.state.bottomMenuIndexs.index = -1;
  2120. this.$store.state.bottomMenuIndexs.subIndex = -1;
  2121. this.updateCasePopupShow = false;
  2122. this.tableData = [];
  2123. if (type === "default") {
  2124. this.tableType = "normal";
  2125. this.boxWidth = "600";
  2126. this.boxHeight = "600";
  2127. if (data.c_content) {
  2128. let obj = JSON.parse(data.c_content).properties;
  2129. this.tableData.push(obj);
  2130. }
  2131. }
  2132. if (type === "new") {
  2133. this.rightLabelData.forEach(item => {
  2134. if (item.id == data.id) {
  2135. item.geometryChecked = false;
  2136. this.controlLabel(item);
  2137. }
  2138. });
  2139. if (data.featureType === "点") {
  2140. this.$store.state.mapMethodsCollection.get("RENDER").setView(data.coord, 6);
  2141. } else {
  2142. map2DViewer.map.fitBounds(map2DViewer.myLabels[`label_${data.id}`].getBounds());
  2143. }
  2144. let geojsonData = JSON.parse(data.geojson);
  2145. let geoType = geojsonData.properties.featureType;
  2146. let area = geojsonData.properties.area;
  2147. let distance = parseFloat(geojsonData.properties.distance).toFixed(2) + " 公里";
  2148. this.$store.state.mapMethodsCollection.get("RENDER").drawGeometry(geoType, data);
  2149. this.tableType = "personal";
  2150. this.boxWidth = "300";
  2151. this.boxHeight = "300";
  2152. this.tableData.push({
  2153. 名称: data.name,
  2154. 类别: data.type,
  2155. 描述: data.des,
  2156. 距离: distance,
  2157. 面积: area
  2158. });
  2159. }
  2160. this.attrTableShow = true;
  2161. },
  2162. closeEvent() {
  2163. this.attrTableShow = false;
  2164. },
  2165. // 关闭修改标记弹窗
  2166. closeLabelEvent() {
  2167. this.updateCasePopupShow = false;
  2168. },
  2169. modifyLabelEvent() {
  2170. this.$nextTick(() => {
  2171. let selectType = this.$refs.updateLabelRef.selectVal;
  2172. let desContent = this.$refs.updateLabelRef.textContent;
  2173. let currentNameInput = this.$refs.updateLabelRef.nameInput;
  2174. let geojson = JSON.parse(this.$refs.updateLabelRef.geojson);
  2175. let geometryType = geojson.properties.featureTypeIndex;
  2176. if (myLabelNameMap.has(currentNameInput) && currentNameInput !== geojson.properties.name) {
  2177. this.$message.info("该名称已存在,请重新输入!");
  2178. } else {
  2179. let id = this.$refs.updateLabelRef.id;
  2180. let params = new FormData();
  2181. let nameInput = this.$refs.updateLabelRef.nameInput;
  2182. // 修改标题和描述
  2183. geojson.properties.title = selectType;
  2184. geojson.properties.desc = desContent;
  2185. geojson.properties.name = nameInput;
  2186. params = {
  2187. userId: Number(localStorage.getItem("USER_ID")),
  2188. sourceId: 0,
  2189. type: geometryType,
  2190. geojson: JSON.stringify(geojson),
  2191. id: id
  2192. };
  2193. this.$Post(this.urlsCollection.updateConllection, params).then(
  2194. res => {
  2195. if (res.code === 200) {
  2196. this.updateCasePopupShow = false;
  2197. this.getUserMarkers();
  2198. this.$message.success("修改成功!");
  2199. }
  2200. },
  2201. error => {
  2202. this.$message.error("保存失败");
  2203. console.log(error);
  2204. }
  2205. );
  2206. }
  2207. });
  2208. },
  2209. // 修改标记 -- 仅支持修改类型和描述
  2210. updateLabel(val) {
  2211. this.$store.state.bottomMenuIndexs.index = -1;
  2212. this.$store.state.bottomMenuIndexs.subIndex = -1;
  2213. this.updateCasePopupShow = true;
  2214. this.attrTableShow = false;
  2215. this.targetArea = JSON.parse(val.geojson).properties.area;
  2216. this.targetDistance = JSON.parse(val.geojson).properties.distance;
  2217. if (this.updateCasePopupShow) {
  2218. this.$nextTick(() => {
  2219. this.$refs.updateLabelRef.menuData.title = "修改标记";
  2220. this.$refs.updateLabelRef.nameInput = val.name;
  2221. this.$refs.updateLabelRef.selectVal = val.type;
  2222. this.$refs.updateLabelRef.textContent = val.des;
  2223. this.$refs.updateLabelRef.id = val.id;
  2224. this.$refs.updateLabelRef.geojson = val.geojson;
  2225. });
  2226. }
  2227. },
  2228. // 删除标记
  2229. deleteLabel(id) {
  2230. if (localStorage.getItem("USER_ID")) {
  2231. let params = new FormData();
  2232. this.$store.state.mapMethodsCollection.get("RENDER").deleteGeometry(map2DViewer.myLabels[`label_${id}`]);
  2233. map2DViewer.myLabels[`label_${id}`] = null;
  2234. params = {
  2235. userId: Number(localStorage.getItem("USER_ID")),
  2236. sourceId: 0,
  2237. id: id
  2238. };
  2239. this.$Post(this.urlsCollection.deleteConllection, params).then(res => {
  2240. if (res.code === 200) {
  2241. // console.log("疑点删除成功");
  2242. this.getUserMarkers();
  2243. }
  2244. });
  2245. }
  2246. },
  2247. // 控制标记的显示与隐藏
  2248. controlLabel(val) {
  2249. val.geometryChecked = !val.geometryChecked;
  2250. // 已经绘制了几何体
  2251. if (map2DViewer.myLabels[`label_${val.id}`]) {
  2252. if (val.featureType === "点") {
  2253. map2DViewer.myLabels[`label_${val.id}`].setOpacity(val.geometryChecked ? 1 : 0);
  2254. }
  2255. if (val.featureType !== "点") {
  2256. map2DViewer.myLabels[`label_${val.id}`].setStyle(
  2257. val.geometryChecked
  2258. ? {
  2259. opacity: 1,
  2260. fillOpacity: 0.4
  2261. }
  2262. : {
  2263. opacity: 0,
  2264. fillOpacity: 0
  2265. }
  2266. );
  2267. }
  2268. } else {
  2269. // 未绘制几何体
  2270. // console.log(val, "未绘制几何体");
  2271. if (val.geometryChecked && val.geojson) {
  2272. let geoType = JSON.parse(val.geojson).properties.featureType;
  2273. this.$store.state.mapMethodsCollection.get("RENDER").drawGeometry(geoType, val);
  2274. }
  2275. }
  2276. }
  2277. }
  2278. };
  2279. </script>
  2280. <style lang="less" scoped>
  2281. @commonBorderColor: #00aaff64;
  2282. @mapTitleBgColor: #00476b;
  2283. .comprehensive-analysis {
  2284. &-law-popup {
  2285. position: fixed;
  2286. left: 0;
  2287. right: 0;
  2288. margin: 100px auto;
  2289. pointer-events: auto;
  2290. z-index: 99;
  2291. }
  2292. &-label-popup {
  2293. position: absolute;
  2294. top: 15%;
  2295. left: 35%;
  2296. pointer-events: auto;
  2297. z-index: 99;
  2298. }
  2299. .el-checkbox {
  2300. color: #fff;
  2301. /deep/.el-checkbox__input.is-checked + .el-checkbox__label {
  2302. color: rgba(116, 255, 255, 1);
  2303. }
  2304. /deep/.el-checkbox__input.is-checked .el-checkbox__inner::after {
  2305. width: 70%;
  2306. height: 70%;
  2307. background: #74ffff;
  2308. border-radius: 0;
  2309. transform: rotate(0deg) scaleY(1);
  2310. position: static;
  2311. }
  2312. /deep/.el-checkbox__inner {
  2313. border: 1px solid #dcdfe6;
  2314. background: rgba(0, 170, 255, 0);
  2315. display: flex;
  2316. align-items: center;
  2317. justify-content: center;
  2318. position: static;
  2319. &::after {
  2320. transition: 0ms;
  2321. }
  2322. }
  2323. /deep/.el-checkbox__label {
  2324. padding-left: 0;
  2325. font-size: 15px;
  2326. position: absolute;
  2327. top: 1px;
  2328. left: 25px;
  2329. }
  2330. }
  2331. &-infobox {
  2332. width: 250px;
  2333. height: 40px;
  2334. display: flex;
  2335. align-items: center;
  2336. justify-content: center;
  2337. position: absolute;
  2338. border: none;
  2339. right: 10%;
  2340. top: 15px;
  2341. pointer-events: auto;
  2342. color: #fff;
  2343. font-size: 20px;
  2344. }
  2345. &-leftjuanlianInfo {
  2346. position: absolute;
  2347. width: 250px;
  2348. border-left: 5px solid #2fb8ff;
  2349. left: 0px;
  2350. top: 15px;
  2351. pointer-events: auto;
  2352. color: #e6a23c;
  2353. font-size: 20px;
  2354. background-image: linear-gradient(90deg, @mapTitleBgColor, #00000000);
  2355. padding: 5px 10px;
  2356. -moz-user-select: none;
  2357. -webkit-user-select: none;
  2358. -ms-user-select: none;
  2359. -khtml-user-select: none;
  2360. user-select: none;
  2361. cursor: pointer;
  2362. }
  2363. &-leftjuanlianInfo .top {
  2364. position: absolute;
  2365. height: 3px;
  2366. left: -5px;
  2367. width: 100%;
  2368. top: -6px;
  2369. background-image: linear-gradient(90deg, @mapTitleBgColor, #00000000);
  2370. border-left: 5px solid #2fb8ff;
  2371. }
  2372. &-leftjuanlianInfo .bottom {
  2373. position: absolute;
  2374. height: 3px;
  2375. left: -5px;
  2376. width: 100%;
  2377. bottom: -6px;
  2378. background-image: linear-gradient(90deg, @mapTitleBgColor, #00000000);
  2379. border-left: 5px solid #2fb8ff;
  2380. }
  2381. &-leftjuanlianInfo .mapTitle {
  2382. display: flex;
  2383. flex-direction: row;
  2384. flex-wrap: nowrap;
  2385. align-content: center;
  2386. align-items: center;
  2387. & > div:nth-child(1) {
  2388. display: flex;
  2389. flex-direction: column;
  2390. flex-wrap: nowrap;
  2391. align-content: space-around;
  2392. justify-content: space-evenly;
  2393. align-items: center;
  2394. & div {
  2395. width: 3px;
  2396. height: 3px;
  2397. background-color: #2fb8ff;
  2398. transform: rotate(45deg);
  2399. margin: 3px;
  2400. }
  2401. }
  2402. & > div:nth-child(2) {
  2403. width: 6px;
  2404. height: 6px;
  2405. background-color: #2fb8ff;
  2406. transform: rotate(45deg);
  2407. margin: 6px;
  2408. }
  2409. & > div:nth-child(3) {
  2410. font-size: 20px;
  2411. letter-spacing: 2px;
  2412. font-weight: bold;
  2413. font-family: pingfangSC;
  2414. }
  2415. }
  2416. &-rightjuanlianInfo .mapTitle {
  2417. display: flex;
  2418. flex-direction: row-reverse;
  2419. flex-wrap: nowrap;
  2420. align-content: center;
  2421. align-items: center;
  2422. & > div:nth-child(1) {
  2423. display: flex;
  2424. flex-direction: column;
  2425. flex-wrap: nowrap;
  2426. align-content: space-around;
  2427. justify-content: space-evenly;
  2428. align-items: center;
  2429. & div {
  2430. width: 3px;
  2431. height: 3px;
  2432. background-color: #2fb8ff;
  2433. transform: rotate(45deg);
  2434. margin: 3px;
  2435. }
  2436. }
  2437. & > div:nth-child(2) {
  2438. width: 6px;
  2439. height: 6px;
  2440. background-color: #2fb8ff;
  2441. transform: rotate(45deg);
  2442. margin: 6px;
  2443. }
  2444. & > div:nth-child(3) {
  2445. font-size: 20px;
  2446. letter-spacing: 2px;
  2447. font-weight: bold;
  2448. font-family: pingfangSC;
  2449. }
  2450. }
  2451. .unMapTitlective {
  2452. color: #2fb8ff;
  2453. }
  2454. .mapTitlective {
  2455. background-image: linear-gradient(0deg, #33eeff, #ffffff);
  2456. text-shadow: 0 0 5px #fff;
  2457. background-clip: text;
  2458. color: transparent;
  2459. }
  2460. &-rightjuanlianInfo .top {
  2461. position: absolute;
  2462. height: 3px;
  2463. right: -5px;
  2464. width: 100%;
  2465. top: -6px;
  2466. background-image: linear-gradient(-90deg, @mapTitleBgColor, #00000000);
  2467. border-right: 5px solid #2fb8ff;
  2468. }
  2469. &-rightjuanlianInfo .bottom {
  2470. position: absolute;
  2471. height: 3px;
  2472. right: -5px;
  2473. width: 100%;
  2474. bottom: -6px;
  2475. background-image: linear-gradient(-90deg, @mapTitleBgColor, #00000000);
  2476. border-right: 5px solid #2fb8ff;
  2477. }
  2478. &-rightjuanlianInfo {
  2479. position: absolute;
  2480. width: 250px;
  2481. border-right: 5px solid #2fb8ff;
  2482. right: 0;
  2483. top: 15px;
  2484. pointer-events: auto;
  2485. color: #303133;
  2486. font-size: 20px;
  2487. background-image: linear-gradient(-90deg, @mapTitleBgColor, #00000000);
  2488. padding: 5px 10px;
  2489. -moz-user-select: none;
  2490. -webkit-user-select: none;
  2491. -ms-user-select: none;
  2492. -khtml-user-select: none;
  2493. user-select: none;
  2494. cursor: pointer;
  2495. }
  2496. &-searchbox {
  2497. width: 300px;
  2498. height: 40px;
  2499. display: flex;
  2500. align-items: center;
  2501. justify-content: center;
  2502. position: absolute;
  2503. left: 21%;
  2504. top: 30px;
  2505. pointer-events: auto;
  2506. /deep/.el-input-group__append,
  2507. .el-input-group__prepend {
  2508. background-color: transparent;
  2509. color: #fff;
  2510. border-left: none;
  2511. }
  2512. /deep/.el-input-group--append .el-input__inner,
  2513. .el-input-group__prepend {
  2514. border-right: none;
  2515. }
  2516. }
  2517. &-basemapswitch {
  2518. width: 300px;
  2519. height: 80px;
  2520. // border: 1px solid black;
  2521. position: absolute;
  2522. right: 420px;
  2523. bottom: 20px;
  2524. display: flex;
  2525. align-items: center;
  2526. justify-content: space-around;
  2527. pointer-events: auto;
  2528. .basemapBox {
  2529. cursor: pointer;
  2530. border-radius: 5px;
  2531. width: 120px;
  2532. height: 75px;
  2533. border: 1px solid rgba(255, 255, 255, 0.6);
  2534. background-repeat: no-repeat;
  2535. background-size: 99% 98%;
  2536. position: relative;
  2537. &-titlebox {
  2538. width: 70px;
  2539. height: 30px;
  2540. position: absolute;
  2541. right: 0;
  2542. bottom: 0;
  2543. background: rgba(20, 20, 20, 0.5);
  2544. display: flex;
  2545. align-items: center;
  2546. justify-content: center;
  2547. color: rgba(255, 255, 255, 0.7);
  2548. font-size: 14px;
  2549. }
  2550. &-panel {
  2551. width: 100px;
  2552. height: 150px;
  2553. border: 1px solid rgba(255, 255, 255, 0.6);
  2554. position: absolute;
  2555. left: 0;
  2556. top: -160px;
  2557. background: url("../assets/map/basemap-list-back.png") no-repeat center;
  2558. overflow: auto;
  2559. .panel-item {
  2560. width: 100%;
  2561. height: 30px;
  2562. color: rgba(255, 255, 255, 0.6);
  2563. display: flex;
  2564. align-items: center;
  2565. justify-content: center;
  2566. border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  2567. font-size: 14px;
  2568. &:hover {
  2569. color: rgb(0, 170, 255, 0.4);
  2570. }
  2571. }
  2572. }
  2573. &:hover {
  2574. box-shadow: 0 2px 15px 3px rgb(0, 170, 255, 0.6);
  2575. & > div:nth-child(2) {
  2576. border: 1px solid rgb(0, 170, 255, 0.4);
  2577. }
  2578. & > div:nth-child(1) {
  2579. background: rgb(0, 170, 255, 0.4);
  2580. color: rgba(20, 20, 20, 1);
  2581. font-weight: bold;
  2582. }
  2583. }
  2584. }
  2585. }
  2586. &-backbtn {
  2587. width: 120px;
  2588. height: 35px;
  2589. background: @commonBorderColor;
  2590. color: #fff;
  2591. border-radius: 3px;
  2592. position: absolute;
  2593. left: 15px;
  2594. bottom: 15px;
  2595. pointer-events: auto;
  2596. transition: 0.6s;
  2597. cursor: pointer;
  2598. z-index: 999;
  2599. .left-arrow {
  2600. width: 7px;
  2601. height: 7px;
  2602. border-top: 2px solid #ffffff;
  2603. border-right: 2px solid #ffffff;
  2604. transform: translate(-50%, -50%) rotate(225deg);
  2605. position: absolute;
  2606. top: 16.5px;
  2607. left: 25px;
  2608. }
  2609. .title {
  2610. width: 80px;
  2611. height: 35px;
  2612. line-height: 35px;
  2613. position: absolute;
  2614. left: 34px;
  2615. }
  2616. &:hover {
  2617. background: #00aaff;
  2618. }
  2619. }
  2620. &-legendbox {
  2621. position: absolute;
  2622. right: 410px;
  2623. top: 30px;
  2624. z-index: 1;
  2625. }
  2626. /* 弹窗 */
  2627. &-popup {
  2628. position: fixed;
  2629. left: 0;
  2630. right: 0;
  2631. margin: 100px auto;
  2632. pointer-events: auto;
  2633. z-index: 99;
  2634. }
  2635. /* 左侧面板开启按钮 */
  2636. &-leftopenbox {
  2637. position: absolute;
  2638. left: 5px;
  2639. width: 50px;
  2640. height: 100%;
  2641. display: flex;
  2642. flex-direction: column;
  2643. justify-content: center;
  2644. & > div {
  2645. pointer-events: auto;
  2646. width: 40px;
  2647. height: 40px;
  2648. border-radius: 50%;
  2649. background: rgba(102, 203, 255, 1);
  2650. position: relative;
  2651. cursor: pointer;
  2652. & > div {
  2653. position: absolute;
  2654. top: 8px;
  2655. left: 16px;
  2656. display: inline-block;
  2657. width: 0px;
  2658. height: 0px;
  2659. border: 12px solid transparent;
  2660. border-left-color: #fff;
  2661. }
  2662. }
  2663. }
  2664. /* 右侧面板开启按钮 */
  2665. &-rightopenbox {
  2666. position: absolute;
  2667. right: 0;
  2668. width: 50px;
  2669. height: 100%;
  2670. display: flex;
  2671. flex-direction: column;
  2672. justify-content: center;
  2673. & > div {
  2674. pointer-events: auto;
  2675. width: 40px;
  2676. height: 40px;
  2677. border-radius: 50%;
  2678. cursor: pointer;
  2679. position: relative;
  2680. background: rgba(102, 203, 255, 1);
  2681. & > div {
  2682. position: absolute;
  2683. top: 8px;
  2684. right: 16px;
  2685. display: inline-block;
  2686. width: 0px;
  2687. height: 0px;
  2688. border: 12px solid transparent;
  2689. border-right-color: #fff;
  2690. }
  2691. }
  2692. }
  2693. /* 左边树状面板 */
  2694. &-left {
  2695. width: 400px;
  2696. height: 85%;
  2697. position: absolute;
  2698. top: 60px;
  2699. left: 0;
  2700. background: url("../assets/image/tree_background.png") no-repeat center;
  2701. background-size: 100% 100%;
  2702. pointer-events: auto;
  2703. .close-btnbox {
  2704. position: absolute;
  2705. right: -20px;
  2706. height: 100%;
  2707. width: 40px;
  2708. display: flex;
  2709. flex-direction: column;
  2710. justify-content: center;
  2711. & > div {
  2712. pointer-events: auto;
  2713. width: 40px;
  2714. height: 40px;
  2715. border-radius: 50%;
  2716. cursor: pointer;
  2717. position: relative;
  2718. background: rgba(102, 203, 255, 1);
  2719. & > div {
  2720. position: absolute;
  2721. top: 8px;
  2722. right: 16px;
  2723. display: inline-block;
  2724. width: 0px;
  2725. height: 0px;
  2726. border: 12px solid transparent;
  2727. border-right-color: #fff;
  2728. }
  2729. }
  2730. }
  2731. .control-container {
  2732. width: 100%;
  2733. height: 8%;
  2734. display: flex;
  2735. justify-content: flex-end;
  2736. align-items: center;
  2737. position: relative;
  2738. &-pin-btn {
  2739. width: 30px;
  2740. height: 30px;
  2741. background: url("../assets/image/panel_unlock.png") no-repeat center;
  2742. position: absolute;
  2743. top: 0;
  2744. right: 3px;
  2745. cursor: pointer;
  2746. &.lock-style {
  2747. background: url("../assets/image/panel_lock.png") no-repeat center;
  2748. }
  2749. }
  2750. &-input {
  2751. width: 200px;
  2752. position: absolute;
  2753. bottom: 5px;
  2754. left: 30px;
  2755. /deep/.el-input__inner {
  2756. font-size: 15px;
  2757. height: 35px;
  2758. }
  2759. }
  2760. &-select {
  2761. width: 130px;
  2762. position: absolute;
  2763. bottom: 7px;
  2764. right: 35px;
  2765. }
  2766. }
  2767. .contant-container {
  2768. width: 100%;
  2769. height: 92%;
  2770. overflow: auto;
  2771. display: flex;
  2772. align-items: center;
  2773. justify-content: center;
  2774. &-innerbox {
  2775. width: 90%;
  2776. height: 98%;
  2777. .tree-arrow {
  2778. position: relative;
  2779. top: 0;
  2780. left: 0;
  2781. display: inline-block;
  2782. width: 0px;
  2783. height: 0px;
  2784. border: 7px solid transparent;
  2785. border-left-color: #fff;
  2786. }
  2787. .tree-arrow-expanded {
  2788. position: relative;
  2789. top: 4px;
  2790. left: -3px;
  2791. display: inline-block;
  2792. width: 0px;
  2793. height: 0px;
  2794. border: 7px solid transparent;
  2795. border-top-color: #fff;
  2796. }
  2797. .custom-tree-node {
  2798. position: relative;
  2799. width: 250px;
  2800. .el-checkbox {
  2801. width: 100%;
  2802. }
  2803. &-item {
  2804. max-width: 220px;
  2805. overflow: hidden;
  2806. white-space: nowrap;
  2807. text-overflow: ellipsis;
  2808. }
  2809. }
  2810. }
  2811. }
  2812. }
  2813. /* 右面板 -- 显示标记疑点 */
  2814. &-right {
  2815. width: 400px;
  2816. height: 85%;
  2817. position: absolute;
  2818. top: 60px;
  2819. right: 0;
  2820. background: url("../assets/image/tree_background.png") no-repeat center;
  2821. background-size: 100% 100%;
  2822. pointer-events: auto;
  2823. z-index: 2;
  2824. // 关闭折叠面板
  2825. .close-btnbox {
  2826. position: absolute;
  2827. left: -20px;
  2828. height: 100%;
  2829. width: 40px;
  2830. display: flex;
  2831. flex-direction: column;
  2832. justify-content: center;
  2833. & > div {
  2834. pointer-events: auto;
  2835. width: 40px;
  2836. height: 40px;
  2837. border-radius: 50%;
  2838. background: rgba(102, 203, 255, 1);
  2839. position: relative;
  2840. cursor: pointer;
  2841. & > div {
  2842. position: absolute;
  2843. top: 8px;
  2844. left: 16px;
  2845. display: inline-block;
  2846. width: 0px;
  2847. height: 0px;
  2848. border: 12px solid transparent;
  2849. border-left-color: #fff;
  2850. }
  2851. }
  2852. }
  2853. .control-container {
  2854. width: 100%;
  2855. height: 5%;
  2856. position: relative;
  2857. & > div {
  2858. width: 30px;
  2859. height: 30px;
  2860. background: url("../assets/image/panel_unlock.png") no-repeat center;
  2861. position: absolute;
  2862. top: 0;
  2863. left: 3px;
  2864. cursor: pointer;
  2865. &.lock-style {
  2866. background: url("../assets/image/panel_lock.png") no-repeat center;
  2867. }
  2868. }
  2869. }
  2870. .contant-container {
  2871. width: 100%;
  2872. height: 95%;
  2873. overflow: auto;
  2874. display: flex;
  2875. align-items: center;
  2876. justify-content: center;
  2877. &-innerbox {
  2878. width: 90%;
  2879. height: 98%;
  2880. .el-collapse-item__header {
  2881. .status-select {
  2882. width: 300px;
  2883. height: 30px;
  2884. display: flex;
  2885. align-items: center;
  2886. justify-content: flex-start;
  2887. font-size: 15px;
  2888. .title {
  2889. width: 200px;
  2890. height: 30px;
  2891. line-height: 30px;
  2892. overflow: hidden;
  2893. white-space: nowrap;
  2894. text-overflow: ellipsis;
  2895. }
  2896. /deep/.el-input__suffix {
  2897. right: -15px;
  2898. }
  2899. }
  2900. .all-icon {
  2901. position: relative;
  2902. left: 10px;
  2903. display: flex;
  2904. align-items: center;
  2905. justify-content: space-around;
  2906. width: 100px;
  2907. & > div {
  2908. width: 30px;
  2909. height: 30px;
  2910. }
  2911. &-locate {
  2912. background: url("../assets/map/white_locate.png") no-repeat center;
  2913. }
  2914. &-visible {
  2915. background: url("../assets/map/white_hide.png") no-repeat center;
  2916. &.click {
  2917. background: url("../assets/map/white_display.png") no-repeat center;
  2918. }
  2919. }
  2920. }
  2921. }
  2922. .panel-list-item {
  2923. position: relative;
  2924. margin: 0 auto;
  2925. width: 80%;
  2926. height: auto;
  2927. background: #00aaff;
  2928. font-family: "PingFangSC SC";
  2929. font-weight: 400;
  2930. font-size: 18px;
  2931. line-height: 40px;
  2932. background: rgba(0, 47, 86, 0.3);
  2933. color: #fff;
  2934. padding-left: 20px;
  2935. border-left: 1px solid rgba(207, 222, 255, 0.2);
  2936. border-right: 1px solid rgba(207, 222, 255, 0.2);
  2937. border-bottom: 1px solid rgba(207, 222, 255, 0.2);
  2938. cursor: pointer;
  2939. .title-section {
  2940. max-width: 160px;
  2941. overflow: hidden;
  2942. white-space: nowrap;
  2943. text-overflow: ellipsis;
  2944. font-size: 14px;
  2945. }
  2946. .normal-icon {
  2947. position: absolute;
  2948. right: 20px;
  2949. top: 0;
  2950. display: flex;
  2951. align-items: center;
  2952. justify-content: space-around;
  2953. width: 120px;
  2954. color: #666666;
  2955. }
  2956. .operation-icon {
  2957. position: absolute;
  2958. right: 60px;
  2959. top: 0;
  2960. display: flex;
  2961. align-items: center;
  2962. justify-content: space-around;
  2963. width: 75px;
  2964. // background: red;
  2965. }
  2966. .visible-icon {
  2967. position: absolute;
  2968. right: 20px;
  2969. top: 9.5px;
  2970. width: 20px;
  2971. height: 20px;
  2972. background: url("../assets/map/eye_invisible.png") no-repeat center;
  2973. &.click {
  2974. background: url("../assets/map/eye_visible.png") no-repeat center;
  2975. }
  2976. }
  2977. }
  2978. .panel-footer {
  2979. border: none;
  2980. width: 100%;
  2981. height: 50px;
  2982. margin-top: 10px;
  2983. overflow-x: auto;
  2984. }
  2985. }
  2986. }
  2987. }
  2988. /* 侧边栏收缩动画效果 */
  2989. /* 左边 */
  2990. .fade-left-enter-from {
  2991. opacity: 0;
  2992. transform: translateX(-300px);
  2993. }
  2994. .fade-left-enter-to {
  2995. opacity: 1;
  2996. transform: translateX(0);
  2997. }
  2998. /* 主动输入控住过渡的持续时间和缓动曲线 */
  2999. .fade-left-enter-active {
  3000. transition: all 0.3s ease;
  3001. }
  3002. .fade-left-leave-from {
  3003. opacity: 1;
  3004. transform: translateX(0);
  3005. }
  3006. .fade-left-leave-to {
  3007. opacity: 0;
  3008. transform: translateX(-300px);
  3009. }
  3010. .fade-left-leave-active {
  3011. transition: all 0.3s ease;
  3012. }
  3013. /* 右边 */
  3014. .fade-right-enter-from {
  3015. opacity: 0;
  3016. transform: translateX(300px);
  3017. }
  3018. .fade-right-enter-to {
  3019. opacity: 1;
  3020. transform: translateX(0);
  3021. }
  3022. .fade-right-enter-active {
  3023. transition: all 0.3s ease;
  3024. }
  3025. .fade-right-leave-from {
  3026. opacity: 1;
  3027. transform: translateX(0);
  3028. }
  3029. .fade-right-leave-to {
  3030. opacity: 0;
  3031. transform: translateX(300px);
  3032. }
  3033. .fade-right-leave-active {
  3034. transition: all 0.3s ease;
  3035. }
  3036. }
  3037. </style>