移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

811 lines
30 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar :title="$route.query.deptName" left-arrow fixed placeholder @click-left="$router.push({path:'/contracted/index'})" />
  4. <div class="head">
  5. <div class="tap_block">
  6. <p @click="$router.push({path:'/contracted/village/contractor', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">承包方</p>
  7. <p @click="$router.push({path:'/contracted/village/employer', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">发包方</p>
  8. <p @click="$router.push({path:'/contracted/village/massif', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">地块</p>
  9. <p class="active">地图</p>
  10. </div>
  11. </div>
  12. <div style="position:relative;">
  13. <div class="mapBox" id="landMapBox"></div>
  14. <div class="legend_main" v-if="showLegend">
  15. <div class="legend">
  16. <p class="legend_tt">图例
  17. <img src="../../../../../static/images/contracted/map_icon_01.png" @click="showLegend = false" alt="">
  18. </p>
  19. <van-checkbox-group v-model="landCategory" @change="filterLandLayer">
  20. <van-checkbox name="10" shape="square" checked-color="#16e90f"><div><p>承包地</p><i class="i1"></i></div></van-checkbox>
  21. <van-checkbox name="21" shape="square" checked-color="#01c6de"><div><p>自留地</p><i class="i2"></i></div></van-checkbox>
  22. <van-checkbox name="22" shape="square" checked-color="#eeee00"><div><p>机动地</p><i class="i3"></i></div></van-checkbox>
  23. <van-checkbox name="23" shape="square" checked-color="#ee3c3c"><div><p>开荒地</p><i class="i4"></i></div></van-checkbox>
  24. <van-checkbox name="99" shape="square" checked-color="#eb8600"><div><p>其他地</p><i class="i5"></i></div></van-checkbox>
  25. </van-checkbox-group>
  26. </div>
  27. <div class="legend_second" v-if="taskStatus === '2'">
  28. <p class="legend_tt" id="drawLandPolygon">
  29. <img src="../../../../../static/images/contracted/map_icon_02.png" alt="">画图
  30. </p>
  31. </div>
  32. </div>
  33. <div class="openLegend" v-if="!showLegend" @click="showLegend = true">
  34. <span class="sanjiao-left"></span>
  35. </div>
  36. </div>
  37. <div class="landPopup">
  38. <van-dialog v-model="open" :title="title" :show-confirm-button="false" :show-cancel-button="false">
  39. <van-form ref="landForm">
  40. <van-field v-model="form.dkbm" label="地块代码:" placeholder="请输入地块代码" required :rules="[{ required: true }]" :border="false" input-align="right" label-width="auto" maxlength="19" > <!-- :disabled="isDisabled" -->
  41. <template #button v-if="!isDisabled">
  42. <van-button size="mini" type="primary" native-type="button" @click="generateCode">生成代码</van-button>
  43. </template>
  44. </van-field>
  45. <van-field v-model="form.dkmc" label="地块名称:" placeholder="请输入地块名称" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  46. <van-field v-model="syqxzText" label="所有权性质:"
  47. placeholder="请选择所有权性质"
  48. required
  49. :rules="[{ required: true }]"
  50. :border="false"
  51. input-align="right"
  52. right-icon="arrow-down"
  53. readonly
  54. clickable
  55. @click="showOwnership = true"
  56. />
  57. <van-popup v-model="showOwnership" position="bottom" get-container=".app-container">
  58. <van-picker
  59. show-toolbar
  60. :columns="syqxzOptions"
  61. value-key="dictLabel"
  62. @confirm="onConfirmOwnershipOptions"
  63. @cancel="showOwnership = false"
  64. />
  65. </van-popup>
  66. <van-field v-model="dklbText" label="地块类别:"
  67. placeholder="请选择地块类别"
  68. required
  69. :rules="[{ required: true }]"
  70. :border="false"
  71. input-align="right"
  72. right-icon="arrow-down"
  73. readonly
  74. clickable
  75. @click="openLandCategoryPopup"
  76. />
  77. <van-popup v-model="showLandCategory" position="bottom" get-container=".app-container">
  78. <van-picker
  79. show-toolbar
  80. :columns="dklbOptions"
  81. value-key="dictLabel"
  82. @confirm="onConfirmLandCategoryOptions"
  83. @cancel="showLandCategory = false"
  84. />
  85. </van-popup>
  86. <van-field v-model="tdlylxText" label="土地利用类型:"
  87. placeholder="请选择土地利用类型"
  88. required
  89. :rules="[{ required: true }]"
  90. :border="false"
  91. input-align="right"
  92. right-icon="arrow-down"
  93. readonly
  94. clickable
  95. @click="showLandType = true"
  96. />
  97. <van-popup v-model="showLandType" position="bottom" get-container=".app-container">
  98. <van-picker
  99. show-toolbar
  100. :columns="tdlylxOptions"
  101. value-key="dictLabel"
  102. @confirm="onConfirmLandTypeOptions"
  103. @cancel="showLandType = false"
  104. />
  105. </van-popup>
  106. <van-field v-model="dldjText" label="地力等级:"
  107. placeholder="请选择地力等级"
  108. required
  109. :rules="[{ required: true }]"
  110. :border="false"
  111. input-align="right"
  112. right-icon="arrow-down"
  113. readonly
  114. clickable
  115. @click="showLandGrade = true"
  116. />
  117. <van-popup v-model="showLandGrade" position="bottom" get-container=".app-container">
  118. <van-picker
  119. show-toolbar
  120. :columns="dldjOptions"
  121. value-key="dictLabel"
  122. @confirm="onConfirmLandGradeOptions"
  123. @cancel="showLandGrade = false"
  124. />
  125. </van-popup>
  126. <van-field v-model="tdytText" label="土地用途:"
  127. placeholder="请选择土地用途"
  128. required
  129. :rules="[{ required: true }]"
  130. :border="false"
  131. input-align="right"
  132. right-icon="arrow-down"
  133. readonly
  134. clickable
  135. @click="showLandPurpose = true"
  136. />
  137. <van-popup v-model="showLandPurpose" position="bottom" get-container=".app-container">
  138. <van-picker
  139. show-toolbar
  140. :columns="tdytOptions"
  141. value-key="dictLabel"
  142. @confirm="onConfirmLandPurposeOptions"
  143. @cancel="showLandPurpose = false"
  144. />
  145. </van-popup>
  146. <van-field v-model="form.sfjbnt" label="基本农田:" required :rules="[{ required: true }]" :border="false" input-align="right" >
  147. <template #input>
  148. <van-radio-group v-model="form.sfjbnt" direction="horizontal">
  149. <!-- <van-radio name="1">是</van-radio>
  150. <van-radio name="2">否</van-radio> -->
  151. <van-radio v-for="dict in sfjbntOptions" :ke="dict.dictValue" :name="dict.dictValue">{{ dict.dictLabel }}</van-radio>
  152. </van-radio-group>
  153. </template>
  154. </van-field>
  155. <van-field v-model="form.scmjm" type="number" label="实测面积(亩):" placeholder="请输入实测面积(亩)" required :rules="[{ required: true }]" :border="false" input-align="right" />
  156. <van-field v-model="form.zjrxm" label="指界人姓名:" placeholder="请输入指界人姓名" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="100" />
  157. <van-field v-model="form.dkdz" label="地块东至:" placeholder="请输入地块东至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  158. <van-field v-model="form.dkxz" label="地块西至:" placeholder="请输入地块西至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  159. <van-field v-model="form.dknz" label="地块南至:" placeholder="请输入地块南至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  160. <van-field v-model="form.dkbz" label="地块北至:" placeholder="请输入地块北至" required :rules="[{ required: true }]" :border="false" input-align="right" maxlength="50" />
  161. <van-field v-model="form.dkbzxx" label="地块备注信息:" placeholder="请输入地块备注信息" type="textarea" rows="3" :border="false" input-align="right" maxlength="250" />
  162. </van-form>
  163. <div class="footer_main">
  164. <van-button type="default" hairline size="large" @click="closePopup">关闭弹窗</van-button>
  165. <van-button type="danger" hairline size="large" @click="deleteLand(form.id)" v-if="taskStatus === '2' && showDeleteBtn">删除地块</van-button>
  166. <van-button type="info" hairline size="large" @click="saveLand" v-if="showSaveBtn">保存信息</van-button>
  167. </div>
  168. </van-dialog>
  169. </div>
  170. </div>
  171. </template>
  172. <script>
  173. import Cookies from "js-cookie";
  174. import { getConfigKey } from "@/api/system/config";
  175. import { getDept } from "@/api/contracted";
  176. import { getDk, addDk, updateDk, deleteDk, generateLandCode } from "@/api/contracted/dk";
  177. import $ from "jquery";
  178. export default {
  179. name: "contractedVillageContractor",
  180. data() {
  181. return {
  182. form: {}, // 地块信息表单参数
  183. map: "", // 地图
  184. mapGeoServerUrl: "", // geoserver地址
  185. mapCenterLocation: [], // 地图中心坐标
  186. landLayerName: "", // 地块图层名称
  187. landLayer: "", // 地块图层
  188. mapBorder: "", // 地图边界
  189. villageBorderLayerName: "", // 乡镇边界图层名称
  190. vectorLayer: "", // 绘制的矢量图层
  191. title: "", // 弹出层标题
  192. open: false, // 是否显示地块弹出层
  193. syqxzOptions: [], // 所有权性质字典
  194. syqxzText: null, // 所有权性质标签名
  195. showOwnership: false, // 控制所有权性质字典弹出层的显示和隐藏
  196. dklbOptions: [], // 地块类别字典
  197. dklbText: null, // 地块类别标签名
  198. showLandCategory: false, // 控制的地块类别字典弹出层的显示和隐藏
  199. dldjOptions: [], // 地力等级字典
  200. dldjText: null, // 地力等级标签名
  201. showLandGrade: false, // 控制地力等级字典弹出层的显示和隐藏
  202. tdytOptions: [], // 土地用途字典
  203. tdytText: null, // 土地用途标签名
  204. showLandPurpose: false, // 控制土地用途字典弹出层的显示和隐藏
  205. tdlylxOptions: [], // 土地利用类型
  206. tdlylxText: null, // 土地利用类型标签名
  207. showLandType: false, // 控制土地利用类型字典弹出层的显示和隐藏
  208. sfjbntOptions: [], // 是否基本农田字典
  209. showSaveBtn: false, // 控制保存按钮的显示隐藏
  210. showDeleteBtn: false, // 控制删除按钮的显示隐藏
  211. isDisabled: false, // 是否禁用
  212. taskStatus: null, // 调查任务的完成状态:1表示已完成,2表示未完成
  213. landCategory: ['10'], // 地块类别
  214. showLegend:true
  215. };
  216. },
  217. created() {
  218. this.taskStatus = Cookies.get('taskStatus');
  219. this.getDicts("land_ownership").then(response => {
  220. this.syqxzOptions = response.data;
  221. });
  222. this.getDicts("land_type").then(response => {
  223. this.dklbOptions = response.data;
  224. // 去除地块类别中的承包地块选项
  225. let index = this.dklbOptions.findIndex(item => item.dictValue === '10');
  226. this.dklbOptions.splice(index, 1);
  227. });
  228. this.getDicts("land_grade").then(response => {
  229. this.dldjOptions = response.data;
  230. });
  231. this.getDicts("use_code").then(response => {
  232. this.tdytOptions = response.data;
  233. });
  234. this.getDicts("land_use").then(response => {
  235. this.tdlylxOptions = response.data;
  236. });
  237. this.getDicts("is_common").then(response => {
  238. this.sfjbntOptions = response.data;
  239. });
  240. // 获取geoserver的地址
  241. this.getGeoServerUrl();
  242. // 获取地块图层名称
  243. this.getLandLayerName();
  244. // 获取村边界的图层名称
  245. this.getVillageBorderLayerName();
  246. },
  247. mounted() {
  248. // 初始化地图
  249. setTimeout(() => {
  250. this.initMap();
  251. }, 500);
  252. },
  253. methods: {
  254. // 获取geoserver的地址
  255. getGeoServerUrl() {
  256. getConfigKey("system.geoServer.url").then(response => {
  257. this.mapGeoServerUrl = response.msg;
  258. });
  259. },
  260. // 获取地块图层名称
  261. getLandLayerName() {
  262. getConfigKey("geoserver.layer.landCategory").then(response => {
  263. this.landLayerName = response.msg;
  264. });
  265. },
  266. // 获取村边界的图层名称
  267. getVillageBorderLayerName() {
  268. getConfigKey("geoserver.layer.villageBorder").then(response => {
  269. this.villageBorderLayerName = response.msg;
  270. });
  271. },
  272. // 初始化地图
  273. initMap() {
  274. getDept(this.$route.query.deptId).then(response => {
  275. let dept = response.data;
  276. if (dept.lng && dept.lat) {
  277. this.mapCenterLocation = [dept.lng, dept.lat];
  278. } else {
  279. this.mapCenterLocation = [116.391458, 39.902377];
  280. }
  281. document.getElementById("landMapBox").innerHTML = "";
  282. // 定义地图投影
  283. let projection = new ol.proj.Projection({
  284. code: "EPSG:3857",
  285. units: "degrees",
  286. });
  287. // 定义地图图层
  288. let aerial = new ol.layer.Tile({
  289. source: new ol.source.XYZ({
  290. url: "http://t{0-7}.tianditu.com/img_w/wmts?" +
  291. "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
  292. "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067",
  293. }),
  294. isGroup: true,
  295. name: "卫星影像图",
  296. });
  297. let yingxzi = new ol.layer.Tile({
  298. source: new ol.source.XYZ({
  299. url: "http://t{0-7}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067",
  300. }),
  301. isGroup: true,
  302. name: "天地图文字标注--卫星影像图",
  303. });
  304. //加载地图
  305. this.map = new ol.Map({
  306. controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]),
  307. layers: [aerial, yingxzi],
  308. projection: projection,
  309. target: "landMapBox",
  310. view: new ol.View({
  311. center: ol.proj.fromLonLat(this.mapCenterLocation), // 地图中心坐标
  312. zoom: 15.5,
  313. minZoom: 1, //地图缩小限制
  314. maxZoom: 18, //地图放大限制
  315. // extent: [13481224.75161,5667110.83528,13811063.06278,5880284.11416]
  316. }),
  317. });
  318. // // 添加村边界
  319. this.addVillageBorder();
  320. // 添加地块图层
  321. this.addLandLayer();
  322. // 绘制地块
  323. $("#drawLandPolygon").click(() => {
  324. // 创建矢量数据源
  325. let vectorSource = new ol.source.Vector({
  326. wrapX: false,
  327. });
  328. // 创建矢量图层
  329. this.vectorLayer = new ol.layer.Vector({
  330. source: vectorSource,
  331. });
  332. // 添加图层
  333. this.map.addLayer(this.vectorLayer);
  334. // 地图交互-绘制图形
  335. let drawInteraction = new ol.interaction.Draw({
  336. source: vectorSource,
  337. type: "Polygon",
  338. });
  339. // 添加交互
  340. this.map.addInteraction(drawInteraction);
  341. drawInteraction.on('drawend', (evt) => {
  342. // 移除交互
  343. this.map.removeInteraction(drawInteraction);
  344. let coordinates = evt.feature.getGeometry().getCoordinates();
  345. this.reset();
  346. this.form.theGeom = JSON.stringify(coordinates);
  347. this.title = "添加地块信息";
  348. this.showSaveBtn = true;
  349. this.showDeleteBtn = false;
  350. this.isDisabled = false;
  351. setTimeout(() => {
  352. this.open = true;
  353. }, 10);
  354. });
  355. });
  356. // 地图点击事件
  357. this.map.on("click", (evt) => {
  358. // 点击宅基地查看详情
  359. if (this.landLayer) {
  360. const viewResolution = this.map.getView().getResolution();
  361. const url = this.landLayer.getSource()
  362. .getFeatureInfoUrl(evt.coordinate, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'application/json'});
  363. if (url) {
  364. fetch(url)
  365. .then(response => response.json())
  366. .then(data => {
  367. if (data.features.length > 0) {
  368. let id = data.features[0].id.split(".")[1];
  369. getDk(id).then(response => {
  370. const data = response.data;
  371. this.reset();
  372. this.form = data;
  373. this.syqxzText = this.selectDictLabel(this.syqxzOptions, data.syqxz);
  374. if (data.dklb === '10') {
  375. this.dklbText = '承包地块';
  376. } else {
  377. this.dklbText = this.selectDictLabel(this.dklbOptions, data.dklb);
  378. }
  379. this.dldjText = this.selectDictLabel(this.dldjOptions, data.dldj);
  380. this.tdytText = this.selectDictLabel(this.tdytOptions, data.tdyt);
  381. this.tdlylxText = this.selectDictLabel(this.tdlylxOptions, data.tdlylx);
  382. this.title = "查看地块信息";
  383. this.showSaveBtn = false;
  384. this.showDeleteBtn = true;
  385. this.isDisabled = true;
  386. setTimeout(() => {
  387. this.open = true;
  388. }, 10);
  389. });
  390. /* if (this.selectedHomesteadLayer) {
  391. this.map.removeLayer(this.selectedHomesteadLayer);
  392. this.selectedHomesteadLayer = "";
  393. }
  394. this.selectedHomesteadLayer = new ol.layer.Vector({
  395. source: new ol.source.Vector({
  396. features: new ol.format.GeoJSON().readFeatures(data)
  397. }),
  398. name: 'selectedHomesteadLayer',
  399. style: new ol.style.Style({
  400. fill: new ol.style.Fill({
  401. //矢量图层填充颜色,以及透明度
  402. color: "rgba(255, 84, 87, 0.3)",
  403. }),
  404. stroke: new ol.style.Stroke({
  405. //边界样式
  406. color: "#ff5457",
  407. width: 3,
  408. }),
  409. })
  410. });
  411. // this.map.addLayer(this.selectedHomesteadLayer);
  412. this.map.getLayers().insertAt(4, this.selectedHomesteadLayer);*/
  413. }
  414. });
  415. }
  416. }
  417. });
  418. });
  419. },
  420. filterLandLayer() {
  421. if (this.landLayer) {
  422. this.map.removeLayer(this.landLayer);
  423. this.landLayer = "";
  424. }
  425. this.addLandLayer();
  426. },
  427. // 添加地块图层
  428. addLandLayer() {
  429. this.landLayer = new ol.layer.Image({
  430. source: new ol.source.ImageWMS({
  431. url: this.mapGeoServerUrl + '/wms',
  432. params: {
  433. LAYERS: this.landLayerName,
  434. cql_filter: "dept_id = '" + this.$route.query.deptId + "' and DKLB in (" + this.landCategory + ")",
  435. SRID: 3857,
  436. abc: Math.random() // 无效参数,保证每次发送的请求都不一样
  437. }
  438. }),
  439. name: 'landLayer'
  440. });
  441. this.map.getLayers().insertAt(3, this.landLayer);
  442. // this.map.addLayer(this.landLayer);
  443. },
  444. // 添加村边界
  445. addVillageBorder() {
  446. this.mapBorder = new ol.layer.Image({
  447. source: new ol.source.ImageWMS({
  448. url: this.mapGeoServerUrl + '/wms',
  449. params: {
  450. LAYERS: this.villageBorderLayerName,
  451. cql_filter: "dept_id = '" + this.$route.query.deptId + "'",
  452. SRID: 3857,
  453. },
  454. }),
  455. name: 'villageBorderLayer'
  456. });
  457. this.map.getLayers().insertAt(2, this.mapBorder);
  458. },
  459. saveLand() {
  460. this.$refs.landForm.validate().then(() => {
  461. if (this.form.id) {
  462. this.showSaveBtn = false;
  463. updateDk(this.form).then(response => {
  464. if (response.code == 200) {
  465. this.$toast({
  466. icon: 'success',
  467. message: '保存成功',
  468. duration:"1000",
  469. onClose: () => {
  470. this.open = false;
  471. this.showSaveBtn = true;
  472. }
  473. });
  474. }
  475. });
  476. } else {
  477. this.form.deptId = this.$route.query.deptId;
  478. this.showSaveBtn = false;
  479. addDk(this.form).then(response => {
  480. if (response.code == 200) {
  481. this.$toast({
  482. icon: 'success',
  483. message: '保存成功',
  484. duration:"1000",
  485. onClose: () => {
  486. this.open = false;
  487. this.showSaveBtn = true;
  488. // 移除矢量图层
  489. this.map.removeLayer(this.vectorLayer);
  490. this.vectorLayer = "";
  491. // 移除地块图层重新加载
  492. this.map.removeLayer(this.landLayer);
  493. this.landLayer = "";
  494. this.addLandLayer();
  495. }
  496. });
  497. }
  498. });
  499. }
  500. }).catch(() => {
  501. this.$notify({ type: 'danger', message: '请填写完整的表单项' });
  502. });
  503. },
  504. deleteLand(id) {
  505. this.$dialog.confirm({
  506. message: '是否确认删除此地块?',
  507. }).then(() => {
  508. // on confirm
  509. this.showDeleteBtn = false;
  510. deleteDk(id).then(res => {
  511. if (res.code == 200) {
  512. this.$toast({
  513. icon: 'success',
  514. message: '删除成功',
  515. duration: "1000",
  516. onClose: () => {
  517. this.open = false;
  518. this.showDeleteBtn = true;
  519. // 移除地块图层重新加载
  520. this.map.removeLayer(this.landLayer);
  521. this.landLayer = "";
  522. this.addLandLayer();
  523. }
  524. });
  525. }
  526. });
  527. }).catch(() => {
  528. // on cancel
  529. });
  530. },
  531. onConfirmOwnershipOptions(value){
  532. this.form.syqxz = value.dictValue;
  533. this.syqxzText = value.dictLabel;
  534. this.showOwnership = false;
  535. },
  536. onConfirmLandCategoryOptions(value){
  537. this.form.dklb = value.dictValue;
  538. this.dklbText = value.dictLabel;
  539. this.showLandCategory = false;
  540. },
  541. onConfirmLandTypeOptions(value) {
  542. this.form.tdlylx = value.dictValue;
  543. this.tdlylxText = value.dictLabel;
  544. this.showLandType = false;
  545. },
  546. onConfirmLandGradeOptions(value) {
  547. this.form.dldj = value.dictValue
  548. this.dldjText = value.dictLabel;
  549. this.showLandGrade = false;
  550. },
  551. onConfirmLandPurposeOptions(value){
  552. this.form.tdyt = value.dictValue;
  553. this.tdytText = value.dictLabel;
  554. this.showLandPurpose = false;
  555. },
  556. generateCode() {
  557. generateLandCode({deptId: this.$route.query.deptId}).then(response => {
  558. this.$set(this.form, 'dkbm', response.data);
  559. });
  560. },
  561. closePopup() {
  562. // 移除矢量图层
  563. if (this.vectorLayer) {
  564. this.map.removeLayer(this.vectorLayer);
  565. this.vectorLayer = "";
  566. }
  567. this.open = false;
  568. this.reset();
  569. },
  570. reset() {
  571. this.form = {
  572. deptId: null,
  573. dkbm: null,
  574. dkmc: null,
  575. syqxz: '30',
  576. dklb: '99',
  577. tdlylx: '01',
  578. dldj: '01',
  579. tdyt: '1',
  580. sfjbnt: '1',
  581. scmjm: null,
  582. zjrxm: null,
  583. dkdz: null,
  584. dkxz: null,
  585. dknz: null,
  586. dkbz: null,
  587. dkbzxx: null,
  588. theGeom: null
  589. };
  590. this.syqxzText = '集体土地所有权';
  591. this.dklbText = '其他集体土地';
  592. this.tdlylxText = '【1】耕地';
  593. this.dldjText = '一等地';
  594. this.tdytText = '种植业';
  595. },
  596. openLandCategoryPopup() {
  597. // 修改时 && 地块类别为承包地块 不允许打开地块类别弹出层
  598. if (this.form.id && this.form.dklb === '10') {
  599. this.$toast({
  600. icon: 'fail',
  601. message: '当前地块为承包地块,不能更改地块类别',
  602. duration: '2000'
  603. })
  604. return ;
  605. }
  606. this.showLandCategory = true;
  607. }
  608. },
  609. };
  610. </script>
  611. <style scoped lang="scss">
  612. .app-container{
  613. background: #fff url("../../../../../static/images/contracted/contracted_index_bg.png") no-repeat center;
  614. background-size: 100% 100%;
  615. height: 100vh;
  616. }
  617. /deep/ .van-nav-bar{
  618. background: transparent;
  619. }
  620. /deep/ .van-nav-bar .van-icon{
  621. color: #000000;
  622. }
  623. /deep/ .van-hairline--bottom::after{
  624. border: none;
  625. }
  626. /deep/ .van-field--disabled .van-field__label {
  627. color: #646566;
  628. }
  629. /deep/ .landPopup .van-dialog {
  630. width: 90%;
  631. height: 85%;
  632. overflow-y: auto;
  633. }
  634. /deep/ .landPopup .van-field__label {
  635. width: 7em;
  636. }
  637. .head{
  638. padding: 0 4vw;
  639. }
  640. .tap_block{
  641. width: 100%;
  642. display: flex;
  643. justify-content: space-between;
  644. background: #ebfaf2;
  645. padding: 2PX 4PX;
  646. border-radius: 10PX;
  647. margin-top: 1vh;
  648. .active{
  649. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  650. box-shadow: 0 0 10PX #cccccc;
  651. color: #333333;
  652. }
  653. p{
  654. width: 25%;
  655. text-align: center;
  656. padding: 5PX 0;
  657. border-radius: 10PX;
  658. color: #666666;
  659. }
  660. }
  661. .legend_main{
  662. position: absolute;
  663. top: 2vh;
  664. right: 2vw;
  665. }
  666. .openLegend{
  667. position: absolute;
  668. top: 2vh;
  669. right: 0vw;
  670. background-color: rgba(255,255,255,.5);
  671. width: 20PX;
  672. height: 70PX;
  673. display: flex;
  674. align-items: center;
  675. justify-content: center;
  676. border-top-left-radius: 10PX;
  677. border-bottom-left-radius: 10PX;
  678. .sanjiao-left {
  679. display: inline-block;
  680. border-right: 8PX solid #999999;
  681. border-right-color: initial;
  682. border-top: 5PX solid transparent;
  683. border-bottom: 5PX solid transparent;
  684. }
  685. }
  686. .legend_second{
  687. background: rgba(255,255,255,.5);
  688. padding: 2vh;
  689. border-radius: 10PX;
  690. margin-top: 2vh;
  691. }
  692. .legend_tt{
  693. font-size: 16PX;
  694. display: flex;
  695. align-items: center;
  696. justify-content: space-between;
  697. img{
  698. width: 20PX;
  699. }
  700. }
  701. .legend{
  702. background: rgba(255,255,255,.5);
  703. padding: 2vh;
  704. border-radius: 10PX;
  705. .van-checkbox{
  706. margin-top: 2vh;
  707. &:nth-child(1){
  708. /deep/ .van-checkbox__icon .van-icon{
  709. border-color: rgba(22,233,15,1);
  710. }
  711. }
  712. &:nth-child(2){
  713. /deep/ .van-checkbox__icon .van-icon{
  714. border-color: rgba(1,198,222,1);
  715. }
  716. }
  717. &:nth-child(3){
  718. /deep/ .van-checkbox__icon .van-icon{
  719. border-color: rgba(238,238,0,1);
  720. }
  721. }
  722. &:nth-child(4){
  723. /deep/ .van-checkbox__icon .van-icon{
  724. border-color: rgba(238,60,60,1);
  725. }
  726. }
  727. &:nth-child(5){
  728. /deep/ .van-checkbox__icon .van-icon{
  729. border-color: rgba(235,134,0,1);
  730. }
  731. }
  732. }
  733. .van-checkbox-group {
  734. .van-checkbox__label{
  735. i{
  736. display: block;
  737. width: 15PX;
  738. height: 15PX;
  739. border: 1px solid;
  740. border-radius: 3PX;
  741. margin-left: 10PX;
  742. }
  743. .i1{
  744. background: rgba(22,233,15,.7);
  745. border-color: rgba(22,233,15,1);
  746. }
  747. .i2{
  748. background: rgba(1,198,222,.7);
  749. border-color: rgba(1,198,222,1);
  750. }
  751. .i3{
  752. background: rgba(238,238,0,.7);
  753. border-color: rgba(238,238,0,1);
  754. }
  755. .i4{
  756. background: rgba(238,60,60,.7);
  757. border-color: rgba(238,60,60,1);
  758. }
  759. .i5{
  760. background: rgba(235,134,0,.7);
  761. border-color: rgba(235,134,0,1);
  762. }
  763. div{
  764. display: flex;
  765. align-items: center;
  766. }
  767. }
  768. }
  769. }
  770. .mapBox{
  771. margin-top: 2vh;
  772. height: 88vh;
  773. width: 100%;
  774. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  775. }
  776. .footer_main {
  777. flex: 0 0 120px;
  778. background: #ccc;
  779. display: flex;
  780. justify-content: center; /* 相对父元素水平居中 */
  781. align-items: center; /* 子元素相对父元素垂直居中 */
  782. }
  783. </style>