chore: codegen
This commit is contained in:
parent
62e7cc6e7b
commit
c3618e121e
1
apps/web-antd/src/api/tool/gen/model.d.ts
vendored
1
apps/web-antd/src/api/tool/gen/model.d.ts
vendored
@ -176,6 +176,7 @@ export interface Info {
|
||||
crud: boolean;
|
||||
// 树表需要添加此属性
|
||||
params?: any;
|
||||
popupComponent?: string;
|
||||
}
|
||||
|
||||
export interface GenInfo {
|
||||
|
@ -100,8 +100,13 @@ async function initMenuSelect() {
|
||||
|
||||
onMounted(async () => {
|
||||
const info = genInfoData.value;
|
||||
for (const key in info) {
|
||||
formApi.setFieldValue(key, info[key as keyof typeof info]);
|
||||
await formApi.setValues(info);
|
||||
// 弹出框类型需要手动赋值
|
||||
if (info.options) {
|
||||
const popupComponent = JSON.parse(info.options)?.popupComponent;
|
||||
if (popupComponent) {
|
||||
await formApi.setFieldValue('popupComponent', popupComponent);
|
||||
}
|
||||
}
|
||||
await Promise.all([initTreeSelect(info.columns), initMenuSelect()]);
|
||||
});
|
||||
|
@ -168,6 +168,20 @@ export const formSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'parentMenuId',
|
||||
label: '上级菜单',
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: [
|
||||
{ label: 'modal弹窗', value: 'modal' },
|
||||
{ label: 'drawer抽屉', value: 'drawer' },
|
||||
],
|
||||
optionType: 'button',
|
||||
},
|
||||
defaultValue: 'modal',
|
||||
fieldName: 'popupComponent',
|
||||
label: '弹窗组件类型',
|
||||
},
|
||||
{
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
|
@ -20,9 +20,8 @@ async function handleSubmit() {
|
||||
const requestData = cloneDeep(unref(genInfoData));
|
||||
// 树表需要添加这个参数
|
||||
if (requestData && requestData.tplCategory === 'tree') {
|
||||
const { parentMenuId, treeCode, treeName, treeParentCode } = requestData;
|
||||
const { treeCode, treeName, treeParentCode } = requestData;
|
||||
requestData.params = {
|
||||
parentMenuId,
|
||||
treeCode,
|
||||
treeName,
|
||||
treeParentCode,
|
||||
@ -39,6 +38,12 @@ async function handleSubmit() {
|
||||
column.isQuery = transform(query);
|
||||
column.isRequired = transform(required);
|
||||
});
|
||||
// 需要手动添加父级菜单 弹窗类型
|
||||
requestData.params = {
|
||||
...requestData.params,
|
||||
parentMenuId: requestData.parentMenuId,
|
||||
popupComponent: requestData.popupComponent,
|
||||
};
|
||||
}
|
||||
await editSave(requestData);
|
||||
// 跳转到成功页面
|
||||
|
Loading…
Reference in New Issue
Block a user