移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

5830 lignes
244 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-sticky>
  4. <div class="bannerBg" style="">
  5. <van-nav-bar
  6. style="background:transparent;border-bottom-width:0;"
  7. @click-left="onClickLeft"
  8. @click-right="showUploadList"
  9. >
  10. <template #left>
  11. <van-icon name="arrow-left" size=".5rem" color="#fff" />
  12. </template>
  13. <template #right>
  14. <van-icon v-if="$cookies.get('upload')!=null&&$cookies.get('upload')==1" name="photo-o" size=".5rem" color="#fff"/>
  15. </template>
  16. <template #title>
  17. <p style="color:#fff">{{item.deptName}}</p>
  18. </template>
  19. </van-nav-bar>
  20. <van-popup v-model:show="showImageList" position="bottom" style="height:40vh;padding:50px 10px 0" closeable
  21. close-icon="close">
  22. <p style="color:#000;position:absolute;top:0.426667rem;left:0.426667rem">图片上传</p>
  23. <div style="width:100%;height:calc( 40vh - 100px);overflow-y: scroll;">
  24. <van-uploader v-model="uploadImgList" :after-read="beforeReadImageList" @delete="deleteFileImageList" multiple :max-count="50" />
  25. </div>
  26. <van-row justify="space-around" style=" position:fixed;bottom:0;left:0;width:100%;height:50px;text-align: center;">
  27. <van-col span="12"><van-button type="primary" style="width:100px;" round @click="uploadImgList = [],uploadImgList1 = []">清空</van-button></van-col>
  28. <van-col span="12"><van-button type="primary" style="width:100px;" round @click="submitUploadList">上传</van-button></van-col>
  29. </van-row>
  30. </van-popup>
  31. <div style="display:flex;width:95%;margin:0 auto;justify-content:space-between;padding: 0px 0 15px">
  32. <div :class="{activeBtn : activeBtn==1,disactiveBtn :activeBtn!=1 }" @click="$router.push({path:'/homesteadSurvey/list'})">入户核查</div>
  33. <div :class="{activeBtn : activeBtn==2,disactiveBtn :activeBtn!=2 }" @click="$router.push({path:'/homesteadSurvey/list2'})">农户信息</div>
  34. <div :class="{activeBtn : activeBtn==3,disactiveBtn :activeBtn!=3 }" @click="$router.push({path:'/homesteadSurvey/list3'})">所有权人</div>
  35. <div :class="{activeBtn : activeBtn==4,disactiveBtn :activeBtn!=4 }" @click="$router.push({path:'/homesteadSurvey/list4'})">切换地图</div>
  36. </div>
  37. </div>
  38. <div style="background:#fff;padding:10px 2.5%;display: flex;justify-content: space-between;">
  39. <div style="text-align:center;background: rgba(122,201,67,0.2);width: 49%;font-size: 14px;border-radius: 8px;display: flex;align-items: center;justify-content: center;padding: 2px 0;">
  40. <img src="../../assets/images/housesteadSurvey/list01.png" alt="">
  41. <p style="margin-left: 10px;">
  42. <span style="color:#60B722;line-height:.8rem;">宅基地数:</span>
  43. <span style="color:#60B722;line-height:.8rem;"><span style="font-size:16px;color: #448815;">{{totalH}}</span> 宗</span>
  44. </p>
  45. </div>
  46. <div style="text-align:center;background: rgba(122,201,67,0.2);width: 49%;font-size: 14px;border-radius: 8px;display: flex;align-items: center;justify-content: center;padding: 2px 0;">
  47. <img src="../../assets/images/housesteadSurvey/list02.png" alt="">
  48. <p style="margin-left: 10px;">
  49. <span style="color:#60B722;line-height:.8rem">使用权人数:</span>
  50. <span style="color:#60B722;line-height:.8rem"><span style="font-size:16px;color: #448815;">{{totalR}}</span> 人</span>
  51. </p>
  52. </div>
  53. </div>
  54. </van-sticky>
  55. <van-search v-model="zjdvalue" placeholder="请输入宅基地代码或农户姓名" show-action @search="onSearchzjd" style="padding-top: 0;padding-bottom: 0;">
  56. <template #action>
  57. <van-icon name="add" color="rgba(122,201,67,1)" size=".8rem" @click="onClickzjd" style="vertical-align:middle;"/>
  58. </template>
  59. </van-search>
  60. <van-tabs v-model="active" title-active-color="#7AC943" color="#7AC943" @click="getZjdList">
  61. <van-tab v-for="(item,index) in surveyStatusOptions" >
  62. <template #title>
  63. <div style="display: flex;align-items: center;">
  64. <van-badge v-if="item.dictValue == '1'" :content="whcNums" :color="active==0?'#7AC943':'#878787'" />
  65. <van-badge v-if="item.dictValue == '2'" :content="hcycNums" :color="active==1?'#7AC943':'#878787'" />
  66. <van-badge v-if="item.dictValue == '3'" :content="hcwcNums" :color="active==2?'#7AC943':'#878787'" />
  67. <van-badge v-if="item.dictValue == '4'" :content="spbhNums" :color="active==3?'#7AC943':'#878787'" />
  68. <van-badge v-if="item.dictValue == '5'" :content="sptgNums" :color="active==4?'#7AC943':'#878787'" />
  69. </div>
  70. <div style="display: flex;align-items: center;">
  71. <p>{{item.dictLabel}}</p>
  72. </div>
  73. </template>
  74. <!--<van-pull-refresh v-model="isLoadingzjd" @refresh="onRefreshzjd">-->
  75. <van-list
  76. v-model:loading="loading2"
  77. :finished="finished2"
  78. finished-text="没有更多了"
  79. :immediate-check="false"
  80. @load="onRefreshzjd"
  81. >
  82. <van-cell v-for="(item,index) in list1" :key="index" size="small" :clickable="true" style="border-radius: 16px;
  83. box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:95%;margin:15px auto 0;">
  84. <template #title>
  85. <div style="display: flex;align-items: center;">
  86. <p style="display: flex;align-items: center;" >
  87. <img src="../../assets/images/housesteadSurvey/list03.png" alt="" style="margin-right: 5px;">
  88. <span style="line-height: 1;">{{limitWords(item.shyqrdbxm)}}</span>
  89. </p>
  90. <p v-if="item.surveyStatus == '5'" style="display: flex;align-items: center;color:#22B7F2;font-size:12px;margin-left: auto;margin-right: 10px;border-bottom: 1px dashed #22B7F2;" @click="queryDetail(item)"><img src="../../assets/images/housesteadSurvey/list06.png" alt="" style="margin-right: 3px;">详情</p>
  91. <!-- <p v-if="item.zjdAudit=='0'" style="color:#ff976a;background:rgba(255,151,106,0.2);font-size:12px;padding: 5px;line-height: 1;border-radius: 5px;">待审核</p>-->
  92. <!-- <p v-if="item.zjdAudit=='1'" style="color:#7AC943;background:rgba(122,201,67,0.2);font-size:12px;padding: 5px;line-height: 1;border-radius: 5px;">已审核</p>-->
  93. <!-- <p v-if="item.zjdAudit=='2'" style="color:#ee0a24;font-size:12px;">已驳回</p>-->
  94. <p v-if="item.surveyStatus != '5'" style="display: flex;align-items: center;color:#22B7F2;font-size:12px;margin-left: auto;margin-right: 10px;border-bottom: 1px dashed #22B7F2;" @click="setCookies(item)"><img src="../../assets/images/housesteadSurvey/list07.png" alt="" style="margin-right: 3px;">调查</p>
  95. <!-- <van-button plain round color="#FA5353" size="mini" v-if="item.houseDataConfirmStatus!='CONFIRMED'" style="vertical-align:middle;float:right;margin-right:10px" @click="deleteZjd(item,index)">删除</van-button>-->
  96. </div>
  97. </template>
  98. <!--<template #default>
  99. <van-button v-if="item.houseDataConfirmStatus=='CONFIRMED'" plain round color="#7AC943" size="mini" style="vertical-align:middle;margin-top:15px;">查看详情</van-button>
  100. <van-button v-if="item.houseDataConfirmStatus!='CONFIRMED'"plain round color="#FA5353" size="mini" style="vertical-align:middle;margin-top:15px;">开始调查</van-button>
  101. </template>-->
  102. <template #label>
  103. <p style="display: flex;align-items: center;margin-top: 10px;"><img src="../../assets/images/housesteadSurvey/list04.png" alt="" style="margin-right: 5px;">宅基地代码: {{item.zjddm}} </p>
  104. <p style="display: flex;align-items: center;margin-top: 5px;"><img src="../../assets/images/housesteadSurvey/list05.png" alt="" style="margin-right: 5px;">宗地面积: {{item.zdmj}}㎡<span style="margin-left: auto;color: #333333;" v-if="item.surveyStatus != '1'">调查员:{{item.surveyBy}}</span></p>
  105. </template>
  106. </van-cell>
  107. </van-list>
  108. <!--</van-pull-refresh>-->
  109. </van-tab>
  110. </van-tabs>
  111. </div>
  112. </template>
  113. <script>
  114. import {rhhcList,getQueryLand,getZjdzd,delZjdzdInfo,uploadFile,submitUploadImageList} from "@/api/homesteadSurvey/zjdzd";
  115. import {addNh, delNh, exportNh, getNh, listNh, updateNh,setNhInfo} from "@/api/homesteadSurvey/nh";
  116. import {addNhhncy, delNhhncy, exportNhhncy, getNhhncy, listNhhncy, updateNhhncy} from "@/api/homesteadSurvey/nhhncy";
  117. import {listShyqr,setSyqrInfo} from "@/api/homesteadSurvey/shyqr";
  118. import {listSuyqr,updateSuyqr,addSuyqr} from "@/api/homesteadSurvey/suyqr";
  119. import {listZrz,getZrzZjdDmList,getZrz} from "@/api/homesteadSurvey/zrz";
  120. import {listFsss,getFsssZjdDmList,getFsss} from "@/api/homesteadSurvey/fsss";
  121. import {getGeoServerConfigKey} from "@/api/system/config";
  122. import { listTown, getTown } from "@/api/homesteadSurvey/town";
  123. import { listVillage} from "@/api/homesteadSurvey/village";
  124. import {deptGetId,} from "@/api/homestead/index";
  125. import $ from "jquery";
  126. import {Dialog} from "vant";
  127. import {ref} from "vue";
  128. import axios from "axios";
  129. export default {
  130. name: "homesteadList",
  131. data() {
  132. return {
  133. loading1:false,
  134. finished1:false,
  135. loading2:false,
  136. finished2:false,
  137. loading3:false,
  138. finished3:false,
  139. //全部
  140. qbNums:0,
  141. //已调查数量
  142. yhcNums:0,
  143. //未核查数量
  144. whcNums:0,
  145. //核查异常数量
  146. hcycNums:0,
  147. //核查完成数量
  148. hcwcNums:0,
  149. //审批通过数量
  150. sptgNums:0,
  151. //审批驳回数量
  152. spbhNums:0,
  153. // 总户数
  154. totalH:0,
  155. // 总人数
  156. totalR:0,
  157. zjdSx:true,
  158. zrzSx :true,
  159. fsssSx:true,
  160. showhncysjly:false,
  161. showhzsjly:false,
  162. showhncycybz:false,
  163. showhncyzjlx:false,
  164. showhncyyhzgx:false,
  165. showhzjzhcssfyzf:false,
  166. showhncyoccupation:false,
  167. showhncyjzqk:false,
  168. showhzoccupation:false,
  169. showhzjzqk:false,
  170. // 下拉刷新
  171. isLoadingnh:false,
  172. countnh:0,
  173. isLoadingzjd:false,
  174. countqb:1,
  175. countyhc:1,
  176. countwhc:1,
  177. // 使用权人表单弹出
  178. shownh:false,
  179. showhzht:false,
  180. showhzlx:false,
  181. showhncylist:false,
  182. showhncy:false,
  183. activeBtn:1,
  184. value:'',
  185. // 宅基地搜索框
  186. zjdvalue:"",
  187. // 使用权人搜索框
  188. nhvalue:"",
  189. active:0,
  190. // 全部列表
  191. list:[],
  192. // 已核查列表
  193. list1:[],
  194. // 未核查列表
  195. list2:[],
  196. // 户主列表
  197. nhlist:[],
  198. // 户内成员表单
  199. form5: {},
  200. // 户内成员列表
  201. hncylist:[],
  202. currentRate:20,
  203. // 使用权人
  204. nhform:[],
  205. // 户主列表
  206. hzform:{},
  207. // 权利人列表
  208. qlrform:{},
  209. // 权利人性质弹出框
  210. showsuyqxz:false,
  211. // 代理人证件类型弹出框
  212. showdlrzjlx:false,
  213. // 代表人证件类型弹出框
  214. showdbrzjlx:false,
  215. // 数据来源弹出框
  216. showsjly:false,
  217. surveyStatusOptions:[],
  218. // 证件类型字典
  219. zjlxOptions: [],
  220. // 所有权性质字典
  221. suyqxzOption: [],
  222. // 婚姻状况字典
  223. hyzkOptions:[],
  224. // 数据来源字典
  225. sjlyOptions:[],
  226. // 居住情况字典
  227. jzqkOptions:[],
  228. // 与户主关系字典
  229. yhzgxOptions:[],
  230. // 职业字典
  231. occupationOptions:[],
  232. // 集镇或城市是否有住房字典
  233. jzhcssfyzfOptions:[],
  234. // 成员备注字典
  235. cybzOptions:[],
  236. columns:[],
  237. show1:false,
  238. showhzzjlx: false,
  239. // 路由传过来的任务基本信息。
  240. item: {},
  241. //地图使用 --start
  242. openMap: false,
  243. mapTheGeomZrzId: null,
  244. mapTheGeomZjdId: null,
  245. mapTheGeomFsssId: null,
  246. drawInsert:null,
  247. mapZjdData:"",
  248. mapZrzData:"",
  249. mapFsssData:"",
  250. mapZjdDataTure:"",
  251. mapZjdTeAll:{
  252. active:"",
  253. mapZjdAData:{},
  254. mapZrzAData:{},
  255. mapFsssAData:{},
  256. },
  257. mapHaDataValue:false,
  258. mapHasDateStatus: 0, //0附属设施 1自然幢 2宅基地
  259. selectionIconShow:false,
  260. homesteadListStatus:false,
  261. //地图绘制状态
  262. draw: {
  263. drawMapPolygon: false, //绘制地图
  264. },
  265. mapTownList: null,
  266. mapVillageList: null,
  267. coordinate:"",
  268. checked:['zjdSx', 'zrzSx', 'fsssSx'],
  269. checkAllMap: false,
  270. sx:"",
  271. drawingClick:true,
  272. //搜索---start
  273. seachText: "",
  274. //搜索栏目-操作栏显隐
  275. searchBarOperVisbile: false,
  276. mapDataAll: [],
  277. showSearch:false,
  278. bottomHeight:'0px',
  279. //搜索---end
  280. //测面
  281. textMjAll:"",
  282. clickBbox:"",
  283. textMjAllNum:"",
  284. //核查
  285. zjdHcDy:"",
  286. //绘图
  287. htZjdZrzFsss:"",
  288. //筛选
  289. checkAllFlag: true,
  290. CheckedAllArr: [],//全选数组
  291. dataForm: {
  292. imageUrl: []
  293. },
  294. dataList: [["fsssSx"],["zjdSx"],["zrzSx"]], //地图使用 --end
  295. checkBoxAll:[],
  296. //地图跳转存之
  297. mapAddJump:"",
  298. mapAddJumpNum:"",
  299. nhdm:"",
  300. backTheGeom:"",
  301. //地图服务地址
  302. mapGeoServerUrl:"",
  303. backMap:"",
  304. // 任务完成标记
  305. //宅基地点击事件
  306. mapXs: false,
  307. mapClick:"",
  308. isFinished:false,
  309. //
  310. showImageList:false,
  311. uploadImgList:[],
  312. uploadImgList1:[],
  313. // 字典列表json
  314. dictTypeList:null,
  315. };
  316. },
  317. mounted(){
  318. },
  319. created(){
  320. axios.get('../static/dictyType.json').then(res => {
  321. this.dictTypeList = res.data
  322. this.zjlxOptions = this.dictTypeList.zjlx;
  323. this.suyqxzOptions = this.dictTypeList.qsxz;
  324. this.sjlyOptions = this.dictTypeList.sjly;
  325. this.hyzkOptions = this.dictTypeList.hyzk;
  326. this.occupationOptions = this.dictTypeList.occupation;
  327. this.jzqkOptions = this.dictTypeList.living_condition;
  328. this.jzhcssfyzfOptions = this.dictTypeList.jzhcssfyzf;
  329. this.cybzOptions = this.dictTypeList.member_remark;
  330. })
  331. this.getDicts("survey_status").then(response => {
  332. var arr = [];
  333. response.data.forEach(function (item) {
  334. if (item.dictValue !== '1') {
  335. item.dictLabel = item.dictLabel.substring(2,item.dictLabel.length);
  336. arr.push(item);
  337. }else{
  338. arr.push(item);
  339. }
  340. });
  341. this.surveyStatusOptions = arr;
  342. });
  343. this.getList();
  344. this.getSyqr();
  345. // this.getDicts("family_status").then(response => {
  346. // var arr = [];
  347. // response.data.forEach(function (item) {
  348. // if (item.dictLabel !== '户主') {
  349. // arr.push(item)
  350. // }
  351. // });
  352. // this.yhzgxOptions = arr;
  353. // });
  354. // if(this.$cookies.get("search") != null && this.$cookies.get("search") !="" && this.$cookies.get("search")!=undefined){
  355. // if(this.$cookies.get("search").activeBtn !=null){
  356. // if(this.$cookies.get("search").activeBtn == 4){
  357. // // if(location.href.indexOf("#reloaded")==-1){
  358. // // location.href=location.href+"#reloaded";
  359. // // location.reload();
  360. // // }
  361. // this.activeBtn = this.$cookies.get("search").activeBtn;
  362. // this.item = this.$cookies.get("item");
  363. // this.mapAddJump = this.$cookies.get("search").backMapZjdAData.deptId;
  364. // this.backTheGeom = this.$cookies.get("search").backMapZjdAData.theGeom;
  365. // this.mapZjdData = this.$cookies.get("search").backMapZjdAData;
  366. // this.mapZjdTeAll.mapZjdAData = this.$cookies.get("search").backMapZjdAData;
  367. // this.mapClick = this.mapZjdTeAll.mapZjdAData.zjddm;
  368. // this.mapXs =true;
  369. // this.zjdHcDy = 1;
  370. // this.mapZjdDataTure = 1;
  371. // this.mapAddJumpNum =1;
  372. // this.mapShow();
  373. // this.getZjdList();
  374. // this.getTotalHR();
  375. // if(this.item.taskStatus=="FINISHED"){
  376. // this.isFinished = true
  377. // }else{
  378. // this.isFinished = false
  379. // }
  380. // }
  381. // }else {
  382. // this.item = this.$cookies.get("item");
  383. // this.getZjdList();
  384. // this.getTotalHR();
  385. // if(this.item.taskStatus=="FINISHED"){
  386. // this.isFinished = true
  387. // }else{
  388. // this.isFinished = false
  389. // }
  390. // }
  391. // }else {
  392. // this.item = this.$cookies.get("item");
  393. // this.getZjdList();
  394. // this.getTotalHR();
  395. // if(this.item.taskStatus=="FINISHED"){
  396. // this.isFinished = true
  397. // }else{
  398. // this.isFinished = false
  399. // }
  400. // }
  401. },
  402. methods: {
  403. getList(){
  404. let params = {
  405. "surveyStatus":"1",
  406. "pageNum": 1,
  407. "pageSize":10,
  408. }
  409. rhhcList(params).then(res => {
  410. this.list1 = res.data.zjdzdxxList;
  411. if(res.data.zjdzdxxList.length>0&&res.data.zjdzdxxList.length<res.data.zjdzs){
  412. this.countyhc++
  413. this.loading2 = false
  414. this.finished2 = false;
  415. }else{
  416. this.loading2 = false
  417. this.finished2 = true
  418. }
  419. });
  420. rhhcList({surveyStatus:"1,2,3,4,5"}).then(res => {
  421. this.whcNums = res.data.wdcs;
  422. this.hcycNums = res.data.dcycs;
  423. this.hcwcNums = res.data.dcwcs;
  424. this.sptgNums = res.data.dctgs;
  425. this.spbhNums = res.data.dcbhs;
  426. this.totalH = res.data.zjdzs;
  427. this.totalR = res.data.shyqrs;
  428. });
  429. },
  430. showUploadList(){
  431. this.showImageList = true;
  432. },
  433. submitUploadList(){
  434. submitUploadImageList(this.uploadImgList1).then(res => {
  435. let _this = this
  436. this.$toast({
  437. icon: 'success', // 找到自己需要的图标
  438. message: '上传成功',
  439. duration:"1000",
  440. onClose:function(){
  441. _this.showImageList = false
  442. }
  443. })
  444. })
  445. },
  446. // 图片上传前
  447. beforeReadImageList(file){
  448. let _this = this
  449. if(file.length!=undefined){
  450. file.map(res => {
  451. let zjddm = res.file.name
  452. //zjddm=zjddm.substring(0,zjddm.lastIndexOf("\("));
  453. // 创建Canvas对象(画布)
  454. let canvas = document.createElement('canvas')
  455. // 获取对应的CanvasRenderingContext2D对象(画笔)
  456. let context = canvas.getContext('2d')
  457. // 创建新的图片对象
  458. let img = new Image()
  459. // 指定图片的DataURL(图片的base64编码数据)
  460. img.src = res.content
  461. // 监听浏览器加载图片完成,然后进行进行绘制
  462. img.onload = () => {
  463. /*const h = img.height
  464. const w = img.width*/
  465. let ch = img.height/5
  466. let cw = img.width/5
  467. let canvas = document.createElement('canvas')
  468. let ctx = canvas.getContext('2d')
  469. canvas.height = ch
  470. canvas.width = cw
  471. ctx.clearRect(0,0,cw,ch)
  472. ctx.drawImage(img,0,0,cw,ch)
  473. let base_img = canvas.toDataURL('image/jpeg')
  474. let blobBin = atob(base_img.split(',')[1])
  475. let d = []
  476. for (let i=0;i<blobBin.length;i++){
  477. d.push(blobBin.charCodeAt(i))
  478. }
  479. let data2 = new FormData();
  480. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  481. uploadFile(data2).then(response => {
  482. let p={
  483. "zjddm":zjddm,
  484. "url":response.fileName
  485. }
  486. _this.uploadImgList1.push(p)
  487. })
  488. }
  489. })
  490. }else{
  491. let zjddm = file.file.name
  492. //zjddm=zjddm.substring(0,zjddm.lastIndexOf("\("));
  493. // 创建Canvas对象(画布)
  494. let canvas = document.createElement('canvas')
  495. // 获取对应的CanvasRenderingContext2D对象(画笔)
  496. let context = canvas.getContext('2d')
  497. // 创建新的图片对象
  498. let img = new Image()
  499. // 指定图片的DataURL(图片的base64编码数据)
  500. img.src = file.content
  501. // 监听浏览器加载图片完成,然后进行进行绘制
  502. img.onload = () => {
  503. /*const h = img.height
  504. const w = img.width*/
  505. let ch = img.height/5
  506. let cw = img.width/5
  507. let canvas = document.createElement('canvas')
  508. let ctx = canvas.getContext('2d')
  509. canvas.height = ch
  510. canvas.width = cw
  511. ctx.clearRect(0,0,cw,ch)
  512. ctx.drawImage(img,0,0,cw,ch)
  513. let base_img = canvas.toDataURL('image/jpeg')
  514. let blobBin = atob(base_img.split(',')[1])
  515. let d = []
  516. for (let i=0;i<blobBin.length;i++){
  517. d.push(blobBin.charCodeAt(i))
  518. }
  519. let data2 = new FormData();
  520. data2.append("file", new Blob([new Uint8Array(d)],{type:'image/jpeg'}));
  521. uploadFile(data2).then(response => {
  522. let p={
  523. "zjddm":zjddm,
  524. "url":response.fileName
  525. }
  526. _this.uploadImgList1.push(p)
  527. })
  528. }
  529. }
  530. },
  531. deleteFileImageList(file){
  532. let url = file.file.name
  533. this.uploadImgList1.map((res,index) => {
  534. if(res.zjddm==url){
  535. this.uploadImgList1.remove(index);
  536. }
  537. })
  538. },
  539. validatorIdcardqlr(val){
  540. if(this.qlrform.dbrzjlx=='01'){
  541. if(this.vcheckID(val)){
  542. return true
  543. }else {
  544. return false
  545. }
  546. }else{
  547. return true
  548. }
  549. },
  550. validatorIdcardnh(val){
  551. if(this.nhform.hzzjlx=='01'){
  552. if(this.vcheckID(val)){
  553. return true
  554. }else {
  555. return false
  556. }
  557. }else{
  558. return true
  559. }
  560. },
  561. validatorIdcardhncy(val){
  562. if(this.form5.zjlx=='01'){
  563. if(this.vcheckID(val)){
  564. return true
  565. }else {
  566. return false
  567. }
  568. }else{
  569. return true
  570. }
  571. },
  572. checkCode(val) {
  573. var p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
  574. var factor = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 ];
  575. var parity = [ 1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2 ];
  576. var code = val.substring(17);
  577. if(p.test(val)) {
  578. var sum = 0;
  579. for(var i=0;i<17;i++) {
  580. sum += val[i]*factor[i];
  581. }
  582. if(parity[sum % 11] == code.toUpperCase()) {
  583. return true;
  584. }
  585. }
  586. return false;
  587. },
  588. checkDate (val) {
  589. var pattern = /^(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)$/;
  590. if(pattern.test(val)) {
  591. var year = val.substring(0, 4);
  592. var month = val.substring(4, 6);
  593. var date = val.substring(6, 8);
  594. var date2 = new Date(year+"-"+month+"-"+date);
  595. if(date2 && date2.getMonth() == (parseInt(month) - 1)) {
  596. return true;
  597. }
  598. }
  599. return false;
  600. },
  601. checkProv(val) {
  602. var pattern = /^[1-9][0-9]/;
  603. var provs = {11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门"};
  604. if(pattern.test(val)) {
  605. if(provs[val]) {
  606. return true;
  607. }
  608. }
  609. return false;
  610. },
  611. vcheckID(val){
  612. if(this.checkCode(val)) {
  613. var date = val.substring(6,14);
  614. if(this.checkDate(date)) {
  615. if(this.checkProv(val.substring(0,2))) {
  616. return true;
  617. }
  618. }
  619. }
  620. return false;
  621. },
  622. deleteZjd(item,index){
  623. Dialog.confirm({
  624. title: '警告',
  625. message: '将删除与此宅基地关联的使用权人,自然幢,房屋,附属设施等所有信息,同时删除后无法恢复,确认删除么?',
  626. })
  627. .then(() => {
  628. // on confirm
  629. delZjdzdInfo(item).then(res => {
  630. if(res.code=="200"){
  631. if(this.active==1){
  632. this.list1.splice(index,1);
  633. }else if(this.active==2){
  634. this.list2.splice(index,1);
  635. }else{
  636. this.list.splice(index,1);
  637. }
  638. }
  639. })
  640. })
  641. .catch(() => {
  642. // on cancel
  643. });
  644. },
  645. //删除户主
  646. deletenh(item,index){
  647. let yes = true
  648. let params={
  649. nhdm : item.nhdm,
  650. deptId: item.deptId
  651. }
  652. listNhhncy(params).then((res) => {
  653. console.log(res.rows.length)
  654. if(res.rows.length>0){
  655. yes = false
  656. this.$toast({
  657. icon: 'error', // 找到自己需要的图标
  658. message: '无法删除,此户主存在户内成员!',
  659. duration:"1000",
  660. onClose:function(){
  661. }
  662. })
  663. }else{
  664. listShyqr(params).then((res) => {
  665. if(res.rows.length>0){
  666. yes = false
  667. this.$toast({
  668. icon: 'error', // 找到自己需要的图标
  669. message: '无法删除,此户主已经成为使用权人!',
  670. duration:"1000",
  671. onClose:function(){
  672. }
  673. })
  674. }else{
  675. if(yes){
  676. Dialog.confirm({
  677. title: '警告',
  678. message: '确认删除此使用权人么?',
  679. })
  680. .then(() => {
  681. // on confirm
  682. delNh(item.id).then(res => {
  683. if(res.code=="200"){
  684. this.nhlist.splice(index,1);
  685. this.totalH--
  686. this.totalR--
  687. }
  688. })
  689. })
  690. .catch(() => {
  691. // on cancel
  692. });
  693. }
  694. }
  695. });
  696. }
  697. });
  698. },
  699. // 设为户主
  700. setNh(item,index){
  701. Dialog.confirm({
  702. title: '警告',
  703. message: '此操作将删除原户主,并将此成员设为新户主,是否确认操作?',
  704. })
  705. .then(() => {
  706. // on confirm
  707. delNhhncy(item.id).then(res => {
  708. if(res.code=="200"){
  709. this.hncylist.splice(index,1);
  710. this.totalR--
  711. }
  712. })
  713. // 更新户主信息
  714. let pnh = {
  715. deptId : item.deptId,
  716. nhdm : item.nhdm,
  717. hzxm:item.xm,
  718. hzzjlx :item.zjlx,
  719. hzzjhm :item.zjhm
  720. }
  721. setNhInfo(pnh).then(res => {
  722. })
  723. // 更新使用权人
  724. let psyqr = {
  725. deptId : item.deptId,
  726. nhdm : item.nhdm,
  727. shyqrdbxm : item.xm,
  728. shyqrdbzjlx : item.zjlx,
  729. shyqrdbzjhm : item.zjhm,
  730. xb : item.xb
  731. }
  732. setSyqrInfo(psyqr).then(res => {
  733. })
  734. })
  735. .catch(() => {
  736. // on cancel
  737. });
  738. },
  739. //删除户内成员
  740. deletehncy(id,index){
  741. Dialog.confirm({
  742. title: '警告',
  743. message: '删除后无法恢复,确认删除此成员么?',
  744. })
  745. .then(() => {
  746. // on confirm
  747. delNhhncy(id).then(res => {
  748. if(res.code=="200"){
  749. this.hncylist.splice(index,1);
  750. this.totalR--
  751. }
  752. })
  753. })
  754. .catch(() => {
  755. // on cancel
  756. });
  757. },
  758. // 字数限制
  759. limitWords(val){
  760. if(val==null||val==""){
  761. return "无"
  762. }else{
  763. if(val.length>11){
  764. val = val.slice(0,10) +"..."
  765. }
  766. return val
  767. }
  768. },
  769. // 与户主关系翻译
  770. yhzgxfy(value){
  771. let label
  772. this.yhzgxOptions.map(res => {
  773. if(res.dictValue == value){
  774. label = res.dictLabel
  775. }
  776. })
  777. return label
  778. },
  779. onRefreshzjd(){
  780. this.isLoadingzjd = false;
  781. let _this = this
  782. if(this.active==0&&this.loading2){
  783. let params = {
  784. "shyqrdbxm" : this.zjdvalue,
  785. "surveyStatus":"1",
  786. "pageNum": this.countyhc+1,
  787. "pageSize":10,
  788. }
  789. rhhcList(params).then((response) => {
  790. if(response.data.zjdzdxxList.length>0&&this.list2.length<response.data.zjdzs){
  791. response.data.zjdzdxxList.map(res => {
  792. _this.list1.push(res)
  793. })
  794. this.countyhc++
  795. this.loading2 = false
  796. }else{
  797. this.loading2 = false
  798. this.loading2 = true
  799. }
  800. });
  801. }else if(this.active==1&&this.loading2){
  802. let params = {
  803. "shyqrdbxm" : this.zjdvalue,
  804. "surveyStatus":"2",
  805. "pageNum": this.countyhc+1,
  806. "pageSize":10,
  807. }
  808. rhhcList(params).then((response) => {
  809. if(response.data.zjdzdxxList.length>0&&this.list1.length<response.data.zjdzs){
  810. response.data.zjdzdxxList.map(res => {
  811. _this.list1.push(res)
  812. })
  813. this.countyhc++
  814. this.loading2 = false
  815. }else{
  816. this.finished2 = true
  817. }
  818. });
  819. }else if(this.active==2&&this.loading2){
  820. let params = {
  821. "shyqrdbxm" : this.zjdvalue,
  822. "surveyStatus":"3",
  823. "pageNum": this.countyhc+1,
  824. "pageSize":10,
  825. }
  826. rhhcList(params).then((response) => {
  827. if(response.data.zjdzdxxList.length>0&&this.list1.length<response.data.zjdzs){
  828. response.data.zjdzdxxList.map(res => {
  829. _this.list1.push(res)
  830. })
  831. this.countyhc++
  832. this.loading2 = false
  833. }else{
  834. this.finished2 = true
  835. }
  836. });
  837. }else if(this.active==3&&this.loading2){
  838. let params = {
  839. "shyqrdbxm" : this.zjdvalue,
  840. "surveyStatus":"4",
  841. "pageNum": this.countyhc+1,
  842. "pageSize":10,
  843. }
  844. rhhcList(params).then((response) => {
  845. if(response.data.zjdzdxxList.length>0&&this.list1.length<response.data.zjdzs){
  846. response.data.zjdzdxxList.map(res => {
  847. _this.list1.push(res)
  848. })
  849. this.countyhc++
  850. this.loading2 = false
  851. }else{
  852. this.finished2 = true
  853. }
  854. });
  855. }else if(this.active==4&&this.loading2){
  856. let params = {
  857. "shyqrdbxm" : this.zjdvalue,
  858. "surveyStatus":"5",
  859. "pageNum": this.countyhc+1,
  860. "pageSize":10,
  861. }
  862. rhhcList(params).then((response) => {
  863. if(response.data.zjdzdxxList.length>0&&this.list1.length<response.data.zjdzs){
  864. response.data.zjdzdxxList.map(res => {
  865. _this.list1.push(res)
  866. })
  867. this.countyhc++
  868. this.loading2 = false
  869. }else{
  870. this.finished2 = true
  871. }
  872. });
  873. }
  874. },
  875. getTotalHR(){
  876. let params = {
  877. "deptId" : this.item.deptId,
  878. "pageNum": 1,
  879. "pageSize":10,
  880. }
  881. listNh(params).then((response) => {
  882. if(response.rows.length>=0){
  883. this.totalH = response.total
  884. }
  885. listNhhncy(params).then((res) => {
  886. if(res.rows.length>=0){
  887. this.totalR = res.total + this.totalH
  888. }
  889. });
  890. });
  891. },
  892. onRefreshnh(){
  893. this.isLoadingnh = false
  894. let params = {
  895. "deptId" : this.item.deptId,
  896. "pageNum": this.countnh+1,
  897. "pageSize":10,
  898. }
  899. listNh(params).then((response) => {
  900. if(response.rows.length>0&&this.nhlist.length<response.total){
  901. response.rows.map(res => {
  902. this.nhlist.unshift(res)
  903. })
  904. this.countnh++
  905. }
  906. });
  907. },
  908. queryDetail(item){
  909. //this.$cookies.set("search",JSON.stringify(item));
  910. this.$cookies.set("search","");
  911. // let _this = this
  912. // setTimeout(function(){
  913. // _this.$router.push({name:'homesteadAdd'});
  914. // },1000)
  915. getZjdzd(item.id).then((response) => {
  916. localStorage.setItem("zjdzdxxItem",JSON.stringify(response.data));
  917. localStorage.setItem("executePermission",false);
  918. this.$router.push({path:'/homesteadSurvey/add'});
  919. });
  920. },
  921. setCookies(item){
  922. //this.$cookies.set("search",JSON.stringify(item));
  923. this.$cookies.set("search","");
  924. // let _this = this
  925. // setTimeout(function(){
  926. // _this.$router.push({name:'homesteadAdd'});
  927. // },1000)
  928. getZjdzd(item.id).then((response) => {
  929. localStorage.setItem("zjdzdxxItem",JSON.stringify(response.data));
  930. localStorage.setItem("executePermission",true);
  931. this.$router.push({path:'/homesteadSurvey/add'});
  932. });
  933. },
  934. // 入户核查搜索框新增。
  935. onClickzjd(){
  936. this.$cookies.remove("search");
  937. localStorage.setItem("zjdzdxxItem",JSON.stringify({suyqrdm:this.qlrform.suyqrdm,zjddm:null,zjdlyzk:"1",landStatus:"1"
  938. ,houseOwnership:"2",landPhms:"10",isMore:"0",sffz:"0",sfcz:"0"
  939. ,zjdqdfs:"01",sjly:"01",qlsdfs:"1",qllx:"1",qlxz:"203",dj:"1",yt:"01"}));
  940. this.$router.push({name:'homesteadAdd'});
  941. },
  942. // 农户信息搜索框新增。
  943. onClicknh(){
  944. this.shownh = true;
  945. let params = {
  946. "deptId" : this.item.deptId
  947. }
  948. this.qlrform={}
  949. this.nhform={
  950. "suyqrdm":null,
  951. "deptId":this.item.deptId,
  952. "hzzjlx":'01',
  953. "hzzjlxName":"身份证",
  954. "hyzk":'02',
  955. "occupation":'1',
  956. "occupationName":'务农',
  957. "jzqk":'3',
  958. "jzqkName":'常年居住',
  959. "jzhcssfyzf":'1',
  960. "jzhcssfyzfName":'无住房',
  961. "zqtczsfyzf":'Y',
  962. "sfbccm":'Y',
  963. "sfpkh":'N',
  964. "sfwbh":'N',
  965. "sjly":'07',
  966. "sjlyName":'农村集体产权制度改革',
  967. }
  968. listSuyqr(params).then((response) => {
  969. if(response.rows.length>0){
  970. this.qlrform = response.rows[0]
  971. this.nhform.suyqrdm = this.qlrform.suyqrdm
  972. this.nhform.txdz = response.rows[0].suyqrmc
  973. }
  974. });
  975. },
  976. // 返回
  977. onClickLeft(){
  978. this.$cookies.set("search","")
  979. this.$router.push({path:'/homesteadSurvey/index'});
  980. },
  981. onConfirmhncysjly(value){
  982. this.form5.sjlyName = value.dictLabel
  983. this.form5.sjly = value.dictValue
  984. this.showhncysjly= false
  985. },
  986. onConfirmhzsjly(value){
  987. this.nhform.sjlyName = value.dictLabel
  988. this.nhform.sjly = value.dictValue
  989. this.showhzsjly= false
  990. },
  991. onConfirmhncycybz(value){
  992. this.form5.cybzName = value.dictLabel
  993. this.form5.cybz = value.dictValue
  994. this.showhncycybz= false
  995. },
  996. onConfirmhzjzhcssfyzf(value){
  997. this.nhform.jzhcssfyzfName = value.dictLabel
  998. this.nhform.jzhcssfyzf = value.dictValue
  999. this.showhzjzhcssfyzf= false
  1000. },
  1001. onConfirmhncyyhzgx(value){
  1002. this.form5.yhzgxName = value.dictLabel
  1003. this.form5.yhzgx = value.dictValue
  1004. this.showhncyyhzgx = false
  1005. },
  1006. onConfirmhncyzjlx(value){
  1007. this.form5.zjlxName = value.dictLabel
  1008. this.form5.zjlx = value.dictValue
  1009. this.showhncyzjlx = false
  1010. },
  1011. onConfirmhncyjzqk(value){
  1012. this.form5.jzqkName = value.dictLabel
  1013. this.form5.jzqk = value.dictValue
  1014. this.showhncyjzqk = false
  1015. },
  1016. onConfirmhzjzqk(value){
  1017. this.nhform.jzqkName = value.dictLabel
  1018. this.nhform.jzqk = value.dictValue
  1019. this.showhzjzqk = false
  1020. },
  1021. onConfirmhncyoccupation(value){
  1022. this.form5.occupationName = value.dictLabel
  1023. this.form5.occupation = value.dictValue
  1024. this.showhncyoccupation = false
  1025. },
  1026. onConfirmhzoccupation(value){
  1027. this.nhform.occupationName = value.dictLabel
  1028. this.nhform.occupation = value.dictValue
  1029. this.showhzoccupation = false
  1030. },
  1031. onConfirmhzzjlx(value){
  1032. this.nhform.hzzjlxName = value.dictLabel
  1033. this.nhform.hzzjlx = value.dictValue
  1034. this.showhzzjlx = false
  1035. },
  1036. onConfirmdbrzjlx(value){
  1037. this.qlrform.dbrzjlxName = value.dictLabel
  1038. this.qlrform.dbrzjlx = value.dictValue
  1039. this.showdbrzjlx = false
  1040. },
  1041. onConfirmsuyqxz(value){
  1042. this.qlrform.suyqxzName = value.dictLabel
  1043. this.qlrform.suyqxz = value.dictValue
  1044. this.showsuyqxz = false
  1045. },
  1046. onConfirmdlrzjlx(value){
  1047. this.qlrform.dlrzjlxName = value.dictLabel
  1048. this.qlrform.dlrzjlx = value.dictValue
  1049. this.showdlrzjlx = false
  1050. },
  1051. onConfirmsjly(value){
  1052. this.qlrform.sjlyName = value.dictLabel
  1053. this.qlrform.sjly = value.dictValue
  1054. this.showsjly = false
  1055. },
  1056. // 户主保存
  1057. onSubmitnh(){
  1058. if(this.nhform.id!=null){
  1059. updateNh(this.nhform).then(
  1060. response => {
  1061. let _this =this
  1062. this.$toast({
  1063. icon: 'success', // 找到自己需要的图标
  1064. message: '修改成功',
  1065. duration:"1000",
  1066. onClose:function(){
  1067. _this.getNh()
  1068. let psyqr = {
  1069. deptId : _this.nhform.deptId,
  1070. nhdm : _this.nhform.nhdm,
  1071. shyqrdbxm : _this.nhform.hzxm,
  1072. shyqrdbzjlx : _this.nhform.hzzjlx,
  1073. shyqrdbzjhm : _this.nhform.hzzjhm,
  1074. dh : _this.nhform.phone,
  1075. dz : _this.nhform.txdz
  1076. }
  1077. setSyqrInfo(psyqr).then(res => {
  1078. _this.shownh = false
  1079. })
  1080. }
  1081. })
  1082. }
  1083. );
  1084. }else{
  1085. this.nhform.deptId = this.item.deptId
  1086. addNh(this.nhform).then(
  1087. response => {
  1088. this.totalR+=1
  1089. this.totalH+=1
  1090. let _this =this
  1091. this.$toast({
  1092. icon: 'success', // 找到自己需要的图标
  1093. message: '保存成功',
  1094. duration:"1000",
  1095. onClose:function(){
  1096. _this.shownh = false
  1097. _this.getNh()
  1098. }
  1099. })
  1100. }
  1101. );
  1102. }
  1103. },
  1104. // 所有权人保存
  1105. onSubmitsyqr(){
  1106. if(this.qlrform.id!=null){
  1107. updateSuyqr(this.qlrform).then(
  1108. response => {
  1109. let _this =this
  1110. this.$toast({
  1111. icon: 'success', // 找到自己需要的图标
  1112. message: '修改成功',
  1113. duration:"1000"
  1114. })
  1115. }
  1116. );
  1117. }else{
  1118. this.qlrform.deptId = this.item.deptId
  1119. addSuyqr(this.qlrform).then(
  1120. response => {
  1121. let _this =this
  1122. this.$toast({
  1123. icon: 'success', // 找到自己需要的图标
  1124. message: '保存成功',
  1125. duration:"1000"
  1126. })
  1127. }
  1128. );
  1129. }
  1130. },
  1131. // 查询所有权人
  1132. getSyqr(){
  1133. //删除地图选中状态
  1134. $("#deleteHistoryMap").trigger("click");
  1135. let params = {
  1136. "deptId" : this.item.deptId
  1137. }
  1138. this.qlrform ={
  1139. "deptId":this.item.deptId,
  1140. "suyqxz":'40',
  1141. "suyqxzName":'集体土地所有权',
  1142. "dbrzjlx":'01',
  1143. "dbrzjlxName":'身份证',
  1144. "sfclncjtjjzz":'Y',
  1145. "sjly":'04',
  1146. "sjlyName":"农村宅基地使用权确权登记发证"
  1147. }
  1148. listSuyqr(params).then((response) => {
  1149. if(response.rows.length>0){
  1150. this.qlrform = response.rows[0]
  1151. if(this.qlrform.suyqxz==null||this.qlrform.suyqxz==""){
  1152. this.qlrform.suyqxz = "40"
  1153. this.qlrform.suyqxzName = "集体土地所有权"
  1154. }
  1155. if(this.qlrform.dbrzjlx==null||this.qlrform.dbrzjlx==""){
  1156. this.qlrform.dbrzjlx = "01"
  1157. this.qlrform.dbrzjlxName = "身份证"
  1158. }
  1159. if(this.qlrform.sfclncjtjjzz==null||this.qlrform.sfclncjtjjzz==""){
  1160. this.qlrform.sfclncjtjjzz = "Y"
  1161. }
  1162. if(this.qlrform.sjly==null||this.qlrform.sjly==""){
  1163. this.qlrform.sjly = "04"
  1164. this.qlrform.sjlyName = "农村宅基地使用权确权登记发证"
  1165. }
  1166. this.zjlxOptions.map(res => {
  1167. if(res.dictValue == this.qlrform.dbrzjlx){
  1168. this.qlrform.dbrzjlxName = res.dictLabel
  1169. }
  1170. if(res.dictValue == this.qlrform.dlrzjlx){
  1171. this.qlrform.dlrzjlxName = res.dictLabel
  1172. }
  1173. })
  1174. this.suyqxzOptions.map(res => {
  1175. if(res.dictValue == this.qlrform.suyqxz){
  1176. this.qlrform.suyqxzName = res.dictLabel
  1177. }
  1178. })
  1179. this.sjlyOptions.map(res => {
  1180. if(res.dictValue == this.qlrform.sjly){
  1181. this.qlrform.sjlyName = res.dictLabel
  1182. }
  1183. })
  1184. }
  1185. });
  1186. this.mapZjdData = "";
  1187. this.mapZrzData = "";
  1188. this.mapFsssData = "";
  1189. //that.mapZjdTeAll.active ="1";
  1190. this.mapZjdTeAll.mapZjdAData = {};
  1191. this.mapZjdTeAll.mapZrzAData = {};
  1192. this.mapZjdTeAll.mapFsssAData = {};
  1193. this.mapZjdDataTure = "";
  1194. this.mapXs =false;
  1195. this.mapClick ="";
  1196. this.mapAddJump = "";
  1197. this.backTheGeom = "";
  1198. this.zjdHcDy = "";
  1199. this.mapZjdDataTure = "";
  1200. this.mapAddJumpNum ="";
  1201. },
  1202. // 查询农户列表
  1203. getNh(){
  1204. //删除地图选中状态
  1205. $("#deleteHistoryMap").trigger("click");
  1206. let params = {
  1207. "deptId" : this.item.deptId
  1208. }
  1209. listNh(params).then((response) => {
  1210. this.nhlist = response.rows
  1211. this.totalN = response.total
  1212. });
  1213. this.mapZjdData = "";
  1214. this.mapZrzData = "";
  1215. this.mapFsssData = "";
  1216. //that.mapZjdTeAll.active ="1";
  1217. this.mapZjdTeAll.mapZjdAData = {};
  1218. this.mapZjdTeAll.mapZrzAData = {};
  1219. this.mapZjdTeAll.mapFsssAData = {};
  1220. this.mapZjdDataTure = "";
  1221. this.mapXs =false;
  1222. this.mapClick ="";
  1223. this.mapAddJump = "";
  1224. this.backTheGeom = "";
  1225. this.zjdHcDy = "";
  1226. this.mapZjdDataTure = "";
  1227. this.mapAddJumpNum ="";
  1228. },
  1229. //调查
  1230. getDc(){
  1231. //删除地图选中状态
  1232. $("#deleteHistoryMap").trigger("click");
  1233. this.mapZjdData = "";
  1234. this.mapZrzData = "";
  1235. this.mapFsssData = "";
  1236. //that.mapZjdTeAll.active ="1";
  1237. this.mapZjdTeAll.mapZjdAData = {};
  1238. this.mapZjdTeAll.mapZrzAData = {};
  1239. this.mapZjdTeAll.mapFsssAData = {};
  1240. this.mapZjdDataTure = "";
  1241. this.mapXs =false;
  1242. this.mapClick ="";
  1243. this.mapAddJump = "";
  1244. this.backTheGeom = "";
  1245. this.zjdHcDy = "";
  1246. this.mapZjdDataTure = "";
  1247. this.mapAddJumpNum ="";
  1248. },
  1249. // 农户信息搜索框
  1250. onSearchnh(){
  1251. let params = {
  1252. "deptId" : this.item.deptId,
  1253. "nhValue" : this.nhvalue
  1254. }
  1255. listNh(params).then((response) => {
  1256. this.nhlist = response.rows
  1257. });
  1258. },
  1259. // 宅基地搜索框
  1260. onSearchzjd(){
  1261. rhhcList({"shyqrdbxm" : this.zjdvalue,surveyStatus:"1,2,3,4,5"}).then(res => {
  1262. this.whcNums = res.data.wdcs;
  1263. this.hcycNums = res.data.dcycs;
  1264. this.hcwcNums = res.data.dcwcs;
  1265. this.sptgNums = res.data.dctgs;
  1266. this.spbhNums = res.data.dcbhs;
  1267. });
  1268. if(this.active==0){
  1269. let params = {
  1270. "shyqrdbxm" : this.zjdvalue,
  1271. "surveyStatus":"1",
  1272. "pageNum": 1,
  1273. "pageSize":10,
  1274. }
  1275. rhhcList(params).then((response) => {
  1276. console.info(this.list2.length);
  1277. if (response.code == 200) {
  1278. this.list1 = response.data.zjdzdxxList;
  1279. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1280. this.countyhc++
  1281. this.loading2 = false
  1282. this.finished2 = false;
  1283. }else{
  1284. this.loading2 = false
  1285. this.finished2 = true
  1286. }
  1287. }
  1288. });
  1289. } else if(this.active==1){
  1290. let params = {
  1291. "shyqrdbxm" : this.zjdvalue,
  1292. "surveyStatus":"2",
  1293. "pageNum": 1,
  1294. "pageSize":10,
  1295. }
  1296. rhhcList(params).then((response) => {
  1297. console.info(this.list2.length);
  1298. if (response.code == 200) {
  1299. this.list1 = response.data.zjdzdxxList;
  1300. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1301. this.countyhc++
  1302. this.loading2 = false
  1303. this.finished2 = false;
  1304. }else{
  1305. this.loading2 = false
  1306. this.finished2 = true
  1307. }
  1308. }
  1309. });
  1310. } else if(this.active==2){
  1311. let params = {
  1312. "shyqrdbxm" : this.zjdvalue,
  1313. "surveyStatus":"3",
  1314. "pageNum": 1,
  1315. "pageSize":10,
  1316. }
  1317. rhhcList(params).then((response) => {
  1318. console.info(this.list2.length);
  1319. if (response.code == 200) {
  1320. this.list1 = response.data.zjdzdxxList;
  1321. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1322. this.countyhc++
  1323. this.loading2 = false
  1324. this.finished2 = false;
  1325. }else{
  1326. this.loading2 = false
  1327. this.finished2 = true
  1328. }
  1329. }
  1330. });
  1331. } else if(this.active==3){
  1332. let params = {
  1333. "shyqrdbxm" : this.zjdvalue,
  1334. "surveyStatus":"4",
  1335. "pageNum": 1,
  1336. "pageSize":10,
  1337. }
  1338. rhhcList(params).then((response) => {
  1339. console.info(this.list2.length);
  1340. if (response.code == 200) {
  1341. this.list1 = response.data.zjdzdxxList;
  1342. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1343. this.countyhc++
  1344. this.loading2 = false
  1345. this.finished2 = false;
  1346. }else{
  1347. this.loading2 = false
  1348. this.finished2 = true
  1349. }
  1350. }
  1351. });
  1352. }else{
  1353. let params = {
  1354. "shyqrdbxm" : this.zjdvalue,
  1355. "surveyStatus":"5",
  1356. "pageNum": 1,
  1357. "pageSize":10,
  1358. }
  1359. rhhcList(params).then((response) => {
  1360. if (response.code == 200) {
  1361. this.list1 = response.data.zjdzdxxList;
  1362. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1363. this.countyhc++
  1364. this.loading2 = false
  1365. this.finished2 = false;
  1366. }else{
  1367. this.loading2 = false
  1368. this.finished2 = true
  1369. }
  1370. }
  1371. });
  1372. }
  1373. },
  1374. // 户内成员弹窗
  1375. showPopuphncy(item){
  1376. this.showhncy = true
  1377. if(item.id==null||item.id==""){
  1378. this.form5 = {
  1379. "nhdm":this.nhdm,
  1380. "deptId":this.item.deptId,
  1381. "zjlx":'01',
  1382. "zjlxName":"身份证",
  1383. "yhzgx":"14",
  1384. "yhzgxName":"妻",
  1385. "hyzk":'02',
  1386. "hklx":'1',
  1387. "occupation":'1',
  1388. "occupationName":'务农',
  1389. "jzqk":'3',
  1390. "jzqkName":'常年居住',
  1391. "sfbjtjjzzcy":'Y',
  1392. "xb":'0',
  1393. "sfbccm":'Y',
  1394. "sfpkh":'N',
  1395. "sfwbh":'N',
  1396. "sjly":'07',
  1397. "sjlyName":'农村集体产权制度改革',
  1398. "cybz":'9',
  1399. "cybzName":'其他备注'
  1400. }
  1401. }else{
  1402. let _this = this
  1403. this.form5 = item
  1404. if(this.form5.nhdm==null||this.form5.nhdm==""){
  1405. this.form5.nhdm = this.nhform.nhdm
  1406. }
  1407. if(this.form5.deptId==null||this.form5.deptId==""){
  1408. this.form5.deptId = this.nhform.deptId
  1409. }
  1410. if(this.form5.zjlx==null||this.form5.zjlx==""){
  1411. this.form5.zjlx = "01"
  1412. this.form5.zjlxName = "身份证"
  1413. }
  1414. if(this.form5.yhzgx==null||this.form5.yhzgx==""){
  1415. this.form5.yhzgx = "14"
  1416. this.form5.yhzgxName = "妻"
  1417. }
  1418. if(this.form5.hyzk==null||this.form5.hyzk==""){
  1419. this.form5.hyzk = "02"
  1420. }
  1421. if(this.form5.hklx==null||this.form5.hklx==""){
  1422. this.form5.hklx = "1"
  1423. }
  1424. if(this.form5.occupation==null||this.form5.occupation==""){
  1425. this.form5.occupation = "1"
  1426. this.form5.occupationName = "务农"
  1427. }
  1428. if(this.form5.jzqk==null||this.form5.jzqk==""){
  1429. this.form5.jzqk = "3"
  1430. this.form5.jzqkName = "常年居住"
  1431. }
  1432. if(this.form5.sfbjtjjzzcy==null||this.form5.sfbjtjjzzcy==""){
  1433. this.form5.sfbjtjjzzcy = "Y"
  1434. }
  1435. if(this.form5.xb==null||this.form5.xb==""){
  1436. this.form5.xb = "0"
  1437. }
  1438. if(this.form5.sfbccm==null||this.form5.sfbccm==""){
  1439. this.form5.sfbccm = "Y"
  1440. }
  1441. if(this.form5.sfpkh==null||this.form5.sfpkh==""){
  1442. this.form5.sfpkh = "N"
  1443. }
  1444. if(this.form5.sfwbh==null||this.form5.sfwbh==""){
  1445. this.form5.sfwbh = "N"
  1446. }
  1447. if(this.form5.sjly==null||this.form5.sjly==""){
  1448. this.form5.sjly = "07"
  1449. this.form5.sjlyName = "农村集体产权制度改革"
  1450. }
  1451. if(this.form5.cybz==null||this.form5.cybz==""){
  1452. this.form5.cybz = "9"
  1453. this.form5.cybzName = "其他备注"
  1454. }
  1455. this.jzhcssfyzfOptions.map(res => {
  1456. if(res.dictValue == item.jzhcssfyzf){
  1457. this.form5.jzhcssfyzfName = res.dictLabel
  1458. }
  1459. })
  1460. this.zjlxOptions.map(res => {
  1461. if(res.dictValue == item.zjlx){
  1462. this.form5.zjlxName = res.dictLabel
  1463. }
  1464. })
  1465. this.occupationOptions.map(res => {
  1466. if(res.dictValue == item.occupation){
  1467. this.form5.occupationName = res.dictLabel
  1468. }
  1469. })
  1470. this.jzqkOptions.map(res => {
  1471. if(res.dictValue == item.jzqk){
  1472. this.form5.jzqkName = res.dictLabel
  1473. }
  1474. })
  1475. this.yhzgxOptions.map(res => {
  1476. if(res.dictValue == item.yhzgx){
  1477. this.form5.yhzgxName = res.dictLabel
  1478. }
  1479. })
  1480. this.cybzOptions.map(res => {
  1481. if(res.dictValue == item.cybz){
  1482. this.form5.cybzName = res.dictLabel
  1483. }
  1484. })
  1485. this.sjlyOptions.map(res => {
  1486. if(res.dictValue == item.sjly){
  1487. this.form5.sjlyName = res.dictLabel
  1488. }
  1489. })
  1490. }
  1491. },
  1492. // 户内成员列表
  1493. showPopuphncylist(item){
  1494. if(item.nhdm==null||item.nhdm==""){
  1495. this.$toast({
  1496. icon: 'error', // 找到自己需要的图标
  1497. message: '请先保存户主信息',
  1498. duration:"1000"
  1499. })
  1500. }else{
  1501. this.nhdm = item.nhdm
  1502. this.showhncylist = true
  1503. let params = {
  1504. "nhdm":item.nhdm,
  1505. "deptId":this.item.deptId
  1506. }
  1507. listNhhncy(params).then((response) => {
  1508. if (response.code == 200) {
  1509. this.hncylist = response.rows
  1510. }
  1511. });
  1512. }
  1513. },
  1514. showPopupnh(item){
  1515. this.shownh = true
  1516. this.nhform = item
  1517. this.jzhcssfyzfOptions.map(res => {
  1518. if(res.dictValue == item.jzhcssfyzf){
  1519. this.nhform.jzhcssfyzfName = res.dictLabel
  1520. }
  1521. })
  1522. this.zjlxOptions.map(res => {
  1523. if(res.dictValue == item.hzzjlx){
  1524. this.nhform.hzzjlxName = res.dictLabel
  1525. }
  1526. })
  1527. this.occupationOptions.map(res => {
  1528. if(res.dictValue == item.occupation){
  1529. this.nhform.occupationName = res.dictLabel
  1530. }
  1531. })
  1532. this.jzqkOptions.map(res => {
  1533. if(res.dictValue == item.jzqk){
  1534. this.nhform.jzqkName = res.dictLabel
  1535. }
  1536. })
  1537. this.sjlyOptions.map(res => {
  1538. if(res.dictValue == item.sjly){
  1539. this.nhform.sjlyName = res.dictLabel
  1540. }
  1541. })
  1542. },
  1543. getZjdList(){
  1544. this.countyhc = 0;
  1545. if(this.active === 0){
  1546. let params = {
  1547. "shyqrdbxm" : this.zjdvalue,
  1548. "surveyStatus":"1",
  1549. "pageNum": 1,
  1550. "pageSize":10,
  1551. }
  1552. rhhcList(params).then((response) => {
  1553. if (response.code == 200) {
  1554. this.whcNums = response.data.zjdzs;
  1555. this.list1 = response.data.zjdzdxxList;
  1556. this.loading2 = false
  1557. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1558. this.countyhc++
  1559. this.finished2 = false;
  1560. }else{
  1561. this.finished2 = true
  1562. }
  1563. }
  1564. });
  1565. }else if(this.active === 1){
  1566. let params = {
  1567. "shyqrdbxm" : this.zjdvalue,
  1568. "surveyStatus":"2",
  1569. "pageNum": 1,
  1570. "pageSize":10,
  1571. }
  1572. rhhcList(params).then((response) => {
  1573. if (response.code == 200) {
  1574. this.hcycNums = response.data.zjdzs;
  1575. this.list1 = response.data.zjdzdxxList;
  1576. this.loading2 = false
  1577. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1578. this.countyhc++
  1579. this.finished2 = false;
  1580. }else{
  1581. this.finished2 = true
  1582. }
  1583. }
  1584. });
  1585. }else if(this.active === 2){
  1586. let params = {
  1587. "shyqrdbxm" : this.zjdvalue,
  1588. "surveyStatus":"3",
  1589. "pageNum": 1,
  1590. "pageSize":10,
  1591. }
  1592. rhhcList(params).then((response) => {
  1593. if (response.code == 200) {
  1594. this.hcwcNums = response.data.zjdzs;
  1595. this.list1 = response.data.zjdzdxxList;
  1596. this.loading2 = false
  1597. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1598. this.countyhc++
  1599. this.finished2 = false;
  1600. }else{
  1601. this.finished2 = true
  1602. }
  1603. }
  1604. });
  1605. }else if(this.active === 3){
  1606. let params = {
  1607. "shyqrdbxm" : this.zjdvalue,
  1608. "surveyStatus":"4",
  1609. "pageNum": 1,
  1610. "pageSize":10,
  1611. }
  1612. rhhcList(params).then((response) => {
  1613. if (response.code == 200) {
  1614. this.spbhNums = response.data.zjdzs;
  1615. this.list1 = response.data.zjdzdxxList;
  1616. this.loading2 = false
  1617. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1618. this.countyhc++
  1619. this.finished2 = false;
  1620. }else{
  1621. this.finished2 = true
  1622. }
  1623. }
  1624. });
  1625. }else if(this.active === 4){
  1626. let params = {
  1627. "shyqrdbxm" : this.zjdvalue,
  1628. "surveyStatus":"5",
  1629. "pageNum": 1,
  1630. "pageSize":10,
  1631. }
  1632. rhhcList(params).then((response) => {
  1633. if (response.code == 200) {
  1634. this.sptgNums = response.data.zjdzs;
  1635. this.list1 = response.data.zjdzdxxList;
  1636. this.loading2 = false
  1637. if(response.data.zjdzdxxList.length>0&&response.data.zjdzdxxList.length<response.data.zjdzs){
  1638. this.countyhc++
  1639. this.finished2 = false;
  1640. }else{
  1641. this.finished2 = true
  1642. }
  1643. }
  1644. });
  1645. }
  1646. },
  1647. onConfirm(){},
  1648. /*onSubmithncy(){
  1649. if (this.form5.id != null) {
  1650. if (this.form5.zjlx=='01'&&parseInt(this.form5.zjhm.substr(16, 1)) % 2 == 1) {
  1651. if(this.form5.xb!='1'){
  1652. Dialog.confirm({
  1653. title: '警告',
  1654. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1655. })
  1656. .then(() => {
  1657. // on confirm
  1658. updateNhhncy(this.form5).then(response => {
  1659. let _this =this
  1660. this.$toast({
  1661. icon: 'success', // 找到自己需要的图标
  1662. message: '修改成功',
  1663. duration:"1000",
  1664. onClose:function(){
  1665. _this.showhncy = false
  1666. let params = {
  1667. "nhdm":_this.form5.nhdm,
  1668. deptId:_this.form5.deptId
  1669. }
  1670. listNhhncy(params).then((response) => {
  1671. _this.hncylist = response.rows
  1672. })
  1673. }
  1674. })
  1675. });
  1676. })
  1677. .catch(() => {
  1678. // on cancel
  1679. });
  1680. }else{
  1681. updateNhhncy(this.form5).then(response => {
  1682. let _this =this
  1683. this.$toast({
  1684. icon: 'success', // 找到自己需要的图标
  1685. message: '修改成功',
  1686. duration:"1000",
  1687. onClose:function(){
  1688. _this.showhncy = false
  1689. let params = {
  1690. "nhdm":_this.form5.nhdm,
  1691. deptId:_this.form5.deptId
  1692. }
  1693. listNhhncy(params).then((response) => {
  1694. _this.hncylist = response.rows
  1695. })
  1696. }
  1697. })
  1698. });
  1699. }
  1700. } else {
  1701. if(this.form5.xb=='1'){
  1702. Dialog.confirm({
  1703. title: '警告',
  1704. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1705. })
  1706. .then(() => {
  1707. // on confirm
  1708. updateNhhncy(this.form5).then(response => {
  1709. let _this =this
  1710. this.$toast({
  1711. icon: 'success', // 找到自己需要的图标
  1712. message: '修改成功',
  1713. duration:"1000",
  1714. onClose:function(){
  1715. _this.showhncy = false
  1716. let params = {
  1717. "nhdm":_this.form5.nhdm,
  1718. deptId:_this.form5.deptId
  1719. }
  1720. listNhhncy(params).then((response) => {
  1721. _this.hncylist = response.rows
  1722. })
  1723. }
  1724. })
  1725. });
  1726. })
  1727. .catch(() => {
  1728. // on cancel
  1729. });
  1730. }else{
  1731. updateNhhncy(this.form5).then(response => {
  1732. let _this =this
  1733. this.$toast({
  1734. icon: 'success', // 找到自己需要的图标
  1735. message: '修改成功',
  1736. duration:"1000",
  1737. onClose:function(){
  1738. _this.showhncy = false
  1739. let params = {
  1740. "nhdm":_this.form5.nhdm,
  1741. deptId:_this.form5.deptId
  1742. }
  1743. listNhhncy(params).then((response) => {
  1744. _this.hncylist = response.rows
  1745. })
  1746. }
  1747. })
  1748. });
  1749. }
  1750. }
  1751. } else {
  1752. if (this.form5.zjlx=='01'&&parseInt(this.form5.zjhm.substr(16, 1)) % 2 == 1) {
  1753. if(this.form5.xb!='1'){
  1754. Dialog.confirm({
  1755. title: '警告',
  1756. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1757. })
  1758. .then(() => {
  1759. // on confirm
  1760. addNhhncy(this.form5).then(response => {
  1761. let _this =this
  1762. this.$toast({
  1763. icon: 'success', // 找到自己需要的图标
  1764. message: '保存成功',
  1765. duration:"1000",
  1766. onClose:function(){
  1767. _this.showhncy = false
  1768. _this.totalR+=1
  1769. _this.totalH+=1
  1770. let params = {
  1771. "nhdm":_this.form5.nhdm,
  1772. deptId:_this.form5.deptId
  1773. }
  1774. listNhhncy(params).then((response) => {
  1775. _this.hncylist = response.rows
  1776. })
  1777. }
  1778. })
  1779. });
  1780. })
  1781. .catch(() => {
  1782. // on cancel
  1783. });
  1784. }else{
  1785. addNhhncy(this.form5).then(response => {
  1786. let _this =this
  1787. this.$toast({
  1788. icon: 'success', // 找到自己需要的图标
  1789. message: '保存成功',
  1790. duration:"1000",
  1791. onClose:function(){
  1792. _this.showhncy = false
  1793. _this.totalR+=1
  1794. _this.totalH+=1
  1795. let params = {
  1796. "nhdm":_this.form5.nhdm,
  1797. deptId:_this.form5.deptId
  1798. }
  1799. listNhhncy(params).then((response) => {
  1800. _this.hncylist = response.rows
  1801. })
  1802. }
  1803. })
  1804. });
  1805. }
  1806. } else {
  1807. if(this.form5.xb=='1'){
  1808. Dialog.confirm({
  1809. title: '警告',
  1810. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1811. })
  1812. .then(() => {
  1813. // on confirm
  1814. addNhhncy(this.form5).then(response => {
  1815. let _this =this
  1816. this.$toast({
  1817. icon: 'success', // 找到自己需要的图标
  1818. message: '保存成功',
  1819. duration:"1000",
  1820. onClose:function(){
  1821. _this.showhncy = false
  1822. _this.totalR+=1
  1823. _this.totalH+=1
  1824. let params = {
  1825. "nhdm":_this.form5.nhdm,
  1826. deptId:_this.form5.deptId
  1827. }
  1828. listNhhncy(params).then((response) => {
  1829. _this.hncylist = response.rows
  1830. })
  1831. }
  1832. })
  1833. });
  1834. })
  1835. .catch(() => {
  1836. // on cancel
  1837. });
  1838. }else{
  1839. addNhhncy(this.form5).then(response => {
  1840. let _this =this
  1841. this.$toast({
  1842. icon: 'success', // 找到自己需要的图标
  1843. message: '保存成功',
  1844. duration:"1000",
  1845. onClose:function(){
  1846. _this.showhncy = false
  1847. _this.totalR+=1
  1848. _this.totalH+=1
  1849. let params = {
  1850. "nhdm":_this.form5.nhdm,
  1851. deptId:_this.form5.deptId
  1852. }
  1853. listNhhncy(params).then((response) => {
  1854. _this.hncylist = response.rows
  1855. })
  1856. }
  1857. })
  1858. });
  1859. }
  1860. }
  1861. }
  1862. },*/
  1863. onSubmithncy(){
  1864. if (this.form5.id != null) {
  1865. if (this.form5.zjlx=='01'&&parseInt(this.form5.zjhm.substr(16, 1)) % 2 == 1) {
  1866. if(this.form5.xb!='1'){
  1867. Dialog.confirm({
  1868. title: '警告',
  1869. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1870. })
  1871. .then(() => {
  1872. // on confirm
  1873. updateNhhncy(this.form5).then(response => {
  1874. let _this =this
  1875. this.$toast({
  1876. icon: 'success', // 找到自己需要的图标
  1877. message: '修改成功',
  1878. duration:"1000",
  1879. onClose:function(){
  1880. _this.showhncy = false
  1881. let params = {
  1882. "nhdm":_this.form5.nhdm,
  1883. deptId:_this.form5.deptId
  1884. }
  1885. listNhhncy(params).then((response) => {
  1886. _this.hncylist = response.rows
  1887. })
  1888. }
  1889. })
  1890. });
  1891. })
  1892. .catch(() => {
  1893. // on cancel
  1894. });
  1895. }else{
  1896. updateNhhncy(this.form5).then(response => {
  1897. let _this =this
  1898. this.$toast({
  1899. icon: 'success', // 找到自己需要的图标
  1900. message: '修改成功',
  1901. duration:"1000",
  1902. onClose:function(){
  1903. _this.showhncy = false
  1904. let params = {
  1905. "nhdm":_this.form5.nhdm,
  1906. deptId:_this.form5.deptId
  1907. }
  1908. listNhhncy(params).then((response) => {
  1909. _this.hncylist = response.rows
  1910. })
  1911. }
  1912. })
  1913. });
  1914. }
  1915. } else if (this.form5.zjlx=='01'&&parseInt(this.form5.zjhm.substr(16, 1)) % 2 == 0){
  1916. if(this.form5.xb!='0'){
  1917. Dialog.confirm({
  1918. title: '警告',
  1919. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1920. })
  1921. .then(() => {
  1922. // on confirm
  1923. updateNhhncy(this.form5).then(response => {
  1924. let _this =this
  1925. this.$toast({
  1926. icon: 'success', // 找到自己需要的图标
  1927. message: '修改成功',
  1928. duration:"1000",
  1929. onClose:function(){
  1930. _this.showhncy = false
  1931. let params = {
  1932. "nhdm":_this.form5.nhdm,
  1933. deptId:_this.form5.deptId
  1934. }
  1935. listNhhncy(params).then((response) => {
  1936. _this.hncylist = response.rows
  1937. })
  1938. }
  1939. })
  1940. });
  1941. })
  1942. .catch(() => {
  1943. // on cancel
  1944. });
  1945. }else{
  1946. updateNhhncy(this.form5).then(response => {
  1947. let _this =this
  1948. this.$toast({
  1949. icon: 'success', // 找到自己需要的图标
  1950. message: '修改成功',
  1951. duration:"1000",
  1952. onClose:function(){
  1953. _this.showhncy = false
  1954. let params = {
  1955. "nhdm":_this.form5.nhdm,
  1956. deptId:_this.form5.deptId
  1957. }
  1958. listNhhncy(params).then((response) => {
  1959. _this.hncylist = response.rows
  1960. })
  1961. }
  1962. })
  1963. });
  1964. }
  1965. }else{
  1966. updateNhhncy(this.form5).then(response => {
  1967. let _this =this
  1968. this.$toast({
  1969. icon: 'success', // 找到自己需要的图标
  1970. message: '修改成功',
  1971. duration:"1000",
  1972. onClose:function(){
  1973. _this.showhncy = false
  1974. let params = {
  1975. "nhdm":_this.form5.nhdm,
  1976. deptId:_this.form5.deptId
  1977. }
  1978. listNhhncy(params).then((response) => {
  1979. _this.hncylist = response.rows
  1980. })
  1981. }
  1982. })
  1983. });
  1984. }
  1985. } else {
  1986. if (this.form5.zjlx=='01'&&parseInt(this.form5.zjhm.substr(16, 1)) % 2 == 1) {
  1987. if(this.form5.xb!='1'){
  1988. Dialog.confirm({
  1989. title: '警告',
  1990. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  1991. })
  1992. .then(() => {
  1993. // on confirm
  1994. addNhhncy(this.form5).then(response => {
  1995. let _this =this
  1996. this.$toast({
  1997. icon: 'success', // 找到自己需要的图标
  1998. message: '保存成功',
  1999. duration:"1000",
  2000. onClose:function(){
  2001. _this.totalR+=1
  2002. _this.showhncy = false
  2003. let params = {
  2004. "nhdm":_this.form5.nhdm,
  2005. deptId:_this.form5.deptId
  2006. }
  2007. listNhhncy(params).then((response) => {
  2008. _this.hncylist = response.rows
  2009. })
  2010. }
  2011. })
  2012. });
  2013. })
  2014. .catch(() => {
  2015. // on cancel
  2016. });
  2017. }else{
  2018. addNhhncy(this.form5).then(response => {
  2019. let _this =this
  2020. this.$toast({
  2021. icon: 'success', // 找到自己需要的图标
  2022. message: '保存成功',
  2023. duration:"1000",
  2024. onClose:function(){
  2025. _this.totalR+=1
  2026. _this.showhncy = false
  2027. let params = {
  2028. "nhdm":_this.form5.nhdm,
  2029. deptId:_this.form5.deptId
  2030. }
  2031. listNhhncy(params).then((response) => {
  2032. _this.hncylist = response.rows
  2033. })
  2034. }
  2035. })
  2036. });
  2037. }
  2038. } else if (this.form5.zjlx=='01'&&parseInt(this.form5.zjhm.substr(16, 1)) % 2 == 0){
  2039. if(this.form5.xb!='0'){
  2040. Dialog.confirm({
  2041. title: '警告',
  2042. message: '成员性别与身份证号中性别信息不符,是否继续保存?',
  2043. })
  2044. .then(() => {
  2045. // on confirm
  2046. addNhhncy(this.form5).then(response => {
  2047. let _this =this
  2048. this.$toast({
  2049. icon: 'success', // 找到自己需要的图标
  2050. message: '保存成功',
  2051. duration:"1000",
  2052. onClose:function(){
  2053. _this.totalR+=1
  2054. _this.showhncy = false
  2055. let params = {
  2056. "nhdm":_this.form5.nhdm,
  2057. deptId:_this.form5.deptId
  2058. }
  2059. listNhhncy(params).then((response) => {
  2060. _this.hncylist = response.rows
  2061. })
  2062. }
  2063. })
  2064. });
  2065. })
  2066. .catch(() => {
  2067. // on cancel
  2068. });
  2069. }else{
  2070. addNhhncy(this.form5).then(response => {
  2071. let _this =this
  2072. this.$toast({
  2073. icon: 'success', // 找到自己需要的图标
  2074. message: '保存成功',
  2075. duration:"1000",
  2076. onClose:function(){
  2077. _this.totalR+=1
  2078. _this.showhncy = false
  2079. let params = {
  2080. "nhdm":_this.form5.nhdm,
  2081. deptId:_this.form5.deptId
  2082. }
  2083. listNhhncy(params).then((response) => {
  2084. _this.hncylist = response.rows
  2085. })
  2086. }
  2087. })
  2088. });
  2089. }
  2090. }else{
  2091. addNhhncy(this.form5).then(response => {
  2092. let _this =this
  2093. this.$toast({
  2094. icon: 'success', // 找到自己需要的图标
  2095. message: '保存成功',
  2096. duration:"1000",
  2097. onClose:function(){
  2098. _this.totalR+=1
  2099. _this.showhncy = false
  2100. let params = {
  2101. "nhdm":_this.form5.nhdm,
  2102. deptId:_this.form5.deptId
  2103. }
  2104. listNhhncy(params).then((response) => {
  2105. _this.hncylist = response.rows
  2106. })
  2107. }
  2108. })
  2109. });
  2110. }
  2111. }
  2112. },
  2113. mapShow() {
  2114. //删除地图选中状态
  2115. $("#deleteHistoryMap").trigger("click");
  2116. //通过数据直接查询方式--------加载较慢 start
  2117. //镇边界获取
  2118. // listTown().then(response => {
  2119. // if (response.code == 200) {
  2120. // this.mapTownList = response.rows;
  2121. // //村边界获取
  2122. // listVillage(this.queryParams).then(response => {
  2123. // this.mapVillageList = response.rows;
  2124. // listZjdzd().then((response) => {
  2125. // if (response.code == 200) {
  2126. // this.mapTheGeomZjdId= response.rows;
  2127. // listZrz().then((response) => {
  2128. // if (response.code == 200) {
  2129. // this.mapTheGeomZrzId = response.rows;
  2130. // listFsss().then((response) => {
  2131. // if (response.code == 200) {
  2132. // this.mapTheGeomFsssId = response.rows;
  2133. // }
  2134. // setTimeout(() => {
  2135. // this.GetMapsInit();
  2136. // }, 300);
  2137. // });
  2138. // }
  2139. // });
  2140. // }
  2141. // });
  2142. // });
  2143. // }
  2144. // });
  2145. //通过数据直接查询方式--------加载较慢 end
  2146. getGeoServerConfigKey().then(response => {
  2147. this.mapGeoServerUrl = response.msg;
  2148. setTimeout(() => {
  2149. this.GetMapsInit();
  2150. }, 300);
  2151. });
  2152. var that = this;
  2153. setTimeout(function () {
  2154. var height = $(".searchBar_wrap").outerHeight(true) - $(".searchBar_wrap .van-search").outerHeight(true)
  2155. that.bottomHeight = -height+'px'
  2156. },500)
  2157. },
  2158. //地图加载 -----start
  2159. GetMapsInit() {
  2160. //加载地图编辑
  2161. var that = this;
  2162. var map;
  2163. //点击事件添加样式
  2164. var hc_land_on;
  2165. document.getElementById("mapWrapAll").innerHTML = '';
  2166. var hc_land;
  2167. var projection = new ol.proj.Projection({
  2168. //地图投影类型
  2169. code: "EPSG:3857",
  2170. units: "degrees",
  2171. //extent:extent
  2172. });
  2173. var aerial = new ol.layer.Tile({
  2174. source: new ol.source.XYZ({
  2175. // url: "http://t0.tianditu.gov.cn/img_w/wmts?" +
  2176. // "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
  2177. // "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067",
  2178. url: "http://t{0-7}.tianditu.com/img_w/wmts?" +
  2179. "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
  2180. "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067",
  2181. }),
  2182. isGroup: true,
  2183. name: "卫星影像图",
  2184. });
  2185. var yingxzi = new ol.layer.Tile({
  2186. source: new ol.source.XYZ({
  2187. url: "http://t{0-7}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk= ",
  2188. }),
  2189. isGroup: true,
  2190. name: "天地图文字标注--卫星影像图",
  2191. });
  2192. //加载地图
  2193. map = new ol.Map({
  2194. controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]), //隐藏放大缩小按钮
  2195. layers: [aerial, yingxzi],
  2196. projection: projection,
  2197. target: "mapWrapAll",
  2198. view: new ol.View({
  2199. //center: ol.proj.fromLonLat([115.452752, 31.789033]),
  2200. //center: ol.proj.fromLonLat([115.452752, 31.789033]),
  2201. zoom: 10,
  2202. minZoom: 5, //地图缩小限制
  2203. maxZoom: 18.3, //地图放大限制
  2204. resolution: Math.random() * 0.00000001,
  2205. }),
  2206. interactions: ol.interaction.defaults({
  2207. pinchRotate: false // 移动端禁止地图旋转
  2208. }),
  2209. });
  2210. //使用geoserver服务查询开始 -------------------start
  2211. //镇边界查询开始 ------------------------------start
  2212. // var zhenTc= new ol.layer.Tile({
  2213. // source: new ol.source.TileWMS({
  2214. // url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
  2215. // params: {
  2216. // LAYERS: 'zjd_dc:t_house_survey_border_town',
  2217. // TILED: true,
  2218. // //cql_filter: cql_filter,
  2219. // SRID: 3857,
  2220. // },
  2221. // }),
  2222. // });
  2223. // map.addLayer(zhenTc);
  2224. //镇边界查询开始 ------------------------------end
  2225. //村边界查询开始 ------------------------------start
  2226. var cql_filter = "dept_id='" + that.$cookies.get("item").deptId + "'";
  2227. var cunTc = new ol.layer.Image({
  2228. source: new ol.source.ImageWMS({
  2229. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2230. params: {
  2231. LAYERS: 'zjd_dc:t_house_survey_border_village',
  2232. TILED: true,
  2233. cql_filter: cql_filter,
  2234. SRID: 3857,
  2235. TIMESTAMP: new Date().getTime(),
  2236. },
  2237. resolution: Math.random() * 0.00000001,
  2238. }),
  2239. });
  2240. // //定位查询位置
  2241. // let param_dw = {
  2242. // srsName: "EPSG:3857",
  2243. // service: "WFS",
  2244. // version: "1.0.0",
  2245. // request: "GetFeature",
  2246. // typename: "zjd_dc:t_house_survey_border_village",
  2247. // //featureNS: 'nsgk_hc',//命名空间 URI
  2248. // cql_filter: cql_filter,
  2249. // //featurePrefix: 'nationalwater',//工作区名称
  2250. // //featureTypes: ['nationalwater:01fir'],//查询图层,可以是同一个工作区下多个图层,逗号隔开
  2251. // outputFormat: "application/json",
  2252. // //filter: ol.format.filter.equalTo(t,e,r)//前者是属性名,后者是对应值
  2253. // };
  2254. // let url_dw = that.mapGeoServerUrl + "/geoserver/zjd_dc/wfs"; //wfsurl;
  2255. // url_dw = url_dw + "?";
  2256. // for (let key in param_dw) {
  2257. // url_dw = url_dw + key + "=" + param_dw[key] + "&";
  2258. // }
  2259. // url_dw = url_dw.substr(0, url_dw.length - 1);
  2260. // fetch(url_dw, {
  2261. // method: "POST", // *GET, POST, PUT, DELETE, etc.
  2262. // })
  2263. // .then((res) => {
  2264. // var geojsonmap = res.json();
  2265. // return geojsonmap;
  2266. // })
  2267. // .then((data) => {
  2268. // if (that.backTheGeom != "" && that.backTheGeom != undefined && that.backTheGeom.substring(0, 1) == "{") {
  2269. // //自然幢图层查询开始 ------------------start
  2270. // var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + that.mapZjdData.zjddm + "'";
  2271. // zrzTc = new ol.layer.Image({
  2272. // source: new ol.source.ImageWMS({
  2273. // url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2274. // params: {
  2275. // LAYERS: 'zjd_dc:t_house_survey_zrz',
  2276. // TILED: true,
  2277. // cql_filter: cql_filter_map,
  2278. // SRID: 3857,
  2279. // TIMESTAMP: new Date().getTime(),
  2280. // },
  2281. // }),
  2282. // });
  2283. // map.addLayer(zrzTc);
  2284. // //自然幢图层查询开始 ------------------start
  2285. // //附属设施图层查询开始 ------------------start
  2286. // //var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  2287. // fsssTc = new ol.layer.Image({
  2288. // source: new ol.source.ImageWMS({
  2289. // url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2290. // params: {
  2291. // LAYERS: 'zjd_dc:t_house_survey_fsss',
  2292. // TILED: true,
  2293. // cql_filter: cql_filter_map,
  2294. // SRID: 3857,
  2295. // TIMESTAMP: new Date().getTime(),
  2296. // },
  2297. // }),
  2298. // });
  2299. // map.addLayer(fsssTc);
  2300. // //附属设施图层查询开始 ------------------end
  2301. // hc_land_on = new ol.layer.Vector({
  2302. // title: "add Layer",
  2303. // source: new ol.source.Vector({
  2304. // projection: projection,
  2305. // features: new ol.format.GeoJSON().readFeatures(that.backTheGeom),
  2306. // }),
  2307. // style: new ol.style.Style({
  2308. // stroke: new ol.style.Stroke({
  2309. // //边界样式
  2310. // color: "#CCFF66",
  2311. // width: 6,
  2312. // }),
  2313. // }),
  2314. // });
  2315. // map.addLayer(hc_land_on);
  2316. // var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  2317. // var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  2318. // var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  2319. // var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  2320. // //定位查询位置
  2321. // var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  2322. // that.clickBbox = center;
  2323. // console.log(that.mapZjdData);
  2324. // that.textMjAll = that.mapZjdData.zdmj;
  2325. // map.getView().animate({
  2326. // // 只设置需要的属性即可
  2327. // center: center, // 中心点
  2328. // zoom: 17.9, // 缩放级别
  2329. // rotation: undefined, // 缩放完成view视图旋转弧度
  2330. // duration: 1000, // 缩放持续时间,默认不需要设置
  2331. // resolution: Math.random() * 0.00000001,
  2332. // });
  2333. // //this.backMap =1;
  2334. // } else if (that.backTheGeom != "" && that.backTheGeom != undefined && that.backTheGeom.substring(0, 1) == "[") {
  2335. // //that.newHt ="1";
  2336. // var zbNew = JSON.stringify({
  2337. // "type": "MultiPolygon",
  2338. // "coordinates": [that.backTheGeom.replaceAll("\"", "")]
  2339. // });
  2340. // var leftJoin = zbNew.replace("\"[", "[");
  2341. // var rightJoin = leftJoin.replace("\"]", "]");
  2342. // hc_land_on = new ol.layer.Vector({
  2343. // title: "add Layer",
  2344. // source: new ol.source.Vector({
  2345. // projection: projection,
  2346. // features: new ol.format.GeoJSON().readFeatures("{\n" +
  2347. // " \"type\": \"Feature\",\n" +
  2348. // " \"geometry\":" + rightJoin + "}"),
  2349. // }),
  2350. // style: new ol.style.Style({
  2351. // fill: new ol.style.Fill({
  2352. // //矢量图层填充颜色,以及透明度
  2353. // color: "rgba(204, 255, 204,0.3)",
  2354. // }),
  2355. // stroke: new ol.style.Stroke({
  2356. // //边界样式
  2357. // color: "#CCFF66",
  2358. // width: 3,
  2359. // }),
  2360. // }),
  2361. // });
  2362. // map.addLayer(hc_land_on);
  2363. // var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  2364. // var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  2365. // var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  2366. // var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  2367. // //定位查询位置
  2368. // var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  2369. // that.clickBbox = center;
  2370. // that.textMjAll = that.mapZjdData.zdmj;
  2371. // map.getView().animate({
  2372. // // 只设置需要的属性即可
  2373. // center: center, // 中心点
  2374. // zoom: 16.9, // 缩放级别
  2375. // rotation: undefined, // 缩放完成view视图旋转弧度
  2376. // duration: 1000, // 缩放持续时间,默认不需要设置
  2377. // resolution: Math.random() * 0.00000001,
  2378. // });
  2379. // //this.backMap =1;
  2380. // } else {
  2381. // //通过村界大小视图显示
  2382. // // let resolution = map.getView().getResolutionForExtent(data.bbox, map.getSize());
  2383. // // resolution:resolution + Math.random() * 0.00000001,
  2384. // // map.getView().fit(data.bbox);
  2385. // // map.getView().setResolution(resolution);
  2386. // // //初始视图大小控制
  2387. // // map.getView().setZoom(16.0);
  2388. // console.log(data);
  2389. // console.log(data.features[0].geometry.coordinates[0][0][0]);
  2390. // map.getView().animate({
  2391. // // 只设置需要的属性即可
  2392. // center: data.features[0].geometry.coordinates[0][0][0], // 中心点
  2393. // zoom: 16.9, // 缩放级别
  2394. // rotation: undefined, // 缩放完成view视图旋转弧度
  2395. // duration: 1000, // 缩放持续时间,默认不需要设置
  2396. // resolution: Math.random() * 0.00000001,
  2397. // });
  2398. // }
  2399. // })
  2400. // .catch((error) => {
  2401. // console.log("【异常】", error);
  2402. // });
  2403. map.addLayer(cunTc);
  2404. //村边界查询开始 ------------------------------end
  2405. //国有数据加载-----------------------------------start
  2406. deptGetId(that.$cookies.get("item").deptId).then((res) => {
  2407. var cql_filter_guoyou = "ZLDWDM='" + res.data.orgCode + "0000000'";
  2408. var guoyouTc = new ol.layer.Image({
  2409. source: new ol.source.ImageWMS({
  2410. url: that.mapGeoServerUrl + "/geoserver/zjd_gydl/wms",
  2411. params: {
  2412. LAYERS: 'zjd_gydl:DLTB',
  2413. TILED: true,
  2414. cql_filter: cql_filter_guoyou,
  2415. SRID: 3857,
  2416. TIMESTAMP: new Date().getTime(),
  2417. },
  2418. }),
  2419. });
  2420. map.addLayer(guoyouTc);
  2421. });
  2422. //国有数据加载----------------------------------end
  2423. //宅基地图层查询开始 ------------------start
  2424. //var cql_filter_all = "dept_id='" + that.$cookies.get("item").deptId + "'";
  2425. var zjdTc = new ol.layer.Image({
  2426. source: new ol.source.ImageWMS({
  2427. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2428. params: {
  2429. LAYERS: 'zjd_dc:t_house_survey_zjdzd',
  2430. TILED: true,
  2431. cql_filter: cql_filter,
  2432. SRID: 3857,
  2433. TIMESTAMP: new Date().getTime(),
  2434. },
  2435. }),
  2436. });
  2437. //定位查询位置
  2438. let param_zjdzd = {
  2439. srsName: "EPSG:3857",
  2440. service: "WFS",
  2441. version: "1.0.0",
  2442. request: "GetFeature",
  2443. typename: "zjd_dc:t_house_survey_zjdzd",
  2444. //featureNS: 'nsgk_hc',//命名空间 URI
  2445. cql_filter: cql_filter,
  2446. //featurePrefix: 'nationalwater',//工作区名称
  2447. //featureTypes: ['nationalwater:01fir'],//查询图层,可以是同一个工作区下多个图层,逗号隔开
  2448. outputFormat: "application/json",
  2449. maxFeatures:1,
  2450. //filter: ol.format.filter.equalTo(t,e,r)//前者是属性名,后者是对应值
  2451. };
  2452. let url_zjdzd = that.mapGeoServerUrl + "/geoserver/zjd_dc/wfs"; //wfsurl;
  2453. url_zjdzd = url_zjdzd + "?";
  2454. for (let key in param_zjdzd) {
  2455. url_zjdzd = url_zjdzd + key + "=" + param_zjdzd[key] + "&";
  2456. }
  2457. url_zjdzd = url_zjdzd.substr(0, url_zjdzd.length - 1);
  2458. fetch(url_zjdzd, {
  2459. method: "POST", // *GET, POST, PUT, DELETE, etc.
  2460. })
  2461. .then((res) => {
  2462. var geojsonmap = res.json();
  2463. return geojsonmap;
  2464. })
  2465. .then((data) => {
  2466. if (that.backTheGeom != "" && that.backTheGeom != undefined && that.backTheGeom.substring(0, 1) == "{") {
  2467. //自然幢图层查询开始 ------------------start
  2468. var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + that.mapZjdData.zjddm + "'";
  2469. zrzTc = new ol.layer.Image({
  2470. source: new ol.source.ImageWMS({
  2471. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2472. params: {
  2473. LAYERS: 'zjd_dc:t_house_survey_zrz',
  2474. TILED: true,
  2475. cql_filter: cql_filter_map,
  2476. SRID: 3857,
  2477. TIMESTAMP: new Date().getTime(),
  2478. },
  2479. }),
  2480. });
  2481. map.addLayer(zrzTc);
  2482. //自然幢图层查询开始 ------------------start
  2483. //附属设施图层查询开始 ------------------start
  2484. //var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  2485. fsssTc = new ol.layer.Image({
  2486. source: new ol.source.ImageWMS({
  2487. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2488. params: {
  2489. LAYERS: 'zjd_dc:t_house_survey_fsss',
  2490. TILED: true,
  2491. cql_filter: cql_filter_map,
  2492. SRID: 3857,
  2493. TIMESTAMP: new Date().getTime(),
  2494. },
  2495. }),
  2496. });
  2497. map.addLayer(fsssTc);
  2498. //附属设施图层查询开始 ------------------end
  2499. hc_land_on = new ol.layer.Vector({
  2500. title: "add Layer",
  2501. source: new ol.source.Vector({
  2502. projection: projection,
  2503. features: new ol.format.GeoJSON().readFeatures(that.backTheGeom),
  2504. }),
  2505. style: new ol.style.Style({
  2506. stroke: new ol.style.Stroke({
  2507. //边界样式
  2508. color: "#CCFF66",
  2509. width: 6,
  2510. }),
  2511. }),
  2512. });
  2513. map.addLayer(hc_land_on);
  2514. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  2515. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  2516. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  2517. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  2518. //定位查询位置
  2519. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  2520. that.clickBbox = center;
  2521. console.log(that.mapZjdData);
  2522. that.textMjAll = that.mapZjdData.zdmj;
  2523. map.getView().animate({
  2524. // 只设置需要的属性即可
  2525. center: center, // 中心点
  2526. zoom: 17.9, // 缩放级别
  2527. rotation: undefined, // 缩放完成view视图旋转弧度
  2528. duration: 1000, // 缩放持续时间,默认不需要设置
  2529. resolution: Math.random() * 0.00000001,
  2530. });
  2531. //this.backMap =1;
  2532. } else if (that.backTheGeom != "" && that.backTheGeom != undefined && that.backTheGeom.substring(0, 1) == "[") {
  2533. //that.newHt ="1";
  2534. var zbNew = JSON.stringify({
  2535. "type": "MultiPolygon",
  2536. "coordinates": [that.backTheGeom.replaceAll("\"", "")]
  2537. });
  2538. var leftJoin = zbNew.replace("\"[", "[");
  2539. var rightJoin = leftJoin.replace("\"]", "]");
  2540. hc_land_on = new ol.layer.Vector({
  2541. title: "add Layer",
  2542. source: new ol.source.Vector({
  2543. projection: projection,
  2544. features: new ol.format.GeoJSON().readFeatures("{\n" +
  2545. " \"type\": \"Feature\",\n" +
  2546. " \"geometry\":" + rightJoin + "}"),
  2547. }),
  2548. style: new ol.style.Style({
  2549. fill: new ol.style.Fill({
  2550. //矢量图层填充颜色,以及透明度
  2551. color: "rgba(204, 255, 204,0.3)",
  2552. }),
  2553. stroke: new ol.style.Stroke({
  2554. //边界样式
  2555. color: "#CCFF66",
  2556. width: 3,
  2557. }),
  2558. }),
  2559. });
  2560. map.addLayer(hc_land_on);
  2561. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  2562. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  2563. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  2564. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  2565. //定位查询位置
  2566. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  2567. that.clickBbox = center;
  2568. that.textMjAll = that.mapZjdData.zdmj;
  2569. map.getView().animate({
  2570. // 只设置需要的属性即可
  2571. center: center, // 中心点
  2572. zoom: 16.9, // 缩放级别
  2573. rotation: undefined, // 缩放完成view视图旋转弧度
  2574. duration: 1000, // 缩放持续时间,默认不需要设置
  2575. resolution: Math.random() * 0.00000001,
  2576. });
  2577. //this.backMap =1;
  2578. } else {
  2579. //通过村界大小视图显示
  2580. // let resolution = map.getView().getResolutionForExtent(data.bbox, map.getSize());
  2581. // resolution:resolution + Math.random() * 0.00000001,
  2582. // map.getView().fit(data.bbox);
  2583. // map.getView().setResolution(resolution);
  2584. // //初始视图大小控制
  2585. // map.getView().setZoom(16.0);
  2586. map.getView().animate({
  2587. // 只设置需要的属性即可
  2588. center: data.features[0].geometry.coordinates[0][0][0], // 中心点
  2589. zoom: 15.9, // 缩放级别
  2590. rotation: undefined, // 缩放完成view视图旋转弧度
  2591. duration: 1000, // 缩放持续时间,默认不需要设置
  2592. resolution: Math.random() * 0.00000001,
  2593. });
  2594. }
  2595. })
  2596. .catch((error) => {
  2597. console.log("【异常】", error);
  2598. });
  2599. map.addLayer(zjdTc);
  2600. //宅基地图层查询开始 ------------------start
  2601. var zrzTc;
  2602. // //自然幢图层查询开始 ------------------start
  2603. // var zrzTc = new ol.layer.Image({
  2604. // source: new ol.source.ImageWMS({
  2605. // url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2606. // params: {
  2607. // LAYERS: 'zjd_dc:t_house_survey_zrz',
  2608. // TILED: true,
  2609. // cql_filter: cql_filter,
  2610. // SRID: 3857,
  2611. // TIMESTAMP: new Date().getTime(),
  2612. // },
  2613. // }),
  2614. // });
  2615. // map.addLayer(zrzTc);
  2616. // //自然幢图层查询开始 ------------------start
  2617. //
  2618. var fsssTc;
  2619. // //附属设施图层查询开始 ------------------start
  2620. // var fsssTc = new ol.layer.Image({
  2621. // source: new ol.source.ImageWMS({
  2622. // url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2623. // params: {
  2624. // LAYERS: 'zjd_dc:t_house_survey_fsss',
  2625. // TILED: true,
  2626. // cql_filter: cql_filter,
  2627. // SRID: 3857,
  2628. // TIMESTAMP: new Date().getTime(),
  2629. // },
  2630. // }),
  2631. // });
  2632. // map.addLayer(fsssTc);
  2633. // //附属设施图层查询开始 ------------------start
  2634. //使用geoserver服务查询开始 -------------------end
  2635. // if(this.backMap ==1){
  2636. // var cql = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + this.mapZjdTeAll.mapZjdAData.zjddm + "'";
  2637. // var wmsSourceBack = new ol.source.ImageWMS({
  2638. // crossOrigin: 'anonymous',
  2639. // params: {
  2640. // LAYERS: 'zjd_dc:t_house_survey_all',
  2641. // 'VERSION': '1.1.0',
  2642. // 'FORMAT': "image/png",
  2643. // 'CQL_FILTER': cql
  2644. // },
  2645. // serverType: 'geoserver',
  2646. // url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  2647. // });
  2648. // zjdTc.setSource(wmsSourceBack);
  2649. // ol.view.setResolution(ol.view.getResolution() + Math.random() * 0.00000001);//随机数缩放实现刷新
  2650. // }
  2651. //数据库直接加载数据渲染方式---------------------------------------------------start
  2652. //判断当前账套是否有数据
  2653. // var mapTalkAbout = true;
  2654. // //获取镇界线----start
  2655. // if(this.mapTownList.length >0){
  2656. // for (var i = 0; this.mapTownList.length > i; i++) {
  2657. // if (this.mapTownList[i] != null && this.mapTownList[i].theGeom != null && this.mapTownList[i].theGeom != "") {
  2658. // mapTalkAbout =false;
  2659. // this.mapTownList[i].createBy = 'mapTownList';
  2660. // var theGeomLine= this.mapTownList[i].theGeom.replaceAll("MultiPolygon","LineString");
  2661. // theGeomLine = theGeomLine.replaceAll("[[[[","[[");
  2662. // theGeomLine = theGeomLine.replaceAll("]]]]","]]");
  2663. // hc_land = new ol.layer.Vector({
  2664. // title: "add Layer",
  2665. // source: new ol.source.Vector({
  2666. // projection: projection,
  2667. // features: new ol.format.GeoJSON().readFeatures("{\n" +
  2668. // " \"type\": \"Feature\",\n" +
  2669. // " \"geometry\":" + theGeomLine + ", \"properties\":" + JSON.stringify(this.mapTownList[i]) + "}"),
  2670. // }),
  2671. // style: new ol.style.Style({
  2672. // fill: new ol.style.Fill({
  2673. // //矢量图层填充颜色,以及透明度
  2674. // color: "#AE57A4",
  2675. // }),
  2676. // stroke: new ol.style.Stroke({
  2677. // //边界样式
  2678. // color: "#FF0000",
  2679. // width: 3,
  2680. // }),
  2681. // // text: new ol.style.Text({
  2682. // // text: this.mapTownList[i].xzqmc,
  2683. // // font: '30px sans-serif',
  2684. // // textAlign: "center",
  2685. // // textBaseline: "middle",
  2686. // // //font: 'verdana',
  2687. // // fill: new ol.style.Fill({
  2688. // // color: "#ff0000"
  2689. // // }),
  2690. // // // backgroundFill: new ol.style.Fill({
  2691. // // // color: "#ff0000"
  2692. // // // }),
  2693. // // font: "30px sans-serif",
  2694. // // stroke: new ol.style.Stroke({
  2695. // // color: "#ffffff"
  2696. // // // width: 3
  2697. // // }),
  2698. // // offsetX: parseInt(0, 10),
  2699. // // offsetY: parseInt(0, 10),
  2700. // // placement: "line", //point 则自动计算面的中心k点然后标注 line 则根据面要素的边进行标注
  2701. // // overflow: false //超出面的部分不显示
  2702. // //}),
  2703. // }),
  2704. // });
  2705. // map.addLayer(hc_land);
  2706. // //console.log(hc_land.values_.source.featuresRtree_.rbush_.data);
  2707. // var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX;
  2708. // var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY;
  2709. // var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX;
  2710. // var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY;
  2711. // // //定位查询位置
  2712. // var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  2713. // // console.log(center);
  2714. // map.getView().animate({
  2715. // // 只设置需要的属性即可
  2716. // center: center, // 中心点
  2717. // zoom: 9.8, // 缩放级别
  2718. // rotation: undefined, // 缩放完成view视图旋转弧度
  2719. // duration: 1000, // 缩放持续时间,默认不需要设置
  2720. // });
  2721. // }
  2722. // }
  2723. // }
  2724. // //获取镇界线----end
  2725. // //获取村界线----start
  2726. // if(this.mapVillageList.length >0){
  2727. // for (var i = 0; this.mapVillageList.length > i; i++) {
  2728. // if (this.mapVillageList[i] != null && this.mapVillageList[i].theGeom != null && this.mapVillageList[i].theGeom != "") {
  2729. // mapTalkAbout =false;
  2730. // this.mapVillageList[i].createBy = 'mapVillageList';
  2731. // var theGeomLine= this.mapVillageList[i].theGeom.replaceAll("MultiPolygon","LineString");
  2732. // theGeomLine = theGeomLine.replaceAll("[[[[","[[");
  2733. // theGeomLine = theGeomLine.replaceAll("]]]]","]]");
  2734. // hc_land = new ol.layer.Vector({
  2735. // title: "add Layer",
  2736. // source: new ol.source.Vector({
  2737. // projection: projection,
  2738. // features: new ol.format.GeoJSON().readFeatures("{\n" +
  2739. // " \"type\": \"Feature\",\n" +
  2740. // " \"geometry\":" + theGeomLine + ", \"properties\":" + JSON.stringify(this.mapVillageList[i]) + "}"),
  2741. // }),
  2742. // style: new ol.style.Style({
  2743. // fill: new ol.style.Fill({
  2744. // //矢量图层填充颜色,以及透明度
  2745. // color: "#AE57A4",
  2746. // }),
  2747. // stroke: new ol.style.Stroke({
  2748. // //边界样式
  2749. // color: "#ff00ff",
  2750. // width: 3,
  2751. // }),
  2752. // // text: new ol.style.Text({
  2753. // // text: this.mapVillageList[i].dcmj,
  2754. // // font: '30px sans-serif',
  2755. // // textAlign: "center",
  2756. // // textBaseline: "middle",
  2757. // // //font: 'verdana',
  2758. // // fill: new ol.style.Fill({
  2759. // // color: "#ff00ff"
  2760. // // }),
  2761. // // // backgroundFill: new ol.style.Fill({
  2762. // // // color: "#ff0000"
  2763. // // // }),
  2764. // // font: "30px sans-serif",
  2765. // // stroke: new ol.style.Stroke({
  2766. // // color: "#ffffff"
  2767. // // // width: 3
  2768. // // }),
  2769. // // offsetX: parseInt(0, 10),
  2770. // // offsetY: parseInt(0, 10),
  2771. // // placement: "line", //point 则自动计算面的中心k点然后标注 line 则根据面要素的边进行标注
  2772. // // overflow: false //超出面的部分不显示
  2773. // // }),
  2774. // }),
  2775. // });
  2776. // map.addLayer(hc_land);
  2777. // }
  2778. // }
  2779. // }
  2780. // // //获取村界线----end
  2781. // //宅基地定位开始 ---------start
  2782. // if(this.mapTheGeomZjdId.length >0) {
  2783. // for (var i = 0; this.mapTheGeomZjdId.length > i; i++) {
  2784. // if (this.mapTheGeomZjdId[i] !=null && this.mapTheGeomZjdId[i].theGeom != null && this.mapTheGeomZjdId[i].theGeom != "") {
  2785. // mapTalkAbout =false;
  2786. // this.mapTheGeomZjdId[i].createBy = 'mapTheGeomZjdId';
  2787. // var styleYqr = "";
  2788. // if(this.mapTheGeomZjdId[i].houseDataConfirmStatus == "CONFIRMED"){
  2789. // styleYqr = new ol.style.Style({
  2790. // fill: new ol.style.Fill({
  2791. // //矢量图层填充颜色,以及透明度
  2792. // color: "#AE57A4",
  2793. // }),
  2794. // stroke: new ol.style.Stroke({
  2795. // //边界样式
  2796. // color: "#28FF28",
  2797. // width: 3,
  2798. // }),
  2799. // });
  2800. // } else {
  2801. // styleYqr = new ol.style.Style({
  2802. // fill: new ol.style.Fill({
  2803. // //矢量图层填充颜色,以及透明度
  2804. // color: "#AE57A4",
  2805. // }),
  2806. // stroke: new ol.style.Stroke({
  2807. // //边界样式
  2808. // color: "rgba(255, 45, 45,1)",
  2809. // width: 3,
  2810. // }),
  2811. // });
  2812. // }
  2813. // hc_land = new ol.layer.Vector({
  2814. // title: "add Layer",
  2815. // source: new ol.source.Vector({
  2816. // projection: projection,
  2817. // features: new ol.format.GeoJSON().readFeatures("{\n" +
  2818. // " \"type\": \"Feature\",\n" +
  2819. // " \"geometry\":" + this.mapTheGeomZjdId[i].theGeom + ", \"properties\":" + JSON.stringify(this.mapTheGeomZjdId[i]) + "}"),
  2820. // }),
  2821. // style: styleYqr
  2822. // });
  2823. // map.addLayer(hc_land);
  2824. // // var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX;
  2825. // // var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY;
  2826. // // var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX;
  2827. // // var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY;
  2828. // // //定位查询位置
  2829. // // var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  2830. // // map.getView().animate({
  2831. // // // 只设置需要的属性即可
  2832. // // center: center, // 中心点
  2833. // // zoom: 15.8, // 缩放级别
  2834. // // rotation: undefined, // 缩放完成view视图旋转弧度
  2835. // // duration: 1000, // 缩放持续时间,默认不需要设置
  2836. // // });
  2837. // //自然幢定位开始 ---------start
  2838. // getZrzZjdDmList(this.mapTheGeomZjdId[i].zjddm).then((response) => {
  2839. // if (response.code == 200) {
  2840. // this.mapTheGeomZrzId = response.data;
  2841. // if(this.mapTheGeomZrzId.length >0) {
  2842. // for (var i = 0; this.mapTheGeomZrzId.length > i; i++) {
  2843. // if (this.mapTheGeomZrzId[i] !=null && this.mapTheGeomZrzId[i].theGeom != null && this.mapTheGeomZrzId[i].theGeom != "") {
  2844. // this.mapTheGeomZrzId[i].createBy = 'mapTheGeomZrzId';
  2845. // var styleZrz = "";
  2846. // if(this.mapTheGeomZjdId[i].houseDataConfirmStatus == "CONFIRMED"){
  2847. // styleZrz = new ol.style.Style({
  2848. // fill: new ol.style.Fill({
  2849. // //矢量图层填充颜色,以及透明度
  2850. // color: "#FFD306",
  2851. // }),
  2852. // stroke: new ol.style.Stroke({
  2853. // //边界样式
  2854. // color: "#28FF28",
  2855. // width: 3,
  2856. // }),
  2857. // });
  2858. // } else {
  2859. // styleZrz = new ol.style.Style({
  2860. // fill: new ol.style.Fill({
  2861. // //矢量图层填充颜色,以及透明度
  2862. // color: "#FFD306",
  2863. // }),
  2864. // stroke: new ol.style.Stroke({
  2865. // //边界样式
  2866. // color: "rgba(255, 45, 45,1)",
  2867. // width: 3,
  2868. // }),
  2869. // });
  2870. // }
  2871. // hc_land = new ol.layer.Vector({
  2872. // title: "add Layer",
  2873. // source: new ol.source.Vector({
  2874. // projection: projection,
  2875. // features: new ol.format.GeoJSON().readFeatures("{\n" +
  2876. // " \"type\": \"Feature\",\n" +
  2877. // " \"geometry\":" + this.mapTheGeomZrzId[i].theGeom + ", \"properties\":" + JSON.stringify(this.mapTheGeomZrzId[i]) + "}"),
  2878. // }),
  2879. // style: styleZrz
  2880. // });
  2881. // map.addLayer(hc_land);
  2882. // }
  2883. // }
  2884. // }
  2885. // }
  2886. // });
  2887. // //自然幢定位结束 ---------end
  2888. //
  2889. // //附属设施定位开始 ---------start
  2890. // getFsssZjdDmList(this.mapTheGeomZjdId[i].zjddm).then((response) => {
  2891. // if (response.code == 200) {
  2892. // this.mapTheGeomFsssId = response.data;
  2893. // if(this.mapTheGeomFsssId.length >0) {
  2894. // for (var i = 0; this.mapTheGeomFsssId.length > i; i++) {
  2895. // if (this.mapTheGeomFsssId[i] !=null && this.mapTheGeomFsssId[i].theGeom != null && this.mapTheGeomFsssId[i].theGeom != "") {
  2896. // this.mapTheGeomFsssId[i].createBy = 'mapTheGeomFsssId';
  2897. // var styleFsss = "";
  2898. // if(this.mapTheGeomZjdId[i].houseDataConfirmStatus == "CONFIRMED"){
  2899. // styleFsss = new ol.style.Style({
  2900. // fill: new ol.style.Fill({
  2901. // //矢量图层填充颜色,以及透明度
  2902. // color: "#00FFFF",
  2903. // }),
  2904. // stroke: new ol.style.Stroke({
  2905. // //边界样式
  2906. // color: "#28FF28",
  2907. // width: 3,
  2908. // }),
  2909. // });
  2910. // } else {
  2911. // styleFsss = new ol.style.Style({
  2912. // fill: new ol.style.Fill({
  2913. // //矢量图层填充颜色,以及透明度
  2914. // color: "#00FFFF",
  2915. // }),
  2916. // stroke: new ol.style.Stroke({
  2917. // //边界样式
  2918. // color: "rgba(255, 45, 45,1)",
  2919. // width: 3,
  2920. // }),
  2921. // });
  2922. // }
  2923. // hc_land = new ol.layer.Vector({
  2924. // title: "add Layer",
  2925. // source: new ol.source.Vector({
  2926. // projection: projection,
  2927. // features: new ol.format.GeoJSON().readFeatures("{\n" +
  2928. // " \"type\": \"Feature\",\n" +
  2929. // " \"geometry\":" + this.mapTheGeomFsssId[i].theGeom + ", \"properties\":" + JSON.stringify(this.mapTheGeomFsssId[i]) + "}"),
  2930. // }),
  2931. // style: styleFsss
  2932. // });
  2933. // map.addLayer(hc_land);
  2934. // }
  2935. // }
  2936. // }
  2937. // }
  2938. // });
  2939. // //附属设施定位结束 ---------end
  2940. // }
  2941. // }
  2942. // }
  2943. // //宅基地定位结束 ---------end
  2944. //数据库直接加载数据渲染方式---------------------------------------------------end
  2945. //地图操作定义------------start
  2946. //定位定义------------start
  2947. var Zb;
  2948. var latitude;
  2949. var longitude;
  2950. var vector_drawing;
  2951. //定位定义------------end
  2952. //绘图定义---------------start
  2953. var drawing;
  2954. var draw_map;
  2955. //绘图定义---------------end
  2956. //测面绘图定义------------start
  2957. var draw_cm;
  2958. //定义矢量图层
  2959. var vector;
  2960. //创建一个帮助提示信息对象
  2961. var helpTooltip;
  2962. //创建一个测量提示信息对象
  2963. var measureTooltip;
  2964. //创建一个帮助提示框对象
  2965. var helpTooltipElement;
  2966. //测出距离
  2967. var measureTooltipElement;
  2968. //测面绘图定义-----------end
  2969. //地图操作定义------------end
  2970. //定位当前位置 ------start
  2971. $("#dwMapAll").on("click", function () {
  2972. //删除测量记录操作--------start
  2973. //将矢量图层从图中删除
  2974. //map.removeLayer(helpTooltip);
  2975. map.removeLayer(vector);
  2976. map.removeInteraction(draw_cm);
  2977. //map.removeOverlay(helpTooltipElement);
  2978. //map.removeLayer(measureTooltip);
  2979. //删除测量记录操作--------end
  2980. //删除绘制图层画图操作-------start
  2981. map.removeInteraction(draw_map);
  2982. map.removeLayer(drawing);
  2983. //删除绘制图层画图操作-------end
  2984. //开始定位当前位置
  2985. navigator.geolocation.getCurrentPosition(function(position) {
  2986. latitude = position.coords.latitude;// 获取纬度
  2987. longitude = position.coords.longitude;// 获取经度
  2988. });
  2989. if(latitude !=null && longitude !=null && latitude !="" && longitude !="" && latitude !=undefined && longitude !=undefined ){
  2990. Zb = [longitude,latitude];
  2991. }else {
  2992. Zb =[115.452752, 31.789033];
  2993. }
  2994. //获取坐标点LocationManager
  2995. // geoGps().then(response => {
  2996. //
  2997. // });
  2998. //矢量标注样式设置函数,设置image为图标ol.style.Icon
  2999. function createLabelStyle() {
  3000. return new ol.style.Style({
  3001. image: new ol.style.Icon({
  3002. //设置图标偏移
  3003. anchor: [0.5, 1],
  3004. //标注样式的起点位置
  3005. anchorOrigin: "top-right",
  3006. //X方向单位:分数
  3007. anchorXUnits: "fraction",
  3008. //Y方向单位:像素
  3009. anchorYUnits: "pixels",
  3010. //偏移起点位置的方向
  3011. offsetOrigin: "top-right",
  3012. //透明度
  3013. opacity: 0.9,
  3014. //图片路径
  3015. src: require("../../assets/images/housesteadSurvey/mark.png"),
  3016. }),
  3017. text: new ol.style.Text({
  3018. textAlign: "center", //位置
  3019. textBaseline: "middle", //基准线
  3020. font: "normal 12px 微软雅黑", //文字样式
  3021. //text: "标注点", //文本内容
  3022. fill: new ol.style.Fill({
  3023. //文本填充样式(即文字颜色)
  3024. color: "#ff0000",
  3025. }),
  3026. }),
  3027. zIndex: 9999,
  3028. });
  3029. }
  3030. var newcenterFeature = new ol.Feature({
  3031. geometry: new ol.geom.Point(ol.proj.fromLonLat(Zb)), //几何信息
  3032. name: "标注点",
  3033. });
  3034. var sourceMapLook = new ol.source.Vector({wrapX: false});
  3035. vector_drawing = new ol.layer.Vector({
  3036. source: sourceMapLook,
  3037. });
  3038. map.addLayer(vector_drawing);
  3039. newcenterFeature.setStyle(createLabelStyle()); //设置要素样式
  3040. sourceMapLook.addFeature(newcenterFeature);
  3041. map.getView().animate({
  3042. // 只设置需要的属性即可
  3043. center: ol.proj.fromLonLat(Zb), // 中心点
  3044. zoom: 17.8, // 缩放级别
  3045. rotation: undefined, // 缩放完成view视图旋转弧度
  3046. duration: 1000, // 缩放持续时间,默认不需要设置
  3047. resolution:Math.random() * 0.00000001,
  3048. });
  3049. });
  3050. //定位当前位置 ------end
  3051. //开始绘制图层- -----start
  3052. $("#htMapAll").on("click", function () {
  3053. if(that.drawingClick) {
  3054. that.drawingClick=false;
  3055. //删除之前 测距操作添加map中的绘图 --------start
  3056. //map.removeLayer(helpTooltip);
  3057. map.removeLayer(vector);
  3058. map.removeInteraction(draw_cm);
  3059. //map.removeOverlay(helpTooltipElement);
  3060. map.removeLayer(measureTooltipElement);
  3061. //删除之前 测距操作添加map中的绘图 --------end
  3062. //删除之前画图图层,重新绘制图层
  3063. map.removeInteraction(draw_map);
  3064. map.removeLayer(drawing);
  3065. //var source = new ol.source.Vector({wrapX: false});
  3066. drawing = new ol.layer.Vector({
  3067. source: new ol.source.Vector(),
  3068. });
  3069. map.addLayer(drawing);
  3070. function addInteraction() {
  3071. draw_map = new ol.interaction.Draw({
  3072. source: drawing.getSource(),
  3073. type: "Polygon",
  3074. });
  3075. draw_map.on("drawend", function (evt) {
  3076. var feature = evt.feature;
  3077. var geometry = feature.getGeometry();
  3078. that.coordinate = geometry.getCoordinates();
  3079. //_this.coordinateList = coordinate.toString();
  3080. //提示当前坐标是否绘制完成
  3081. if (that.coordinate != "" && that.coordinate != null) {
  3082. that.showhzht = true;
  3083. that.htZjdZrzFsss = JSON.stringify(that.coordinate);
  3084. console.log(that.mapZjdData);
  3085. // htMapAllFu();
  3086. } else {
  3087. $("#htMapAll").trigger("click");
  3088. }
  3089. });
  3090. map.addInteraction(draw_map);
  3091. }
  3092. function htMapAllFu() {
  3093. //that.drawMapPolygonFun();
  3094. //绘制多边形地图
  3095. that.$dialog
  3096. .confirm({
  3097. title: "提示",
  3098. message: "是否重新绘制画图",
  3099. })
  3100. .then(() => {
  3101. //$("#drawRemove").trigger("click");
  3102. map.removeInteraction(draw_map);
  3103. that.coordinate = "";
  3104. })
  3105. .catch(() => {
  3106. //删除画图点
  3107. map.removeInteraction(draw_map);
  3108. });
  3109. }
  3110. addInteraction();
  3111. } else {
  3112. that.drawingClick=true;
  3113. //删除之前 测距操作添加map中的绘图 --------start
  3114. //map.removeLayer(helpTooltip);
  3115. map.removeLayer(vector);
  3116. map.removeInteraction(draw_cm);
  3117. //map.removeOverlay(helpTooltipElement);
  3118. map.removeLayer(measureTooltipElement);
  3119. //删除之前 测距操作添加map中的绘图 --------end
  3120. //删除之前画图图层,重新绘制图层
  3121. map.removeInteraction(draw_map);
  3122. map.removeLayer(drawing);
  3123. //var source = new ol.source.Vector({wrapX: false});
  3124. }
  3125. });
  3126. //删除之前绘制图层
  3127. $("#deleteHistory").on("click", function () {
  3128. map.removeLayer(drawing);
  3129. that.showhzht = false;
  3130. });
  3131. //开始绘制图层- -----end
  3132. //切换功能删除之前选中状态
  3133. $("#deleteHistoryMap").on("click", function () {
  3134. map.removeLayer(hc_land_on);
  3135. that.mapZjdData = "";
  3136. that.mapZrzData = "";
  3137. that.mapFsssData = "";
  3138. //that.mapZjdTeAll.active ="1";
  3139. that.mapZjdTeAll.mapZjdAData = {};
  3140. that.mapZjdTeAll.mapZrzAData = {};
  3141. that.mapZjdTeAll.mapFsssAData = {};
  3142. that.mapZjdDataTure = "";
  3143. });
  3144. //清除画图鼠标点击事件
  3145. // $("#drawRemove").click(function () {
  3146. // map.removeLayer(drawing);
  3147. // });
  3148. //
  3149. //地图定义
  3150. var delete_map = ["mapZjd", "mapZrz","mapFsss"];
  3151. var hc_land_queryList =[];
  3152. var texiao_layer_zjd;
  3153. var texiao_layer_zrz;
  3154. var texiao_layer_fsss;
  3155. //按照查询条件人名 定位地图-----------------start
  3156. $("#query").on("click", function () {
  3157. //数据库查询数据------------------------------------------------------start
  3158. $("#deleteHistoryMap").trigger("click");
  3159. var val = that.seachText;
  3160. //删除之前查询图层
  3161. for(var i=0;hc_land_queryList.length>i;i++){
  3162. map.removeLayer(hc_land_queryList[i]);
  3163. }
  3164. hc_land_queryList = [];
  3165. that.mapDataAll =[];
  3166. if (val == "") {
  3167. that.$toast('请填写查询条件再查询');
  3168. } else {
  3169. var styleZjd = new ol.style.Style({
  3170. stroke: new ol.style.Stroke({
  3171. //边界样式
  3172. color: "#CCFF66",
  3173. width: 6,
  3174. }),
  3175. });
  3176. let params;
  3177. if(that.mapAddJumpNum == 1){
  3178. params = {
  3179. "deptId" : that.mapAddJump,
  3180. "syqr" : val
  3181. }
  3182. } else {
  3183. params = {
  3184. "deptId" : that.$cookies.get("item").deptId,
  3185. "syqr" : val
  3186. }
  3187. }
  3188. listZjdzd(params).then((response) => {
  3189. if(response.rows.length != 0){
  3190. that.mapDataAll = response.rows;
  3191. for(var hg=0; hg < that.mapDataAll.length; hg++){
  3192. var mapNum = that.mapDataAll[hg].houseDataConfirmStatus;
  3193. if(mapNum == "UNCONFIRMED"){
  3194. that.mapDataAll[hg].paceType = "未核查";
  3195. } else if (mapNum == "CONFIRMED"){
  3196. that.mapDataAll[hg].paceType = "已核查";
  3197. }else{
  3198. }
  3199. that.mapDataAll[hg].typeTc="宅基地";
  3200. if (that.mapDataAll[hg] !=null && that.mapDataAll[hg].theGeom != null && that.mapDataAll[hg].theGeom != "") {
  3201. that.mapDataAll[hg].createBy = 'mapTheGeomZjdId';
  3202. hc_land_queryList[hg] =new ol.layer.Vector({
  3203. title: "add Layer",
  3204. source: new ol.source.Vector({
  3205. projection: projection,
  3206. features: new ol.format.GeoJSON().readFeatures("{\n" +
  3207. " \"type\": \"Feature\",\n" +
  3208. " \"geometry\":" + that.mapDataAll[hg].theGeom + ", \"properties\":" + JSON.stringify(that.mapDataAll[hg]) + "}"),
  3209. }),
  3210. style: styleZjd
  3211. });
  3212. map.addLayer(hc_land_queryList[hg]);
  3213. var maxXMap = hc_land_queryList[hg].values_.source.featuresRtree_.rbush_.data.maxX;
  3214. var maxYMap = hc_land_queryList[hg].values_.source.featuresRtree_.rbush_.data.maxY;
  3215. var minXMap = hc_land_queryList[hg].values_.source.featuresRtree_.rbush_.data.minX;
  3216. var minYMap = hc_land_queryList[hg].values_.source.featuresRtree_.rbush_.data.minY;
  3217. //定位查询位置
  3218. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  3219. map.getView().animate({
  3220. // 只设置需要的属性即可
  3221. center: center, // 中心点
  3222. zoom: 15.8, // 缩放级别
  3223. rotation: undefined, // 缩放完成view视图旋转弧度
  3224. duration: 1000, // 缩放持续时间,默认不需要设置
  3225. resolution:Math.random() * 0.00000001,
  3226. });
  3227. }
  3228. // listFsss(paramsZrz).then((response) => {
  3229. // that.mapDataAll.push(response.rows);
  3230. // });
  3231. }
  3232. // for(var queryFor=0; hc_land_queryList > queryFor; queryFor++ ){
  3233. // map.addLayer(hc_land_queryList[queryFor]);
  3234. // }
  3235. // var mapZrzFor = that.mapDataAll[0].length+1;
  3236. // console.log(mapZrzFor);
  3237. // for(var mapFor=0;mapZrzFor>mapFor;mapFor++){
  3238. // //查询自然幢
  3239. // let paramsZrz = {
  3240. // "deptId" : that.$cookies.get("item").deptId,
  3241. // "zjddm" : that.mapDataAll[0][mapFor].zjddm,
  3242. // "pageSize":20,
  3243. // }
  3244. // listZrz(paramsZrz).then((response) => {
  3245. // console.log(response);
  3246. // that.mapDataAll[0].
  3247. // that.mapDataAll[0].push(response.rows);
  3248. // });
  3249. // }
  3250. setTimeout(function () {
  3251. that.showSearch = true ;
  3252. $('.searchBox').css('display','block')
  3253. var height = $(".searchBar_wrap").outerHeight(true) - $(".searchBar_wrap .van-search").outerHeight(true)
  3254. document.styleSheets[0].insertRule(
  3255. "@keyframes test" +
  3256. "{" +
  3257. "0%{bottom: -" + height + "px;}" +
  3258. "100%{bottom: 0px;}" +
  3259. "}"
  3260. )
  3261. $('.searchBar_wrap').css({'animation':'test 0.5s ease-in-out 0s 1 alternate forwards','-webkit-animation':'test 0.5s ease-in-out 0s 1 alternate forwards'});
  3262. //}
  3263. },500);
  3264. } else {
  3265. that.$toast("暂无数据")
  3266. }
  3267. });
  3268. }
  3269. //数据库查询数据------------------------------------------------------end
  3270. //地图查询------------------------------------------------------------start
  3271. /**
  3272. * @api wfs服务空间查询
  3273. * @param {*} wfsurl
  3274. * @param {*} srsName
  3275. * @param {*} typeName
  3276. * @param {*} drawType
  3277. * @param {option 可选} geometryField
  3278. */
  3279. // var val = that.seachText;
  3280. // if (val == "") {
  3281. // that.$toast('请填写查询条件再查询');
  3282. // } else {
  3283. // //清除之前查询数据
  3284. // that.mapDataAll =[];
  3285. // //分类查询查询农地、农房
  3286. // var difang;
  3287. // //查询条件
  3288. // var cql_filter_cun;
  3289. // var cun = that.$cookies.get("item").deptId;
  3290. // difang = ["zjd_dc:t_house_survey_zjdzd", "zjd_dc:t_house_survey_zrz","zjd_dc:t_house_survey_fsss"];
  3291. // var tach = 0;
  3292. // var once = 0;
  3293. // for (var i = 0; i < difang.length; i++) {
  3294. // map.removeLayer(delete_map[i]);
  3295. // // 数字验证!
  3296. // var reg = /\d/;
  3297. // //验证汉子
  3298. // //var han = /^[\u4e00-\u9fa5]+$/;
  3299. // if (reg.test(val)) {
  3300. // //循环判断查询条件
  3301. // cql_filter_cun = "zjddm='" + val + "'" + "and dept_id='" + cun + "'";
  3302. // } else {
  3303. // //循环判断查询条件
  3304. // if (difang[i] == "zjd_dc:t_house_survey_zjdzd") {
  3305. // cql_filter_cun = "zjddm='" + val + "'" + "and dept_id='" + cun + "'";
  3306. // } else if(difang[i] == "zjd_dc:t_house_survey_zrz") {
  3307. // cql_filter_cun = "zjddm='" + val + "'" + "and dept_id='" + cun + "'";
  3308. // } else if(difang[i] == "zjd_dc:t_house_survey_fsss") {
  3309. // cql_filter_cun = "zjddm='" + val + "'" + "and dept_id='" + cun + "'";
  3310. // }
  3311. // }
  3312. // //for(var i=0; i< difang.length; i++){
  3313. // //cql_filter = "CM='"+cun +"'"+ "and XZQK='待流转待盘活'";
  3314. //
  3315. // //图层加载
  3316. //
  3317. // //业务图层 wms服务
  3318. // delete_map[i] = new ol.layer.Tile({
  3319. // source: new ol.source.TileWMS({
  3320. // url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
  3321. // params: {
  3322. // LAYERS: difang[i],
  3323. // //'LAYERS': 'new_shp:new_shp_all',
  3324. // TILED: true,
  3325. // cql_filter: cql_filter_cun,
  3326. // SRID: 3857,
  3327. // },
  3328. // }),
  3329. // });
  3330. //
  3331. // //}
  3332. // //定位查询位置
  3333. // let param_dw = {
  3334. // srsName: "EPSG:3857",
  3335. // service: "WFS",
  3336. // version: "1.0.0",
  3337. // request: "GetFeature",
  3338. // typename: difang[i],
  3339. // //featureNS: 'nsgk_hc',//命名空间 URI
  3340. // cql_filter: cql_filter_cun,
  3341. // //featurePrefix: 'nationalwater',//工作区名称
  3342. // //featureTypes: ['nationalwater:01fir'],//查询图层,可以是同一个工作区下多个图层,逗号隔开
  3343. // outputFormat: "application/json",
  3344. // //filter: ol.format.filter.equalTo(t,e,r)//前者是属性名,后者是对应值
  3345. // };
  3346. // let url_dw = that.mapGeoServerUrl+"/geoserver/zjd_dc/wfs"; //wfsurl;
  3347. // url_dw = url_dw + "?";
  3348. // for (let key in param_dw) {
  3349. // url_dw = url_dw + key + "=" + param_dw[key] + "&";
  3350. // }
  3351. // url_dw = url_dw.substr(0, url_dw.length - 1);
  3352. // fetch(url_dw, {
  3353. // method: "POST", // *GET, POST, PUT, DELETE, etc.
  3354. // })
  3355. // .then((res) => {
  3356. // var geojsonmap = res.json();
  3357. // return geojsonmap;
  3358. // })
  3359. // .then((data) => {
  3360. // tach = tach + 1;
  3361. // if (data.features != null && data.features != "") {
  3362. // for(var i=0; data.features.length >i; i++) {
  3363. // //特效动画实现 -----------------------------start
  3364. // console.log(tach,"++++++++++++++++++",once)
  3365. // var datamap = data.features[0].bbox;
  3366. // if (tach == 1 && once == 0) {
  3367. // console.log("zrz")
  3368. // texiao_layer_zjd = new ol.layer.Vector({
  3369. // source: new ol.source.Vector(),
  3370. // });
  3371. // map.addLayer(texiao_layer_zjd);
  3372. // var center = ol.extent.getCenter(datamap); //获取边界区域的中心位置
  3373. // var circle = new ol.Feature({
  3374. // geometry: new ol.geom.Point(center), //ol.proj.transform([104, 30], 'EPSG:4326', 'EPSG:3857') //投影坐标转为地理坐标
  3375. // });
  3376. //
  3377. // circle.setStyle(
  3378. // new ol.style.Style({
  3379. // image: new ol.style.Circle({
  3380. // radius: 0,
  3381. // stroke: new ol.style.Stroke({
  3382. // color: "yellow",
  3383. // size: 1,
  3384. // }),
  3385. // }),
  3386. // })
  3387. // );
  3388. // texiao_layer_zjd.getSource().addFeature(circle);
  3389. //
  3390. // // 关键的地方在此:监听postcompose事件,在里面重新设置circle的样式
  3391. // var radius = 0;
  3392. // map.on("postcompose", function () {
  3393. // // 增大半径,最大20
  3394. // radius++;
  3395. // radius = radius % 10;
  3396. // // 设置样式
  3397. // circle.setStyle(
  3398. // new ol.style.Style({
  3399. // image: new ol.style.Circle({
  3400. // radius: radius,
  3401. // stroke: new ol.style.Stroke({
  3402. // color: "yellow",
  3403. // size: 1,
  3404. // }),
  3405. // }),
  3406. // })
  3407. // );
  3408. // });
  3409. // } else if(tach == 2) {
  3410. // console.log("zrz")
  3411. // texiao_layer_zrz = new ol.layer.Vector({
  3412. // source: new ol.source.Vector(),
  3413. // });
  3414. // map.addLayer(texiao_layer_zrz);
  3415. // var center = ol.extent.getCenter(datamap); //获取边界区域的中心位置
  3416. // var circle = new ol.Feature({
  3417. // geometry: new ol.geom.Point(center), //ol.proj.transform([104, 30], 'EPSG:4326', 'EPSG:3857') //投影坐标转为地理坐标
  3418. // });
  3419. //
  3420. // circle.setStyle(
  3421. // new ol.style.Style({
  3422. // image: new ol.style.Circle({
  3423. // radius: 0,
  3424. // stroke: new ol.style.Stroke({
  3425. // color: "yellow",
  3426. // size: 1,
  3427. // }),
  3428. // }),
  3429. // })
  3430. // );
  3431. // texiao_layer_zrz.getSource().addFeature(circle);
  3432. //
  3433. // // 关键的地方在此:监听postcompose事件,在里面重新设置circle的样式
  3434. // var radius = 0;
  3435. // map.on("postcompose", function () {
  3436. // // 增大半径,最大20
  3437. // radius++;
  3438. // radius = radius % 10;
  3439. // // 设置样式
  3440. // circle.setStyle(
  3441. // new ol.style.Style({
  3442. // image: new ol.style.Circle({
  3443. // radius: radius,
  3444. // stroke: new ol.style.Stroke({
  3445. // color: "yellow",
  3446. // size: 1,
  3447. // }),
  3448. // }),
  3449. // })
  3450. // );
  3451. // });
  3452. // } else {
  3453. // console.log("fsss")
  3454. // texiao_layer_fsss = new ol.layer.Vector({
  3455. // source: new ol.source.Vector(),
  3456. // });
  3457. // map.addLayer(texiao_layer_fsss);
  3458. // var center = ol.extent.getCenter(datamap); //获取边界区域的中心位置
  3459. // var circle = new ol.Feature({
  3460. // geometry: new ol.geom.Point(center), //ol.proj.transform([104, 30], 'EPSG:4326', 'EPSG:3857') //投影坐标转为地理坐标
  3461. // });
  3462. //
  3463. // circle.setStyle(
  3464. // new ol.style.Style({
  3465. // image: new ol.style.Circle({
  3466. // radius: 0,
  3467. // stroke: new ol.style.Stroke({
  3468. // color: "yellow",
  3469. // size: 1,
  3470. // }),
  3471. // }),
  3472. // })
  3473. // );
  3474. // texiao_layer_fsss.getSource().addFeature(circle);
  3475. //
  3476. // // 关键的地方在此:监听postcompose事件,在里面重新设置circle的样式
  3477. // var radius = 0;
  3478. // map.on("postcompose", function () {
  3479. // // 增大半径,最大20
  3480. // radius++;
  3481. // radius = radius % 10;
  3482. // // 设置样式
  3483. // circle.setStyle(
  3484. // new ol.style.Style({
  3485. // image: new ol.style.Circle({
  3486. // radius: radius,
  3487. // stroke: new ol.style.Stroke({
  3488. // color: "yellow",
  3489. // size: 1,
  3490. // }),
  3491. // }),
  3492. // })
  3493. // );
  3494. // });
  3495. // }
  3496. // //特效动画实现 -----------------------------end
  3497. // that.mapDataAll.push(JSON.parse(JSON.stringify(data.features[i].properties)));
  3498. // }
  3499. // //定位实现
  3500. // let resolution = map.getView().getResolutionForExtent(data.bbox, map.getSize());
  3501. // map.getView().fit(data.bbox);
  3502. // map.getView().setResolution(resolution);
  3503. // console.log(that.mapDataAll);
  3504. // } else if (tach == 1) {
  3505. // once = once + 1;
  3506. // } else {
  3507. // if (once == 1 && tach == 3) {
  3508. // that.$toast("没有找到相关人员信息");
  3509. // //that.showSearch = false ;
  3510. // }else {
  3511. //
  3512. // }
  3513. // }
  3514. // })
  3515. // .catch((error) => {
  3516. // console.log("【异常】", error);
  3517. // });
  3518. // map.addLayer(delete_map[i]);
  3519. // }
  3520. //地图查询------------------------------------------------------------end
  3521. });
  3522. //按照查询 定位地图-----------------end
  3523. //筛选附属设施-----------------------------------start
  3524. $("#fsssSx").click(function () {
  3525. if(!that.fsssSx){
  3526. map.addLayer(fsssTc);
  3527. }else {
  3528. map.removeLayer(fsssTc);
  3529. }
  3530. });
  3531. $("#zrzSx").click(function () {
  3532. if(!that.zrzSx){
  3533. map.addLayer(zrzTc);
  3534. }else {
  3535. map.removeLayer(zrzTc);
  3536. }
  3537. });
  3538. $("#zjdSx").click(function () {
  3539. if(!that.zjdSx){
  3540. map.addLayer(zjdTc);
  3541. }else {
  3542. map.removeLayer(zjdTc);
  3543. }
  3544. });
  3545. $("#checkAll").click(function () {
  3546. if(!that.fsssSx && !that.zjdSx && !that.zrzSx){
  3547. map.addLayer(zjdTc);
  3548. map.addLayer(zrzTc);
  3549. map.addLayer(fsssTc);
  3550. }else {
  3551. map.removeLayer(zrzTc);
  3552. map.removeLayer(zjdTc);
  3553. map.removeLayer(fsssTc);
  3554. }
  3555. });
  3556. //筛选附属设施-----------------------------------end
  3557. // //获取类型开始 侧面-----------------------------------------------------------------start
  3558. //样式加载定义
  3559. var vector_drawing_delete;
  3560. $("#area").click(function () {
  3561. console.log(that.textMjAll);
  3562. console.log(that.clickBbox);
  3563. if(that.textMjAll ==null || that.textMjAll ==""){
  3564. that.textMjAll =0;
  3565. }
  3566. if((that.textMjAll != "" && that.clickBbox !="") || (that.textMjAll == 0 && that.clickBbox !="")){
  3567. map.removeLayer(vector_drawing_delete);
  3568. function createLabelStyle() {
  3569. return new ol.style.Style({
  3570. text: new ol.style.Text({
  3571. text: that.textMjAll+"㎡",
  3572. textAlign: "center", //位置
  3573. textBaseline: "middle", //基准线
  3574. font: "normal 12px 微软雅黑", //文字样式
  3575. //text: "标注点", //文本内容
  3576. fill: new ol.style.Fill({
  3577. //文本填充样式(即文字颜色)
  3578. color: "#FFFFFF",
  3579. width: 10,
  3580. }),
  3581. overflow: false //超出面的部分不显示
  3582. }),
  3583. zIndex: 9999,
  3584. });
  3585. }
  3586. var newcenterFeature = new ol.Feature({
  3587. geometry: new ol.geom.Point(that.clickBbox), //几何信息
  3588. //name: "标注点",
  3589. });
  3590. var sourceMapLook = new ol.source.Vector({wrapX: false});
  3591. vector_drawing_delete = new ol.layer.Vector({
  3592. source: sourceMapLook,
  3593. });
  3594. map.addLayer(vector_drawing_delete);
  3595. newcenterFeature.setStyle(createLabelStyle()); //设置要素样式
  3596. sourceMapLook.addFeature(newcenterFeature);
  3597. //map.addLayer(styleFsss);
  3598. } else if(that.textMjAllNum == "1"){
  3599. that.$toast("该图层面积暂无信息");
  3600. } else {
  3601. that.$toast("选择图层进行面积显示");
  3602. }
  3603. });
  3604. // $("#area").click(function () {
  3605. // console.log("进入测面")
  3606. // //删除绘制图层画图操作-------start
  3607. // map.removeInteraction(draw_map);
  3608. // map.removeLayer(drawing);
  3609. // //删除绘制图层画图操作-------end
  3610. // //开始绘制 测面--------------------------------------------------------------start
  3611. // //定义矢量数据源
  3612. // var source = new ol.source.Vector();
  3613. //
  3614. // vector = new ol.layer.Vector({
  3615. // source: source,
  3616. // style: new ol.style.Style({
  3617. // fill: new ol.style.Fill({
  3618. // color: "rgba(255,255,255,0.2)",
  3619. // }),
  3620. // stroke: new ol.style.Stroke({
  3621. // color: "#e21e0a",
  3622. // width: 2,
  3623. // }),
  3624. // //image: new ol.style.Circle({
  3625. // // radius: 7,
  3626. // // fill: new ol.style.Fill({
  3627. // // color:'#ffcc33'
  3628. // // })
  3629. // //})
  3630. // }),
  3631. // });
  3632. //
  3633. // //将矢量图层添加到地图中 线的颜色加入map中
  3634. // map.addLayer(vector);
  3635. //
  3636. // var sketch;
  3637. //
  3638. // var continuePolygonMsg = "单击以继续绘制多边形";
  3639. //
  3640. // /**
  3641. // * Message to show when the user is drawing a line.
  3642. // * @type {string}
  3643. // */
  3644. // //var continueLineMsg = '单击继续绘制直线';
  3645. //
  3646. // //鼠标移动触发的函数
  3647. // var pointerMoveHandler = function (evt) {
  3648. // //Indicates if the map is currently being dragged.
  3649. // //Only set for POINTERDRAG and POINTERMOVE events. Default is false.
  3650. // //如果是平移地图则直接结束
  3651. // if (evt.dragging) {
  3652. // return;
  3653. // }
  3654. // //帮助提示信息
  3655. // var helpMsg = "单击开始绘图";
  3656. //
  3657. // if (sketch) {
  3658. // //Get the feature's default geometry.
  3659. // //A feature may have any number of named geometries.
  3660. // //获取绘图对象的几何要素
  3661. // var geom = sketch.getGeometry();
  3662. // //如果当前绘制的几何要素是多边形,则将绘制提示信息设置为多边形绘制提示信息
  3663. // //如果当前绘制的几何要素是多线段,则将绘制提示信息设置为多线段绘制提示信息
  3664. // helpMsg = continuePolygonMsg;
  3665. // }
  3666. // //设置帮助提示要素的内标签为帮助提示信息
  3667. // helpTooltipElement.innerHTML = helpMsg;
  3668. // //设置帮助提示信息的位置
  3669. // //The coordinate in view projection corresponding to the original browser event.
  3670. // helpTooltip.setPosition(evt.coordinate);
  3671. // //移除帮助提示要素的隐藏样式
  3672. // $(helpTooltipElement).removeClass("hidden");
  3673. // };
  3674. //
  3675. // map.on("pointermove", pointerMoveHandler);
  3676. //
  3677. // map.getViewport().addEventListener("mouseout", function () {
  3678. // helpTooltipElement.classList.add("hidden");
  3679. // });
  3680. //
  3681. // //添加交互式绘图对象的函数
  3682. // function addInteraction() {
  3683. // // 获取当前选择的绘制类型
  3684. // //var type = typeSelect.value == 'length' ? 'Polygon' : 'LineString';
  3685. // //创建一个交互式绘图对象
  3686. // var type = "Polygon";
  3687. // draw_cm = new ol.interaction.Draw({
  3688. // //绘制的数据源
  3689. // source: source,
  3690. // //绘制类型
  3691. // type: type,
  3692. // //样式
  3693. // style: new ol.style.Style({
  3694. // fill: new ol.style.Fill({
  3695. // color: "rgba(255,255,255,0.2)",
  3696. // }),
  3697. // stroke: new ol.style.Stroke({
  3698. // color: "rgba(0,0,0,0.5)",
  3699. // lineDash: [10, 10],
  3700. // width: 2,
  3701. // }),
  3702. // // image: new ol.style.Circle({
  3703. // // radius: 5,
  3704. // // stroke: new ol.style.Stroke({
  3705. // // color:'rgba(0,0,0,0.7)'
  3706. // // }),
  3707. // // fill: new ol.style.Fill({
  3708. // //color: 'rgba(255,255,255,0.2)'
  3709. // // })
  3710. // //})
  3711. // }),
  3712. // });
  3713. // //将交互绘图对象添加到地图中
  3714. // map.addInteraction(draw_cm);
  3715. //
  3716. // //创建测量提示框
  3717. // createMeasureTooltip();
  3718. // //创建帮助提示框
  3719. // createHelpTooltip();
  3720. //
  3721. // //定义一个事件监听
  3722. // var listener;
  3723. // //定义一个控制鼠标点击次数的变量
  3724. // var count = 0;
  3725. // //绘制开始事件
  3726. // draw_cm.on(
  3727. // "drawstart",
  3728. // function (evt) {
  3729. // //The feature being drawn.
  3730. // sketch = evt.feature;
  3731. // //提示框的坐标
  3732. // var tooltipCoord = evt.coordinate;
  3733. // //监听几何要素的change事件
  3734. // //Increases the revision counter and dispatches a 'change' event.
  3735. //
  3736. // listener = sketch.getGeometry().on("change", function (evt) {
  3737. // //The event target.
  3738. // //获取绘制的几何对象
  3739. // var geom = evt.target;
  3740. // //定义一个输出对象,用于记录面积和长度
  3741. // var output;
  3742. // map.removeEventListener("singleclick");
  3743. // map.removeEventListener("dblclick");
  3744. // //输出多边形的面积
  3745. // output = formatArea(geom);
  3746. // //Return an interior point of the polygon.
  3747. // //获取多变形内部点的坐标
  3748. // tooltipCoord = geom.getInteriorPoint().getCoordinates();
  3749. //
  3750. // //设置测量提示框的内标签为最终输出结果
  3751. // measureTooltipElement.innerHTML = output;
  3752. // //设置测量提示信息的位置坐标
  3753. // measureTooltip.setPosition(tooltipCoord);
  3754. // });
  3755. //
  3756. // //地图单击事件
  3757. // map.on("singleclick", function (evt) {
  3758. // //设置测量提示信息的位置坐标,用来确定鼠标点击后测量提示框的位置
  3759. // measureTooltip.setPosition(evt.coordinate);
  3760. // //如果是第一次点击,则设置测量提示框的文本内容为起点
  3761. // if (count == 0) {
  3762. // measureTooltipElement.innerHTML = "起点";
  3763. // }
  3764. // //根据鼠标点击位置生成一个点
  3765. // var point = new ol.geom.Point(evt.coordinate);
  3766. // //将该点要素添加到矢量数据源中
  3767. // source.addFeature(new ol.Feature(point));
  3768. // //更改测量提示框的样式,使测量提示框可见
  3769. // measureTooltipElement.className = "tooltip tooltip-static";
  3770. // //创建测量提示框
  3771. // createMeasureTooltip();
  3772. // //点击次数增加
  3773. // count++;
  3774. // });
  3775. //
  3776. // //地图双击事件
  3777. // map.on("dblclick", function (evt) {
  3778. // //根据
  3779. // var point = new ol.geom.Point(evt.coordinate);
  3780. // source.addFeature(new ol.Feature(point));
  3781. // });
  3782. // },
  3783. // this
  3784. // );
  3785. // //绘制结束事件
  3786. // draw_cm.on(
  3787. // "drawend",
  3788. // function (evt) {
  3789. // count = 0;
  3790. // //设置测量提示框的样式
  3791. // measureTooltipElement.className = "tooltip tooltip-static";
  3792. // //Set the offset for this overlay.
  3793. // //设置偏移量
  3794. // measureTooltip.setOffset([0, -7]);
  3795. // //清空绘制要素
  3796. // sketch = null;
  3797. // //清空测量提示要素
  3798. // measureTooltipElement = null;
  3799. // //创建测量提示框
  3800. // createMeasureTooltip();
  3801. // //Removes an event listener using the key returned by on() or once().
  3802. // //移除事件监听
  3803. // ol.Observable.unByKey(listener);
  3804. // //移除地图单击事件
  3805. // map.removeEventListener("singleclick");
  3806. // },
  3807. // this
  3808. // );
  3809. // }
  3810. // /**
  3811. // * Creates a new help tooltip
  3812. // */
  3813. // function createHelpTooltip() {
  3814. // if (helpTooltipElement) {
  3815. // helpTooltipElement.parentNode.removeChild(helpTooltipElement);
  3816. // }
  3817. // helpTooltipElement = document.createElement("div");
  3818. // helpTooltipElement.className = "ol-tooltip hidden";
  3819. // helpTooltip = new ol.Overlay({
  3820. // element: helpTooltipElement,
  3821. // offset: [15, 0],
  3822. // positioning: "center-left",
  3823. // });
  3824. // map.addOverlay(helpTooltip);
  3825. // }
  3826. //
  3827. // /**
  3828. // * Creates a new measure tooltip
  3829. // */
  3830. // function createMeasureTooltip() {
  3831. // if (measureTooltipElement) {
  3832. // measureTooltipElement.parentNode.removeChild(measureTooltipElement);
  3833. // }
  3834. // measureTooltipElement = document.createElement("div");
  3835. // measureTooltipElement.className = "ol-tooltip ol-tooltip-measure";
  3836. // measureTooltip = new ol.Overlay({
  3837. // element: measureTooltipElement,
  3838. // offset: [0, -15],
  3839. // positioning: "bottom-center",
  3840. // });
  3841. // map.addOverlay(measureTooltip);
  3842. // }
  3843. //
  3844. // //格式化测量面积
  3845. // var formatArea = function (polygon) {
  3846. // //定义面积变量
  3847. // var area;
  3848. // //获取平面面积
  3849. // area = polygon.getArea();
  3850. // //定义输出变量
  3851. // var output;
  3852. // //当面积大于10000时,转换为平方千米,否则为平方米
  3853. // if (area > 10000) {
  3854. // output =
  3855. // Math.round((area / 1000000) * 100) / 100 + " " + "km<sup>2</sup>";
  3856. // } else {
  3857. // output = Math.round(area * 100) / 100 + " " + "m<sup>2</sup>";
  3858. // }
  3859. // return output;
  3860. // };
  3861. //
  3862. // addInteraction();
  3863. // });
  3864. // //侧面结束-----------------------------------------------------------------end
  3865. //全图展示-----------------start
  3866. $("#mapAllQt").click(function (){
  3867. //定位查询位置
  3868. let param_dw = {
  3869. srsName: "EPSG:3857",
  3870. service: "WFS",
  3871. version: "1.0.0",
  3872. request: "GetFeature",
  3873. typename: "zjd_dc:t_house_survey_border_village",
  3874. //featureNS: 'nsgk_hc',//命名空间 URI
  3875. cql_filter: cql_filter,
  3876. //featurePrefix: 'nationalwater',//工作区名称
  3877. //featureTypes: ['nationalwater:01fir'],//查询图层,可以是同一个工作区下多个图层,逗号隔开
  3878. outputFormat: "application/json",
  3879. //filter: ol.format.filter.equalTo(t,e,r)//前者是属性名,后者是对应值
  3880. };
  3881. let url_dw = that.mapGeoServerUrl+"/geoserver/zjd_dc/wfs"; //wfsurl;
  3882. url_dw = url_dw + "?";
  3883. for (let key in param_dw) {
  3884. url_dw = url_dw + key + "=" + param_dw[key] + "&";
  3885. }
  3886. url_dw = url_dw.substr(0, url_dw.length - 1);
  3887. fetch(url_dw, {
  3888. method: "POST", // *GET, POST, PUT, DELETE, etc.
  3889. })
  3890. .then((res) => {
  3891. var geojsonmap = res.json();
  3892. return geojsonmap;
  3893. })
  3894. .then((data) => {
  3895. let resolution = map.getView().getResolutionForExtent(data.bbox,map.getSize());
  3896. resolution:resolution + Math.random() * 0.00000001,
  3897. map.getView().fit(data.bbox);
  3898. map.getView().setResolution(resolution);
  3899. // var datamap = data.bbox;
  3900. // var center = ol.extent.getCenter(datamap);
  3901. // map.getView().animate({
  3902. // // 只设置需要的属性即可
  3903. // center: center, // 中心点
  3904. // rotation: undefined, // 缩放完成view视图旋转弧度
  3905. // });
  3906. })
  3907. .catch((error) => {
  3908. console.log("【异常】", error);
  3909. });
  3910. });
  3911. //业务图层 wfs服务 属性查询开始 ------------------start
  3912. /**
  3913. * @api wfs服务空间查询
  3914. * @param {*} wfsurl
  3915. * @param {*} srsName
  3916. * @param {*} typeName
  3917. * @param {*} drawType
  3918. * @param {option 可选} geometryField
  3919. */
  3920. //查询全部图层 -------查询叠加图层出现覆盖问题
  3921. var wmsSource = new ol.source.TileWMS({
  3922. url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
  3923. params: {
  3924. LAYERS: "zjd_dc:t_house_survey_all",
  3925. TILED: true,
  3926. SRID: 3857,
  3927. serverType: "geoserver",
  3928. crossOrigin: "anonymous",
  3929. },
  3930. resolution:Math.random() * 0.00000001,
  3931. });
  3932. //查询宅基地图层
  3933. var ZjdwmsSource = new ol.source.TileWMS({
  3934. url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
  3935. params: {
  3936. LAYERS: "zjd_dc:t_house_survey_zjdzd",
  3937. TILED: true,
  3938. SRID: 3857,
  3939. serverType: "geoserver",
  3940. crossOrigin: "anonymous",
  3941. },
  3942. resolution:Math.random() * 0.00000001,
  3943. });
  3944. //查询自然幢图层
  3945. var ZrzwmsSource = new ol.source.TileWMS({
  3946. url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
  3947. params: {
  3948. LAYERS: "zjd_dc:t_house_survey_zrz",
  3949. TILED: true,
  3950. SRID: 3857,
  3951. serverType: "geoserver",
  3952. crossOrigin: "anonymous",
  3953. },
  3954. resolution:Math.random() * 0.00000001,
  3955. });
  3956. //查询附属设施图层
  3957. var FssswmsSource = new ol.source.TileWMS({
  3958. url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
  3959. params: {
  3960. LAYERS: "zjd_dc:t_house_survey_fsss",
  3961. TILED: true,
  3962. SRID: 3857,
  3963. serverType: "geoserver",
  3964. crossOrigin: "anonymous",
  3965. },
  3966. resolution:Math.random() * 0.00000001,
  3967. });
  3968. map.on("pointermove", function (evt) {
  3969. if (evt.dragging) {
  3970. return;
  3971. }
  3972. var pixel = map.getEventPixel(evt.originalEvent);
  3973. var hit = map.forEachLayerAtPixel(pixel, function () {
  3974. return true;
  3975. });
  3976. map.getTargetElement().style.cursor = hit ? "pointer" : "";
  3977. });
  3978. //属性查询结束 ------------------end
  3979. //点击查询详细信息
  3980. map.on("singleclick", function (evt) {
  3981. console.log(evt);
  3982. let feature = map.forEachFeatureAtPixel(
  3983. evt.pixel,
  3984. (feature) => feature
  3985. );
  3986. var viewResolution = map.getView().getResolution(); ///** @type {number} */ (view.getResolution());
  3987. var zb = evt.coordinate;
  3988. var url;
  3989. var url_bbox;
  3990. that.clickBbox ="";
  3991. that.textMjAll = "";
  3992. if(that.drawingClick) {
  3993. //点击空白删除之前图层
  3994. map.removeLayer(hc_land_on);
  3995. //map.removeLayer(hc_land_query);
  3996. //for(var i=0;hc_land_query>i;i++){
  3997. //map.removeLayer(hc_land_query);
  3998. for(var i=0;hc_land_queryList.length>i;i++){
  3999. map.removeLayer(hc_land_queryList[i]);
  4000. }
  4001. //}c
  4002. if (that.fsssSx && that.zjdSx && that.zrzSx) {
  4003. url = wmsSource.getFeatureInfoUrl(
  4004. evt.coordinate,
  4005. viewResolution,
  4006. "EPSG:3857",
  4007. {INFO_FORMAT: "text/html"}
  4008. );
  4009. url_bbox = wmsSource.getFeatureInfoUrl(
  4010. evt.coordinate,
  4011. viewResolution,
  4012. "EPSG:3857",
  4013. {INFO_FORMAT: "application/json"}
  4014. );
  4015. } else {
  4016. if (that.zjdSx) {
  4017. url = ZjdwmsSource.getFeatureInfoUrl(
  4018. evt.coordinate,
  4019. viewResolution,
  4020. "EPSG:3857",
  4021. {INFO_FORMAT: "text/html"}
  4022. );
  4023. url_bbox = ZjdwmsSource.getFeatureInfoUrl(
  4024. evt.coordinate,
  4025. viewResolution,
  4026. "EPSG:3857",
  4027. {INFO_FORMAT: "application/json"}
  4028. );
  4029. } else if (that.fsssSx) {
  4030. url = FssswmsSource.getFeatureInfoUrl(
  4031. evt.coordinate,
  4032. viewResolution,
  4033. "EPSG:3857",
  4034. {INFO_FORMAT: "text/html"}
  4035. );
  4036. url_bbox = FssswmsSource.getFeatureInfoUrl(
  4037. evt.coordinate,
  4038. viewResolution,
  4039. "EPSG:3857",
  4040. {INFO_FORMAT: "application/json"}
  4041. );
  4042. } else if (that.zrzSx) {
  4043. url = ZrzwmsSource.getFeatureInfoUrl(
  4044. evt.coordinate,
  4045. viewResolution,
  4046. "EPSG:3857",
  4047. {INFO_FORMAT: "text/html"}
  4048. );
  4049. url_bbox = ZrzwmsSource.getFeatureInfoUrl(
  4050. evt.coordinate,
  4051. viewResolution,
  4052. "EPSG:3857",
  4053. {INFO_FORMAT: "application/json"}
  4054. );
  4055. } else {
  4056. url = wmsSource.getFeatureInfoUrl(
  4057. evt.coordinate,
  4058. viewResolution,
  4059. "EPSG:3857",
  4060. {INFO_FORMAT: "text/html"}
  4061. );
  4062. url_bbox = wmsSource.getFeatureInfoUrl(
  4063. evt.coordinate,
  4064. viewResolution,
  4065. "EPSG:3857",
  4066. {INFO_FORMAT: "application/json"}
  4067. );
  4068. }
  4069. }
  4070. if (url_bbox) {
  4071. fetch(url_bbox).then((res) => {
  4072. var geojsonmap = res.json();
  4073. return geojsonmap;
  4074. })
  4075. .then((data) => {
  4076. var center = ol.extent.getCenter(data.bbox); //获取边界区域的中心位置
  4077. center = [center[0], center[1] - 16];
  4078. that.clickBbox = center;
  4079. })
  4080. .catch((error) => {
  4081. that.mapZjdData = "";
  4082. that.mapZrzData = "";
  4083. that.mapFsssData = "";
  4084. //that.mapZjdTeAll.active ="1";
  4085. that.mapZjdTeAll.mapZjdAData = {};
  4086. that.mapZjdTeAll.mapZrzAData = {};
  4087. that.mapZjdTeAll.mapFsssAData = {};
  4088. that.mapZjdDataTure = "";
  4089. that.mapXs =false;
  4090. that.mapClick ="";
  4091. console.log("【异常】", error);
  4092. });
  4093. }
  4094. if (url) {
  4095. fetch(url)
  4096. .then(function (response) {
  4097. return response.text();
  4098. })
  4099. .then(function (html) {
  4100. document.getElementById("info").innerHTML = html;
  4101. if (html.indexOf("<table") != -1) {
  4102. that.mapZjdData = "";
  4103. that.mapZrzData = "";
  4104. that.mapFsssData = "";
  4105. //that.mapZjdTeAll.active ="1";
  4106. that.mapZjdTeAll.mapZjdAData = {};
  4107. that.mapZjdTeAll.mapZrzAData = {};
  4108. that.mapZjdTeAll.mapFsssAData = {};
  4109. that.mapZjdDataTure = "";
  4110. setTimeout(() => {
  4111. if ($("#info .featureInfo .featureInfo").text() == "t_house_survey_zjdzd") {
  4112. map.removeLayer(hc_land_on);
  4113. that.mapHasDateStatus = 2;
  4114. that.mapXs = true;
  4115. let obj = {};
  4116. let trs = $("#info .featureInfo").find("tr:eq(1)");
  4117. let zjdXq = trs.find("td").eq(0).text();
  4118. let zjdIdNum = zjdXq.replace("t_house_survey_zjdzd.", "");
  4119. obj.id = zjdIdNum; // 主键id
  4120. obj.deptName = trs.find("td").eq(3).text();//行政区划名称
  4121. obj.zjddm = trs.find("td").eq(6).text();//宅基地代码
  4122. obj.zdmj = trs.find("td").eq(11).text();//宗地面积
  4123. obj.active = 1;
  4124. var vector_drawing_map;
  4125. let params = {
  4126. "deptId": that.$cookies.get("item").deptId,
  4127. "zjddm": obj.zjddm,
  4128. }
  4129. that.mapClick = obj.zjddm;
  4130. //点击查看自然幢
  4131. //自然幢图层查询开始 ------------------start
  4132. var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  4133. zrzTc = new ol.layer.Image({
  4134. source: new ol.source.ImageWMS({
  4135. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  4136. params: {
  4137. LAYERS: 'zjd_dc:t_house_survey_zrz',
  4138. TILED: true,
  4139. cql_filter: cql_filter_map,
  4140. SRID: 3857,
  4141. TIMESTAMP: new Date().getTime(),
  4142. },
  4143. }),
  4144. });
  4145. map.addLayer(zrzTc);
  4146. //自然幢图层查询开始 ------------------start
  4147. //附属设施图层查询开始 ------------------start
  4148. //var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  4149. fsssTc = new ol.layer.Image({
  4150. source: new ol.source.ImageWMS({
  4151. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  4152. params: {
  4153. LAYERS: 'zjd_dc:t_house_survey_fsss',
  4154. TILED: true,
  4155. cql_filter: cql_filter_map,
  4156. SRID: 3857,
  4157. TIMESTAMP: new Date().getTime(),
  4158. },
  4159. }),
  4160. });
  4161. map.addLayer(fsssTc);
  4162. //附属设施图层查询开始 ------------------end
  4163. that.$cookies.set("search", "")
  4164. //that.$cookies.set("map", "")
  4165. console.log(document.cookie.split(';').length)
  4166. console.log(params);
  4167. listZjdzd(params).then((response) => {
  4168. if (response.rows[0].zdmj != "") {
  4169. that.textMjAll = response.rows[0].zdmj;
  4170. } else {
  4171. that.textMjAllNum = "1";
  4172. }
  4173. that.mapZjdData = response.rows[0];
  4174. that.mapZjdData.active = 1;
  4175. that.mapZjdTeAll.mapZjdAData = that.mapZjdData;
  4176. that.mapZjdDataTure = 1;
  4177. that.zjdHcDy = obj.zjddm;
  4178. var styleZjd = new ol.style.Style({
  4179. stroke: new ol.style.Stroke({
  4180. //边界样式
  4181. color: "#CCFF66",
  4182. width: 6,
  4183. }),
  4184. });
  4185. hc_land_on = new ol.layer.Vector({
  4186. title: "add Layer",
  4187. source: new ol.source.Vector({
  4188. projection: projection,
  4189. features: new ol.format.GeoJSON().readFeatures("{\n" +
  4190. " \"type\": \"Feature\",\n" +
  4191. " \"geometry\":" + that.mapZjdData.theGeom + ", \"properties\":" + JSON.stringify(that.mapZjdData) + "}"),
  4192. }),
  4193. style: styleZjd
  4194. });
  4195. map.addLayer(hc_land_on);
  4196. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  4197. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  4198. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  4199. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  4200. //定位查询位置
  4201. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  4202. map.getView().animate({
  4203. // 只设置需要的属性即可
  4204. center: center, // 中心点
  4205. zoom: 17.8, // 缩放级别
  4206. rotation: undefined, // 缩放完成view视图旋转弧度
  4207. duration: 1000, // 缩放持续时间,默认不需要设置
  4208. resolution:Math.random() * 0.00000001,
  4209. });
  4210. function createLabelStyleMap() {
  4211. return new ol.style.Style({
  4212. text: new ol.style.Text({
  4213. text: that.mapZjdData.syqr,
  4214. textAlign: "center", //位置
  4215. textBaseline: "middle", //基准线
  4216. font: "normal 16px 微软雅黑", //文字样式
  4217. //text: "标注点", //文本内容
  4218. fill: new ol.style.Fill({
  4219. //文本填充样式(即文字颜色)
  4220. color: "#09DDCE",
  4221. width: 10,
  4222. }),
  4223. overflow: false //超出面的部分不显示
  4224. }),
  4225. zIndex: 9999,
  4226. });
  4227. }
  4228. var newcenterFeatureMap = new ol.Feature({
  4229. geometry: new ol.geom.Point(center), //几何信息
  4230. //name: "标注点",
  4231. });
  4232. var sourceMapLookMap = new ol.source.Vector({wrapX: false});
  4233. vector_drawing_map = new ol.layer.Vector({
  4234. source: sourceMapLookMap,
  4235. });
  4236. map.addLayer(vector_drawing_map);
  4237. newcenterFeatureMap.setStyle(createLabelStyleMap()); //设置要素样式
  4238. sourceMapLookMap.addFeature(newcenterFeatureMap);
  4239. });
  4240. //let cloneObj = JSON.parse(JSON.stringify(obj));
  4241. //that.mapZjdData = cloneObj;
  4242. } else if ($("#info .featureInfo .featureInfo").text() == "t_house_survey_zrz") {
  4243. //that.mapZjdTeAll.mapZjdAData ={};
  4244. that.mapZjdDataTure = "";
  4245. that.mapZjdTeAll.mapFsssAData = {};
  4246. map.removeLayer(hc_land_on);
  4247. let obj = {};
  4248. that.mapHasDateStatus = 1;
  4249. let trs = $("#info .featureInfo").find("tr:eq(1)");
  4250. let zrzXq = trs.find("td").eq(0).text();
  4251. let zrzIdNum = zrzXq.replace("t_house_survey_zrz.", "");
  4252. obj.id = zrzIdNum; // 主键id
  4253. obj.deptName = trs.find("td").eq(3).text();//行政区划名称
  4254. obj.zjddm = trs.find("td").eq(4).text();//宅基地代码
  4255. obj.scjzmj = trs.find("td").eq(12).text();//实测建筑面积
  4256. let params = {
  4257. "deptId": that.$cookies.get("item").deptId,
  4258. "zjddm": obj.zjddm,
  4259. }
  4260. that.$cookies.set("search", "")
  4261. //that.$cookies.set("map", "")
  4262. console.log(that.mapZjdData);
  4263. //if (that.mapZjdData !="" && that.mapZjdData !=null && that.mapZjdData !=undefined) {
  4264. console.log(that.mapClick);
  4265. console.log(obj.zjddm);
  4266. if(that.mapXs && that.mapClick == obj.zjddm){
  4267. listZjdzd(params).then((response) => {
  4268. that.mapZjdData = response.rows[0];
  4269. //that.mapZjdAData.active = 1;
  4270. that.mapZjdTeAll.mapZjdAData = that.mapZjdData;
  4271. getZrz(obj.id).then((response) => {
  4272. if (response.data.scjzmj != "") {
  4273. that.textMjAll = response.data.scjzmj;
  4274. } else {
  4275. that.textMjAllNum = "1";
  4276. }
  4277. that.mapZrzData = response.data;
  4278. that.mapZrzData.active = 3;
  4279. that.mapZjdTeAll.mapZrzAData = that.mapZrzData;
  4280. that.zjdHcDy = obj.zjddm;
  4281. var styleZjd = new ol.style.Style({
  4282. stroke: new ol.style.Stroke({
  4283. //边界样式
  4284. color: "#CCFF66",
  4285. width: 6,
  4286. }),
  4287. });
  4288. hc_land_on = new ol.layer.Vector({
  4289. title: "add Layer",
  4290. source: new ol.source.Vector({
  4291. projection: projection,
  4292. features: new ol.format.GeoJSON().readFeatures("{\n" +
  4293. " \"type\": \"Feature\",\n" +
  4294. " \"geometry\":" + that.mapZrzData.theGeom + ", \"properties\":" + JSON.stringify(that.mapZrzData) + "}"),
  4295. }),
  4296. style: styleZjd
  4297. });
  4298. map.addLayer(hc_land_on);
  4299. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  4300. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  4301. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  4302. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  4303. //定位查询位置
  4304. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  4305. map.getView().animate({
  4306. // 只设置需要的属性即可
  4307. center: center, // 中心点
  4308. zoom: 17.8, // 缩放级别
  4309. rotation: undefined, // 缩放完成view视图旋转弧度
  4310. duration: 1000, // 缩放持续时间,默认不需要设置
  4311. resolution: Math.random() * 0.00000001,
  4312. });
  4313. });
  4314. });
  4315. } else {
  4316. //自然幢图层查询开始 ------------------start
  4317. var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  4318. zrzTc = new ol.layer.Image({
  4319. source: new ol.source.ImageWMS({
  4320. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  4321. params: {
  4322. LAYERS: 'zjd_dc:t_house_survey_zrz',
  4323. TILED: true,
  4324. cql_filter: cql_filter_map,
  4325. SRID: 3857,
  4326. TIMESTAMP: new Date().getTime(),
  4327. },
  4328. }),
  4329. });
  4330. map.addLayer(zrzTc);
  4331. //自然幢图层查询开始 ------------------start
  4332. //附属设施图层查询开始 ------------------start
  4333. //var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  4334. fsssTc = new ol.layer.Image({
  4335. source: new ol.source.ImageWMS({
  4336. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  4337. params: {
  4338. LAYERS: 'zjd_dc:t_house_survey_fsss',
  4339. TILED: true,
  4340. cql_filter: cql_filter_map,
  4341. SRID: 3857,
  4342. TIMESTAMP: new Date().getTime(),
  4343. },
  4344. }),
  4345. });
  4346. map.addLayer(fsssTc);
  4347. //附属设施图层查询开始 ------------------end
  4348. listZjdzd(params).then((response) => {
  4349. if (response.rows[0].zdmj != "") {
  4350. that.textMjAll = response.rows[0].zdmj;
  4351. } else {
  4352. that.textMjAllNum = "1";
  4353. }
  4354. that.mapZjdData = response.rows[0];
  4355. that.mapZjdData.active = 1;
  4356. that.mapZjdTeAll.mapZjdAData = that.mapZjdData;
  4357. that.mapZjdDataTure = 1;
  4358. that.zjdHcDy = obj.zjddm;
  4359. that.mapClick = obj.zjddm;
  4360. that.mapXs = true;
  4361. var styleZjd = new ol.style.Style({
  4362. stroke: new ol.style.Stroke({
  4363. //边界样式
  4364. color: "#CCFF66",
  4365. width: 6,
  4366. }),
  4367. });
  4368. hc_land_on = new ol.layer.Vector({
  4369. title: "add Layer",
  4370. source: new ol.source.Vector({
  4371. projection: projection,
  4372. features: new ol.format.GeoJSON().readFeatures("{\n" +
  4373. " \"type\": \"Feature\",\n" +
  4374. " \"geometry\":" + that.mapZjdData.theGeom + ", \"properties\":" + JSON.stringify(that.mapZjdData) + "}"),
  4375. }),
  4376. style: styleZjd
  4377. });
  4378. map.addLayer(hc_land_on);
  4379. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  4380. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  4381. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  4382. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  4383. //定位查询位置
  4384. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  4385. map.getView().animate({
  4386. // 只设置需要的属性即可
  4387. center: center, // 中心点
  4388. zoom: 17.8, // 缩放级别
  4389. rotation: undefined, // 缩放完成view视图旋转弧度
  4390. duration: 1000, // 缩放持续时间,默认不需要设置
  4391. resolution:Math.random() * 0.00000001,
  4392. });
  4393. function createLabelStyleMap() {
  4394. return new ol.style.Style({
  4395. text: new ol.style.Text({
  4396. text: that.mapZjdData.syqr,
  4397. textAlign: "center", //位置
  4398. textBaseline: "middle", //基准线
  4399. font: "normal 16px 微软雅黑", //文字样式
  4400. //text: "标注点", //文本内容
  4401. fill: new ol.style.Fill({
  4402. //文本填充样式(即文字颜色)
  4403. color: "#09DDCE",
  4404. width: 10,
  4405. }),
  4406. overflow: false //超出面的部分不显示
  4407. }),
  4408. zIndex: 9999,
  4409. });
  4410. }
  4411. var newcenterFeatureMap = new ol.Feature({
  4412. geometry: new ol.geom.Point(center), //几何信息
  4413. //name: "标注点",
  4414. });
  4415. var sourceMapLookMap = new ol.source.Vector({wrapX: false});
  4416. vector_drawing_map = new ol.layer.Vector({
  4417. source: sourceMapLookMap,
  4418. });
  4419. map.addLayer(vector_drawing_map);
  4420. newcenterFeatureMap.setStyle(createLabelStyleMap()); //设置要素样式
  4421. sourceMapLookMap.addFeature(newcenterFeatureMap);
  4422. });
  4423. }
  4424. } else if ($("#info .featureInfo .featureInfo").text() == "t_house_survey_fsss") {
  4425. that.mapZjdTeAll.mapZrzAData = {};
  4426. that.mapZjdDataTure = "";
  4427. //that.mapZjdTeAll.mapZjdAData ={};
  4428. map.removeLayer(hc_land_on);
  4429. let obj = {};
  4430. that.mapHasDateStatus = 0;
  4431. let trs = $("#info .featureInfo").find("tr:eq(1)");
  4432. let fsssXq = trs.find("td").eq(0).text();
  4433. let fsssIdNum = fsssXq.replace("t_house_survey_fsss.", "");
  4434. obj.id = fsssIdNum; // 主键id
  4435. obj.deptName = trs.find("td").eq(4).text();//行政区划名称
  4436. obj.zjddm = trs.find("td").eq(1).text();//宅基地代码
  4437. // obj.houseDataConfirmStatus = trs.find("td").eq(6).text(); //状态
  4438. // obj.fssslx = trs.find("td").eq(7).text(); //附属设施类型
  4439. obj.jzmj = trs.find("td").eq(8).text(); //建筑面积
  4440. let params = {
  4441. "deptId": that.$cookies.get("item").deptId,
  4442. "zjddm": obj.zjddm,
  4443. "pageSize": 20,
  4444. }
  4445. that.$cookies.remove("search")
  4446. //if (that.mapZjdData !="" && that.mapZjdData !=null && that.mapZjdData !=undefined) {
  4447. if(that.mapXs && that.mapClick == obj.zjddm){
  4448. listZjdzd(params).then((response) => {
  4449. that.mapZjdData = response.rows[0];
  4450. that.mapZjdData.active = 1;
  4451. that.mapZjdTeAll.mapZjdAData = that.mapZjdData;
  4452. getFsss(obj.id).then((response) => {
  4453. if (response.data.jzmj != "") {
  4454. that.textMjAll = response.data.jzmj;
  4455. } else {
  4456. that.textMjAllNum = "1";
  4457. }
  4458. //that.mapfsssData.active = 4;
  4459. that.mapfsssData = response.data;
  4460. console.log(that.mapfsssData);
  4461. that.mapZjdTeAll.mapFsssAData = that.mapfsssData;
  4462. that.zjdHcDy = obj.zjddm;
  4463. var styleZjd = new ol.style.Style({
  4464. stroke: new ol.style.Stroke({
  4465. //边界样式
  4466. color: "#CCFF66",
  4467. width: 6,
  4468. }),
  4469. });
  4470. hc_land_on = new ol.layer.Vector({
  4471. title: "add Layer",
  4472. source: new ol.source.Vector({
  4473. projection: projection,
  4474. features: new ol.format.GeoJSON().readFeatures("{\n" +
  4475. " \"type\": \"Feature\",\n" +
  4476. " \"geometry\":" + that.mapfsssData.theGeom + ", \"properties\":" + JSON.stringify(that.mapfsssData) + "}"),
  4477. }),
  4478. style: styleZjd
  4479. });
  4480. map.addLayer(hc_land_on);
  4481. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  4482. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  4483. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  4484. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  4485. //定位查询位置
  4486. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  4487. map.getView().animate({
  4488. // 只设置需要的属性即可
  4489. center: center, // 中心点
  4490. zoom: 17.8, // 缩放级别
  4491. rotation: undefined, // 缩放完成view视图旋转弧度
  4492. duration: 1000, // 缩放持续时间,默认不需要设置
  4493. resolution: Math.random() * 0.00000001,
  4494. });
  4495. });
  4496. });
  4497. } else {
  4498. //自然幢图层查询开始 ------------------start
  4499. var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  4500. zrzTc = new ol.layer.Image({
  4501. source: new ol.source.ImageWMS({
  4502. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  4503. params: {
  4504. LAYERS: 'zjd_dc:t_house_survey_zrz',
  4505. TILED: true,
  4506. cql_filter: cql_filter_map,
  4507. SRID: 3857,
  4508. TIMESTAMP: new Date().getTime(),
  4509. },
  4510. }),
  4511. });
  4512. map.addLayer(zrzTc);
  4513. //自然幢图层查询开始 ------------------start
  4514. //附属设施图层查询开始 ------------------start
  4515. //var cql_filter_map = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + obj.zjddm + "'";
  4516. fsssTc = new ol.layer.Image({
  4517. source: new ol.source.ImageWMS({
  4518. url: that.mapGeoServerUrl + "/geoserver/zjd_dc/wms",
  4519. params: {
  4520. LAYERS: 'zjd_dc:t_house_survey_fsss',
  4521. TILED: true,
  4522. cql_filter: cql_filter_map,
  4523. SRID: 3857,
  4524. TIMESTAMP: new Date().getTime(),
  4525. },
  4526. }),
  4527. });
  4528. map.addLayer(fsssTc);
  4529. //附属设施图层查询开始 ------------------end
  4530. listZjdzd(params).then((response) => {
  4531. if (response.rows[0].zdmj != "") {
  4532. that.textMjAll = response.rows[0].zdmj;
  4533. } else {
  4534. that.textMjAllNum = "1";
  4535. }
  4536. that.mapZjdData = response.rows[0];
  4537. that.mapZjdData.active = 1;
  4538. that.mapZjdTeAll.mapZjdAData = that.mapZjdData;
  4539. that.mapZjdDataTure = 1;
  4540. that.zjdHcDy = obj.zjddm;
  4541. that.mapClick = obj.zjddm;
  4542. that.mapXs = true;
  4543. var styleZjd = new ol.style.Style({
  4544. stroke: new ol.style.Stroke({
  4545. //边界样式
  4546. color: "#CCFF66",
  4547. width: 6,
  4548. }),
  4549. });
  4550. hc_land_on = new ol.layer.Vector({
  4551. title: "add Layer",
  4552. source: new ol.source.Vector({
  4553. projection: projection,
  4554. features: new ol.format.GeoJSON().readFeatures("{\n" +
  4555. " \"type\": \"Feature\",\n" +
  4556. " \"geometry\":" + that.mapZjdData.theGeom + ", \"properties\":" + JSON.stringify(that.mapZjdData) + "}"),
  4557. }),
  4558. style: styleZjd
  4559. });
  4560. map.addLayer(hc_land_on);
  4561. var maxXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxX;
  4562. var maxYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.maxY;
  4563. var minXMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minX;
  4564. var minYMap = hc_land_on.values_.source.featuresRtree_.rbush_.data.minY;
  4565. //定位查询位置
  4566. var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置
  4567. map.getView().animate({
  4568. // 只设置需要的属性即可
  4569. center: center, // 中心点
  4570. zoom: 17.8, // 缩放级别
  4571. rotation: undefined, // 缩放完成view视图旋转弧度
  4572. duration: 1000, // 缩放持续时间,默认不需要设置
  4573. resolution:Math.random() * 0.00000001,
  4574. });
  4575. function createLabelStyleMap() {
  4576. return new ol.style.Style({
  4577. text: new ol.style.Text({
  4578. text: that.mapZjdData.syqr,
  4579. textAlign: "center", //位置
  4580. textBaseline: "middle", //基准线
  4581. font: "normal 16px 微软雅黑", //文字样式
  4582. //text: "标注点", //文本内容
  4583. fill: new ol.style.Fill({
  4584. //文本填充样式(即文字颜色)
  4585. color: "#09DDCE",
  4586. width: 10,
  4587. }),
  4588. overflow: false //超出面的部分不显示
  4589. }),
  4590. zIndex: 9999,
  4591. });
  4592. }
  4593. var newcenterFeatureMap = new ol.Feature({
  4594. geometry: new ol.geom.Point(center), //几何信息
  4595. //name: "标注点",
  4596. });
  4597. var sourceMapLookMap = new ol.source.Vector({wrapX: false});
  4598. vector_drawing_map = new ol.layer.Vector({
  4599. source: sourceMapLookMap,
  4600. });
  4601. map.addLayer(vector_drawing_map);
  4602. newcenterFeatureMap.setStyle(createLabelStyleMap()); //设置要素样式
  4603. sourceMapLookMap.addFeature(newcenterFeatureMap);
  4604. });
  4605. }
  4606. // if(obj.jzmj != ""){
  4607. // that.textMjAll = obj.jzmj;
  4608. // } else {
  4609. // that.textMjAllNum = "1";
  4610. // }
  4611. } else {
  4612. }
  4613. }, 300);
  4614. } else {
  4615. }
  4616. });
  4617. }
  4618. }
  4619. //数据库查询详情时使用----------------------------------------start
  4620. // if(feature) {
  4621. // //document.getElementById("info").innerHTML = "";
  4622. // that.mapHaDataValue = true;
  4623. // var ifConsole = feature.values_.createBy;
  4624. // if (ifConsole =="mapTheGeomFsssId") {
  4625. // let obj = {};
  4626. // that.mapHasDateStatus = 0;
  4627. // obj.deptName = feature.values_.deptName;//行政区划名称
  4628. // obj.zjddm = feature.values_.zjddm;//宅基地代码
  4629. // obj.houseDataConfirmStatus = feature.values_.houseDataConfirmStatus; //状态
  4630. // obj.fssslx = feature.values_.fssslx; //附属设施类型
  4631. // obj.jzmj = feature.values_.jzmj; //建筑面积
  4632. // obj.qsly = feature.values_.qsly;//权属来源
  4633. // obj.fwzt = feature.values_.fwzt; //房屋状态
  4634. // obj.sfsp = feature.values_.sfsp; //是否审批
  4635. // obj.sffz = feature.values_.sffz; //是否发证
  4636. // obj.jglx = feature.values_.jglx; //结构类型
  4637. // obj.sfzzsy = feature.values_.sfzzsy; //是否正在使用
  4638. // obj.jzwqk = feature.values_.jzwqk; //建筑物情况
  4639. // obj.tdzk = feature.values_.tdzk; //审批或建设前土地状况
  4640. // obj.sfsgcf = feature.values_.sfsgcf; //是否受过处罚
  4641. // obj.sysNormalDisable = feature.values_.sysNormalDisable; //是否停用
  4642. // //附属设施类型字典项
  4643. // that.getDicts("fsss_type").then((response) => {
  4644. // var assetTypeOptions = response.data;
  4645. // if(obj.fssslx !=null && obj.fssslx !=""){
  4646. // for(var i=0;assetTypeOptions.length >i; i++){
  4647. // if(obj.fssslx == assetTypeOptions[i].dictValue) {
  4648. // obj.fssslx = assetTypeOptions[i].dictLabel;
  4649. // break;
  4650. // }
  4651. // }
  4652. // }
  4653. // });
  4654. // //权属类型字典项
  4655. // that.getDicts("acquisition_method").then((response) => {
  4656. // var assetTypeOptions = response.data;
  4657. // if(obj.qsly !=null && obj.qsly !=""){
  4658. // for(var i=0;assetTypeOptions.length >i; i++){
  4659. // if(obj.qsly == assetTypeOptions[i].dictValue) {
  4660. // obj.qsly = assetTypeOptions[i].dictLabel;
  4661. // break;
  4662. // }
  4663. // }
  4664. // }
  4665. // });
  4666. // //房屋状态字典项
  4667. // that.getDicts("fwzt").then((response) => {
  4668. // var assetTypeOptions = response.data;
  4669. // if(obj.fwzt !=null && obj.fwzt !=""){
  4670. // for(var i=0;assetTypeOptions.length >i; i++){
  4671. // if(obj.fwzt == assetTypeOptions[i].dictValue) {
  4672. // obj.fwzt = assetTypeOptions[i].dictLabel;
  4673. // break;
  4674. // }
  4675. // }
  4676. // }
  4677. // });
  4678. // //是否审批字典项
  4679. // that.getDicts("sys_yes_no").then((response) => {
  4680. // var assetTypeOptions = response.data;
  4681. // if(obj.sfsp !=null && obj.sfsp !=""){
  4682. // for(var i=0;assetTypeOptions.length >i; i++){
  4683. // if(obj.sfsp == assetTypeOptions[i].dictValue) {
  4684. // obj.sfsp = assetTypeOptions[i].dictLabel;
  4685. // break;
  4686. // }
  4687. // }
  4688. // }
  4689. // });
  4690. // //是否发证字典项
  4691. // that.getDicts("sys_yes_no").then((response) => {
  4692. // var assetTypeOptions = response.data;
  4693. // if(obj.sffz !=null && obj.sffz !=""){
  4694. // for(var i=0;assetTypeOptions.length >i; i++){
  4695. // if(obj.sffz == assetTypeOptions[i].dictValue) {
  4696. // obj.sffz = assetTypeOptions[i].dictLabel;
  4697. // break;
  4698. // }
  4699. // }
  4700. // }
  4701. // });
  4702. // //结构类型字典项
  4703. // that.getDicts("house_jglx").then((response) => {
  4704. // var assetTypeOptions = response.data;
  4705. // if(obj.jglx !=null && obj.jglx !=""){
  4706. // for(var i=0;assetTypeOptions.length >i; i++){
  4707. // if(obj.jglx == assetTypeOptions[i].dictValue) {
  4708. // obj.jglx = assetTypeOptions[i].dictLabel;
  4709. // break;
  4710. // }
  4711. // }
  4712. // }
  4713. // });
  4714. // //是否正在使用字典项
  4715. // that.getDicts("sys_yes_no").then((response) => {
  4716. // var assetTypeOptions = response.data;
  4717. // if(obj.sfzzsy !=null && obj.sfzzsy !=""){
  4718. // for(var i=0;assetTypeOptions.length >i; i++){
  4719. // if(obj.sfzzsy == assetTypeOptions[i].dictValue) {
  4720. // obj.sfzzsy = assetTypeOptions[i].dictLabel;
  4721. // break;
  4722. // }
  4723. // }
  4724. // }
  4725. // });
  4726. // //房屋状态字典项
  4727. // that.getDicts("fwzt").then((response) => {
  4728. // var assetTypeOptions = response.data;
  4729. // if(obj.fwzt !=null && obj.fwzt !=""){
  4730. // for(var i=0;assetTypeOptions.length >i; i++){
  4731. // if(obj.fwzt == assetTypeOptions[i].dictValue) {
  4732. // obj.fwzt = assetTypeOptions[i].dictLabel;
  4733. // break;
  4734. // }
  4735. // }
  4736. // }
  4737. // });
  4738. // //土地状况字典项
  4739. // that.getDicts("land_state").then((response) => {
  4740. // var assetTypeOptions = response.data;
  4741. // if(obj.tdzk !=null && obj.tdzk !=""){
  4742. // for(var i=0;assetTypeOptions.length >i; i++){
  4743. // if(obj.tdzk == assetTypeOptions[i].dictValue) {
  4744. // obj.tdzk = assetTypeOptions[i].dictLabel;
  4745. // break;
  4746. // }
  4747. // }
  4748. // }
  4749. // });
  4750. // //是否受过处罚字典项
  4751. // that.getDicts("land_state").then((response) => {
  4752. // var assetTypeOptions = response.data;
  4753. // if(obj.sfsgcf !=null && obj.sfsgcf !=""){
  4754. // for(var i=0;assetTypeOptions.length >i; i++){
  4755. // if(obj.sfsgcf == assetTypeOptions[i].dictValue) {
  4756. // obj.sfsgcf = assetTypeOptions[i].dictLabel;
  4757. // break;
  4758. // }
  4759. // }
  4760. // }
  4761. // });
  4762. // that.mapFsssData = obj;
  4763. // } else if(ifConsole =="mapTheGeomZrzId"){
  4764. // let obj = {};
  4765. // that.mapHasDateStatus = 1;
  4766. // obj.deptName = feature.values_.deptName;//部门名称
  4767. // obj.zjddm = feature.values_.zjddm;//宅基地代码
  4768. // obj.nmfwzh = feature.values_.nmfwzh;//农民房屋幢号
  4769. // obj.zrzh = feature.values_.zrzh;//自然幢号
  4770. // obj.jgrq = feature.values_.jgrq;//竣工日期
  4771. // obj.jzwgd = feature.values_.jzwgd;//建筑物高度
  4772. // obj.zzdmj = feature.values_.zzdmj;//幢占地面积
  4773. // obj.zydmj = feature.values_.zydmj;//幢用地面积
  4774. // obj.scjzmj = feature.values_.scjzmj;//实测建筑面积
  4775. // obj.zcs = feature.values_.zcs;//总层数
  4776. // obj.dscs = feature.values_.dscs;//地上层数
  4777. // obj.dxcs = feature.values_.dxcs;//地下层数
  4778. // obj.fwjg = feature.values_.fwjg;//房屋结构
  4779. // obj.sjly = feature.values_.sjly;//数据来源
  4780. // obj.status = feature.values_.status;//状态
  4781. // obj.houseDataConfirmStatus = feature.values_.houseDataConfirmStatus;//数据调查确认状态
  4782. // //字典项转化
  4783. // //房屋结构字典项
  4784. // that.getDicts("housing_structure").then((response) => {
  4785. // var assetTypeOptions = response.data;
  4786. // if(obj.fwjg !=null && obj.fwjg !=""){
  4787. // for(var i=0;assetTypeOptions.length >i; i++){
  4788. // if(obj.fwjg == assetTypeOptions[i].dictValue) {
  4789. // obj.fwjg = assetTypeOptions[i].dictLabel;
  4790. // break;
  4791. // }
  4792. // }
  4793. // }
  4794. // });
  4795. // //房屋结构字典项
  4796. // that.getDicts("sjly").then((response) => {
  4797. // var assetTypeOptions = response.data;
  4798. // if(obj.sjly !=null && obj.sjly !=""){
  4799. // for(var i=0;assetTypeOptions.length >i; i++){
  4800. // if(obj.sjly == assetTypeOptions[i].dictValue) {
  4801. // obj.sjly = assetTypeOptions[i].dictLabel;
  4802. // break;
  4803. // }
  4804. // }
  4805. // }
  4806. // });
  4807. // that.mapZrzData = obj;
  4808. // } else if(ifConsole =="mapTheGeomZjdId"){
  4809. // let obj = {};
  4810. // that.mapHasDateStatus = 2;
  4811. // obj.deptName = feature.values_.deptName;//行政区划名称
  4812. // obj.suyqrdm = feature.values_.suyqrdm;//所有权人代码
  4813. // obj.nhdm = feature.values_.nhdm;//农户代码
  4814. // obj.zjddm = feature.values_.zjddm;//宅基地代码
  4815. // obj.zdbh = feature.values_.zdbh;//宗地编号
  4816. // obj.zddm = feature.values_.zddm;//宗地代码
  4817. // obj.zl = feature.values_.zl;//坐落
  4818. // obj.zldwdm = feature.values_.zldwdm;//坐落单位代码
  4819. // obj.zdmj = feature.values_.zdmj;//宗地面积
  4820. // obj.yt = feature.values_.yt;//用途
  4821. // obj.ytmc = feature.values_.ytmc;//用途名称
  4822. // obj.dj = feature.values_.dj;//宗地编号
  4823. // obj.jg = feature.values_.jg;//价格万元
  4824. // obj.qllx = feature.values_.qllx;//权利类型
  4825. // obj.qlxz = feature.values_.qlxz;//权利性质
  4826. // obj.qlsdfs = feature.values_.qlsdfs;//权利设定方式
  4827. // obj.rjl = feature.values_.rjl;//容积率
  4828. // obj.jzmd = feature.values_.jzmd;//建筑密度
  4829. // obj.jzxg = feature.values_.jzxg;//建筑限高
  4830. // obj.zdszd = feature.values_.zdszd;//宗地四至-东
  4831. // obj.zdszn = feature.values_.zdszn;//宗地四至-南
  4832. // obj.zdszx = feature.values_.zdszx;//宗地四至-西
  4833. // obj.zdszb = feature.values_.zdszb;//宗地四至-北
  4834. // obj.zdt = feature.values_.zdt;//宗地图
  4835. // obj.tfh = feature.values_.tfh;//图幅号
  4836. // obj.djh = feature.values_.djh;//地籍号
  4837. // obj.sjly = feature.values_.sjly;//数据来源
  4838. // obj.lyzk = feature.values_.lyzk;//当前利用状况
  4839. // obj.xzkssj = feature.values_.xzkssj;//闲置开始时间
  4840. // obj.sffz = feature.values_.sffz;//是否发证
  4841. // obj.zjdzsh = feature.values_.zjdzsh;//宅基地证书号
  4842. // obj.zjdxctp = feature.values_.zjdxctp;//宅基地现场图片
  4843. // obj.zjdqdfs = feature.values_.zjdqdfs;//宅基地取得方式
  4844. // obj.bccjl = feature.values_.bccjl;//被惩处经历
  4845. // obj.bccbz = feature.values_.bccbz;//被惩处备注
  4846. // obj.yctcyx = feature.values_.yctcyx;//有偿退出意向
  4847. // obj.zjdpzmj = feature.values_.zjdpzmj;//宅基地批准面积
  4848. // obj.zjdxzyy = feature.values_.zjdxzyy;//宅基地闲置原因
  4849. // obj.lzyx = feature.values_.lzyx;//流转意向
  4850. // obj.sysNormalDisable = feature.values_.sysNormalDisable;//是否停用
  4851. // obj.active = 1;
  4852. // //字典项转化
  4853. // //是否发证字典项
  4854. // that.getDicts("sys_yes_no").then((response) => {
  4855. // var assetTypeOptions = response.data;
  4856. // if(obj.sffz !=null && obj.sffz !=""){
  4857. // for(var i=0;assetTypeOptions.length >i; i++){
  4858. // if(obj.sffz == assetTypeOptions[i].dictValue) {
  4859. // obj.sffz = assetTypeOptions[i].dictLabel;
  4860. // break;
  4861. // }
  4862. // }
  4863. // }
  4864. // });
  4865. // //利用状态字典项
  4866. // that.getDicts("zjdlyzk").then((response) => {
  4867. // var assetTypeOptions = response.data;
  4868. // if(obj.lyzk !=null && obj.lyzk !=""){
  4869. // for(var i=0;assetTypeOptions.length >i; i++){
  4870. // if(obj.lyzk == assetTypeOptions[i].dictValue) {
  4871. // obj.lyzk = assetTypeOptions[i].dictLabel;
  4872. // break;
  4873. // }
  4874. // }
  4875. // }
  4876. // });
  4877. // //流转意向字典项
  4878. // that.getDicts("is_have").then((response) => {
  4879. // var assetTypeOptions = response.data;
  4880. // if(obj.lzyx !=null && obj.lzyx !=""){
  4881. // for(var i=0;assetTypeOptions.length >i; i++){
  4882. // if(obj.lzyx == assetTypeOptions[i].dictValue) {
  4883. // obj.lzyx = assetTypeOptions[i].dictLabel;
  4884. // break;
  4885. // }
  4886. // }
  4887. // }
  4888. // });
  4889. // //有偿退出意向字典项
  4890. // that.getDicts("is_have").then((response) => {
  4891. // var assetTypeOptions = response.data;
  4892. // if(obj.yctcyx !=null && obj.yctcyx !=""){
  4893. // for(var i=0;assetTypeOptions.length >i; i++){
  4894. // if(obj.yctcyx == assetTypeOptions[i].dictValue) {
  4895. // obj.yctcyx = assetTypeOptions[i].dictLabel;
  4896. // break;
  4897. // }
  4898. // }
  4899. // }
  4900. // });
  4901. // //被惩处经历字典项
  4902. // that.getDicts("is_have").then((response) => {
  4903. // var assetTypeOptions = response.data;
  4904. // if(obj.bccjl !=null && obj.bccjl !=""){
  4905. // for(var i=0;assetTypeOptions.length >i; i++){
  4906. // if(obj.bccjl == assetTypeOptions[i].dictValue) {
  4907. // obj.bccjl = assetTypeOptions[i].dictLabel;
  4908. // break;
  4909. // }
  4910. // }
  4911. // }
  4912. // });
  4913. // //宅基地取得方式字典项
  4914. // that.getDicts("acquisition_method").then((response) => {
  4915. // var assetTypeOptions = response.data;
  4916. // if(obj.zjdqdfs !=null && obj.zjdqdfs !=""){
  4917. // for(var i=0;assetTypeOptions.length >i; i++){
  4918. // if(obj.zjdqdfs == assetTypeOptions[i].dictValue) {
  4919. // obj.zjdqdfs = assetTypeOptions[i].dictLabel;
  4920. // break;
  4921. // }
  4922. // }
  4923. // }
  4924. // });
  4925. // //权利设定方式字典项
  4926. // that.getDicts("right_setting_mode").then((response) => {
  4927. // var assetTypeOptions = response.data;
  4928. // if(obj.qlsdfs !=null && obj.qlsdfs !=""){
  4929. // for(var i=0;assetTypeOptions.length >i; i++){
  4930. // if(obj.qlsdfs == assetTypeOptions[i].dictValue) {
  4931. // obj.qlsdfs = assetTypeOptions[i].dictLabel;
  4932. // break;
  4933. // }
  4934. // }
  4935. // }
  4936. // });
  4937. // //数据来源字典项
  4938. // that.getDicts("sjly").then((response) => {
  4939. // var assetTypeOptions = response.data;
  4940. // if(obj.sjly !=null && obj.sjly !=""){
  4941. // for(var i=0;assetTypeOptions.length >i; i++){
  4942. // if(obj.sjly == assetTypeOptions[i].dictValue) {
  4943. // obj.sjly = assetTypeOptions[i].dictLabel;
  4944. // break;
  4945. // }
  4946. // }
  4947. // }
  4948. // });
  4949. // that.mapZjdData = obj;
  4950. // console.log(obj.zjddm);
  4951. // that.zjdHcDy = obj.zjddm;
  4952. // } else {
  4953. // that.mapHaDataValue = false;
  4954. // }
  4955. // }else {
  4956. // that.mapHaDataValue = false;
  4957. // }
  4958. //数据库查询详情时使用----------------------------------------end
  4959. });
  4960. //数据库循环加载时使用 --------------------加载较慢 ------start
  4961. //当前账套没有任何空间数据
  4962. // if(mapTalkAbout){
  4963. // let deptName = this.$store.state.user.loginDeptId + "";
  4964. // getQueryLand(deptName).then((response) => {
  4965. // if (response.code == 200) {
  4966. // let InsertCode = response.data;
  4967. // if (InsertCode != null) {
  4968. // var lat = InsertCode.lat;
  4969. // var lng = InsertCode.lng;
  4970. // var center;
  4971. // if(lat !=null && lng !=null && lat !="" && lng !=""){
  4972. // center = [lng,lat];
  4973. // }else {
  4974. // center =[115.452752, 31.789033];
  4975. // }
  4976. // map.getView().animate({
  4977. // // 只设置需要的属性即可
  4978. // center: ol.proj.fromLonLat(center), // 中心点
  4979. // zoom: 17.9, // 缩放级别
  4980. // rotation: undefined, // 缩放完成view视图旋转弧度
  4981. // duration: 1000, // 缩放持续时间,默认不需要设置
  4982. // });
  4983. // }
  4984. // }
  4985. // });
  4986. // }
  4987. //数据库循环加载时使用 --------------------加载较慢 ------start
  4988. },
  4989. /*右侧列表 --展开收缩*/
  4990. selectionPushMap() {
  4991. this.selectionIconShow = true;
  4992. this.homesteadListStatus = true;
  4993. $(".homesteadList_wrap").animate(
  4994. {
  4995. right: "0",
  4996. },
  4997. 300
  4998. );
  4999. },
  5000. homesteadListShrink() {
  5001. this.selectionIconShow = false;
  5002. // this.checked =["zjdSx","zrzSx","fsssSx"];
  5003. $(".homesteadList_wrap").animate(
  5004. {
  5005. right: "-300px",
  5006. },
  5007. 300
  5008. );
  5009. setTimeout(() => {
  5010. this.homesteadListStatus = false;
  5011. }, 300);
  5012. },
  5013. checkClick(res){
  5014. // 1、全选与不全选模块
  5015. $(".checkall").change(function() {
  5016. $(".item-list-checkbox .checkitem").prop("checked", $(this).prop("checked"));
  5017. if($(this).prop("checked")){
  5018. }else {
  5019. }
  5020. });
  5021. // 2、小复选框模块
  5022. $(".checkitem").change(function() {
  5023. if ($(".checkitem:checked").length === $(".checkitem").length) {
  5024. $(".checkall").prop("checked", true);
  5025. } else {
  5026. $(".checkall").prop("checked", false);
  5027. }
  5028. })
  5029. },
  5030. //绘制多边形地图
  5031. drawMapPolygonFun() {
  5032. },
  5033. guidProduct(){
  5034. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  5035. var r = Math.random() * 16 | 0,
  5036. v = c == 'x' ? r : (r & 0x3 | 0x8);
  5037. return v.toString(16);
  5038. });
  5039. },
  5040. //宅基地点击地图核查
  5041. zjdHc(){
  5042. if(this.zjdHcDy != "" && this.zjdHcDy != "undefined"){
  5043. if(this.mapZjdData !=undefined && this.mapZjdData !="" && this.mapZjdDataTure !=""){
  5044. this.mapZjdTeAll.active =1;
  5045. //this.$cookies.set("search",this.mapZjdTeAll);
  5046. this.$cookies.set("search","")
  5047. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5048. //this.$router.push({path:'/homesteadSurvey/add'});
  5049. }else if(this.mapZrzData !=undefined && this.mapZrzData !=""){
  5050. if(this.mapZjdTeAll.mapZjdAData !=""){
  5051. this.mapZjdTeAll.active = 3;
  5052. //this.$cookies.set("search",this.mapZjdTeAll);
  5053. this.$cookies.set("search","")
  5054. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5055. } else {
  5056. this.$toast("必须有宅基地数据才能进入自然幢核查");
  5057. }
  5058. }else {
  5059. if(this.mapZjdTeAll.mapZjdAData !="") {
  5060. this.mapZjdTeAll.active = 4;
  5061. //this.$cookies.set("search", this.mapZjdTeAll);
  5062. this.$cookies.set("search","")
  5063. this.$router.push({path: '/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5064. } else {
  5065. this.$toast("必须有宅基地数据才能进入附属设施核查");
  5066. }
  5067. }
  5068. } else {
  5069. this.$dialog.alert({
  5070. title: '宅基地核查',
  5071. message: "请从地图中选择图层并点击核查",
  5072. theme: 'round-button',
  5073. }).then(() => {
  5074. // on close
  5075. });
  5076. }
  5077. },
  5078. //搜索详情跳转
  5079. zjdSs(item){
  5080. this.mapZjdTeAll.mapZjdAData ={};
  5081. this.mapZjdTeAll.mapZrzAData ={};
  5082. this.mapZjdTeAll.mapFsssAData ={};
  5083. //this.mapZjdTeAll.active =1;
  5084. if(item.typeTc =="宅基地"){
  5085. getZjdzd(item.id).then((response) => {
  5086. this.mapZjdData = response.data;
  5087. this.mapZjdTeAll.active = 1;
  5088. this.mapZjdTeAll.mapZjdAData = this.mapZjdData;
  5089. //this.$cookies.set("search",this.mapZjdTeAll);
  5090. this.$cookies.set("search","")
  5091. setTimeout(() => {
  5092. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5093. }, 500);
  5094. });
  5095. }else if(item.typeTc =="自然幢"){
  5096. //let =
  5097. getZjdzd(item.id).then((response) => {
  5098. this.mapZrzData = response.data;
  5099. this.mapZjdTeAll.active = 3;
  5100. this.mapZjdTeAll.mapZrzAData = this.mapZrzData;
  5101. //this.$cookies.set("search",this.mapZjdTeAll);
  5102. this.$cookies.set("search","")
  5103. setTimeout(() => {
  5104. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5105. }, 500);
  5106. });
  5107. }else if(item.typeTc =="附属设施"){
  5108. getFsss(item.id).then((response) => {
  5109. this.mapFsssData = response.data;
  5110. this.mapZjdTeAll.active = 4;
  5111. this.mapZjdTeAll.mapFsssAData = this.mapFsssData;
  5112. //this.$cookies.set("search",this.mapZjdTeAll);
  5113. this.$cookies.set("search","")
  5114. setTimeout(() => {
  5115. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5116. }, 500);
  5117. });
  5118. }else{
  5119. this.$toast("无数据请检查后进入核查页面");
  5120. }
  5121. },
  5122. //地图查询
  5123. toggleSearch() {
  5124. $("#query").trigger("click");
  5125. },
  5126. //
  5127. checkAllArray(value){
  5128. if(this.checked.length<3){
  5129. this.$refs.checkboxGroup.toggleAll(true);
  5130. }else{
  5131. this.$refs.checkboxGroup.toggleAll(false);
  5132. }
  5133. },
  5134. //筛选//全选
  5135. checkAll(val) {
  5136. this.$refs.checkboxGroup.value.toggleAll(true);
  5137. return;
  5138. let checkedCount = this.CheckedAllArr.length
  5139. if (val) {
  5140. //全选
  5141. this.CheckedAllArr = this.dataList.map(item => item.id)
  5142. } else{
  5143. //取消全选
  5144. if (checkedCount === this.dataList.length) {
  5145. //如果不增加这个条件判断点击某一项时会全部取消
  5146. this.CheckedAllArr = []
  5147. }
  5148. }
  5149. },
  5150. //单选
  5151. handleChecked(value) {
  5152. // this.checkAllFlag = this.CheckedAllArr.length == this.dataList.length;
  5153. if (value.length<3){
  5154. this.checkAllFlag = false;
  5155. }else{
  5156. this.checkAllFlag = true;
  5157. }
  5158. value.indexOf('zjdSx') == -1 ? this.zjdSx = false : this.zjdSx = true;
  5159. value.indexOf('zrzSx') == -1 ? this.zrzSx = false : this.zrzSx = true;
  5160. value.indexOf('fsssSx') == -1 ? this.fsssSx = false : this.fsssSx = true;
  5161. },
  5162. closeSearchBox(){
  5163. this.showSearch = false ;
  5164. var height = $(".searchBar_wrap").outerHeight(true) - $(".searchBar_wrap .van-search").outerHeight(true)
  5165. document.styleSheets[0].insertRule(
  5166. "@keyframes test2" +
  5167. "{" +
  5168. "0%{bottom: 0px}" +
  5169. "100%{bottom: -" + height + "px;}" +
  5170. "}"
  5171. )
  5172. $('.searchBar_wrap').css({'animation':'test2 0.5s ease-in-out 0s 1 alternate forwards','-webkit-animation':'test2 0.5s ease-in-out 0s 1 alternate forwards'});
  5173. },
  5174. zjdTz(){
  5175. if(this.mapZjdData =="" && this.mapZjdDataTure =="" && this.mapZjdData !=undefined){
  5176. this.mapZjdTeAll.active =1;
  5177. this.mapZjdTeAll.mapZjdAData.deptId =JSON.parse(localStorage.getItem("surveyItem")).deptId;
  5178. this.mapZjdTeAll.mapZjdAData.theGeom =this.htZjdZrzFsss;
  5179. //this.mapZjdTeAll.mapZjdAData.deptId = this.$cookies.get("item").deptId;
  5180. //this.$cookies.set("search",this.mapZjdTeAll);
  5181. this.$cookies.set("search","")
  5182. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5183. }else {
  5184. this.$toast("已选择宅基地,请选择自然幢或附属设施按钮");
  5185. }
  5186. },
  5187. zrzTz(){
  5188. if(this.mapZjdData !=undefined && this.mapZjdData !="" && this.mapZjdDataTure !=""){
  5189. this.mapZjdTeAll.active =3;
  5190. this.mapZjdTeAll.mapZrzAData.theGeom =this.htZjdZrzFsss;
  5191. this.mapZjdTeAll.mapZrzAData.deptId =JSON.parse(localStorage.getItem("surveyItem")).deptId;
  5192. //this.mapZjdTeAll.mapZrzAData.deptId = this.$cookies.get("item").deptId;
  5193. //this.$cookies.set("search",this.mapZjdTeAll);
  5194. this.$cookies.set("search","")
  5195. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5196. }else {
  5197. this.$toast("请先在地图上选择宅基地后,再选择自然幢按钮");
  5198. }
  5199. },
  5200. fsssTz(){
  5201. if(this.mapZjdData !=undefined && this.mapZjdData !="" && this.mapZjdDataTure !=""){
  5202. this.mapZjdTeAll.active =4;
  5203. this.mapZjdTeAll.mapFsssAData.theGeom =this.htZjdZrzFsss;
  5204. this.mapZjdTeAll.mapFsssAData.deptId =this.$cookies.get("item").deptId;
  5205. //this.mapZjdTeAll.mapFsssAData.deptId = this.$cookies.get("item").deptId;
  5206. //this.$cookies.set("search",this.mapZjdTeAll);
  5207. this.$cookies.set("search","")
  5208. this.$router.push({path:'/homesteadSurvey/add',query: {res: this.mapZjdTeAll}});
  5209. }else {
  5210. this.$toast("请先在地图上选择宅基地后,再选择附属设施按钮");
  5211. }
  5212. },
  5213. //绘图重置清除之前图层
  5214. deleteHistory(){
  5215. $("#deleteHistory").trigger("click");
  5216. }
  5217. },
  5218. }
  5219. </script>
  5220. <style scoped lang="scss">
  5221. /deep/ .van-swipe-cell__wrapper{
  5222. margin-right:-3px;
  5223. }
  5224. .hzlxBtn{
  5225. font-size: 0.3rem;
  5226. display: inline-block;
  5227. padding: 2% 0;
  5228. border-radius: 30PX;
  5229. color: #FFF;
  5230. margin-right: 2%;
  5231. width: 30%;
  5232. &:last-child{
  5233. margin: 0;
  5234. }
  5235. }
  5236. .van-cell__title{
  5237. flex:2
  5238. }
  5239. .bannerBg{
  5240. width: 100%;
  5241. color:#fff;
  5242. /*padding:10px;*/
  5243. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  5244. }
  5245. .van-hairline--bottom::after {
  5246. border-bottom-width: 0;
  5247. }
  5248. .activeBtn{
  5249. background:#fff;
  5250. border-radius:25PX;
  5251. color:#7AC943;
  5252. line-height:30PX;
  5253. text-align:center;
  5254. font-size:14PX;
  5255. width: 25%;
  5256. margin:0 10px;
  5257. box-shadow: 0px 5px 6px 0px rgba(0,0,0,0.16);
  5258. }
  5259. .disactiveBtn{
  5260. background:rgba(255,255,255,.4);
  5261. border-radius:25PX;
  5262. color:#fff;
  5263. line-height:30PX;
  5264. text-align:center;
  5265. font-size:14PX;
  5266. width: 25%;
  5267. margin:0 10px;
  5268. box-shadow: 0px 5px 6px 0px rgba(0,0,0,0.16);
  5269. }
  5270. /*.van-cell__label{*/
  5271. /* color: #969799;*/
  5272. /* font-size: 12px;*/
  5273. /* line-height: 20px;*/
  5274. /* margin:0*/
  5275. /*}*/
  5276. .map_area {
  5277. width: 50vw;
  5278. height: 50vh;
  5279. z-index:1;
  5280. background:#000;
  5281. position: fixed;
  5282. left: 0;
  5283. top: 0;
  5284. }
  5285. .van-field__label{
  5286. width:50%;
  5287. }
  5288. .rightZoom_wrap {
  5289. position: absolute;
  5290. right: 3%;
  5291. top: 35%;
  5292. margin-top: -200px;
  5293. background: #fff;
  5294. margin-bottom: 16px;
  5295. border-radius: 10px;
  5296. text-align: center;
  5297. padding: 15px 20px;
  5298. img{
  5299. margin: 0 auto;
  5300. }
  5301. .amplification {
  5302. line-height: 1;
  5303. font-size: 18px;
  5304. text-align: center;
  5305. margin-top: 5px;
  5306. }
  5307. }
  5308. .mapZoom_wrap {
  5309. position: absolute;
  5310. right: 3%;
  5311. top: 50%;
  5312. margin-top: -200px;
  5313. background: #fff;
  5314. margin-bottom: 16px;
  5315. border-radius: 10px;
  5316. padding: 0px 20px;
  5317. div{
  5318. padding: 15px 0;
  5319. border-bottom: 1px solid #C9C9C9;
  5320. &:last-child{
  5321. border: none;
  5322. }
  5323. p{
  5324. margin-top: 5px;
  5325. }
  5326. }
  5327. .qtMap {
  5328. font-size: 18px;
  5329. text-align: center;
  5330. line-height: 1;
  5331. }
  5332. .clMap {
  5333. font-size: 18px;
  5334. text-align: center;
  5335. line-height: 1;
  5336. }
  5337. .hcMap {
  5338. font-size: 18px;
  5339. text-align: center;
  5340. line-height: 1;
  5341. }
  5342. .htMap {
  5343. font-size: 18px;
  5344. text-align: center;
  5345. line-height: 1;
  5346. }
  5347. .dwMap {
  5348. font-size: 18px;
  5349. text-align: center;
  5350. line-height: 1;
  5351. }
  5352. }
  5353. .rightIcon_wrap {
  5354. position: absolute;
  5355. right: 16px;
  5356. bottom: 160px;
  5357. .selectionIcon_wrap {
  5358. width: 74px;
  5359. background: #fff;
  5360. border-radius: 10px;
  5361. padding: 14px 0;
  5362. .icon {
  5363. width: 38px;
  5364. height: 38px;
  5365. background: url("../../assets/images/homestead/selection_icon.png")
  5366. no-repeat;
  5367. background-size: 100% 100%;
  5368. margin: 0 auto 4px;
  5369. }
  5370. .text {
  5371. font-size: 24px;
  5372. text-align: center;
  5373. }
  5374. }
  5375. .positioning_wrap {
  5376. width: 74px;
  5377. background: #fff;
  5378. margin-bottom: 16px;
  5379. border-radius: 10px;
  5380. height: 74px;
  5381. display: flex;
  5382. justify-content: center; /* 相对父元素水平居中 */
  5383. align-items: center; /* 子元素相对父元素垂直居中*/
  5384. .icon {
  5385. width: 38px;
  5386. height: 38px;
  5387. background: url("../../assets/images/homestead/positioning_icon.png")
  5388. no-repeat;
  5389. background-size: 100% 100%;
  5390. margin: 0 auto;
  5391. }
  5392. }
  5393. }
  5394. .homesteadList_wrap {
  5395. // display: none;
  5396. display: flex;
  5397. position: absolute;
  5398. right: -200px;
  5399. top: 0px;
  5400. bottom: 0px;
  5401. width: 300px;
  5402. background: #fff;
  5403. z-index: 999;
  5404. border-top-left-radius: 15px;
  5405. border-bottom-left-radius: 15px;
  5406. flex-direction: column;
  5407. .noInfo_data {
  5408. font-size: 28px;
  5409. text-align: center;
  5410. height: 300px;
  5411. line-height: 300px;
  5412. color: #666;
  5413. }
  5414. .title_m {
  5415. color: #333;
  5416. line-height: 36px;
  5417. padding: 20px 40px 22px;
  5418. .name {
  5419. font-size: 36px;
  5420. line-height: 42px;
  5421. height: 42px;
  5422. }
  5423. .more_icon {
  5424. width: 38px;
  5425. height: 38px;
  5426. background: url("../../assets/images/homestead/selectionNext_icon.png")
  5427. no-repeat;
  5428. float: right;
  5429. margin-top: 2px;
  5430. }
  5431. }
  5432. .main_m {
  5433. overflow-y: auto;
  5434. padding: 10px 0;
  5435. // height: 300px;
  5436. flex: 1;
  5437. .flex_block {
  5438. height: 70px;
  5439. display: flex;
  5440. // justify-content: center; /* 相对父元素水平居中 */
  5441. align-items: center; /* 子元素相对父元素垂直居中 */
  5442. padding: 0 40px;
  5443. &.active {
  5444. box-shadow: 0px 0px 10px rgba(24, 45, 51, 0.5);
  5445. }
  5446. .name_text {
  5447. font-size: 28px;
  5448. flex: 0.5;
  5449. overflow: hidden; /*超出部分隐藏*/
  5450. white-space: nowrap; /*不换行*/
  5451. text-overflow: ellipsis; /*超出部分文字以...显示*/
  5452. }
  5453. .square_text {
  5454. font-size: 28px;
  5455. flex: 0.4;
  5456. }
  5457. .operation_mian {
  5458. flex: 0 0 150px;
  5459. .describe {
  5460. font-size: 20px;
  5461. padding: 6px 5px;
  5462. float: right;
  5463. color: #fff;
  5464. border-radius: 30px;
  5465. overflow: hidden;
  5466. text-overflow: ellipsis;
  5467. white-space: nowrap;
  5468. max-width: 150px;
  5469. &.yph {
  5470. background: #b026ff;
  5471. }
  5472. &.dlzdph {
  5473. background: #ff6f36;
  5474. }
  5475. &.ylz {
  5476. background: #7fff4c;
  5477. }
  5478. &.dlz {
  5479. background: rgb(255, 232, 76);
  5480. }
  5481. &.ylzdph {
  5482. background: #ff7dd0;
  5483. }
  5484. &.zy {
  5485. background: rgb(100, 30, 100);
  5486. }
  5487. &.xz {
  5488. background: rgb(60, 100, 180);
  5489. }
  5490. &.chdb {
  5491. background: #fe0303;
  5492. }
  5493. }
  5494. }
  5495. }
  5496. }
  5497. .footerBtn_wrap {
  5498. flex: 0 0 90px;
  5499. display: flex;
  5500. justify-content: center; /* 相对父元素水平居中 */
  5501. align-items: center; /* 子元素相对父元素垂直居中 */
  5502. .options {
  5503. flex: 1;
  5504. font-size: 38px;
  5505. display: flex;
  5506. justify-content: center; /* 相对父元素水平居中 */
  5507. align-items: center; /* 子元素相对父元素垂直居中 */
  5508. height: 90px;
  5509. &:first-child {
  5510. border-bottom-left-radius: 15px;
  5511. }
  5512. &.active {
  5513. background: #3cbf5b;
  5514. color: #fff;
  5515. }
  5516. }
  5517. }
  5518. }
  5519. .checkbox {
  5520. width: 200px;
  5521. margin: 30px auto;
  5522. }
  5523. .thead-checkbox {
  5524. background-color: lightgray;
  5525. }
  5526. .item-checkbox {
  5527. border: 1px solid darkgray;
  5528. }
  5529. .van-sticky{position: fixed;top: 0;right: 0; left: 0;z-index: 9999;}
  5530. .searchBar_wrap {
  5531. // display: none;
  5532. position: fixed;
  5533. left: 0;
  5534. bottom: 0;
  5535. width: 100%;
  5536. padding: 0px 16px 0px 13px;
  5537. background: #fff;
  5538. border-top-left-radius: 15px;
  5539. border-top-right-radius: 15px;
  5540. z-index: 9;
  5541. .searchBox{
  5542. height: 40vh;
  5543. overflow-y: scroll;
  5544. .van-cell{
  5545. /*&:first-child{*/
  5546. /* box-shadow: none;*/
  5547. /* margin:0;*/
  5548. /*}*/
  5549. box-shadow: 0px 0px 5px #cccccc;
  5550. border-radius: 15PX;
  5551. width: 98%;
  5552. margin: 0 auto;
  5553. margin-bottom: 0.35rem;
  5554. &:first-child{
  5555. margin-top: 5px;
  5556. }
  5557. }
  5558. .van-cell__title{
  5559. flex: 0.8;
  5560. p{
  5561. color: rgb(34, 183, 242);
  5562. .van-icon{
  5563. vertical-align: middle;
  5564. }
  5565. span{
  5566. vertical-align: middle;
  5567. &:nth-child(2){
  5568. overflow: hidden;
  5569. white-space: nowrap;
  5570. text-overflow: ellipsis;
  5571. display: inline-block;
  5572. width: 60%;
  5573. }
  5574. &:nth-child(3){
  5575. font-size: 0.25rem;
  5576. border-radius: 5PX;
  5577. padding: 5PX 15PX;
  5578. margin-left: 5%;
  5579. }
  5580. }
  5581. }
  5582. }
  5583. .van-cell__value{
  5584. flex: 0.2;
  5585. p{
  5586. font-size: 0.25rem;
  5587. display: inline-block;
  5588. border-radius: 1rem;
  5589. line-height: 1;
  5590. padding: 10%;
  5591. }
  5592. }
  5593. }
  5594. .actionBar_wrap {
  5595. display: flex;
  5596. position: absolute;
  5597. top: 0;
  5598. left: 0;
  5599. width: 100%;
  5600. height: 100%;
  5601. background: #fff;
  5602. border-top-left-radius: 15px;
  5603. border-top-right-radius: 15px;
  5604. .m_list {
  5605. flex: 1;
  5606. display: flex;
  5607. justify-content: center; /* 相对父元素水平居中 */
  5608. align-items: center; /* 子元素相对父元素垂直居中 */
  5609. .tensile,
  5610. .positioning,
  5611. .spacing,
  5612. .scale {
  5613. width: 76px;
  5614. height: 72px;
  5615. background: #ffffff;
  5616. border-radius: 8px;
  5617. box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.16);
  5618. .icon {
  5619. width: 76px;
  5620. height: 72px;
  5621. }
  5622. &.active {
  5623. background: #333;
  5624. &.tensile {
  5625. .icon {
  5626. background: url("../../assets/images/homestead/operation/tensile_active.png")
  5627. center center no-repeat;
  5628. background-size: 38px 50px;
  5629. }
  5630. }
  5631. &.positioning {
  5632. .icon {
  5633. background: url("../../assets/images/homestead/operation/positioning_active.png")
  5634. center center no-repeat;
  5635. background-size: 38px 48px;
  5636. }
  5637. }
  5638. &.spacing {
  5639. .icon {
  5640. background: url("../../assets/images/homestead/operation/spacing_active.png")
  5641. center center no-repeat;
  5642. background-size: 46px 46px;
  5643. }
  5644. }
  5645. &.scale {
  5646. .icon {
  5647. background: url("../../assets/images/homestead/operation/scale_active.png")
  5648. center center no-repeat;
  5649. background-size: 48px 48px;
  5650. }
  5651. }
  5652. }
  5653. }
  5654. .tensile {
  5655. .icon {
  5656. background: url("../../assets/images/homestead/operation/tensile.png")
  5657. center center no-repeat;
  5658. background-size: 38px 50px;
  5659. }
  5660. }
  5661. .positioning {
  5662. .icon {
  5663. background: url("../../assets/images/homestead/operation/positioning.png")
  5664. center center no-repeat;
  5665. background-size: 38px 48px;
  5666. }
  5667. }
  5668. .spacing {
  5669. .icon {
  5670. background: url("../../assets/images/homestead/operation/spacing.png")
  5671. center center no-repeat;
  5672. background-size: 46px 46px;
  5673. }
  5674. }
  5675. .scale {
  5676. .icon {
  5677. background: url("../../assets/images/homestead/operation/scale.png")
  5678. center center no-repeat;
  5679. background-size: 48px 48px;
  5680. }
  5681. }
  5682. .closes {
  5683. background: url("../../assets/images/homestead/searchBar_close.png")
  5684. no-repeat;
  5685. background-size: 100% 100%;
  5686. width: 72px;
  5687. height: 72px;
  5688. &.gray {
  5689. background: url("../../assets/images/homestead/searchBar_close_gray.png")
  5690. no-repeat;
  5691. background-size: 100% 100%;
  5692. }
  5693. }
  5694. .correct {
  5695. background: url("../../assets/images/homestead/searchBar_save.png")
  5696. no-repeat;
  5697. background-size: 100% 100%;
  5698. width: 72px;
  5699. height: 72px;
  5700. }
  5701. }
  5702. }
  5703. .searchBar_area {
  5704. flex: 1;
  5705. height: 80px;
  5706. background: #f1f1f1;
  5707. border: 1px solid #dfdfdf;
  5708. border-radius: 10px;
  5709. padding: 0 28px;
  5710. display: flex;
  5711. .bar_icon {
  5712. width: 50px;
  5713. height: 50px;
  5714. background: url("../../assets/images/homestead/searchBar_bar.png")
  5715. center center no-repeat;
  5716. background-size: 100% 100%;
  5717. margin-top: 14px;
  5718. margin-right: 15px;
  5719. }
  5720. .bar_ipt {
  5721. flex: 1;
  5722. input {
  5723. width: 100%;
  5724. height: 100%;
  5725. background: none;
  5726. border: 0 none;
  5727. font-size: 32px;
  5728. }
  5729. }
  5730. .bar_text {
  5731. flex: 0 0 80px;
  5732. font-size: 32px;
  5733. color: #333333;
  5734. font-family: PingFang SC, PingFang SC-Regular;
  5735. font-weight: 400;
  5736. display: flex;
  5737. justify-content: center; /* 相对父元素水平居中 */
  5738. align-items: center; /* 子元素相对父元素垂直居中 */
  5739. }
  5740. }
  5741. .searchBar_more {
  5742. flex: 0 0 80px;
  5743. background: url("../../assets/images/homestead/searchBar_add.png") center
  5744. center no-repeat;
  5745. background-size: 80% 80%;
  5746. margin-left: 15px;
  5747. }
  5748. }
  5749. </style>