fix: 优化设备批量启动请求参数处理

This commit is contained in:
xieyonghong 2023-05-08 16:05:55 +08:00
parent 436ae6cf54
commit 16960ea287
1 changed files with 15 additions and 1 deletions

View File

@ -596,6 +596,7 @@ const handleParams = (config: Record<string, any>) => {
if (Object.keys(_terms).length) {
const url = new URLSearchParams();
Object.keys(_terms).forEach((key) => {
console.log(_terms[key])
url.append(key, _terms[key]);
});
return url.toString();
@ -729,11 +730,24 @@ const onCheckChange = () => {
_selectedRowKeys.value = [];
};
const handleGetParams = (p: any) => {
p?.terms.map((a: any) => {
return a.terms.map((b: any) => {
if (b.column.includes('$product-info')) {
b.column = 'productId'
b.termType = 'product-info'
}
return b
})
})
return p
}
const activeAllDevice = () => {
type.value = 'active';
const activeAPI = `${BASE_API_PATH}/device-instance/deploy?:X_Access_Token=${LocalStore.get(
TOKEN_KEY,
)}&${handleParams(params.value)}`;
)}&${handleParams(handleGetParams(params.value))}`;
api.value = activeAPI;
operationVisible.value = true;
};