移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

5709 righe
236 KiB

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