fix: bug#10863、10816、10739、10746、10749

This commit is contained in:
JiangQiming 2023-03-24 15:22:02 +08:00
parent f55bf06297
commit 8d35495808
4 changed files with 32 additions and 21 deletions

View File

@ -38,7 +38,7 @@
:params="queryParams"
:rowSelection="{
selectedRowKeys: table._selectedRowKeys.value,
onChange: selectRow,
onChange: selectChange,
}"
@cancelSelect="table.cancelSelect"
:columns="columns"
@ -55,7 +55,7 @@
:status="slotProps.state?.value"
:statusText="slotProps.state?.text"
:statusNames="{
online: 'success',
online: 'processing',
offline: 'error',
notActive: 'warning',
}"
@ -121,7 +121,7 @@
:status="slotProps.state.value"
:text="slotProps.state.text"
:statusNames="{
online: 'success',
online: 'processing',
offline: 'error',
notActive: 'warning',
}"
@ -173,10 +173,8 @@ const confirm = () => {
permission: item.selectPermissions,
}));
if (params.length === 1) {
// , ,
departmentStore.setProductId(params[0].assetIdList[0]);
}
// , ,
departmentStore.setProductId(params[0].assetIdList[0]);
loading.value = true;
bindDeviceOrProductList_api(props.assetType, params)
@ -475,15 +473,20 @@ const table: any = {
},
};
table.init();
const selectRow = (keys: string[], rows: any[]) => {
const okRows = rows.filter(
(item) =>
!!item.permissionList.find(
(permiss: any) => permiss.value === 'share',
),
);
table.selectedRows = okRows;
table._selectedRowKeys.value = okRows.map((item) => item.id);
// const selectRow = (rows: any[], check: boolean) => {
// const okRows = rows.filter(
// (item) =>
// !!item.permissionList.find(
// (permiss: any) => permiss.value === 'share',
// ),
// );
// table.selectedRows = okRows;
// table._selectedRowKeys.value = okRows.map((item) => item.id);
// };
// fix: bug#10749
const selectChange = (keys: string[], rows: any[]) => {
table.selectedRows = rows;
table._selectedRowKeys.value = keys;
};
</script>

View File

@ -68,8 +68,8 @@
:status="slotProps.state?.value"
:statusText="slotProps.state?.text"
:statusNames="{
1: 'processing',
0: 'error',
online: 'processing',
offline: 'error',
}"
>
<template #img>
@ -171,8 +171,8 @@
:status="slotProps.state.value"
:text="slotProps.state.text"
:statusNames="{
1: 'processing',
0: 'error',
online: 'processing',
offline: 'error',
}"
></BadgeStatus>
</template>
@ -517,6 +517,7 @@ const table = {
},
];
unBindDeviceOrProduct_api('product', params).then(() => {
tableData._selectedRowKeys = [];
message.success('操作成功');
table.refresh();
});

View File

@ -213,4 +213,11 @@ const table = reactive({
});
const dialogVisible = ref(false);
watch(
() => props.parentId,
() => {
table.refresh();
},
);
</script>

View File

@ -71,7 +71,7 @@
v-model:value="form.data.targetType"
:disabled="!!form.data.id"
@change="form.rules.checkUnique"
placeholder="请选择关联方"
placeholder="请选择关联方"
>
<j-select-option
v-for="item in targetList"