From 73804519e49472df58ead906b16dc5f32ec3fb90 Mon Sep 17 00:00:00 2001 From: Flow <958079825@qq.com> Date: Mon, 16 Jun 2025 16:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=91=E5=AE=9A=E8=AE=BE?= =?UTF-8?q?=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/person/devicebind.vue | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/views/person/devicebind.vue b/src/views/person/devicebind.vue index 164ca3e6c..0de490e81 100644 --- a/src/views/person/devicebind.vue +++ b/src/views/person/devicebind.vue @@ -82,11 +82,9 @@ min-width="100" :show-overflow-tooltip="true" /> - + @@ -177,11 +175,9 @@ min-width="100" :show-overflow-tooltip="true" /> - + @@ -220,6 +216,7 @@ import { DICT_TYPE } from '@/utils/dict' import { ContentWrap } from '@/components/ContentWrap' import { DeviceuserApi, DeviceuserVO } from '@/api/deviceuser' import dayjs from 'dayjs' +import { ElMessageBox } from 'element-plus' defineOptions({ name: 'DeviceBind' }) const userProfile = ref() @@ -236,7 +233,7 @@ const personName = ref() const queryParams = reactive({ pageNo: 1, pageSize: 10, - orgid: undefined + orgid: undefined, }) const queryFormRef = ref() @@ -254,9 +251,16 @@ const getList = async () => { try { userProfile.value = await getUserProfile() queryParams.orgid = userProfile.value.dept.id - console.log(queryParams) - const data = await DeviceApi.getDeviceNotBind(queryParams) - list.value = data.list + const data = await DeviceApi.getDevicePage(queryParams) + // 获取每个设备的家庭组号信息 + const devicePromises = data.list.map(async (device) => { + const deviceuserData = await DeviceuserApi.getDeviceuserByDeviceId(device.devicecode) + return { + ...device, + familyid: deviceuserData?.[0]?.familyid || '' + } + }) + list.value = await Promise.all(devicePromises) total.value = data.total } finally { loading.value = false