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 { LayerTypeEnum } from "@/enums/projectEnum";
import { queryLayersByPos } from "@/utils/mapUtils"; import { queryLayersByPos } from "@/utils/mapUtils";
import axios from "axios"; import axios from "axios";
import { throttle } from "lodash-es";
import { useProjectStore } from "@/store/modules/project"; import { useProjectStore } from "@/store/modules/project";
const clustering = reactive({ const clustering = reactive({
enabled: true, enabled: true,
@ -275,6 +274,25 @@ const baseLayerActions: Record<string, any> = {
}; };
export function useLayer() { 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 addLayer = async (layerData: any) => {
const { layerType, url, id, isNeedCluster } = layerData; const { layerType, url, id, isNeedCluster } = layerData;
let action = null; let action = null;
@ -362,7 +380,7 @@ export function useLayer() {
} }
}; };
const removeLayer = (layerData: any) => { const removeLayer = (layerData: any) => {
const { id, layerType } = layerData; const { id, layerType, isNeedCluster, nameCn } = layerData;
if (!layerType) return; if (!layerType) return;
const type: any = LayerTypeEnum[layerType as never]; const type: any = LayerTypeEnum[layerType as never];
@ -376,30 +394,15 @@ export function useLayer() {
type: SyCim.LayerType[type], type: SyCim.LayerType[type],
} as any); } as any);
} }
if (isNeedCluster === "1" && nameCn === "水库点") {
removeViewerClick();
}
}; };
const zoomToLayer = (data: any) => { const zoomToLayer = (data: any) => {
const { layerType } = data; const { layerType } = data;
zoomToLayerActions[layerType as string]?.(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 { return {
addLayer, addLayer,
removeLayer, removeLayer,

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

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

Loading…
Cancel
Save