Commit 7fbca840 authored by qjeslks's avatar qjeslks

7.28.2

parent f6a5e883
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</el-form-item> </el-form-item>
<el-form-item label="设备:"> <el-form-item label="设备:">
<el-cascader :options="options" v-model="AlarmInfo" :props="props" collapse-tags clearable :show-all-levels="false" <el-cascader :options="options" v-model="AlarmInfo" :props="props" collapse-tags clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 210px;" /> placeholder="请选择" style="min-width: 210px;" @change="getopt" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button> <el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
</el-card> </el-card>
<el-card class="moduleCard" :height="tableHeight"> <el-card class="moduleCard" :height="tableHeight">
<el-table :data="tableData" :row-class-name="rowClassName" :height="tableHeight" v-loading="loading" :cell-style="setCellStyle" id="out-table" <el-table :data="tableData" :row-class-name="rowClassName" :height="tableHeight" v-loading="loading" :cell-style="setCellStyle" id="out-table"
border highlight-current-row :header-cell-style="setHeaderCellStyle" @sort-change="sortMethod" :header-cell-class-name="handleHeadAddClass" > border highlight-current-row :header-cell-style="setHeaderCellStyle" :header-cell-class-name="handleHeadAddClass" >
<el-table-column prop="index" label="编号" :sortable="false" width="100px" fixed /> <el-table-column prop="index" label="编号" :sortable="false" width="100px" fixed />
<el-table-column prop="name" label="设施名称" :sortable="true" width="250px" fixed /> <el-table-column prop="name" label="设施名称" :sortable="false" width="250px" fixed />
<el-table-column prop="cnName" label="报警类型" :sortable="false" fixed /> <el-table-column prop="cnName" label="报警类型" :sortable="false" fixed />
<el-table-column prop="gatherTime" label="报警时间" :sortable="true" width="200px" fixed /> <el-table-column prop="gatherTime" label="报警时间" :sortable="false" width="200px" fixed />
<el-table-column prop="topMost" label="上上限" :sortable="false" width="200px" fixed > <el-table-column prop="topMost" label="上上限" :sortable="false" width="200px" fixed >
<template #default="scope"> <template #default="scope">
<div class="div-form-img"> <div class="div-form-img">
...@@ -92,41 +92,6 @@ ...@@ -92,41 +92,6 @@
tableHeight.value = window.innerHeight - 195; tableHeight.value = window.innerHeight - 195;
} }
//获取排序的方法
function sortMethod({ order, prop }){
// 触发的排序和缓存的排序相同时,取消该字段的排序
if (!order || sortField[prop] === order) {
sortField[prop] = null
} else {
sortField[prop] = order
}
// console.log(sortField)
let sortname = "";
let sortnames = "";
let direction = '';
for (const i in sortField) {
if (sortField[i] == 'ascending') {
direction = 'ASC'
} else if (sortField[i] == 'descending') {
direction = 'DESC'
}
if(i === "name"){
sortname = "name";
}else if(i === "alarmDate"){
sortname = "alarmDate";
}
// console.log(sortname)
if(sortnames===""){
sortnames = sortnames + sortname + " " + direction;
}else{
sortnames = sortnames + "," + sortname + " " + direction;
}
AlarmInfo.sort = sortnames;
}
console.log(AlarmInfo.sort)
getdata() //调用后端查询接口
}
function handleHeadAddClass({ column }) { function handleHeadAddClass({ column }) {
if (sortField[column.property]) { if (sortField[column.property]) {
column.order = sortField[column.property] column.order = sortField[column.property]
...@@ -164,13 +129,11 @@ ...@@ -164,13 +129,11 @@
sessionStorage.setItem("DeviceQueryEnd", endTime); sessionStorage.setItem("DeviceQueryEnd", endTime);
} }
const AlarmInfo = reactive([]) const AlarmInfo = ref([])
getSupplys(); getSupplys();
getdata(); getdata();
function getdata() { function getdata() {
sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
gettransfer(); gettransfer();
} }
...@@ -190,7 +153,7 @@ ...@@ -190,7 +153,7 @@
function getBoilers(){ function getBoilers(){
loading.value = true; loading.value = true;
tableData.length = 0; tableData.length = 0;
AlarmInfo.length = 0; AlarmInfo.value = [];
options.length = 0; options.length = 0;
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
if (result) { if (result) {
...@@ -214,7 +177,7 @@ ...@@ -214,7 +177,7 @@
} }
}); });
options.forEach(element =>{ options.forEach(element =>{
AlarmInfo.push(element.value); AlarmInfo.value.push(element.value);
}) })
} }
} }
...@@ -223,7 +186,7 @@ ...@@ -223,7 +186,7 @@
function getPipes(){ function getPipes(){
loading.value = true; loading.value = true;
tableData.length = 0; tableData.length = 0;
AlarmInfo.length = 0; AlarmInfo.value = [];
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
if (result) { if (result) {
options.length = 0; options.length = 0;
...@@ -243,9 +206,8 @@ ...@@ -243,9 +206,8 @@
} }
}); });
} }
console.log(options);
options.forEach(element =>{ options.forEach(element =>{
AlarmInfo.push(element.value); AlarmInfo.value.push(element.value);
}) })
console.log(AlarmInfo.value); console.log(AlarmInfo.value);
} }
...@@ -255,7 +217,7 @@ ...@@ -255,7 +217,7 @@
loading.value = true; loading.value = true;
tableData.length = 0; tableData.length = 0;
options.length = 0; options.length = 0;
AlarmInfo.length = 0; AlarmInfo.value = [];
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
if (result) { if (result) {
console.log(result) console.log(result)
...@@ -285,25 +247,18 @@ ...@@ -285,25 +247,18 @@
} }
}); });
} }
AlarmInfo.push(options[0].children[0].children[0].value); AlarmInfo.value.push(options[0].children[0].children[0].value);
console.log(AlarmInfo)
} }
//获取数据列表 //获取数据列表
function gettransfer() { function gettransfer() {
loading.value = true; loading.value = true;
if (currentPage.value == 1) { http.post("/api/alarm/" + type.value, AlarmInfo.value).then((result) => {
AlarmInfo.start = 0; console.log(result);
AlarmInfo.count = pageSize.value; console.log(AlarmInfo.value);
} else {
AlarmInfo.start = ((currentPage.value - 1) * pageSize.value) + 1;
AlarmInfo.count = pageSize.value - 1;
}
http.post("/api/alarm/" + type.value, AlarmInfo).then((result) => {
console.log(result.data);
if(result.data !== null){ if(result.data !== null){
tableData.value = result.data; tableData.value = result.data;
} }
if(result.data === null || AlarmInfo.length < 1){ if(result.data === null){
tableData.value = null; tableData.value = null;
} }
loading.value = false; loading.value = false;
...@@ -328,6 +283,10 @@ ...@@ -328,6 +283,10 @@
return css_color; return css_color;
} }
function getopt(){
console.log(AlarmInfo.value);
}
function getImgUrl(scope,item) { function getImgUrl(scope,item) {
var url = null; var url = null;
......
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