|
@@ -3,10 +3,10 @@
|
|
|
<div>项目名称:选址结果</div>
|
|
|
<div class="box-sizing" style="height: 47%; width: 100%">
|
|
|
<div class="title block-title">
|
|
|
- 意向地块({{ bgList ? bgList.length : 0 }})
|
|
|
+ 意向地块 ({{ bgList ? bgList.length : 0 }})
|
|
|
<span @click="download" class="export">导出报告</span>
|
|
|
</div>
|
|
|
- <div class="bxCon" style="height: 90%;">
|
|
|
+ <div class="bxCon" style="height: 90%">
|
|
|
<el-collapse accordion v-model="activeNames">
|
|
|
<el-collapse-item
|
|
|
:name="'gb' + index1"
|
|
@@ -14,9 +14,7 @@
|
|
|
:key="index1"
|
|
|
>
|
|
|
<template slot="title">
|
|
|
- 地块编号{{ item1.properties.dkbm }} ({{
|
|
|
- item1.properties.ydmj.toFixed(0)
|
|
|
- }})
|
|
|
+ 地块编号{{ item1.dkbm }} ({{ item1.area.toFixed(0) }})
|
|
|
<span class="tools">
|
|
|
<i
|
|
|
class="header-icon el-icon-place"
|
|
@@ -30,14 +28,14 @@
|
|
|
</template>
|
|
|
<div class="collapseCon">
|
|
|
<p class="oneItem">
|
|
|
- <span>{{ item1.properties.kzxxgydmc }}</span>
|
|
|
- <span>{{ item1.properties.ydmj.toFixed(2) }}平方米</span>
|
|
|
+ <span>{{ item1.kzxxgydmc }}</span>
|
|
|
+ <span>{{ item1.area.toFixed(2) }}平方米</span>
|
|
|
</p>
|
|
|
<p style="color: #cddeeb">
|
|
|
<img src="/static/images/ghzc/iconSun.png" />
|
|
|
<span style="margin-left: 20px">基准地标价:</span
|
|
|
><span style="color: #02a7f0"
|
|
|
- >{{ item1.properties.landPrice }}万元</span
|
|
|
+ >{{ item1.landPrice || 0 }}万元</span
|
|
|
>
|
|
|
</p>
|
|
|
</div>
|
|
@@ -45,26 +43,22 @@
|
|
|
</el-collapse>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="height: 47%; width: 100%">
|
|
|
+ <div style="height: 47%; width: 100%" v-if="xzjgObj">
|
|
|
<div class="title flex-box">
|
|
|
<span class="block-title"
|
|
|
- >备选地块({{
|
|
|
- xzjgObj.features ? xzjgObj.features.length : 0
|
|
|
- }})</span
|
|
|
- >
|
|
|
+ >备选地块 ({{ xzjgObj.dks ? xzjgObj.dks.length : 0 }})
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<div class="bxCon">
|
|
|
<el-collapse accordion v-model="activeNames">
|
|
|
<el-collapse-item
|
|
|
:name="index"
|
|
|
- v-for="(item, index) in xzjgObj.features"
|
|
|
- :key="item.properties.dkbm"
|
|
|
+ v-for="(item, index) in xzjgObj.dks"
|
|
|
+ :key="item.dkbm"
|
|
|
>
|
|
|
<template slot="title">
|
|
|
<!-- 地块编号B_P_123 -->
|
|
|
- 地块编号{{ item.properties.dkbm }} ({{
|
|
|
- item.properties.ydmj.toFixed(0)
|
|
|
- }})
|
|
|
+ 地块编号{{ item.dkbm }} ({{ item.area.toFixed(0) }})
|
|
|
<span class="tools">
|
|
|
<i
|
|
|
class="header-icon el-icon-place"
|
|
@@ -78,15 +72,15 @@
|
|
|
</template>
|
|
|
<div class="collapseCon">
|
|
|
<p class="oneItem">
|
|
|
- <span>{{ item.properties.kzxxgydmc }}</span>
|
|
|
- <span>{{ item.properties.ydmj.toFixed(2) }}平方米</span>
|
|
|
+ <span>{{ item.kzxxgydmc }}</span>
|
|
|
+ <span>{{ item.area.toFixed(2) }}平方米</span>
|
|
|
</p>
|
|
|
<p style="color: #cddeeb">
|
|
|
<!-- <i class="iconSun"></i> -->
|
|
|
<img src="/static/images/ghzc/iconSun.png" />
|
|
|
<span style="margin-left: 20px">基准地标价:</span
|
|
|
><span style="color: #02a7f0"
|
|
|
- >{{ item.properties.landPrice }}万元</span
|
|
|
+ >{{ item.landPrice || 0 }}万元</span
|
|
|
>
|
|
|
</p>
|
|
|
</div>
|
|
@@ -118,6 +112,9 @@
|
|
|
<script>
|
|
|
import drawData from "./draw.json";
|
|
|
import ghjgData from "./规划结果.json";
|
|
|
+import { GetXzjg } from "../../../api/ghss/ghxz.js";
|
|
|
+// 使用
|
|
|
+import parse from "wellknown";
|
|
|
export default {
|
|
|
components: {},
|
|
|
props: {
|
|
@@ -153,16 +150,27 @@ export default {
|
|
|
},
|
|
|
geoJsonEntities: null,
|
|
|
xzjgObj: null,
|
|
|
- tempObj: JSON.parse(JSON.stringify(ghjgData)),
|
|
|
+ tempObj: null,
|
|
|
copyData: null,
|
|
|
arrww: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.xzjgObj = JSON.parse(JSON.stringify(ghjgData))
|
|
|
- this.copyData = JSON.parse(JSON.stringify(ghjgData));
|
|
|
- this.addPolygon("规划结果", "ghjg", "#0000FF");
|
|
|
- this.addPolygon("draw", "draw", "#FF0000");
|
|
|
+ GetXzjg({ bsm: "dbc5fcf178fc4592b4940627e758b90d" }).then((res) => {
|
|
|
+ console.log(res, "-------");
|
|
|
+ this.xzjgObj = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.copyData = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.tempObj = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.xzjgObj.dks.forEach((item) => {
|
|
|
+ this.drawWktPloygon(item.geom, "#0000ff");
|
|
|
+ });
|
|
|
+ this.drawWktPloygon(this.geom, "#ff0000");
|
|
|
+ });
|
|
|
+
|
|
|
+ // this.xzjgObj = JSON.parse(JSON.stringify(ghjgData));
|
|
|
+ // this.copyData = JSON.parse(JSON.stringify(ghjgData));
|
|
|
+ // this.addPolygon("规划结果", "ghjg", "#0000FF");
|
|
|
+ // this.addPolygon("draw", "draw", "#FF0000");
|
|
|
},
|
|
|
methods: {
|
|
|
download() {
|
|
@@ -174,6 +182,41 @@ export default {
|
|
|
"_blank"
|
|
|
);
|
|
|
},
|
|
|
+
|
|
|
+ drawWktPloygon(item, itemColor) {
|
|
|
+ // const geometry = parse(item); // 就可以得到{type: 'MultiPolygon', coordinates: Array(1)}
|
|
|
+ // console.log(geometry, "geometry");
|
|
|
+ // viewer.entities.removeAll();
|
|
|
+ let geoms =
|
|
|
+ item
|
|
|
+ .substring(item.indexOf("(((") + 3, item.length - 3)
|
|
|
+ .split(")),((") ||
|
|
|
+ item.substring(item.indexOf("((") + 2, item.length - 2).split(")),((");
|
|
|
+ for (let i = 0; i < geoms.length; i++) {
|
|
|
+ let geom = geoms[i].split(",");
|
|
|
+ let points = [];
|
|
|
+ for (let j = 0; j < geom.length; j++) {
|
|
|
+ points.push(parseFloat(geom[j].split(" ")[0]));
|
|
|
+ points.push(parseFloat(geom[j].split(" ")[1]));
|
|
|
+ }
|
|
|
+ points.push(parseFloat(geom[0].split(" ")[0]));
|
|
|
+ points.push(parseFloat(geom[0].split(" ")[1]));
|
|
|
+ viewer.entities.add({
|
|
|
+ polygon: {
|
|
|
+ hierarchy: {
|
|
|
+ positions: Cesium.Cartesian3.fromDegreesArray(points),
|
|
|
+ },
|
|
|
+ material: Cesium.Color.WHITE.withAlpha(0.3),
|
|
|
+ clampToGround: true,
|
|
|
+ outline: true,
|
|
|
+ outlineWidth: 5,
|
|
|
+ outlineColor: Cesium.Color.fromCssColorString(itemColor),
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ viewer.flyTo(viewer.entities);
|
|
|
+ },
|
|
|
+
|
|
|
// 加载GeoJSON数据
|
|
|
addPolygon(label, id, color) {
|
|
|
let _this = this;
|
|
@@ -203,26 +246,26 @@ export default {
|
|
|
});
|
|
|
if (list.length == 0) {
|
|
|
this.bgList.push(item);
|
|
|
- const list = this.xzjgObj.features.filter((item1) => {
|
|
|
- return item1.properties.dkbm != item.properties.dkbm;
|
|
|
+ const list = this.xzjgObj.dks.filter((item1) => {
|
|
|
+ return item1.dkbm != item.dkbm;
|
|
|
});
|
|
|
- this.xzjgObj.features = list;
|
|
|
+ this.xzjgObj.dks = list;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
deleteprogramme(e, item) {
|
|
|
e.stopPropagation();
|
|
|
this.bgList = this.bgList.filter((item1) => {
|
|
|
- return item1.properties.dkbm != item.properties.dkbm;
|
|
|
+ return item1.dkbm != item.dkbm;
|
|
|
});
|
|
|
const temp = JSON.parse(
|
|
|
JSON.stringify(
|
|
|
- this.tempObj.features.filter((item1) => {
|
|
|
- return item1.properties.dkbm == item.properties.dkbm;
|
|
|
+ this.tempObj.dks.filter((item1) => {
|
|
|
+ return item1.dkbm == item.dkbm;
|
|
|
})
|
|
|
)
|
|
|
);
|
|
|
- this.xzjgObj.features.push(temp[0]);
|
|
|
+ this.xzjgObj.dks.push(temp[0]);
|
|
|
},
|
|
|
resetAll() {
|
|
|
// this.xzjgObj = JSON.parse(JSON.stringify(this.tempObj))
|
|
@@ -232,33 +275,33 @@ export default {
|
|
|
this.bgList = [];
|
|
|
},
|
|
|
mapview(item) {
|
|
|
- this.edlARR();
|
|
|
- // e.stopPropagation()
|
|
|
- let tempArr = item.geometry.coordinates[0];
|
|
|
- for (let i = 0; i < tempArr.length; i++) {
|
|
|
- const oneDArray = tempArr[i].reduce(
|
|
|
- (accumulator, currentValue) => accumulator.concat(currentValue),
|
|
|
- []
|
|
|
- );
|
|
|
- let entity = new Cesium.Entity({
|
|
|
- name: "地块" + i,
|
|
|
- show: true,
|
|
|
- polygon: {
|
|
|
- hierarchy: {
|
|
|
- positions: Cesium.Cartesian3.fromDegreesArray(oneDArray),
|
|
|
- },
|
|
|
- material: Cesium.Color.WHITE.withAlpha(0.3),
|
|
|
- clampToGround: true,
|
|
|
- outline: true,
|
|
|
- outlineWidth: 6,
|
|
|
- outlineColor: Cesium.Color.fromCssColorString("#FF0000"),
|
|
|
- },
|
|
|
- });
|
|
|
- viewer.entities.add(entity);
|
|
|
- // 存ID
|
|
|
- this.arrww.push(entity.id);
|
|
|
- viewer.flyTo(entity);
|
|
|
- }
|
|
|
+ // this.edlARR();
|
|
|
+ // // e.stopPropagation()
|
|
|
+ // let tempArr = item.geometry.coordinates[0];
|
|
|
+ // for (let i = 0; i < tempArr.length; i++) {
|
|
|
+ // const oneDArray = tempArr[i].reduce(
|
|
|
+ // (accumulator, currentValue) => accumulator.concat(currentValue),
|
|
|
+ // []
|
|
|
+ // );
|
|
|
+ // let entity = new Cesium.Entity({
|
|
|
+ // name: "地块" + i,
|
|
|
+ // show: true,
|
|
|
+ // polygon: {
|
|
|
+ // hierarchy: {
|
|
|
+ // positions: Cesium.Cartesian3.fromDegreesArray(oneDArray),
|
|
|
+ // },
|
|
|
+ // material: Cesium.Color.WHITE.withAlpha(0.3),
|
|
|
+ // clampToGround: true,
|
|
|
+ // outline: true,
|
|
|
+ // outlineWidth: 6,
|
|
|
+ // outlineColor: Cesium.Color.fromCssColorString("#FF0000"),
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // viewer.entities.add(entity);
|
|
|
+ // // 存ID
|
|
|
+ // this.arrww.push(entity.id);
|
|
|
+ // viewer.flyTo(entity);
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
edlARR() {
|
|
@@ -287,10 +330,7 @@ export default {
|
|
|
initData() {
|
|
|
this.model = this.rwObj;
|
|
|
this.bgList = this.tempObj.items.filter(
|
|
|
- (item) =>
|
|
|
- !this.xzjgObj.features.some(
|
|
|
- (ele) => ele.properties.dkbm === item.properties.dkbm
|
|
|
- )
|
|
|
+ (item) => !this.xzjgObj.dks.some((ele) => ele.dkbm === item.dkbm)
|
|
|
);
|
|
|
this.bgList.sort(function (a, b) {
|
|
|
return parseInt(a.yxfa) - parseInt(b.yxfa);
|
|
@@ -307,6 +347,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
beforeDestroy() {
|
|
|
+ viewer.entities.removeAll();
|
|
|
viewer.dataSources.removeAll();
|
|
|
this.edlARR();
|
|
|
},
|