feat: 分组管理

This commit is contained in:
xuziqiang
2024-07-09 16:27:21 +08:00
parent fb1980d73a
commit 30286253e7
9 changed files with 94 additions and 25 deletions

View File

@@ -1,13 +1,14 @@
<template>
<ns-modal
ref="modalRef"
centered
v-bind="extraModalConfig"
destroyOnClose
v-model:visible="visible"
:title="title"
:okButtonProps="buttonProps"
@ok="handleOk">
<ns-form ref="formRef" :schemas="schemas" :model="formData" formLayout="formVertical" />
<ns-form ref="formRef" :schemas="schemas" :model="formData" formLayout="vertical" />
</ns-modal>
</template>
@@ -21,6 +22,7 @@
api: string | object | Function;
data?: object;
extraModalConfig?: object;
success?: Function;
};
const route = useRoute();
const { httpRequest } = useApi();
@@ -59,14 +61,15 @@
formRef.value
.triggerSubmit()
.then((data: any) => {
const { api } = props;
const { api, success } = props;
const requestConfig: HttpRequestConfig = { method: 'POST' };
const { params } = route;
httpRequest({ api, params: data, pathParams: params, requestConfig })
.then(() => {
.then((res) => {
NsMessage.success('操作成功', 1, () => {
toggle();
success && success(res);
});
})
.finally(() => {