修改统计中心bug

This commit is contained in:
luojiayi 2025-05-21 17:43:01 +08:00
parent 22382d746e
commit 97c1a703d7
3 changed files with 34 additions and 36 deletions

View File

@ -3,16 +3,14 @@
<div class="card-head"> <div class="card-head">
<div class="title">当前设备告警记录</div> <div class="title">当前设备告警记录</div>
<div class="search"> <div class="search">
<el-select class="select" placeholder="请选择事件类型" v-model="paging.warnType" <el-select class="select" placeholder="请选择事件类型" v-model="paging.warnType" style="width: 150px; margin-right: 20px" @change="handleChange">
style="width: 150px; margin-right: 20px" @change="handleChange"> <el-option label="全部" value="" />
<el-option label="全部" value=""/> <el-option v-for="(item, index) in warnTypeList" :key="index" :label="item" :value="index" />
<el-option v-for="(item, index) in warnTypeList" :key="index" :label="item" :value="index"/>
</el-select> </el-select>
<el-select class="select" placeholder="请选择处理状态" v-model="paging.status" style="width: 150px" <el-select class="select" placeholder="请选择处理状态" v-model="paging.status" style="width: 150px" @change="handleChange">
@change="handleChange"> <el-option label="全部" value="" />
<el-option label="全部" value=""/> <el-option label="待处理" value="0" />
<el-option label="待处理" value="0"/> <el-option label="已处理" value="1" />
<el-option label="已处理" value="1"/>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -32,10 +30,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import TableCustom from "@/components/table-custom.vue"; import TableCustom from "@/components/table-custom.vue";
import {warningRecord} from "@/api/index"; import { warningRecord } from "@/api/index";
import {ref, reactive, watch} from "vue"; import { ref, reactive, watch } from "vue";
import {TDevice} from "@/api/index.d"; import { TDevice } from "@/api/index.d";
import {useRouter} from "vue-router"; import { useRouter } from "vue-router";
const statusColor = ["danger", "success"]; const statusColor = ["danger", "success"];
@ -75,11 +73,11 @@ const props = defineProps({
// //
let columns = [ let columns = [
{type: "index", label: "序号", width: 55, align: "center"}, { type: "index", label: "序号", width: 55, align: "center" },
{prop: "warnType", label: "事件类型"}, { prop: "warnType", label: "事件类型" },
{prop: "status", label: "处理状态"}, { prop: "status", label: "处理状态" },
{prop: "createTime", label: "触发时间"}, { prop: "createTime", label: "触发时间" },
{prop: "operator", label: "操作"}, { prop: "operator", label: "操作" },
]; ];
const getData = async () => { const getData = async () => {
const res = await warningRecord(paging); const res = await warningRecord(paging);
@ -97,19 +95,19 @@ const changePage = (val: number) => {
}; };
watch( watch(
() => props.deviceInfo, () => props.deviceInfo,
(newVal) => { (newVal) => {
if (newVal) { if (newVal) {
paging.deviceId = newVal.deviceId; paging.deviceId = newVal.deviceId;
getData && getData(); getData && getData();
} }
}, },
{immediate: true} // { immediate: true } //
); );
const toIncidentDispose = (id: string) => { const toIncidentDispose = (id: string) => {
router.push({ router.push({
path: "/incidentDispose", path: "/incidentDispose",
query: {id}, query: { id },
}); });
}; };
</script> </script>

View File

@ -37,9 +37,9 @@ let option = ref({
const getStatisticsUseCount = () => { const getStatisticsUseCount = () => {
statisticsUseCount().then((res) => { statisticsUseCount().then((res) => {
option.value.series.data = [ option.value.series.data = [
{ value: res.defaultCount, name: "常规模式" }, { value: res.defaultCount || 0, name: "常规模式" },
{ value: res.outsideCount, name: "户外押送" }, { value: res.outsideCount || 0, name: "户外押送" },
{ value: res.monitorCount, name: "审讯模式" }, { value: res.monitorCount || 0, name: "审讯模式" },
]; ];
myChart.setOption(option.value); myChart.setOption(option.value);
}); });

View File

@ -39,12 +39,12 @@ let option = ref({
const getStatisticsWarningApi = () => { const getStatisticsWarningApi = () => {
statisticsWarningapi().then((res) => { statisticsWarningapi().then((res) => {
option.value.series.data = [ option.value.series.data = [
{ value: res?.sosCount, name: "SOS告警" }, { value: res?.sosCount || 0, name: "SOS告警" },
{ value: res?.railCount, name: "围栏告警" }, { value: res?.railCount || 0, name: "围栏告警" },
{ value: res?.destroyCount, name: "破坏告警" }, { value: res?.destroyCount || 0, name: "破坏告警" },
{ value: res?.heartRateCount, name: "心率告警" }, { value: res?.heartRateCount || 0, name: "心率告警" },
{ value: res?.bloodOxygenCount, name: "血氧告警" }, { value: res?.bloodOxygenCount || 0, name: "血氧告警" },
{ value: res?.tempCount, name: "体温告警" }, { value: res?.tempCount || 0, name: "体温告警" },
]; ];
myChart.setOption(option.value); myChart.setOption(option.value);
}); });