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

View File

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

View File

@ -78,13 +78,17 @@ const form = reactive({
}); });
}, },
clickSave: () => { clickSave: () => {
formRef.value?.validate().then(() => {
const updateRole = updateRole_api(form.data); const updateRole = updateRole_api(form.data);
const updateTree = updatePrimissTree_api(roleId, { menus: form.menus }); const updateTree = updatePrimissTree_api(roleId, {
menus: form.menus,
});
Promise.all([updateRole, updateTree]).then((resp) => { Promise.all([updateRole, updateTree]).then((resp) => {
message.success('操作成功'); message.success('操作成功');
router.push('/system/Role'); router.push('/system/Role');
}); });
});
}, },
}); });