fix: bug#10773、10772、10829、10826
This commit is contained in:
parent
1f6f7d23b4
commit
9c9ee029e6
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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('操作成功');
|
// message.success('操作成功');
|
||||||
emits('refresh')
|
// 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') {
|
} else if (props.mode === 'appManger') {
|
||||||
const removeItems = removeKeys.map((key) => ({
|
const removeItems = removeKeys.map((key) => ({
|
||||||
id: key,
|
id: key,
|
||||||
|
|
|
@ -78,12 +78,16 @@ const form = reactive({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clickSave: () => {
|
clickSave: () => {
|
||||||
const updateRole = updateRole_api(form.data);
|
formRef.value?.validate().then(() => {
|
||||||
const updateTree = updatePrimissTree_api(roleId, { menus: form.menus });
|
const updateRole = updateRole_api(form.data);
|
||||||
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -123,7 +127,7 @@ form.getForm();
|
||||||
:deep(.ant-form-item-required) {
|
:deep(.ant-form-item-required) {
|
||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
|
|
||||||
&::before{
|
&::before {
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue