修改台账

This commit is contained in:
guanj
2026-04-15 19:29:36 +08:00
parent 632a0104fb
commit 01a28d88f3
4 changed files with 84 additions and 56 deletions

View File

@@ -218,7 +218,8 @@ import {
portableDeviceRegister,
portableDeviceAccess,
getExcelTemplate,
engineeringProject
engineeringProject,
onlineRegister
} from '@/api/cs-system-boot/device'
import html2canvas from 'html2canvas'
import { fullUrl } from '@/utils/common'
@@ -271,7 +272,7 @@ const queryTheDictionary = () => {
queryByCode('DEV_CLD')
.then(res => {
devTypeOptions2.value = res.data
return queryCsDictTree(res.data.id).then(res => {
queryCsDictTree(res.data.id).then(res => {
devModelOptions2.value = res.data.map((item: any) => {
return {
value: item.id,
@@ -280,8 +281,6 @@ const queryTheDictionary = () => {
}
})
})
})
.then(() => {
queryByCode('Device_Type').then(async res => {
const id = res.data.id
await queryCsDictTree(id).then(res => {
@@ -315,6 +314,7 @@ const queryTheDictionary = () => {
await tableStore.index()
})
})
.catch(error => {
console.error('查询过程中出现错误:', error)
})
@@ -611,12 +611,51 @@ const tableStore = new TableStore({
// .catch(e => {})
// }
// },
// 在线设备注册
{
title: '接入',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
loading: 'loading1',
disabled: row => {
return !(
row.devType == '123202e523be2b8defc8d0c2f118f232' &&
row.associatedProject != null &&
row.status != 3
)
},
click: row => {
// 便携式设备手动接入
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
row.loading1 = true
onlineRegister({
projectId: row.associatedProject,
nDid: row.ndid
})
.then(res => {
ElMessage.success(res.message)
row.loading1 = false
tableStore.index()
})
.catch(() => {
row.loading1 = false
})
})
}
},
//便携式设备手动接入
{
title: '接入',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
loading: 'loading1',
disabled: row => {
return (
(row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
@@ -632,14 +671,18 @@ const tableStore = new TableStore({
type: 'warning'
})
.then(() => {
row.loading1 = true
portableDeviceAccess({
nDid: row.ndid
}).then(res => {
ElMessage.success(res.message)
row.loading1 = false
tableStore.index()
})
})
.catch(e => {})
.catch(e => {
row.loading1 = false
})
}
},
{
@@ -647,6 +690,7 @@ const tableStore = new TableStore({
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
loading: 'loading1',
disabled: row => {
return (
(row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
@@ -662,24 +706,20 @@ const tableStore = new TableStore({
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
loading.value = true
portableDeviceRegister({
nDid: row.ndid
}).then(() => {
row.loading1 = true
portableDeviceRegister({
nDid: row.ndid
})
.then(res => {
row.loading1 = false
ElMessage.success(res.message)
tableStore.index()
})
.then(res => {
loading.value = false
ElMessage.success(res.message)
tableStore.index()
})
.catch(e => {
loading.value = false
})
})
.catch(e => {
loading.value = false
})
.catch(e => {
row.loading1 = false
})
})
}
},
{