feat:【antd】【ele】form-create 集成的 todo 处理
This commit is contained in:
@@ -35,6 +35,7 @@ async function bootstrap(namespace: string) {
|
||||
// });
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(VueDOMPurifyHTML);
|
||||
|
||||
// 注册v-loading指令
|
||||
registerLoadingDirective(app, {
|
||||
@@ -61,10 +62,6 @@ async function bootstrap(namespace: string) {
|
||||
// formCreate
|
||||
setupFormCreate(app);
|
||||
|
||||
// vue-dompurify-html
|
||||
// TODO @dhb52:VueDOMPurifyHTML 是不是不用引入哈?
|
||||
app.use(VueDOMPurifyHTML);
|
||||
|
||||
// 配置Motion插件
|
||||
const { MotionPlugin } = await import('@vben/plugins/motion');
|
||||
app.use(MotionPlugin);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import type { Rule } from '@form-create/ant-design-vue';
|
||||
|
||||
/** 数据字典 Select 选择器组件 Props 类型 */
|
||||
export interface DictSelectProps {
|
||||
dictType: string; // 字典类型
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型 TODO @芋艿:'boolean' | 'number' | 'string';需要和 vue3 一起统一!
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型
|
||||
selectType?: 'checkbox' | 'radio' | 'select'; // 选择器类型,下拉框 select、多选框 checkbox、单选框 radio
|
||||
formCreateInject?: any;
|
||||
}
|
||||
@@ -22,25 +20,6 @@ export interface Menu {
|
||||
list: MenuItem[];
|
||||
}
|
||||
|
||||
export type MenuList = Array<Menu>;
|
||||
|
||||
// TODO @dhb52:MenuList、Menu、MenuItem、DragRule 这几个,是不是没用到呀?
|
||||
// 拖拽组件的规则
|
||||
export interface DragRule {
|
||||
icon: string;
|
||||
name: string;
|
||||
label: string;
|
||||
children?: string;
|
||||
inside?: true;
|
||||
drag?: string | true;
|
||||
dragBtn?: false;
|
||||
mask?: false;
|
||||
|
||||
rule(): Rule;
|
||||
|
||||
props(v: any, v1: any): Rule[];
|
||||
}
|
||||
|
||||
/** 通用 API 下拉组件 Props 类型 */
|
||||
export interface ApiSelectProps {
|
||||
name: string; // 组件名称
|
||||
|
||||
@@ -91,10 +91,12 @@ const components = [
|
||||
FileUpload,
|
||||
];
|
||||
|
||||
// 参考 https://www.form-create.com/v3/ant-design-vue/auto-import 文档
|
||||
export function setupFormCreate(app: App) {
|
||||
components.forEach((component) => {
|
||||
app.component(component.name as string, component);
|
||||
});
|
||||
// TODO @xingyu:这里为啥 app.component('AMessage', message); 看官方是没有的;
|
||||
app.component('AMessage', message);
|
||||
formCreate.use(install);
|
||||
app.use(formCreate);
|
||||
|
||||
@@ -38,7 +38,7 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||
const designerConfig = ref({
|
||||
switchType: [], // 是否可以切换组件类型,或者可以相互切换的字段
|
||||
autoActive: true, // 是否自动选中拖入的组件
|
||||
useTemplate: false, // 是否生成vue2语法的模板组件
|
||||
useTemplate: false, // 是否生成 Vue 语法的模板组件
|
||||
formOptions: {
|
||||
form: {
|
||||
labelWidth: '100px', // 设置默认的 label 宽度为 100px
|
||||
|
||||
@@ -27,7 +27,7 @@ const designer = ref(); // 表单设计器
|
||||
const designerConfig = ref({
|
||||
switchType: [], // 是否可以切换组件类型,或者可以相互切换的字段
|
||||
autoActive: true, // 是否自动选中拖入的组件
|
||||
useTemplate: false, // 是否生成vue2语法的模板组件
|
||||
useTemplate: false, // 是否生成 Vue 语法的模板组件
|
||||
formOptions: {
|
||||
form: {
|
||||
labelWidth: '100px', // 设置默认的 label 宽度为 100px
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { Rule } from '@form-create/element-ui'; // 左侧拖拽按钮
|
||||
/** 数据字典 Select 选择器组件 Props 类型 */
|
||||
export interface DictSelectProps {
|
||||
dictType: string; // 字典类型
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型 TODO @芋艿:'boolean' | 'number' | 'string';需要和 vue3 一起统一!
|
||||
valueType?: 'bool' | 'int' | 'str'; // 字典值类型
|
||||
selectType?: 'checkbox' | 'radio' | 'select'; // 选择器类型,下拉框 select、多选框 checkbox、单选框 radio
|
||||
formCreateInject?: any;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||
const designerConfig = ref({
|
||||
switchType: [], // 是否可以切换组件类型,或者可以相互切换的字段
|
||||
autoActive: true, // 是否自动选中拖入的组件
|
||||
useTemplate: false, // 是否生成vue2语法的模板组件
|
||||
useTemplate: false, // 是否生成 Vue 语法的模板组件
|
||||
formOptions: {
|
||||
form: {
|
||||
labelWidth: '100px', // 设置默认的 label 宽度为 100px
|
||||
|
||||
@@ -27,7 +27,7 @@ const designer = ref(); // 表单设计器
|
||||
const designerConfig = ref({
|
||||
switchType: [], // 是否可以切换组件类型,或者可以相互切换的字段
|
||||
autoActive: true, // 是否自动选中拖入的组件
|
||||
useTemplate: false, // 是否生成vue2语法的模板组件
|
||||
useTemplate: false, // 是否生成 Vue 语法的模板组件
|
||||
formOptions: {
|
||||
form: {
|
||||
labelWidth: '100px', // 设置默认的 label 宽度为 100px
|
||||
|
||||
Reference in New Issue
Block a user