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

5790 Zeilen
238 KiB

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