移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

5474 строки
230 KiB

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