移动端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

883 linhas
29 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="map_main" id="mapWrap"></div>
  4. <div class="top_address" @click="showAddress=true">
  5. <i class="address_icon"></i>
  6. <p>羊亭</p>
  7. <p>/北上夼</p>
  8. </div>
  9. <van-popup v-model="show" position="bottom" :overlay="false" round>
  10. <div class="pop_main">
  11. <div class="pop_title">
  12. <i class="address_icon"></i>
  13. <p>羊亭镇-北上夼村</p>
  14. </div>
  15. <div class="pop_content">
  16. <div class="pop_content_left">
  17. <img src="../../../static/images/plotPremises/plotPremises_icon_01.png" alt="">
  18. <div class="pop_content_left_box">
  19. <div>
  20. <p>农房 <span>(栋)</span></p>
  21. <p class="num">352</p>
  22. </div>
  23. <span class="border"></span>
  24. <div>
  25. <p>可租 <span>(栋)</span></p>
  26. <p class="num" @click="showList = true,activeName='nf'">71</p>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="pop_content_left">
  31. <img src="../../../static/images/plotPremises/plotPremises_icon_02.png" alt="">
  32. <div class="pop_content_left_box">
  33. <div>
  34. <p>农地 <span>(亩)</span></p>
  35. <p class="num">352</p>
  36. </div>
  37. <span class="border"></span>
  38. <div>
  39. <p>可租 <span>(亩)</span></p>
  40. <p class="num" @click="showList = true,activeName='nd'">71</p>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </van-popup>
  47. <van-popup v-model="showZD" closeable position="bottom" :closed="show=true" :overlay="false" round>
  48. <div class="pop_main">
  49. <div class="pop_title">
  50. <i class="address_icon"></i>
  51. <p>羊亭镇-北上夼村-107</p>
  52. </div>
  53. <div class="pop_content_zd">
  54. <img src="../../../static/images/plotPremises/plotPremises_img.png" alt="">
  55. <div class="pop_content_zd_right">
  56. <van-row type="flex" justify="space-between">
  57. <van-col>租地位置:</van-col>
  58. <van-col>北上夼村</van-col>
  59. </van-row>
  60. <van-row type="flex" justify="space-between">
  61. <van-col>租地编号:</van-col>
  62. <van-col class="num">310</van-col>
  63. </van-row>
  64. <van-row type="flex" justify="space-between">
  65. <van-col>租地面积:</van-col>
  66. <van-col class="num">12亩</van-col>
  67. </van-row>
  68. <van-row type="flex" justify="space-between">
  69. <van-col>咨询代表:</van-col>
  70. <van-col>{{ deptInfo.leader }}</van-col>
  71. </van-row>
  72. <van-row type="flex" justify="space-between">
  73. <van-col>咨询电话:</van-col>
  74. <van-col class="num">{{ deptInfo.phone }}</van-col>
  75. </van-row>
  76. </div>
  77. </div>
  78. </div>
  79. </van-popup>
  80. <van-popup v-model="showZF" closeable position="bottom" :closed="show=true" :overlay="false" round>
  81. <div class="pop_main">
  82. <div class="pop_title">
  83. <i class="address_icon"></i>
  84. <p>羊亭镇-北上夼村-107</p>
  85. </div>
  86. <div class="pop_content_zd">
  87. <img src="../../../static/images/plotPremises/plotPremises_img.png" alt="">
  88. <div class="pop_content_zd_right">
  89. <van-row type="flex" justify="space-between">
  90. <van-col>租房位置:</van-col>
  91. <van-col>北上夼村</van-col>
  92. </van-row>
  93. <van-row type="flex" justify="space-between">
  94. <van-col>租房编号:</van-col>
  95. <van-col class="num">310</van-col>
  96. </van-row>
  97. <van-row type="flex" justify="space-between">
  98. <van-col>租房面积:</van-col>
  99. <van-col class="num">12亩</van-col>
  100. </van-row>
  101. <van-row type="flex" justify="space-between">
  102. <van-col>咨询代表:</van-col>
  103. <van-col>{{ deptInfo.leader }}</van-col>
  104. </van-row>
  105. <van-row type="flex" justify="space-between">
  106. <van-col>咨询电话:</van-col>
  107. <van-col class="num">{{ deptInfo.phone }}</van-col>
  108. </van-row>
  109. </div>
  110. </div>
  111. </div>
  112. </van-popup>
  113. <van-popup v-model="showList" close-icon="../../../static/images/plotPremises/plotPremises_icon_03.png" closeable position="right" :closed="show=true" :overlay="false" round :style="{ width: '45%' , height: '60%' , background:'#ffffff' }">
  114. <div class="pop_main_right">
  115. <p class="pop_title" :style="{color:activeName=='nf'?'#1B65F8':'#FF7321'}">{{activeName=='nf'?'待租农房':'待租农地'}}</p>
  116. <div class="pop_content_right">
  117. <van-row>
  118. <van-col span="8" offset="4">编号</van-col>
  119. <van-col span="9" offset="3">面积</van-col>
  120. </van-row>
  121. <van-row v-for="(item,index) in 20"
  122. :key="index"
  123. @click="listChange(index)"
  124. :class="{ active: selectChooseOrder == index }"
  125. >
  126. <van-col span="8" offset="4" class="num">101</van-col>
  127. <van-col span="9" offset="3" class="num">3亩</van-col>
  128. </van-row>
  129. </div>
  130. <div class="pop_btn_right">
  131. <p :style="{background:activeName=='nf'?'#1B65F8':'',color:activeName=='nf'?'#ffffff':''}" @click="tabChange('nf')">农房</p>
  132. <p :style="{background:activeName=='nd'?'#FF7321':'',color:activeName=='nd'?'#ffffff':''}" @click="tabChange('nd')">农地</p>
  133. </div>
  134. </div>
  135. </van-popup>
  136. <van-popup v-model="showAddress" position="bottom" round>
  137. <van-picker show-toolbar title="村镇选择" :columns="columns" />
  138. </van-popup>
  139. </div>
  140. </template>
  141. <script>
  142. import $ from "jquery";
  143. import { getConfigKey } from "@/utils/data";
  144. import { treeselect } from "@/api/agriculturalTrusteeship";
  145. import { getDept } from "@/api/plotPremisesMobile";
  146. export default {
  147. data() {
  148. return {
  149. show:true,
  150. showZD:false,
  151. showZF:false,
  152. showList:false,
  153. showAddress:false,
  154. activeName:'nf',
  155. selectChooseOrder:-1,
  156. columns: [
  157. {
  158. text: '浙江',
  159. children: [
  160. {
  161. text: '杭州',
  162. children: [{ text: '西湖区' }, { text: '余杭区' }],
  163. },
  164. {
  165. text: '温州',
  166. children: [{ text: '鹿城区' }, { text: '瓯海区' }],
  167. },
  168. ],
  169. },
  170. {
  171. text: '福建',
  172. children: [
  173. {
  174. text: '福州',
  175. children: [{ text: '鼓楼区' }, { text: '台江区' }],
  176. },
  177. {
  178. text: '厦门',
  179. children: [{ text: '思明区' }, { text: '海沧区' }],
  180. },
  181. ],
  182. },
  183. ],
  184. addrOptions: [],
  185. map: "", // 地图
  186. // countyBorder: "", // 区县边界
  187. // townBorder: "", // 乡镇边界
  188. // villageBorder: "", // 村边界
  189. borderLayer: "", // 区域边界图层
  190. deptLayer: "", // 坐标点图层
  191. userRole: "", // 记录用户身份
  192. cityId: null, // 记录市的deptId
  193. countyId: null, // 记录区县的deptId
  194. townId: null, // 记录乡镇的deptId
  195. currentDeptLevel: null, // 当前所处的部门级别
  196. mapGeoServerUrl: "", // 加载geoserver地址
  197. countyBorderLayerName: "", // 区县边界图层名称
  198. townBorderLayerName: "", // 乡镇边界图层名称
  199. villageBorderLayerName: "", // 村边界图层名称
  200. landLayer: "", // 地块图层
  201. homesteadLayer: "", // 宅基地图层
  202. deptInfo: {
  203. leader: null, // 联系人
  204. phone: null // 电话
  205. }
  206. };
  207. },
  208. created() {
  209. },
  210. mounted() {
  211. // 获取geoserver的地址
  212. this.getGeoServerUrl();
  213. // 获取区县边界图层名称
  214. this.getCountyBorderLayerName();
  215. // 获取乡镇边界的图层名称
  216. this.getTownBorderLayerName();
  217. // 获取村边界的图层名称
  218. this.getVillageBorderLayerName();
  219. // 获取部门下拉树列表
  220. treeselect().then(response => {
  221. this.addrOptions = response.data;
  222. // 初始化地图
  223. this.initMap();
  224. });
  225. },
  226. methods: {
  227. tabChange(name){
  228. this.activeName = name;
  229. },
  230. listChange(id){
  231. this.selectChooseOrder = id;
  232. this.show = false;
  233. this.showZF = false;
  234. this.showZD = true;
  235. },
  236. //获取geoserver的地址
  237. getGeoServerUrl() {
  238. getConfigKey("system.geoServer.url").then(response => {
  239. this.mapGeoServerUrl = response.msg;
  240. });
  241. },
  242. //获取区县边界的图层名称
  243. getCountyBorderLayerName() {
  244. getConfigKey("geoserver.layer.countyBorder").then(response => {
  245. this.countyBorderLayerName = response.msg;
  246. });
  247. },
  248. //获取乡镇边界的图层名称
  249. getTownBorderLayerName() {
  250. getConfigKey("geoserver.layer.townBorder").then(response => {
  251. this.townBorderLayerName = response.msg;
  252. });
  253. },
  254. //获取村边界的图层名称
  255. getVillageBorderLayerName() {
  256. getConfigKey("geoserver.layer.villageBorder").then(response => {
  257. this.villageBorderLayerName = response.msg;
  258. });
  259. },
  260. // 初始化地图
  261. initMap() {
  262. const dept = this.addrOptions[0];
  263. // 定义地图中心坐标
  264. let mapCenterLocation;
  265. if (dept.lng && dept.lat) {
  266. mapCenterLocation = [dept.lng, dept.lat];
  267. } else {
  268. mapCenterLocation = [116.391458, 39.902377];
  269. }
  270. document.getElementById("mapWrap").innerHTML = "";
  271. // 定义地图投影
  272. let projection = new ol.proj.Projection({
  273. code: "EPSG:3857",
  274. units: "degrees",
  275. });
  276. // 定义地图图层
  277. let aerial = new ol.layer.Tile({
  278. source: new ol.source.XYZ({
  279. url: "http://t{0-7}.tianditu.com/img_w/wmts?" +
  280. "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
  281. "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067",
  282. }),
  283. isGroup: true,
  284. name: "卫星影像图",
  285. });
  286. let yingxzi = new ol.layer.Tile({
  287. source: new ol.source.XYZ({
  288. url: "http://t{0-7}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067",
  289. }),
  290. isGroup: true,
  291. name: "天地图文字标注--卫星影像图",
  292. });
  293. //加载地图
  294. this.map = new ol.Map({
  295. controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]),
  296. layers: [aerial, yingxzi],
  297. projection: projection,
  298. target: "mapWrap",
  299. view: new ol.View({
  300. center: ol.proj.fromLonLat(mapCenterLocation), // 地图中心坐标
  301. zoom: 9.5,
  302. minZoom: 1, //地图缩小限制
  303. maxZoom: 18, //地图放大限制
  304. // extent: [13481224.75161,5667110.83528,13811063.06278,5880284.11416]
  305. }),
  306. interactions: ol.interaction.defaults({
  307. doubleClickZoom: false, // 双击放大地图
  308. // mouseWheelZoom: false, // 鼠标滚轮放大地图
  309. // shiftDragZoom: false, // shift + 鼠标左键拖拽 放大地图
  310. })
  311. });
  312. if (dept.deptLevel === '5') {
  313. // 登录身份为市级领导
  314. this.userRole = 'cityLeader';
  315. this.cityId = dept.id;
  316. this.currentDeptLevel = '5';
  317. // 添加区县边界
  318. this.addCountyBorder();
  319. } else if (dept.deptLevel === '4') {
  320. // 登录身份为县级领导
  321. this.userRole = 'countyLeader';
  322. this.countyId = dept.id;
  323. this.currentDeptLevel = '4';
  324. // 添加乡镇边界
  325. this.addTownBorder(dept.id);
  326. this.map.getView().setZoom(10.5);
  327. }
  328. // else if (dept.deptLevel === '3') {
  329. // // 登录身份为镇级领导
  330. // this.userRole = 'townLeader';
  331. // this.townId = dept.id;
  332. // this.currentDeptLevel = '3';
  333. // // 添加村边界
  334. // this.addVillageBorder(dept.id);
  335. // this.map.getView().setZoom(12.5);
  336. // }
  337. if (dept.children) {
  338. this.addDeptLayer(dept.children);
  339. }
  340. this.map.on("click", (evt) => {
  341. let feature = this.map.forEachFeatureAtPixel(
  342. evt.pixel,
  343. (feature) => feature
  344. );
  345. if (feature) {
  346. // 镇级:加载村级坐标点
  347. if (feature.get('level') === 'deptPoint') {
  348. const deptId = feature.get('deptId');
  349. const deptLevel = feature.get('deptLevel');
  350. const lng = feature.get('lng');
  351. const lat = feature.get('lat');
  352. if (deptLevel === '4' || deptLevel === '3') {
  353. if (deptLevel === '4') {
  354. this.countyId = deptId;
  355. this.currentDeptLevel = '4';
  356. this.map.removeLayer(this.borderLayer);
  357. this.borderLayer = '';
  358. // 添加乡镇边界
  359. this.addTownBorder(deptId);
  360. this.map.getView().animate({
  361. center: ol.proj.fromLonLat([lng, lat]), // 中心点
  362. zoom: 10.5, // 缩放级别
  363. rotation: undefined, // 缩放完成view视图旋转弧度
  364. duration: 1000, // 缩放持续时间,默认不需要设置
  365. });
  366. } else if (deptLevel === '3') {
  367. this.townId = deptId;
  368. this.currentDeptLevel = '3';
  369. this.map.removeLayer(this.borderLayer);
  370. this.borderLayer = '';
  371. // 添加村边界
  372. const cqlFilter = "parent_id = '" + deptId + "'";
  373. this.addVillageBorder(cqlFilter);
  374. this.map.getView().animate({
  375. center: ol.proj.fromLonLat([lng, lat]), // 中心点
  376. zoom: 12.5, // 缩放级别
  377. rotation: undefined, // 缩放完成view视图旋转弧度
  378. duration: 1000, // 缩放持续时间,默认不需要设置
  379. });
  380. }
  381. const deptNode = this.findNode(this.addrOptions, deptId);
  382. if (deptNode && deptNode.children) {
  383. this.map.removeLayer(this.deptLayer);
  384. this.deptLayer = '';
  385. this.addDeptLayer(deptNode.children);
  386. }
  387. } else if (deptLevel === '2') {
  388. this.currentDeptLevel = '2';
  389. this.map.removeLayer(this.borderLayer);
  390. this.borderLayer = '';
  391. // 添加村边界
  392. const cqlFilter = "dept_id = '" + deptId + "'";
  393. this.addVillageBorder(cqlFilter);
  394. let villagePoint = {
  395. id: deptId,
  396. label: feature.get('deptName'),
  397. lng: lng,
  398. lat: lat,
  399. deptLevel: deptLevel,
  400. };
  401. let depts = [];
  402. depts.push(villagePoint);
  403. this.map.removeLayer(this.deptLayer);
  404. this.deptLayer = '';
  405. this.addDeptLayer(depts);
  406. this.addLandLayer(deptId);
  407. this.addHomesteadLayer(deptId);
  408. this.map.getView().animate({
  409. center: ol.proj.fromLonLat([lng, lat]), // 中心点
  410. zoom: 17, // 缩放级别
  411. rotation: undefined, // 缩放完成view视图旋转弧度
  412. duration: 1000, // 缩放持续时间,默认不需要设置
  413. });
  414. getDept(deptId).then(res => {
  415. this.deptInfo.leader = res.data.leader;
  416. this.deptInfo.phone = res.data.phone;
  417. });
  418. }
  419. }
  420. }
  421. });
  422. // 缩小地图,重新加载页面
  423. this.map.on("moveend", (evt) => {
  424. const zoom = this.map.getView().getZoom();
  425. if (this.userRole === 'cityLeader') {
  426. if (this.currentDeptLevel === '2' && zoom < 13) {
  427. this.currentDeptLevel = '3';
  428. this.map.removeLayer(this.borderLayer);
  429. this.borderLayer = "";
  430. const cqlFilter = "parent_id = '" + this.townId + "'";
  431. this.addVillageBorder(cqlFilter);
  432. this.map.removeLayer(this.deptLayer);
  433. this.deptLayer = "";
  434. const deptNode = this.findNode(this.addrOptions, this.townId);
  435. if (deptNode && deptNode.children) {
  436. this.addDeptLayer(deptNode.children);
  437. }
  438. this.map.removeLayer(this.landLayer);
  439. this.landLayer = "";
  440. this.map.removeLayer(this.homesteadLayer);
  441. this.homesteadLayer = "";
  442. this.deptInfo.leader = null;
  443. this.deptInfo.phone = null;
  444. } else if (this.currentDeptLevel === '3' && zoom < 11) {
  445. this.currentDeptLevel = '4';
  446. this.map.removeLayer(this.borderLayer);
  447. this.borderLayer = "";
  448. this.addTownBorder(this.countyId);
  449. this.map.removeLayer(this.deptLayer);
  450. this.deptLayer = "";
  451. const deptNode = this.findNode(this.addrOptions, this.countyId);
  452. if (deptNode && deptNode.children) {
  453. this.addDeptLayer(deptNode.children);
  454. }
  455. } else if (this.currentDeptLevel === '4' && zoom < 9.5) {
  456. this.currentDeptLevel = '5';
  457. this.map.removeLayer(this.borderLayer);
  458. this.borderLayer = "";
  459. this.addCountyBorder();
  460. this.map.removeLayer(this.deptLayer);
  461. this.deptLayer = "";
  462. const deptNode = this.findNode(this.addrOptions, this.cityId);
  463. if (deptNode && deptNode.children) {
  464. this.addDeptLayer(deptNode.children);
  465. }
  466. }
  467. } else if (this.userRole === 'countyLeader') {
  468. if (this.currentDeptLevel === '2' && zoom < 13) {
  469. this.currentDeptLevel = '3';
  470. this.map.removeLayer(this.borderLayer);
  471. this.borderLayer = "";
  472. const cqlFilter = "parent_id = '" + this.townId + "'";
  473. this.addVillageBorder(cqlFilter);
  474. this.map.removeLayer(this.deptLayer);
  475. this.deptLayer = "";
  476. const deptNode = this.findNode(this.addrOptions, this.townId);
  477. if (deptNode && deptNode.children) {
  478. this.addDeptLayer(deptNode.children);
  479. }
  480. this.map.removeLayer(this.landLayer);
  481. this.landLayer = "";
  482. this.map.removeLayer(this.homesteadLayer);
  483. this.homesteadLayer = "";
  484. this.deptInfo.leader = null;
  485. this.deptInfo.phone = null;
  486. } else if (this.currentDeptLevel === '3' && zoom < 11) {
  487. this.currentDeptLevel = '4';
  488. this.map.removeLayer(this.borderLayer);
  489. this.borderLayer = "";
  490. this.addTownBorder(this.countyId);
  491. this.map.removeLayer(this.deptLayer);
  492. this.deptLayer = "";
  493. const deptNode = this.findNode(this.addrOptions, this.countyId);
  494. if (deptNode && deptNode.children) {
  495. this.addDeptLayer(deptNode.children);
  496. }
  497. }
  498. }
  499. });
  500. },
  501. findNode(tree, deptId) {
  502. for (const node of tree) {
  503. if (node.id === deptId) return node;
  504. if (node.children) {
  505. const res = this.findNode(node.children, deptId);
  506. if (res) return res;
  507. }
  508. }
  509. return null;
  510. },
  511. // 添加区县边界
  512. addCountyBorder() {
  513. this.borderLayer = new ol.layer.Image({
  514. source: new ol.source.ImageWMS({
  515. url: this.mapGeoServerUrl + '/wms',
  516. params: {
  517. LAYERS: this.countyBorderLayerName,
  518. SRID: 3857,
  519. }
  520. }),
  521. name: 'countyBorderLayer'
  522. });
  523. this.map.getLayers().insertAt(2, this.borderLayer);
  524. },
  525. // 添加乡镇边界
  526. addTownBorder(deptId) {
  527. this.borderLayer = new ol.layer.Image({
  528. source: new ol.source.ImageWMS({
  529. url: this.mapGeoServerUrl + "/wms",
  530. params: {
  531. LAYERS: this.townBorderLayerName,
  532. // TILED: true,
  533. cql_filter: "parent_id = '" + deptId + "'",
  534. SRID: 3857,
  535. },
  536. }),
  537. name: 'townBorderLayer'
  538. });
  539. this.map.getLayers().insertAt(2, this.borderLayer);
  540. },
  541. // 添加村边界
  542. addVillageBorder(cqlFilter) {
  543. this.borderLayer = new ol.layer.Image({
  544. source: new ol.source.ImageWMS({
  545. url: this.mapGeoServerUrl + '/wms',
  546. params: {
  547. LAYERS: this.villageBorderLayerName,
  548. cql_filter: cqlFilter,
  549. SRID: 3857,
  550. },
  551. }),
  552. name: 'villageBorderLayer'
  553. });
  554. this.map.getLayers().insertAt(2, this.borderLayer);
  555. },
  556. // 创建矢量数据源
  557. addDeptLayer(depts) {
  558. const createFeatureStyle = function(feature) {
  559. return new ol.style.Style({
  560. image: new ol.style.Icon({
  561. //设置图标偏移
  562. anchor: [0.5, 1],
  563. //标注样式的起点位置
  564. anchorOrigin: "top-right",
  565. //X方向单位:分数
  566. anchorXUnits: "fraction",
  567. //Y方向单位:像素
  568. anchorYUnits: "pixels",
  569. //偏移起点位置的方向
  570. offsetOrigin: "top-right",
  571. //透明度
  572. opacity: 0.9,
  573. // rotation: (Math.PI / 180) * 20,
  574. //图片路径
  575. src: require("../../assets/images/plotPremises/mark.png"),
  576. }),
  577. text: new ol.style.Text({
  578. textAlign: "center", //位置
  579. textBaseline: "bottom", //基准线
  580. font: "normal 14px 微软雅黑", //文字样式
  581. text: feature.get("deptName"), //文本内容
  582. fill: new ol.style.Fill({
  583. //文本填充样式(即文字颜色)
  584. color: "#ffffff",
  585. }),
  586. }),
  587. });
  588. };
  589. let features = [];
  590. for (let i = 0; i < depts.length; i++) {
  591. let feature = new ol.Feature({
  592. geometry: new ol.geom.Point(
  593. ol.proj.fromLonLat([depts[i].lng, depts[i].lat])
  594. ),
  595. deptId: depts[i].id,
  596. deptName: depts[i].label,
  597. // orgCode: depts[i].orgCode,
  598. lat: depts[i].lat,
  599. lng: depts[i].lng,
  600. deptLevel: depts[i].deptLevel,
  601. level: 'deptPoint',
  602. });
  603. // 创建下级部门坐标点
  604. feature.setStyle(createFeatureStyle(feature));
  605. features.push(feature);
  606. }
  607. const vectorSource = new ol.source.Vector({
  608. features: features,
  609. });
  610. // 创建矢量图层
  611. this.deptLayer = new ol.layer.Vector({
  612. source: vectorSource,
  613. name: 'deptLayer'
  614. });
  615. // this.map.addLayer(this.deptLayer);
  616. this.map.getLayers().insertAt(3, this.deptLayer);
  617. },
  618. // 添加地块图层
  619. addLandLayer(deptId) {
  620. /* let params = {};
  621. if (this.street === '全部' && this.cun === '全部') {
  622. params = {
  623. LAYERS: this.homesteadLayerName,
  624. SRID: 3857,
  625. };
  626. } else if (this.street !== '全部' && this.cun === '全部') {
  627. let villageDeptIds = this.houseCunship.map(item => item.deptId);
  628. params = {
  629. LAYERS: this.homesteadLayerName,
  630. cql_filter: "dept_id in (" + villageDeptIds + ")",
  631. SRID: 3857,
  632. };
  633. } else if (this.street !== '全部' && this.cun !== '全部') {
  634. params = {
  635. LAYERS: "zjd_dc:t_sys_dk", // 测试用的图层,正式使用时要换成自己发布的图层
  636. cql_filter: "dept_id = '" + this.deptId + "'",
  637. SRID: 3857,
  638. };
  639. } */
  640. this.landLayer = new ol.layer.Image({
  641. source: new ol.source.ImageWMS({
  642. url: "http://218.59.175.43:8090/geoserver/zjd_dc/wms", // 测试用的geoserver服务器链接,正式使用时需要换掉
  643. params: {
  644. LAYERS: "zjd_dc:t_sys_dk_mobile", // 测试用的图层,正式使用时要换成自己发布的图层
  645. cql_filter: "dept_id = '" + deptId + "'",
  646. SRID: 3857,
  647. }
  648. }),
  649. name: 'landLayer'
  650. });
  651. this.map.addLayer(this.landLayer);
  652. // this.map.getLayers().insertAt(3, this.landLayer);
  653. },
  654. // 添加宅基地图层
  655. addHomesteadLayer(deptId) {
  656. /* let params = {};
  657. if (this.street === '全部' && this.cun === '全部') {
  658. params = {
  659. LAYERS: this.homesteadLayerName,
  660. SRID: 3857,
  661. };
  662. } else if (this.street !== '全部' && this.cun === '全部') {
  663. let villageDeptIds = this.houseCunship.map(item => item.deptId);
  664. params = {
  665. LAYERS: this.homesteadLayerName,
  666. cql_filter: "dept_id in (" + villageDeptIds + ")",
  667. SRID: 3857,
  668. };
  669. } else if (this.street !== '全部' && this.cun !== '全部') {
  670. params = {
  671. LAYERS: "zjd_dc:t_sys_dk", // 测试用的图层,正式使用时要换成自己发布的图层
  672. cql_filter: "dept_id = '" + this.deptId + "'",
  673. SRID: 3857,
  674. };
  675. } */
  676. this.homesteadLayer = new ol.layer.Image({
  677. source: new ol.source.ImageWMS({
  678. url: "http://218.59.175.43:8090/geoserver/zjd_dc/wms", // 测试用的geoserver服务器链接,正式使用时需要换掉
  679. params: {
  680. LAYERS: "zjd_dc:t_homestead_zjdzdxx_mobile", // 测试用的图层,正式使用时要换成自己发布的图层
  681. cql_filter: "dept_id = '" + deptId + "'",
  682. SRID: 3857,
  683. }
  684. }),
  685. name: 'homesteadLayer'
  686. });
  687. this.map.addLayer(this.homesteadLayer);
  688. // this.map.getLayers().insertAt(3, this.homesteadLayer);
  689. },
  690. },
  691. };
  692. </script>
  693. <style scoped lang="scss">
  694. .home_wrapper {
  695. background: #e9e9e9;
  696. min-height: 100vh;
  697. width: 100vw;
  698. }
  699. .num{
  700. font-family: Arial;
  701. }
  702. .map_main{
  703. width: 100%;
  704. height: 100vh;
  705. /*background: url("../../../static/images/plotPremises/map_bg.png") no-repeat center;*/
  706. /*background-size: 100%;*/
  707. }
  708. /deep/ .van-popup{
  709. background: #F1F0F5;
  710. }
  711. /deep/ .van-popup--right{
  712. top: 35%;
  713. .van-icon__image{
  714. width: .7em;
  715. height: .7em;
  716. display: block;
  717. }
  718. }
  719. .top_address{
  720. display: flex;
  721. align-items: center;
  722. position: absolute;
  723. top: 5vh;
  724. left: 3vw;
  725. padding: 1vh 2vh;
  726. background: #ffffff;
  727. border-radius: 5vh;
  728. p{font-size: 1.5vh}
  729. }
  730. .address_icon {
  731. width: 13PX;
  732. height: 17PX;
  733. background: url("../../../static/images/plotPremises/positioning.png") no-repeat;
  734. background-size: 100% 100%;
  735. margin-right: 1vw;
  736. }
  737. .pop_main{
  738. padding: 2vh 3vw;
  739. .pop_title{
  740. display: flex;
  741. align-items: center;
  742. font-size: 2.2vh;
  743. line-height: 1;
  744. }
  745. .pop_content{
  746. display: flex;
  747. justify-content: space-between;
  748. margin-top: 2vh;
  749. .pop_content_left{
  750. background: #ffffff;
  751. width: 48%;
  752. padding: 1.5vh 3vw;
  753. border-radius: 15PX;
  754. .pop_content_left_box{
  755. display: flex;
  756. justify-content: space-between;
  757. margin-top: .5vh;
  758. .border{
  759. border-left: 2PX dashed #DFDFDF;
  760. }
  761. div{
  762. p{
  763. &:first-child{
  764. font-size: 2vh;
  765. color: #797979;
  766. span{
  767. font-size: 1.5vh;
  768. }
  769. }
  770. &:last-child{
  771. font-size: 3vh;
  772. color: #333333;
  773. }
  774. }
  775. &:last-child{
  776. p:last-child{
  777. color: #1B65F8;
  778. }
  779. }
  780. }
  781. }
  782. }
  783. }
  784. .pop_content_zd{
  785. background: #ffffff;
  786. border-radius: 15PX;
  787. display: flex;
  788. justify-content: space-between;
  789. margin-top: 2vh;
  790. overflow: hidden;
  791. img{width: 40%;}
  792. .pop_content_zd_right{
  793. width: 60%;
  794. padding:1.5vh 2.5vh;
  795. font-size: 1.8vh;
  796. display: flex;
  797. flex-direction: column;
  798. justify-content: space-between;
  799. }
  800. }
  801. }
  802. .pop_main_right{
  803. .pop_title{
  804. font-size: 2.2vh;
  805. color: #1B65F8;
  806. padding: 1.5vh;
  807. }
  808. .pop_content_right{
  809. font-size: 1.8vh;
  810. height: 48vh;
  811. overflow-y: scroll;
  812. .active{
  813. box-shadow:0px 0px 5px #999999;
  814. }
  815. .van-row{
  816. padding: 1vh 0;
  817. }
  818. }
  819. .pop_btn_right{
  820. display: flex;
  821. width: 100%;
  822. position: absolute;
  823. bottom: 0;
  824. p{
  825. padding: 1.5vh 0;
  826. text-align: center;
  827. font-size: 2vh;
  828. flex: 1;
  829. background: #E1E0E4;
  830. color: #9F9F9F;
  831. }
  832. }
  833. }
  834. </style>