移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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