fix: bug#10773、10772、10829、10826

This commit is contained in:
JiangQiming 2023-03-23 16:46:02 +08:00
parent 1f6f7d23b4
commit 9c9ee029e6
3 changed files with 33 additions and 17 deletions

View File

@ -19,6 +19,7 @@
:dataSource="paramsTable"
:pagination="false"
size="small"
bordered
>
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'name'">
@ -65,8 +66,7 @@
</template>
<template v-else-if="column.key === 'action'">
<PermissionButton
type="link"
:hasPermission="`{permission}:delete`"
type="text"
:popConfirm="{
title: `确定删除`,
onConfirm: () =>
@ -88,8 +88,9 @@
style="text-align: center"
/>
<j-button
type="dashed"
@click="requestBody.addRow"
style="width: 100%; text-align: center"
style="width: 100%; text-align: center; margin-top: 5px;"
>
<AIcon type="PlusOutlined" />新增
</j-button>
@ -305,11 +306,15 @@ type requestObj = {
}
}
.table {
margin-bottom: 22px;
:deep(.ant-table-cell) {
padding: 0 8px;
height: 56px;
}
}
:deep(.ant-form-item) {
margin-bottom: 0;
}
}
}
}

View File

@ -79,7 +79,7 @@ const rowSelection = {
},
selectedRowKeys: ref<string[]>([]),
};
const save = () => {
const save = async () => {
const keys = props.selectedRowKeys;
const removeKeys = props.sourceKeys.filter((key) => !keys.includes(key));
@ -87,13 +87,20 @@ const save = () => {
if (props.mode === 'api') {
// api
removeKeys.length &&
delOperations_api(removeKeys)
.finally(() => addOperations_api(addKeys))
.then(() => {
message.success('操作成功');
emits('refresh')
});
// removeKeys.length &&
// delOperations_api(removeKeys)
// .finally(() => addOperations_api(addKeys))
// .then(() => {
// message.success('');
// emits('refresh');
// });
// fix: bug#10829
removeKeys.length && (await delOperations_api(removeKeys));
const res = await addOperations_api(addKeys);
if (res.success) {
message.success('操作成功');
emits('refresh');
}
} else if (props.mode === 'appManger') {
const removeItems = removeKeys.map((key) => ({
id: key,

View File

@ -78,12 +78,16 @@ const form = reactive({
});
},
clickSave: () => {
const updateRole = updateRole_api(form.data);
const updateTree = updatePrimissTree_api(roleId, { menus: form.menus });
formRef.value?.validate().then(() => {
const updateRole = updateRole_api(form.data);
const updateTree = updatePrimissTree_api(roleId, {
menus: form.menus,
});
Promise.all([updateRole, updateTree]).then((resp) => {
message.success('操作成功');
router.push('/system/Role');
Promise.all([updateRole, updateTree]).then((resp) => {
message.success('操作成功');
router.push('/system/Role');
});
});
},
});
@ -123,7 +127,7 @@ form.getForm();
:deep(.ant-form-item-required) {
padding-right: 12px;
&::before{
&::before {
right: 0;
}
}