|
@@ -15,12 +15,11 @@
|
|
|
<div id="uploadingBox">
|
|
|
<div v-show="dataUpState" style="width: 100%">
|
|
|
<el-progress
|
|
|
- :percentage="postDataSize == 0 ? 0 : (postIndex / postDataSize) * 100"
|
|
|
+ :percentage="postIndex == 0 ? 0 : (postIndex / postDataSize) * 100"
|
|
|
:stroke-width="10"
|
|
|
:show-text="false"
|
|
|
></el-progress>
|
|
|
<div>当前进度:{{ postIndex + "/" + postDataSize }}</div>
|
|
|
- <div v-for="(item, index) in postMessageList" :key="index">{{ (index + postIndex) +":"+ item }}</div>
|
|
|
</div>
|
|
|
<el-upload
|
|
|
v-show="!dataUpState"
|
|
@@ -69,9 +68,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
townMap: new Map(),
|
|
|
- postMessageList: [],
|
|
|
dataUpState: false,
|
|
|
- postIndex: 1609,
|
|
|
+ postIndex: 0,
|
|
|
postDataSize: 0,
|
|
|
// 文件目标路径
|
|
|
filePath: "",
|
|
@@ -97,6 +95,7 @@ export default {
|
|
|
},
|
|
|
props: [],
|
|
|
methods: {
|
|
|
+ getMapData() {},
|
|
|
// 当用户点击svg底座时,切换底部菜单显示隐藏状态。
|
|
|
changeShowBottomMenusStatus() {
|
|
|
// 打开弹窗
|
|
@@ -132,16 +131,15 @@ export default {
|
|
|
// let pdData = that.pd.features;
|
|
|
// that.addPreModelData(pdData);
|
|
|
// });
|
|
|
- shp("http://127.0.0.1:5500/nzy_performance/zjz/PermFarmland").then(
|
|
|
- function (geojson) {
|
|
|
- debugger;
|
|
|
- window.geojsontu = geojson;
|
|
|
- that.postDataSize = geojson.features.length;
|
|
|
- that.dataUpState = true;
|
|
|
- let pdData = that.pd.features;
|
|
|
- that.addAllLayerData(pdData);
|
|
|
- }
|
|
|
- );
|
|
|
+ this.$Get(
|
|
|
+ "http://127.0.0.1:5500/output/soil/jlh/zjz/PATROL.geojson"
|
|
|
+ ).then((geojson) => {
|
|
|
+ window.geojsontu = geojson;
|
|
|
+ that.postDataSize = geojson.features.length;
|
|
|
+ that.dataUpState = true;
|
|
|
+ let pdData = that.pd.features;
|
|
|
+ that.addAllLayerData(pdData);
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$message.error(
|
|
|
"浦东新区行政区划数据未获取,请尝试刷新页面并重试!"
|
|
@@ -227,11 +225,11 @@ export default {
|
|
|
pdPolygon != "" &&
|
|
|
turf.intersect(testPolygon, pdPolygon)
|
|
|
) {
|
|
|
- targetProperties.面积 = area;
|
|
|
- targetProperties.性质 = "基本农田被侵占";
|
|
|
- targetProperties.图层构成 = "基本农田和2020年森林";
|
|
|
- targetProperties.镇域名称 = pdData[j].properties.NAME;
|
|
|
- targetProperties.xzqh = this.townMap.get(
|
|
|
+ targetProperties["面积"] = area;
|
|
|
+ targetProperties["性质"] = "基本农田被侵占";
|
|
|
+ targetProperties["图层构成"] = "基本农田和2020年森林";
|
|
|
+ targetProperties["镇域名称"] = pdData[j].properties.NAME;
|
|
|
+ targetProperties["xzqh"] = this.townMap.get(
|
|
|
pdData[j].properties.NAME
|
|
|
);
|
|
|
geojsondata.properties = targetProperties;
|
|
@@ -244,11 +242,11 @@ export default {
|
|
|
(turf.intersect(pdPolygon, outerPolygon) ||
|
|
|
turf.intersect(pdPolygon, innerPolygon))
|
|
|
) {
|
|
|
- targetProperties.面积 = area;
|
|
|
- targetProperties.性质 = "基本农田被侵占";
|
|
|
- targetProperties.图层构成 = "基本农田和2020年森林";
|
|
|
- targetProperties.镇域名称 = pdData[j].properties.NAME;
|
|
|
- targetProperties.xzqh = this.townMap.get(
|
|
|
+ targetProperties["面积"] = area;
|
|
|
+ targetProperties["性质"] = "基本农田被侵占";
|
|
|
+ targetProperties["图层构成"] = "基本农田和2020年森林";
|
|
|
+ targetProperties["镇域名称"] = pdData[j].properties.NAME;
|
|
|
+ targetProperties["xzqh"] = this.townMap.get(
|
|
|
pdData[j].properties.NAME
|
|
|
);
|
|
|
geojsondata.properties = targetProperties;
|
|
@@ -257,11 +255,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (!geojsondata.properties.xzqh) {
|
|
|
- targetProperties.面积 = area;
|
|
|
- targetProperties.性质 = "基本农田被侵占";
|
|
|
- targetProperties.图层构成 = "基本农田和2020年森林";
|
|
|
- targetProperties.镇域名称 = "浦东新区";
|
|
|
- targetProperties.xzqh = 5000000;
|
|
|
+ targetProperties["面积"] = area;
|
|
|
+ targetProperties["性质"] = "基本农田被侵占";
|
|
|
+ targetProperties["图层构成"] = "基本农田和2020年森林";
|
|
|
+ targetProperties["镇域名称"] = "浦东新区";
|
|
|
+ targetProperties["xzqh"] = 5000000;
|
|
|
geojsondata.properties = targetProperties;
|
|
|
}
|
|
|
let xzqh = geojsondata.properties.xzqh;
|
|
@@ -307,20 +305,22 @@ export default {
|
|
|
if (geojsondata && this.postIndex < this.postDataSize) {
|
|
|
delete geojsondata["geometry"]["bbox"];
|
|
|
// 封装参数
|
|
|
- let xzqh = geojsondata.properties.xzqh;
|
|
|
+ let townName = geojsondata.properties["镇域名称"];
|
|
|
+ let layerType = geojsondata.properties["土地类型"];
|
|
|
+ let xzqh = this.townMap.get(geojsondata.properties["镇域名称"]);
|
|
|
geojsondata = JSON.stringify(geojsondata);
|
|
|
let params = new FormData();
|
|
|
- params.append("columnId", "510");
|
|
|
- params.append("modelId", "118");
|
|
|
+ params.append("columnId", "768");
|
|
|
+ params.append("modelId", "120");
|
|
|
var data = {
|
|
|
c_boolean: false,
|
|
|
c_content: geojsondata,
|
|
|
c_date_time: (new Date().getTime() / 1000).toFixed(0) * 1000,
|
|
|
- c_editorid: 4,
|
|
|
- c_editor_name: "gaolu",
|
|
|
+ // c_editorid: 4,
|
|
|
+ // c_editor_name: "",
|
|
|
c_xzqh: xzqh,
|
|
|
- content: "测试录入数据",
|
|
|
- title: "gl-t" + this.postIndex,
|
|
|
+ content: layerType,
|
|
|
+ title: layerType,
|
|
|
};
|
|
|
params.append("content", JSON.stringify(data));
|
|
|
this.$Post(this.urlsCollection.addContent, params).then(
|
|
@@ -329,16 +329,10 @@ export default {
|
|
|
this.postIndex += 1;
|
|
|
this.addAllLayerData(pdData);
|
|
|
} else {
|
|
|
- this.postIndex += 1;
|
|
|
- this.addData(pdData);
|
|
|
- this.postMessageList.push(error);
|
|
|
this.$message.error(res.message);
|
|
|
}
|
|
|
},
|
|
|
- error => {
|
|
|
- this.postIndex += 1;
|
|
|
- this.addData(pdData);
|
|
|
- this.postMessageList.push(error);
|
|
|
+ (error) => {
|
|
|
this.$message.error(error);
|
|
|
}
|
|
|
);
|