|
@@ -1,42 +1,62 @@
|
|
<template>
|
|
<template>
|
|
<div class="CockpitVectorBox">
|
|
<div class="CockpitVectorBox">
|
|
-
|
|
|
|
<div class="cockpit_vector">
|
|
<div class="cockpit_vector">
|
|
-
|
|
|
|
- <el-table :header-cell-style="{
|
|
|
|
- background: 'rgba(10, 25, 38, 0.6)',
|
|
|
|
- color: '#66b1ff',
|
|
|
|
- fontSize: '14px',
|
|
|
|
- fontFamily: 'Microsoft YaHei',
|
|
|
|
- fontWeight: '400',
|
|
|
|
- }"
|
|
|
|
- :data="store.state.vectorData.filter(item => item.name !== 'id' && item.name !== 'geom' && item.name !== 'type' && item.name !== 'create_time' && item.name !== 'val1' && item.name !== 'val2')"
|
|
|
|
- style="width: 100%">
|
|
|
|
-
|
|
|
|
- <el-table-column show-overflow-tooltip="true" prop="name" label="属性" width="90">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :header-cell-style="{
|
|
|
|
+ background: 'rgba(10, 25, 38, 0.6)',
|
|
|
|
+ color: '#66b1ff',
|
|
|
|
+ fontSize: '14px',
|
|
|
|
+ fontFamily: 'Microsoft YaHei',
|
|
|
|
+ fontWeight: '400',
|
|
|
|
+ }"
|
|
|
|
+ :data="
|
|
|
|
+ store.state.vectorData.filter(
|
|
|
|
+ (item) =>
|
|
|
|
+ item.name !== 'id' &&
|
|
|
|
+ item.name !== 'geom' &&
|
|
|
|
+ item.name !== 'type' &&
|
|
|
|
+ item.name !== 'create_time' &&
|
|
|
|
+ item.name !== 'val1' &&
|
|
|
|
+ item.name !== 'val2'
|
|
|
|
+ )
|
|
|
|
+ "
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column
|
|
|
|
+ show-overflow-tooltip="true"
|
|
|
|
+ prop="name"
|
|
|
|
+ label="属性"
|
|
|
|
+ width="90"
|
|
|
|
+ >
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column show-overflow-tooltip="true" prop="value" label="属性值">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ show-overflow-tooltip="true"
|
|
|
|
+ prop="value"
|
|
|
|
+ label="属性值"
|
|
|
|
+ >
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <div id="seaTransferCharts" ref="echartsRef"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
-import { QueryList } from '@/api/cockpitNew'
|
|
|
|
|
|
+import { QueryList } from "@/api/cockpitNew";
|
|
import * as wellknown from "wellknown";
|
|
import * as wellknown from "wellknown";
|
|
import * as turf from "@turf/turf";
|
|
import * as turf from "@turf/turf";
|
|
|
|
+import * as echarts from "echarts";
|
|
|
|
+import { name } from "file-loader";
|
|
let pick_entity = null;
|
|
let pick_entity = null;
|
|
export default {
|
|
export default {
|
|
components: {},
|
|
components: {},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
restaurants: [],
|
|
restaurants: [],
|
|
- state: '',
|
|
|
|
|
|
+ state: "",
|
|
timeout: null,
|
|
timeout: null,
|
|
pick_entity: null,
|
|
pick_entity: null,
|
|
-
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//监听属性 类似于data概念
|
|
//监听属性 类似于data概念
|
|
@@ -48,7 +68,10 @@ export default {
|
|
build_data(geojson) {
|
|
build_data(geojson) {
|
|
geojson.coordinates.forEach((res) => {
|
|
geojson.coordinates.forEach((res) => {
|
|
const twoDArray = res[0];
|
|
const twoDArray = res[0];
|
|
- const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
|
|
|
|
|
|
+ const oneDArray = twoDArray.reduce(
|
|
|
|
+ (accumulator, currentValue) => accumulator.concat(currentValue),
|
|
|
|
+ []
|
|
|
|
+ );
|
|
|
|
|
|
pick_entity.entities.add({
|
|
pick_entity.entities.add({
|
|
polygon: {
|
|
polygon: {
|
|
@@ -73,8 +96,8 @@ export default {
|
|
// 是否显示
|
|
// 是否显示
|
|
show: true,
|
|
show: true,
|
|
// 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
|
|
// 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
|
|
- zIndex: 10
|
|
|
|
- }
|
|
|
|
|
|
+ zIndex: 10,
|
|
|
|
+ },
|
|
});
|
|
});
|
|
|
|
|
|
// 注意:polygon首尾坐标要一致
|
|
// 注意:polygon首尾坐标要一致
|
|
@@ -85,7 +108,11 @@ export default {
|
|
viewer.camera.flyTo({
|
|
viewer.camera.flyTo({
|
|
duration: 1,
|
|
duration: 1,
|
|
|
|
|
|
- destination: Cesium.Cartesian3.fromDegrees(centroid[0], centroid[1], 3000),
|
|
|
|
|
|
+ destination: Cesium.Cartesian3.fromDegrees(
|
|
|
|
+ centroid[0],
|
|
|
|
+ centroid[1],
|
|
|
|
+ 3000
|
|
|
|
+ ),
|
|
// destination: {
|
|
// destination: {
|
|
// x: -6283267.004204832,
|
|
// x: -6283267.004204832,
|
|
// y: 28123682.896774407,
|
|
// y: 28123682.896774407,
|
|
@@ -94,31 +121,178 @@ export default {
|
|
orientation: {
|
|
orientation: {
|
|
heading: 6.149339593573709,
|
|
heading: 6.149339593573709,
|
|
pitch: -1.539825618847483,
|
|
pitch: -1.539825618847483,
|
|
- roll: 0
|
|
|
|
|
|
+ roll: 0,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
-
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ async initChart(params) {
|
|
|
|
+ const chartDom = this.$refs.echartsRef;
|
|
|
|
+ let myChart = echarts.init(chartDom);
|
|
|
|
+ let obj = {
|
|
|
|
+ jscType: "jsc_hysyq_yhlx_zbmx_cx",
|
|
|
|
+ beginTime: params ? params.beginTime : store.state.cockpit_date[0],
|
|
|
|
+ endTime: params ? params.endTime : store.state.cockpit_date[1],
|
|
|
|
+ id: params ? params.id : "4602",
|
|
|
|
+ val0: params ? params.dataid : "3",
|
|
|
|
+ };
|
|
|
|
+ let res = await QueryList(obj);
|
|
|
|
+ const data = [];
|
|
|
|
+ var total = 0
|
|
|
|
+ res.data.forEach((item, index) => {
|
|
|
|
+ data.push({
|
|
|
|
+ name: item["用海类型"],
|
|
|
|
+ value: item["宗海面积(公顷)"],
|
|
|
|
+ });
|
|
|
|
+ total += Number(item["宗海面积(公顷)"])
|
|
|
|
+ });
|
|
|
|
+ const color = [
|
|
|
|
+ "#3591FF",
|
|
|
|
+ "#2040B8",
|
|
|
|
+ "#3EF6D1",
|
|
|
|
+ "#0082CE",
|
|
|
|
+ "#42DEED",
|
|
|
|
+ "#C1CC77",
|
|
|
|
+ "#00AB51",
|
|
|
|
+ "#31B571",
|
|
|
|
+ "#3351E3",
|
|
|
|
+ ];
|
|
|
|
+ const legendData = data.map((item, index) => {
|
|
|
|
+ const tag = index % 6;
|
|
|
|
+ return {
|
|
|
|
+ name: item.name,
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: color[tag] || "",
|
|
|
|
+ },
|
|
|
|
+ textStyle: {
|
|
|
|
+ rich: {
|
|
|
|
+ title: {
|
|
|
|
+ color: "#CDCEDA",
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ width: 70,
|
|
|
|
+ fontWeight: "bold",
|
|
|
|
+ },
|
|
|
|
+ p: {
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ width: 55,
|
|
|
|
+ color: "#02D0C5",
|
|
|
|
+ shadowColor: "#000",
|
|
|
|
+ inactiveColor: "#000",
|
|
|
|
+ fontWeight: "bold",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ let option = {
|
|
|
|
+ //你的代码
|
|
|
|
+ backgroundColor:'transparent',
|
|
|
|
+ legend: {
|
|
|
|
+ // type: 'scroll',
|
|
|
|
+ show: true,
|
|
|
|
+ // orient: "vertical",
|
|
|
|
+ bottom: 0,
|
|
|
|
+ // top: "center",
|
|
|
|
+ itemGap: 5,
|
|
|
|
+ borderRadius: 5,
|
|
|
|
+ itemWidth: 10,
|
|
|
|
+ icon: "circle",
|
|
|
|
+ // itemHeight: 10,
|
|
|
|
+ data: legendData,
|
|
|
|
+ formatter: function (name) {
|
|
|
|
+ const name1 = name.length > 5 ? `${name.substring(0, 4)}...` : name;
|
|
|
|
+ const value = data.filter((item) => item.name === name)[0].value;
|
|
|
|
+ // const proportion = data.filter((item) => item.name === name)[0].proportion;
|
|
|
|
+ return `{title|${name1}} {p|${value}公顷}`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ tooltip: {
|
|
|
|
+ trigger: "item",
|
|
|
|
+ backgroundColor: "rgba(13,5,30,.6)",
|
|
|
|
+ borderWidth: 1,
|
|
|
|
+ borderColor: "#32A1FF",
|
|
|
|
+ padding: 5,
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: "#fff",
|
|
|
|
+ },
|
|
|
|
+ formatter: (data) => {
|
|
|
|
+ const { name = "", value = "" } = data.data || {};
|
|
|
|
+ const name1 =
|
|
|
|
+ name.length > 10
|
|
|
|
+ ? `${name.substring(0, 10)} <br /> ${name.substring(
|
|
|
|
+ 10,
|
|
|
|
+ name.length
|
|
|
|
+ )}`
|
|
|
|
+ : name;
|
|
|
|
+ return `${name1} ${value}公顷`;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ title: {
|
|
|
|
+ // text: `{a|${total.toFixed(2)}}`+"{b|公顷}",
|
|
|
|
+ text: `{a|${total.toFixed(2)}}`,
|
|
|
|
+ textStyle: {
|
|
|
|
+ rich: {
|
|
|
|
+ a: {
|
|
|
|
+ color: "#fff",
|
|
|
|
+ fontSize: 18,
|
|
|
|
+ align: "35%",
|
|
|
|
+ },
|
|
|
|
+ b: {
|
|
|
|
+ fontSize: 14,
|
|
|
|
+ color: "#fff",
|
|
|
|
+ // fontWeight: "bold",
|
|
|
|
+ align: "35%",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ x: "35%",
|
|
|
|
+ y: "35%",
|
|
|
|
+ },
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ name: "",
|
|
|
|
+ type: "pie",
|
|
|
|
+ radius: ["40%", "60%"],
|
|
|
|
+ center: ["45%", "40%"],
|
|
|
|
+ startAngle: 90,
|
|
|
|
+ itemStyle: {
|
|
|
|
+ shadowBlur: 10,
|
|
|
|
+ shadowColor: "rgba(0, 103, 255, 0.2)",
|
|
|
|
+ shadowOffsetX: -5,
|
|
|
|
+ shadowOffsetY: 5,
|
|
|
|
+
|
|
|
|
+ color: function (params) {
|
|
|
|
+ return color[params.dataIndex % 6];
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ label: {
|
|
|
|
+ show: false,
|
|
|
|
+ },
|
|
|
|
+ labelLine: {},
|
|
|
|
+ data: data,
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ myChart.setOption(option);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- beforeCreate() { }, //生命周期 - 创建之前
|
|
|
|
- created() { }, //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
|
- beforeMount() { }, //生命周期 - 挂载之前
|
|
|
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
|
+ created() {}, //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
mounted() {
|
|
mounted() {
|
|
const that = this;
|
|
const that = this;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
-
|
|
|
|
pick_entity = new Cesium.CustomDataSource("pick_entity");
|
|
pick_entity = new Cesium.CustomDataSource("pick_entity");
|
|
viewer.dataSources.add(pick_entity);
|
|
viewer.dataSources.add(pick_entity);
|
|
}); //生命周期 - 挂在完成
|
|
}); //生命周期 - 挂在完成
|
|
|
|
+ this.initChart();
|
|
}, //生命周期 - 挂在完成
|
|
}, //生命周期 - 挂在完成
|
|
- beforeUpdate() { }, //生命周期 - 更新之前
|
|
|
|
- updated() { }, //生命周期 - 更新之后
|
|
|
|
- beforeDestroy() { }, //生命周期 - 销毁之前
|
|
|
|
- destroy() { },//生命周期 - 销毁完成
|
|
|
|
- activated() { }, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件被插入到 DOM 中时调用。
|
|
|
|
- deactivated() { } //若组件实例是 <KeepAlive> 缓存树的一部分,当组件从 DOM 中被移除时调用。
|
|
|
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
|
+ destroy() {}, //生命周期 - 销毁完成
|
|
|
|
+ activated() {}, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件被插入到 DOM 中时调用。
|
|
|
|
+ deactivated() {}, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件从 DOM 中被移除时调用。
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
@@ -126,20 +300,18 @@ export default {
|
|
// color: #198ec0;
|
|
// color: #198ec0;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
.list_vector {
|
|
.list_vector {
|
|
background-image: url("/static/images/ghzc/内容框.png");
|
|
background-image: url("/static/images/ghzc/内容框.png");
|
|
|
|
|
|
width: 20rem;
|
|
width: 20rem;
|
|
- border-top: 1px solid #CCC;
|
|
|
|
|
|
+ border-top: 1px solid #ccc;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
padding: 1rem;
|
|
padding: 1rem;
|
|
// border-bottom:1px solid #CCC ;
|
|
// border-bottom:1px solid #CCC ;
|
|
}
|
|
}
|
|
|
|
|
|
.list_vector:last-child {
|
|
.list_vector:last-child {
|
|
-
|
|
|
|
- border-bottom: 1px solid #CCC;
|
|
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
}
|
|
}
|
|
|
|
|
|
.cockpit_vector {
|
|
.cockpit_vector {
|
|
@@ -181,7 +353,6 @@ export default {
|
|
color: #fff;
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/deep/ .el-autocomplete-suggestion {
|
|
/deep/ .el-autocomplete-suggestion {
|
|
margin-top: 8px;
|
|
margin-top: 8px;
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
@@ -212,24 +383,21 @@ export default {
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
.list_vector_multi {
|
|
.list_vector_multi {
|
|
background-image: url("/static/images/ghzc/内容框.png");
|
|
background-image: url("/static/images/ghzc/内容框.png");
|
|
|
|
|
|
width: 20rem;
|
|
width: 20rem;
|
|
- border-top: 1px solid #CCC;
|
|
|
|
|
|
+ border-top: 1px solid #ccc;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
padding: 0.5rem 0rem 0.5rem 0rem;
|
|
padding: 0.5rem 0rem 0.5rem 0rem;
|
|
- border-left: 1px solid #CCC;
|
|
|
|
- border-right: 1px solid #CCC;
|
|
|
|
|
|
+ border-left: 1px solid #ccc;
|
|
|
|
+ border-right: 1px solid #ccc;
|
|
}
|
|
}
|
|
|
|
|
|
.list_vector_multi:last-child {
|
|
.list_vector_multi:last-child {
|
|
-
|
|
|
|
- border-bottom: 1px solid #CCC;
|
|
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/deep/ .el-table tr {
|
|
/deep/ .el-table tr {
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
}
|
|
}
|
|
@@ -238,10 +406,9 @@ export default {
|
|
.el-table th.el-table__cell.is-leaf {
|
|
.el-table th.el-table__cell.is-leaf {
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
|
|
|
|
- border-bottom: 0px solid #EBEEF5;
|
|
|
|
|
|
+ border-bottom: 0px solid #ebeef5;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
.el-table {
|
|
.el-table {
|
|
color: #fff;
|
|
color: #fff;
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
background: rgba(10, 25, 38, 0.5) !important;
|
|
@@ -249,14 +416,11 @@ export default {
|
|
|
|
|
|
/deep/ .el-table__fixed-right::before,
|
|
/deep/ .el-table__fixed-right::before,
|
|
.el-table__fixed::before {
|
|
.el-table__fixed::before {
|
|
-
|
|
|
|
background: rgba(10, 25, 38, 0.9) !important;
|
|
background: rgba(10, 25, 38, 0.9) !important;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/deep/ .el-table__fixed-right-patch {
|
|
/deep/ .el-table__fixed-right-patch {
|
|
background: rgba(10, 25, 38, 0.9) !important;
|
|
background: rgba(10, 25, 38, 0.9) !important;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/deep/ .el-table--border::after,
|
|
/deep/ .el-table--border::after,
|
|
@@ -264,4 +428,9 @@ export default {
|
|
.el-table::before {
|
|
.el-table::before {
|
|
background: rgba(10, 25, 38, 0) !important;
|
|
background: rgba(10, 25, 38, 0) !important;
|
|
}
|
|
}
|
|
|
|
+#seaTransferCharts {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 13rem;
|
|
|
|
+ background-color: rgba(10, 25, 38, 0.9) !important;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|