From 7a624fe907b3f33733fbd51455e97287a79f7cb8 Mon Sep 17 00:00:00 2001 From: qiaochuLei <124648559+qiaochuLei@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:16:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug#27688=20=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E8=AE=BE=E5=A4=87=E6=97=B6=EF=BC=8C=E4=B8=8D=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E4=BA=A7=E5=93=81=EF=BC=8C=E6=97=A0=E6=B3=95=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=85=A8=E9=83=A8=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E4=BB=BB=E4=BD=95=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: bug#27688 批量导出设备时,不选择产品,无法导出全部设备信息,导出文件没有任何数据 * fix: bug#27696当阿里云关联付费实例时,无法绑定成功,界面报错,服务器异常 --- .../Northbound/AliCloud/Detail/index.vue | 20 ++++++++++++------- src/views/device/Instance/Export/index.vue | 3 ++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/views/Northbound/AliCloud/Detail/index.vue b/src/views/Northbound/AliCloud/Detail/index.vue index 03c59189..73bd9068 100644 --- a/src/views/Northbound/AliCloud/Detail/index.vue +++ b/src/views/Northbound/AliCloud/Detail/index.vue @@ -98,6 +98,7 @@ .regionId " show-search + @change="regionChange" @blur="productChange" > >(new Set()); -const modelRef = reactive({ +const modelRef = reactive({ id: undefined, name: undefined, accessConfig: { @@ -500,6 +501,7 @@ const modelRef = reactive({ instanceId: undefined, accessKeyId: undefined, accessSecret: undefined, + apiEndpoint: undefined, }, bridgeProductKey: undefined, bridgeProductName: undefined, @@ -591,16 +593,19 @@ const onCollChange = (_key: string[]) => { }; const _error = computed(() => { - return _errorSet.value.size ? `当前选择的部分产品为禁用状态` : '' -}) + return _errorSet.value.size ? `当前选择的部分产品为禁用状态` : ''; +}); +const regionChange = (val: any) => { + modelRef.accessConfig.apiEndpoint = `https://iot.${val}.aliyuncs.com`; +}; const onActiveProduct = async () => { [..._errorSet.value.values()].forEach(async (i: any) => { const resp = await _deploy(i).catch((error) => { onlyMessage('操作失败', 'error'); }); - if(resp?.status === 200) { - _errorSet.value.delete(i) + if (resp?.status === 200) { + _errorSet.value.delete(i); onlyMessage('操作成功!'); } }); @@ -610,14 +615,14 @@ const onActiveProduct = async () => { const onPlatError = (val: any) => { const _item = productList.value.find((item) => item.id === val); if (val && _item && !_item?.state) { - _errorSet.value.add(val) + _errorSet.value.add(val); } }; const _validator = (_rule: any, value: string): Promise => new Promise((resolve, reject) => { const _item = productList.value.find((item) => item.id === value); - if(!modelRef.id || modelRef.id === ':id') { + if (!modelRef.id || modelRef.id === ':id') { return resolve(''); } else if (!_item && value) { return reject('关联产品已被删除,请重新选择'); @@ -633,6 +638,7 @@ const saveBtn = () => { (item: any) => item?.productKey === data?.bridgeProductKey, ); data.bridgeProductName = product?.productName || ''; + data.accessConfig.apiEndpoint = modelRef.accessConfig.apiEndpoint; loading.value = true; const resp = await savePatch({ ...toRaw(modelRef), diff --git a/src/views/device/Instance/Export/index.vue b/src/views/device/Instance/Export/index.vue index 3b278eb4..44c02bdf 100644 --- a/src/views/device/Instance/Export/index.vue +++ b/src/views/device/Instance/Export/index.vue @@ -123,7 +123,8 @@ const handleOk = async () => { urlParams.append(key, _params[key]) } }) - window.open(`${origin}/api/device-instance/${modelRef.product}/export.xlsx?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}&${urlParams}`) + const url = modelRef.product ? `${origin}/api/device-instance/${modelRef.product}/export.xlsx?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}&${urlParams}` : `${origin}/api/device-instance/export.xlsx?:X_Access_Token=${LocalStore.get(TOKEN_KEY)}&${urlParams}` + window.open(url) emit('close'); };