Browse Source

Merge branch 'feature-v1.0.0' of ssh://gitlab.datameta.com:2224/project/water/data-board-2025 into feature-v1.0.0

feature-v1.0.0
ruancuihong 1 month ago
parent
commit
df535e12bb
  1. 45
      src/hooks/web/useProject.tsx
  2. 24
      src/views/Main/ProjectOperation/components/DataStatistics.vue

45
src/hooks/web/useProject.tsx

@ -3,7 +3,6 @@ import * as SyCim from "sy-cesium-sdk";
import { LayerTypeEnum } from "@/enums/projectEnum";
import { queryLayersByPos } from "@/utils/mapUtils";
import axios from "axios";
import { throttle } from "lodash-es";
import { useProjectStore } from "@/store/modules/project";
const clustering = reactive({
enabled: true,
@ -275,6 +274,25 @@ const baseLayerActions: Record<string, any> = {
};
export function useLayer() {
const viewerClick = (e: any) => {
const projectStore = useProjectStore();
const selectedLayers: any = projectStore.selectedLayers;
queryLayersByPos(e.wgs84SurfacePosition, selectedLayers, (res: any) => {
if (res?.attributes?.showCode) {
const { showCode, showName } = res?.attributes;
window.$bus.$emit("open-water-dialog", {
code: showCode,
name: showName,
});
}
});
};
const addViewerClick = () => {
window.viewer?.on(SyCim.MouseEventType.CLICK, viewerClick, window.viewer);
};
const removeViewerClick = () => {
window.viewer?.off(SyCim.MouseEventType.CLICK, viewerClick, window.viewer);
};
const addLayer = async (layerData: any) => {
const { layerType, url, id, isNeedCluster } = layerData;
let action = null;
@ -362,7 +380,7 @@ export function useLayer() {
}
};
const removeLayer = (layerData: any) => {
const { id, layerType } = layerData;
const { id, layerType, isNeedCluster, nameCn } = layerData;
if (!layerType) return;
const type: any = LayerTypeEnum[layerType as never];
@ -376,30 +394,15 @@ export function useLayer() {
type: SyCim.LayerType[type],
} as any);
}
if (isNeedCluster === "1" && nameCn === "水库点") {
removeViewerClick();
}
};
const zoomToLayer = (data: any) => {
const { layerType } = data;
zoomToLayerActions[layerType as string]?.(data);
};
const viewerClick = (e: any) => {
const projectStore = useProjectStore();
const selectedLayers: any = projectStore.selectedLayers;
queryLayersByPos(e.wgs84SurfacePosition, selectedLayers, (res: any) => {
if (res?.attributes?.showCode) {
const { showCode, showName } = res?.attributes;
window.$bus.$emit("open-water-dialog", {
code: showCode,
name: showName,
});
}
});
};
const addViewerClick = () => {
window.viewer?.on(SyCim.MouseEventType.CLICK, viewerClick, window.viewer);
};
const removeViewerClick = () => {
window.viewer?.off(SyCim.MouseEventType.CLICK, viewerClick, window.viewer);
};
return {
addLayer,
removeLayer,

24
src/views/Main/ProjectOperation/components/DataStatistics.vue

@ -16,7 +16,7 @@
v-model="dateArr"
type="daterange"
range-separator="至"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
@ -85,7 +85,7 @@ const props = defineProps({
const cascaderOptions = ref([]);
const showType = ref("1");
const cascaderArr = ref([]);
const dataArr = ref([]);
const dateArr = ref([]);
const cascaderProps = {
expandTrigger: "hover",
label: "stnm",
@ -119,11 +119,10 @@ const echartsRef4 = ref();
function getData() {
switch (showType.value) {
case "1":
console.log("dataArr.value >> ", dataArr.value);
//
getReservoirMonitorIndexData({
startTime: dataArr.value ? dataArr.value[0] + " 00:00:00" : "",
endTime: dataArr.value ? dataArr.value[1] + " 23:59:59" : "",
startTime: dateArr.value?.length ? dateArr.value[0] + " 00:00:00" : "",
endTime: dateArr.value?.length ? dateArr.value[1] + " 23:59:59" : "",
group: "SK",
resCode: props.resCode,
stcd: cascaderArr.value[0] || "",
@ -255,8 +254,8 @@ function initLineOptions(data: any) {
function getEchartsData() {
//
getReservoirCZMonitorEchartsData({
startTime: dataArr.value ? dataArr.value[0] + " 00:00:00" : "",
endTime: dataArr.value ? dataArr.value[1] + " 23:59:59" : "",
startTime: dateArr.value?.length ? dateArr.value[0] + " 00:00:00" : "",
endTime: dateArr.value?.length ? dateArr.value[1] + " 23:59:59" : "",
resCode: props.resCode,
stcd: cascaderArr.value[0] || "",
mpcd: cascaderArr.value[1] || "",
@ -268,8 +267,8 @@ function getEchartsData() {
});
//
getReservoirCZMonitorEchartsData({
startTime: dataArr.value ? dataArr.value[0] + " 00:00:00" : "",
endTime: dataArr.value ? dataArr.value[1] + " 23:59:59" : "",
startTime: dateArr.value?.length ? dateArr.value[0] + " 00:00:00" : "",
endTime: dateArr.value?.length ? dateArr.value[1] + " 23:59:59" : "",
resCode: props.resCode,
stcd: cascaderArr.value[0] || "",
elementType: "ENV",
@ -280,8 +279,8 @@ function getEchartsData() {
});
//
getReservoirCZMonitorEchartsData({
startTime: dataArr.value ? dataArr.value[0] + " 00:00:00" : "",
endTime: dataArr.value ? dataArr.value[1] + " 23:59:59" : "",
startTime: dateArr.value?.length ? dateArr.value[0] + " 00:00:00" : "",
endTime: dateArr.value?.length ? dateArr.value[1] + " 23:59:59" : "",
resCode: props.resCode,
mpcd: cascaderArr.value[1] || "",
elementType: "C_STRESS",
@ -322,6 +321,9 @@ onMounted(() => {
height: 32px !important;
line-height: 32px !important;
}
:deep(.sy-range-editor--small) .sy-range-input {
color: rgba(0, 0, 0, 0.9) !important;
}
.search-box {
display: flex;
justify-content: space-between;

Loading…
Cancel
Save