feat: 代码生成 支持选择表单生成类型(需要模板支持)
This commit is contained in:
parent
6e0c79411b
commit
55f5e6bd0c
@ -3,6 +3,7 @@
|
|||||||
**FEATURES**
|
**FEATURES**
|
||||||
|
|
||||||
- 代码生成支持路径方式生成
|
- 代码生成支持路径方式生成
|
||||||
|
- 代码生成 支持选择表单生成类型(需要模板支持)
|
||||||
|
|
||||||
# 1.2.1
|
# 1.2.1
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vben/web-antd",
|
"name": "@vben/web-antd",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"homepage": "https://vben.pro",
|
"homepage": "https://vben.pro",
|
||||||
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
1
apps/web-antd/src/api/tool/gen/model.d.ts
vendored
1
apps/web-antd/src/api/tool/gen/model.d.ts
vendored
@ -177,6 +177,7 @@ export interface Info {
|
|||||||
// 树表需要添加此属性
|
// 树表需要添加此属性
|
||||||
params?: any;
|
params?: any;
|
||||||
popupComponent?: string;
|
popupComponent?: string;
|
||||||
|
formComponent?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GenInfo {
|
export interface GenInfo {
|
||||||
|
@ -82,6 +82,7 @@ async function handleSave() {
|
|||||||
...requestData.params,
|
...requestData.params,
|
||||||
parentMenuId: requestData.parentMenuId,
|
parentMenuId: requestData.parentMenuId,
|
||||||
popupComponent: requestData.popupComponent,
|
popupComponent: requestData.popupComponent,
|
||||||
|
formComponent: requestData.formComponent,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// 保存
|
// 保存
|
||||||
|
@ -109,9 +109,12 @@ onMounted(async () => {
|
|||||||
await formApi.setValues(info);
|
await formApi.setValues(info);
|
||||||
// 弹出框类型需要手动赋值
|
// 弹出框类型需要手动赋值
|
||||||
if (info.options) {
|
if (info.options) {
|
||||||
const popupComponent = JSON.parse(info.options)?.popupComponent;
|
const { popupComponent, formComponent } = JSON.parse(info.options);
|
||||||
if (popupComponent) {
|
if (popupComponent) {
|
||||||
await formApi.setFieldValue('popupComponent', popupComponent);
|
formApi.setFieldValue('popupComponent', popupComponent);
|
||||||
|
}
|
||||||
|
if (formComponent) {
|
||||||
|
formApi.setFieldValue('formComponent', formComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await Promise.all([initTreeSelect(info.columns), initMenuSelect()]);
|
await Promise.all([initTreeSelect(info.columns), initMenuSelect()]);
|
||||||
|
@ -157,6 +157,21 @@ export const formSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'popupComponent',
|
fieldName: 'popupComponent',
|
||||||
label: '弹窗组件类型',
|
label: '弹窗组件类型',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'RadioGroup',
|
||||||
|
componentProps: {
|
||||||
|
buttonStyle: 'solid',
|
||||||
|
options: [
|
||||||
|
{ label: 'useVbenForm', value: 'useForm' },
|
||||||
|
{ label: 'antd原生表单', value: 'native' },
|
||||||
|
],
|
||||||
|
optionType: 'button',
|
||||||
|
},
|
||||||
|
help: '自定义功能, 需要后端支持\n复杂(布局, 联动等)表单建议用antd原生表单',
|
||||||
|
defaultValue: 'useForm',
|
||||||
|
fieldName: 'formComponent',
|
||||||
|
label: '生成表单类型',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
component: 'RadioGroup',
|
component: 'RadioGroup',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
Loading…
Reference in New Issue
Block a user