Commit 1744317b authored by neogcg's avatar neogcg

fixbug

parent 5c404997
...@@ -29,10 +29,13 @@ export default { ...@@ -29,10 +29,13 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("user", ["userBaseInfo"]), ...mapState("user", ["userBaseInfo", "token"]),
userId() { userId() {
return this.userBaseInfo.userId; return this.userBaseInfo.userId;
}, },
usertoken() {
return this.token;
},
}, },
methods: { methods: {
receiveMessage, receiveMessage,
...@@ -43,9 +46,9 @@ export default { ...@@ -43,9 +46,9 @@ export default {
}, },
}, },
mounted() { mounted() {
this.websocket = socket({ // this.websocket = socket({
onmessage: this.receiveMessage, // onmessage: this.receiveMessage,
}); // });
EventBus.$on("dialogAlarm", (data) => { EventBus.$on("dialogAlarm", (data) => {
// 接收消息之后 声音弹窗显示 // 接收消息之后 声音弹窗显示
...@@ -54,16 +57,15 @@ export default { ...@@ -54,16 +57,15 @@ export default {
this.tflag = false; this.tflag = false;
}, 3000); }, 3000);
}); });
// EventBus.$on("cancelWS", () => { EventBus.$on("cancelWS", () => {
// this.websocket.close(); this.websocket.close();
// }); });
// EventBus.$on("wsOpen", () => { // EventBus.$on("wsOpen", () => {
// this.websocket.onopen(); // this.websocket.onopen();
// }); // });
}, },
watch: { watch: {
userId: { usertoken: {
immediate: true, immediate: true,
handler(newV) { handler(newV) {
if (newV) { if (newV) {
...@@ -74,6 +76,17 @@ export default { ...@@ -74,6 +76,17 @@ export default {
} }
}, },
}, },
// userId: {
// immediate: true,
// handler(newV) {
// if (newV) {
// this.closeWebsocket();
// this.websocket = socket({
// onmessage: this.receiveMessage,
// });
// }
// },
// },
}, },
}; };
</script> </script>
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
logout().then(() => { logout().then(() => {
this.$store.dispatch('user/logout') this.$store.dispatch('user/logout')
this.$router.push(`/login`) this.$router.push(`/login`)
// EventBus.$emit('cancelWS') EventBus.$emit('cancelWS')
}) })
}, },
......
...@@ -17,6 +17,7 @@ const mutations = { ...@@ -17,6 +17,7 @@ const mutations = {
}, },
SET_TOKEN: (state, token) => { SET_TOKEN: (state, token) => {
state.token = token state.token = token
console.log(token);
}, },
SET_BASEINFO: (state, data) => { SET_BASEINFO: (state, data) => {
state.userBaseInfo = data state.userBaseInfo = data
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
<div class="leakage-top"> <div class="leakage-top">
<div style="color: #666666"></div> <div style="color: #666666"></div>
<div class="operate-btn"> <div class="operate-btn">
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="exportList">导出</el-button> <el-button type="primary" @click="exportList">导出</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="search" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -207,6 +207,7 @@ export default { ...@@ -207,6 +207,7 @@ export default {
], ],
isQuery: false, isQuery: false,
searchOption: {}, searchOption: {},
exids: [],
wsUrl: "ws://8.142.143.40:8885/websocket/1/1", wsUrl: "ws://8.142.143.40:8885/websocket/1/1",
}; };
}, },
...@@ -225,23 +226,34 @@ export default { ...@@ -225,23 +226,34 @@ export default {
return "stripe"; return "stripe";
} }
}, },
refresh() {
this.searchOption = {};
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
this.getTableData();
},
handlePageChange(pageData) { handlePageChange(pageData) {
this.params.size = pageData.size; this.params.size = pageData.size;
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData(); this.getTableData();
}, },
getTableData(option) { search(option) {
this.searchOption = option; this.searchOption = option;
this.getTableData();
},
getTableData() {
let type = this.confirmStatus == 2 ? "" : this.confirmStatus; let type = this.confirmStatus == 2 ? "" : this.confirmStatus;
let param = { let param = {
confirmStatus: type, confirmStatus: type,
...this.params, ...this.params,
...option, ...this.searchOption,
}; };
cableTimeList(param).then((res) => { cableTimeList(param).then((res) => {
let list = res.records || []; let list = res.records || [];
this.tableData = list; this.tableData = list;
this.total = res.total; this.total = res.total;
this.exids = list.map((i) => i.id);
}); });
}, },
confirm(dialogInfo) { confirm(dialogInfo) {
...@@ -266,7 +278,6 @@ export default { ...@@ -266,7 +278,6 @@ export default {
this.centerDialogVisible = false; this.centerDialogVisible = false;
}, },
cancel2(row) { cancel2(row) {
console.log(row);
this.centerDialogVisible = true; this.centerDialogVisible = true;
this.dialogInfo = row; this.dialogInfo = row;
}, },
...@@ -282,7 +293,7 @@ export default { ...@@ -282,7 +293,7 @@ export default {
...this.params, ...this.params,
...this.searchOption, ...this.searchOption,
}; };
exportLeakyCable(param).then((res) => { exportLeakyCable({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `漏缆监测告警.xls`); download(res, "vnd.ms-excel", `漏缆监测告警.xls`);
}); });
}, },
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
<div class="leakage-top"> <div class="leakage-top">
<div style="color: #666666"></div> <div style="color: #666666"></div>
<div class="operate-btn"> <div class="operate-btn">
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="exportList">导出</el-button> <el-button type="primary" @click="exportList">导出</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="search" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
], ],
isQuery: false, isQuery: false,
searchOption: {}, searchOption: {},
exids: [],
wsUrl: "ws://8.142.143.40:8885/websocket/1/2", wsUrl: "ws://8.142.143.40:8885/websocket/1/2",
}; };
}, },
...@@ -192,22 +193,34 @@ export default { ...@@ -192,22 +193,34 @@ export default {
return "stripe"; return "stripe";
} }
}, },
refresh() {
this.searchOption = {};
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
},
handlePageChange(pageData) { handlePageChange(pageData) {
this.params.size = pageData.size; this.params.size = pageData.size;
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData(); this.getTableData();
}, },
getTableData(option) { search(option) {
this.searchOption = option;
this.getTableData();
},
getTableData() {
let type = this.confirmStatus == 2 ? "" : this.confirmStatus; let type = this.confirmStatus == 2 ? "" : this.confirmStatus;
let param = { let param = {
confirmStatus: type, confirmStatus: type,
...this.params, ...this.params,
...option, ...this.searchOption,
}; };
deviceList(param).then((res) => { deviceList(param).then((res) => {
let list = res.records || []; let list = res.records || [];
this.tableData = list; this.tableData = list;
this.total = res.total; this.total = res.total;
this.exids = list.map((i) => i.id);
}); });
}, },
confirm2(row) { confirm2(row) {
...@@ -222,7 +235,6 @@ export default { ...@@ -222,7 +235,6 @@ export default {
this.centerDialogVisible = false; this.centerDialogVisible = false;
}, },
cancel2(row) { cancel2(row) {
console.log(row);
this.centerDialogVisible = true; this.centerDialogVisible = true;
this.dialogInfo = row; this.dialogInfo = row;
}, },
...@@ -232,8 +244,6 @@ export default { ...@@ -232,8 +244,6 @@ export default {
id: dialogInfo.id, id: dialogInfo.id,
}; };
deviceCancel(query).then((res) => { deviceCancel(query).then((res) => {
console.log(query);
console.log(res);
this.getTableData(); this.getTableData();
}); });
this.centerDialogVisible = false; this.centerDialogVisible = false;
...@@ -251,7 +261,7 @@ export default { ...@@ -251,7 +261,7 @@ export default {
...this.params, ...this.params,
...this.searchOption, ...this.searchOption,
}; };
exportConnet(param).then((res) => { exportConnet({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `设备连接告警.xls`); download(res, "vnd.ms-excel", `设备连接告警.xls`);
}); });
}, },
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<delids :multipleSelection2="multipleSelection" @del="toDelete" <delids :multipleSelection2="multipleSelection" @del="toDelete"
>删除</delids >删除</delids
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="toExport">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
<el-button type="primary">清空数据</el-button> <el-button type="primary">清空数据</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="getTableData" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -94,6 +94,12 @@ export default { ...@@ -94,6 +94,12 @@ export default {
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData(); this.getTableData();
}, },
refresh() {
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
},
getTableData(option) { getTableData(option) {
this.searchOption = option; this.searchOption = option;
let params = { let params = {
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<delids :multipleSelection2="multipleSelection" @del="toDelete" <delids :multipleSelection2="multipleSelection" @del="toDelete"
>删除</delids >删除</delids
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="toExport">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
<el-button type="primary">清空数据</el-button> <el-button type="primary">清空数据</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="getTableData" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -95,6 +95,12 @@ export default { ...@@ -95,6 +95,12 @@ export default {
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData(); this.getTableData();
}, },
refresh() {
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
},
getTableData(option) { getTableData(option) {
this.searchOption = option; this.searchOption = option;
let params = { let params = {
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
<delids :multipleSelection2="multipleSelection" @del="deleteCable" <delids :multipleSelection2="multipleSelection" @del="deleteCable"
>删除</delids >删除</delids
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="toExport">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="getTableData" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -94,6 +94,12 @@ export default { ...@@ -94,6 +94,12 @@ export default {
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData(); this.getTableData();
}, },
refresh() {
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
},
getTableData(option) { getTableData(option) {
this.searchOption = option; this.searchOption = option;
let params = { let params = {
...@@ -168,7 +174,7 @@ export default { ...@@ -168,7 +174,7 @@ export default {
& ::v-deep .important { & ::v-deep .important {
background-color: #f89850; background-color: #f89850;
} }
& ::v-deep .common { & ::v-deep .common {
background-color: #ead906; background-color: #ead906;
} }
.page { .page {
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<delids :multipleSelection2="multipleSelection" @del="deleteCable" <delids :multipleSelection2="multipleSelection" @del="deleteCable"
>删除</delids >删除</delids
> >
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="toExport">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
<el-button type="primary">图形报表</el-button> <el-button type="primary">图形报表</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="getTableData" ref="reset" />
</div> </div>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
...@@ -83,6 +83,12 @@ export default { ...@@ -83,6 +83,12 @@ export default {
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData(); this.getTableData();
}, },
refresh() {
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
},
getTableData(option) { getTableData(option) {
this.searchOption = option; this.searchOption = option;
let params = { let params = {
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<div class="leakage-top"> <div class="leakage-top">
<div></div> <div></div>
<div class="operate-btn"> <div class="operate-btn">
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="toExport">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="search" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -18,11 +18,31 @@ ...@@ -18,11 +18,31 @@
:cell-class-name="cellClassFn" :cell-class-name="cellClassFn"
:header-cell-style="{ background: '#EAF1FE', color: '#666666' }" :header-cell-style="{ background: '#EAF1FE', color: '#666666' }"
> >
<el-table-column prop="startPointDeviceName" label="网元设备" align="center" /> <el-table-column
<el-table-column prop="startPointConnectStatus_text" label="连接状态" align="center" /> prop="startPointDeviceName"
<el-table-column prop="endPointDeviceName" label="网元设备" align="center" /> label="网元设备"
<el-table-column prop="endPointConnectStatus_text" label="连接状态" align="center" /> align="center"
<el-table-column prop="lastPointDeviceName" label="网元设备" align="center" /> />
<el-table-column
prop="startPointConnectStatus_text"
label="连接状态"
align="center"
/>
<el-table-column
prop="endPointDeviceName"
label="网元设备"
align="center"
/>
<el-table-column
prop="endPointConnectStatus_text"
label="连接状态"
align="center"
/>
<el-table-column
prop="lastPointDeviceName"
label="网元设备"
align="center"
/>
<el-table-column prop="uploadTime" label="上传时间" align="center" /> <el-table-column prop="uploadTime" label="上传时间" align="center" />
</el-table> </el-table>
<Pagination <Pagination
...@@ -36,75 +56,99 @@ ...@@ -36,75 +56,99 @@
</template> </template>
<script> <script>
import { DeviceStatusList } from '../api' import { DeviceStatusList } from "../api";
import { ConnectStatusEnum } from '@/const/index' import { ConnectStatusEnum } from "@/const/index";
import search from './components/search.vue' import search from "./components/search.vue";
import download from '@/utils/download' import download from "@/utils/download";
import { exportConnetTime } from '@/api/export' import { exportConnetTime } from "@/api/export";
export default { export default {
data() { data() {
return { return {
ConnectStatusEnum, ConnectStatusEnum,
params: { params: {
current: 1, current: 1,
size: 10 size: 10,
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false, isQuery: false,
searchOption: {} searchOption: {},
exids: [],
}; };
}, },
components: { search }, components: { search },
methods: { methods: {
// 表格背景图颜色 // 表格背景图颜色
cellClassFn({ row, column, rowIndex, columnIndex }) { cellClassFn({ row, column, rowIndex, columnIndex }) {
if ((row.startPointConnectStatus_text == '连接正常' && column.property == 'startPointConnectStatus_text')) { if (
return 'green' row.startPointConnectStatus_text == "连接正常" &&
column.property == "startPointConnectStatus_text"
) {
return "green";
} }
if ((row.startPointConnectStatus_text == '连接异常' && column.property == 'startPointConnectStatus_text')) { if (
return 'red' row.startPointConnectStatus_text == "连接异常" &&
column.property == "startPointConnectStatus_text"
) {
return "red";
} }
if ((row.endPointConnectStatus_text == '连接正常' && column.property == 'endPointConnectStatus_text')) { if (
return 'green' row.endPointConnectStatus_text == "连接正常" &&
} else if ((row.endPointConnectStatus_text == '连接异常' && column.property == 'endPointConnectStatus_text')) { column.property == "endPointConnectStatus_text"
return 'red' ) {
return "green";
} else if (
row.endPointConnectStatus_text == "连接异常" &&
column.property == "endPointConnectStatus_text"
) {
return "red";
} }
if (rowIndex % 2 == 1) { if (rowIndex % 2 == 1) {
return 'stripe' return "stripe";
} }
}, },
refresh() {
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
}
},
handlePageChange(pageData) { handlePageChange(pageData) {
this.params.size = pageData.size; this.params.size = pageData.size;
this.params.current = pageData.page; this.params.current = pageData.page;
this.getTableData() this.getTableData();
}, },
getTableData(option) { search(option) {
this.searchOption = option this.searchOption = option;
this.getTableData();
},
getTableData() {
let params = { let params = {
...this.params, ...this.params,
...option ...this.searchOption,
} };
DeviceStatusList(params).then(res => { DeviceStatusList(params).then((res) => {
let list = res.records || [] let list = res.records || [];
list.forEach(item => { list.forEach((item) => {
item.startPointConnectStatus_text = this.ConnectStatusEnum[item.startPointConnectStatus] item.startPointConnectStatus_text =
item.endPointConnectStatus_text = this.ConnectStatusEnum[item.endPointConnectStatus] this.ConnectStatusEnum[item.startPointConnectStatus];
item.endPointConnectStatus_text =
this.ConnectStatusEnum[item.endPointConnectStatus];
}); });
this.tableData = list this.tableData = list;
this.total = res.total this.total = res.total;
}) this.exids = list.map((i) => i.id);
});
}, },
toExport() { toExport() {
let params = { exportConnetTime({ ids: this.exids }).then((res) => {
...this.params, download(res, "vnd.ms-excel", `设备实时.xls`);
...this.searchOption });
} },
exportConnetTime(params).then(res => { download(res, 'vnd.ms-excel', `设备实时.xls`) })
}
}, },
mounted() { mounted() {
this.getTableData() this.getTableData();
}, },
}; };
</script> </script>
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<div class="leakage-top"> <div class="leakage-top">
<div style="color: #666666"></div> <div style="color: #666666"></div>
<div class="operate-btn"> <div class="operate-btn">
<el-button type="primary" @click="getTableData">刷新</el-button> <el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="isQuery = !isQuery">查询</el-button> <el-button type="primary" @click="isQuery = !isQuery">查询</el-button>
<el-button type="primary" @click="toExport">导出</el-button> <el-button type="primary" @click="toExport">导出</el-button>
</div> </div>
</div> </div>
<div v-if="isQuery"> <div v-if="isQuery">
<search @search="getTableData" /> <search @search="search" ref="reset" />
</div> </div>
<el-table <el-table
:data="tableData" :data="tableData"
...@@ -31,11 +31,20 @@ ...@@ -31,11 +31,20 @@
width="180" width="180"
align="center" align="center"
/> />
<el-table-column prop="alarmLevelName" label="告警级别" width="150" align="center"> <el-table-column
prop="alarmLevelName"
label="告警级别"
width="150"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column prop="alarmInfo" label="告警信息" align="center"> <el-table-column prop="alarmInfo" label="告警信息" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="lateUploadTime" label="最新上传时间" align="center" /> <el-table-column
prop="lateUploadTime"
label="最新上传时间"
align="center"
/>
</el-table> </el-table>
<Pagination <Pagination
:limit="params.size" :limit="params.size"
...@@ -48,70 +57,81 @@ ...@@ -48,70 +57,81 @@
</template> </template>
<script> <script>
import { CableStatusList, CableStatusExport } from '../api' import { CableStatusList, CableStatusExport } from "../api";
import { ConnectStatusEnum } from '@/const/index' import { ConnectStatusEnum } from "@/const/index";
import search from './components/search.vue' import search from "./components/search.vue";
import { exportLeakyCableTime } from '@/api/export' import { exportLeakyCableTime } from "@/api/export";
import download from '@/utils/download' import download from "@/utils/download";
export default { export default {
data() { data() {
return { return {
ConnectStatusEnum, ConnectStatusEnum,
params: { params: {
curent: 1, curent: 1,
size: 10 size: 10,
}, },
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false, isQuery: false,
searchOption: {} searchOption: {},
exids: [],
}; };
}, },
components: { search }, components: { search },
methods: { methods: {
// 表格背景图颜色 // 表格背景图颜色
cellClassFn({ row, column, rowIndex, columnIndex }) { cellClassFn({ row, column, rowIndex, columnIndex }) {
if (row.alarmLevelName == '紧急' && column.label == '告警级别') { if (row.alarmLevelName == "紧急" && column.label == "告警级别") {
return 'emergency' return "emergency";
} else if (row.alarmLevelName == '重要' && column.label == '告警级别') { } else if (row.alarmLevelName == "重要" && column.label == "告警级别") {
return 'important' return "important";
} else if (row.alarmLevelName == '一般' && column.label == '告警级别') { } else if (row.alarmLevelName == "一般" && column.label == "告警级别") {
return 'common' return "common";
} }
if (rowIndex % 2 == 1) { if (rowIndex % 2 == 1) {
return 'stripe' return "stripe";
}
},
refresh() {
this.searchOption = {};
this.getTableData();
if (this.$refs.reset != undefined) {
this.$refs.reset.reset();
} }
}, },
handlePageChange(pageData) { handlePageChange(pageData) {
this.params.size = pageData.size this.params.size = pageData.size;
this.params.curent = pageData.page this.params.curent = pageData.page;
this.getTableData() this.getTableData();
},
search(option) {
this.searchOption = option;
this.getTableData();
}, },
getTableData(option) { getTableData() {
this.searchOption = option
let params = { let params = {
...this.params, ...this.params,
...option ...this.searchOption,
} };
CableStatusList(params).then(res => { CableStatusList(params).then((res) => {
let list = res.records || [] let list = res.records || [];
this.tableData = list this.tableData = list;
this.total = res.records.length this.total = res.records.length;
this.exids = list.map((i) => i.id);
}) });
}, },
toExport() { toExport() {
let params = { let params = {
...this.params, ...this.params,
...this.searchOption ...this.searchOption,
} };
exportLeakyCableTime(params).then(res => { exportLeakyCableTime({ ids: this.exids }).then((res) => {
download(res, 'vnd.ms-excel', `漏缆实时.xls`) download(res, "vnd.ms-excel", `漏缆实时.xls`);
}) });
} },
}, },
mounted() { mounted() {
this.getTableData() this.getTableData();
}, },
}; };
</script> </script>
...@@ -148,7 +168,7 @@ export default { ...@@ -148,7 +168,7 @@ export default {
& ::v-deep .important { & ::v-deep .important {
background-color: #f89850; background-color: #f89850;
} }
& ::v-deep .common { & ::v-deep .common {
background-color: #ead906; background-color: #ead906;
} }
.page { .page {
......
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="seabtn" @click="searchQuery()">查询</el-button> <el-button type="success" @click="searchQuery()">查询</el-button>
<el-button class="seabtn" @click="reset">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
......
...@@ -109,8 +109,8 @@ ...@@ -109,8 +109,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="seabtn" @click="searchQuery()">查询</el-button> <el-button type="success" @click="searchQuery()">查询</el-button>
<el-button class="seabtn" @click="reset()">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
......
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="铁路名称:"> <el-form-item>
<el-button class="seabtn" @click="searchQuery()">查询</el-button> <el-button type="success" @click="searchQuery()">查询</el-button>
<el-button class="seabtn" @click="reset()">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
......
...@@ -49,9 +49,9 @@ ...@@ -49,9 +49,9 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="seabtn" @click="searchQuery()">查询</el-button> <el-button type="success" @click="searchQuery()">查询</el-button>
<el-button class="seabtn" @click="reset()">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
></el-option> </el-select ></el-option> </el-select
></el-form-item> ></el-form-item>
<el-form-item> <el-form-item>
<el-button class="seabtn" @click="searchQuery()">查询</el-button> <el-button type="success" @click="searchQuery()">查询</el-button>
<el-button class="seabtn" @click="reset()">重置</el-button> <el-button type="primary" @click="reset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
......
...@@ -57,7 +57,8 @@ export default { ...@@ -57,7 +57,8 @@ export default {
total: 10, total: 10,
tableData: [], tableData: [],
isQuery: false, isQuery: false,
searchOption: {} searchOption: {},
exids:[]
}; };
}, },
components: { components: {
...@@ -79,17 +80,14 @@ export default { ...@@ -79,17 +80,14 @@ export default {
let list = res.records || [] let list = res.records || []
this.tableData = list this.tableData = list
this.total = res.total this.total = res.total
this.exids = list.map((i)=>i.id)
}) })
}, },
tableRowClassName({ row, rowIndex }) { tableRowClassName({ row, rowIndex }) {
return rowIndex % 2 === 0 ? '' : 'single-row' return rowIndex % 2 === 0 ? '' : 'single-row'
}, },
exportLog() { exportLog() {
let params = { exportLog({ids:this.exids}).then(res => {
...this.params,
...this.searchOption
}
exportLog(params).then(res => {
download(res, 'vnd.ms-excel', `用户日志.xls`) download(res, 'vnd.ms-excel', `用户日志.xls`)
}) })
} }
......
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