Commit 5f81dda4 authored by liuyangyang's avatar liuyangyang

Merge branch 'lyyDev' into dev

parents 7ae82c56 72878d04
...@@ -69,10 +69,9 @@ export const getDustLineOption = (xData = [], seriesData = []) => ({ ...@@ -69,10 +69,9 @@ export const getDustLineOption = (xData = [], seriesData = []) => ({
containLabel: true, containLabel: true,
}, },
legend: { legend: {
data: ["健康度指数(%)"], data: ["周期(天数)"],
bottom: "0%", bottom: "0%",
icon: "circle", itemWidth: 20,
itemWidth: 10,
itemHeight: 10, itemHeight: 10,
itemGap: 10, itemGap: 10,
}, },
...@@ -105,7 +104,7 @@ export const getDustLineOption = (xData = [], seriesData = []) => ({ ...@@ -105,7 +104,7 @@ export const getDustLineOption = (xData = [], seriesData = []) => ({
}, },
series: [ series: [
{ {
name: "", name: "周期(天数)",
type: "line", type: "line",
color: "#399DFA", color: "#399DFA",
data: seriesData, data: seriesData,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</el-form-item> </el-form-item>
<el-form-item label="发生位置"> <el-form-item label="发生位置">
<el-input <el-input
v-model="formInline.position" v-model="formInline.name"
placeholder="请输入发生位置" placeholder="请输入发生位置"
style="width: 200px" style="width: 200px"
clearable clearable
...@@ -21,19 +21,19 @@ ...@@ -21,19 +21,19 @@
</el-form-item> </el-form-item>
<el-form-item label="除尘器名称"> <el-form-item label="除尘器名称">
<el-input <el-input
v-model="formInline.deviceName" v-model="formInline.dusterName"
placeholder="请输入除尘器名称" placeholder="请输入除尘器名称"
style="width: 200px" style="width: 200px"
clearable clearable
/> />
</el-form-item> </el-form-item>
<el-form-item label="设备类型"> <el-form-item label="设备类型">
<el-select v-model="formInline.type" style="width: 200px"> <el-select v-model="formInline.deviceType" style="width: 200px">
<el-option <el-option
v-for="i in dustList.list" v-for="i in typeList.list"
:key="i" :key="i"
:label="`${i.deviceName}`" :label="`${i.desc}`"
:value="i.deviceNo" :value="i.code"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="default" class="default-btn" @click="onSubmit" <el-button type="default" class="default-btn" @click="onReset"
>重置</el-button >重置</el-button
> >
<el-button type="primary" class="search-btn" @click="onSubmit" <el-button type="primary" class="search-btn" @click="onSubmit"
...@@ -64,10 +64,10 @@ ...@@ -64,10 +64,10 @@
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item> <el-form-item>
<el-radio-group v-model="formInline.warnType"> <el-radio-group v-model="formInline.suspendFlag" @change="onSubmit">
<el-radio value="1">挂起期间告警</el-radio> <el-radio value="1">挂起期间告警</el-radio>
<el-radio value="2">非挂起期间告警</el-radio> <el-radio value="0">非挂起期间告警</el-radio>
<el-radio value="3">全部告警</el-radio> <el-radio value="2">全部告警</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<common-table <common-table
:data="tableData.list" :data="tableData.list"
:columns="tableColumns" :columns="tableColumns"
:default-page-size="10" :default-page-size="pageSize"
@pagination-change="handlePaginationChange" @pagination-change="handlePaginationChange"
:pagination-texts="{ :pagination-texts="{
total: '共', total: '共',
...@@ -89,18 +89,55 @@ ...@@ -89,18 +89,55 @@
<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="openDialog(row)">暂挂起</span>
row.deviceName </template>
}}</span>
</template> -->
<!-- <template #operation="{ row }">
<span class="view-btn" @click="handleView(row)">详情</span>
<span class="edit-btn" @click="handleEdit(row)">编辑</span>
</template> -->
</common-table> </common-table>
</div> </div>
</div> </div>
<!-- 设备挂起 -->
<el-dialog
class="equWarnDialog"
v-model="equDialog"
title=""
width="500px"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<div class="equd_body">
<span
>是否要对<span class="bold">{{ clickItem.name }}</span
>不再告警:</span
>
<el-form-item>
<el-radio-group v-model="equSubmitInfo.noAlarm" @change="onSubmit">
<el-radio value="1"></el-radio>
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker
v-model="equSubmitInfo.startTime"
type="datetime"
placeholder="选择开始时间"
/>
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker
v-model="equSubmitInfo.endTime"
type="datetime"
placeholder="选择结束时间"
/>
</el-form-item>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="equDialog = false">取消</el-button>
<el-button type="primary" @click="equPending"> 确认 </el-button>
</span>
</template>
</el-dialog>
</div> </div>
</template> </template>
...@@ -108,19 +145,22 @@ ...@@ -108,19 +145,22 @@
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 { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { getDataFun, postDataJSON } from "@/request/method.js";
import moment from "moment";
const router = useRouter(); const router = useRouter();
const formInline = ref({ const formInline = ref({
eventName: "", eventName: "",
deviceName: "", name: "",
position: "", dusterName: "",
type: "", deviceType: "",
suspendFlag: "2",
date: "", date: "",
warnType: "3",
}); });
const currentPage = ref(1); const currentPage = ref(1);
const pageSize = ref(10); const pageSize = ref(20);
const equDialog = ref(false);
const tableColumns = ref([ const tableColumns = ref([
{ {
...@@ -129,42 +169,42 @@ const tableColumns = ref([ ...@@ -129,42 +169,42 @@ const tableColumns = ref([
width: "5%", width: "5%",
}, },
{ {
prop: "deviceName", prop: "eventName",
label: "事件名称", label: "事件名称",
width: "9%", width: "9%",
}, },
{ {
prop: "compart", prop: "name",
label: "发生位置", label: "发生位置",
width: "9%", width: "9%",
}, },
{ {
prop: "position", prop: "deviceType",
label: "设备类型", label: "设备类型",
width: "9%", width: "9%",
}, },
{ {
prop: "changeDateRemind", prop: "alarmIndicators",
label: "告警指标", label: "告警指标",
width: "9%", width: "9%",
}, },
{ {
prop: "changeDate", prop: "value",
label: "监测值", label: "监测值",
width: "9%", width: "9%",
}, },
{ {
prop: "changePeo", prop: "eventTime",
label: "告警时间", label: "告警时间",
width: "9%", width: "9%",
}, },
{ {
prop: "ownerdeviceName", prop: "isSuspendAlarm",
label: "是否挂起期间告警", label: "是否挂起期间告警",
width: "9%", width: "9%",
}, },
{ {
prop: "lastAlarmTime", prop: "operate",
label: "操作", label: "操作",
width: "10%", width: "10%",
}, },
...@@ -182,30 +222,22 @@ const tableData = reactive({ ...@@ -182,30 +222,22 @@ const tableData = reactive({
ownerdeviceName: "xx", ownerdeviceName: "xx",
lastAlarmTime: "xx", lastAlarmTime: "xx",
changeRound: "xx", changeRound: "xx",
operate: "挂起",
}, },
], ],
}); });
const dustList = reactive({ const typeList = reactive({
list: [], list: [],
}); });
const getDustList = () => { const getTypeList = () => {
dustList.list = [ const url = "/alarm/getDeviceType";
{ return getDataFun(url, "").then((res) => {
deviceName: "1#除尘器", if (res && res.data) {
deviceNo: "11111", typeList.list = res.data || [];
}, }
{ });
deviceName: "2#除尘器",
deviceNo: "22222",
},
{
deviceName: "3#除尘器",
deviceNo: "333333",
},
];
}; };
getDustList();
const getIndex = (index) => { const getIndex = (index) => {
return (currentPage.value - 1) * pageSize.value + index + 1; return (currentPage.value - 1) * pageSize.value + index + 1;
...@@ -214,18 +246,103 @@ const getIndex = (index) => { ...@@ -214,18 +246,103 @@ const getIndex = (index) => {
const handlePaginationChange = (pagination) => { const handlePaginationChange = (pagination) => {
currentPage.value = pagination.currentPage; currentPage.value = pagination.currentPage;
pageSize.value = pagination.pageSize; pageSize.value = pagination.pageSize;
console.log("分页变化", pagination); getAlarmList();
}; };
const onSubmit = () => { const onSubmit = () => {
console.log("submit!", formInline.value); getAlarmList();
};
const onReset = () => {
formInline.value = {
eventName: "",
name: "",
dusterName: "",
deviceType: "",
suspendFlag: "2",
date: [],
};
currentPage.value = 1;
pageSize.value = 20;
getAlarmList();
}; };
const openRound = () => { const openRound = () => {
router.push({ path: "/management/suspend-management" }); router.push({ path: "/management/suspend-management" });
}; };
onMounted(async () => {}); const clickItem = ref({});
const openDialog = (item) => {
clickItem.value = item;
equDialog.value = true;
};
const getAlarmList = () => {
const url = "/alarm/getAlarmListPage";
const params = {
eventName: formInline.value.eventName,
name: formInline.value.name,
dusterName: formInline.value.dusterName,
deviceType: formInline.value.deviceType,
suspendFlag: formInline.value.suspendFlag,
startTime: formInline.value.date[0]
? moment(new Date(formInline.value.date[0]).getTime()).format(
"YYYY-MM-DD HH:mm:ss"
)
: "",
endTime: formInline.value.date[1]
? moment(new Date(formInline.value.date[1]).getTime()).format(
"YYYY-MM-DD HH:mm:ss"
)
: "",
pageNo: currentPage.value,
pageSize: pageSize.value,
};
return getDataFun(url, params).then((res) => {
if (res && res.data) {
tableData.list = res.data.list || [];
} else {
return [];
}
});
};
const equSubmitInfo = ref({
noAlarm: "0",
startTime: "",
endTime: "",
});
const equPending = () => {
const url = "/alarm/suspendDevice";
const params = {
id: clickItem.value.id,
noAlarm: equSubmitInfo.value.noAlarm,
startTime: equSubmitInfo.value.startTime
? moment(new Date(equSubmitInfo.value.startTime).getTime()).format(
"YYYY-MM-DD HH:mm:ss"
)
: "",
endTime: equSubmitInfo.value.endTime
? moment(new Date(equSubmitInfo.value.endTime).getTime()).format(
"YYYY-MM-DD HH:mm:ss"
)
: "",
};
return getDataFun(url, params).then((res) => {
if (res && res.data) {
tableData.list = res.data.list || [];
} else {
return [];
}
});
};
onMounted(async () => {
getTypeList();
getAlarmList();
});
onBeforeUnmount(() => {}); onBeforeUnmount(() => {});
</script> </script>
...@@ -427,5 +544,16 @@ onBeforeUnmount(() => {}); ...@@ -427,5 +544,16 @@ onBeforeUnmount(() => {});
background-color: #fef0f0; background-color: #fef0f0;
} }
} }
.equWarnDialog {
.equd_body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.bold {
font-weight: bold;
}
}
}
} }
</style> </style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="仓室"> <el-form-item label="仓室">
<el-input <el-input
v-model="formInline.deviceName" v-model="formInline.compart"
placeholder="请输入仓室名称" placeholder="请输入仓室名称"
style="width: 180px" style="width: 180px"
clearable clearable
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</el-form-item> </el-form-item>
<el-form-item label="除尘器名称"> <el-form-item label="除尘器名称">
<el-input <el-input
v-model="formInline.deviceName" v-model="formInline.dusterName"
placeholder="请输入除尘器名称" placeholder="请输入除尘器名称"
style="width: 180px" style="width: 180px"
clearable clearable
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="default" class="default-btn" @click="onSubmit" <el-button type="default" class="default-btn" @click="onReset"
>重置</el-button >重置</el-button
> >
<el-button type="primary" class="search-btn" @click="onSubmit" <el-button type="primary" class="search-btn" @click="onSubmit"
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<common-table <common-table
:data="tableData.list" :data="tableData.list"
:columns="tableColumns" :columns="tableColumns"
:default-page-size="10" :default-page-size="20"
@pagination-change="handlePaginationChange" @pagination-change="handlePaginationChange"
:pagination-texts="{ :pagination-texts="{
total: '共', total: '共',
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
<template #index="{ $index }"> <template #index="{ $index }">
{{ getIndex($index) }} {{ getIndex($index) }}
</template> </template>
<template #deviceName="{ row }"> <template #dusterName="{ row }">
<span class="health-score" @dblclick="openDialog(row.deviceName)">{{ <span class="health-score" @dblclick="openDialog(row.dusterName)">{{
row.deviceName row.dusterName
}}</span> }}</span>
</template> </template>
<!-- <template #operation="{ row }"> <!-- <template #operation="{ row }">
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
<el-option <el-option
v-for="i in dustList.list" v-for="i in dustList.list"
:key="i" :key="i"
:label="`${i.deviceName}`" :label="`${i.dusterName}`"
:value="i.deviceNo" :value="i.dusterNo"
/> />
</el-select> </el-select>
</div> </div>
...@@ -118,16 +118,19 @@ ...@@ -118,16 +118,19 @@
<script setup> <script setup>
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 { getToken, removeToken, setToken } from "@/utils/auth";
import chartLine from "./components/chart-line.vue"; import chartLine from "./components/chart-line.vue";
import { getDataFun, postDataJSON } from "@/request/method.js";
import moment from "moment";
const formInline = ref({ const formInline = ref({
compart: "", compart: "",
dusterName: "", dusterName: "",
date: "", date: ["", ""],
}); });
const currentPage = ref(1); const currentPage = ref(1);
const pageSize = ref(10); const pageSize = ref(20);
const dustLineisShow = ref(false); const dustLineisShow = ref(false);
const tableColumns = ref([ const tableColumns = ref([
...@@ -137,7 +140,7 @@ const tableColumns = ref([ ...@@ -137,7 +140,7 @@ const tableColumns = ref([
width: "5%", width: "5%",
}, },
{ {
prop: "deviceName", prop: "dusterName",
label: "除尘器名称", label: "除尘器名称",
width: "8%", width: "8%",
}, },
...@@ -147,37 +150,32 @@ const tableColumns = ref([ ...@@ -147,37 +150,32 @@ const tableColumns = ref([
width: "8%", width: "8%",
}, },
{ {
prop: "position", prop: "bagLocation",
label: "布袋位置(排/列)", label: "布袋位置(排/列)",
width: "8%", width: "8%",
}, },
{ {
prop: "changeDateRemind", prop: "bagChangeNextTime",
label: "布袋更换提醒时间", label: "布袋更换提醒时间",
width: "8%", width: "8%",
}, },
{ {
prop: "changeDate", prop: "bagChangeTime",
label: "更换时间", label: "更换时间",
width: "8%", width: "8%",
}, },
{ {
prop: "changePeo", prop: "bagChangeAuthor",
label: "更换人", label: "更换人",
width: "8%", width: "8%",
}, },
{ {
prop: "ownerdeviceName", prop: "dusterName",
label: "所属除尘器", label: "所属除尘器",
width: "8%", width: "8%",
}, },
{ {
prop: "lastAlarmTime", prop: "bagChangePeriod",
label: "布袋更换提醒时间",
width: "10%",
},
{
prop: "changeRound",
label: "更换周期(与上次更换比)", label: "更换周期(与上次更换比)",
width: "6%", width: "6%",
}, },
...@@ -199,39 +197,64 @@ const tableData = reactive({ ...@@ -199,39 +197,64 @@ const tableData = reactive({
], ],
}); });
const getAllDustList = () => {
const url = "/bag/cycle/getReplaceListPage";
console.log(formInline.value.date);
const params = {
compart: formInline.value.compart,
dusterName: formInline.value.dusterName,
startTime: formInline.value.date[0]
? moment(new Date(formInline.value.date[0]).getTime()).format(
"YYYY-MM-DD HH:mm:ss"
)
: "",
endTime: formInline.value.date[1]
? moment(new Date(formInline.value.date[1]).getTime()).format(
"YYYY-MM-DD HH:mm:ss"
)
: "",
pageNo: currentPage.value,
pageSize: pageSize.value,
customerId: getToken("customerId"),
};
return getDataFun(url, params).then((res) => {
if (res && res.data) {
tableData.list = res.data.records || [];
} else {
return [];
}
});
};
const selectDustNo = ref(""); const selectDustNo = ref("");
const dustList = reactive({ const dustList = reactive({
list: [], list: [],
}); });
const getHealthScoreColor = (score) => {
const value = parseInt(score);
if (value >= 90) return "#67C23A";
if (value >= 70) return "#E6A23C";
return "#F56C6C";
};
const getIndex = (index) => { const getIndex = (index) => {
return (currentPage.value - 1) * pageSize.value + index + 1; return (currentPage.value - 1) * pageSize.value + index + 1;
}; };
const handleView = (row) => {
console.log("查看详情", row);
};
const handleEdit = (row) => {
console.log("编辑", row);
};
const handlePaginationChange = (pagination) => { const handlePaginationChange = (pagination) => {
currentPage.value = pagination.currentPage; currentPage.value = pagination.currentPage;
pageSize.value = pagination.pageSize; pageSize.value = pagination.pageSize;
console.log("分页变化", pagination); getAllDustList();
}; };
const onSubmit = () => { const onSubmit = () => {
console.log("submit!", formInline.value); getAllDustList();
};
const onReset = () => {
formInline.value = {
compart: "",
dusterName: "",
date: ["", ""],
};
currentPage.value = 1;
pageSize.value = 20;
getAllDustList();
}; };
const dustLineInfo = reactive({ list: [{}] }); const dustLineInfo = reactive({ list: [{}] });
...@@ -242,49 +265,48 @@ const openDialog = (deviceName) => { ...@@ -242,49 +265,48 @@ const openDialog = (deviceName) => {
}; };
const getDustList = () => { const getDustList = () => {
return [ const url = "/bag/cycle/getDusterList";
{ return getDataFun(url, "").then((res) => {
deviceName: "1#除尘器", if (res && res.data) {
deviceNo: "11111", return res.data;
}, } else {
{ return [];
deviceName: "2#除尘器", }
deviceNo: "22222", });
},
{
deviceName: "3#除尘器",
deviceNo: "333333",
},
];
}; };
const getDustListInfo = () => { const getDustInfo = () => {
return [ const url = "/bag/cycle/getReplaceAnalysis";
{ time: "1", value: "20" }, const params = {
{ time: "2", value: "30" }, dusterNo: selectDustNo.value,
{ time: "4", value: "40" }, };
{ time: "8", value: "45" }, return getDataFun(url, params).then((res) => {
{ time: "10", value: "15" }, if (res && res.data) {
{ time: "周期", value: "20" }, return res.data;
]; } else {
return [];
}
});
}; };
const changeDust = (deviceName) => { const changeDust = async (dusterName) => {
dustList.list = getDustList(); dustList.list = await getDustList();
if (deviceName) { if (dusterName) {
dustList.list.forEach((i) => { dustList.list.forEach((i) => {
if (i.deviceName == deviceName) { if (i.dusterName == dusterName) {
selectDustNo.value = i.deviceNo; selectDustNo.value = i.dusterNo;
} }
}); });
} else { } else {
selectDustNo.value = dustList.list[0].deviceNo || ""; selectDustNo.value = dustList.list[0].dusterNo || "";
} }
let list = getDustListInfo(); let list = await getDustInfo();
dustLineInfo.list = list; dustLineInfo.list = list;
}; };
onMounted(async () => {}); onMounted(async () => {
getAllDustList();
});
onBeforeUnmount(() => {}); onBeforeUnmount(() => {});
</script> </script>
......
...@@ -25,8 +25,8 @@ const initChart = () => { ...@@ -25,8 +25,8 @@ const initChart = () => {
let seriesData = []; let seriesData = [];
if (props.dustLineInfo) { if (props.dustLineInfo) {
props.dustLineInfo.forEach((i) => { props.dustLineInfo.forEach((i) => {
xData.push(i.time); xData.push(i.replaceTime);
seriesData.push(i.value); seriesData.push(i.period);
}); });
} }
chartInstance = echarts.init(chartDustRef.value); chartInstance = echarts.init(chartDustRef.value);
...@@ -49,7 +49,6 @@ watch( ...@@ -49,7 +49,6 @@ watch(
); );
onMounted(() => { onMounted(() => {
initChart();
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
chartInstance?.resize(); chartInstance?.resize();
}); });
...@@ -62,6 +61,7 @@ onBeforeUnmount(() => { ...@@ -62,6 +61,7 @@ onBeforeUnmount(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.chart-line { .chart-line {
margin-top: 20px;
canvas { canvas {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -4,38 +4,38 @@ ...@@ -4,38 +4,38 @@
<div class="search"> <div class="search">
<el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="项目名称"> <el-form-item label="项目名称">
<el-select v-model="formInline.name" style="width: 200px"> <el-select v-model="formInline.projectId" style="width: 200px">
<el-option <el-option
v-for="i in nameList.list" v-for="i in nameList.list"
:key="i" :key="i"
:label="`${i.label}`" :label="`${i.name}`"
:value="i.value" :value="i.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类别"> <el-form-item label="设备类别">
<el-select v-model="formInline.type" 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"
:key="i" :key="i"
:label="`${i.label}`" :label="`${i.desc}`"
:value="i.value" :value="i.code"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="原因分类"> <el-form-item label="原因分类">
<el-select v-model="formInline.reason" style="width: 200px"> <el-select v-model="formInline.reasonCategory" style="width: 200px">
<el-option <el-option
v-for="i in reasonList.list" v-for="i in reasonList.list"
:key="i" :key="i"
:label="`${i.label}`" :label="`${i.value}`"
:value="i.value" :value="i.key"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="default" class="default-btn" @click="onSubmit" <el-button type="default" class="default-btn" @click="onReset"
>重置</el-button >重置</el-button
> >
<el-button type="primary" class="search-btn" @click="onSubmit" <el-button type="primary" class="search-btn" @click="onSubmit"
...@@ -79,18 +79,16 @@ ...@@ -79,18 +79,16 @@
<script setup> <script setup>
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";
const formInline = ref({ const formInline = ref({
eventName: "", projectId: "",
deviceName: "", deviceType: "",
position: "", reasonCategory: "",
type: "",
date: "",
warnType: "3",
}); });
const currentPage = ref(1); const currentPage = ref(1);
const pageSize = ref(10); const pageSize = ref(20);
const tableColumns = ref([ const tableColumns = ref([
{ {
...@@ -99,62 +97,62 @@ const tableColumns = ref([ ...@@ -99,62 +97,62 @@ const tableColumns = ref([
width: "5%", width: "5%",
}, },
{ {
prop: "deviceName", prop: "projectName",
label: "项目名称", label: "项目名称",
width: "7%", width: "7%",
}, },
{ {
prop: "compart", prop: "deviceNo",
label: "设备编号", label: "设备编号",
width: "7%", width: "7%",
}, },
{ {
prop: "position", prop: "deviceType",
label: "设备类型", label: "设备类型",
width: "7%", width: "7%",
}, },
{ {
prop: "changeDateRemind", prop: "deviceName",
label: "设备名称", label: "设备名称",
width: "7%", width: "7%",
}, },
{ {
prop: "changeDate", prop: "signalNo",
label: "设备信号编号", label: "设备信号编号",
width: "7%", width: "7%",
}, },
{ {
prop: "changePeo", prop: "location",
label: "设备所在位置", label: "设备所在位置",
width: "7%", width: "7%",
}, },
{ {
prop: "ownerdeviceName", prop: "suspendStartTime",
label: "挂起开始时间", label: "挂起开始时间",
width: "7%", width: "7%",
}, },
{ {
prop: "ownerdeviceName", prop: "suspendEndTime",
label: "结束时间", label: "结束时间",
width: "7%", width: "7%",
}, },
{ {
prop: "ownerdeviceName", prop: "reasonCategory",
label: "原因分类", label: "原因分类",
width: "7%", width: "7%",
}, },
{ {
prop: "ownerdeviceName", prop: "reasonDesc",
label: "原因描述", label: "原因描述",
width: "7%", width: "7%",
}, },
{ {
prop: "ownerdeviceName", prop: "createTime",
label: "创建时间", label: "创建时间",
width: "7%", width: "7%",
}, },
{ {
prop: "ownerdeviceName", prop: "createUser",
label: "创建人", label: "创建人",
width: "7%", width: "7%",
}, },
...@@ -184,61 +182,39 @@ const tableData = reactive({ ...@@ -184,61 +182,39 @@ const tableData = reactive({
const nameList = reactive({ const nameList = reactive({
list: [], list: [],
}); });
const getNameList = () => { const getNameList = () => {
nameList.list = [ const url = "/alarm/getProjectEnumList";
{ return getDataFun(url, "").then((res) => {
label: "1#除尘器", if (res && res.data) {
value: "11111", nameList.list = res.data || [];
}, }
{ });
label: "2#除尘器",
value: "22222",
},
{
label: "3#除尘器",
value: "333333",
},
];
}; };
const typeList = reactive({ const typeList = reactive({
list: [], list: [],
}); });
const getTypeList = () => { const getTypeList = () => {
typeList.list = [ const url = "/alarm/getDeviceType";
{ return getDataFun(url, "").then((res) => {
label: "1#除尘器", if (res && res.data) {
value: "11111", typeList.list = res.data || [];
}, }
{ });
label: "2#除尘器",
value: "22222",
},
{
label: "3#除尘器",
value: "333333",
},
];
}; };
const reasonList = reactive({ const reasonList = reactive({
list: [], list: [],
}); });
const getReasonList = () => { const getReasonList = () => {
reasonList.list = [ const url = "/alarm/reasonCategoryEnumList";
{ return getDataFun(url, "").then((res) => {
label: "1#除尘器", if (res && res.data) {
value: "11111", reasonList.list = res.data || [];
}, }
{ });
label: "2#除尘器",
value: "22222",
},
{
label: "3#除尘器",
value: "333333",
},
];
}; };
const getIndex = (index) => { const getIndex = (index) => {
...@@ -248,17 +224,46 @@ const getIndex = (index) => { ...@@ -248,17 +224,46 @@ const getIndex = (index) => {
const handlePaginationChange = (pagination) => { const handlePaginationChange = (pagination) => {
currentPage.value = pagination.currentPage; currentPage.value = pagination.currentPage;
pageSize.value = pagination.pageSize; pageSize.value = pagination.pageSize;
console.log("分页变化", pagination); getManagementList();
}; };
const onSubmit = () => { const onSubmit = () => {
console.log("submit!", formInline.value); getManagementList();
};
const onReset = () => {
formInline.value = {
deviceType: "",
reasonCategory: "",
projectId: "",
};
currentPage.value = 1;
pageSize.value = 20;
getManagementList();
};
const getManagementList = () => {
const url = "/alarm/getSuspendDeviceListPage";
const params = {
deviceType: formInline.value.deviceType,
reasonCategory: formInline.value.reasonCategory,
projectId: formInline.value.projectId,
pageNo: currentPage.value,
pageSize: pageSize.value,
};
tableData.list = [];
return getDataFun(url, params).then((res) => {
if (res && res.data) {
tableData.list = res.data.list || [];
}
});
}; };
onMounted(async () => { onMounted(async () => {
getNameList(); getNameList();
getTypeList(); getTypeList();
getReasonList(); getReasonList();
getManagementList();
}); });
onBeforeUnmount(() => {}); onBeforeUnmount(() => {});
......
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