Commit f89d385c authored by Administrator's avatar Administrator

Merge branch 'release/remote_shutoff'

parents dda13fb2 44c4baf2
Pipeline #180 failed with stage
...@@ -95,7 +95,21 @@ ...@@ -95,7 +95,21 @@
<el-table-column align="center" label="切断装置状态" width="120"> <el-table-column align="center" label="切断装置状态" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span> <span>
<el-tag :type=" scope.row.shutoff_status==1 ? 'success' : 'warning' " effect="dark">{{ shutoffStatus(scope.row.shutoff_status) }}</el-tag> <el-popconfirm
:title="'确定' + unshutoff_status(scope.row.shutoff_status) + scope.row.username + shutoffDevice(scope.row.shutoff_type) + '吗?'"
@onConfirm="changeShutoffStatus(scope.row.id, scope.row.shutoff_status, scope.row.dtype)"
@onCancel="()=>{}"
>
<el-button
slot="reference"
:loading="shutoff_loading"
size="mini"
:type=" scope.row.shutoff_status==1 ? 'success' : 'warning' "
@click="shutoff_visible = true"
>
{{ shutoffStatus(scope.row.shutoff_status) }}
</el-button>
</el-popconfirm>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -130,7 +144,7 @@ ...@@ -130,7 +144,7 @@
</template> </template>
<script> <script>
import { control } from '@/api/device'; import { control, updedata } from '@/api/device';
import Pagination from '@/components/Pagination'; // 分页 import Pagination from '@/components/Pagination'; // 分页
import websocketurl from '@/api/configurl'; import websocketurl from '@/api/configurl';
import clip from '@/utils/clipboard'; import clip from '@/utils/clipboard';
...@@ -142,6 +156,8 @@ export default { ...@@ -142,6 +156,8 @@ export default {
components: { Pagination }, components: { Pagination },
data() { data() {
return { return {
shutoff_visible: false,
shutoff_loading: false,
downloadLoading: false, downloadLoading: false,
tableKey: 0, tableKey: 0,
loading: true, loading: true,
...@@ -259,6 +275,19 @@ export default { ...@@ -259,6 +275,19 @@ export default {
shutoff[2] = '关闭'; shutoff[2] = '关闭';
return shutoff[id]; return shutoff[id];
}, },
unshutoff_status(state) {
return state === 1 ? '关闭' : '开启';
},
// 修改切断装置状态
changeShutoffStatus(id, shutoff_status, tid) {
updedata({ deid: id, shutoff_status: shutoff_status !== 1 ? 1 : 2, tid: tid })
.then(response => {
// this.devicelist();
})
.catch(err => {
console.log(err);
});
},
onSubmit() { onSubmit() {
this.formSearch.page = 1; this.formSearch.page = 1;
this.devicelist(); this.devicelist();
......
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