Commit 7dcb951a authored by liuyangyang's avatar liuyangyang

bug修复

parent a3f31c64
...@@ -80,6 +80,7 @@ const routes = [ ...@@ -80,6 +80,7 @@ const routes = [
meta: { title: 'BME布袋监测', icon: 'collectorList' }, meta: { title: 'BME布袋监测', icon: 'collectorList' },
}, },
{ {
name: 'alerts',
path: '/alerts', path: '/alerts',
component: () => import('../views/AboutView/AboutView.vue'), component: () => import('../views/AboutView/AboutView.vue'),
meta: { title: '告警总览', icon: 'warnning' }, meta: { title: '告警总览', icon: 'warnning' },
......
...@@ -107,36 +107,45 @@ ...@@ -107,36 +107,45 @@
:close-on-press-escape="false" :close-on-press-escape="false"
> >
<div class="equd_body"> <div class="equd_body">
<span <el-form
>是否要对<span class="bold">{{ clickItem.name }}</span ref="ruleFormRef"
>不再告警:</span :model="equSubmitInfo"
:rules="rules"
class="equd_form"
> >
<el-form-item> <span
<el-radio-group v-model="equSubmitInfo.noAlarm" @change="onSubmit"> >是否要对<span class="bold">{{ clickItem.name }}</span
<el-radio value="1"></el-radio> >不再告警:</span
<el-radio value="0"></el-radio> >
</el-radio-group> <el-form-item>
</el-form-item> <el-radio-group v-model="equSubmitInfo.noAlarm" @change="onSubmit">
<el-form-item label="开始时间"> <el-radio value="1"></el-radio>
<el-date-picker <el-radio value="0"></el-radio>
v-model="equSubmitInfo.startTime" </el-radio-group>
type="datetime" </el-form-item>
placeholder="选择开始时间" <el-form-item label="开始时间" prop="startTime">
/> <el-date-picker
</el-form-item> v-model="equSubmitInfo.startTime"
<el-form-item label="结束时间"> type="datetime"
<el-date-picker placeholder="选择开始时间"
v-model="equSubmitInfo.endTime" />
type="datetime" </el-form-item>
placeholder="选择结束时间" <el-form-item label="结束时间" prop="endTime">
/> <el-date-picker
</el-form-item> v-model="equSubmitInfo.endTime"
type="datetime"
placeholder="选择结束时间"
/>
</el-form-item>
</el-form>
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="equDialog = false">取消</el-button> <el-button @click="equDialog = false">取消</el-button>
<el-button type="primary" @click="equPending"> 确认 </el-button> <el-button type="primary" @click="equPending(ruleFormRef)">
确认
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
...@@ -151,13 +160,15 @@ import { getDataFun, postDataJSON } from "@/request/method.js"; ...@@ -151,13 +160,15 @@ import { getDataFun, postDataJSON } from "@/request/method.js";
import moment from "moment"; import moment from "moment";
const router = useRouter(); const router = useRouter();
const route = useRoute();
const formInline = ref({ const formInline = ref({
eventName: "", eventName: "",
name: "", name: "",
dusterName: "", dusterName: "",
deviceType: "", deviceType: "",
suspendFlag: "2", suspendFlag: "0",
date: "", date: [],
}); });
const currentPage = ref(1); const currentPage = ref(1);
...@@ -212,6 +223,17 @@ const tableColumns = ref([ ...@@ -212,6 +223,17 @@ const tableColumns = ref([
}, },
]); ]);
const ruleFormRef = ref(null);
const rules = {
startTime: [{ required: true, message: "请填写开始时间", trigger: "blur" }],
endTime: [
{
required: true,
message: "请填写结束时间",
},
],
};
const tableData = reactive({ const tableData = reactive({
list: [], list: [],
}); });
...@@ -251,7 +273,7 @@ const onReset = () => { ...@@ -251,7 +273,7 @@ const onReset = () => {
name: "", name: "",
dusterName: "", dusterName: "",
deviceType: "", deviceType: "",
suspendFlag: "2", suspendFlag: "0",
date: [], date: [],
}; };
currentPage.value = 1; currentPage.value = 1;
...@@ -309,7 +331,8 @@ const equSubmitInfo = ref({ ...@@ -309,7 +331,8 @@ const equSubmitInfo = ref({
endTime: "", endTime: "",
}); });
const equPending = () => { const equPending = async (formEl) => {
if (!formEl) return;
const url = "/alarm/suspendDevice"; const url = "/alarm/suspendDevice";
const params = { const params = {
id: clickItem.value.id, id: clickItem.value.id,
...@@ -325,15 +348,33 @@ const equPending = () => { ...@@ -325,15 +348,33 @@ const equPending = () => {
) )
: "", : "",
}; };
return getDataFun(url, params).then((res) => { await formEl.validate((valid, fields) => {
if (res && res.code == 1) { if (valid) {
equDialog.value = false; return getDataFun(url, params).then((res) => {
getAlarmList(); if (res && res.code == 1) {
equDialog.value = false;
getAlarmList();
}
});
} else {
} }
}); });
}; };
onMounted(async () => { onMounted(async () => {
if (route.query) {
const { deviceName, suspendStartTime, suspendEndTime } = route.query;
if (deviceName) {
formInline.value.dusterName = deviceName;
}
if (suspendStartTime) {
formInline.value.date[0] = suspendStartTime;
}
if (deviceName) {
formInline.value.date[1] = suspendEndTime;
}
}
getTypeList(); getTypeList();
getAlarmList(); getAlarmList();
}); });
...@@ -540,10 +581,12 @@ onBeforeUnmount(() => {}); ...@@ -540,10 +581,12 @@ onBeforeUnmount(() => {});
} }
.equWarnDialog { .equWarnDialog {
.equd_body { .equd_body {
display: flex; .equd_form {
flex-direction: column; display: flex;
justify-content: center; flex-direction: column;
align-items: center; justify-content: center;
align-items: center;
}
.bold { .bold {
font-weight: bold; font-weight: bold;
} }
......
...@@ -82,13 +82,13 @@ ...@@ -82,13 +82,13 @@
<el-dialog <el-dialog
class="dustListDialog" class="dustListDialog"
v-model="dustLineisShow" v-model="dustLineisShow"
title="仓室数量设置" title="更换周期分析"
width="1000px" width="1000px"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
> >
<div class="input-group"> <div class="input-group">
<span>仓室编号</span> <span>除尘器名称</span>
<el-select <el-select
v-model="selectDustNo" v-model="selectDustNo"
@change="changeDust" @change="changeDust"
...@@ -149,12 +149,12 @@ const tableColumns = ref([ ...@@ -149,12 +149,12 @@ const tableColumns = ref([
{ {
prop: "compart", prop: "compart",
label: "仓室", label: "仓室",
width: "8%", width: "10%",
}, },
{ {
prop: "bagLocation", prop: "bagLocation",
label: "布袋位置(排/列)", label: "布袋位置(排/列)",
width: "8%", width: "6%",
}, },
{ {
prop: "bagChangeNextTime", prop: "bagChangeNextTime",
...@@ -169,13 +169,13 @@ const tableColumns = ref([ ...@@ -169,13 +169,13 @@ const tableColumns = ref([
{ {
prop: "bagChangeAuthor", prop: "bagChangeAuthor",
label: "更换人", label: "更换人",
width: "8%", width: "5%",
},
{
prop: "dusterName",
label: "所属除尘器",
width: "8%",
}, },
// {
// prop: "dusterName",
// label: "所属除尘器",
// width: "8%",
// },
{ {
prop: "bagChangePeriod", prop: "bagChangePeriod",
label: "更换周期(与上次更换比)", label: "更换周期(与上次更换比)",
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类"> <el-form-item label="设备类">
<el-select v-model="formInline.deviceType" style="width: 200px"> <el-select v-model="formInline.deviceType" style="width: 200px">
<el-option <el-option
v-for="i in typeList.list" v-for="i in typeList.list"
...@@ -63,10 +63,8 @@ ...@@ -63,10 +63,8 @@
<template #index="{ $index }"> <template #index="{ $index }">
{{ getIndex($index) }} {{ getIndex($index) }}
</template> </template>
<template #deviceName="{ row }"> <template #operate="{ row }">
<span class="health-score" @dblclick="openDialog(row.deviceName)">{{ <span class="health-score" @click="linkTo(row)">挂起期间告警</span>
row.deviceName
}}</span>
</template> </template>
<!-- <template #operation="{ row }"> <!-- <template #operation="{ row }">
<span class="view-btn" @click="handleView(row)">详情</span> <span class="view-btn" @click="handleView(row)">详情</span>
...@@ -82,7 +80,9 @@ ...@@ -82,7 +80,9 @@
import { ref, onMounted, onBeforeUnmount, computed, reactive } from "vue"; import { ref, onMounted, onBeforeUnmount, computed, reactive } from "vue";
import CommonTable from "@/components/commonTable/index.vue"; import CommonTable from "@/components/commonTable/index.vue";
import { getDataFun, postDataJSON } from "@/request/method.js"; import { getDataFun, postDataJSON } from "@/request/method.js";
import { useRoute, useRouter } from "vue-router";
const router = useRouter();
const formInline = ref({ const formInline = ref({
projectId: "", projectId: "",
deviceType: "", deviceType: "",
...@@ -98,11 +98,11 @@ const tableColumns = ref([ ...@@ -98,11 +98,11 @@ const tableColumns = ref([
label: "序号", label: "序号",
width: "5%", width: "5%",
}, },
{ // {
prop: "projectName", // prop: "projectName",
label: "项目名称", // label: "项目名称",
width: "7%", // width: "7%",
}, // },
{ {
prop: "deviceNo", prop: "deviceNo",
label: "设备编号", label: "设备编号",
...@@ -159,7 +159,7 @@ const tableColumns = ref([ ...@@ -159,7 +159,7 @@ const tableColumns = ref([
width: "7%", width: "7%",
}, },
{ {
prop: "lastAlarmTime", prop: "operate",
label: "操作", label: "操作",
width: "8%", width: "8%",
}, },
...@@ -267,6 +267,17 @@ const getManagementList = () => { ...@@ -267,6 +267,17 @@ const getManagementList = () => {
}); });
}; };
const linkTo = (item) => {
router.push({
path: "/alerts",
query: {
deviceName: item.deviceName,
suspendStartTime: item.suspendStartTime,
suspendEndTime: item.suspendEndTime,
},
});
};
onMounted(async () => { onMounted(async () => {
getNameList(); getNameList();
getTypeList(); getTypeList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment