设备登记列表

This commit is contained in:
zhujiyan
2024-06-12 18:05:35 +08:00
parent 67bc106c1d
commit d76037e7b6
7 changed files with 2172 additions and 1555 deletions

View File

@@ -66,8 +66,9 @@
:title="dialogTitle"
v-model="dialogFormVisible"
:close-on-click-modal="false"
class="cn-operate-dialog"
:before-close="resetForm"
draggable
width="40%"
>
<el-form :model="form" label-width="120px" :rules="rules" ref="ruleFormRef">
<el-form-item label="设备名称:" prop="name">
@@ -136,7 +137,10 @@ import {
deleteEquipmentDelivery,
editEquipmentDelivery,
batchImportDevice,
resetEquipmentDelivery
resetEquipmentDelivery,
governDeviceRegister,
portableDeviceRegister,
portableDeviceAccess
} from '@/api/cs-system-boot/device'
import html2canvas from 'html2canvas'
import { fullUrl } from '@/utils/common'
@@ -216,20 +220,14 @@ const tableStore = new TableStore({
title: '设备类型',
field: 'devType',
formatter: row => {
return (
devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0] &&
devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0].label
)
return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
}
},
{
title: '设备型号',
field: 'devModel',
formatter: row => {
return (
devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0] &&
devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0].label
)
return devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
}
},
{
@@ -244,15 +242,13 @@ const tableStore = new TableStore({
{
title: '状态',
field: 'status',
// formatter: row => {
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
// },
width: 100,
render: 'tag',
custom: {
1: 'warning',
2: 'success',
3: 'primary',
4: 'danger'
4: 'primary'
},
replaceValue: {
1: '未注册',
@@ -260,6 +256,9 @@ const tableStore = new TableStore({
3: '接入',
4: '已取消'
}
// formatter: row => {
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
// },
},
{
title: '操作',
@@ -267,6 +266,104 @@ const tableStore = new TableStore({
width: '180',
render: 'buttons',
buttons: [
//直连装置注册
{
title: '注册',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
(row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '1'
)
},
click: row => {
// 直连设备注册
ElMessageBox.confirm('确定注册该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
governDeviceRegister({
nDid: row.ndid,
type: '4'
}).then(res => {
ElMessage.success(res.message)
tableStore.onTableAction('search', {})
})
})
.catch(e => {})
}
},
//便携式设备注册
{
title: '注册',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
(row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '1'
)
},
click: row => {
// 便携式设备注册
ElMessageBox.confirm('确定注册该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
portableDeviceRegister({
nDid: row.ndid
}).then(res => {
console.log(res,"8888");
ElMessage.success(res.message)
tableStore.index()
})
})
.catch(e => {})
}
},
//直连设备接入
{
title: '接入',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
(row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '2'
)
},
click: row => {
// 直连设备接入
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
governDeviceRegister({
nDid: row.ndid,
type: '4'
}).then(res => {
ElMessage.success(res.message)
tableStore.onTableAction('search', {})
})
})
.catch(e => {})
}
},
//便携式设备接入
{
title: '接入',
type: 'primary',
@@ -275,12 +372,26 @@ const tableStore = new TableStore({
disabled: row => {
return (
(row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status == '3'
row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '2'
)
},
click: row => {
console.log('接入')
// 便携式设备接入
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
portableDeviceAccess({
nDid: row.ndid
}).then(res => {
ElMessage.success(res.message)
tableStore.index()
})
})
.catch(e => {})
}
},
{
@@ -339,12 +450,14 @@ const tableStore = new TableStore({
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteEquipmentDelivery(row.id).then(res => {
ElMessage.success('删除成功!')
tableStore.onTableAction('search', {})
})
})
.then(() => {
deleteEquipmentDelivery(row.id).then(res => {
ElMessage.success('删除成功!')
tableStore.onTableAction('search', {})
})
})
.catch(e => {})
}
}
]