修改台账

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

@@ -144,11 +144,3 @@ export function queryPushResult() {
method: 'post'
})
}
//监测设备接入
export function onlineRegister(data: any) {
return createAxios({
url: '/access-boot/device/onlineRegister',
method: 'post',
params: data
})
}

View File

@@ -103,3 +103,11 @@ export function engineeringProject() {
method: 'post'
})
}
//监测设备接入
export function onlineRegister(data: any) {
return createAxios({
url: '/access-boot/device/onlineRegister',
method: 'post',
params: data
})
}

View File

@@ -405,9 +405,10 @@
pageStatus == 2)
)
"
@change="busItem.devModel = ''"
>
<el-option
v-for="item in [...formDevTypeOptions, ...devTypeOptions]"
v-for="item in formDevTypeOptions"
:key="item.value"
:label="item.label || item.name"
:value="item.value || item.id"
@@ -438,7 +439,9 @@
"
>
<el-option
v-for="option in [...devCLD, ...devModelOptions]"
v-for="option in devModelOptions.filter(
item => item.pid == busItem.devType
)"
:key="option.id"
:label="option.name"
:value="option.id"
@@ -595,7 +598,7 @@
<el-option label="停用" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item
<!-- <el-form-item
label="接入:"
v-if="connectionMethod == 'MQTT' && busItem?.id"
>
@@ -608,7 +611,7 @@
>
{{ accessLoading ? '接入中' : '接入' }}
</el-button>
</el-form-item>
</el-form-item> -->
<el-form-item
class="form-item"
label="排序:"
@@ -1454,7 +1457,7 @@ import {
updateLine,
pushLog,
queryPushResult,
onlineRegister
} from '@/api/cs-device-boot/cloudDeviceEntry'
import { getTopoTemplate } from '@/api/cs-device-boot/topologyTemplate'
import { getFileUrl } from '@/api/system-boot/file'
@@ -1654,7 +1657,7 @@ const cityOptions = computed(() => {
})
const formDevTypeOptions = computed(() => {
return [devTypeOptions2.value]
return devTypeOptions.value //[devTypeOptions2.value]
})
// 电压等级选项,用于显示带单位的名称
@@ -3319,12 +3322,10 @@ const area = async () => {
queryByCode('DEV_CLD')
.then(res => {
devTypeOptions2.value = res.data
return queryCsDictTree(res.data.id).then(res => {
queryCsDictTree(res.data.id).then(res => {
devCLD.value = res.data
})
})
.then(() => {
return queryByCode('Device_Type').then(res => {
queryByCode('Device_Type').then(res => {
queryByid(res.data.id).then((list: any) => {
devModelOptions.value = list.data.map((item: any, index: any) => {
return {
@@ -3340,6 +3341,9 @@ const area = async () => {
})
})
})
// .then(() => {
// return
// })
.catch(error => {
console.error('查询过程中出现错误:', error)
})
@@ -3353,22 +3357,6 @@ const area = async () => {
}
const accessLoading = ref(false)
// 接入
const access = (item: any) => {
accessLoading.value = true
onlineRegister({
projectId: formData.value.projectInfoList[0].id,
nDid: item.ndid
})
.then((res: any) => {
if (res.code == 'A0000') {
ElMessage.success(res)
accessLoading.value = false
}
})
.catch(() => {
accessLoading.value = false
})
}
onMounted(() => {
nodeData.value.level = 0

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
})
})
}
},
{