From 11a118c28a24aa02428f4cf2052afd42c474da92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=95=E5=B5=A9?= <17854119262@163.com> Date: Fri, 8 Mar 2024 10:12:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=AE=BE=E8=AE=A1=E5=92=8C?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=8F=91=E5=B8=83=E5=89=8D=E7=AB=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formModule/FormModuleDrawer.vue | 90 ++++++++ .../onlineform/formModule/FormModuleTree.vue | 111 ++++++++++ .../onlineform/formModule/formModule.data.ts | 197 ++++++++++++++++++ .../demo/onlineform/formModule/index.vue | 140 +++++++++++++ .../formScheme/FormSchemeDrawer.vue | 90 ++++++++ .../onlineform/formScheme/FormSchemeTree.vue | 111 ++++++++++ .../onlineform/formScheme/formScheme.data.ts | 197 ++++++++++++++++++ .../demo/onlineform/formScheme/index.vue | 140 +++++++++++++ 8 files changed, 1076 insertions(+) create mode 100644 src/views/demo/onlineform/formModule/FormModuleDrawer.vue create mode 100644 src/views/demo/onlineform/formModule/FormModuleTree.vue create mode 100644 src/views/demo/onlineform/formModule/formModule.data.ts create mode 100644 src/views/demo/onlineform/formModule/index.vue create mode 100644 src/views/demo/onlineform/formScheme/FormSchemeDrawer.vue create mode 100644 src/views/demo/onlineform/formScheme/FormSchemeTree.vue create mode 100644 src/views/demo/onlineform/formScheme/formScheme.data.ts create mode 100644 src/views/demo/onlineform/formScheme/index.vue diff --git a/src/views/demo/onlineform/formModule/FormModuleDrawer.vue b/src/views/demo/onlineform/formModule/FormModuleDrawer.vue new file mode 100644 index 0000000..92c9ec7 --- /dev/null +++ b/src/views/demo/onlineform/formModule/FormModuleDrawer.vue @@ -0,0 +1,90 @@ + + diff --git a/src/views/demo/onlineform/formModule/FormModuleTree.vue b/src/views/demo/onlineform/formModule/FormModuleTree.vue new file mode 100644 index 0000000..6e4e538 --- /dev/null +++ b/src/views/demo/onlineform/formModule/FormModuleTree.vue @@ -0,0 +1,111 @@ + + diff --git a/src/views/demo/onlineform/formModule/formModule.data.ts b/src/views/demo/onlineform/formModule/formModule.data.ts new file mode 100644 index 0000000..2859ac1 --- /dev/null +++ b/src/views/demo/onlineform/formModule/formModule.data.ts @@ -0,0 +1,197 @@ +import { BasicColumn, FormSchema } from '@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; +import Icon from '@/components/Icon/Icon.vue'; + +export const columns: BasicColumn[] = [ + { + title: '按钮名称', + dataIndex: 'name', + }, + { + title: 'DOMID', + dataIndex: 'domId', + }, + { + title: '排序', + dataIndex: 'sort', + }, +]; + +const isDir = (type: string) => type === '0'; +const isMenu = (type: string) => type === '1'; +const isButton = (type: string) => type === '2'; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'key', + label: '关键字', + component: 'Input', + colProps: { span: 8 }, + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'type', + label: '类型', + component: 'RadioButtonGroup', + defaultValue: '1', + componentProps: { + options: [ + // { label: '目录', value: '0' }, + { label: '菜单', value: '1' }, + { label: '按钮', value: '2' }, + ], + }, + colProps: { lg: 24, md: 24 }, + }, + { + field: 'id', + label: '名称', + component: 'Input', + ifShow: false, + }, + { + field: 'name', + label: '名称', + component: 'Input', + required: true, + }, + + { + field: 'parentId', + label: '上级', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + ifShow: ({ values }) => !isButton(values.type), + }, + { + field: 'moduleId', + label: '菜单', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + ifShow: ({ values }) => isButton(values.type), + required: true, + }, + { + field: 'domId', + label: 'DMOID', + component: 'Input', + required: true, + ifShow: ({ values }) => isButton(values.type), + }, + { + field: 'sortNo', + label: '排序', + component: 'InputNumber', + ifShow: ({ values }) => !isButton(values.type), + }, + { + field: 'sort', + label: '排序', + component: 'InputNumber', + ifShow: ({ values }) => isButton(values.type), + }, + { + field: 'class', + helpMessage: ['参考参数值', 'success、warning、error'], + label: '样式', + component: 'Input', + ifShow: ({ values }) => isButton(values.type), + }, + { + field: 'iconName', + label: '图标', + component: 'IconPicker', + ifShow: ({ values }) => !isButton(values.type), + }, + + { + field: 'url', + label: '路由地址', + component: 'Input', + required: true, + ifShow: ({ values }) => !isButton(values.type), + }, + // { + // field: 'component', + // label: '组件路径', + // component: 'Input', + // ifShow: ({ values }) => isMenu(values.type), + // }, + { + field: 'code', + label: '权限标识', + component: 'Input', + ifShow: ({ values }) => !isButton(values.type), + }, + { + field: 'status', + label: '是否系统', + component: 'RadioButtonGroup', + defaultValue: 1, + componentProps: { + options: [ + { label: '是', value: 0 }, + { label: '否', value: 1 }, + ], + }, + ifShow: ({ values }) => !isButton(values.type), + }, + // { + // field: 'isExt', + // label: '是否外链', + // component: 'RadioButtonGroup', + // defaultValue: '0', + // componentProps: { + // options: [ + // { label: '否', value: '0' }, + // { label: '是', value: '1' }, + // ], + // }, + // ifShow: ({ values }) => !isButton(values.type), + // }, + + // { + // field: 'keepalive', + // label: '是否缓存', + // component: 'RadioButtonGroup', + // defaultValue: '0', + // componentProps: { + // options: [ + // { label: '否', value: '0' }, + // { label: '是', value: '1' }, + // ], + // }, + // ifShow: ({ values }) => isMenu(values.type), + // }, + + // { + // field: 'show', + // label: '是否显示', + // component: 'RadioButtonGroup', + // defaultValue: '0', + // componentProps: { + // options: [ + // { label: '是', value: '0' }, + // { label: '否', value: '1' }, + // ], + // }, + // ifShow: ({ values }) => !isButton(values.type), + // }, +]; diff --git a/src/views/demo/onlineform/formModule/index.vue b/src/views/demo/onlineform/formModule/index.vue new file mode 100644 index 0000000..42fc3b9 --- /dev/null +++ b/src/views/demo/onlineform/formModule/index.vue @@ -0,0 +1,140 @@ + + diff --git a/src/views/demo/onlineform/formScheme/FormSchemeDrawer.vue b/src/views/demo/onlineform/formScheme/FormSchemeDrawer.vue new file mode 100644 index 0000000..ff7ee00 --- /dev/null +++ b/src/views/demo/onlineform/formScheme/FormSchemeDrawer.vue @@ -0,0 +1,90 @@ + + diff --git a/src/views/demo/onlineform/formScheme/FormSchemeTree.vue b/src/views/demo/onlineform/formScheme/FormSchemeTree.vue new file mode 100644 index 0000000..6e4e538 --- /dev/null +++ b/src/views/demo/onlineform/formScheme/FormSchemeTree.vue @@ -0,0 +1,111 @@ + + diff --git a/src/views/demo/onlineform/formScheme/formScheme.data.ts b/src/views/demo/onlineform/formScheme/formScheme.data.ts new file mode 100644 index 0000000..2859ac1 --- /dev/null +++ b/src/views/demo/onlineform/formScheme/formScheme.data.ts @@ -0,0 +1,197 @@ +import { BasicColumn, FormSchema } from '@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; +import Icon from '@/components/Icon/Icon.vue'; + +export const columns: BasicColumn[] = [ + { + title: '按钮名称', + dataIndex: 'name', + }, + { + title: 'DOMID', + dataIndex: 'domId', + }, + { + title: '排序', + dataIndex: 'sort', + }, +]; + +const isDir = (type: string) => type === '0'; +const isMenu = (type: string) => type === '1'; +const isButton = (type: string) => type === '2'; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'key', + label: '关键字', + component: 'Input', + colProps: { span: 8 }, + }, +]; + +export const formSchema: FormSchema[] = [ + { + field: 'type', + label: '类型', + component: 'RadioButtonGroup', + defaultValue: '1', + componentProps: { + options: [ + // { label: '目录', value: '0' }, + { label: '菜单', value: '1' }, + { label: '按钮', value: '2' }, + ], + }, + colProps: { lg: 24, md: 24 }, + }, + { + field: 'id', + label: '名称', + component: 'Input', + ifShow: false, + }, + { + field: 'name', + label: '名称', + component: 'Input', + required: true, + }, + + { + field: 'parentId', + label: '上级', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + ifShow: ({ values }) => !isButton(values.type), + }, + { + field: 'moduleId', + label: '菜单', + component: 'TreeSelect', + componentProps: { + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + getPopupContainer: () => document.body, + }, + ifShow: ({ values }) => isButton(values.type), + required: true, + }, + { + field: 'domId', + label: 'DMOID', + component: 'Input', + required: true, + ifShow: ({ values }) => isButton(values.type), + }, + { + field: 'sortNo', + label: '排序', + component: 'InputNumber', + ifShow: ({ values }) => !isButton(values.type), + }, + { + field: 'sort', + label: '排序', + component: 'InputNumber', + ifShow: ({ values }) => isButton(values.type), + }, + { + field: 'class', + helpMessage: ['参考参数值', 'success、warning、error'], + label: '样式', + component: 'Input', + ifShow: ({ values }) => isButton(values.type), + }, + { + field: 'iconName', + label: '图标', + component: 'IconPicker', + ifShow: ({ values }) => !isButton(values.type), + }, + + { + field: 'url', + label: '路由地址', + component: 'Input', + required: true, + ifShow: ({ values }) => !isButton(values.type), + }, + // { + // field: 'component', + // label: '组件路径', + // component: 'Input', + // ifShow: ({ values }) => isMenu(values.type), + // }, + { + field: 'code', + label: '权限标识', + component: 'Input', + ifShow: ({ values }) => !isButton(values.type), + }, + { + field: 'status', + label: '是否系统', + component: 'RadioButtonGroup', + defaultValue: 1, + componentProps: { + options: [ + { label: '是', value: 0 }, + { label: '否', value: 1 }, + ], + }, + ifShow: ({ values }) => !isButton(values.type), + }, + // { + // field: 'isExt', + // label: '是否外链', + // component: 'RadioButtonGroup', + // defaultValue: '0', + // componentProps: { + // options: [ + // { label: '否', value: '0' }, + // { label: '是', value: '1' }, + // ], + // }, + // ifShow: ({ values }) => !isButton(values.type), + // }, + + // { + // field: 'keepalive', + // label: '是否缓存', + // component: 'RadioButtonGroup', + // defaultValue: '0', + // componentProps: { + // options: [ + // { label: '否', value: '0' }, + // { label: '是', value: '1' }, + // ], + // }, + // ifShow: ({ values }) => isMenu(values.type), + // }, + + // { + // field: 'show', + // label: '是否显示', + // component: 'RadioButtonGroup', + // defaultValue: '0', + // componentProps: { + // options: [ + // { label: '是', value: '0' }, + // { label: '否', value: '1' }, + // ], + // }, + // ifShow: ({ values }) => !isButton(values.type), + // }, +]; diff --git a/src/views/demo/onlineform/formScheme/index.vue b/src/views/demo/onlineform/formScheme/index.vue new file mode 100644 index 0000000..a636408 --- /dev/null +++ b/src/views/demo/onlineform/formScheme/index.vue @@ -0,0 +1,140 @@ + +