Commit 43ee4ecc authored by liuyangyang's avatar liuyangyang

设备页面联调

parent 301b1793
......@@ -94,10 +94,10 @@
row.deviceName
}}</span>
</template> -->
<!-- <template #operation="{ row }">
<template #operation="{ row }">
<span class="view-btn" @click="handleView(row)">详情</span>
<span class="edit-btn" @click="handleEdit(row)">编辑</span>
</template> -->
</template>
</common-table>
</div>
</div>
......@@ -108,6 +108,7 @@
import { ref, onMounted, onBeforeUnmount, computed, reactive } from "vue";
import CommonTable from "@/components/commonTable/index.vue";
import { useRoute, useRouter } from "vue-router";
import { getDataFun, postDataJSON } from "@/request/method.js";
const router = useRouter();
const formInline = ref({
......@@ -225,7 +226,32 @@ const openRound = () => {
router.push({ path: "/management/suspend-management" });
};
onMounted(async () => {});
const getAlarmList = () => {
const url = "/alarm/getAlarmListPage";
console.log(formInline.value.date);
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] || "",
endTime: formInline.value.date[1] || "",
pageNo: currentPage.value,
pageSize: pageSize.value,
};
return getDataFun(url, params).then((res) => {
if (res && res.data) {
tableData.list = res.data.records || [];
} else {
return [];
}
});
};
onMounted(async () => {
getAlarmList();
});
onBeforeUnmount(() => {});
</script>
......
......@@ -118,6 +118,7 @@
<script setup>
import { ref, onMounted, onBeforeUnmount, computed, reactive } from "vue";
import CommonTable from "@/components/commonTable/index.vue";
import { getToken, removeToken, setToken } from "@/utils/auth";
import chartLine from "./components/chart-line.vue";
import { getDataFun, postDataJSON } from "@/request/method.js";
......@@ -205,10 +206,11 @@ const getAllDustList = () => {
endTime: formInline.value.date[1] || "",
pageNo: currentPage.value,
pageSize: pageSize.value,
customerId: getToken('customerId'),
};
return getDataFun(url, params).then((res) => {
if (res && res.data) {
tableData.list = res.data.records;
tableData.list = res.data.records || [];
} else {
return [];
}
......@@ -228,7 +230,7 @@ const getIndex = (index) => {
const handlePaginationChange = (pagination) => {
currentPage.value = pagination.currentPage;
pageSize.value = pagination.pageSize;
console.log("分页变化", pagination);
getAllDustList();
};
const onSubmit = () => {
......
......@@ -49,7 +49,6 @@ watch(
);
onMounted(() => {
initChart();
window.addEventListener("resize", () => {
chartInstance?.resize();
});
......
......@@ -4,38 +4,38 @@
<div class="search">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="项目名称">
<el-select v-model="formInline.name" style="width: 200px">
<el-select v-model="formInline.projectId" style="width: 200px">
<el-option
v-for="i in nameList.list"
:key="i"
:label="`${i.label}`"
:value="i.value"
:label="`${i.name}`"
:value="i.id"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类别">
<el-select v-model="formInline.type" style="width: 200px">
<el-select v-model="formInline.deviceType" style="width: 200px">
<el-option
v-for="i in typeList.list"
:key="i"
:label="`${i.label}`"
:value="i.value"
:label="`${i.desc}`"
:value="i.code"
/>
</el-select>
</el-form-item>
<el-form-item label="原因分类">
<el-select v-model="formInline.reason" style="width: 200px">
<el-select v-model="formInline.reasonCategory" style="width: 200px">
<el-option
v-for="i in reasonList.list"
:key="i"
:label="`${i.label}`"
:value="i.value"
:label="`${i.value}`"
:value="i.key"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="default" class="default-btn" @click="onSubmit"
<el-button type="default" class="default-btn" @click="onRest"
>重置</el-button
>
<el-button type="primary" class="search-btn" @click="onSubmit"
......@@ -79,18 +79,16 @@
<script setup>
import { ref, onMounted, onBeforeUnmount, computed, reactive } from "vue";
import CommonTable from "@/components/commonTable/index.vue";
import { getDataFun, postDataJSON } from "@/request/method.js";
const formInline = ref({
eventName: "",
deviceName: "",
position: "",
type: "",
date: "",
warnType: "3",
projectId: "",
deviceType: "",
reasonCategory: "",
});
const currentPage = ref(1);
const pageSize = ref(10);
const pageSize = ref(20);
const tableColumns = ref([
{
......@@ -99,62 +97,62 @@ const tableColumns = ref([
width: "5%",
},
{
prop: "deviceName",
prop: "projectName",
label: "项目名称",
width: "7%",
},
{
prop: "compart",
prop: "deviceNo",
label: "设备编号",
width: "7%",
},
{
prop: "position",
prop: "deviceType",
label: "设备类型",
width: "7%",
},
{
prop: "changeDateRemind",
prop: "deviceName",
label: "设备名称",
width: "7%",
},
{
prop: "changeDate",
prop: "signalNo",
label: "设备信号编号",
width: "7%",
},
{
prop: "changePeo",
prop: "location",
label: "设备所在位置",
width: "7%",
},
{
prop: "ownerdeviceName",
prop: "suspendStartTime",
label: "挂起开始时间",
width: "7%",
},
{
prop: "ownerdeviceName",
prop: "suspendEndTime",
label: "结束时间",
width: "7%",
},
{
prop: "ownerdeviceName",
prop: "reasonCategory",
label: "原因分类",
width: "7%",
},
{
prop: "ownerdeviceName",
prop: "reasonDesc",
label: "原因描述",
width: "7%",
},
{
prop: "ownerdeviceName",
prop: "createTime",
label: "创建时间",
width: "7%",
},
{
prop: "ownerdeviceName",
prop: "createUser",
label: "创建人",
width: "7%",
},
......@@ -184,61 +182,39 @@ const tableData = reactive({
const nameList = reactive({
list: [],
});
const getNameList = () => {
nameList.list = [
{
label: "1#除尘器",
value: "11111",
},
{
label: "2#除尘器",
value: "22222",
},
{
label: "3#除尘器",
value: "333333",
},
];
const url = "/alarm/getProjectEnumList";
return getDataFun(url, "").then((res) => {
if (res && res.data) {
nameList.list = res.data || [];
}
});
};
const typeList = reactive({
list: [],
});
const getTypeList = () => {
typeList.list = [
{
label: "1#除尘器",
value: "11111",
},
{
label: "2#除尘器",
value: "22222",
},
{
label: "3#除尘器",
value: "333333",
},
];
const url = "/alarm/getDeviceType";
return getDataFun(url, "").then((res) => {
if (res && res.data) {
typeList.list = res.data || [];
}
});
};
const reasonList = reactive({
list: [],
});
const getReasonList = () => {
reasonList.list = [
{
label: "1#除尘器",
value: "11111",
},
{
label: "2#除尘器",
value: "22222",
},
{
label: "3#除尘器",
value: "333333",
},
];
const url = "/alarm/reasonCategoryEnumList";
return getDataFun(url, "").then((res) => {
if (res && res.data) {
reasonList.list = res.data || [];
}
});
};
const getIndex = (index) => {
......@@ -248,17 +224,46 @@ const getIndex = (index) => {
const handlePaginationChange = (pagination) => {
currentPage.value = pagination.currentPage;
pageSize.value = pagination.pageSize;
console.log("分页变化", pagination);
getManagementList();
};
const onSubmit = () => {
console.log("submit!", formInline.value);
getManagementList();
};
const onRest = () => {
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 () => {
getNameList();
getTypeList();
getReasonList();
getManagementList();
});
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