diff --git a/src/hooks/web/useProject.tsx b/src/hooks/web/useProject.tsx index c92ebe7..a1d5ea7 100644 --- a/src/hooks/web/useProject.tsx +++ b/src/hooks/web/useProject.tsx @@ -277,12 +277,12 @@ export function useLayer() { const viewerClickEvent = throttle((e: any) => { if (!e.wgs84SurfacePosition) return; const projectStore = useProjectStore(); - const selectLayers: any = projectStore.selectedLayers; - // .filter((item: any) => item.isNeedCluster === "1"); + const selectLayers: any = projectStore.selectedLayers.filter((item: any) => item.isNeedCluster === "1"); queryLayersByPos(e.wgs84SurfacePosition, selectLayers, (res: any) => { if (res?.attributes?.showCode) { const { showCode, showName, scale } = res?.attributes; - window.$bus.$emit("open-water-dialog", { + // TODO: 待处理区分 + window.$bus.$emit("open-reservoir-dialog", { code: showCode, name: showName, scale @@ -321,93 +321,93 @@ export function useLayer() { } if (!layerType || !(action = layerActions[layerType as string])) return; let layer: any = await action(layerData); - // if (isNeedCluster === "1") { - // let baseUrl = import.meta.env.VITE_BASE_URL; - // const data = await getFeatures(layerData); - // if (data?.features?.[0]?.geometry?.type === 'Point') { - // let layerConfig = {}; - // switch (layerData.nameCn) { - // case "水库点": - // layerConfig = { - // isUniqueRender: true, - // field: "ENG_SCAL", - // fieldOptions: [ - // { name: "1.0", attr: "image", value: "reservoir_big.png" }, - // { name: "2.0", attr: "image", value: "reservoir_big.png" }, - // { name: "3.0", attr: "image", value: "reservoir_normal.png" }, - // { name: "4.0", attr: "image", value: "reservoir_small.png" }, - // { name: "5.0", attr: "image", value: "reservoir_small.png" }, - // ], - // width: 24, - // height: 24, - // image: "reservoir_big.png", - // }; - // break; - // case "水闸": - // layerConfig = { - // isUniqueRender: true, - // field: "ENG_SCAL", - // fieldOptions: [ - // { name: "1.0", attr: "image", value: "sluice_big.png" }, - // { name: "2.0", attr: "image", value: "sluice_big.png" }, - // { name: "3.0", attr: "image", value: "sluice_middle.png" }, - // { name: "4.0", attr: "image", value: "sluice_small.png" }, - // { name: "5.0", attr: "image", value: "sluice_small.png" }, - // ], - // image: "sluice_middle.png", - // }; - // break; - // } - // layer = new SyCim.ClusterWfsLayer(layerData.id, { - // data, - // symbol: { - // type: "billboardP", - // imageProxy: `${baseUrl}/img/map/`, // 图片代理 - // style: { - // clampToGround: true, - // image: "reservoir_small.png", - // ...layerConfig, - // }, - // clustering: { - // enabled: clustering.enabled, - // pixelRange: clustering.pixelRange, - // minimumClusterSize: clustering.minimumClusterSize, - // clusterEvent: undefined, - // clusterColors: undefined, // 聚合点颜色 - // getImage: undefined, // 获取聚合图片的函数 - // }, - // }, - // }); - // layer.bindPopup( - // (e: any) => { - // const graphic = e.graphic; - // if (graphic) { - // const attr = graphic?.attr; - // const code = attr?.RES_CODE ?? attr?.WAGA_CODE; - // const name = attr?.RES_NAME ?? attr?.WAGA_NAME; - // const scale = attr?.ENG_SCAL ?? attr?.WAGA_TYPE; - // if (attr?.RES_CODE) { - // window.$bus.$emit("open-water-dialog", { - // code, - // name, - // scale - // }); - // return ""; - // } else { - // return `
- //
水闸名称:${name}
- //
水闸编码:${code}
- //
水闸位置:${attr.WAGA_LOC}
- //
`; - // } - // } - // }, - // { - // closeButton: true, - // }, - // ); - // } - // } + if (isNeedCluster === "1") { + let baseUrl = import.meta.env.VITE_BASE_URL; + const data = await getFeatures(layerData); + if (data?.features?.[0]?.geometry?.type === 'Point') { + let layerConfig = {}; + switch (layerData.nameCn) { + case "水库点": + layerConfig = { + isUniqueRender: true, + field: "ENG_SCAL", + fieldOptions: [ + { name: "1.0", attr: "image", value: "reservoir_big.png" }, + { name: "2.0", attr: "image", value: "reservoir_big.png" }, + { name: "3.0", attr: "image", value: "reservoir_normal.png" }, + { name: "4.0", attr: "image", value: "reservoir_small.png" }, + { name: "5.0", attr: "image", value: "reservoir_small.png" }, + ], + width: 24, + height: 24, + image: "reservoir_big.png", + }; + break; + case "水闸": + layerConfig = { + isUniqueRender: true, + field: "ENG_SCAL", + fieldOptions: [ + { name: "1.0", attr: "image", value: "sluice_big.png" }, + { name: "2.0", attr: "image", value: "sluice_big.png" }, + { name: "3.0", attr: "image", value: "sluice_middle.png" }, + { name: "4.0", attr: "image", value: "sluice_small.png" }, + { name: "5.0", attr: "image", value: "sluice_small.png" }, + ], + image: "sluice_middle.png", + }; + break; + } + layer = new SyCim.ClusterWfsLayer(layerData.id, { + data, + symbol: { + type: "billboardP", + imageProxy: `${baseUrl}/img/map/`, // 图片代理 + style: { + clampToGround: true, + image: "reservoir_small.png", + ...layerConfig, + }, + clustering: { + enabled: clustering.enabled, + pixelRange: clustering.pixelRange, + minimumClusterSize: clustering.minimumClusterSize, + clusterEvent: undefined, + clusterColors: undefined, // 聚合点颜色 + getImage: undefined, // 获取聚合图片的函数 + }, + }, + }); + layer.bindPopup( + (e: any) => { + const graphic = e.graphic; + if (graphic) { + const attr = graphic?.attr; + const code = attr?.RES_CODE ?? attr?.WAGA_CODE; + const name = attr?.RES_NAME ?? attr?.WAGA_NAME; + const scale = attr?.ENG_SCAL ?? attr?.WAGA_TYPE; + if (attr?.RES_CODE) { + window.$bus.$emit("open-reservoir-dialog", { + code, + name, + scale + }); + return ""; + } else { + return `
+
水闸名称:${name}
+
水闸编码:${code}
+
水闸位置:${attr.WAGA_LOC}
+
`; + } + } + }, + { + closeButton: true, + }, + ); + } + } layer && window.viewer.addLayer(layer); if (["013000"].includes(layerType)) { // 3d tiles diff --git a/src/views/Main/ProjectOperation/components/BaseInfo.vue b/src/views/Main/Dike/components/BaseInfo.vue similarity index 100% rename from src/views/Main/ProjectOperation/components/BaseInfo.vue rename to src/views/Main/Dike/components/BaseInfo.vue diff --git a/src/views/Main/ProjectOperation/components/DataStatistics.vue b/src/views/Main/Dike/components/DataStatistics.vue similarity index 100% rename from src/views/Main/ProjectOperation/components/DataStatistics.vue rename to src/views/Main/Dike/components/DataStatistics.vue diff --git a/src/views/Main/ProjectOperation/components/MonitorWarning.vue b/src/views/Main/Dike/components/MonitorWarning.vue similarity index 100% rename from src/views/Main/ProjectOperation/components/MonitorWarning.vue rename to src/views/Main/Dike/components/MonitorWarning.vue diff --git a/src/views/Main/ProjectOperation/components/VideoAnalysis.vue b/src/views/Main/Dike/components/VideoAnalysis.vue similarity index 100% rename from src/views/Main/ProjectOperation/components/VideoAnalysis.vue rename to src/views/Main/Dike/components/VideoAnalysis.vue diff --git a/src/views/Main/ProjectOperation/index.vue b/src/views/Main/Dike/index.vue similarity index 98% rename from src/views/Main/ProjectOperation/index.vue rename to src/views/Main/Dike/index.vue index 48784c5..82fe24e 100644 --- a/src/views/Main/ProjectOperation/index.vue +++ b/src/views/Main/Dike/index.vue @@ -77,7 +77,7 @@ function handleGetResInfo(data: any) { } function handleClose() { - window.$bus.$emit("close-water-dialog"); + window.$bus.$emit("close-reservoir-dialog"); } watch( () => props.data, diff --git a/src/views/Main/Reservoir/components/BaseInfo.vue b/src/views/Main/Reservoir/components/BaseInfo.vue new file mode 100644 index 0000000..b594d4e --- /dev/null +++ b/src/views/Main/Reservoir/components/BaseInfo.vue @@ -0,0 +1,769 @@ + + + diff --git a/src/views/Main/Reservoir/components/DataStatistics.vue b/src/views/Main/Reservoir/components/DataStatistics.vue new file mode 100644 index 0000000..efdd1d9 --- /dev/null +++ b/src/views/Main/Reservoir/components/DataStatistics.vue @@ -0,0 +1,446 @@ + + + + diff --git a/src/views/Main/Reservoir/components/MonitorWarning.vue b/src/views/Main/Reservoir/components/MonitorWarning.vue new file mode 100644 index 0000000..91aa42e --- /dev/null +++ b/src/views/Main/Reservoir/components/MonitorWarning.vue @@ -0,0 +1,198 @@ + + + diff --git a/src/views/Main/Reservoir/components/VideoAnalysis.vue b/src/views/Main/Reservoir/components/VideoAnalysis.vue new file mode 100644 index 0000000..3b40959 --- /dev/null +++ b/src/views/Main/Reservoir/components/VideoAnalysis.vue @@ -0,0 +1,94 @@ + + + diff --git a/src/views/Main/Reservoir/index.vue b/src/views/Main/Reservoir/index.vue new file mode 100644 index 0000000..82fe24e --- /dev/null +++ b/src/views/Main/Reservoir/index.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/views/Main/Sluice/components/BaseInfo.vue b/src/views/Main/Sluice/components/BaseInfo.vue new file mode 100644 index 0000000..b594d4e --- /dev/null +++ b/src/views/Main/Sluice/components/BaseInfo.vue @@ -0,0 +1,769 @@ + + + diff --git a/src/views/Main/Sluice/components/DataStatistics.vue b/src/views/Main/Sluice/components/DataStatistics.vue new file mode 100644 index 0000000..efdd1d9 --- /dev/null +++ b/src/views/Main/Sluice/components/DataStatistics.vue @@ -0,0 +1,446 @@ + + + + diff --git a/src/views/Main/Sluice/components/MonitorWarning.vue b/src/views/Main/Sluice/components/MonitorWarning.vue new file mode 100644 index 0000000..91aa42e --- /dev/null +++ b/src/views/Main/Sluice/components/MonitorWarning.vue @@ -0,0 +1,198 @@ + + + diff --git a/src/views/Main/Sluice/components/VideoAnalysis.vue b/src/views/Main/Sluice/components/VideoAnalysis.vue new file mode 100644 index 0000000..3b40959 --- /dev/null +++ b/src/views/Main/Sluice/components/VideoAnalysis.vue @@ -0,0 +1,94 @@ + + + diff --git a/src/views/Main/Sluice/index.vue b/src/views/Main/Sluice/index.vue new file mode 100644 index 0000000..82fe24e --- /dev/null +++ b/src/views/Main/Sluice/index.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/views/Main/index.vue b/src/views/Main/index.vue index 42e8614..662ecda 100644 --- a/src/views/Main/index.vue +++ b/src/views/Main/index.vue @@ -24,7 +24,8 @@ - + // 水库详情弹窗 +