|
|
|
@ -50,13 +50,14 @@ |
|
|
|
|
<el-table |
|
|
|
|
:data="tableData" |
|
|
|
|
style="width: 100%" |
|
|
|
|
border |
|
|
|
|
max-height="380" |
|
|
|
|
v-loading="loading" |
|
|
|
|
> |
|
|
|
|
<el-table-column |
|
|
|
|
label="设备标识" |
|
|
|
|
align="center" |
|
|
|
|
width="230" |
|
|
|
|
width="250" |
|
|
|
|
fixed |
|
|
|
|
show-overflow-tooltip |
|
|
|
|
v-if="columns[0].show" |
|
|
|
@ -110,11 +111,13 @@ |
|
|
|
|
label="设备在线时间" |
|
|
|
|
align="center" |
|
|
|
|
prop="devOnlineTime" |
|
|
|
|
width="200" |
|
|
|
|
v-if="columns[6].show" |
|
|
|
|
/> |
|
|
|
|
<el-table-column |
|
|
|
|
label="设备状态" |
|
|
|
|
align="center" |
|
|
|
|
width="110" |
|
|
|
|
prop="devStatus" |
|
|
|
|
v-if="columns[7].show" |
|
|
|
|
> |
|
|
|
@ -125,6 +128,7 @@ |
|
|
|
|
<el-table-column |
|
|
|
|
label="是否合法" |
|
|
|
|
align="center" |
|
|
|
|
width="110" |
|
|
|
|
v-if="columns[8].show" |
|
|
|
|
> |
|
|
|
|
<template #default="scope"> |
|
|
|
@ -135,12 +139,32 @@ |
|
|
|
|
<el-table-column |
|
|
|
|
label="在线状态" |
|
|
|
|
align="center" |
|
|
|
|
width="100" |
|
|
|
|
width="110" |
|
|
|
|
prop="devOnline" |
|
|
|
|
v-if="columns[9].show" |
|
|
|
|
> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-tag>{{ scope.row.devOnline }}</el-tag> |
|
|
|
|
<el-button |
|
|
|
|
:loading="onlineLoading" |
|
|
|
|
:type="scope.row.devOnline === '在线' ? 'primary' : 'danger'" |
|
|
|
|
link |
|
|
|
|
@click="loadDevOnline(scope.row)" |
|
|
|
|
> |
|
|
|
|
{{ scope.row.devOnline }}</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="200" |
|
|
|
|
fixed="right" |
|
|
|
|
> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-button type="primary" @click="skipFault(scope.row)" link |
|
|
|
|
>故障管理</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" @click="skipWebApp(scope.row)" link>网络应用</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -160,6 +184,7 @@ |
|
|
|
|
import { Search } from "@element-plus/icons-vue"; |
|
|
|
|
import { RemoteEquipmentTable } from "@/api/resources-equipment/types"; |
|
|
|
|
import { remoteTablePage } from "@/api/resources-equipment"; |
|
|
|
|
import { checkDevOnline } from "@/api/remote"; |
|
|
|
|
defineOptions({ |
|
|
|
|
name: "RemoteOperation", |
|
|
|
|
inheritAttrs: false, |
|
|
|
@ -177,6 +202,7 @@ const options = ref<OptionType[]>([ |
|
|
|
|
{ label: "设备PPPOE账号", value: "pppoeAccount" }, |
|
|
|
|
]); |
|
|
|
|
const loading = ref<boolean>(false); |
|
|
|
|
const onlineLoading = ref<boolean>(false); |
|
|
|
|
const buttonColSpan = computed(() => { |
|
|
|
|
return queryForm.value.selectName === undefined ? 18 : 12; |
|
|
|
|
}); |
|
|
|
@ -193,8 +219,8 @@ const columns = ref<TableColumns[]>([ |
|
|
|
|
{ name: "软件版本", show: true }, |
|
|
|
|
{ name: "设备上行方式", show: false }, |
|
|
|
|
{ name: "设备在线时间", show: false }, |
|
|
|
|
{ name: "设备状态", show: true }, |
|
|
|
|
{ name: "是否合法", show: true }, |
|
|
|
|
{ name: "设备状态", show: false }, |
|
|
|
|
{ name: "是否合法", show: false }, |
|
|
|
|
{ name: "在线状态", show: true }, |
|
|
|
|
]); |
|
|
|
|
const changeColumns = (newColumns: TableColumns[]) => { |
|
|
|
@ -229,6 +255,38 @@ const skipRemoteInfo = (row: RemoteEquipmentTable) => { |
|
|
|
|
path: `/resources/remote-info/${row.devId}/${row.typeAndVerId}`, |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
const skipFault = (row: RemoteEquipmentTable) => { |
|
|
|
|
router.push({ |
|
|
|
|
name: "FaultManagement", |
|
|
|
|
query: { devId: row.devId }, |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
const loadDevOnline = (row: RemoteEquipmentTable) => { |
|
|
|
|
onlineLoading.value = true; |
|
|
|
|
checkDevOnline(prop.devId) |
|
|
|
|
.then(({ data }) => { |
|
|
|
|
let resultCode = data.resultCode; |
|
|
|
|
let resultState = data.resultState; |
|
|
|
|
if ("2" === resultState) { |
|
|
|
|
if (resultCode === "401") { |
|
|
|
|
row.devOnline = "离线"; |
|
|
|
|
} else { |
|
|
|
|
row.devOnline = "在线"; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
row.devOnline = "离线"; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
onlineLoading.value = false; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
const skipWebApp = (row: RemoteEquipmentTable) => { |
|
|
|
|
router.push({ |
|
|
|
|
name: "WebApplications", |
|
|
|
|
query: { devId: row.devId }, |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
|