Browse Source

Merge branch 'release-sy-v1.0.0' of http://gitlab.datameta.com/project/water/shuili-vue into release-sy-v1.0.0

sy-water-data-board-ui
hejunjie 1 month ago
parent
commit
49f03ba021
  1. 3
      src/views/aiSupervision/waterSetting/runScene/layerTree/index.js
  2. 44
      src/views/dike/safeOperation/index.vue
  3. 109
      src/views/reservoir/safeOperation/index.vue
  4. 12
      src/views/sluice/runManage/patrolMaintenance/overviewAnalysis/index.vue
  5. 54
      src/views/sluice/runManage/patrolMaintenance/statisticsAnalysis/index.vue
  6. 107
      src/views/sluice/safeOperation/index.vue

3
src/views/aiSupervision/waterSetting/runScene/layerTree/index.js

@ -219,9 +219,8 @@ export async function addLayer(layerData) {
return; return;
} }
if (!layerType || !(action = layerActions[layerType])) return; if (!layerType || !(action = layerActions[layerType])) return;
console.log(action)
const layer = await action(layerData); const layer = await action(layerData);
console.log(layer) console.log(layer);
layer && window.viewer.addLayer(layer); layer && window.viewer.addLayer(layer);
if (["013000"].includes(layerType)) { if (["013000"].includes(layerType)) {
// 3d tiles // 3d tiles

44
src/views/dike/safeOperation/index.vue

@ -17,7 +17,7 @@
></el-button> ></el-button>
</el-input> --> </el-input> -->
<div class="tool-btn"> <div class="tool-btn">
<div class="btn cursor-pointer" @click="showTreeBox = !showTreeBox"> <div class="btn cursor-pointer" @click="handleChangeTreeShow">
<img class="icon" src="../../../assets/icons/layer.png" alt="" /> <img class="icon" src="../../../assets/icons/layer.png" alt="" />
图层管理 图层管理
</div> </div>
@ -36,7 +36,7 @@
:data="treeData" :data="treeData"
default-expand-all default-expand-all
node-key="id" node-key="id"
ref="tree" ref="treeRef"
show-checkbox show-checkbox
highlight-current highlight-current
:props="defaultProps" :props="defaultProps"
@ -140,17 +140,21 @@ export default {
}); });
let id = res1.records?.[0]?.id; let id = res1.records?.[0]?.id;
let res2 = await getLayerData(id); let res2 = await getLayerData(id);
this.treeData = res2.data.children; this.treeData = res2.data?.children || [];
getSceneConfig(id).then((res) => { let res3 = await getSceneConfig(id);
console.log("配置 >>>>> ", res); this.configData = res3.data || null;
this.configData = res.data || null; if (res3.data?.layerId && typeof res3.data.layerId === "string") {
if (res.data?.layerId) { this.checkList = JSON.parse(res3.data?.layerId);
this.checkList = JSON.parse(res.data?.layerId); this.treeData.forEach((item) => {
this.layerList = this.treeData.filter((item) => { if (item.layers) {
return this.checkList.includes(item.id); let arr = item.layers?.filter((item) =>
}); this.checkList.includes(item.id)
} );
}); this.layerList.push(...arr);
}
});
}
this.initMap();
}, },
handleChangeMode() { handleChangeMode() {
this.mapSceneType = this.mapSceneType === 3 ? 2 : 3; this.mapSceneType = this.mapSceneType === 3 ? 2 : 3;
@ -232,7 +236,14 @@ export default {
this.viewerAddEventListener(); this.viewerAddEventListener();
}, 300); }, 300);
}, },
handleChangeTreeShow() {
this.showTreeBox = !this.showTreeBox;
if (this.showTreeBox) {
this.$nextTick(() => {
this.$refs.treeRef?.setCheckedKeys(this.checkList);
});
}
},
handleAddHtmlLayer(position, data) { handleAddHtmlLayer(position, data) {
console.log("添加DivIcon >>>>> ", position, data); console.log("添加DivIcon >>>>> ", position, data);
htmlLayer?.clear(); htmlLayer?.clear();
@ -329,7 +340,6 @@ export default {
}, },
}, },
created() { created() {
this.initData();
emitter.on("openDialog", this.openDialog); emitter.on("openDialog", this.openDialog);
// devRun(() => { // devRun(() => {
// setTimeout(() => { // setTimeout(() => {
@ -341,9 +351,7 @@ export default {
// }); // });
}, },
mounted() { mounted() {
setTimeout(() => { this.initData();
this.initMap();
}, 50);
}, },
beforeDestroy() { beforeDestroy() {
window.viewer = null; window.viewer = null;

109
src/views/reservoir/safeOperation/index.vue

@ -17,7 +17,7 @@
></el-button> ></el-button>
</el-input> --> </el-input> -->
<div class="tool-btn"> <div class="tool-btn">
<div class="btn cursor-pointer" @click="showTreeBox = !showTreeBox"> <div class="btn cursor-pointer" @click="handleChangeTreeShow">
<img class="icon" src="../../../assets/icons/layer.png" alt="" /> <img class="icon" src="../../../assets/icons/layer.png" alt="" />
图层管理 图层管理
</div> </div>
@ -36,7 +36,7 @@
:data="treeData" :data="treeData"
default-expand-all default-expand-all
node-key="id" node-key="id"
ref="tree" ref="treeRef"
show-checkbox show-checkbox
highlight-current highlight-current
:props="defaultProps" :props="defaultProps"
@ -157,17 +157,21 @@ export default {
}); });
let id = res1.records?.[0]?.id; let id = res1.records?.[0]?.id;
let res2 = await getLayerData(id); let res2 = await getLayerData(id);
this.treeData = res2.data.children; this.treeData = res2.data?.children || [];
getSceneConfig(id).then((res) => { let res3 = await getSceneConfig(id);
console.log("配置 >>>>> ", res); this.configData = res3.data || null;
this.configData = res.data || null; if (res3.data?.layerId && typeof res3.data.layerId === "string") {
if (res.data?.layerId) { this.checkList = JSON.parse(res3.data?.layerId);
this.checkList = JSON.parse(res.data?.layerId); this.treeData.forEach((item) => {
this.layerList = this.treeData.filter((item) => { if (item.layers) {
return this.checkList.includes(item.id); let arr = item.layers?.filter((item) =>
}); this.checkList.includes(item.id)
} );
}); this.layerList.push(...arr);
}
});
}
this.initMap();
}, },
handleChangeMode() { handleChangeMode() {
this.mapSceneType = this.mapSceneType === 3 ? 2 : 3; this.mapSceneType = this.mapSceneType === 3 ? 2 : 3;
@ -182,10 +186,15 @@ export default {
); );
}, },
handleGetResInfo(data) { handleGetResInfo(data) {
console.log("handleGetResInfo >>>>> ", data);
this.resInfoData = data; this.resInfoData = data;
}, },
initMap() { initMap() {
if (!sycim) {
setTimeout(() => {
this.initMap();
}, 1000);
return;
}
viewer = new sycim.Viewer("reservoir-map-container"); viewer = new sycim.Viewer("reservoir-map-container");
window.viewer = viewer; window.viewer = viewer;
let baseLayer = sycim.ImageryLayerFactory.createImageryLayer( let baseLayer = sycim.ImageryLayerFactory.createImageryLayer(
@ -207,32 +216,50 @@ export default {
depthTestAgainstTerrain: true, depthTestAgainstTerrain: true,
}, },
}); });
//
// viewer.on(
// sycim.SceneEventType.CAMERA_CHANGED,
// () => {
// viewer.setOptions({
// globe: {
// depthTestAgainstTerrain: viewer.cameraPosition.alt > 10000 ? false : true
// }
// });
// },
// viewer
// );
setTimeout(() => { setTimeout(() => {
viewer.scene.camera.setView({ if (this.layerList.length) {
destination: new Cesium.Cartesian3.fromDegrees(113.27, 23.13, 600000), this.layerList.forEach((item) => {
// orientation: { addLayer(item);
// heading: 0, });
// pitch: -90, }
// roll: 0, if (this.configData) {
// }, let pos = JSON.parse(this.configData.cameraPosture);
duration: 2, viewer.scene.camera.setView({
}); destination: new Cesium.Cartesian3.fromDegrees(
pos.lng,
pos.lat,
pos.alt
),
duration: 2,
});
} else {
viewer.scene.camera.setView({
destination: new Cesium.Cartesian3.fromDegrees(
113.27,
23.13,
600000
),
// orientation: {
// heading: 0,
// pitch: -90,
// roll: 0,
// },
duration: 2,
});
}
this.viewerAddEventListener(); this.viewerAddEventListener();
}, 300); }, 300);
}, },
handleChangeTreeShow() {
this.showTreeBox = !this.showTreeBox;
if (this.showTreeBox) {
this.$nextTick(() => {
this.$refs.treeRef?.setCheckedKeys(this.checkList);
});
}
},
handleAddHtmlLayer(position, data) { handleAddHtmlLayer(position, data) {
console.log("添加DivIcon >>>>> ", position, data); console.log("添加DivIcon >>>>> ", position, data);
htmlLayer?.clear(); htmlLayer?.clear();
@ -316,13 +343,10 @@ export default {
} }
}, },
handleCheckTree(data, checked) { handleCheckTree(data, checked) {
console.log("data, checked >>>>> ", data, checked);
console.log("getCheckedNodes >>>>> ", this.$refs.tree.getCheckedNodes());
if (data.pid === "root" || data.layers) return; if (data.pid === "root" || data.layers) return;
if (checked) { if (checked) {
this.checkList = [...this.checkList, data.id]; this.checkList = [...this.checkList, data.id];
const list = this.$refs.tree.getCheckedNodes(); const list = this.$refs.treeRef?.getCheckedNodes();
console.log("checkList >>>>> ", this.checkList);
addLayer(data); addLayer(data);
this.legendList = getSelectedLayersLegend(list); this.legendList = getSelectedLayersLegend(list);
this.layerList.push(data); this.layerList.push(data);
@ -334,7 +358,6 @@ export default {
}, },
}, },
created() { created() {
this.initData();
emitter.on("openDialog", this.openDialog); emitter.on("openDialog", this.openDialog);
// devRun(() => { // devRun(() => {
// setTimeout(() => { // setTimeout(() => {
@ -346,9 +369,7 @@ export default {
// }); // });
}, },
mounted() { mounted() {
setTimeout(() => { this.initData();
this.initMap();
}, 50);
}, },
beforeDestroy() { beforeDestroy() {
window.viewer = null; window.viewer = null;

12
src/views/sluice/runManage/patrolMaintenance/overviewAnalysis/index.vue

@ -180,7 +180,7 @@ export default {
getTableData() { getTableData() {
// //
this.renderEcharts({ this.renderEcharts({
group: "C_1", group: "C_SZ_1",
echartsInstanceName: "proEchartInstance", echartsInstanceName: "proEchartInstance",
echartsDomName: "proEchart", echartsDomName: "proEchart",
echartsOptions: { echartsOptions: {
@ -197,7 +197,7 @@ export default {
// //
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
let num = res.data.yaxis[0]?.series.find( let num = res.data.yaxis[0]?.series.find(
(v) => v.code === "DF_PROJECT_ADCD_SUM" (v) => v.code === "SZ_PROJECT_ADCD_SUM"
)?.sum; )?.sum;
this.projectSum = Number(num ?? null); this.projectSum = Number(num ?? null);
} }
@ -205,7 +205,7 @@ export default {
}); });
// //
this.renderEcharts({ this.renderEcharts({
group: "C_2", group: "C_SZ_2",
echartsInstanceName: "patrolEchartInstance", echartsInstanceName: "patrolEchartInstance",
echartsDomName: "patrolEchart", echartsDomName: "patrolEchart",
echartsOptions: { echartsOptions: {
@ -229,7 +229,7 @@ export default {
}); });
// //
this.renderEcharts({ this.renderEcharts({
group: "C_3", group: "C_SZ_3",
echartsInstanceName: "compareEchartInstance", echartsInstanceName: "compareEchartInstance",
echartsDomName: "compareEchart", echartsDomName: "compareEchart",
echartsOptions: { echartsOptions: {
@ -244,9 +244,9 @@ export default {
// //
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
let newArr = res.data.yaxis.flatMap((v) => v.series); let newArr = res.data.yaxis.flatMap((v) => v.series);
let num1 = newArr.find((v) => v.code === "DF_QX_ADCD_SUM")?.sum; let num1 = newArr.find((v) => v.code === "SZ_QX_ADCD_SUM")?.sum;
this.flawSum = Number(num1 ?? null); this.flawSum = Number(num1 ?? null);
let num2 = newArr.find((v) => v.code === "DF_YH_ADCD_SUM")?.sum; let num2 = newArr.find((v) => v.code === "SZ_YH_ADCD_SUM")?.sum;
this.yhSum = Number(num2 ?? null); this.yhSum = Number(num2 ?? null);
} }
} }

54
src/views/sluice/runManage/patrolMaintenance/statisticsAnalysis/index.vue

@ -21,17 +21,17 @@
remote remote
filterable filterable
reserve-keyword reserve-keyword
:remote-method="handleGetRemoteDikeMethod" :remote-method="handleGetRemoteProMethod"
@focus="handleGetRemoteDikeMethod('')" @focus="handleGetRemoteProMethod('')"
@change="handleChangeDike" @change="handleChangeSelect"
v-model="paramsData.dikeCode" v-model="paramsData.wagaCode"
placeholder="请选择堤防" placeholder="请选择水闸"
> >
<el-option <el-option
v-for="item in dikeList" v-for="item in proList"
:key="item.id" :key="item.id"
:label="item.dikeName" :label="item.wagaName"
:value="item.dikeCode" :value="item.wagaCode"
></el-option> ></el-option>
</el-select> </el-select>
<el-button <el-button
@ -136,7 +136,8 @@ import * as echarts from "echarts";
import TopBackTitle from "@/components/TopBackTitle/index.vue"; import TopBackTitle from "@/components/TopBackTitle/index.vue";
import { cascaderLazyLoad } from "@/utils/elUtils"; import { cascaderLazyLoad } from "@/utils/elUtils";
import { getV2PatrolStatisticChart, getRunProjectList } from "@/api/dike"; import { getV2PatrolStatisticChart } from "@/api/dike";
import { getRunProjectList } from "@/api/sluice";
import { import {
initCommonBarLineOptions, initCommonBarLineOptions,
@ -154,10 +155,10 @@ export default {
xcRecordsSum: null, xcRecordsSum: null,
flawSum: null, flawSum: null,
yhSum: null, yhSum: null,
dikeList: [], proList: [],
paramsData: { paramsData: {
dikeCode: null, wagaCode: null,
dikeName: null, wagaName: null,
timeRange: [], timeRange: [],
}, },
areasOptionProps: { areasOptionProps: {
@ -185,23 +186,23 @@ export default {
window.removeEventListener("resize", this.echartsResizeFunc); window.removeEventListener("resize", this.echartsResizeFunc);
}, },
methods: { methods: {
handleChangeDike() { handleChangeSelect() {
let res = this.dikeList.find( let res = this.proList.find(
(v) => v.dikeCode === this.paramsData.dikeCode (v) => v.wagaCode === this.paramsData.wagaCode
); );
this.paramsData.dikeType = res.dikeType; this.paramsData.dikeType = res.dikeType;
this.paramsData.dikeName = res.dikeName; this.paramsData.wagaName = res.wagaName;
}, },
handleGetRemoteDikeMethod(query) { handleGetRemoteProMethod(query) {
getRunProjectList({ getRunProjectList({
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
data: { data: {
dikeName: query, wagaName: query,
}, },
}).then((res) => { }).then((res) => {
if (res) { if (res) {
this.dikeList = res.records; this.proList = res.records;
} }
}); });
}, },
@ -270,7 +271,7 @@ export default {
// //
getTableData() { getTableData() {
// //
this.requestFunc({ group: "C_14" }).then((res) => { this.requestFunc({ group: "C_SZ_14" }).then((res) => {
if (res.data) { if (res.data) {
// //
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
@ -354,7 +355,7 @@ export default {
} }
}); });
// //
this.requestFunc({ group: "C_15" }).then((res) => { this.requestFunc({ group: "C_SZ_15" }).then((res) => {
if (res.data) { if (res.data) {
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
this.flawSum = res.data.yaxis this.flawSum = res.data.yaxis
@ -435,7 +436,7 @@ export default {
} }
}); });
// //
this.requestFunc({ group: "C_16" }).then((res) => { this.requestFunc({ group: "C_SZ_16" }).then((res) => {
if (res.data) { if (res.data) {
this.$nextTick(() => { this.$nextTick(() => {
// //
@ -546,13 +547,13 @@ export default {
} }
}); });
// //
this.requestFunc({ group: "C_17" }).then((res) => { this.requestFunc({ group: "C_SZ_17" }).then((res) => {
if (res.data) { if (res.data) {
if (res.data.yaxis?.length) { if (res.data.yaxis?.length) {
this.yhSum = Number( this.yhSum = Number(
res.data.yaxis res.data.yaxis
.flatMap((v) => v.series) .flatMap((v) => v.series)
?.find((v) => v.code === "DF_BD_YH_SUM")?.sum ?? null ?.find((v) => v.code === "SZ_BD_YH_SUM")?.sum ?? null
); );
} }
this.$nextTick(() => { this.$nextTick(() => {
@ -622,13 +623,12 @@ export default {
], ],
seriesOptions: {}, seriesOptions: {},
}); });
console.log("options >>>>> ", options);
this.yhCompareRefPieInstance.setOption(options); this.yhCompareRefPieInstance.setOption(options);
}); });
} }
}); });
// //
this.requestFunc({ group: "C_18" }).then((res) => { this.requestFunc({ group: "C_SZ_18" }).then((res) => {
if (res.data) { if (res.data) {
if (res.data?.yaxis?.length) { if (res.data?.yaxis?.length) {
let newArr = res.data.yaxis.flatMap((v) => v.series); let newArr = res.data.yaxis.flatMap((v) => v.series);
@ -646,7 +646,7 @@ export default {
}, },
resetSearch() { resetSearch() {
this.paramsData.timeRange = []; this.paramsData.timeRange = [];
this.paramsData.dikeCode = null; this.paramsData.wagaCode = null;
this.getTableData(); this.getTableData();
}, },
}, },

107
src/views/sluice/safeOperation/index.vue

@ -17,7 +17,7 @@
></el-button> ></el-button>
</el-input> --> </el-input> -->
<div class="tool-btn"> <div class="tool-btn">
<div class="btn cursor-pointer" @click="showTreeBox = !showTreeBox"> <div class="btn cursor-pointer" @click="handleChangeTreeShow">
<img class="icon" src="../../../assets/icons/layer.png" alt="" /> <img class="icon" src="../../../assets/icons/layer.png" alt="" />
图层管理 图层管理
</div> </div>
@ -36,7 +36,7 @@
:data="treeData" :data="treeData"
default-expand-all default-expand-all
node-key="id" node-key="id"
ref="tree" ref="treeRef"
show-checkbox show-checkbox
highlight-current highlight-current
:props="defaultProps" :props="defaultProps"
@ -58,7 +58,7 @@
</div> </div>
</Transition> </Transition>
<div class="legend-icon"><<Legend></Legend></div> <div class="legend-icon"><Legend></Legend></div>
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog <el-dialog
@ -83,6 +83,7 @@ import mitt from "mitt";
import ProjectDetail from "./components/ProjectDetail.vue"; import ProjectDetail from "./components/ProjectDetail.vue";
import { getSceneListData, getLayerData } from "@/api/mapCommon"; import { getSceneListData, getLayerData } from "@/api/mapCommon";
import { getSceneConfig } from "@/api/aiSupervision/layerConfigApi";
import { import {
addLayer, addLayer,
@ -124,21 +125,34 @@ export default {
children: "layers", children: "layers",
label: "nameCn", label: "nameCn",
}, },
configData: null,
layerList: [], layerList: [],
checkList: [], checkList: [],
treeData: [], treeData: [],
}; };
}, },
methods: { methods: {
initData() { async initData() {
getSceneListData({ let res1 = await getSceneListData({
name: "水闸安全运行", name: "水闸安全运行",
}).then((res) => {
let id = res.records?.[0]?.id;
getLayerData(id).then((res) => {
this.treeData = res.data.children;
});
}); });
let id = res1.records?.[0]?.id;
let res2 = await getLayerData(id);
this.treeData = res2.data?.children || [];
let res3 = await getSceneConfig(id);
this.configData = res3.data || null;
if (res3.data?.layerId && typeof res3.data.layerId === "string") {
this.checkList = JSON.parse(res3.data?.layerId);
this.treeData.forEach((item) => {
if (item.layers) {
let arr = item.layers?.filter((item) =>
this.checkList.includes(item.id)
);
this.layerList.push(...arr);
}
});
}
this.initMap();
}, },
handleChangeMode() { handleChangeMode() {
this.mapSceneType = this.mapSceneType === 3 ? 2 : 3; this.mapSceneType = this.mapSceneType === 3 ? 2 : 3;
@ -157,6 +171,12 @@ export default {
this.resInfoData = data; this.resInfoData = data;
}, },
initMap() { initMap() {
if (!sycim) {
setTimeout(() => {
this.initMap();
}, 1000);
return;
}
viewer = new sycim.Viewer("reservoir-map-container"); viewer = new sycim.Viewer("reservoir-map-container");
window.viewer = viewer; window.viewer = viewer;
let baseLayer = sycim.ImageryLayerFactory.createImageryLayer( let baseLayer = sycim.ImageryLayerFactory.createImageryLayer(
@ -178,32 +198,50 @@ export default {
depthTestAgainstTerrain: true, depthTestAgainstTerrain: true,
}, },
}); });
//
// viewer.on(
// sycim.SceneEventType.CAMERA_CHANGED,
// () => {
// viewer.setOptions({
// globe: {
// depthTestAgainstTerrain: viewer.cameraPosition.alt > 10000 ? false : true
// }
// });
// },
// viewer
// );
setTimeout(() => { setTimeout(() => {
viewer.scene.camera.setView({ if (this.layerList.length) {
destination: new Cesium.Cartesian3.fromDegrees(113.27, 23.13, 600000), this.layerList.forEach((item) => {
// orientation: { addLayer(item);
// heading: 0, });
// pitch: -90, }
// roll: 0, if (this.configData) {
// }, let pos = JSON.parse(this.configData.cameraPosture);
duration: 2, viewer.scene.camera.setView({
}); destination: new Cesium.Cartesian3.fromDegrees(
pos.lng,
pos.lat,
pos.alt
),
duration: 2,
});
} else {
viewer.scene.camera.setView({
destination: new Cesium.Cartesian3.fromDegrees(
113.27,
23.13,
600000
),
// orientation: {
// heading: 0,
// pitch: -90,
// roll: 0,
// },
duration: 2,
});
}
this.viewerAddEventListener(); this.viewerAddEventListener();
}, 300); }, 300);
}, },
handleChangeTreeShow() {
this.showTreeBox = !this.showTreeBox;
if (this.showTreeBox) {
this.$nextTick(() => {
this.$refs.treeRef?.setCheckedKeys(this.checkList);
});
}
},
handleAddHtmlLayer(position, data) { handleAddHtmlLayer(position, data) {
console.log("添加DivIcon >>>>> ", position, data); console.log("添加DivIcon >>>>> ", position, data);
htmlLayer?.clear(); htmlLayer?.clear();
@ -300,7 +338,6 @@ export default {
}, },
}, },
created() { created() {
this.initData();
emitter.on("openDialog", this.openDialog); emitter.on("openDialog", this.openDialog);
// devRun(() => { // devRun(() => {
// setTimeout(() => { // setTimeout(() => {
@ -312,9 +349,7 @@ export default {
// }); // });
}, },
mounted() { mounted() {
setTimeout(() => { this.initData();
this.initMap();
}, 50);
}, },
beforeDestroy() { beforeDestroy() {
window.viewer = null; window.viewer = null;

Loading…
Cancel
Save