移动端
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

assetMapOpen.vue 42 KiB

před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
před 1 rokem
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019
  1. <template>
  2. <div class="homestead_main">
  3. <!--<div id="landMapDiv"></div>-->
  4. <div class="header_main"
  5. :style="`background-image:url(${require(showBtn?'@/assets/images/sunVillage_info/list_head.png':'@/assets/images/sunVillage_info/list_head_red.png')})`"
  6. >
  7. 资产地图公开
  8. <div class="return_btn" @click="onClickLeft"></div>
  9. </div>
  10. <div id="mapAll"> </div>
  11. <div id="info" style="display: none"></div>
  12. <div class="plotPremises_right" v-if="this.mapHaDataValue">
  13. <div class="land_information_main">
  14. <div class="area_information">
  15. <div class="mian">
  16. <div class="basic_information" v-if="mapHasDateStatus == 0">
  17. <div class="basic_block">
  18. <van-row>
  19. <van-col :span="4"><span class="title">资源编码:</span></van-col>
  20. <van-col :span="8"><span class="desc">{{ mapHasData.code }}</span></van-col>
  21. <van-col :span="4"><span class="title">资源名称:</span></van-col>
  22. <van-col :span="8"><span class="desc">{{ mapHasData.name }}</span></van-col>
  23. </van-row>
  24. <van-row>
  25. <van-col :span="4"><span class="title">资源类型:</span></van-col>
  26. <van-col :span="8"><span class="desc">{{ mapHasData.resourceType }}</span></van-col>
  27. <van-col :span="4"><span class="title">坐落位置:</span></van-col>
  28. <van-col :span="8"><span class="desc">{{ mapHasData.location }}</span></van-col>
  29. </van-row>
  30. <van-row>
  31. <van-col :span="4"><span class="title">东至:</span></van-col>
  32. <van-col :span="8"><span class="desc">{{ mapHasData.east }}</span></van-col>
  33. <van-col :span="4"><span class="title">西至:</span></van-col>
  34. <van-col :span="8"><span class="desc">{{ mapHasData.west }}</span></van-col>
  35. </van-row>
  36. <van-row>
  37. <van-col :span="4"><span class="title">南至:</span></van-col>
  38. <van-col :span="8"><span class="desc">{{ mapHasData.south }}</span></van-col>
  39. <van-col :span="4"><span class="title">北至:</span></van-col>
  40. <van-col :span="8"><span class="desc">{{ mapHasData.north }}</span></van-col>
  41. </van-row>
  42. <van-row>
  43. <van-col :span="4"><span class="title">总面积:</span></van-col>
  44. <van-col :span="8"><span class="desc">{{ mapHasData.totalArea }}</span></van-col>
  45. <van-col :span="4"><span class="title">资产状态:</span></van-col>
  46. <van-col :span="8"><span class="desc">{{ mapHasData.status }}</span></van-col>
  47. </van-row>
  48. <van-row>
  49. <van-col :span="4"><span class="title">使用情况:</span></van-col>
  50. <van-col :span="8"><span class="desc">{{ mapHasData.useType }}</span></van-col>
  51. <van-col :span="4"><span class="title">备注:</span></van-col>
  52. <van-col :span="8"><span class="desc">{{ mapHasData.remark }}</span></van-col>
  53. </van-row>
  54. <van-row>
  55. <van-col :span="24"><span class="title">附件图片:</span></van-col>
  56. </van-row>
  57. <van-row>
  58. <van-col :span="24" style="height: 120px;overflow-y: auto;">
  59. <div class="fileList">
  60. <template v-for="(item,index) in mapHasData.fileList">
  61. <a :href="item.url" v-if="item.url.indexOf('xlsx') > -1 || item.url.indexOf('xls') > -1">
  62. <img src="../../assets/images/homestead/icon_excel.jpg" alt="" style="width:100px;height: 100px;">
  63. </a>
  64. <a :href="item.url" v-else-if="item.url.indexOf('docx') > -1 || item.url.indexOf('dox') > -1">
  65. <img src="../../assets/images/homestead/icon_word.jpg" alt="" style="width:100px;height: 100px;">
  66. </a>
  67. <img v-else :src="item.url" alt="" @click="openImage(item.url)" style="width:100px;height: 100px;">
  68. </template>
  69. <van-empty v-if="mapHasData.fileList.length<1" description="暂无附件"></van-empty>
  70. </div>
  71. </van-col>
  72. </van-row>
  73. <div class="gl_main">
  74. <div class="headers">
  75. <div class="flex3">合同编码</div>
  76. <div class="flex3">合同名称</div>
  77. <div class="flex3">发包对象</div>
  78. <div class="flex3">承包款(元)</div>
  79. <div class="flex3">状态</div>
  80. </div>
  81. <div class="desc_main">
  82. <ul class="analysisTable_list">
  83. <!--1-->
  84. <li v-for="item in contractionList" class="flex_item">
  85. <div class="flex3" @click="lookName(item.code)">{{item.code}}</div>
  86. <div class="flex3" @click="lookName(item.name)">{{item.name}}</div>
  87. <div class="flex3">{{item.secondParty}}</div>
  88. <div class="flex3">{{item.totalAmount}}</div>
  89. <div class="flex3">{{selectDictLabel(contractionStatuOptions, item.contractionStatus)}}</div>
  90. </li>
  91. </ul>
  92. </div>
  93. </div>
  94. <!-- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>-->
  95. </div>
  96. </div>
  97. <div class="basic_information" v-if="mapHasDateStatus == 1">
  98. <div class="basic_block">
  99. <van-row>
  100. <van-col :span="4"><span class="title">资产编码:</span></van-col>
  101. <van-col :span="8"><span class="desc">{{ mapHasData.code }}</span></van-col>
  102. <van-col :span="4"><span class="title">资产名称:</span></van-col>
  103. <van-col :span="8"><span class="desc">{{ mapHasData.name }}</span></van-col>
  104. </van-row>
  105. <van-row>
  106. <van-col :span="4"><span class="title">资产类别:</span></van-col>
  107. <van-col :span="8"><span class="desc">{{ mapHasData.assetType }}</span></van-col>
  108. <van-col :span="4"><span class="title">经营属性:</span></van-col>
  109. <van-col :span="8"><span class="desc">{{ mapHasData.operationType }}</span></van-col>
  110. </van-row>
  111. <van-row>
  112. <van-col :span="4"><span class="title">增加方式:</span></van-col>
  113. <van-col :span="8"><span class="desc">{{ mapHasData.addType }}</span></van-col>
  114. <van-col :span="4"><span class="title">构建时间:</span></van-col>
  115. <van-col :span="8"><span class="desc">{{ mapHasData.buildTime }}</span></van-col>
  116. </van-row>
  117. <van-row>
  118. <van-col :span="4"><span class="title">坐落位置:</span></van-col>
  119. <van-col :span="8"><span class="desc">{{ mapHasData.location }}</span></van-col>
  120. <van-col :span="4"><span class="title">规格型号:</span></van-col>
  121. <van-col :span="8"><span class="desc">{{ mapHasData.specification }}</span></van-col>
  122. </van-row>
  123. <van-row>
  124. <van-col :span="4"><span class="title">供应商:</span></van-col>
  125. <van-col :span="8"><span class="desc">{{ mapHasData.supplier }}</span></van-col>
  126. <van-col :span="4"><span class="title">使用情况:</span></van-col>
  127. <van-col :span="8"><span class="desc">{{ mapHasData.useType }}</span></van-col>
  128. </van-row>
  129. <van-row>
  130. <van-col :span="4"><span class="title">数量/面积:</span></van-col>
  131. <van-col :span="8"><span class="desc">{{ mapHasData.quantity }}</span></van-col>
  132. <van-col :span="4"><span class="title">计量单位:</span></van-col>
  133. <van-col :span="8"><span class="desc">{{ mapHasData.unit }}</span></van-col>
  134. </van-row>
  135. <van-row>
  136. <van-col :span="4"><span class="title">原值:</span></van-col>
  137. <van-col :span="8"><span class="desc">{{ mapHasData.originalValue }}</span></van-col>
  138. <van-col :span="4"><span class="title">资产状态:</span></van-col>
  139. <van-col :span="8"><span class="desc">{{ mapHasData.assetStatus }}</span></van-col>
  140. </van-row>
  141. <van-row>
  142. <van-col :span="24"><span class="title">附件图片:</span></van-col>
  143. </van-row>
  144. <van-row>
  145. <van-col :span="24" style="height: 120px;overflow-y: auto;">
  146. <div class="fileList">
  147. <template v-for="(item,index) in mapHasData.fileList">
  148. <a :href="item.url" v-if="item.url.indexOf('xlsx') > -1 || item.url.indexOf('xls') > -1">
  149. <img src="../../assets/images/homestead/icon_excel.jpg" alt="" style="width:100px;height: 100px;">
  150. </a>
  151. <a :href="item.url" v-else-if="item.url.indexOf('docx') > -1 || item.url.indexOf('dox') > -1">
  152. <img src="../../assets/images/homestead/icon_word.jpg" alt="" style="width:100px;height: 100px;">
  153. </a>
  154. <img v-else :src="item.url" alt="" @click="openImage(item.url)" style="width:100px;height: 100px;">
  155. </template>
  156. <van-empty v-if="mapHasData.fileList.length<1" description="暂无附件"></van-empty>
  157. </div>
  158. </van-col>
  159. </van-row>
  160. <div class="gl_main">
  161. <div class="headers">
  162. <div class="flex3">合同编码</div>
  163. <div class="flex3">合同名称</div>
  164. <div class="flex3">发包对象</div>
  165. <div class="flex3">承包款(元)</div>
  166. <div class="flex3">状态</div>
  167. </div>
  168. <div class="desc_main">
  169. <ul class="analysisTable_list">
  170. <!--1-->
  171. <li v-for="item in contractionList" class="flex_item">
  172. <div class="flex3" @click="lookName(item.code)">{{item.code}}</div>
  173. <div class="flex3" @click="lookName(item.name)">{{item.name}}</div>
  174. <div class="flex3">{{item.secondParty}}</div>
  175. <div class="flex3" >{{item.totalAmount}}</div>
  176. <div class="flex3">{{selectDictLabel(contractionStatuOptions, item.contractionStatus)}}</div>
  177. </li>
  178. </ul>
  179. </div>
  180. </div>
  181. </div>
  182. <!--<div class="basic_block">
  183. <span class="title">折旧科目:</span>
  184. <span class="desc">{{ mapHasData.depreciationSubject }}</span>
  185. </div>
  186. <div class="basic_block">
  187. <span class="title">折旧费用科目:</span>
  188. <span class="desc">{{ mapHasData.depreciationFeeSubject }}</span>
  189. </div>
  190. <div class="basic_block">
  191. <span class="title">资产清理科目:</span>
  192. <span class="desc">{{ mapHasData.fixedSubject }}</span>
  193. </div>
  194. <div class="basic_block">
  195. <span class="title">资产清理额:</span>
  196. <span class="desc">{{ mapHasData.fixedValue }}</span>
  197. </div>
  198. <div class="basic_block">
  199. <span class="title">购置凭证ID:</span>
  200. <span class="desc">{{ mapHasData.voucherId }}</span>
  201. </div>-->
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <van-dialog v-model="dialogVisible">
  208. <img width="100%" :src="dialogImageUrl" alt="">
  209. </van-dialog>
  210. </div>
  211. </template>
  212. <style scoped lang="scss">
  213. .homestead_main {
  214. height: 100vh;
  215. display: flex;
  216. display: -webkit-flex;
  217. display: -ms-flexbox;
  218. display: -moz-box;
  219. flex-direction: column;
  220. position: relative;
  221. }
  222. #mapAll {
  223. height: 100vh;
  224. position: absolute;
  225. left: 0;
  226. top: 0;
  227. width: 100vw;
  228. }
  229. .header_main{
  230. height: 116px;
  231. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  232. background-size: 100% 100%;
  233. position: fixed;
  234. top: 0;
  235. left: 0;
  236. width: 100%;
  237. font-size: 36px;
  238. line-height: 116px;
  239. text-align: center;
  240. color: #fff;
  241. position: fixed;
  242. z-index: 9999;
  243. .return_btn{
  244. width: 24px;
  245. height: 43.2px;
  246. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  247. background-size: 20px 36px;
  248. position: absolute;
  249. left: 38px;
  250. top: 36px;
  251. }
  252. .add_btn{
  253. width: 56.4px;
  254. height: 40.8px;
  255. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  256. background-size: 47px 34px;
  257. position: absolute;
  258. right: 38px;
  259. top: 36px;
  260. }
  261. }
  262. .fileList{
  263. img{
  264. width: 8vw;
  265. height: 8vw;
  266. margin-right: 20px;
  267. }
  268. }
  269. .flex3 {
  270. flex: 0.5;
  271. overflow: hidden; /*超出部分隐藏*/
  272. white-space: nowrap; /*不换行*/
  273. text-overflow: ellipsis; /*超出部分文字以...显示*/
  274. }
  275. .plotPremises_right {
  276. width: 94%;
  277. position: fixed;
  278. z-index: 1001;
  279. top: 50%;
  280. transform: translateY(-50%);
  281. right: 3%;
  282. display: flex;
  283. // display: none;
  284. min-width: 300px;
  285. /*height: calc(100% - 104px);*/
  286. flex-direction: column;
  287. .topTrimLine {
  288. width: 100%;
  289. height: 8px;
  290. background: url("../../assets/images/homestead/header_border.png")
  291. no-repeat;
  292. background-size: 100% 100%;
  293. position: absolute;
  294. top: -4px;
  295. left: 0;
  296. }
  297. .land_information_main {
  298. flex: 1;
  299. // align-items: center;
  300. .area_information {
  301. // margin-bottom: 3%;
  302. position: relative;
  303. .mian {
  304. background: rgba(25, 29, 24, 0.7);
  305. /*background: rgba(255, 255, 255, 0.7);*/
  306. // background: url("../../assets/images/dataScreen/plotPremises/left_top_img.png")
  307. // no-repeat;
  308. // background-size: 100% 100%;
  309. padding: 3%;
  310. flex: 1;
  311. display: flex;
  312. flex-direction: column;
  313. .area_title {
  314. margin: 0;
  315. font-size: 22px;
  316. color: #38da94;
  317. }
  318. .basic_information {
  319. position: relative;
  320. flex: 1;
  321. display: flex;
  322. flex-direction: column;
  323. .basic_block {
  324. font-size: 15px;
  325. color: #47c68f;
  326. flex: 1;
  327. .van-row{
  328. display:flex;
  329. flex-wrap: wrap;
  330. .van-col{
  331. padding: 1% 0 1% 2%;
  332. border-top: 1px solid #fff;
  333. border-left: 1px solid #fff;
  334. &:last-child{
  335. border-right: 1px solid #fff;
  336. }
  337. }
  338. &:last-child{
  339. .van-col{
  340. &:last-child{
  341. border-bottom: 1px solid #fff;
  342. }
  343. }
  344. }
  345. }
  346. .title {
  347. color: #fff;
  348. padding-right: 8px;
  349. }
  350. }
  351. .patternmaking {
  352. position: absolute;
  353. right: 2%;
  354. bottom: 16%;
  355. .img_block {
  356. margin-top: 8px;
  357. &:first-child {
  358. margin-top: 0;
  359. }
  360. }
  361. p {
  362. margin: 0;
  363. font-size: 0;
  364. img {
  365. width: 78px;
  366. height: 60px;
  367. }
  368. }
  369. }
  370. .gl_main{
  371. margin-top: .8vh;
  372. height: 28.15vh;
  373. padding:0.92vh 0 0 0;
  374. .headers {
  375. height: 3.24vh;
  376. font-size: 1.48vh;
  377. color: #0befca;
  378. text-align: center;
  379. display: flex;
  380. justify-content: center;
  381. align-items: center;
  382. background: rgba(11,239,202,.3);
  383. padding-right: 0.53vw;
  384. margin-bottom: 1vh;
  385. .flex_left{
  386. text-align: left;
  387. padding-left: 0.83vw;
  388. }
  389. }
  390. .desc_main{
  391. height: 21.5vh;
  392. overflow-y: scroll;
  393. padding-right: 0.3vw;
  394. box-sizing:border-box;
  395. .analysisTable_list {
  396. margin: 0;
  397. padding: 0;
  398. flex: 1;
  399. display: flex;
  400. flex-direction: column;
  401. .flex_left{
  402. text-align: left;
  403. padding-left: 0.83vw;
  404. box-sizing:border-box;
  405. }
  406. .flex_item {
  407. height: 2.77vh;
  408. list-style: none;
  409. margin: 0;
  410. display: flex;
  411. justify-content: center;
  412. align-items: center;
  413. text-align: center;
  414. color: #fff;
  415. font-size: 1.29vh;
  416. position: relative;
  417. // border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  418. // &:hover {
  419. // background: rgba(8, 85, 255, 0.6);
  420. // }
  421. &:nth-child(2n){
  422. background: rgba(53, 125, 250, 0.1);
  423. }
  424. }
  425. }
  426. }
  427. }
  428. }
  429. .area_data {
  430. padding: 4% 0;
  431. display: flex;
  432. justify-content: space-between;
  433. flex-wrap: wrap;
  434. border-bottom: 1px solid #62655d;
  435. .details_block {
  436. width: 33.33%;
  437. &.line {
  438. margin-bottom: 2%;
  439. }
  440. p {
  441. margin: 0;
  442. }
  443. .m_title {
  444. color: #bbb;
  445. font-size: 12px;
  446. padding-bottom: 5px;
  447. }
  448. .m_desc {
  449. color: #fff;
  450. font-size: 14px;
  451. }
  452. }
  453. }
  454. .farmhouse_table {
  455. padding: 4% 0 2%;
  456. }
  457. }
  458. }
  459. }
  460. }
  461. </style>
  462. <script>
  463. import {
  464. getPermanentList,
  465. getResourceList,
  466. assetPropertyDetail,
  467. assetResourceDetail,
  468. openAttachmentList
  469. } from "@/api/sunVillage_info/fixedAssets";
  470. import {getQueryLand} from "@/api/sunVillage_info/homestead/application";
  471. import { getConfigKey } from "@/api/system/config";
  472. export default {
  473. components: {
  474. getPermanentList,
  475. getResourceList,
  476. getQueryLand
  477. },
  478. data() {
  479. return {
  480. situationW: 70,
  481. //地图判断
  482. openMap: false,
  483. showBtn: false,
  484. mapTheGeomId: null,
  485. mapTheGeomResourceId: null,
  486. drawInsert:null,
  487. mapHasData:{},
  488. contractionList:[],
  489. //合同状态字典
  490. contractionStatuOptions:[],
  491. mapHaDataValue:false,
  492. mapHasDateStatus: 0, //0资源资产 1固定资产
  493. dialogVisible:false,
  494. dialogImageUrl:'',
  495. mapGeoServerUrl: "", // geoserver地址
  496. villageBorderLayerName: "", // 乡镇边界图层名称
  497. };
  498. },
  499. created() {
  500. // 获取geoserver的地址
  501. this.getGeoServerUrl();
  502. // 获取村边界的图层名称
  503. this.getVillageBorderLayerName();
  504. },
  505. mounted() {
  506. let mapTheGeomAll =this.$cookies.get("bookId");
  507. console.info(mapTheGeomAll);
  508. getPermanentList(mapTheGeomAll).then((response) => {
  509. if (response.code == 200) {
  510. this.mapTheGeomId = response.data;
  511. }
  512. });
  513. getResourceList(mapTheGeomAll).then((response) => {
  514. if (response.code == 200) {
  515. this.mapTheGeomResourceId = response.data;
  516. setTimeout(() => {
  517. this.GetMapsInit();
  518. }, 500);
  519. }
  520. });
  521. },
  522. methods: {
  523. // 获取geoserver的地址
  524. getGeoServerUrl() {
  525. getConfigKey("system.geoServer.url").then(response => {
  526. this.mapGeoServerUrl = response.msg;
  527. });
  528. },
  529. // 获取村边界的图层名称
  530. getVillageBorderLayerName() {
  531. getConfigKey("geoserver.layer.villageBorder").then(response => {
  532. this.villageBorderLayerName = response.msg;
  533. });
  534. },
  535. openImage(url){
  536. this.dialogImageUrl = url;
  537. this.dialogVisible = true;
  538. },
  539. lookName(val){
  540. this.$toast(val);
  541. },
  542. //地图加载 -----start
  543. GetMapsInit() {
  544. this.getDicts("contraction_status").then((response) => {
  545. this.contractionStatuOptions = response.data;
  546. });
  547. //加载地图编辑
  548. var that = this;
  549. var map;
  550. //矢量标注样式设置函数,设置image为图标ol.style.Icon
  551. function createLabelStyle() {
  552. return new ol.style.Style({
  553. image: new ol.style.Icon({
  554. //设置图标偏移
  555. anchor: [0.5, 1],
  556. //标注样式的起点位置
  557. anchorOrigin: "top-right",
  558. //X方向单位:分数
  559. anchorXUnits: "fraction",
  560. //Y方向单位:像素
  561. anchorYUnits: "pixels",
  562. //偏移起点位置的方向
  563. offsetOrigin: "top-right",
  564. //透明度
  565. opacity: 0.9,
  566. //图片路径
  567. src: require("../../assets/images/homestead/mark.png"),
  568. }),
  569. text: new ol.style.Text({
  570. textAlign: "center", //位置
  571. textBaseline: "middle", //基准线
  572. font: "normal 12px 微软雅黑", //文字样式
  573. //text: "标注点", //文本内容
  574. fill: new ol.style.Fill({
  575. //文本填充样式(即文字颜色)
  576. color: "#ff0000",
  577. }),
  578. }),
  579. zIndex: 9999,
  580. });
  581. }
  582. // document.getElementById("mapAll").innerHTML = '';
  583. var hc_land;
  584. var vector_drawing;
  585. var projection = new ol.proj.Projection({
  586. //地图投影类型
  587. code: "EPSG:3857",
  588. units: "degrees",
  589. //extent:extent
  590. });
  591. var aerial = new ol.layer.Tile({
  592. source: new ol.source.XYZ({
  593. url: "http://t0.tianditu.gov.cn/img_w/wmts?" +
  594. "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
  595. "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067",
  596. }),
  597. isGroup: true,
  598. name: "卫星影像图",
  599. });
  600. var yingxzi = new ol.layer.Tile({
  601. source: new ol.source.XYZ({
  602. url: "https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067",
  603. }),
  604. isGroup: true,
  605. name: "天地图文字标注--卫星影像图",
  606. });
  607. //加载地图
  608. map = new ol.Map({
  609. controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]), //隐藏放大缩小按钮
  610. layers: [aerial, yingxzi],
  611. projection: projection,
  612. target: "mapAll",
  613. view: new ol.View({
  614. //center: ol.proj.fromLonLat([115.452752, 31.789033]),
  615. zoom: 15,
  616. minZoom: 0, //地图缩小限制
  617. maxZoom: 18.3, //地图放大限制
  618. }),
  619. });
  620. // 添加村边界
  621. let mapBorder = new ol.layer.Image({
  622. source: new ol.source.ImageWMS({
  623. url: this.mapGeoServerUrl + '/wms',
  624. params: {
  625. LAYERS: this.villageBorderLayerName,
  626. cql_filter: "dept_id = '" + this.$cookies.get("deptId") + "'",
  627. SRID: 3857,
  628. },
  629. }),
  630. name: 'villageBorderLayer'
  631. });
  632. map.addLayer(mapBorder);
  633. //判断当前账套是否有数据
  634. var mapTalkAbout = true;
  635. //图层查询资源性资产定位开始 ---------start
  636. if(this.mapTheGeomResourceId.length >0) {
  637. for (var i = 0; this.mapTheGeomResourceId.length > i; i++) {
  638. if (this.mapTheGeomResourceId[i] !=null && this.mapTheGeomResourceId[i].theGeom != null && this.mapTheGeomResourceId[i].theGeom != "") {
  639. mapTalkAbout =false;
  640. hc_land = new ol.layer.Vector({
  641. title: "add Layer",
  642. source: new ol.source.Vector({
  643. projection: projection,
  644. features: new ol.format.GeoJSON().readFeatures("{\n" +
  645. " \"type\": \"Feature\",\n" +
  646. " \"geometry\":" + this.mapTheGeomResourceId[i].theGeom + ", \"properties\":" + JSON.stringify(this.mapTheGeomResourceId[i]) + "}"),
  647. }),
  648. style: new ol.style.Style({
  649. fill: new ol.style.Fill({
  650. //矢量图层填充颜色,以及透明度
  651. color: "rgba(204, 255, 204,0.3)",
  652. }),
  653. stroke: new ol.style.Stroke({
  654. //边界样式
  655. color: "#47c68f",
  656. width: 3,
  657. }),
  658. }),
  659. });
  660. map.addLayer(hc_land);
  661. var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX;
  662. var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY;
  663. var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX;
  664. var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY;
  665. //定位查询位置
  666. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  667. map.getView().animate({
  668. // 只设置需要的属性即可
  669. center: center, // 中心点
  670. zoom: 15.8, // 缩放级别
  671. rotation: undefined, // 缩放完成view视图旋转弧度
  672. duration: 1000, // 缩放持续时间,默认不需要设置
  673. });
  674. }
  675. }
  676. }
  677. //图层查询资源性资产定位开始 ---------end
  678. //图层查询固定资产定位开始 ---------start
  679. if(this.mapTheGeomId.length >0) {
  680. for (var i = 0; this.mapTheGeomId.length > i; i++) {
  681. if (this.mapTheGeomId[i] != null && this.mapTheGeomId[i].theGeom != null && this.mapTheGeomId[i].theGeom != "") {
  682. mapTalkAbout =false;
  683. var theGeomMap = this.mapTheGeomId[i].theGeom.replace("Point", "MultiPolygon");
  684. var pointLeft = theGeomMap.replace("[", "[[[[");
  685. var pointRight = pointLeft.replace("]", "]]]]");
  686. hc_land = new ol.layer.Vector({
  687. title: "add Layer",
  688. source: new ol.source.Vector({
  689. projection: projection,
  690. features: new ol.format.GeoJSON().readFeatures("{\n" +
  691. " \"type\": \"Feature\",\n" +
  692. " \"geometry\":" + pointRight +", \"properties\":" + JSON.stringify(this.mapTheGeomId[i]) + "}"),
  693. }),
  694. style: new ol.style.Style({
  695. fill: new ol.style.Fill({
  696. //矢量图层填充颜色,以及透明度
  697. color: "rgba(204, 255, 204,0.3)",
  698. }),
  699. stroke: new ol.style.Stroke({
  700. //边界样式
  701. color: "#47c68f",
  702. width: 3,
  703. }),
  704. }),
  705. });
  706. map.addLayer(hc_land);
  707. var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX;
  708. var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY;
  709. var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX;
  710. var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY;
  711. //定位查询位置
  712. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  713. var newcenterFeature = new ol.Feature({
  714. geometry: new ol.geom.Point(center), //几何信息
  715. name: "标注点",
  716. properties: hc_land.values_.source.featuresRtree_.rbush_.data.children
  717. });
  718. var sourceMapLook = new ol.source.Vector({wrapX: false});
  719. vector_drawing = new ol.layer.Vector({
  720. source: sourceMapLook,
  721. });
  722. map.addLayer(vector_drawing);
  723. newcenterFeature.setStyle(createLabelStyle()); //设置要素样式
  724. sourceMapLook.addFeature(newcenterFeature);
  725. map.getView().animate({
  726. // 只设置需要的属性即可
  727. center: center, // 中心点
  728. zoom: 15.8, // 缩放级别
  729. rotation: undefined, // 缩放完成view视图旋转弧度
  730. duration: 1000, // 缩放持续时间,默认不需要设置
  731. });
  732. }
  733. }
  734. }
  735. //图层查询固定资产定位结束 ---------end
  736. //点击查询详细信息
  737. map.on("singleclick", function (evt) {
  738. let feature = map.forEachFeatureAtPixel(
  739. evt.pixel,
  740. (feature) => feature
  741. );
  742. if(feature) {
  743. var ifConsole = feature.values_.name;
  744. if (ifConsole !="标注点") {
  745. assetResourceDetail(feature.values_.id, {translate_dict: 1}).then((resp) => {
  746. that.contractionList = resp.data.params.contractionAssetList;
  747. that.mapHaDataValue = true;
  748. });
  749. let obj = {};
  750. that.mapHasDateStatus = 0;
  751. obj.code = feature.values_.code;//资源编码
  752. obj.name = feature.values_.name;//资源名称
  753. obj.totalArea = feature.values_.totalArea; //总面积
  754. obj.location = feature.values_.location; //坐落位置
  755. obj.east = feature.values_.east; //东至
  756. obj.west = feature.values_.west; //西至
  757. obj.south = feature.values_.south; //南至
  758. obj.north = feature.values_.north; //北至
  759. obj.sumArea = feature.values_.sumArea; //未利用地=集体经营+出租经营+其他经营
  760. obj.groupArea = feature.values_.groupArea; //面积-集体经营
  761. obj.groupValue = feature.values_.groupValue; //年收益-集体经营
  762. obj.rentArea = feature.values_.rentArea; //面积-出租经营(合同写入的)
  763. obj.rentValue = feature.values_.rentValue; //年租金-出租经营(合同写入的)
  764. obj.rentLessee = feature.values_.rentLessee; //承租人-出租经营(合同写入的)
  765. obj.rentStartTime = feature.values_.rentStartTime; //开始时间-出租经营(合同写入的)
  766. obj.rentEndTime = feature.values_.rentEndTime; //到期时间-出租经营(合同写入的)
  767. obj.otherArea = feature.values_.otherArea; //面积-其他经营
  768. obj.otherValue = feature.values_.otherValue; //年收益-其他经营
  769. obj.farmerArea = feature.values_.farmerArea; //已承包到户总面积
  770. obj.circulationArea = feature.values_.circulationArea; //面积-流转入集体统一经营
  771. obj.circulationValue = feature.values_.circulationValue; //年收益-流转入集体统一经营
  772. obj.investmentArea = feature.values_.investmentArea; //面积-对外投资
  773. obj.investmentValue = feature.values_.investmentValue; //年收益-对外投资
  774. obj.investmentLessee = feature.values_.investmentLessee; //投资对象-对外投资
  775. obj.investmentStartTime = feature.values_.investmentStartTime; //开始时间-对外投资
  776. obj.investmentEndTime = feature.values_.investmentEndTime; //到期时间-对外投资
  777. obj.resourceType = feature.values_.resourceType; //资产类型
  778. obj.status = feature.values_.status; //资产状态
  779. obj.useType = feature.values_.useType; //使用情况
  780. obj.remark = feature.values_.remark; //备注
  781. //资源资产字典项
  782. that.getDicts("resource_type").then(response => {
  783. var resourceTypeOptions = response.data;
  784. if(obj.resourceType !=null && obj.resourceType !="") {
  785. for (var i = 0; resourceTypeOptions.length > i; i++) {
  786. if (obj.resourceType == resourceTypeOptions[i].dictValue) {
  787. obj.resourceType = resourceTypeOptions[i].dictLabel;
  788. break;
  789. }
  790. }
  791. }
  792. });
  793. //使用情况字典项
  794. that.getDicts("use_type").then(response => {
  795. var useTypeOptions = response.data;
  796. if(obj.useType !=null && obj.useType !="") {
  797. for (var i = 0; useTypeOptions.length > i; i++) {
  798. if (obj.useType == useTypeOptions[i].dictValue) {
  799. obj.useType = useTypeOptions[i].dictLabel;
  800. break;
  801. }
  802. }
  803. }
  804. });
  805. //资产状态字典项
  806. that.getDicts("sys_normal_disable").then(response => {
  807. var statusOptions = response.data;
  808. if(obj.status !=null && obj.status !="") {
  809. for (var i = 0; statusOptions.length > i; i++) {
  810. if (obj.status == statusOptions[i].dictValue) {
  811. obj.status = statusOptions[i].dictLabel;
  812. break;
  813. }
  814. }
  815. }
  816. });
  817. obj.fileList = [];
  818. let parmasData = {
  819. tableId: feature.values_.id,
  820. tableName: 't_asset_resource',
  821. bizPath: 'asset',
  822. };
  823. openAttachmentList(parmasData).then((res) => {
  824. if (res.code == 200) {
  825. res.rows.map(rr=>{
  826. obj.fileList.push({
  827. url:'/api'+rr.fileUrl
  828. })
  829. })
  830. }
  831. });
  832. console.log(obj)
  833. that.mapHasData = obj;
  834. } else {
  835. let obj = {};
  836. assetPropertyDetail(feature.values_.properties[0].value.values_.id, {translate_dict: 1}).then((resp) => {
  837. that.contractionList = resp.data.params.contractionAssetList;
  838. that.mapHaDataValue = true;
  839. });
  840. that.mapHasDateStatus = 1;
  841. obj.code = feature.values_.properties[0].value.values_.code;//资源编码
  842. obj.name = feature.values_.properties[0].value.values_.name;//资源名称
  843. obj.buildTime = feature.values_.properties[0].value.values_.buildTime; //构建时间
  844. obj.location = feature.values_.properties[0].value.values_.location; //坐落位置
  845. obj.specification = feature.values_.properties[0].value.values_.specification; //规格型号
  846. obj.supplier = feature.values_.properties[0].value.values_.supplier; //供应商
  847. obj.quantity = feature.values_.properties[0].value.values_.quantity; //数量/建筑面积
  848. //obj.unit = feature.values_.properties[0].value.values_.unit; //计量单位
  849. obj.originalValue = feature.values_.properties[0].value.values_.originalValue; //原值
  850. obj.netValue = feature.values_.properties[0].value.values_.netValue; //净值(原值-累计折旧)
  851. obj.residualsRate = feature.values_.properties[0].value.values_.residualsRate; //残值率 N%
  852. obj.netSalvage = feature.values_.properties[0].value.values_.netSalvage; //净残值(原值*残值率)
  853. obj.expectedYears = feature.values_.properties[0].value.values_.expectedYears; //预计使用年数
  854. obj.perYearDepreciationValue = feature.values_.perYearDepreciationValue; //每年折旧额:(原值-净残值)/ 预计使用年数
  855. obj.depreciationYears = feature.values_.properties[0].value.values_.depreciationYears; //已折旧年数
  856. obj.depreciationValue = feature.values_.properties[0].value.values_.depreciationValue; //累计折旧(已提折旧):每年折旧额*已折旧年数
  857. obj.depreciationSubject = feature.values_.properties[0].value.values_.depreciationSubject; //折旧科目(152:累计折旧)
  858. obj.depreciationFeeSubject = feature.values_.properties[0].value.values_.depreciationFeeSubject; //折旧费用科目(541005:管理费用-折旧及修理费)
  859. obj.fixedSubject = feature.values_.properties[0].value.values_.fixedSubject; //资产清理科目(153:固定资产清理)
  860. obj.fixedValue = feature.values_.properties[0].value.values_.fixedValue; //资产清理额
  861. obj.voucherId = feature.values_.properties[0].value.values_.voucherId; //购置凭证ID
  862. obj.assetType = feature.values_.properties[0].value.values_.assetType; //资产类别
  863. obj.operationType = feature.values_.properties[0].value.values_.operationType; //经营属性
  864. obj.addType = feature.values_.properties[0].value.values_.addType; //增加方式
  865. obj.useType = feature.values_.properties[0].value.values_.useType; //使用情况
  866. obj.depreciationType = feature.values_.properties[0].value.values_.depreciationType; //折旧方式
  867. obj.assetStatus = feature.values_.properties[0].value.values_.assetStatus; //资产状态
  868. obj.unit = feature.values_.properties[0].value.values_.unit; //计量单位
  869. obj.fileList = [];
  870. let parmasData = {
  871. tableId: feature.values_.properties[0].value.values_.id,
  872. tableName: 't_asset_permanent',
  873. bizPath: 'asset',
  874. };
  875. openAttachmentList(parmasData).then((res) => {
  876. if (res.code == 200) {
  877. res.rows.map(rr=>{
  878. obj.fileList.push({
  879. url:'/api'+rr.fileUrl
  880. })
  881. })
  882. }
  883. });
  884. //固定资产字典项
  885. that.getDicts("asset_type").then((response) => {
  886. var assetTypeOptions = response.data;
  887. if(obj.assetType !=null && obj.assetType !=""){
  888. for(var i=0;assetTypeOptions.length >i; i++){
  889. if(obj.assetType == assetTypeOptions[i].dictValue) {
  890. obj.assetType = assetTypeOptions[i].dictLabel;
  891. break;
  892. }
  893. }
  894. }
  895. });
  896. that.getDicts("operation_type").then((response) => {
  897. var operationTypeOptions = response.data;
  898. if(obj.operationType !=null && obj.operationType !="") {
  899. for (var i = 0; operationTypeOptions.length > i; i++) {
  900. if (obj.operationType == operationTypeOptions[i].dictValue) {
  901. obj.operationType = operationTypeOptions[i].dictLabel;
  902. break;
  903. }
  904. }
  905. }
  906. });
  907. that.getDicts("add_type").then((response) => {
  908. var addTypeOptions = response.data;
  909. if(obj.addType !=null && obj.addType !="") {
  910. for (var i = 0; addTypeOptions.length > i; i++) {
  911. if (obj.addType == addTypeOptions[i].dictValue) {
  912. obj.addType = addTypeOptions[i].dictLabel;
  913. break;
  914. }
  915. }
  916. }
  917. });
  918. that.getDicts("use_type").then((response) => {
  919. var useTypeOptions = response.data;
  920. if(obj.useType !=null && obj.useType !="") {
  921. for (var i = 0; useTypeOptions.length > i; i++) {
  922. if (obj.useType == useTypeOptions[i].dictValue) {
  923. obj.useType = useTypeOptions[i].dictLabel;
  924. break;
  925. }
  926. }
  927. }
  928. });
  929. that.getDicts("depreciation_type").then((response) => {
  930. var depreciationTypeOptions = response.data;
  931. if(obj.depreciationType !=null && obj.depreciationType !="") {
  932. for (var i = 0; depreciationTypeOptions.length > i; i++) {
  933. if (obj.depreciationType == depreciationTypeOptions[i].dictValue) {
  934. obj.depreciationType = depreciationTypeOptions[i].dictLabel;
  935. break;
  936. }
  937. }
  938. }
  939. });
  940. that.getDicts("asset_status").then((response) => {
  941. var assetStatusOptions = response.data;
  942. if(obj.assetStatus !=null && obj.assetStatus !="") {
  943. for (var i = 0; assetStatusOptions.length > i; i++) {
  944. if (obj.assetStatus == assetStatusOptions[i].dictValue) {
  945. obj.assetStatus = assetStatusOptions[i].dictLabel;
  946. break;
  947. }
  948. }
  949. }
  950. });
  951. that.getDicts("fixed_assets_unit").then((response) => {
  952. var unitOptions = response.data;
  953. if(obj.unit !=null && obj.unit !="") {
  954. for (var i = 0; unitOptions.length > i; i++) {
  955. if (obj.unit == unitOptions[i].dictValue) {
  956. obj.unit = unitOptions[i].dictLabel;
  957. break;
  958. }
  959. }
  960. }
  961. });
  962. that.mapHasData = obj;
  963. }
  964. }else {
  965. that.mapHaDataValue = false;
  966. }
  967. });
  968. //当前账套没有任何空间数据
  969. if(mapTalkAbout){
  970. let deptName =this.$cookies.get("deptId");
  971. getQueryLand(deptName).then((response) => {
  972. if (response.code == 200) {
  973. let InsertCode = response.data;
  974. if (InsertCode != null) {
  975. var lat = InsertCode.lat;
  976. var lng = InsertCode.lng;
  977. var center;
  978. if(lat !=null && lng !=null && lat !="" && lng !=""){
  979. center = [lng,lat];
  980. }else {
  981. center =[115.452752, 31.789033];
  982. }
  983. map.getView().animate({
  984. // 只设置需要的属性即可
  985. center: ol.proj.fromLonLat(center), // 中心点
  986. zoom: 17.9, // 缩放级别
  987. rotation: undefined, // 缩放完成view视图旋转弧度
  988. duration: 1000, // 缩放持续时间,默认不需要设置
  989. });
  990. }
  991. }
  992. });
  993. }
  994. },
  995. },
  996. };
  997. </script>