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

5655 Zeilen
236 KiB

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