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