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

View File

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

View File

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