Skip to content

Commit

Permalink
fix(projects): fix menu transform data
Browse files Browse the repository at this point in the history
  • Loading branch information
paynezhuang committed May 31, 2024
1 parent 0e1c2f6 commit 5b3c20c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/typings/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,7 @@ declare namespace Api {
| 'multiTab'
| 'activeMenu'
| 'fixedIndexInTab'
> & {
query: NonNullable<Api.SystemManage.Menu['query']>;
layout: string;
page: string;
pathParam: string;
};
>;

/** menu list */
type MenuList = Common.PaginatingQueryRecord<Menu>;
Expand Down
11 changes: 8 additions & 3 deletions src/views/manage/menu/modules/menu-operate-drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ interface Props {
const props = defineProps<Props>();
type Model = Api.SystemManage.MenuEdit;
type Model = Api.SystemManage.MenuEdit & {
query: NonNullable<Api.SystemManage.Menu['query']>;
layout: string;
page: string;
pathParam: string;
};
interface Emits {
(e: 'submitted', data: Model): void;
Expand Down Expand Up @@ -201,11 +206,11 @@ function getSubmitParams() {
async function handleSubmit() {
await validate();
getSubmitParams();
const params = getSubmitParams();
// request
const func = isEdit.value ? fetchUpdateMenuInfo : fetchAddMenu;
const { error, data } = await func(model);
const { error, data } = await func(params);
if (!error && data) {
window.$message?.success(isEdit.value ? $t('common.updateSuccess') : $t('common.addSuccess'));
closeDrawer();
Expand Down

0 comments on commit 5b3c20c

Please sign in to comment.