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. 40
      src/views/dike/safeOperation/index.vue
  3. 89
      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. 89
      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;
}
if (!layerType || !(action = layerActions[layerType])) return;
console.log(action)
const layer = await action(layerData);
console.log(layer)
console.log(layer);
layer && window.viewer.addLayer(layer);
if (["013000"].includes(layerType)) {
// 3d tiles

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

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

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

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

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

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

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

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

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

@ -17,7 +17,7 @@
></el-button>
</el-input> -->
<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="" />
图层管理
</div>
@ -36,7 +36,7 @@
:data="treeData"
default-expand-all
node-key="id"
ref="tree"
ref="treeRef"
show-checkbox
highlight-current
:props="defaultProps"
@ -58,7 +58,7 @@
</div>
</Transition>
<div class="legend-icon"><<Legend></Legend></div>
<div class="legend-icon"><Legend></Legend></div>
<!-- 弹窗 -->
<el-dialog
@ -83,6 +83,7 @@ import mitt from "mitt";
import ProjectDetail from "./components/ProjectDetail.vue";
import { getSceneListData, getLayerData } from "@/api/mapCommon";
import { getSceneConfig } from "@/api/aiSupervision/layerConfigApi";
import {
addLayer,
@ -124,21 +125,34 @@ export default {
children: "layers",
label: "nameCn",
},
configData: null,
layerList: [],
checkList: [],
treeData: [],
};
},
methods: {
initData() {
getSceneListData({
async initData() {
let res1 = await getSceneListData({
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() {
this.mapSceneType = this.mapSceneType === 3 ? 2 : 3;
@ -157,6 +171,12 @@ export default {
this.resInfoData = data;
},
initMap() {
if (!sycim) {
setTimeout(() => {
this.initMap();
}, 1000);
return;
}
viewer = new sycim.Viewer("reservoir-map-container");
window.viewer = viewer;
let baseLayer = sycim.ImageryLayerFactory.createImageryLayer(
@ -178,21 +198,31 @@ export default {
depthTestAgainstTerrain: true,
},
});
//
// viewer.on(
// sycim.SceneEventType.CAMERA_CHANGED,
// () => {
// viewer.setOptions({
// globe: {
// depthTestAgainstTerrain: viewer.cameraPosition.alt > 10000 ? false : true
// }
// });
// },
// viewer
// );
setTimeout(() => {
if (this.layerList.length) {
this.layerList.forEach((item) => {
addLayer(item);
});
}
if (this.configData) {
let pos = JSON.parse(this.configData.cameraPosture);
viewer.scene.camera.setView({
destination: new Cesium.Cartesian3.fromDegrees(113.27, 23.13, 600000),
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,
@ -200,10 +230,18 @@ export default {
// },
duration: 2,
});
}
this.viewerAddEventListener();
}, 300);
},
handleChangeTreeShow() {
this.showTreeBox = !this.showTreeBox;
if (this.showTreeBox) {
this.$nextTick(() => {
this.$refs.treeRef?.setCheckedKeys(this.checkList);
});
}
},
handleAddHtmlLayer(position, data) {
console.log("添加DivIcon >>>>> ", position, data);
htmlLayer?.clear();
@ -300,7 +338,6 @@ export default {
},
},
created() {
this.initData();
emitter.on("openDialog", this.openDialog);
// devRun(() => {
// setTimeout(() => {
@ -312,9 +349,7 @@ export default {
// });
},
mounted() {
setTimeout(() => {
this.initMap();
}, 50);
this.initData();
},
beforeDestroy() {
window.viewer = null;

Loading…
Cancel
Save