移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

5797 行
237 KiB

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