index.vue 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283
  1. <template>
  2. <vl-map
  3. class-name="overview-map"
  4. :map.sync="map"
  5. projection="EPSG:4490"
  6. @loaded="mapLoaded"
  7. >
  8. <vl-china-cities :enabled="false" @pick="(fea) => (feature = fea)" />
  9. <vl-map-dev-info
  10. :top="140"
  11. :show-panel="false"
  12. @info-update="(v) => (viewInfo = v)"
  13. />
  14. <vl-config-layers
  15. ref="configLayer"
  16. :layers-config="layersConfig"
  17. :visible-layer-ids="realLayers"
  18. @loaded="configLayerLoaded"
  19. />
  20. <vl-tool-bar :height="34" :radius="4">
  21. <vl-tool-bar-item
  22. no-padding
  23. class="tool-box"
  24. style="width: 110px !important;color: #FFF"
  25. >
  26. <vl-tool-box
  27. ref="toolBox"
  28. :enable-scope-sketch="false"
  29. @drawend="drawend"
  30. style="width: 110px"
  31. />
  32. </vl-tool-bar-item>
  33. <vl-tool-bar-item
  34. no-padding
  35. style="margin-left: 10px;"
  36. v-show="layerShow"
  37. title="图层"
  38. >
  39. <vl-layer-tree :enabled-layers="enabledLayersConfig" />
  40. </vl-tool-bar-item>
  41. </vl-tool-bar>
  42. <vl-legend
  43. :size="40"
  44. :legend-fill="0.4"
  45. :enabled-layers="enabledLayersConfig"
  46. :default-expand="defaultExpand"
  47. v-if="legendShow"
  48. />
  49. <VlImglayers :imgLayers="imgLayers" @change="vlImgLayerChangeHandle" @change1="vlImgLayerChangeHandle1" @sliderChange="vlImgLayerSliderChangeHandle" @sliderChange1="vlImgLayerSliderChangeHandle1"> </VlImglayers>
  50. <vl-feature-flicker
  51. :feature="feature"
  52. new-layer
  53. :duration="2400"
  54. :interval="800"
  55. />
  56. <!-- 详情 -->
  57. <vl-feature-overlay
  58. v-show="overlayShow"
  59. :feature="feature"
  60. :use-centroid="false"
  61. no-styled
  62. >
  63. <template slot-scope="{ props }" v-if="detailType != 0">
  64. <div class="overlayBox">
  65. <span class="title" v-if="detailType == 1 || detailType == 2"
  66. >详情<a class="btn" @click="showLandDetail(props)">详情</a></span
  67. >
  68. <span class="title" v-if="detailType == 4 || detailType == 5"
  69. >详情<a
  70. v-if="detailType == 6"
  71. class="btn"
  72. @click="mockDetail(props)"
  73. >要素配置模拟</a
  74. ></span
  75. >
  76. <span
  77. class="title"
  78. v-if="
  79. (detailType == 5 && tzzxShow) || (detailType == 33 && tzzxShow)
  80. "
  81. >详情<a class="btn" @click="tzzxDetail(props)">提质增效</a></span
  82. >
  83. <span class="title" v-if="detailType == 10 || detailType == 11"
  84. >详情<a class="btn" @click="showSpDetail(props)">更多</a></span
  85. >
  86. <span
  87. class="title"
  88. v-if="
  89. detailType == 13 ||
  90. detailType == 14 ||
  91. detailType == 15 ||
  92. detailType == 16 ||
  93. detailType == 33
  94. "
  95. >详情</span
  96. >
  97. <span class="title" v-if="detailType == 12"
  98. >详情<a class="btn" @click="locationTsxzDetail(props)"
  99. >详情</a
  100. ></span
  101. >
  102. <span
  103. class="title"
  104. v-if="
  105. detailType == 20 ||
  106. detailType == 21 ||
  107. detailType == 22 ||
  108. detailType == 23 ||
  109. detailType == 24 ||
  110. detailType == 25 ||
  111. detailType == 26 ||
  112. detailType == 27 ||
  113. detailType == 31 ||
  114. detailType == 100
  115. "
  116. >详情<a class="btn" @click="skyb(props)">时空演变</a></span
  117. >
  118. <span
  119. class="title"
  120. v-if="
  121. detailType == 101
  122. "
  123. >控规详情<a class="btn" @click="skyb(props)">时空演变</a></span
  124. >
  125. <span class="title" v-if="detailType == 32"
  126. >详情<a
  127. v-if="detailType == 32"
  128. class="btn"
  129. @click="bjmockDetail(props)"
  130. >要素配置模拟</a
  131. ></span
  132. >
  133. <span class="title" v-if="detailType == 50 || detailType == 51">
  134. 详情
  135. </span>
  136. <span class="title" v-if="detailType == 99">
  137. 详情
  138. <a class="label" v-show="props['dksyh']">工业用地</a>
  139. <a
  140. class="label"
  141. v-show="props['tdyt'] && props['tdyt'].startsWith('07')"
  142. >住宅用地</a
  143. >
  144. <a
  145. class="label"
  146. v-show="props['tdyt'] && props['tdyt'].startsWith('0803')"
  147. >教育用地</a
  148. >
  149. <a class="label" v-show="props['新增调查地']">商业用地</a>
  150. <a class="label" v-show="props['spmj']">临时用地</a>
  151. </span>
  152. <div class="content" v-if="detailType == 1">
  153. <h2>{{ props['KFQMC'] }}</h2>
  154. <p>总面积:{{ Number(props['开发区评价面积']).toFixed(0) }}公顷</p>
  155. <p>管理机构:{{ props['开发区管理机构'] }}</p>
  156. <p>地块位置:{{ props['开发区四至范围'] }}</p>
  157. </div>
  158. <div class="content" v-if="detailType == 2">
  159. <h2>{{ props['TDQLR'] }}</h2>
  160. <p>总面积:{{ Number(props['SJYDMJ'] * 0.0015).toFixed(2) }}亩</p>
  161. <p>容积率:{{ props['SJRJL'].toFixed(1) }}</p>
  162. <p>税收总额:{{ props['SJSF2020'].toFixed(1) }}万元</p>
  163. </div>
  164. <div class="content" v-if="detailType == 4 || detailType == 6">
  165. <h2>{{ props['dkbh'] }}</h2>
  166. <p>总面积:{{ Number(props['mj'] * 15).toFixed(2) }}亩</p>
  167. <p>批复文号:{{ props['pfwh'] }}</p>
  168. <p>规划单元:{{ props['ghdy'] }}</p>
  169. </div>
  170. <div class="content" v-if="detailType == 5">
  171. <h2>{{ props['TDQLR'] }}</h2>
  172. <p>总面积:{{ Number(props['SJYDMJ'] * 0.0015).toFixed(2) }}亩</p>
  173. <p>亩均税收:{{ Number(props['mjss']).toFixed(2) }}万元/亩</p>
  174. <p>行业类别:{{ props['HYLB'] }}</p>
  175. <p>土地坐落:{{ props['TDZL'] }}</p>
  176. </div>
  177. <div class="content" v-if="detailType == 10">
  178. <h2>{{ props['xmmc'] }}</h2>
  179. <p>行政区:{{ props['szs'] || props['sxs'] }}</p>
  180. <!-- <p>面积:{{props['sjydmj']}}</p>-->
  181. <p>项目类型:{{ props['xmlx'] }}</p>
  182. </div>
  183. <div class="content" v-if="detailType == 11">
  184. <h2>{{ props['xmmc'] }}</h2>
  185. <p>行政区:{{ props['xzqmc'] }}</p>
  186. <p>面积:{{ props['ydmj'] }}亩</p>
  187. <p>总投资:{{ props['ztz'] }}亿元</p>
  188. <p>2022完成投资:{{ props['ywctz'] }}亿元</p>
  189. <p>2023计划投资:{{ props['jhtz'] }}亿元</p>
  190. </div>
  191. <div class="content" v-if="detailType == 12">
  192. <h2>{{ props['name'] }}</h2>
  193. <p>行政区:{{ props['sqs'] }}</p>
  194. <p>建成面积:{{ (props['jcmj'] * 1500).toFixed(0) }}亩</p>
  195. <p>产业类型:{{ props['cylx'] }}</p>
  196. <p>
  197. 非生产性用地面积:{{ (props['fscxydmj'] * 1500).toFixed(0) }}亩
  198. </p>
  199. </div>
  200. <div class="content" v-if="detailType == 13">
  201. <h2>{{ props['tdqlr'] }}</h2>
  202. <p>地块名称:{{ props['dkmc'] }}</p>
  203. <p>土地坐落:{{ props['tdzl'] }}</p>
  204. </div>
  205. <div class="content" v-if="detailType == 14">
  206. <h2>{{ props['xmmc'] }}</h2>
  207. <p>批准文号:{{ props['pzwh'] }}</p>
  208. <p>实际利用:{{ props['sjly'] }}</p>
  209. </div>
  210. <div class="content" v-if="detailType == 15">
  211. <h2>{{ props['dlmc'] }}</h2>
  212. <p>坐落单位名称:{{ props['zldwmc'] }}</p>
  213. <p>面积:{{ (props['tbmj'] * 0.0015).toFixed(2) }}亩</p>
  214. </div>
  215. <div class="content" v-if="detailType == 20">
  216. <h2>{{ props['dkbh'] }}</h2>
  217. <p>行政区划:{{ props['ssqx'] }} - {{ props['ssjd'] }}</p>
  218. <p>面积:{{ (props['mj'] * 15).toFixed(2) }} 亩</p>
  219. </div>
  220. <div class="content" v-if="detailType == 21">
  221. <h2>{{ props['tdqlr'] }}</h2>
  222. <p>
  223. 行政区划:{{ props['szx'] }}
  224. {{
  225. props['szxz'] && props['szxz'] !== ' '
  226. ? '-' + props['szxz']
  227. : ''
  228. }}
  229. </p>
  230. <p>用地面积:{{ (props['sjydmj'] * 0.0015).toFixed(2) }} 亩</p>
  231. </div>
  232. <div class="content" v-if="detailType == 22">
  233. <h2>{{ props['xmmc'] }}</h2>
  234. <p>批次名称:{{ props['bpxmmc'] }}</p>
  235. <p>批准文号:{{ props['pzwh'] }}</p>
  236. </div>
  237. <div class="content" v-if="detailType == 23">
  238. <h2>
  239. {{ props['dkmc'] }}
  240. {{ props['dkbh'] && props['dkbh'] !== ' ' ? props['dkbh'] : '' }}
  241. </h2>
  242. <p>项目名称:{{ props['tzxmmc'] }}</p>
  243. <p>
  244. 面积:{{ props['txmj'] && (props['txmj'] * 0.0015).toFixed(2) }}
  245. </p>
  246. </div>
  247. <div class="content" v-if="detailType == 24">
  248. <h2>{{ props['dkbh'] }}</h2>
  249. <p>行政区划:{{ '滨江区 - ' + props['dkwz'] }}</p>
  250. <p>管地单位:{{ props['gddw'] }}</p>
  251. </div>
  252. <div class="content" v-if="detailType == 25">
  253. <h2>{{ props['name'] }}</h2>
  254. <p>
  255. 面积:{{ (props['sde.sde.特色小镇.area'] * 100 * 15).toFixed(1) }}
  256. </p>
  257. </div>
  258. <div class="content" v-if="detailType == 26">
  259. <h2>{{ props['项目名称'] }}</h2>
  260. <p>面积:{{ (props['总用地面积'] * 0.0015).toFixed(2) }} 亩</p>
  261. </div>
  262. <div class="content" v-if="detailType == 27">
  263. <h2>{{ props['dkmc'] }}</h2>
  264. <p>面积:{{ (props['txmj'] * 0.0015).toFixed(2) }} 亩</p>
  265. </div>
  266. <div class="content" v-if="detailType == 31 || detailType == 33">
  267. <h2>
  268. {{
  269. props['tdqlr'] ||
  270. props['BSM'] ||
  271. props['项目名称'] ||
  272. props['dkbh']
  273. }}
  274. </h2>
  275. <p v-show="props['sjydmj']">
  276. 面积:{{ (props['sjydmj'] * 0.0015).toFixed(2) }}亩
  277. </p>
  278. <p v-show="props['mj']">
  279. 面积:{{ (props['mj'] * 15).toFixed(2) }}亩
  280. </p>
  281. <p v-show="props['txmj']">
  282. 面积:{{ (props['txmj'] * 0.0015).toFixed(2) }}亩
  283. </p>
  284. <p v-show="props['总用地面积']">
  285. 面积:{{ (props['总用地面积'] * 0.0015).toFixed(2) }}亩
  286. </p>
  287. <!-- <p>批准文号:{{ props['pzwh'] }} </p>-->
  288. </div>
  289. <div class="content" v-if="detailType == 32">
  290. <h2>{{ props['dkbh'] }}</h2>
  291. <p v-show="props['mj']">
  292. 面积:{{ (props['mj'] * 15).toFixed(2) }}亩
  293. </p>
  294. <!-- <p>批准文号:{{ props['pzwh'] }} </p>-->
  295. </div>
  296. <div class="content" v-if="detailType === 50">
  297. <h2>{{ props['dlmc'] || props['dkbh'] }}</h2>
  298. <p>
  299. 面积:{{
  300. props['tbmj']
  301. ? props['tbmj'].toFixed(2)
  302. : (props['mj'] * 15).toFixed(2)
  303. }}
  304. </p>
  305. </div>
  306. <div class="content" v-if="detailType == 99">
  307. <h2>
  308. {{
  309. props['dkmc'] ||
  310. props['tdqlr'] ||
  311. props['BSM'] ||
  312. props['项目名称'] ||
  313. props['dkbh'] ||
  314. props['xmmc']
  315. }}
  316. </h2>
  317. <p v-show="props['sjydmj']">
  318. 面积:{{ (props['sjydmj'] * 0.0015).toFixed(2) }}亩
  319. </p>
  320. <p v-show="props['mj']">
  321. 面积:{{ (props['mj'] * 15).toFixed(2) }}亩
  322. </p>
  323. <p v-show="props['txmj']">
  324. 面积:{{ (props['txmj'] * 0.0015).toFixed(2) }}亩
  325. </p>
  326. <p v-show="props['总用地面积']">
  327. 面积:{{ (props['总用地面积'] * 0.0015).toFixed(2) }}亩
  328. </p>
  329. <p v-show="props['spmj']">
  330. 面积:{{ (props['spmj'] * 0.0015).toFixed(2) }}亩
  331. </p>
  332. </div>
  333. <div class="content" v-if="detailType == 101">
  334. <p v-show="props['dymc']">
  335. 单元名称:{{ props['dymc'] }}
  336. </p>
  337. <p v-show="props['yddm']">
  338. 用地代码:{{ props['yddm'] }}
  339. </p>
  340. <p v-show="props['ydxz']">
  341. 用地性质:{{ props['ydxz'] }}
  342. </p>
  343. </div>
  344. <div class="fixedIcon"></div>
  345. </div>
  346. </template>
  347. </vl-feature-overlay>
  348. </vl-map>
  349. </template>
  350. <script>
  351. import { mapGetters, mapState } from 'vuex';
  352. import MapUtils from '@/utils/MapUtils';
  353. import olMapUtils from "@/utils/OlMapUtils";
  354. import 'ol/ol.css';
  355. import DragPan from 'ol/interaction/DragPan';
  356. import VlMap from '@/components/ol/VlMap';
  357. import { getMapLayerConfig } from '@/components/ol/_utils/map-layer-utils';
  358. import { VlConfigLayers, VlLayerTree } from '@/components/ol/VlConfigLayers';
  359. import { VlToolBar, VlToolBarItem } from '@/components/ol/VlToolBar';
  360. import {
  361. VlFeatureFlicker,
  362. VlFeatureOverlay,
  363. } from '@/components/ol/VlFeatureTool';
  364. import VlLegend from '@/components/ol/VlLegend';
  365. import VlImglayers from '@/components/ol/VLImgLayers';
  366. import { arcgisQuery } from '@/utils/arcgis-map-server-query';
  367. import VlMapDevInfo from '@/components/ol/VlMapDevInfo';
  368. import VlChinaCities from '@/components/ol/VlChinaCities';
  369. import { MultiPolygon } from 'ol/geom';
  370. import { getSrid, mapFit, toArcGIS } from '@/utils/arcgis-utils';
  371. import { Stroke, Style } from 'ol/style';
  372. import { Vector as VectorSource } from 'ol/source';
  373. import { Vector as VectorLayer } from 'ol/layer';
  374. import EChartsLayer from 'ol-echarts';
  375. import { XZQ } from '@/utils/constant/Constant.js';
  376. import { scatter_bg4, bg_text } from './base64Img.js';
  377. import { Geometry as WkxGeometry } from 'wkx';
  378. import { GeoJSON } from 'ol/format';
  379. import { convertRingsToGeoJSON } from '@/utils/ArcGISGeoJSONConvertTool.js';
  380. import { Fill, Text } from 'ol/style';
  381. import VlToolBox from '@/components/ol/VlToolBox';
  382. import TABLE_COMP_MAPPING from './TABLE_COMP_MAPPING.js';
  383. import { getArea } from 'ol/sphere';
  384. import TdytMapping from '@/mock/TdytMapping.js';
  385. import HeatmapLayer from 'ol/layer/Heatmap';
  386. import hotJson from '@/assets/geoJson/GYYDPT4490.json';
  387. export default {
  388. name: 'BigScreenMap',
  389. computed: {
  390. ...mapState({
  391. xzqNameState: (state) => state.BaseData.xzqState,
  392. mapDataOne: (state) => state.BaseData.TDG,
  393. }),
  394. ...mapGetters({
  395. xzqdm: 'BaseData/xzqCodeGetter',
  396. }),
  397. },
  398. components: {
  399. VlFeatureOverlay,
  400. VlChinaCities,
  401. VlMapDevInfo,
  402. VlLegend,
  403. VlLayerTree,
  404. VlFeatureFlicker,
  405. VlToolBarItem,
  406. VlToolBar,
  407. VlConfigLayers,
  408. VlMap,
  409. VlToolBox,
  410. VlImglayers,
  411. },
  412. filters: {},
  413. props: {
  414. districtCode: {
  415. type: String,
  416. default: '33',
  417. },
  418. imgLayers: Array,
  419. title: {
  420. type: String,
  421. default: '',
  422. },
  423. visibleLayerIds: {
  424. type: Array,
  425. default: () => [],
  426. },
  427. overlayShow: {
  428. type: Boolean,
  429. default: false,
  430. },
  431. layerShow: {
  432. type: Boolean,
  433. default: false,
  434. },
  435. defaultLayerId: {
  436. type: String,
  437. default: '',
  438. },
  439. fixed: {
  440. type: Number,
  441. default: 0,
  442. },
  443. GZData: {
  444. type: Array,
  445. default() {
  446. return [];
  447. },
  448. },
  449. legendShow: {
  450. type: Boolean,
  451. default: true,
  452. },
  453. defaultExpand: {
  454. type: Boolean,
  455. default: true,
  456. },
  457. townShow: {
  458. type: Boolean,
  459. default: true,
  460. },
  461. },
  462. data() {
  463. return {
  464. map: undefined,
  465. mapDragPan: null,
  466. visibleLayerId: '',
  467. detailData: {},
  468. detailType: 1,
  469. layerFeatureKey: undefined,
  470. viewInfo: {
  471. x: 120,
  472. y: 30,
  473. center: [0, 0],
  474. zoom: 0,
  475. extent: [0, 0, 0, 0],
  476. scale: 1,
  477. },
  478. layersConfig: getMapLayerConfig(), // getMapLayerConfig 获取的是 config.js 配置的克隆
  479. enabledLayersConfig: [], // 启用的图层配置,来源于 vl-config-layers 的loaded事件回调
  480. feature: undefined, // 闪烁和气泡的 特征
  481. districtFeature: undefined, // 行政区的特征
  482. showDetail: false,
  483. echartslayer: null,
  484. showLifeCircle: false,
  485. xzqType: 'city',
  486. xzqName: '',
  487. realLayers: [],
  488. lifeCycleShow: false,
  489. vectorGeo: null,
  490. vmEventType: '',
  491. tdytMapping: {
  492. 1: '工业用地',
  493. 2: '商服用地',
  494. 3: '住宅用地',
  495. 4: '其他用地',
  496. },
  497. isIconBool: false,
  498. isShowIcon: false,
  499. echartsLayerClickHandle: null,
  500. layerIndex: '0', //图层级别默认为0
  501. heatMapLayer: null,
  502. tzzxShow: false,
  503. geoSource: new VectorSource(),
  504. geoLayer: undefined,
  505. isgyyd: '',
  506. kgLayer: null
  507. };
  508. },
  509. watch: {
  510. GZData: {
  511. immediate: true,
  512. deep: true,
  513. handler: function() {
  514. // 迁徙图图层初始化
  515. this.echartsLayerLoad();
  516. },
  517. },
  518. visibleLayerIds: {
  519. immediate: true,
  520. deep: true,
  521. handler() {
  522. this.visibleLayerId = this.visibleLayerIds[0];
  523. },
  524. },
  525. },
  526. mounted() {
  527. this.$vm.$on('setLayerIndexEvent', (index) => {
  528. this.layerIndex = index;
  529. });
  530. let _initZoom = 8;
  531. const _clientW = document.documentElement.clientWidth;
  532. if (parseInt(_clientW) > 2000) {
  533. setTimeout(() => {
  534. _initZoom = 8.5;
  535. this.map.getView().setZoom(_initZoom);
  536. }, 200);
  537. }
  538. this.$vm.$on('updateLayer', (payload) => {
  539. const { id, param, layerIdx1, layerIdx2 } = payload;
  540. let params = {};
  541. if (layerIdx2 != null) {
  542. params = {
  543. layers: `show:${layerIdx1},${layerIdx2}`,
  544. layerDefs: {
  545. [layerIdx1]: param,
  546. [layerIdx2]: param,
  547. },
  548. };
  549. } else {
  550. params = {
  551. layers: `show:${layerIdx1}`,
  552. layerDefs: {
  553. [layerIdx1]: param,
  554. },
  555. };
  556. }
  557. let layer = this.getLayerById(id);
  558. layer.setVisible(true);
  559. const source = layer.getSource();
  560. source.updateParams(params);
  561. });
  562. this.$vm.$on('refreshLayer', (id) => {
  563. this.feature = null;
  564. if (id) {
  565. let layer = this.getLayerById(id);
  566. layer.setVisible(true);
  567. const source = layer.getSource();
  568. source.refresh();
  569. }
  570. });
  571. this.$vm.$on('setTzzxShow', (payload) => {
  572. this.tzzxShow = payload;
  573. });
  574. this.$vm.$on('setEchartsLayerClickHandle', (handle) => {
  575. this.echartsLayerClickHandle = handle;
  576. });
  577. this.$vm.$on('getGdDetailData', (payload) => {
  578. this.detailData = payload;
  579. });
  580. this.$vm.$on('setGdDetailType', (payload) => {
  581. this.detailType = payload;
  582. });
  583. this.$vm.$on('location-init', () => {
  584. this.feature = null;
  585. this.$vm.$emit('switchLayerShow', true);
  586. if (this.xzqNameState != '' && this.xzqNameState != '浙江省') {
  587. this.locationMaskFeatureHttp(this.xzqNameState, this.visibleLayerId);
  588. } else {
  589. setTimeout(() => {
  590. if (this.map) {
  591. if (window.vtLayer) {
  592. this.map.removeLayer(window.vtLayer);
  593. }
  594. this.map
  595. .getView()
  596. .setCenter([120.45690944408925, 29.248390754380974]);
  597. this.map.getView().setZoom(7.85);
  598. }
  599. }, 0);
  600. }
  601. });
  602. //改变图层显示
  603. this.$vm.$on('change-layer', () => {
  604. this.feature = null;
  605. this.removeHotLayer();
  606. this.$vm.$emit('switchLayerShow', true);
  607. });
  608. this.$vm.$on('clear-layer', () => {
  609. if (this.vectorGeo != null) {
  610. this.vectorGeo.getSource().clear();
  611. this.vectorGeo = null;
  612. }
  613. });
  614. this.$vm.$on('setLayerIdEvent', (name) => {
  615. if (!name) {
  616. this.visibleLayerId = this.visibleLayerIds[
  617. this.visibleLayerIds.length - 1
  618. ];
  619. } else {
  620. this.visibleLayerId = name;
  621. }
  622. });
  623. this.$vm.$on('location-feature', (payload) => {
  624. //根据dzjgh进行图斑定位
  625. const { dzjgh } = payload;
  626. this.locationFeatureHttp(dzjgh, this.visibleLayerId);
  627. });
  628. this.$vm.$on('location-feature-where', (payload) => {
  629. //根据dzjgh进行图斑定位
  630. const { layerId, where, setting = {} } = payload;
  631. this.locationFeatureWhere(layerId, where, setting);
  632. });
  633. this.$vm.$on('location-more-feature-where', (payload) => {
  634. //根据dzjgh进行图斑定位
  635. const { layerId, where, setting = {} } = payload;
  636. this.locationMoreFeatureWhere(layerId, where, setting);
  637. });
  638. this.$vm.$on('location-mask-feature', (payload) => {
  639. //根据dzjgh进行图斑定位
  640. const { dzjgh } = payload;
  641. this.locationMaskFeatureHttp(dzjgh, this.visibleLayerId);
  642. });
  643. this.$vm.$on('location-mask-self-where', (payload) => {
  644. //根据dzjgh进行图斑定位
  645. const { layerId, where } = payload;
  646. this.locationMaskFeatureWhere(layerId, where);
  647. });
  648. this.$vm.$on('showIconEvent', (name, type) => {
  649. if (!this.isIconBool) return;
  650. let id = '';
  651. switch (name) {
  652. case '已批未征':
  653. id = 'pewg-ypwz';
  654. break;
  655. case '规划调整':
  656. id = 'pewg-ghtz';
  657. break;
  658. case '项目未落实':
  659. id = 'pewg-xmwls';
  660. break;
  661. case '手续未完善':
  662. id = 'pewg-sxwws';
  663. break;
  664. case '储备土地':
  665. id = 'pewg-zbtd';
  666. break;
  667. case '供地前期工作':
  668. id = 'pewg-gdqqgz';
  669. break;
  670. case '零星难利用':
  671. id = 'pewg-lxnly';
  672. break;
  673. case '农转用无法调整':
  674. id = 'pewg-nzywftz';
  675. break;
  676. case '其他原因':
  677. id = 'pewg-qtyy';
  678. break;
  679. case '待认定':
  680. id = 'pewg-drd';
  681. break;
  682. }
  683. this.$vm.$emit('setLandMapLayerContro', { type: type, id: id });
  684. });
  685. //根据图层ID显示响应图层
  686. this.$vm.$on('setLandMapLayerContro', (payload) => {
  687. const { parentId, type, id } = payload;
  688. const landMapLayers = this.enabledLayersConfig[1]['children'];
  689. if (parentId) {
  690. for (let i = 0; i < landMapLayers.length; i++) {
  691. if (landMapLayers[i]['id'] === parentId) {
  692. landMapLayers[i]['visible'] = true;
  693. break;
  694. }
  695. }
  696. }
  697. if (id) {
  698. for (let i = 0; i < landMapLayers.length; i++) {
  699. if (landMapLayers[i]['id'] === id) {
  700. setTimeout(() => {
  701. landMapLayers[i]['visible'] = type == 'hide' ? false : true;
  702. }, 1000);
  703. break;
  704. }
  705. }
  706. }
  707. });
  708. this.$vm.$on('switchLayerShow', (boolean) => {
  709. if (boolean) {
  710. this.feature = null;
  711. this.visibleLayerId = this.visibleLayerIds[0];
  712. this.realLayers = JSON.parse(JSON.stringify(this.visibleLayerIds));
  713. } else {
  714. this.realLayers = [];
  715. }
  716. });
  717. this.$vm.$on('GlobalStatisticsLayer', (payload) => {
  718. let { layerId, setting } = payload;
  719. this.statisticsLayer(layerId, setting);
  720. });
  721. },
  722. beforeDestroy() {
  723. // 修复 页面大小改变时 echartslayer 未销毁
  724. this.echartslayer && this.echartslayer.remove();
  725. },
  726. methods: {
  727. initHotLayer(field) {
  728. this.heatMapLayer = new HeatmapLayer({
  729. source: new VectorSource({
  730. features: new GeoJSON().readFeatures(hotJson),
  731. // 我们使用json数据
  732. // url: require('@/assets/geojson/dxccHotlayer.json'),
  733. // format: new GeoJSON()
  734. }),
  735. // 这里可以根据自己项目的实际,绑定页面的控件动态调整
  736. blur: 8,
  737. radius: 6,
  738. weight: weightFunction,
  739. });
  740. /*
  741. *设置权重
  742. */
  743. function weightFunction(feature) {
  744. var weight = feature.get(field);
  745. weight = parseFloat(weight);
  746. // weight = parseFloat(weight) / 10;
  747. return weight;
  748. }
  749. // this.heatMapLayer.getSource().on('addfeature', function(event) {
  750. //
  751. // //var place = event.feature.get('place');
  752. // var magnitude = event.feature.get('mjss');
  753. // //设定权重减去的数字是为了过滤地震等级,比如只想显示3级以上地震,那就减去3
  754. // event.feature.set('weight', magnitude);
  755. // });
  756. this.heatMapLayer.setZIndex(999);
  757. this.map.addLayer(this.heatMapLayer);
  758. },
  759. vlImgLayerChangeHandle(val) {
  760. this.visibleLayerId = 'bj-kgdk'
  761. const layer = this.$refs.configLayer.getLayerConfigById(this.visibleLayerId);
  762. layer.enabled = true;
  763. layer.visible = val;
  764. if (!val) {
  765. this.visibleLayerId = this.visibleLayerIds[0];
  766. }
  767. },
  768. vlImgLayerChangeHandle1(val) {
  769. this.visibleLayerId = 'bjq-gd'
  770. const layer = this.$refs.configLayer.getLayerConfigById(this.visibleLayerId);
  771. layer.enabled = true;
  772. layer.visible = val;
  773. if (!val) {
  774. this.visibleLayerId = this.visibleLayerIds[0];
  775. }
  776. },
  777. vlImgLayerSliderChangeHandle(val) {
  778. this.visibleLayerId = 'bj-kgdk'
  779. const layer = this.$refs.configLayer.getLayerConfigById(this.visibleLayerId);
  780. layer.opacity = val / 100
  781. },
  782. vlImgLayerSliderChangeHandle1(val) {
  783. this.visibleLayerId = 'bjq-gd'
  784. const layer = this.$refs.configLayer.getLayerConfigById(this.visibleLayerId);
  785. layer.opacity = val / 100
  786. },
  787. removeHotLayer() {
  788. this.map.removeLayer(this.heatMapLayer);
  789. this.heatMapLayer = null;
  790. },
  791. clearGeoLayer() {
  792. if (this.geoLayer && this.geoSource) {
  793. this.geoSource.clear();
  794. this.map.removeLayer(this.geoLayer);
  795. }
  796. },
  797. addGeoLayer(geoJson) {
  798. if (this.geoLayer && this.geoSource) {
  799. this.geoSource.clear();
  800. this.map.removeLayer(this.geoLayer);
  801. }
  802. this.geoSource.addFeatures(new GeoJSON().readFeatures(geoJson));
  803. this.geoLayer = new VectorLayer({
  804. source: this.geoSource,
  805. style: function(feature) {
  806. return new Style({
  807. stroke: new Stroke({
  808. width: 1,
  809. color: 'rgba(255, 255, 255, 1)',
  810. }),
  811. fill: new Fill({
  812. color: feature.get('color'),
  813. }),
  814. // text: new Text(({
  815. // // 位置
  816. // textAlign: 'center',
  817. // // 基准线
  818. // textBaseline: 'middle',
  819. // // 文字样式
  820. // font: 'bold 16px 微软雅黑',
  821. // // 文本内容
  822. // text: feature.get('name')+'\n'+feature.get('value')+' '+feature.get('unit'),
  823. // // 文字颜色
  824. // fill: new Fill({ color: '#FFF' }),
  825. // // fill: new Fill({ color: feature.get('color') }),
  826. // // 文字背景
  827. // // stroke: new Stroke({ color: '#ffcc33', width: 10 })
  828. // }))
  829. });
  830. },
  831. zIndex: 99,
  832. });
  833. this.map.addLayer(this.geoLayer);
  834. // this.map.getView().fit(this.geoLayer.getSource().getExtent(), { duration: 500 })
  835. // let selectClick = new interaction.Select();
  836. // this.map.addInteraction(selectClick);
  837. // selectClick.on('select', (e)=>{
  838. // var features=e.target.getFeatures().getArray();
  839. // this.$emit('mapSelect',features[0].getProperties())
  840. // })
  841. return this.geoLayer;
  842. // this.geoLayer.setMap(this.map)
  843. },
  844. addGeoLayer2(geoJson) {
  845. if (this.geoLayer && this.geoSource) {
  846. this.geoSource.clear();
  847. this.map.removeLayer(this.geoLayer);
  848. }
  849. this.geoSource.addFeatures(new GeoJSON().readFeatures(geoJson));
  850. this.geoLayer = new VectorLayer({
  851. source: this.geoSource,
  852. style: function() {
  853. return new Style({
  854. stroke: new Stroke({
  855. width: 1,
  856. color: '#4AD808',
  857. }),
  858. fill: new Fill({
  859. color: '#4AD808',
  860. }),
  861. // text: new Text(({
  862. // // 位置
  863. // textAlign: 'center',
  864. // // 基准线
  865. // textBaseline: 'middle',
  866. // // 文字样式
  867. // font: 'bold 16px 微软雅黑',
  868. // // 文本内容
  869. // text: feature.get('name')+'\n'+feature.get('value')+' '+feature.get('unit'),
  870. // // 文字颜色
  871. // fill: new Fill({ color: '#FFF' }),
  872. // // fill: new Fill({ color: feature.get('color') }),
  873. // // 文字背景
  874. // // stroke: new Stroke({ color: '#ffcc33', width: 10 })
  875. // }))
  876. });
  877. },
  878. zIndex: 99,
  879. });
  880. this.map.addLayer(this.geoLayer);
  881. // this.map.getView().fit(this.geoLayer.getSource().getExtent(), { duration: 500 })
  882. // let selectClick = new interaction.Select();
  883. // this.map.addInteraction(selectClick);
  884. // selectClick.on('select', (e)=>{
  885. // var features=e.target.getFeatures().getArray();
  886. // this.$emit('mapSelect',features[0].getProperties())
  887. // })
  888. return this.geoLayer;
  889. // this.geoLayer.setMap(this.map)
  890. },
  891. filterTdyt(val) {
  892. if (!val) return;
  893. if (!TdytMapping[val.trim()]) {
  894. return '';
  895. } else {
  896. return TdytMapping[val.trim()];
  897. }
  898. },
  899. showLandDetail(props) {
  900. this.$vm.$emit('yqModalShow', props);
  901. },
  902. showSpDetail(props) {
  903. this.$vm.$emit('showSpDetail', props);
  904. },
  905. async locationMoreFeatureWhere(layerId, where, setting = {}) {
  906. const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
  907. if (!layerById) {
  908. console.error(`no layer id`);
  909. return;
  910. }
  911. await arcgisQuery(
  912. `${layerById.url}/${this.layerIndex}/query`,
  913. {
  914. outSR: getSrid(this.map),
  915. where,
  916. ...setting,
  917. },
  918. false,
  919. ).then(({ features }) => {
  920. let json = { type: 'FeatureCollection', features: [] };
  921. features.forEach((it) => {
  922. json.features.push(convertRingsToGeoJSON(it.geometry.rings));
  923. });
  924. if (this.vectorGeo != null) {
  925. this.vectorGeo.getSource().clear();
  926. this.vectorGeo = null;
  927. }
  928. // 使用GeoJSON构建source
  929. const source = new VectorSource({
  930. features: new GeoJSON().readFeatures(json),
  931. });
  932. this.vectorGeo = new VectorLayer({
  933. source: source,
  934. style: new Style({
  935. fill: new Fill({
  936. // 填充
  937. color: 'rgba(0,255,0, 0.6)',
  938. }),
  939. stroke: new Stroke({
  940. width: 5,
  941. color: '#00FF00',
  942. }),
  943. }),
  944. zIndex: 99,
  945. });
  946. this.map.addLayer(this.vectorGeo);
  947. this.map.getView().fit(source.getExtent(), {
  948. duration: 500,
  949. maxZoom: 17,
  950. });
  951. });
  952. },
  953. locationByGeoJson(geos) {
  954. this.feature = new GeoJSON().readFeatures(geos)[0];
  955. },
  956. locationByGeoJsonColor(geos, color, width) {
  957. let source = new VectorSource({
  958. features: new GeoJSON().readFeatures(geos),
  959. });
  960. let geoLayer = new VectorLayer({
  961. source: source,
  962. // 设置样式,边框和填充
  963. style: new Style({
  964. stroke: new Stroke({
  965. color: color,
  966. width: width,
  967. }),
  968. // fill: new Fill({
  969. // color: 'rgba(255, 255, 0, 0.5)'
  970. // })
  971. }),
  972. zIndex: 999,
  973. });
  974. // 添加GeoJSON到map上
  975. this.map.addLayer(geoLayer);
  976. this.map.getView().fit(source.getExtent(), {
  977. duration: 500,
  978. maxZoom: 17,
  979. });
  980. },
  981. async locationFeatureHttp(
  982. bsm,
  983. layerId,
  984. { feature = undefined, row = undefined } = {},
  985. ) {
  986. this.layerFeatureKey = TABLE_COMP_MAPPING[layerId].layerField;
  987. layerId = layerId || this.visibleLayerId;
  988. const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
  989. if (!layerById) {
  990. console.error(`no layer id`);
  991. return;
  992. }
  993. if (layerId == 'pewg_1') {
  994. if (bsm) {
  995. this.spinShow = true;
  996. if (!feature) {
  997. const where = `${this.layerFeatureKey} = '${bsm}'`;
  998. await arcgisQuery(
  999. `${layerById.url}/${this.layerIndex}/query`,
  1000. {
  1001. outSR: getSrid(this.map),
  1002. where,
  1003. },
  1004. false,
  1005. ).then(({ features }) => {
  1006. const geos = {
  1007. type: 'FeatureCollection',
  1008. features: [
  1009. {
  1010. type: 'Feature',
  1011. geometry: {
  1012. type: 'MultiPolygon',
  1013. coordinates: [],
  1014. },
  1015. properties: {},
  1016. },
  1017. ],
  1018. };
  1019. let temp = [];
  1020. features.forEach((it) => {
  1021. temp = [...temp, ...it['geometry']['rings']];
  1022. });
  1023. geos['features'][0]['geometry']['coordinates'] = [[...temp]];
  1024. feature = new GeoJSON().readFeatures(geos)[0];
  1025. });
  1026. }
  1027. if (row) {
  1028. feature.setProperties({ ...row });
  1029. }
  1030. this.spinShow = false;
  1031. }
  1032. if (feature) {
  1033. const geometry = feature.getGeometry();
  1034. const wkt = WkxGeometry.parseGeoJSON(
  1035. new GeoJSON().writeGeometryObject(geometry),
  1036. ).toWkt();
  1037. feature.set('wkt', wkt);
  1038. this.feature = feature;
  1039. this.$vm.$emit('getGeoData', feature); //初始化土地生命周期geo/feature参数
  1040. }
  1041. } else {
  1042. if (bsm) {
  1043. this.spinShow = true;
  1044. if (!feature) {
  1045. const where = `${this.layerFeatureKey} = '${bsm}'`;
  1046. await arcgisQuery(
  1047. `${layerById.url}/${this.layerIndex}/query`,
  1048. {
  1049. outSR: getSrid(this.map),
  1050. where,
  1051. },
  1052. true,
  1053. ).then(({ features }) => {
  1054. feature = features[0];
  1055. });
  1056. }
  1057. if (row) {
  1058. feature.setProperties({ ...row });
  1059. }
  1060. this.spinShow = false;
  1061. }
  1062. if (feature) {
  1063. const geometry = feature.getGeometry();
  1064. const wkt = WkxGeometry.parseGeoJSON(
  1065. new GeoJSON().writeGeometryObject(geometry),
  1066. ).toWkt();
  1067. feature.set('wkt', wkt);
  1068. this.feature = feature;
  1069. this.$vm.$emit('getGeoData', feature); //初始化土地生命周期geo/feature参数
  1070. }
  1071. }
  1072. },
  1073. async locationFeatureWhere(layerId, where, setting) {
  1074. this.spinShow = true;
  1075. const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
  1076. await arcgisQuery(
  1077. `${layerById.url}/${this.layerIndex}/query`,
  1078. {
  1079. outSR: getSrid(this.map),
  1080. where,
  1081. ...setting,
  1082. },
  1083. true,
  1084. ).then(({ features }) => {
  1085. let feature = features[0];
  1086. const geometry = feature.getGeometry();
  1087. const wkt = WkxGeometry.parseGeoJSON(
  1088. new GeoJSON().writeGeometryObject(geometry),
  1089. ).toWkt();
  1090. feature.set('wkt', wkt);
  1091. this.feature = feature;
  1092. });
  1093. this.spinShow = false;
  1094. },
  1095. async locationMaskFeatureHttp(
  1096. bsm,
  1097. layerId,
  1098. { feature = undefined, row = undefined } = {},
  1099. ) {
  1100. this.layerFeatureKey = TABLE_COMP_MAPPING[layerId].layerField;
  1101. layerId = layerId || this.visibleLayerId;
  1102. const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
  1103. if (!layerById) {
  1104. console.error(`no layer id`);
  1105. return;
  1106. }
  1107. if (bsm) {
  1108. this.spinShow = true;
  1109. if (!feature) {
  1110. const where = `${this.layerFeatureKey} = '${bsm}'`;
  1111. await arcgisQuery(
  1112. `${layerById.url}/${this.layerIndex}/query`,
  1113. {
  1114. outSR: getSrid(this.map),
  1115. where,
  1116. },
  1117. false,
  1118. ).then((resp) => {
  1119. const { features } = resp;
  1120. let json = { type: 'FeatureCollection', features: [] };
  1121. json.features.push(
  1122. convertRingsToGeoJSON(features[0].geometry.rings),
  1123. );
  1124. MapUtils.drawShade(this.map, json);
  1125. });
  1126. }
  1127. if (row) {
  1128. feature.setProperties({ ...row });
  1129. }
  1130. this.spinShow = false;
  1131. }
  1132. this.feature = feature;
  1133. if (feature) {
  1134. this.$vm.$emit('getGeoData', feature); //初始化土地生命周期geo/feature参数
  1135. }
  1136. },
  1137. async locationMaskFeatureWhere(layerId, where) {
  1138. const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
  1139. if (!layerById) {
  1140. console.error(`no layer id`);
  1141. return;
  1142. }
  1143. this.spinShow = true;
  1144. await arcgisQuery(
  1145. `${layerById.url}/0/query`,
  1146. {
  1147. outSR: getSrid(this.map),
  1148. where,
  1149. },
  1150. false,
  1151. ).then((resp) => {
  1152. const { features } = resp;
  1153. let json = { type: 'FeatureCollection', features: [] };
  1154. json.features.push(convertRingsToGeoJSON(features[0].geometry.rings));
  1155. MapUtils.drawShade(this.map, json);
  1156. });
  1157. this.spinShow = false;
  1158. },
  1159. mapLoaded(map) {
  1160. window.map = map;
  1161. this.map = map;
  1162. const layerId = this.visibleLayerId;
  1163. // 图斑拾取黑名单
  1164. const pickBlackList = [];
  1165. map.on('singleclick', (e) => {
  1166. this.$vm.$emit('clear-layer');
  1167. if (this.visibleLayerId === 'xzqh-s-search') return;
  1168. if (this.visibleLayerId === 'xzqh-x-search') return;
  1169. const drawing = map.get('drawing');
  1170. if (drawing || pickBlackList.includes(layerId)) {
  1171. console.log('no pick event');
  1172. return;
  1173. }
  1174. this.pickServerFeature(e);
  1175. });
  1176. map.on('moveend', () => {
  1177. let zoom = map.getView().getZoom(); //获取当前地图的缩放级别
  1178. if (zoom >= 11.3) {
  1179. // this.visibleLayerId = this.visibleLayerIds[
  1180. // this.visibleLayerIds.length - 1
  1181. // ];
  1182. if (this.mapDragPan) {
  1183. this.mapDragPan.setActive(true);
  1184. }
  1185. //缩放至一定级别不显示tooptip图例
  1186. // this.echartslayer.hide();
  1187. } else {
  1188. this.visibleLayerId = this.visibleLayerIds[0];
  1189. if (this.visibleLayerId === 'xzqh-s-search' && this.mapDragPan) {
  1190. this.mapDragPan.setActive(true);
  1191. }
  1192. // this.echartslayer.show();
  1193. }
  1194. if (zoom >= 9 && this.xzqType !== 'town' && this.townShow) {
  1195. // 县级市
  1196. if (this.vmEventType) {
  1197. this.$vm.$emit(this.vmEventType, 'town');
  1198. }
  1199. this.xzqType = 'town';
  1200. this.$emit('moveend', this.xzqType);
  1201. this.enabledLayersConfig[0]['children'][2]['children'][0][
  1202. 'visible'
  1203. ] = false;
  1204. this.enabledLayersConfig[0]['children'][2]['children'][4][
  1205. 'visible'
  1206. ] = true;
  1207. if (this.isIconBool && !this.isShowIcon) {
  1208. this.isShowIcon = true;
  1209. }
  1210. } else if (zoom < 9 && this.xzqType !== 'city') {
  1211. // 地级市
  1212. if (this.vmEventType) {
  1213. this.$vm.$emit(this.vmEventType, 'city');
  1214. }
  1215. this.xzqType = 'city';
  1216. this.$emit('moveend', this.xzqType);
  1217. this.enabledLayersConfig[0]['children'][2]['children'][0][
  1218. 'visible'
  1219. ] = true;
  1220. this.enabledLayersConfig[0]['children'][2]['children'][4][
  1221. 'visible'
  1222. ] = false;
  1223. }
  1224. });
  1225. map.getView().setCenter([120.45690944408925, 29.248390754380974]);
  1226. map.getView().setZoom(7.85);
  1227. this.map.getInteractions().forEach((element) => {
  1228. if (element instanceof DragPan) {
  1229. this.mapDragPan = element;
  1230. }
  1231. });
  1232. },
  1233. echartsLayerLoad() {
  1234. if (this.echartslayer !== null) {
  1235. // this.map.removeLayer(this.echartslayer);
  1236. this.echartslayer.remove();
  1237. this.echartslayer = null;
  1238. }
  1239. // 迁徙图图层初始化
  1240. this.echartslayer = new EChartsLayer(this.getOption());
  1241. this.echartslayer.setMap(this.map);
  1242. this.echartslayer.$chart.on('click', (item) => {
  1243. if (!this.echartsLayerClickHandle) return;
  1244. this.echartsLayerClickHandle(item);
  1245. });
  1246. },
  1247. getOption() {
  1248. var geoCoordMap = null;
  1249. let GZData = [];
  1250. let isShow = true;
  1251. let typeStr = 1; //Scatter背景图类型 0、1
  1252. if (this.GZData && this.GZData.length > 0) {
  1253. isShow = true;
  1254. GZData = this.GZData;
  1255. typeStr = GZData[0]['typeIndex'];
  1256. } else {
  1257. isShow = false;
  1258. }
  1259. if (!this.xzqName) {
  1260. if (this.xzqType === 'town') {
  1261. const keys = Object.keys(XZQ[this.xzqType]);
  1262. geoCoordMap = {};
  1263. for (let i = 0; i < keys.length; i++) {
  1264. const mapItem = XZQ[this.xzqType][keys[i]];
  1265. Object.assign(geoCoordMap, mapItem);
  1266. }
  1267. } else {
  1268. geoCoordMap = XZQ[this.xzqType];
  1269. }
  1270. } else {
  1271. geoCoordMap = XZQ[this.xzqType][this.xzqName];
  1272. }
  1273. var convertData2 = function(data) {
  1274. var res = [];
  1275. data.forEach((item) => {
  1276. var geoCoord = geoCoordMap[item.name];
  1277. if (geoCoord) {
  1278. res.push({
  1279. name: item.name,
  1280. value: geoCoord,
  1281. query: item['query'],
  1282. param: item['param'],
  1283. });
  1284. }
  1285. });
  1286. return res;
  1287. };
  1288. const series = [
  1289. {
  1290. type: 'scatter',
  1291. coordinateSystem: 'geo',
  1292. tooltip: { show: false },
  1293. z: 999,
  1294. label: {
  1295. normal: {
  1296. show: true,
  1297. formatter: function(item) {
  1298. return `{tline|${item['name']}}`;
  1299. },
  1300. rich: {
  1301. tline: {
  1302. color: '#FFF',
  1303. align: 'center',
  1304. fontSize: 15,
  1305. fontWeight: 600,
  1306. },
  1307. },
  1308. },
  1309. emphasis: {
  1310. show: true,
  1311. },
  1312. },
  1313. itemStyle: {
  1314. opacity: 1,
  1315. color: function(val) {
  1316. return '#333';
  1317. },
  1318. },
  1319. data: convertData2(GZData),
  1320. },
  1321. ];
  1322. if (isShow) {
  1323. if (typeStr === 0) {
  1324. series[0]['symbolOffset'] = [0, -5];
  1325. series.push(
  1326. {
  1327. type: 'scatter',
  1328. coordinateSystem: 'geo',
  1329. tooltip: { show: false },
  1330. z: 999999999,
  1331. label: {
  1332. normal: {
  1333. show: true,
  1334. formatter: function(item) {
  1335. const param = item['data']['param'];
  1336. const order = param['order'] || '0';
  1337. return `{tline|${order}}`;
  1338. },
  1339. rich: {
  1340. tline: {
  1341. color: '#0B2E3A',
  1342. align: 'center',
  1343. fontSize: 14,
  1344. fontWeight: 600,
  1345. },
  1346. },
  1347. },
  1348. emphasis: {
  1349. show: true,
  1350. },
  1351. },
  1352. itemStyle: {
  1353. opacity: 1,
  1354. color: function(val) {
  1355. let a;
  1356. if (val.data.param.order < 4) {
  1357. a = '#FAED25';
  1358. } else {
  1359. a = '#00FFEA';
  1360. }
  1361. return a;
  1362. },
  1363. },
  1364. symbol: 'circle',
  1365. symbolSize: 26,
  1366. symbolOffset: [-45, -80], //开发强度 [-40, -70]、要素保障 [-35, -80]
  1367. data: convertData2(GZData),
  1368. },
  1369. {
  1370. //图例
  1371. type: 'scatter',
  1372. coordinateSystem: 'geo',
  1373. tooltip: { show: false },
  1374. z: 99999,
  1375. label: {
  1376. normal: {
  1377. show: true,
  1378. formatter: function(item) {
  1379. const param = item['data']['param'];
  1380. const value1 = param['value1'] || '';
  1381. const value2 = param['value2'] || 0;
  1382. const unit1 = param['unit1'] || '';
  1383. const unit2 = param['unit2'] || '';
  1384. return `{tline1|${value1}}{tline2|${unit1}}\n{fline1|${value2}}{fline2|${unit2}}`;
  1385. },
  1386. rich: {
  1387. //开发强度 [0, 2]、要素保障 [2, 2]
  1388. tline1: {
  1389. padding: [5, 0],
  1390. color: '#07FCFF',
  1391. align: 'center',
  1392. fontSize: 15,
  1393. fontWeight: 700,
  1394. },
  1395. tline2: {
  1396. padding: [5, 0],
  1397. color: '#07FCFF',
  1398. align: 'center',
  1399. fontSize: 12,
  1400. fontWeight: 600,
  1401. },
  1402. fline1: {
  1403. color: '#FFFFFF',
  1404. fontSize: 14,
  1405. align: 'center',
  1406. fontWeight: 700,
  1407. },
  1408. fline2: {
  1409. color: '#FFFFFF',
  1410. fontSize: 14,
  1411. align: 'center',
  1412. },
  1413. },
  1414. //开发强度 [0, 10]、要素保障 [2, 2]
  1415. offset: [0, -5],
  1416. },
  1417. emphasis: {
  1418. show: true,
  1419. },
  1420. },
  1421. itemStyle: {
  1422. borderWidth: 0,
  1423. opacity: 1,
  1424. color: 'transparent',
  1425. },
  1426. symbol: function(val, item) {
  1427. return scatter_bg4;
  1428. },
  1429. symbolSize: function(val, item) {
  1430. return [90, 65];
  1431. },
  1432. symbolOffset: [0, -50],
  1433. data: convertData2(GZData),
  1434. },
  1435. );
  1436. } else {
  1437. series[0]['symbolOffset'] = [0, 28];
  1438. const getLineMaxHeight = (data) => {
  1439. const maxValue = Math.max(
  1440. ...data.map((item) => item['param']['value1']),
  1441. );
  1442. return 0.6 / maxValue;
  1443. };
  1444. const maxHeight = getLineMaxHeight(GZData);
  1445. const getLineData = (data) => {
  1446. const dataArr = [];
  1447. data.forEach((item) => {
  1448. const name = item.name;
  1449. if (geoCoordMap[name]) {
  1450. dataArr.push({
  1451. query: item['query'],
  1452. coords: [
  1453. geoCoordMap[name],
  1454. [
  1455. geoCoordMap[name][0],
  1456. geoCoordMap[name][1] +
  1457. item['param']['value1'] * maxHeight,
  1458. ],
  1459. ],
  1460. });
  1461. }
  1462. });
  1463. return dataArr;
  1464. };
  1465. const lineData = getLineData(GZData);
  1466. // 柱状体的顶部
  1467. const getTopBarPosition = (data) => {
  1468. const dataArr = [];
  1469. data.forEach((item) => {
  1470. const name = item.name;
  1471. if (geoCoordMap[name]) {
  1472. dataArr.push([
  1473. geoCoordMap[name][0],
  1474. geoCoordMap[name][1] + item['param']['value1'] * maxHeight,
  1475. ]);
  1476. }
  1477. });
  1478. return dataArr;
  1479. };
  1480. const getTopBarPosAndData = (data) => {
  1481. const dataArr = [];
  1482. data.forEach((item) => {
  1483. const name = item.name;
  1484. if (geoCoordMap[name]) {
  1485. dataArr.push([
  1486. geoCoordMap[name][0],
  1487. geoCoordMap[name][1] + item['param']['value1'] * maxHeight,
  1488. item,
  1489. ]);
  1490. }
  1491. });
  1492. return dataArr;
  1493. };
  1494. series.push(
  1495. {
  1496. type: 'scatter',
  1497. coordinateSystem: 'geo',
  1498. tooltip: { show: false },
  1499. z: 9999999,
  1500. label: {
  1501. normal: {
  1502. show: true,
  1503. formatter: function(item) {
  1504. const data = item['data'];
  1505. const param = data[data.length - 1]['param'];
  1506. if (!param) return;
  1507. const value1 = param['value1'] || '';
  1508. const unit1 = param['unit1'] || '';
  1509. return `{tline1|${value1}}{tline2|${unit1}}`;
  1510. },
  1511. rich: {
  1512. tline1: {
  1513. color: '#07FCFF',
  1514. align: 'center',
  1515. fontSize: 15,
  1516. fontWeight: 700,
  1517. },
  1518. tline2: {
  1519. color: '#07FCFF',
  1520. align: 'center',
  1521. fontSize: 12,
  1522. fontWeight: 600,
  1523. },
  1524. },
  1525. offset: [0, 0],
  1526. },
  1527. emphasis: {
  1528. show: true,
  1529. },
  1530. },
  1531. itemStyle: {
  1532. borderWidth: 0,
  1533. opacity: 1,
  1534. color: 'transparent',
  1535. },
  1536. symbol: bg_text,
  1537. symbolSize: function(val, item) {
  1538. return [70, 30];
  1539. },
  1540. symbolOffset: [0, -24],
  1541. data: getTopBarPosAndData(GZData),
  1542. },
  1543. {
  1544. type: 'scatter',
  1545. coordinateSystem: 'geo',
  1546. geoIndex: 0,
  1547. zlevel: 999999,
  1548. label: {
  1549. show: false,
  1550. },
  1551. symbol: 'circle',
  1552. symbolSize: [20, 10],
  1553. itemStyle: {
  1554. color: '#ECC200',
  1555. opacity: 1,
  1556. },
  1557. silent: true,
  1558. data: getTopBarPosition(GZData),
  1559. },
  1560. // 柱状体的主干
  1561. {
  1562. type: 'lines',
  1563. zlevel: 999,
  1564. effect: {
  1565. show: false,
  1566. symbolSize: 5, // 图标大小
  1567. },
  1568. lineStyle: {
  1569. width: 20, // 尾迹线条宽度
  1570. color: '#FFDE00',
  1571. opacity: 1, // 尾迹线条透明度
  1572. curveness: 0, // 尾迹线条曲直度
  1573. },
  1574. label: {
  1575. show: 0,
  1576. position: 'end',
  1577. formatter: '245',
  1578. },
  1579. data: lineData,
  1580. },
  1581. // 柱状体的底部
  1582. {
  1583. type: 'scatter',
  1584. coordinateSystem: 'geo',
  1585. geoIndex: 0,
  1586. zlevel: 9,
  1587. label: {
  1588. show: false,
  1589. },
  1590. symbol: 'circle',
  1591. symbolSize: [20, 10],
  1592. itemStyle: {
  1593. color: '#FFDE44',
  1594. opacity: 1,
  1595. },
  1596. silent: true,
  1597. data: convertData2(GZData),
  1598. },
  1599. {
  1600. type: 'scatter',
  1601. coordinateSystem: 'geo',
  1602. geoIndex: 0,
  1603. zlevel: 4,
  1604. label: {
  1605. show: false,
  1606. },
  1607. symbol: 'circle',
  1608. symbolSize: [40, 20],
  1609. itemStyle: {
  1610. color: '#fff',
  1611. opacity: 1,
  1612. },
  1613. silent: true,
  1614. data: convertData2(GZData),
  1615. },
  1616. {
  1617. type: 'scatter',
  1618. coordinateSystem: 'geo',
  1619. geoIndex: 0,
  1620. zlevel: 4,
  1621. label: {
  1622. show: false,
  1623. },
  1624. symbol: 'circle',
  1625. symbolSize: [60, 32],
  1626. itemStyle: {
  1627. color: {
  1628. type: 'radial',
  1629. x: 0.5,
  1630. y: 0.5,
  1631. r: 0.5,
  1632. colorStops: [
  1633. {
  1634. offset: 0,
  1635. color: 'transparent', // 0% 处的颜色
  1636. },
  1637. {
  1638. offset: 0.85,
  1639. color: 'transparent', // 100% 处的颜色
  1640. },
  1641. {
  1642. offset: 0.98,
  1643. color: '#FFDE44', // 100% 处的颜色
  1644. },
  1645. {
  1646. offset: 1,
  1647. color: '#FFDE44', // 100% 处的颜色
  1648. },
  1649. ],
  1650. global: false, // 缺省为 false
  1651. },
  1652. opacity: 1,
  1653. },
  1654. silent: true,
  1655. data: convertData2(GZData),
  1656. },
  1657. );
  1658. }
  1659. } else {
  1660. series.push({
  1661. type: 'scatter',
  1662. coordinateSystem: 'geo',
  1663. itemStyle: {
  1664. color: 'transparent',
  1665. },
  1666. z: 999,
  1667. label: {
  1668. show: true,
  1669. normal: {
  1670. show: true,
  1671. formatter: function(params) {
  1672. const name = params.name;
  1673. return name;
  1674. },
  1675. fantFamily: 'Microsoft YaHei',
  1676. color: '#FFFFFF',
  1677. fontSize: 19,
  1678. textShadowColor: '#000000',
  1679. textShadowBlur: 2,
  1680. textShadowOffsetX: 2,
  1681. textShadowOffsetY: 2,
  1682. },
  1683. },
  1684. data: convertData2(GZData),
  1685. });
  1686. }
  1687. return {
  1688. tooltip: {
  1689. trigger: 'item',
  1690. },
  1691. series: series,
  1692. };
  1693. },
  1694. configLayerLoaded(enabledLayersConfig) {
  1695. this.enabledLayersConfig = enabledLayersConfig;
  1696. },
  1697. async pickServerFeature(e) {
  1698. console.log(
  1699. this.visibleLayerId,
  1700. typeof this.visibleLayerId,
  1701. 'typeof this.visibleLayerId',
  1702. );
  1703. let tempLayerIds = this.visibleLayerIds.filter(
  1704. (it) =>
  1705. it !== 'xzqh-s' &&
  1706. it !== 'xzqh-s-search' &&
  1707. it !== 'xzqh-x-search' &&
  1708. it !== 'xzqh-x-search-dzl' &&
  1709. it !== 'xzqh-x' &&
  1710. it !== 'xzqh-z' &&
  1711. it !== 'hzyx-202310' &&
  1712. it !== 'hzyx-202308' &&
  1713. it !== 'hzyx-202309' &&
  1714. it !== 'bj-czkfbj' &&
  1715. it !== 'bj-stbhhx' &&
  1716. it !== 'bj-kfbjw',
  1717. );
  1718. if (tempLayerIds.length === 1) {
  1719. const layerConfig = this.$refs.configLayer.getLayerConfigById(
  1720. this.visibleLayerId,
  1721. );
  1722. // 带上图层显示参数,只拾取显示的图斑
  1723. let where = '1=1';
  1724. try {
  1725. where = layerConfig.params.layerDefs[0];
  1726. if (!where) {
  1727. where = '1=1';
  1728. }
  1729. } catch (e) {
  1730. // 获取图层 参数
  1731. }
  1732. const [x, y] = e.coordinate;
  1733. const param = {
  1734. where,
  1735. f: 'json',
  1736. inSR: getSrid(this.map),
  1737. outFields: TABLE_COMP_MAPPING[this.visibleLayerId]
  1738. ? TABLE_COMP_MAPPING[this.visibleLayerId]['outFields']
  1739. : '',
  1740. returnGeometry: 'true',
  1741. geometry: JSON.stringify({ x, y }),
  1742. geometryType: 'esriGeometryPoint',
  1743. };
  1744. arcgisQuery(
  1745. `${layerConfig.url}/${this.layerIndex}/query`,
  1746. param,
  1747. true,
  1748. ).then(({ features: [feature] }) => {
  1749. if (feature) {
  1750. this.locationFeature(null, this.visibleLayerId, { feature });
  1751. } else {
  1752. this.feature = undefined;
  1753. }
  1754. });
  1755. } else if (tempLayerIds.length > 1) {
  1756. // 带上图层显示参数,只拾取显示的图斑
  1757. const where = '1=1';
  1758. const [x, y] = e.coordinate;
  1759. const param = {
  1760. where,
  1761. f: 'json',
  1762. inSR: getSrid(this.map),
  1763. outFields: '',
  1764. returnGeometry: 'true',
  1765. geometry: JSON.stringify({ x, y }),
  1766. geometryType: 'esriGeometryPoint',
  1767. };
  1768. const urls = tempLayerIds.map((i) => this.getLayerConfigById(i));
  1769. const promiseArr = urls.map((i) => {
  1770. param.outFields = TABLE_COMP_MAPPING[i.id]
  1771. ? TABLE_COMP_MAPPING[i.id]['outFields']
  1772. : '';
  1773. return arcgisQuery(`${i.url}/${this.layerIndex}/query`, param, true);
  1774. });
  1775. const feature = await Promise.all(promiseArr).then((resp) => {
  1776. if (this.visibleLayerIds.includes('bj-gyyd-new')) {
  1777. for (let i = 0; i < resp.length; i++) {
  1778. if (resp[i].features.length != 0) {
  1779. this.isgyyd = resp[i].displayFieldName;
  1780. }
  1781. }
  1782. }
  1783. for (let i = 0; i < resp.length; i++) {
  1784. if (resp[i].features.length) {
  1785. this.visibleLayerId = tempLayerIds[i];
  1786. break;
  1787. }
  1788. }
  1789. const features = resp
  1790. .filter((i) => i.features.length)
  1791. .map((i) => i.features[0]);
  1792. return features[0];
  1793. });
  1794. if (feature) {
  1795. this.locationFeature(null, this.visibleLayerId, { feature });
  1796. } else {
  1797. this.feature = undefined;
  1798. }
  1799. }
  1800. },
  1801. async locationFeature(
  1802. bsm,
  1803. layerId,
  1804. { feature = undefined, row = undefined } = {},
  1805. ) {
  1806. if (feature) {
  1807. const geometry = feature.getGeometry();
  1808. const wkt = WkxGeometry.parseGeoJSON(
  1809. new GeoJSON().writeGeometryObject(geometry),
  1810. ).toWkt();
  1811. feature.set('wkt', wkt);
  1812. this.feature = feature;
  1813. this.$vm.$emit('getGeoData', feature); //初始化土地生命周期geo/feature参数
  1814. this.$vm.$emit(
  1815. 'mapClickHandle',
  1816. feature.getProperties(),
  1817. this.visibleLayerId,
  1818. );
  1819. this.$emit(
  1820. 'mapClick',
  1821. feature.getProperties(),
  1822. this.visibleLayerId,
  1823. );
  1824. }
  1825. this.drawendFeaturePop(this.feature);
  1826. },
  1827. locationMoreFeatureWithShade(where, layerId, setting = {}) {
  1828. this.spinShow = true;
  1829. const layer = this.$refs.configLayer.getLayerConfigById(layerId);
  1830. if (!layer) {
  1831. console.error(`no layer id`);
  1832. return;
  1833. }
  1834. arcgisQuery(
  1835. `${layer.url}/${this.layerIndex}/query`,
  1836. {
  1837. outSR: getSrid(this.map),
  1838. where,
  1839. ...setting,
  1840. },
  1841. false,
  1842. ).then(({ features }) => {
  1843. this.spinShow = false;
  1844. const geos = {
  1845. type: 'FeatureCollection',
  1846. features: [
  1847. {
  1848. type: 'Feature',
  1849. geometry: {
  1850. type: 'MultiPolygon',
  1851. coordinates: [],
  1852. },
  1853. properties: {},
  1854. },
  1855. ],
  1856. };
  1857. let temp = [];
  1858. features.forEach((it) => {
  1859. temp = [...temp, ...it['geometry']['rings']];
  1860. });
  1861. geos['features'][0]['geometry']['coordinates'] = [[...temp]];
  1862. this.addGeoLayer2(geos);
  1863. // MapUtils.drawShade(this.map, JSON.stringify(geos))
  1864. });
  1865. },
  1866. drawendFeaturePop(drawFeature) {
  1867. if (!drawFeature) {
  1868. this.drawFeature = drawFeature;
  1869. return;
  1870. }
  1871. const geometry = drawFeature.getGeometry();
  1872. const area = getArea(geometry, {
  1873. projection: this.map.getView().getProjection(),
  1874. });
  1875. drawFeature.set('area', (area / 666.67).toFixed(2));
  1876. this.drawendDistrict(drawFeature);
  1877. },
  1878. drawendDistrict(drawFeature) {
  1879. // const urls = ['xzqh-s', 'xzqh-x', 'xzqh-z'].map(i => this.getLayerConfigById(i).url)
  1880. const urls = ['xzqh-z'].map((i) => this.getLayerConfigById(i).url);
  1881. const srid = getSrid(this.map);
  1882. const param = {
  1883. geometry: toArcGIS(drawFeature.getGeometry(), true),
  1884. geometryType: 'esriGeometryPolygon',
  1885. spatialRel: 'esriSpatialRelIntersects',
  1886. inSR: srid,
  1887. outSR: srid,
  1888. returnGeometry: false,
  1889. where: `1=1`,
  1890. };
  1891. const promiseArr = urls.map((i) =>
  1892. arcgisQuery(`${i}/${this.layerIndex}/query`, param, false),
  1893. );
  1894. Promise.all(promiseArr).then((resp) => {
  1895. const features = resp
  1896. .filter((i) => i.features.length)
  1897. .map((i) => i.features);
  1898. drawFeature.set(
  1899. 'areaList',
  1900. features.flat().map((i) => i.attributes.FULLNAME.substr(3)),
  1901. );
  1902. console.log(drawFeature, features, 'Promise all resp');
  1903. this.drawFeature = drawFeature;
  1904. });
  1905. },
  1906. resetMapView() {
  1907. const { districtFeature, map } = this;
  1908. if (districtFeature) {
  1909. mapFit(districtFeature, map);
  1910. } else {
  1911. this.$refs.configLayer.resetMapView();
  1912. }
  1913. },
  1914. drawend(features) {
  1915. // 绘制结束或清空绘制
  1916. const multiPolygon = features
  1917. ? new MultiPolygon(features.map((i) => i.getGeometry()))
  1918. : features;
  1919. const payload = {
  1920. geometry: multiPolygon ? toArcGIS(multiPolygon, true) : '',
  1921. srid: getSrid(this.map),
  1922. };
  1923. this.$store.dispatch('spacemap/setSketchRangeAnalysis', payload);
  1924. },
  1925. getLayerConfigById(layerId) {
  1926. return this.$refs.configLayer.getLayerConfigById(layerId);
  1927. },
  1928. dateFormat(date) {
  1929. if (date === null || date === undefined || date === '') {
  1930. console.log('时间格式化有误,时间为null');
  1931. return '';
  1932. }
  1933. if (typeof date === 'string') {
  1934. return date.substr(0, 10);
  1935. }
  1936. var time = new Date(date);
  1937. var y = time.getFullYear();
  1938. var m = time.getMonth() + 1;
  1939. var d = time.getDate();
  1940. return y + '-' + this.add0(m) + '-' + this.add0(d);
  1941. },
  1942. add0(m) {
  1943. return m < 10 ? '0' + m : m;
  1944. },
  1945. getLayerById(id) {
  1946. return this.$refs.configLayer.getLayerById(id);
  1947. },
  1948. mockDetail(props) {
  1949. this.$vm.$emit('getMockDetail', props);
  1950. },
  1951. bjmockDetail(props) {
  1952. this.$vm.$emit('getBjMockDetail', props);
  1953. },
  1954. locationTsxzDetail(props) {
  1955. this.$vm.$emit('locationTsxzDetail', props);
  1956. },
  1957. tzzxDetail(props) {
  1958. this.$vm.$emit('getTzzxDetail', props);
  1959. },
  1960. statisticsLayer(layerId, setting) {
  1961. const layerById = this.$refs.configLayer.getLayerConfigById(layerId);
  1962. arcgisQuery(
  1963. `${layerById.url}/${this.layerIndex}/query`,
  1964. setting,
  1965. false,
  1966. ).then(({ features }) => {
  1967. this.$vm.$emit(
  1968. 'statisticsLayerCallback',
  1969. features,
  1970. setting['groupByFieldsForStatistics'],
  1971. );
  1972. });
  1973. },
  1974. skyb(p) {
  1975. window.open(`https://yt.zjasm.net/kjzlptv2/blockTool?geometry=${p.wkt}`);
  1976. },
  1977. },
  1978. };
  1979. </script>
  1980. <style lang="scss" scoped>
  1981. .vl-tool-bar {
  1982. display: flex;
  1983. top: 5px !important;
  1984. right: 10px !important;
  1985. > li {
  1986. display: flex;
  1987. align-items: center;
  1988. justify-content: center;
  1989. cursor: pointer;
  1990. width: 34px !important;
  1991. height: 34px !important;
  1992. border: 1px solid #468ec0;
  1993. background: linear-gradient(0deg, #102a54 0%, #3d5a93 100%);
  1994. border-radius: 4px;
  1995. .img {
  1996. width: 18px !important;
  1997. height: 18px !important;
  1998. }
  1999. > div {
  2000. display: flex;
  2001. align-items: center;
  2002. justify-content: center;
  2003. }
  2004. }
  2005. }
  2006. .overlayBox {
  2007. background: url('../../../assets/images/dk_detail_bg.png') no-repeat;
  2008. background-size: 100% 100%;
  2009. padding: 12px 15px;
  2010. border-radius: 2px;
  2011. position: relative;
  2012. font-family: Alibaba PuHuiTi;
  2013. margin-bottom: 40px;
  2014. min-width: 340px;
  2015. > .fixedIcon {
  2016. position: absolute;
  2017. width: 50px;
  2018. height: 50px;
  2019. bottom: -50px;
  2020. left: 0px;
  2021. right: 0px;
  2022. margin: auto;
  2023. background: url('../../../assets/images/map_icon.png') no-repeat;
  2024. background-size: 100% 100%;
  2025. }
  2026. > .title {
  2027. color: #fff;
  2028. position: relative;
  2029. top: -5px;
  2030. font-size: 16px;
  2031. font-weight: bold;
  2032. > .btn {
  2033. float: right;
  2034. cursor: pointer;
  2035. background-color: #0178cd;
  2036. padding: 5px 10px;
  2037. display: inline-block;
  2038. border-radius: 2px;
  2039. margin-top: -5px;
  2040. color: #fff;
  2041. &:hover {
  2042. color: #22f3e2;
  2043. }
  2044. }
  2045. .label {
  2046. float: right;
  2047. color: #22f3e2;
  2048. margin-top: 8px;
  2049. }
  2050. }
  2051. > .content {
  2052. padding: 15px 5px;
  2053. max-width: 360px;
  2054. > h2,
  2055. p {
  2056. color: #fff;
  2057. }
  2058. > h2 {
  2059. font-size: 16px !important;
  2060. margin-bottom: 10px;
  2061. white-space: nowrap;
  2062. text-overflow: ellipsis;
  2063. overflow: hidden;
  2064. font-weight: bold;
  2065. }
  2066. > p {
  2067. font-size: 15px;
  2068. margin: 5px 0px;
  2069. }
  2070. }
  2071. }
  2072. .overview-map {
  2073. position: relative;
  2074. width: 100%;
  2075. height: 100%;
  2076. overflow: hidden;
  2077. $mask-bgc: radial-gradient(
  2078. closest-side at 50%,
  2079. rgba(4, 18, 41, 0) 0,
  2080. rgba(0, 15, 51, 0.2)
  2081. );
  2082. .space-map-mask {
  2083. position: absolute;
  2084. top: 0;
  2085. left: 0;
  2086. z-index: 0;
  2087. width: 100%;
  2088. height: 100%;
  2089. background-image: $mask-bgc;
  2090. pointer-events: none;
  2091. }
  2092. .map-view-info {
  2093. position: absolute;
  2094. bottom: 10px;
  2095. left: 15px;
  2096. width: 350px;
  2097. height: 32px;
  2098. background: rgba(56, 150, 236, 0.64);
  2099. box-shadow: 0 0 20px 1px #012357;
  2100. font-size: 14px;
  2101. font-weight: 400;
  2102. color: #ffffff;
  2103. line-height: 32px;
  2104. text-indent: 1em;
  2105. }
  2106. $bgc: rgba(255, 255, 255, 0.9);
  2107. &::v-deep {
  2108. .vl-tool-bar {
  2109. .vl-tool-bar-item {
  2110. background-color: transparent;
  2111. }
  2112. }
  2113. .vl-legend {
  2114. border: 1px solid #0660b8;
  2115. .legend-panel {
  2116. // background: $bgc;
  2117. background: #02285c;
  2118. color: #00edff;
  2119. .legend-title {
  2120. background: transparent;
  2121. border-bottom: 1px solid #0660b8;
  2122. }
  2123. }
  2124. }
  2125. .vl-layer-tree {
  2126. .layer-dropdown {
  2127. background-color: $bgc;
  2128. }
  2129. }
  2130. }
  2131. .feature-overlay {
  2132. z-index: 999;
  2133. // min-width: 331px;
  2134. // max-width: 400px;
  2135. width: 295px;
  2136. // min-height: 186px;
  2137. // background: url(~@/assets/project/map-overlay.png) no-repeat;
  2138. // background-size: 100% 100%;;
  2139. // padding: 2px 6px 20px;
  2140. color: white;
  2141. background: #fff;
  2142. z-index: 999;
  2143. position: absolute;
  2144. top: 80px;
  2145. right: 20px;
  2146. .title {
  2147. font-size: 18px;
  2148. line-height: 30px;
  2149. font-weight: 600;
  2150. // background: linear-gradient(270deg, #47c4fa 0%, #2390ee 100%);
  2151. background: #2390ee;
  2152. // border-radius: 10px 10px 0px 0px;
  2153. padding-left: 16px;
  2154. .title-label {
  2155. font-size: 16px;
  2156. font-weight: normal;
  2157. float: right;
  2158. cursor: pointer;
  2159. color: #00ffff;
  2160. &:hover {
  2161. font-weight: bolder;
  2162. }
  2163. }
  2164. .detail {
  2165. font-size: 16px;
  2166. color: #22f3e2;
  2167. cursor: pointer;
  2168. margin-left: 5px;
  2169. }
  2170. }
  2171. .section5 {
  2172. padding: 0 20px 10px;
  2173. .name {
  2174. font-weight: 600;
  2175. padding: 10px 0;
  2176. font-size: 17px;
  2177. color: #333333;
  2178. line-height: 22px;
  2179. cursor: default;
  2180. .detail {
  2181. cursor: pointer;
  2182. margin-left: 5px;
  2183. background: #00b9d6;
  2184. border-radius: 3px;
  2185. font-size: 15px;
  2186. color: #ffffff;
  2187. padding: 0 8px;
  2188. }
  2189. }
  2190. table {
  2191. width: 100%;
  2192. font-size: 15px;
  2193. line-height: 15px;
  2194. td,
  2195. th {
  2196. padding: 3px 0;
  2197. }
  2198. th {
  2199. padding-right: 0.5em;
  2200. word-break: keep-all;
  2201. font-weight: normal;
  2202. color: #666666;
  2203. width: 4.3em;
  2204. }
  2205. td {
  2206. min-width: 3em;
  2207. color: #333333;
  2208. font-weight: bold;
  2209. }
  2210. td + th {
  2211. padding-left: 0.5em;
  2212. }
  2213. }
  2214. }
  2215. }
  2216. .ivu-spin-fix {
  2217. z-index: 0 !important;
  2218. background-color: unset;
  2219. color: white;
  2220. background-image: $mask-bgc;
  2221. }
  2222. }
  2223. </style>