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
80c2028735
  1. 2
      src/hooks/web/useProject.tsx
  2. 13
      src/utils/mapUtils.ts
  3. 2
      src/views/Main/InspectionCard/index.vue
  4. 3
      src/views/Main/Map/index.vue
  5. 11
      src/views/Main/MonitoringCard/index.vue
  6. 16
      src/views/Main/ProjectCountCard/index.vue
  7. 14
      src/views/Main/ProjectOperation/components/BaseInfo.vue
  8. 10
      src/views/Main/ProjectOperation/components/DataStatistics.vue
  9. 4
      src/views/Main/ProjectOperation/components/VideoAnalysis.vue
  10. 47
      src/views/Main/ProjectOperation/index.vue
  11. 9
      src/views/Main/SafetyOverviewCard/index.vue

2
src/hooks/web/useProject.tsx

@ -351,7 +351,7 @@ export function useLayer() {
// },
// clustering: {
// enabled: clustering.enabled,
// pixelRange: clustering.pixelRange,
// pixelRange: clusstering.pixelRange,
// minimumClusterSize: clustering.minimumClusterSize,
// clusterEvent: undefined,
// clusterColors: undefined, // 聚合点颜色

13
src/utils/mapUtils.ts

@ -134,28 +134,24 @@ export const queryLayersByPos = (position: any, layerList = [], cb: any) => {
[200, 201].includes(result.status) &&
result?.data?.datasetInfos?.length > 0
) {
console.log("处理业务数据 >>>>>> ", result?.data);
const fieldInfos = result.data.datasetInfos?.[0]?.fieldInfos;
console.log("fieldInfos >>>>> ", fieldInfos);
const currentFeature = result.data.features?.[0];
console.log("currentFeature >>>>> ", currentFeature);
const nameIndex = fieldInfos.findIndex((f: any) =>
["res_name", "dike_name", "waga_name"].includes(f.name)
);
const codeIndex = fieldInfos.findIndex((f: any) =>
["res_code", "dike_code", "waga_code"].includes(f.name)
);
// if (layer?.fields?.length > 0) {
// const fieldIndex = fieldInfos.findIndex((f) => f.name === layer?.fields[0]?.field);
// code = currentFeature?.fieldValues[fieldIndex];
// }
const scaleIndex = fieldInfos.findIndex((f: any) =>
["eng_scal", "dike_scale", "waga_scale"].includes(f.name)
);
resData = {
attributes: {
showCode: "" + currentFeature?.fieldValues[codeIndex],
showName: "" + currentFeature?.fieldValues[nameIndex],
scale: "" + currentFeature?.fieldValues[scaleIndex],
},
};
console.log("resData >>>>> ", resData);
}
if (cb) cb(resData);
break;
@ -229,7 +225,6 @@ export const getSelectedLayersLegend = (selectedLayersList: any) => {
`${layer.url}/legend.json?bbox=${bbox}`
);
}
console.log(result);
if (result.status === 200 && result.data) {
let currentLayer = [];
// if (mapName) {

2
src/views/Main/InspectionCard/index.vue

@ -79,7 +79,7 @@ onMounted(() => {
window.$bus.$on("inspection-card-query-data", queryData);
});
onBeforeUnmount(() => {
window.$bus.$off("inspection-card-query-data");
// window.$bus.$off("inspection-card-query-data");
});
</script>

3
src/views/Main/Map/index.vue

@ -20,7 +20,8 @@ onMounted(async () => {
});
onBeforeUnmount(() => {
window.removeEventListener("message", messageCallback);
window.$bus.$all_off();
window.removeEventListener("resize", resize);
window.removeEventListener("load", resize);
});
</script>

11
src/views/Main/MonitoringCard/index.vue

@ -32,7 +32,7 @@
</template>
<script setup lang="ts">
import { reactive, onMounted, onBeforeUnmount } from "vue";
import { reactive, onMounted } from "vue";
import { getlStatisticChart } from "@/api/safety/index";
defineOptions({
name: "MonitoringCard",
@ -57,13 +57,13 @@ const queryData = (adcd: string = "") => {
if (item.code === "YZT_CONSTRUCT_DBAQ_SUM") {
chartData.dbaq = +(+item.sum).toFixed(0);
}
if (item.code === 'YZT_SWGCJCCZ_SUM') {
if (item.code === "YZT_SWGCJCCZ_SUM") {
chartData.cz = +(+item.sum).toFixed(0);
}
if (item.code === 'YZT_SWGCJCCD_SUM') {
if (item.code === "YZT_SWGCJCCD_SUM") {
chartData.cd = +(+item.sum).toFixed(0);
}
if (item.code === 'YZT_SSYX_SUM') {
if (item.code === "YZT_SSYX_SUM") {
chartData.yx = +(+item.sum).toFixed(0);
}
});
@ -73,9 +73,6 @@ onMounted(() => {
queryData();
window.$bus.$on("monitoring-card-query-data", queryData);
});
onBeforeUnmount(() => {
window.$bus.$off("monitoring-card-query-data");
});
</script>
<style scoped lang="less">

16
src/views/Main/ProjectCountCard/index.vue

@ -32,7 +32,7 @@ const getChartData = async (adcd: string = "") => {
group: "K1",
};
const data: any = await chartStore.initStatisticChart(pramas)
const data: any = await chartStore.initStatisticChart(pramas);
if (data?.yaxis?.length) {
projectData.value = [];
let newArr = data.yaxis.flatMap((v: any) => v.series);
@ -96,13 +96,7 @@ const initChart = () => {
for (var i = 0; i < legendName.length; i++) {
if (name == projectData.value[i].name) {
return (
"{name|" +
name +
"}{rate|" +
projectData.value[i].value +
"}{unit|" +
projectData.value[i].unit +
"}"
"{name|" + name + "}{rate|" + projectData.value[i].value + "}{unit|" + projectData.value[i].unit + "}"
);
}
}
@ -189,9 +183,7 @@ const initChart = () => {
label: {
position: "center",
formatter: function () {
return ["{total|" + projectCount.value + "}", "{label|总数}"].join(
"\n"
);
return ["{total|" + projectCount.value + "}", "{label|总数}"].join("\n");
},
rich: {
total: {
@ -225,7 +217,7 @@ onMounted(() => {
onBeforeUnmount(() => {
chart?.dispose();
window.removeEventListener("resize", handleResize);
window.$bus.$off("project-count-card-query-data");
// window.$bus.$off("project-count-card-query-data");
});
</script>

14
src/views/Main/ProjectOperation/components/BaseInfo.vue

@ -528,7 +528,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, watch } from "vue";
import { ref, watch } from "vue";
import * as echarts from "echarts";
import { getReservoirBaseDetailData, getReservoirRsppDetailData } from "@/api/reservoir";
@ -538,17 +538,17 @@ const props = defineProps({
default: "",
},
});
let myChart = null;
let code = null;
const activeName = ref("1");
let typeApi = {
let myChart: any = null;
let code: any = null;
const activeName: any = ref("1");
let typeApi: any = {
["1"]: initBaseAndRsppInfo,
["2"]: initBaseAndRsppInfo,
["3"]: initEchart,
["4"]: null,
};
const form = ref({});
const dutyPersonList = ref([]);
const form: any = ref({});
const dutyPersonList: any = ref([]);
const emits = defineEmits(["getResInfo"]);
function initBaseInfo() {
getReservoirBaseDetailData(props.resCode).then((res) => {

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

@ -82,11 +82,11 @@ const props = defineProps({
default: "",
},
});
const cascaderOptions = ref([]);
const showType = ref("1");
const cascaderArr = ref([]);
const dateArr = ref([]);
const cascaderProps = {
const cascaderOptions: any = ref([]);
const showType: any = ref("1");
const cascaderArr: any = ref([]);
const dateArr: any = ref([]);
const cascaderProps: any = {
expandTrigger: "hover",
label: "stnm",
value: "stcd",

4
src/views/Main/ProjectOperation/components/VideoAnalysis.vue

@ -1,7 +1,7 @@
<template>
<div class="video-analysis">
<div class="videoSelect">
<el-select placeholder="请选择视频" v-model="activeVideo" size="mini" style="width: 240px" @change="videoChange">
<el-select placeholder="请选择视频" v-model="activeVideo" size="small" style="width: 240px" @change="videoChange">
<el-option v-for="item in videoList" :key="item" :label="item" :value="item" />
</el-select>
</div>
@ -45,7 +45,7 @@ onMounted(() => {
}
});
});
function videoChange(val) {
function videoChange(val: any) {
console.log("cameraId-watch >>>>> ", val);
getOperationPlay({
cameraId: val,

47
src/views/Main/ProjectOperation/index.vue

@ -1,7 +1,10 @@
<template>
<div class="project-detail-wrapper">
<div class="header">
<span>{{ data.name }}</span>
<div class="title">
<img :src="waterIcon" />
<span>{{ data.name }}</span>
</div>
<div class="btns">
<el-icon @click="handleClose">
<Close />
@ -27,11 +30,15 @@
</div>
</template>
<script setup lang="ts">
import { ref, defineOptions, defineEmits, defineProps, watch } from "vue";
import { ref, defineOptions, defineEmits, defineProps, watch, onMounted } from "vue";
import BaseInfo from "./components/BaseInfo.vue";
import DataStatistics from "./components/DataStatistics.vue";
import MonitorWarning from "./components/MonitorWarning.vue";
import { Close } from "@element-plus/icons-vue";
import RB from "@/assets/map/reservoir_big.png";
import RN from "@/assets/map/reservoir_normal.png";
import RS from "@/assets/map/reservoir_small.png";
// import VideoAnalysis from "./components/VideoAnalysis.vue";
const props = defineProps({
data: {
@ -44,7 +51,27 @@ defineOptions({
name: "ProjectDetail",
});
const emits = defineEmits(["getResInfo"]);
const waterIcon = ref(RN);
const activeTab = ref("1");
function setWaterIcon() {
switch (props.data.scale) {
case "1.0":
case "2.0":
waterIcon.value = RB;
break;
case "3.0":
waterIcon.value = RN;
break;
case "4.0":
case "5.0":
waterIcon.value = RS;
break;
default:
waterIcon.value = RN;
break;
}
}
function handleGetResInfo(data: any) {
emits("getResInfo", data);
}
@ -61,6 +88,10 @@ watch(
},
{ immediate: true },
);
onMounted(() => {
setWaterIcon();
});
</script>
<style scoped lang="scss">
.project-detail-wrapper {
@ -84,6 +115,18 @@ watch(
flex-direction: row;
align-items: center;
justify-content: space-between;
.title {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
margin-right: 4px;
}
}
.btns {
cursor: pointer;
}
}
.content {
height: 748px;

9
src/views/Main/SafetyOverviewCard/index.vue

@ -2,12 +2,7 @@
<div class="safety-overview-card">
<div class="sy-water-cart-title">
安全监查情况
<el-select
v-model="time"
class="sy-water-cart-title-select"
size="small"
@change="timeChange"
>
<el-select v-model="time" class="sy-water-cart-title-select" size="small" @change="timeChange">
<el-option label="今日" value="1"></el-option>
<el-option label="近7日" value="2"></el-option>
<el-option label="近30日" value="3"></el-option>
@ -81,7 +76,7 @@ onMounted(() => {
});
});
onBeforeUnmount(() => {
window.$bus.$off("safety-overview-card-query-data");
// window.$bus.$off("safety-overview-card-query-data");
});
</script>

Loading…
Cancel
Save