移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

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