From 632a0104fb522ab57158d0e393fccc09f0a00a30 Mon Sep 17 00:00:00 2001 From: guanj Date: Wed, 15 Apr 2026 13:44:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=B0=E8=B4=A6=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/cs-device-boot/cloudDeviceEntry.ts | 8 ++ src/views/govern/cloudDeviceEntry/index.vue | 151 ++++++++------------ src/views/govern/device/control/index.vue | 52 +++++-- 3 files changed, 109 insertions(+), 102 deletions(-) diff --git a/src/api/cs-device-boot/cloudDeviceEntry.ts b/src/api/cs-device-boot/cloudDeviceEntry.ts index 5fb5885..ba28b8c 100644 --- a/src/api/cs-device-boot/cloudDeviceEntry.ts +++ b/src/api/cs-device-boot/cloudDeviceEntry.ts @@ -144,3 +144,11 @@ export function queryPushResult() { method: 'post' }) } +//监测设备接入 +export function onlineRegister(data: any) { + return createAxios({ + url: '/access-boot/device/onlineRegister', + method: 'post', + params: data + }) +} diff --git a/src/views/govern/cloudDeviceEntry/index.vue b/src/views/govern/cloudDeviceEntry/index.vue index 79f9d83..f949db4 100644 --- a/src/views/govern/cloudDeviceEntry/index.vue +++ b/src/views/govern/cloudDeviceEntry/index.vue @@ -13,8 +13,13 @@
- - + + {{ nodeLevel == 0 ? '新增工程' @@ -57,11 +62,11 @@ 修改提交 - + -
+
+ @@ -482,18 +488,7 @@ :disabled="!(pageStatus == 2 && nodeLevel == 2)" /> - + + + + {{ accessLoading ? '接入中' : '接入' }} + +
-
- - - - - - - - - - - - - - - - - - - - - -
@@ -1469,7 +1419,7 @@
- +

指令下发中,请稍候...

@@ -1503,7 +1453,8 @@ import { updateEquipment, updateLine, pushLog, - queryPushResult + queryPushResult, + onlineRegister } from '@/api/cs-device-boot/cloudDeviceEntry' import { getTopoTemplate } from '@/api/cs-device-boot/topologyTemplate' import { getFileUrl } from '@/api/system-boot/file' @@ -1550,8 +1501,8 @@ const linePosition: any = dictData.getBasicData('Line_Position') const currentGdName: any = ref('') const affiliatiedFrontArr: any = ref([]) const voltageLevelArr = dictData.getBasicData('Dev_Voltage_Stand') -const devCLD = ref<{ id: string; name: string }[] | null>(null) -const devTypeOptions = ref<{ id: string; name: string }[] | null>(null) +const devCLD: any = ref([]) +const devTypeOptions: any = [] const devTypeOptions2: any = ref([]) const treeClickCount = ref(0) const areaTree: any = tree @@ -2039,7 +1990,7 @@ const add = () => { cntractNo: '', sort: 0, nodeProcess: '', - usageStatus: 0 + usageStatus: 1 }) busBarIndex.value = (formData.value.deviceInfoList.length - 1).toString() // 清理监测点数据 @@ -2428,7 +2379,7 @@ const next = async () => { cntractNo: '', sort: 0, nodeProcess: '', - usageStatus: 0 + usageStatus: 1 }) busBarIndex.value = (formData.value.deviceInfoList.length - 1).toString() nextfalg.value = false @@ -2870,7 +2821,7 @@ const resetAllForms = () => { device.mac = '' device.nodeId = '' device.cntractNo = '' - device.usageStatus = 0 + device.usageStatus = 1 device.sort = 0 }) @@ -3191,7 +3142,7 @@ const handleBusBarTabsEdit = (targetName: any, action: any) => { cntractNo: '', sort: 0, nodeProcess: '', - usageStatus: 0 + usageStatus: 1 }) busBarIndex.value = (formData.value.deviceInfoList.length - 1).toString() } else if (action === 'remove') { @@ -3400,6 +3351,24 @@ const area = async () => { userList.value = res.data.records }) } +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 @@ -3420,7 +3389,7 @@ area()