Commit 1744317b authored by neogcg's avatar neogcg

fixbug

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