fix: bug#27688 批量导出设备时,不选择产品,无法导出全部设备信息,导出文件没有任何数据
* fix: bug#27688 批量导出设备时,不选择产品,无法导出全部设备信息,导出文件没有任何数据 * fix: bug#27696当阿里云关联付费实例时,无法绑定成功,界面报错,服务器异常
This commit is contained in:
parent
e3cc42c747
commit
7a624fe907
|
@ -98,6 +98,7 @@
|
|||
.regionId
|
||||
"
|
||||
show-search
|
||||
@change="regionChange"
|
||||
@blur="productChange"
|
||||
>
|
||||
<j-select-option
|
||||
|
@ -492,7 +493,7 @@ const route = useRoute();
|
|||
const formRef = ref();
|
||||
const _errorSet = ref<Set<string>>(new Set());
|
||||
|
||||
const modelRef = reactive({
|
||||
const modelRef = reactive<any>({
|
||||
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)
|
||||
_errorSet.value.delete(i);
|
||||
onlyMessage('操作成功!');
|
||||
}
|
||||
});
|
||||
|
@ -610,7 +615,7 @@ 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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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),
|
||||
|
|
|
@ -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');
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue