|
@@ -659,6 +659,17 @@ import { esriConfig, appconfig } from "staticPub/config";
|
|
|
import request from "@/utils/request";
|
|
|
import { getMaterialList, getAvgPress } from "@/api/DMA/zoningManage";
|
|
|
import { queryDevice } from "@/api/scadaApi";
|
|
|
+import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer";
|
|
|
+import { OSM, XYZ, Vector as VectorSource } from "ol/source";
|
|
|
+import {
|
|
|
+ Style,
|
|
|
+ Circle,
|
|
|
+ Icon,
|
|
|
+ Fill,
|
|
|
+ RegularShape,
|
|
|
+ Stroke,
|
|
|
+ Text,
|
|
|
+} from "ol/style";
|
|
|
import olMap from "@/views/components/olMap/index.vue";
|
|
|
import { drawTools } from "@/views/components/drawTools";
|
|
|
import { queryByGeoserver } from "@/views/components/mapQueryTools/queryByGeoserver";
|
|
@@ -674,7 +685,7 @@ export default {
|
|
|
viewDiv: HTMLDivElement,
|
|
|
treeData: Array,
|
|
|
options: Object,
|
|
|
- that: Object,
|
|
|
+ that: Object
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -735,6 +746,8 @@ export default {
|
|
|
drawFeature: null,
|
|
|
queryByGeoserver: queryByGeoserver,
|
|
|
geoservers: mapConfig.geoservers || [],
|
|
|
+ vectorSource: null,
|
|
|
+ vectorLayer: null,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -806,9 +819,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
-
|
|
|
- },
|
|
|
+ mounted() {},
|
|
|
destroyed() {},
|
|
|
methods: {
|
|
|
init() {
|
|
@@ -854,7 +865,194 @@ export default {
|
|
|
open(type, row) {
|
|
|
this.diaVisiable = true;
|
|
|
this.isHavePolygon = false;
|
|
|
- this.type = type
|
|
|
+ var sd = this.selectDMA
|
|
|
+ var ap = this.addPipe
|
|
|
+ this.type = type;
|
|
|
+ var cuurId = this.that.currId
|
|
|
+ switch (type) {
|
|
|
+ case 0: // 新建
|
|
|
+ ap.materialType = "";
|
|
|
+ ap.fixYear = "";
|
|
|
+ ap.villageType = "";
|
|
|
+ sd.id = "";
|
|
|
+ sd.isLongWayWatch = false;
|
|
|
+ sd.dmaCode = "";
|
|
|
+ sd.dmaName = "";
|
|
|
+ this.mineStatusLevel = cuurId.partitionLevel || 0
|
|
|
+ this.mineStatusValue = sd.pid = cuurId.id
|
|
|
+ this.mineStatusLabel = cuurId.dmaName
|
|
|
+ this.pidChange();
|
|
|
+ sd.areas = "";
|
|
|
+ sd.pipeLen = "";
|
|
|
+ sd.minDiff = 0;
|
|
|
+ sd.maxDiff = 100;
|
|
|
+ sd.refStandard = "";
|
|
|
+ sd.notes = "";
|
|
|
+ sd.userPipeLen = 0;
|
|
|
+ sd.avgPressure = 0;
|
|
|
+ sd.pointNumber = 0;
|
|
|
+ sd.otherWater = 0;
|
|
|
+ this.pipeTable = [];
|
|
|
+ this.areaMonitorData = [];
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ case 2:
|
|
|
+ this.loading = true;
|
|
|
+ var callback = () => {
|
|
|
+ if (++doneNum == 2) this.loading = false;
|
|
|
+ };
|
|
|
+ var doneNum = 0;
|
|
|
+ request({
|
|
|
+ url: "/gis/area/getDetailById?id=" + row.id,
|
|
|
+ method: "get",
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ var {
|
|
|
+ dmaregion,
|
|
|
+ pipeList,
|
|
|
+ dmaandobserList,
|
|
|
+ deviceArchiveManageList,
|
|
|
+ } = res.result;
|
|
|
+ var id;
|
|
|
+ this.dmatableList = [];
|
|
|
+ if (dmaregion) {
|
|
|
+ id = dmaregion.id;
|
|
|
+ if (dmaregion.geometry) {
|
|
|
+ this.isHavePolygon = true;
|
|
|
+ var geo = JSON.parse(dmaregion.geometry);
|
|
|
+ var view = this.view;
|
|
|
+ this.lineWeight = geo.symbol.outline.width;
|
|
|
+ this.opacity = geo.symbol.color[3];
|
|
|
+ this.lineColor = geo.symbol.outline.color;
|
|
|
+ this.polygonColor =
|
|
|
+ "rgb(" + geo.symbol.color.slice(0, 3).join(",") + ")";
|
|
|
+ this.polygon.geometry = {
|
|
|
+ type: "polygon",
|
|
|
+ rings: [geo.rings],
|
|
|
+ spatialReference: view.spatialReference,
|
|
|
+ };
|
|
|
+ this.polygon.symbol = {
|
|
|
+ type: "simple-fill",
|
|
|
+ color: geo.symbol.color,
|
|
|
+ outline: {
|
|
|
+ color: geo.symbol.outline.color,
|
|
|
+ width: geo.symbol.outline.width + "px",
|
|
|
+ },
|
|
|
+ };
|
|
|
+ view.goTo(this.polygon.geometry.extent);
|
|
|
+ } else {
|
|
|
+ this.deleteDraw();
|
|
|
+ }
|
|
|
+ sd.id = dmaregion.id;
|
|
|
+ sd.dmaCode = dmaregion.dmaCode;
|
|
|
+ sd.dmaName = dmaregion.dmaName;
|
|
|
+ this.mineStatusLevel = dmaregion.partitionLevel - 1 || 0;
|
|
|
+ this.mineStatusValue = sd.pid = dmaregion.pid;
|
|
|
+ this.mineStatusLabel = dmaregion.pname;
|
|
|
+ sd.areas = dmaregion.areas;
|
|
|
+ sd.pipeLen = dmaregion.pipeLen;
|
|
|
+ sd.minDiff = dmaregion.minDiff || 0;
|
|
|
+ sd.maxDiff = dmaregion.maxDiff || 0;
|
|
|
+ sd.refStandard = dmaregion.refStandard;
|
|
|
+ sd.isLongWayWatch = dmaregion.isyc == "1";
|
|
|
+ sd.notes = dmaregion.notes;
|
|
|
+ // 2021-11-25 add by tmx
|
|
|
+ sd.userPipeLen = dmaregion.userPipeLen || 0;
|
|
|
+ sd.avgPressure = dmaregion.avgPressure || 0;
|
|
|
+ sd.pointNumber = dmaregion.pointNumber || 0;
|
|
|
+ sd.otherWater = dmaregion.otherWater || 0;
|
|
|
+ // ---------end----------
|
|
|
+ if (dmaandobserList) {
|
|
|
+ dmaandobserList = dmaandobserList.filter((item) => {
|
|
|
+ return (item.lgtd != null) & (item.lttd != null);
|
|
|
+ });
|
|
|
+ var index = {};
|
|
|
+ var watchIndex = this.TF_options.watchIndex;
|
|
|
+ var symbol = (text) => {
|
|
|
+ return {
|
|
|
+ type: "text",
|
|
|
+ color: "white",
|
|
|
+ haloColor: "black",
|
|
|
+ haloSize: "1px",
|
|
|
+ text: text || "",
|
|
|
+ verticalAlignment: "bottom",
|
|
|
+ font: { size: "14px", weight: "bold" },
|
|
|
+ };
|
|
|
+ };
|
|
|
+ var ids = this.dmatableList.map((e) => {
|
|
|
+ e.select = false;
|
|
|
+ watchIndex[e.id].TF_outText.symbol = symbol();
|
|
|
+ index[e.id] = e;
|
|
|
+ return e.id;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (this.type == 2) this.dmatableList = [];
|
|
|
+ const items = dmaandobserList || [];
|
|
|
+ this.cacheDmaTable = dmaandobserList;
|
|
|
+ for (var i = 0, ii = items.length; i < ii; i++) {
|
|
|
+ var dr = items[i];
|
|
|
+ var text = "";
|
|
|
+ if (ids.indexOf(dr.tableId) > -1) {
|
|
|
+ var dw = index[dr.tableId];
|
|
|
+ dw.select = true;
|
|
|
+ text = dr.isout == "1" ? "出口" : "入口";
|
|
|
+ dw.isout = dr.isout == "1";
|
|
|
+ if (this.type == 2)
|
|
|
+ this.dmatableList.push({
|
|
|
+ id: dr.tableId,
|
|
|
+ schName: dr.tableName,
|
|
|
+ select: true,
|
|
|
+ isout: dw.isout,
|
|
|
+ lgtd: dw.lgtd,
|
|
|
+ lttd: dw.lttd,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.dmatableList.push({
|
|
|
+ id: dr.tableId,
|
|
|
+ schName: dr.tableName,
|
|
|
+ select: true,
|
|
|
+ isout: dr.isout == "1",
|
|
|
+ lgtd: dw.lgtd,
|
|
|
+ lttd: dw.lttd,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ watchIndex[dr.tableId].TF_outText.symbol = symbol(text);
|
|
|
+ }
|
|
|
+ } else this.$message.error("查询观察表失败");
|
|
|
+ callback();
|
|
|
+ // })
|
|
|
+ } else {
|
|
|
+ sd.dmaCode = "";
|
|
|
+ sd.dmaName = "";
|
|
|
+ this.mineStatusLevel = cuurId.partitionLevel || 0;
|
|
|
+ this.mineStatusValue = sd.pid = cuurId.id;
|
|
|
+ this.mineStatusLabel = cuurId.dmaName;
|
|
|
+ sd.areas = "";
|
|
|
+ sd.minDiff = 0;
|
|
|
+ sd.maxDiff = 100;
|
|
|
+ sd.refStandard = "";
|
|
|
+ this.deleteDraw();
|
|
|
+ }
|
|
|
+ if (pipeList) {
|
|
|
+ this.pipeTable = pipeList.map((e) => {
|
|
|
+ return {
|
|
|
+ id: e.id,
|
|
|
+ villageType: Number(e.villageType),
|
|
|
+ fixYear: Number(e.fixYear),
|
|
|
+ pipeLen: Number(e.pipeLen),
|
|
|
+ materialType: e.materialType,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else this.pipeTable = [];
|
|
|
+ if (deviceArchiveManageList) {
|
|
|
+ this.areaMonitorData = deviceArchiveManageList;
|
|
|
+ } else this.areaMonitorData = [];
|
|
|
+ this.pidChange();
|
|
|
+ } else this.$message.error("查询失败");
|
|
|
+ callback();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
loadMap() {
|
|
@@ -906,7 +1104,7 @@ export default {
|
|
|
if (this.drawFeature) {
|
|
|
this.isHavePolygon = true;
|
|
|
this.queryFeaturesByPolygon();
|
|
|
- this.polygon = fearure
|
|
|
+ this.polygon = fearure;
|
|
|
}
|
|
|
};
|
|
|
if (olMap) {
|
|
@@ -954,26 +1152,28 @@ export default {
|
|
|
this.$message.error("查询管线出错");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (this.$refs.olmap) {
|
|
|
let map = this.$refs.olmap.map;
|
|
|
- let vectorLayer = null
|
|
|
+ let vectorLayer = null;
|
|
|
const layers = map.getLayers().getArray();
|
|
|
for (let index = 0; index < layers.length; index++) {
|
|
|
const layer = layers[index];
|
|
|
if (layer.get("type") == "layer" && layer.get("name") == "监测点") {
|
|
|
- vectorLayer = layer
|
|
|
+ vectorLayer = layer;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(vectorLayer && this.drawFeature && this.queryByGeoserver){
|
|
|
- const vector = this.queryByGeoserver.getFeatureByTurf(vectorLayer,this.drawFeature)
|
|
|
- if(vector && vector.features){
|
|
|
- const features = vector.features
|
|
|
- this.getEquipmentData(features)
|
|
|
+ if (vectorLayer && this.drawFeature && this.queryByGeoserver) {
|
|
|
+ const vector = this.queryByGeoserver.getFeatureByTurf(
|
|
|
+ vectorLayer,
|
|
|
+ this.drawFeature
|
|
|
+ );
|
|
|
+ if (vector && vector.features) {
|
|
|
+ const features = vector.features;
|
|
|
+ this.getEquipmentData(features);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -1049,45 +1249,33 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 解析设备数据
|
|
|
- */
|
|
|
- getEquipmentData(features){
|
|
|
- this.dmatableList = []
|
|
|
- if(features){
|
|
|
- features.map(fea=>{
|
|
|
- const properties = fea.properties
|
|
|
+ */
|
|
|
+ getEquipmentData(features) {
|
|
|
+ this.dmatableList = [];
|
|
|
+ if (features) {
|
|
|
+ features.map((fea) => {
|
|
|
+ const properties = fea.properties;
|
|
|
this.dmatableList.push({
|
|
|
- schName:properties.name, //观察表名称
|
|
|
- isout:false,
|
|
|
- select:true
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
+ schName: properties.name, //观察表名称
|
|
|
+ isout: false,
|
|
|
+ select: true,
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- editDraw() {
|
|
|
-
|
|
|
- },
|
|
|
+ editDraw() {},
|
|
|
|
|
|
- editCancel() {
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
+ editCancel() {},
|
|
|
|
|
|
editTrue(cb) {
|
|
|
- var callback = cb;
|
|
|
this.clearEdit();
|
|
|
- this.queryContainsWatch();
|
|
|
- this.getPipeLength(callback);
|
|
|
- this.queryPipeByGeometry();
|
|
|
},
|
|
|
|
|
|
- clearEdit() {
|
|
|
-
|
|
|
- },
|
|
|
+ clearEdit() {},
|
|
|
|
|
|
deleteDraw() {
|
|
|
//this.clearDraw();
|
|
@@ -1098,7 +1286,7 @@ export default {
|
|
|
this.isHavePolygon = false;
|
|
|
this.pipeTable = []; // 清除获取到的数据
|
|
|
this.areaMonitorData = [];
|
|
|
- this.dmatableList = [] //清空观察表数据
|
|
|
+ this.dmatableList = []; //清空观察表数据
|
|
|
var watchs = this.TF_options.watchs;
|
|
|
for (var i = 0, ii = watchs.length; i < ii; i++) {
|
|
|
watchs[i].TF_fea.symbol = {
|
|
@@ -1172,75 +1360,133 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getPipeLength(cb) {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
/**
|
|
|
- * describe 获取绘制区域内的所有管线数据 2021-11-24 add tmx
|
|
|
- */
|
|
|
- queryPipeByGeometry() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- queryContainsWatch() {
|
|
|
-
|
|
|
- },
|
|
|
- pidChange() {
|
|
|
- this.pidLoading = true;
|
|
|
- var view = this.view;
|
|
|
- var graphic = view.TF_Graphic;
|
|
|
- var player = view.TF_DMAParent;
|
|
|
- var blayer = view.TF_DMABother;
|
|
|
- var sp = view.spatialReference;
|
|
|
- var id = this.selectDMA.id || -1;
|
|
|
- var level = this.mineStatusLevel + 1;
|
|
|
- var pid = this.mineStatusValue;
|
|
|
- player.removeAll();
|
|
|
- blayer.removeAll();
|
|
|
+ * 父级ID改变
|
|
|
+ */
|
|
|
+ pidChange() {
|
|
|
+ var pid = this.mineStatusValue
|
|
|
request({
|
|
|
url: "/gis/area/partitionById?size=300&id=" + pid,
|
|
|
method: "get",
|
|
|
}).then((res) => {
|
|
|
if (res.code == 1) {
|
|
|
- res = res.result.region.records;
|
|
|
- var rowsP = undefined;
|
|
|
- var rowsB = [];
|
|
|
- for (var i = 0, il = res, ii = il.length; i < ii; i++) {
|
|
|
- if (il[i].geometry) {
|
|
|
- var di = il[i];
|
|
|
- if (di.id == id) continue;
|
|
|
- var geo = JSON.parse(di.geometry);
|
|
|
- var gra = new graphic({
|
|
|
- geometry: {
|
|
|
- type: "polygon",
|
|
|
- rings: [geo.rings],
|
|
|
- spatialReference: sp,
|
|
|
- },
|
|
|
- symbol: {
|
|
|
- type: "simple-fill",
|
|
|
- color: geo.symbol.color,
|
|
|
- outline: {
|
|
|
- color: geo.symbol.outline.color,
|
|
|
- width: geo.symbol.outline.width + "px",
|
|
|
- },
|
|
|
- },
|
|
|
- });
|
|
|
- if (di.id == pid) rowsP = gra;
|
|
|
- else if (level == di.partitionLevel) rowsB.push(gra);
|
|
|
- }
|
|
|
- }
|
|
|
- if (rowsP) player.add(rowsP);
|
|
|
- if (rowsB.length > 0) blayer.addMany(rowsB);
|
|
|
+ res = res.result.region.records
|
|
|
+ this.showSourceVector(res)
|
|
|
} else this.$message.error("获取分区信息列表失败:" + res.message);
|
|
|
- this.pidLoading = false;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * 显示要素
|
|
|
+ */
|
|
|
+ showSourceVector(tableData) {
|
|
|
+ this.removeFeature();
|
|
|
+ let olMap = this.$refs.olmap;
|
|
|
+ let map = olMap.map
|
|
|
+ if (this.vectorSource == null)
|
|
|
+ this.vectorSource = new VectorSource({ wrapX: false });
|
|
|
+ if (this.vectorLayer == null) {
|
|
|
+ this.vectorLayer = new VectorLayer({ source: this.vectorSource });
|
|
|
+ map.addLayer(this.vectorLayer);
|
|
|
+ }
|
|
|
+ tableData.forEach((item, index) => {
|
|
|
+ const dmaName = item.hasOwnProperty("dmaName") ? item.dmaName : "";
|
|
|
+ const strGeo = item.hasOwnProperty("geometry") ? item.geometry : null;
|
|
|
+ if (strGeo) {
|
|
|
+ const jsonGeo = JSON.parse(strGeo);
|
|
|
+ const rings = jsonGeo.hasOwnProperty("rings") ? jsonGeo.rings : null;
|
|
|
+ if (rings == null) return;
|
|
|
+ if (rings.indexOf("POLYGON") != -1) {
|
|
|
+ let feature = new WKT().readFeature(rings);
|
|
|
+ const symbol = jsonGeo.hasOwnProperty("symbol")
|
|
|
+ ? jsonGeo.symbol
|
|
|
+ : null;
|
|
|
+ if (symbol == null) return;
|
|
|
+ const color = symbol.color;
|
|
|
+ const opacity = symbol.opacity;
|
|
|
+ const outline = symbol.outline;
|
|
|
+ const polygonColor = color.match(/rgb\(([\d\D]*?)\)/)[1];
|
|
|
+ let colorArr = polygonColor.split(",");
|
|
|
+ let colorArray = [];
|
|
|
+ colorArr.map((item) => {
|
|
|
+ colorArray.push(parseInt(item.replace(" ", "")));
|
|
|
+ });
|
|
|
+ colorArr.push(parseFloat(opacity))
|
|
|
+ const feaStyle = this.getFeatureStyle(colorArr,outline.width,outline.color,dmaName)
|
|
|
+ //设置样式
|
|
|
+ feature.setStyle(feaStyle)
|
|
|
+ this.vectorSource.addFeature(feature);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置绘制图形样式
|
|
|
+ * @fillColor 图形填错颜色和透明度,如:[255, 255, 255, 0.33]
|
|
|
+ * @outlineWidth 图形边线宽度 如:2
|
|
|
+ * @outlineColor 图形边线颜色:如:#dc5246
|
|
|
+ * @text 显示字体
|
|
|
+ *
|
|
|
+ */
|
|
|
+ getFeatureStyle(fillColor, outlineWidth, outlineColor, text) {
|
|
|
+ return new Style({
|
|
|
+ fill: new Fill({
|
|
|
+ color: fillColor,
|
|
|
+ }),
|
|
|
+ stroke: new Stroke({
|
|
|
+ width: outlineWidth,
|
|
|
+ color: outlineColor,
|
|
|
+ }),
|
|
|
+ text: new Text({
|
|
|
+ font: "16px Microsoft YaHei",
|
|
|
+ text: text,
|
|
|
+ overflow: true,
|
|
|
+ textAlign: "center", // 对齐方式
|
|
|
+ textBaseline: "middle", // 文本基线
|
|
|
+ fill: new Fill({
|
|
|
+ color: "#0e84ba",
|
|
|
+ }),
|
|
|
+ offsetX: 0,
|
|
|
+ }),
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 移除feature
|
|
|
+ */
|
|
|
+ removeFeature() {
|
|
|
+ let that = this;
|
|
|
+ if (this.vectorLayer) {
|
|
|
+ that.vectorLayer
|
|
|
+ .getSource()
|
|
|
+ .getFeatures()
|
|
|
+ .forEach((feature) => {
|
|
|
+ that.vectorLayer.getSource().removeFeature(feature);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 移除VectorLayer
|
|
|
+ */
|
|
|
+ removeVectorLayer() {
|
|
|
+ let that = this;
|
|
|
+ let olMap = this.$refs.olmap;
|
|
|
+ let map = olMap.map
|
|
|
+ that.vectorLayer
|
|
|
+ .getSource()
|
|
|
+ .getFeatures()
|
|
|
+ .forEach((feature) => {
|
|
|
+ that.vectorLayer.getSource().removeFeature(feature);
|
|
|
+ });
|
|
|
+ that.features = [];
|
|
|
+ map.removeLayer(that.vectorLayer);
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 观察表类型改变
|
|
|
- */
|
|
|
+ */
|
|
|
switchChange(row) {
|
|
|
this.TF_options.watchIndex[row.id].TF_outText.symbol = {
|
|
|
type: "text",
|
|
@@ -1255,25 +1501,21 @@ export default {
|
|
|
|
|
|
/**
|
|
|
* 提交编辑
|
|
|
- */
|
|
|
+ */
|
|
|
dialogTrue() {
|
|
|
-
|
|
|
- var newDMA = this.selectDMA;
|
|
|
+ let newDMA = this.selectDMA;
|
|
|
if (!newDMA["dmaName"].trim())
|
|
|
return this.$message.error("请填写分区名称");
|
|
|
if (!this.isHavePolygon) return this.$message.error("请绘制分区");
|
|
|
this.diaTrueDisable = true;
|
|
|
if (this.edit) return this.editTrue(() => this.dialogTrue());
|
|
|
- var fd = new FormData();
|
|
|
- var polygon = this.polygon;
|
|
|
- var jsonFeature = new GeoJSON().writeFeature(polygon);
|
|
|
- let json = JSON.parse(jsonFeature)
|
|
|
-
|
|
|
- var positionList = new WKT().writeFeature(polygon);
|
|
|
- console.log('显示geojso',jsonFeature,json,positionList)
|
|
|
-
|
|
|
- var d = this.polygonColor;
|
|
|
- var data = {
|
|
|
+ let fd = new FormData();
|
|
|
+ let polygon = this.polygon;
|
|
|
+ // var jsonFeature = new GeoJSON().writeFeature(polygon);
|
|
|
+ // let json = JSON.parse(jsonFeature);
|
|
|
+ let positionList = new WKT().writeFeature(polygon);
|
|
|
+ let d = this.polygonColor;
|
|
|
+ let data = {
|
|
|
pid: newDMA["pid"],
|
|
|
dmaCode: newDMA["dmaCode"],
|
|
|
dmaName: newDMA["dmaName"],
|
|
@@ -1283,7 +1525,7 @@ export default {
|
|
|
maxDiff: newDMA["maxDiff"],
|
|
|
isyc: newDMA["isLongWayWatch"] ? "1" : "0",
|
|
|
notes: newDMA["notes"],
|
|
|
-
|
|
|
+
|
|
|
pointNumber: parseInt(newDMA["pointNumber"]),
|
|
|
userPipeLen: parseFloat(newDMA["userPipeLen"]),
|
|
|
avgPressure: parseFloat(newDMA["avgPressure"]),
|
|
@@ -1355,6 +1597,7 @@ export default {
|
|
|
this.$message.success(
|
|
|
(this.type == 0 ? "新建" : "修改") + "分区成功"
|
|
|
);
|
|
|
+ this.$emit('changeDMAList');//触发changeDMAList事件
|
|
|
} else {
|
|
|
this.$message.error(
|
|
|
(this.type == 0 ? "新建" : "修改") + "分区失败"
|
|
@@ -1363,7 +1606,7 @@ export default {
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
this.$message.error((this.type == 0 ? "新建" : "修改") + "分区失败");
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
treeNodeClick(data) {
|
|
|
var node = this.$refs.parentSelect.getCheckedNodes()[0];
|