移动端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

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