Browse Source

fix: 弹框数据、图表数据

feature-v1.0.0
ruancuihong 1 month ago
parent
commit
34e9069b56
  1. 2
      src/App.vue
  2. 2
      src/views/Main/DailyPatrolCard/index.vue
  3. 47
      src/views/Main/MonitoringCard/index.vue
  4. 9
      src/views/Main/ProjectCountCard/index.vue
  5. 41
      src/views/Main/ProjectOperation/components/DataStatistics.vue
  6. 40
      src/views/Main/ProjectOperation/components/MonitorWarning.vue
  7. 4
      src/views/Main/ProjectOperation/index.vue
  8. 2
      src/views/Main/RiskInspectionCard/index.vue
  9. 35
      src/views/Main/SafetyAppraise/index.vue

2
src/App.vue

@ -21,7 +21,7 @@ body {
font-family: "Helvetica Neue", Helvetica, Tahoma, Arial, "Microsoft Yahei", "Hiragino Sans GB", "WenQuanYi Micro Hei",
sans-serif;
font-size: 14px;
color: #ffffff;
/* color: #ffffff; */
background: #000;
-webkit-overflow-scrolling: touch;
}

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

@ -50,7 +50,7 @@ const getChartData = async (time: any) => {
...time,
group: 'K6'
};
const data: any = await chartStore.initStatisticChart(pramas);
const data: any = chartStore.initStatisticChart(pramas);
if (data?.yaxis?.length) {
let newArr = data.yaxis.flatMap((v: any) => v.series);
newArr?.forEach((item: any) => {

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

@ -7,48 +7,63 @@
</div>
<div class="right">
<div class="name">测报设施建设</div>
<div class="count">{{ chartData.syq + chartData.dbaq }}</div>
<div class="count">{{ chartData.cz + chartData.cd + chartData.yx || 0 }}</div>
</div>
</div>
<div class="cart-item-row">
<div class="left">
<div class="count">{{ chartData.syq }}</div>
<div class="name">水雨情监测设施</div>
<div class="count">{{ chartData.cz || 0 }}</div>
<div class="name">测站数量</div>
<!-- <div class="name">水雨情监测设施</div> -->
</div>
<div class="right">
<div class="count">{{ chartData.dbaq }}</div>
<div class="name">水库大坝安全监测设施</div>
<div class="count">{{ chartData.cd || 0 }}</div>
<div class="name">测点数量</div>
<!-- <div class="name">水库大坝安全监测设施</div> -->
</div>
<div class="right">
<div class="count">{{ chartData.yx || 0 }}</div>
<div class="name">影像监视</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { reactive, onMounted } from "vue";
import { getlStatisticChart } from "@/api/safety/index";
import { reactive, onMounted } from 'vue';
import { getlStatisticChart } from '@/api/safety/index';
defineOptions({
name: "MonitoringCard",
name: 'MonitoringCard'
});
const chartData = reactive<any>({
syq: 0,
dbaq: 0,
dbaq: 0
});
onMounted(() => {
getlStatisticChart({
endTime: "",
startTime: "",
adcd: "",
group: "K2",
endTime: '',
startTime: '',
adcd: '',
group: 'K2'
}).then((res: any) => {
const series = res?.data?.data?.yaxis?.[0]?.series;
if (!series) return;
series.forEach((item: any) => {
if (item.code === "YZT_CONSTRUCT_SYQ_SUM") {
if (item.code === 'YZT_CONSTRUCT_SYQ_SUM') {
chartData.syq = +(+item.sum).toFixed(0);
}
if (item.code === "YZT_CONSTRUCT_DBAQ_SUM") {
if (item.code === 'YZT_CONSTRUCT_DBAQ_SUM') {
chartData.dbaq = +(+item.sum).toFixed(0);
}
if (item.code === 'ATT_ST_BASE') {
chartData.cz = +(+item.sum).toFixed(0);
}
if (item.code === 'ATT_ST_MP') {
chartData.cd = +(+item.sum).toFixed(0);
}
if (item.code === 'ATT_WMST_BASE') {
chartData.yx = +(+item.sum).toFixed(0);
}
});
});
});
@ -123,7 +138,7 @@ onMounted(() => {
line-height: 40px;
letter-spacing: 0em;
font-variation-settings: "opsz" auto;
font-variation-settings: 'opsz' auto;
color: #36b29e;
}
}

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

@ -24,16 +24,21 @@ const projectCount = ref(0);
const projectData: any = ref([]);
const getChartData = async () => {
projectCount.value = 0;
projectData.value = [];
// projectData.value = [];
const pramas = {
endTime: '',
startTime: '',
group: 'K1'
};
const data: any = await chartStore.initStatisticChart(pramas);
const data: any = chartStore.initStatisticChart(pramas)
if (data?.yaxis?.length) {
projectData.value = [];
let newArr = data.yaxis.flatMap((v: any) => v.series);
newArr?.forEach((item: any) => {
// if (item.code === 'YZT_TOUR_CHECK_RWS_SUM') {
// projectData.value.rws = +(+item.sum).toFixed(0);
// }
projectData.value.push({
name: item.name || '',
value: Number(item.sum)?.toFixed(0) || 0,

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

@ -68,7 +68,7 @@
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, watch } from "vue";
import { onMounted, ref } from "vue";
import {
getReservoirCZListData,
getReservoirCDListData,
@ -93,7 +93,7 @@ const cascaderProps = {
children: "children",
checkStrictly: true,
lazy: true,
lazyLoad(node, resolve) {
lazyLoad(node: any, resolve: any) {
console.log("lazyLoad-node >>>>> ", node);
if (node && node.data && node.data.prjcd) {
getReservoirCDListData({
@ -106,11 +106,11 @@ const cascaderProps = {
}
},
};
const attributesList = ref([]);
let echart1 = null;
let echart2 = null;
let echart3 = null;
let echart4 = null;
const attributesList: any = ref([]);
let echart1: any = null;
let echart2: any = null;
let echart3: any = null;
let echart4: any = null;
const echartsRef1 = ref();
const echartsRef2 = ref();
const echartsRef3 = ref();
@ -128,7 +128,7 @@ function getData() {
stcd: cascaderArr.value[0] || "",
mpcd: cascaderArr.value[1] || "",
}).then((res) => {
attributesList.value = res.data;
attributesList.value = res;
});
break;
case "2":
@ -137,7 +137,7 @@ function getData() {
break;
}
}
function initChart(data, chartInstance, echartRes) {
function initChart(data: any, chartInstance: any, echartRes: any) {
// echarts
if (!echartRes) {
return;
@ -154,7 +154,7 @@ function initChart(data, chartInstance, echartRes) {
function initLineOptions(data: any) {
const { markLine, xaxis, yaxis } = data;
if (!xaxis || !yaxis || !yaxis.length) return {};
let yAxis = yaxis.map((v) => {
let yAxis = yaxis.map((v: any) => {
return {
type: "value",
name: `${v.name}(${v.unit})`,
@ -162,10 +162,10 @@ function initLineOptions(data: any) {
};
});
let series = [];
yaxis.forEach((v, i) => {
let series: any = [];
yaxis.forEach((v: any, i: any) => {
if (v.series?.length) {
v.series.forEach((v2) => {
v.series.forEach((v2: any) => {
series.push({
type: "line",
smooth: true,
@ -178,9 +178,9 @@ function initLineOptions(data: any) {
});
if (markLine && markLine.length && series.length) {
let seriesItem = series.find((v) => v.yAxisIndex === 1) || series[0];
let seriesItem = series.find((v: any) => v.yAxisIndex === 1) || series[0];
let colors = ["#f8afaf", "#bae4dd"];
let markLineData = markLine.map((v, i) => {
let markLineData = markLine.map((v: any, i: any) => {
return {
name: v.name,
yAxis: v.value,
@ -337,6 +337,9 @@ onMounted(() => {
}
.attributes-box {
margin-bottom: 16px;
width: 100%;
height: 100%;
padding: 24px 12px;
.title {
padding-left: 10px;
font-size: 14px;
@ -395,6 +398,9 @@ onMounted(() => {
.echarts-box {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
padding: 24px 12px;
.echarts-dom-box {
margin-bottom: 24px;
&:nth-child(2n) {
@ -426,4 +432,9 @@ onMounted(() => {
}
}
}
.text-center {
padding-top: 30px;
text-align: center;
color: rgba(0, 0, 0, 0.9);
}
</style>

40
src/views/Main/ProjectOperation/components/MonitorWarning.vue

@ -38,47 +38,47 @@
<div class="mt-10">
<el-table :data="tableData" border>
<el-table-column label="测站名称">
<template slot-scope="scope">
<span>{{ scope.row.stnm }}</span>
<template #default="{ row }">
<span>{{ row.stnm }}</span>
</template>
</el-table-column>
<el-table-column label="测站编码">
<template slot-scope="scope">
<span>{{ scope.row.stcd }}</span>
<template #default="{ row }">
<span>{{ row.stcd }}</span>
</template>
</el-table-column>
<el-table-column label="测站类型">
<template slot-scope="scope">
<span>{{ scope.row.sttp }}</span>
<template #default="{ row }">
<span>{{ row.sttp }}</span>
</template>
</el-table-column>
<el-table-column label="预警类型">
<template slot-scope="scope">
<span>{{ scope.row.alarmType }}</span>
<template #default="{ row }">
<span>{{ row.alarmType }}</span>
</template>
</el-table-column>
<el-table-column label="监测数据">
<template slot-scope="scope">
<span>{{ scope.row.monitorData }}</span>
<template #default="{ row }">
<span>{{ row.monitorData }}</span>
</template>
</el-table-column>
<el-table-column label="监测时间">
<template slot-scope="scope">
<span>{{ scope.row.monitorTime }}</span>
<template #default="{ row }">
<span>{{ row.monitorTime }}</span>
</template>
</el-table-column>
<el-table-column label="预警值" width="100">
<template slot-scope="scope">
<span>{{ scope.row.alarmValue }}</span>
<template #default="{ row }">
<span>{{ row.alarmValue }}</span>
</template>
</el-table-column>
<el-table-column label="预警时间">
<template slot-scope="scope">
<span>{{ scope.row.alarmTime }}</span>
<template #default="{ row }">
<span>{{ row.alarmTime }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="操作" width="120">
<template slot-scope="scope">
<template #default="{ row }">
<el-button type="text" size="small">告警处置</el-button>
<el-button type="text" size="small">解除本次预警</el-button>
</template>
@ -88,7 +88,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, watch } from 'vue';
import { ref, watch } from 'vue';
import dayjs from 'dayjs';
import { getReservoirCZAlarmPageData } from '@/api/reservoir';
@ -120,7 +120,7 @@ watch(
// getTableData();
// });
function getTableData() {
function getTableData(code = '') {
getReservoirCZAlarmPageData({
startDate: startDate.value + ' 00:00:00',
endDate: endDate.value + ' 23:59:59',
@ -132,7 +132,7 @@ function getTableData() {
paramsData.value.total = res.total;
});
}
function handleChangeDate(value) {
function handleChangeDate(value: any) {
switch (value) {
case '0':
startDate.value = dayjs().subtract(1, 'month').format('YYYY-MM-DD HH:mm:ss');

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

@ -35,8 +35,8 @@ import { Close } from "@element-plus/icons-vue";
// import VideoAnalysis from "./components/VideoAnalysis.vue";
const props = defineProps({
data: {
type: String,
default: "",
type: Object,
default: {},
},
});
const resCode = ref("");

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

@ -59,7 +59,7 @@ const getChartData = async (time: any) => {
...time,
group: 'K5'
};
const data: any = await chartStore.initStatisticChart(pramas);
const data: any = chartStore.initStatisticChart(pramas);
if (data?.yaxis?.length) {
let newArr = data.yaxis.flatMap((v: any) => v.series);
newArr?.forEach((item: any) => {

35
src/views/Main/SafetyAppraise/index.vue

@ -2,24 +2,24 @@
<div class="safety-appraise">
<div class="sy-water-cart-second-title">安全鉴定</div>
<div class="appraise-wrapper">
<div class="appraise-item" v-for="(item, index) in safetyData" :key="index">
<!-- <div class="appraise-item" v-for="(item, index) in safetyData" :key="index">
<div class="count total" :class="[{ wait: item.name === '待鉴定' }, { ok: item.name === '已鉴定' }]">
{{ item?.value || '' }}
</div>
<div class="name">{{ item?.name || '' }}</div>
</div>
<!-- <div class="appraise-item">
<div class="count total">456</div>
</div> -->
<div class="appraise-item">
<div class="count total">{{ safetyData.rws || 0 }}</div>
<div class="name">任务数</div>
</div>
<div class="appraise-item">
<div class="count wait">400</div>
<div class="count wait">{{ safetyData.djd || 0 }}</div>
<div class="name">待鉴定</div>
</div>
<div class="appraise-item">
<div class="count ok">56</div>
<div class="count ok">{{ safetyData.yjd || 0 }}</div>
<div class="name">已鉴定</div>
</div> -->
</div>
</div>
<div class="appraise-progress">
<div class="tips">
@ -27,7 +27,7 @@
已完成<span class="ok">{{ okNum }}%</span>
</div>
<div>
进行中<span class="in">{{ 100 - okNum }}%</span>
进行中<span class="in">{{ okNum ? 100 - okNum : 0 }}%</span>
</div>
<!-- <div>超期未鉴定<span class="overdue">23%</span></div> -->
</div>
@ -82,11 +82,20 @@ const getChartData = async (time: any) => {
if (data?.yaxis?.length) {
let newArr = data.yaxis.flatMap((v: any) => v.series);
newArr?.forEach((item: any) => {
safetyData.value.push({
name: item.name || '',
value: Number(item.sum)?.toFixed(0) || 0,
unit: item.unit || ''
});
if (item.code === 'YZT_TOUR_CHECK_RWS_SUM') {
safetyData.rws = +(+item.sum).toFixed(0);
}
if (item.code === 'YZT_TOUR_CHECK_DJD_SUM') {
safetyData.dyd = +(+item.sum).toFixed(0);
}
if (item.code === 'YZT_TOUR_CHECK_YJD_SUM') {
safetyData.yjd = +(+item.sum).toFixed(0);
}
// safetyData.value.push({
// name: item.name || '',
// value: Number(item.sum)?.toFixed(0) || 0,
// unit: item.unit || ''
// });
taskCount.value += Number(item.sum) || 0;
});
} else {

Loading…
Cancel
Save