|
@@ -169,7 +169,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { ShapeUpload } from "@/api/ghss/hgxfx.js";
|
|
|
+import { ShapeUpload, ShapeUploadV1 } from "@/api/ghss/hgxfx.js";
|
|
|
import { ElMessage } from "element-ui";
|
|
|
import { GetXzqhTree } from "@/api/map";
|
|
|
import {
|
|
@@ -248,6 +248,7 @@ export default {
|
|
|
xzfw: "",
|
|
|
xzmj: 0,
|
|
|
feature: null,
|
|
|
+ yptype:1,
|
|
|
},
|
|
|
handlerDraw: null,
|
|
|
draw: null, //绘制
|
|
@@ -261,9 +262,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
creatTb() {
|
|
|
+ this.yptype = 2
|
|
|
this.dialogVisible = false;
|
|
|
this.multipleSelection.forEach((item, index) => {
|
|
|
this.model.xzmj += item.jcmj;
|
|
|
+ this.fileDataID += item.id + ",";
|
|
|
item.type = "图斑上图";
|
|
|
if (item.geom)
|
|
|
loadGeoJSON(item.geom, "#55A1E3", { isfly: true }, (data) => {
|
|
@@ -274,9 +277,12 @@ export default {
|
|
|
});
|
|
|
this.idArr.push(item.jcbh);
|
|
|
});
|
|
|
+ //去掉最后一个逗号(如果不需要去掉,就不用写)
|
|
|
+ if (this.multipleSelection.length > 0) {
|
|
|
+ this.fileDataID = this.fileDataID.substr(0, this.fileDataID.length - 1);
|
|
|
+ }
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
- console.log(val, "====");
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
handleClose(done) {
|
|
@@ -294,7 +300,6 @@ export default {
|
|
|
this.updateObj.val0 = val.startTime;
|
|
|
this.updateObj.val1 = val.endTime;
|
|
|
this.yearsVal = val.quarter;
|
|
|
- console.log(this.updateObj.val0, this.updateObj.val1, this.yearsVal);
|
|
|
},
|
|
|
getXzqTreeData() {
|
|
|
GetXzqhTree().then((res) => {
|
|
@@ -360,11 +365,14 @@ export default {
|
|
|
this.fileList = [fileList[fileList.length - 1]]; //这一步,是展示最后一次选择文件
|
|
|
this.clearAll(false);
|
|
|
}
|
|
|
+ this.yptype = 1
|
|
|
const formdata = new FormData();
|
|
|
formdata.append("file", file.raw);
|
|
|
formdata.append("fromType", 2);
|
|
|
formdata.append("fromRoute", this.$route.path);
|
|
|
- ShapeUpload(formdata).then((res) => {
|
|
|
+ formdata.append("storeStats", 0);
|
|
|
+ formdata.append("followup", "");
|
|
|
+ ShapeUploadV1(formdata).then((res) => {
|
|
|
if (res.success) {
|
|
|
this.model.xzmj = (res.data.area * 0.0015).toFixed(2);
|
|
|
// viewer.entities.removeAll();
|
|
@@ -416,12 +424,12 @@ export default {
|
|
|
//绘制
|
|
|
drawMap() {
|
|
|
this.remove(); //删除选择的图斑
|
|
|
+ this.yptype = 1
|
|
|
if (!window.handlerPolygon) {
|
|
|
common.initHandler("Polygon");
|
|
|
}
|
|
|
common.handlerDrawing("Polygon").then(
|
|
|
(res) => {
|
|
|
- // console.log(res.positions, "------");
|
|
|
//过滤掉高度
|
|
|
const filteredArr = res.positions.filter((item, index) => {
|
|
|
if ((index + 1) % 3 !== 0) {
|
|
@@ -447,13 +455,11 @@ export default {
|
|
|
}
|
|
|
|
|
|
var matrix = listToMatrix(filteredArr, 2);
|
|
|
- // console.log(matrix, "max-----");
|
|
|
|
|
|
matrix.push(matrix[0]);
|
|
|
const geojsonPolygon = turf.polygon([matrix]);
|
|
|
// var parse = require("wellknown"); //引入wellknow
|
|
|
const wktPolygon = parse.stringify(geojsonPolygon);
|
|
|
- // console.log("WKT Polygon:", wktPolygon);
|
|
|
if (this.$props.type == "cutfill") {
|
|
|
this.model.geom = wktPolygon;
|
|
|
this.$emit("cutfill", this.model.geom);
|
|
@@ -468,8 +474,10 @@ export default {
|
|
|
formdata.append("fromType", 1);
|
|
|
formdata.append("geom", wktPolygon);
|
|
|
formdata.append("fromRoute", this.$route.path);
|
|
|
+ formdata.append("storeStats", 0);
|
|
|
+ formdata.append("followup", "");
|
|
|
// this.addPolygon();
|
|
|
- ShapeUpload(formdata).then((res) => {
|
|
|
+ ShapeUploadV1(formdata).then((res) => {
|
|
|
if (res.success) {
|
|
|
this.fileDataID = res.data.id;
|
|
|
this.model.xzmj = (res.data.area * 0.0015).toFixed(2);
|