移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

5844 rindas
240 KiB

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