mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-27 05:36:43 +08:00
fix: remove role request when open menu operate model
This commit is contained in:
parent
03f098bec6
commit
8db7be98e8
@ -6,7 +6,6 @@ import { $t } from '@/locales';
|
|||||||
import { enableStatusOptions, menuIconTypeOptions, menuTypeOptions } from '@/constants/business';
|
import { enableStatusOptions, menuIconTypeOptions, menuTypeOptions } from '@/constants/business';
|
||||||
import SvgIcon from '@/components/custom/svg-icon.vue';
|
import SvgIcon from '@/components/custom/svg-icon.vue';
|
||||||
import { getLocalIcons } from '@/utils/icon';
|
import { getLocalIcons } from '@/utils/icon';
|
||||||
import { fetchGetAllRoles } from '@/service/api';
|
|
||||||
import {
|
import {
|
||||||
getLayoutAndPage,
|
getLayoutAndPage,
|
||||||
getPathParamFromRoutePath,
|
getPathParamFromRoutePath,
|
||||||
@ -164,22 +163,6 @@ const layoutOptions: CommonType.Option[] = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
/** the enabled role options */
|
|
||||||
const roleOptions = ref<CommonType.Option<string>[]>([]);
|
|
||||||
|
|
||||||
async function getRoleOptions() {
|
|
||||||
const { error, data } = await fetchGetAllRoles();
|
|
||||||
|
|
||||||
if (!error) {
|
|
||||||
const options = data.map(item => ({
|
|
||||||
label: item.roleName,
|
|
||||||
value: item.roleCode
|
|
||||||
}));
|
|
||||||
|
|
||||||
roleOptions.value = [...options];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleInitModel() {
|
function handleInitModel() {
|
||||||
model.value = createDefaultModel();
|
model.value = createDefaultModel();
|
||||||
|
|
||||||
@ -266,7 +249,6 @@ watch(visible, () => {
|
|||||||
if (visible.value) {
|
if (visible.value) {
|
||||||
handleInitModel();
|
handleInitModel();
|
||||||
restoreValidation();
|
restoreValidation();
|
||||||
getRoleOptions();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user