form-designer-xinyi 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +10 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +6 -0
- package/LICENSE +21 -0
- package/README.md +236 -0
- package/docs/.vitepress/config.ts +158 -0
- package/docs/.vitepress/theme/custom.css +38 -0
- package/docs/.vitepress/theme/index.ts +7 -0
- package/docs/.vitepress/theme/style.css +36 -0
- package/docs/guide/about/about.md +25 -0
- package/docs/guide/action/customFunctions.md +560 -0
- package/docs/guide/action/publicMethods.md +25 -0
- package/docs/guide/components/EBuilder.md +544 -0
- package/docs/guide/components/EDesigner.md +117 -0
- package/docs/guide/extensions/actionBar.md +55 -0
- package/docs/guide/extensions/component.md +113 -0
- package/docs/guide/extensions/icon.md +41 -0
- package/docs/guide/extensions/rightSidebar.md +57 -0
- package/docs/guide/start/dark-mode.md +149 -0
- package/docs/guide/start/i18n-cn.md +39 -0
- package/docs/guide/start/index.md +59 -0
- package/docs/guide/start/layoutGuide.md +0 -0
- package/docs/guide/start/quick-start.md +179 -0
- package/docs/guide/start/theme.md +122 -0
- package/docs/guide/utils/pageManager.md +97 -0
- package/docs/guide/utils/pluginManager.md +227 -0
- package/docs/index.md +41 -0
- package/docs/package.json +14 -0
- package/docs/public/dark.png +0 -0
- package/docs/public/favicon.ico +0 -0
- package/docs/public/icons/demo.css +539 -0
- package/docs/public/icons/demo_index.html +589 -0
- package/docs/public/icons/iconfont.css +379 -0
- package/docs/public/icons/iconfont.js +1 -0
- package/docs/public/icons/iconfont.json +646 -0
- package/docs/public/icons/iconfont.ttf +0 -0
- package/docs/public/icons/iconfont.woff +0 -0
- package/docs/public/icons/iconfont.woff2 +0 -0
- package/docs/public/layout.jpg +0 -0
- package/docs/public/logo.png +0 -0
- package/docs/public/theme.jpg +0 -0
- package/docs/updateLog.md +364 -0
- package/docs/vite.config.ts +18 -0
- package/docs//345/210/235/345/247/213/345/214/226/345/270/203/345/261/200.jpg +0 -0
- package/docs//350/256/276/350/256/241/345/231/250/344/273/213/347/273/215.md +21 -0
- package/docs//350/256/276/350/256/241/345/231/250/345/270/203/345/261/200.jpg +0 -0
- package/examples/README.md +18 -0
- package/examples/index.html +13 -0
- package/examples/package.json +27 -0
- package/examples/public/favicon.ico +0 -0
- package/examples/src/App.vue +5 -0
- package/examples/src/assets/logo.png +0 -0
- package/examples/src/layout/baseLayout.vue +3 -0
- package/examples/src/layout/components/Header/index.vue +102 -0
- package/examples/src/layout/components/Main/Maximize.vue +77 -0
- package/examples/src/layout/components/Main/index.vue +16 -0
- package/examples/src/layout/components/Menu/index.vue +49 -0
- package/examples/src/layout/index.vue +26 -0
- package/examples/src/main.ts +6 -0
- package/examples/src/router/index.ts +98 -0
- package/examples/src/style/reset.css +253 -0
- package/examples/src/style.less +44 -0
- package/examples/src/views/builder/basic/index.vue +182 -0
- package/examples/src/views/builder/disableDisplay/index.vue +153 -0
- package/examples/src/views/builder/disableDisplay copy/index.vue +111 -0
- package/examples/src/views/builder/loadData/index.vue +195 -0
- package/examples/src/views/builder/sum/index.vue +127 -0
- package/examples/src/views/designer/basic/index.vue +22 -0
- package/examples/src/views/designer/loadData/index.vue +186 -0
- package/examples/src/vite-env.d.ts +1 -0
- package/examples/tsconfig.json +27 -0
- package/examples/tsconfig.node.json +10 -0
- package/examples/vite.config.ts +28 -0
- package/package.json +44 -0
- package/packages/core/LICENSE +21 -0
- package/packages/core/components/asyncLoader/index.less +92 -0
- package/packages/core/components/asyncLoader/index.vue +7 -0
- package/packages/core/components/builder/index.ts +3 -0
- package/packages/core/components/builder/src/builder.vue +217 -0
- package/packages/core/components/builder/src/types.ts +4 -0
- package/packages/core/components/designer/index.ts +3 -0
- package/packages/core/components/designer/src/designer.vue +258 -0
- package/packages/core/components/designer/src/index.less +81 -0
- package/packages/core/components/designer/src/modules/actionBar/index.less +79 -0
- package/packages/core/components/designer/src/modules/actionBar/index.vue +44 -0
- package/packages/core/components/designer/src/modules/attributeView/attributeView.vue +104 -0
- package/packages/core/components/designer/src/modules/attributeView/eventView.vue +76 -0
- package/packages/core/components/designer/src/modules/attributeView/index.less +36 -0
- package/packages/core/components/designer/src/modules/attributeView/styleView.vue +103 -0
- package/packages/core/components/designer/src/modules/componentView/index.less +52 -0
- package/packages/core/components/designer/src/modules/componentView/index.vue +118 -0
- package/packages/core/components/designer/src/modules/editContainer/editNodeItem.vue +74 -0
- package/packages/core/components/designer/src/modules/editContainer/editScreenContainer.vue +142 -0
- package/packages/core/components/designer/src/modules/editContainer/index.less +129 -0
- package/packages/core/components/designer/src/modules/editContainer/index.vue +37 -0
- package/packages/core/components/designer/src/modules/editContainer/nodeItem.vue +91 -0
- package/packages/core/components/designer/src/modules/editContainer/previewJson.vue +61 -0
- package/packages/core/components/designer/src/modules/editContainer/previewWidgets.vue +373 -0
- package/packages/core/components/designer/src/modules/editContainer/toolbar.vue +248 -0
- package/packages/core/components/designer/src/modules/header/index.less +16 -0
- package/packages/core/components/designer/src/modules/header/index.vue +60 -0
- package/packages/core/components/designer/src/modules/outline/index.less +7 -0
- package/packages/core/components/designer/src/modules/outline/outline.vue +39 -0
- package/packages/core/components/designer/src/modules/preview/index.less +0 -0
- package/packages/core/components/designer/src/modules/preview/index.vue +71 -0
- package/packages/core/components/designer/src/modules/rightSidebar/breadcrumb.vue +30 -0
- package/packages/core/components/designer/src/modules/rightSidebar/index.less +75 -0
- package/packages/core/components/designer/src/modules/rightSidebar/index.vue +58 -0
- package/packages/core/components/designer/src/modules/sourceCode/index.less +7 -0
- package/packages/core/components/designer/src/modules/sourceCode/index.vue +34 -0
- package/packages/core/components/designer/src/types.ts +9 -0
- package/packages/core/components/icon/index.ts +2 -0
- package/packages/core/components/icon/src/icon.vue +15 -0
- package/packages/core/components/node/index.ts +2 -0
- package/packages/core/components/node/src/node.vue +350 -0
- package/packages/core/components/tree/index.ts +2 -0
- package/packages/core/components/tree/src/index.less +106 -0
- package/packages/core/components/tree/src/tree.vue +113 -0
- package/packages/core/components/tree/src/treeNodeItem.vue +87 -0
- package/packages/core/components/tree/src/treeNodes.vue +68 -0
- package/packages/core/extensions/EActionEditor/index.less +172 -0
- package/packages/core/extensions/EActionEditor/index.vue +160 -0
- package/packages/core/extensions/EActionEditor/src/EActionEditorItem.vue +133 -0
- package/packages/core/extensions/EActionEditor/src/EActionModal.vue +258 -0
- package/packages/core/extensions/EActionEditor/src/EArgsEditor.vue +61 -0
- package/packages/core/extensions/EActionEditor/src/EScriptEdit.vue +26 -0
- package/packages/core/extensions/EColEditor/index.less +24 -0
- package/packages/core/extensions/EColEditor/index.vue +65 -0
- package/packages/core/extensions/EInputSize/index.vue +59 -0
- package/packages/core/extensions/EOptionsEditor/index.vue +52 -0
- package/packages/core/extensions/EOptionsEditor/optionItem.vue +72 -0
- package/packages/core/extensions/ERuleEditor/ERuleItem.vue +137 -0
- package/packages/core/extensions/ERuleEditor/data.ts +24 -0
- package/packages/core/extensions/ERuleEditor/index.less +17 -0
- package/packages/core/extensions/ERuleEditor/index.vue +154 -0
- package/packages/core/extensions/ERuleEditor/types.ts +17 -0
- package/packages/core/extensions/MonacoEditor/index.ts +31 -0
- package/packages/core/extensions/MonacoEditor/index.vue +147 -0
- package/packages/core/extensions/Page/index.ts +23 -0
- package/packages/core/extensions/Page/index.vue +27 -0
- package/packages/core/extensions/index.ts +73 -0
- package/packages/core/index.less +27 -0
- package/packages/core/index.ts +35 -0
- package/packages/core/package.json +59 -0
- package/packages/core/static/icons/demo.css +539 -0
- package/packages/core/static/icons/demo_index.html +2281 -0
- package/packages/core/static/icons/iconfont.css +372 -0
- package/packages/core/static/icons/iconfont.js +1 -0
- package/packages/core/static/icons/iconfont.json +646 -0
- package/packages/core/static/icons/iconfont.ttf +0 -0
- package/packages/core/static/icons/iconfont.woff +0 -0
- package/packages/core/static/icons/iconfont.woff2 +0 -0
- package/packages/core/static/logo.png +0 -0
- package/packages/core/theme/var.less +175 -0
- package/packages/core/tsconfig.json +19 -0
- package/packages/core/types/epic-designer.ts +75 -0
- package/packages/epic-designer/.babelrc +9 -0
- package/packages/epic-designer/.eslintrc.cjs +76 -0
- package/packages/epic-designer/LICENSE +21 -0
- package/packages/epic-designer/README.md +239 -0
- package/packages/epic-designer/index.ts +13 -0
- package/packages/epic-designer/package.json +75 -0
- package/packages/epic-designer/shims-vue.d.ts +4 -0
- package/packages/epic-designer/tsconfig.json +19 -0
- package/packages/epic-designer/uno.config.ts +79 -0
- package/packages/script/package.json +17 -0
- package/packages/script/src/check-compiled.ts +22 -0
- package/packages/script/tsconfig.json +10 -0
- package/packages/ui/LICENSE +21 -0
- package/packages/ui/antd/button/button.vue +16 -0
- package/packages/ui/antd/button/index.ts +202 -0
- package/packages/ui/antd/card/card.ts +31 -0
- package/packages/ui/antd/card/index.ts +63 -0
- package/packages/ui/antd/cascader/cascader.vue +23 -0
- package/packages/ui/antd/cascader/index.ts +197 -0
- package/packages/ui/antd/checkbox/index.ts +99 -0
- package/packages/ui/antd/col/col.ts +31 -0
- package/packages/ui/antd/col/index.ts +22 -0
- package/packages/ui/antd/color-picker/index.ts +107 -0
- package/packages/ui/antd/date-picker/datePicker.ts +47 -0
- package/packages/ui/antd/date-picker/index.ts +302 -0
- package/packages/ui/antd/form/form.vue +118 -0
- package/packages/ui/antd/form/index.ts +195 -0
- package/packages/ui/antd/form-item/formItem.vue +15 -0
- package/packages/ui/antd/form-item/index.ts +11 -0
- package/packages/ui/antd/formLogic/actionEdit.vue +72 -0
- package/packages/ui/antd/formLogic/actionItem.vue +46 -0
- package/packages/ui/antd/formLogic/conditionEdit.vue +111 -0
- package/packages/ui/antd/formLogic/conditionItem.vue +150 -0
- package/packages/ui/antd/formLogic/drawer.vue +124 -0
- package/packages/ui/antd/formLogic/formLogic.vue +33 -0
- package/packages/ui/antd/formLogic/index.ts +11 -0
- package/packages/ui/antd/formLogic/types.ts +25 -0
- package/packages/ui/antd/index.less +33 -0
- package/packages/ui/antd/index.ts +323 -0
- package/packages/ui/antd/input/index.ts +169 -0
- package/packages/ui/antd/input-number/index.ts +181 -0
- package/packages/ui/antd/input-password/index.ts +152 -0
- package/packages/ui/antd/modal/index.ts +19 -0
- package/packages/ui/antd/modal/modal.vue +82 -0
- package/packages/ui/antd/radio/index.ts +105 -0
- package/packages/ui/antd/row/index.ts +114 -0
- package/packages/ui/antd/row/row.ts +31 -0
- package/packages/ui/antd/select/index.ts +228 -0
- package/packages/ui/antd/slider/index.ts +142 -0
- package/packages/ui/antd/switch/index.ts +141 -0
- package/packages/ui/antd/textarea/index.ts +162 -0
- package/packages/ui/antd/time-picker/index.ts +189 -0
- package/packages/ui/antd/upload-file/index.ts +88 -0
- package/packages/ui/antd/upload-file/uploadFile.ts +117 -0
- package/packages/ui/antd/upload-image/index.ts +69 -0
- package/packages/ui/antd/upload-image/uploadImage.vue +148 -0
- package/packages/ui/elementPlus/button/button.ts +25 -0
- package/packages/ui/elementPlus/button/index.ts +128 -0
- package/packages/ui/elementPlus/card/card.ts +36 -0
- package/packages/ui/elementPlus/card/index.ts +50 -0
- package/packages/ui/elementPlus/cascader/index.ts +216 -0
- package/packages/ui/elementPlus/checkbox/checkbox.ts +31 -0
- package/packages/ui/elementPlus/checkbox/index.ts +140 -0
- package/packages/ui/elementPlus/col/col.ts +31 -0
- package/packages/ui/elementPlus/col/index.ts +21 -0
- package/packages/ui/elementPlus/collapse/collapse.ts +32 -0
- package/packages/ui/elementPlus/collapse/index.ts +41 -0
- package/packages/ui/elementPlus/collapse-item/collapseItem.ts +31 -0
- package/packages/ui/elementPlus/collapse-item/index.ts +12 -0
- package/packages/ui/elementPlus/color-picker/index.ts +110 -0
- package/packages/ui/elementPlus/date-picker/index.ts +218 -0
- package/packages/ui/elementPlus/form/form.vue +99 -0
- package/packages/ui/elementPlus/form/index.ts +147 -0
- package/packages/ui/elementPlus/formItem/formItem.vue +15 -0
- package/packages/ui/elementPlus/formItem/index.ts +11 -0
- package/packages/ui/elementPlus/index.less +79 -0
- package/packages/ui/elementPlus/index.ts +84 -0
- package/packages/ui/elementPlus/input/index.ts +179 -0
- package/packages/ui/elementPlus/input-number/index.ts +145 -0
- package/packages/ui/elementPlus/modal/index.ts +18 -0
- package/packages/ui/elementPlus/modal/modal.ts +68 -0
- package/packages/ui/elementPlus/radio/index.ts +121 -0
- package/packages/ui/elementPlus/radio/radio.ts +32 -0
- package/packages/ui/elementPlus/row/index.ts +105 -0
- package/packages/ui/elementPlus/row/row.ts +32 -0
- package/packages/ui/elementPlus/select/index.ts +283 -0
- package/packages/ui/elementPlus/select/select.ts +31 -0
- package/packages/ui/elementPlus/slider/index.ts +237 -0
- package/packages/ui/elementPlus/switch/index.ts +159 -0
- package/packages/ui/elementPlus/textarea/index.ts +154 -0
- package/packages/ui/elementPlus/upload-file/index.ts +86 -0
- package/packages/ui/elementPlus/upload-file/uploadFile.ts +114 -0
- package/packages/ui/elementPlus/upload-image/index.ts +86 -0
- package/packages/ui/elementPlus/upload-image/uploadImage.ts +151 -0
- package/packages/ui/hooks/index.ts +1 -0
- package/packages/ui/hooks/logic.ts +129 -0
- package/packages/ui/index.ts +22 -0
- package/packages/ui/naiveUi/button/button.ts +25 -0
- package/packages/ui/naiveUi/button/index.ts +146 -0
- package/packages/ui/naiveUi/card/card.ts +32 -0
- package/packages/ui/naiveUi/card/index.ts +25 -0
- package/packages/ui/naiveUi/cascader/index.ts +218 -0
- package/packages/ui/naiveUi/checkbox/checkbox.ts +27 -0
- package/packages/ui/naiveUi/checkbox/index.ts +114 -0
- package/packages/ui/naiveUi/col/col.ts +30 -0
- package/packages/ui/naiveUi/col/index.ts +21 -0
- package/packages/ui/naiveUi/collapse/collapse.ts +31 -0
- package/packages/ui/naiveUi/collapse/index.ts +40 -0
- package/packages/ui/naiveUi/collapse-item/collapseItem.ts +31 -0
- package/packages/ui/naiveUi/collapse-item/index.ts +12 -0
- package/packages/ui/naiveUi/color-picker/index.ts +179 -0
- package/packages/ui/naiveUi/date-picker/index.ts +210 -0
- package/packages/ui/naiveUi/form/form.vue +85 -0
- package/packages/ui/naiveUi/form/index.ts +141 -0
- package/packages/ui/naiveUi/form-item/formItem.vue +15 -0
- package/packages/ui/naiveUi/form-item/index.ts +10 -0
- package/packages/ui/naiveUi/index.less +33 -0
- package/packages/ui/naiveUi/index.ts +80 -0
- package/packages/ui/naiveUi/input/index.ts +215 -0
- package/packages/ui/naiveUi/input-number/index.ts +141 -0
- package/packages/ui/naiveUi/modal/index.ts +18 -0
- package/packages/ui/naiveUi/modal/modal.ts +83 -0
- package/packages/ui/naiveUi/radio/index.ts +94 -0
- package/packages/ui/naiveUi/radio/radio.ts +27 -0
- package/packages/ui/naiveUi/row/index.ts +105 -0
- package/packages/ui/naiveUi/row/row.ts +31 -0
- package/packages/ui/naiveUi/select/index.ts +193 -0
- package/packages/ui/naiveUi/slider/index.ts +181 -0
- package/packages/ui/naiveUi/switch/index.ts +133 -0
- package/packages/ui/naiveUi/upload-file/index.ts +82 -0
- package/packages/ui/naiveUi/upload-file/uploadFile.ts +78 -0
- package/packages/ui/naiveUi/upload-image/index.ts +82 -0
- package/packages/ui/naiveUi/upload-image/uploadImage.ts +152 -0
- package/packages/ui/package.json +18 -0
- package/packages/ui/tsconfig.json +19 -0
- package/packages/utils/LICENSE +21 -0
- package/packages/utils/common/common.ts +18 -0
- package/packages/utils/common/component.ts +22 -0
- package/packages/utils/common/data.ts +682 -0
- package/packages/utils/common/element.ts +166 -0
- package/packages/utils/common/index.ts +6 -0
- package/packages/utils/common/string.ts +18 -0
- package/packages/utils/common/theme.ts +84 -0
- package/packages/utils/index.ts +3 -0
- package/packages/utils/manager/index.ts +3 -0
- package/packages/utils/manager/pageManager.ts +157 -0
- package/packages/utils/manager/pluginManager.ts +586 -0
- package/packages/utils/manager/revoke.ts +128 -0
- package/packages/utils/package.json +7 -0
- package/packages/utils/shareStore/index.ts +30 -0
- package/packages/utils/tsconfig.json +19 -0
- package/packages/utils/vite.config.ts +39 -0
- package/pnpm-workspace.yaml +5 -0
- package/turbo.json +20 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type PropType, defineComponent, h, nextTick, computed, ref, watch } from 'vue'
|
|
2
|
+
import { ElMessage, ElUpload, ElButton, type UploadProps, type UploadUserFile, type UploadRawFile } from 'element-plus'
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
props: {
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Array as PropType<UploadUserFile[]>,
|
|
7
|
+
default: () => []
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
emits: ['update:modelValue'],
|
|
11
|
+
setup (props, { emit, attrs }) {
|
|
12
|
+
const fileList = ref<UploadUserFile[]>([])
|
|
13
|
+
watch(fileList, (e) => {
|
|
14
|
+
emit('update:modelValue', e)
|
|
15
|
+
})
|
|
16
|
+
// 处理传递进来的值
|
|
17
|
+
watch(
|
|
18
|
+
() => props.modelValue,
|
|
19
|
+
(e) => {
|
|
20
|
+
if ((e != null) && e.length > 0 && (fileList.value != null)) {
|
|
21
|
+
// props modelValue 等于 data 不进行处理
|
|
22
|
+
if (fileList.value === e) return
|
|
23
|
+
fileList.value.length = 0
|
|
24
|
+
fileList.value.push(...e)
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{ deep: true, immediate: true }
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
// function handleChange : UploadProps['onChange'] (e: UploadUserFile[]) => {
|
|
31
|
+
// nextTick(() => { fileList.value = e })
|
|
32
|
+
// }
|
|
33
|
+
const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles): void => {
|
|
34
|
+
nextTick(() => { fileList.value = uploadFiles })
|
|
35
|
+
}
|
|
36
|
+
// 处理数据结果
|
|
37
|
+
// const handleChange = (info: UploadChangeParam): void => {
|
|
38
|
+
// if (info.file.status === 'uploading') {
|
|
39
|
+
// return
|
|
40
|
+
// }
|
|
41
|
+
//
|
|
42
|
+
// if (info.file.status === 'done') {
|
|
43
|
+
// // Get this url from response in real world.
|
|
44
|
+
// const url = info.file.response?.data?.url
|
|
45
|
+
// if (!info.file.url && !url) {
|
|
46
|
+
// info.file.status = 'error'
|
|
47
|
+
// ElMessage.error('上传失败')
|
|
48
|
+
// return
|
|
49
|
+
// }
|
|
50
|
+
// // 赋值url
|
|
51
|
+
// info.file.url = url
|
|
52
|
+
// }
|
|
53
|
+
//
|
|
54
|
+
// if (info.file.status === 'error') {
|
|
55
|
+
// ElMessage.error('upload error')
|
|
56
|
+
// }
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// 上传前处理
|
|
60
|
+
const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile): void => {
|
|
61
|
+
// const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
62
|
+
// if (!isJpgOrPng) {
|
|
63
|
+
// message.error('您只能上传JPG/PNG文件!');
|
|
64
|
+
// }
|
|
65
|
+
// const isLt2M = file.size / 1024 / 1024 < 2;
|
|
66
|
+
// if (!isLt2M) {
|
|
67
|
+
// message.error('图片大小超过 2MB!');
|
|
68
|
+
// }
|
|
69
|
+
// return isJpgOrPng && isLt2M;
|
|
70
|
+
}
|
|
71
|
+
const handleSuccess: UploadProps['onSuccess'] = (response, uploadFile, uploadFiles) => {
|
|
72
|
+
console.log(uploadFiles)
|
|
73
|
+
}
|
|
74
|
+
const handleError: UploadProps['onError'] = (error, uploadFile, uploadFiles) => {
|
|
75
|
+
ElMessage.error('上传失败')
|
|
76
|
+
console.error(error)
|
|
77
|
+
}
|
|
78
|
+
// ts报错先忽略了
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
80
|
+
// @ts-expect-error
|
|
81
|
+
const getUploadProps = computed<UploadProps>(() => ({
|
|
82
|
+
...attrs,
|
|
83
|
+
"file-list": fileList.value,
|
|
84
|
+
onBeforeUpload: beforeUpload,
|
|
85
|
+
onChange: handleChange,
|
|
86
|
+
onSuccess: handleSuccess,
|
|
87
|
+
onError: handleError
|
|
88
|
+
}))
|
|
89
|
+
|
|
90
|
+
return () => {
|
|
91
|
+
return h('div', null, {
|
|
92
|
+
default: () => [
|
|
93
|
+
h(ElUpload, getUploadProps.value, {
|
|
94
|
+
default: () => [
|
|
95
|
+
h(
|
|
96
|
+
ElButton,
|
|
97
|
+
{},
|
|
98
|
+
{
|
|
99
|
+
default: () => [
|
|
100
|
+
h('span', {
|
|
101
|
+
class: 'iconfont epic-icon-shangchuan1',
|
|
102
|
+
style: { 'margin-right': '2px' }
|
|
103
|
+
}),
|
|
104
|
+
h('span', null, { default: () => '上传文件' })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
})
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
})
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type ComponentConfigModel } from "@epic-designer/utils";
|
|
2
|
+
export default {
|
|
3
|
+
component: () => import("./uploadImage"),
|
|
4
|
+
groupName: "表单",
|
|
5
|
+
icon: "epic-icon-image",
|
|
6
|
+
defaultSchema: {
|
|
7
|
+
label: "上传图片",
|
|
8
|
+
type: "upload-image",
|
|
9
|
+
field: "uploadImage",
|
|
10
|
+
input: true,
|
|
11
|
+
componentProps: {
|
|
12
|
+
action: "https://epic.kcz66.com/static/upload-img.json",
|
|
13
|
+
name: "file",
|
|
14
|
+
showFileList: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
config: {
|
|
18
|
+
attribute: [
|
|
19
|
+
{
|
|
20
|
+
label: "字段名",
|
|
21
|
+
type: "input",
|
|
22
|
+
field: "field",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "标题",
|
|
26
|
+
type: "input",
|
|
27
|
+
field: "label",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "请求地址",
|
|
31
|
+
type: "input",
|
|
32
|
+
field: "componentProps.action",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "上传文件字段",
|
|
36
|
+
type: "input",
|
|
37
|
+
field: "componentProps.name",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: "多选",
|
|
41
|
+
type: "switch",
|
|
42
|
+
field: "componentProps.multiple",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "展示文件列表",
|
|
46
|
+
type: "switch",
|
|
47
|
+
field: "componentProps.showFileList",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "拖拽上传",
|
|
51
|
+
type: "switch",
|
|
52
|
+
field: "componentProps.drag",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "允许上传最大数量",
|
|
56
|
+
type: "number",
|
|
57
|
+
field: "componentProps.limit",
|
|
58
|
+
componentProps: {
|
|
59
|
+
min: 0,
|
|
60
|
+
placeholder: "请输入",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "禁用",
|
|
65
|
+
type: "switch",
|
|
66
|
+
field: "componentProps.disabled",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "隐藏",
|
|
70
|
+
type: "switch",
|
|
71
|
+
field: "componentProps.hidden",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "表单校验",
|
|
75
|
+
type: "ERuleEditor",
|
|
76
|
+
layout: "vertical",
|
|
77
|
+
field: "rules",
|
|
78
|
+
describe: "校验规则需要配合表单使用",
|
|
79
|
+
componentProps: {
|
|
80
|
+
ruleType: "array",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
bindModel: "modelValue",
|
|
86
|
+
} as ComponentConfigModel;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { type PropType, defineComponent, h, nextTick, computed, ref, watch } from 'vue'
|
|
2
|
+
import { ElUpload, ElMessage, ElImageViewer, type UploadProps, type UploadUserFile } from 'element-plus'
|
|
3
|
+
|
|
4
|
+
// 封装上传文件组件
|
|
5
|
+
export default defineComponent({
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: Array as PropType<UploadUserFile[]>,
|
|
9
|
+
default: () => []
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
emits: ['update:modelValue'],
|
|
13
|
+
setup (props, { emit, attrs }) {
|
|
14
|
+
const fileList = ref<UploadUserFile[]>([])
|
|
15
|
+
|
|
16
|
+
const imgUrl = ref('')
|
|
17
|
+
const visible = ref(false)
|
|
18
|
+
const setVisible = (value: boolean): void => {
|
|
19
|
+
visible.value = value
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
watch(fileList, (e) => {
|
|
23
|
+
emit('update:modelValue', e)
|
|
24
|
+
})
|
|
25
|
+
// 处理传递进来的值
|
|
26
|
+
watch(
|
|
27
|
+
() => props.modelValue,
|
|
28
|
+
(e) => {
|
|
29
|
+
if (e != null && e.length > 0 && fileList.value != null) {
|
|
30
|
+
// props modelValue 等于 data 不进行处理
|
|
31
|
+
if (fileList.value === e) return
|
|
32
|
+
fileList.value.length = 0
|
|
33
|
+
fileList.value.push(...e)
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{ deep: true, immediate: true }
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles): void => {
|
|
40
|
+
nextTick(() => { fileList.value = uploadFiles })
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 处理数据结果
|
|
44
|
+
// const handleChange = (info: UploadChangeParam): void => {
|
|
45
|
+
// if (info.file.status === 'uploading') {
|
|
46
|
+
// return
|
|
47
|
+
// }
|
|
48
|
+
//
|
|
49
|
+
// if (info.file.status === 'done') {
|
|
50
|
+
// // Get this url from response in real world.
|
|
51
|
+
// const url: string | undefined = info.file.response?.data?.url
|
|
52
|
+
// if (!info.file.url && !url) {
|
|
53
|
+
// info.file.status = 'error'
|
|
54
|
+
// message.error('上传失败')
|
|
55
|
+
// return
|
|
56
|
+
// }
|
|
57
|
+
// // 赋值url
|
|
58
|
+
// info.file.url = url
|
|
59
|
+
// info.file.thumbUrl = url
|
|
60
|
+
// }
|
|
61
|
+
//
|
|
62
|
+
// if (info.file.status === 'error') {
|
|
63
|
+
// message.error('upload error')
|
|
64
|
+
// }
|
|
65
|
+
// }
|
|
66
|
+
|
|
67
|
+
const handleSuccess: UploadProps['onSuccess'] = (response, uploadFile, uploadFiles) => {
|
|
68
|
+
console.log(uploadFiles)
|
|
69
|
+
}
|
|
70
|
+
const handleError: UploadProps['onError'] = (error, uploadFile, uploadFiles) => {
|
|
71
|
+
ElMessage.error('上传失败')
|
|
72
|
+
console.error(error)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 上传前处理
|
|
76
|
+
const beforeUpload = (file: any): void => {
|
|
77
|
+
// const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
78
|
+
// if (!isJpgOrPng) {
|
|
79
|
+
// message.error('您只能上传JPG/PNG文件!');
|
|
80
|
+
// }
|
|
81
|
+
// const isLt2M = file.size / 1024 / 1024 < 2;
|
|
82
|
+
// if (!isLt2M) {
|
|
83
|
+
// message.error('图片大小超过 2MB!');
|
|
84
|
+
// }
|
|
85
|
+
// return isJpgOrPng && isLt2M;
|
|
86
|
+
}
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
88
|
+
// @ts-expect-error
|
|
89
|
+
const getUploadProps = computed<UploadProps>(() => ({
|
|
90
|
+
...attrs,
|
|
91
|
+
'file-list':fileList.value,
|
|
92
|
+
'list-type': 'picture-card',
|
|
93
|
+
accept: 'image/gif,image/jpeg,image/jpg,image/png,image/svg',
|
|
94
|
+
onBeforeUpload: beforeUpload,
|
|
95
|
+
onChange: handleChange,
|
|
96
|
+
onSuccess: handleSuccess,
|
|
97
|
+
onError: handleError,
|
|
98
|
+
onPreview: handlePreview
|
|
99
|
+
}))
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 预览功能
|
|
103
|
+
* @param {*} e
|
|
104
|
+
*/
|
|
105
|
+
const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
|
|
106
|
+
if (!uploadFile.url) return
|
|
107
|
+
imgUrl.value = uploadFile.url
|
|
108
|
+
setVisible(true)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return () => {
|
|
112
|
+
// const type = attrs.type;
|
|
113
|
+
return h(
|
|
114
|
+
'div',
|
|
115
|
+
{
|
|
116
|
+
class: 'epic-upload-image'
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
default: () => [
|
|
120
|
+
h(ElUpload, getUploadProps.value, {
|
|
121
|
+
default: () => [
|
|
122
|
+
h('div', { style: { 'text-align': 'center' } }, {
|
|
123
|
+
default: () => [
|
|
124
|
+
h('span', {
|
|
125
|
+
class: 'iconfont epic-icon-shangchuan1 text-md',
|
|
126
|
+
style: { 'margin-right': '2px' }
|
|
127
|
+
}),
|
|
128
|
+
h(
|
|
129
|
+
'div',
|
|
130
|
+
{ class: 'ant-upload-text' },
|
|
131
|
+
{ default: () => '点击上传' }
|
|
132
|
+
)
|
|
133
|
+
]
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
(() => {
|
|
138
|
+
if (!visible.value) {
|
|
139
|
+
return
|
|
140
|
+
}
|
|
141
|
+
return h(ElImageViewer, {
|
|
142
|
+
urlList: [imgUrl.value],
|
|
143
|
+
onClose: () => { setVisible(false) }
|
|
144
|
+
})
|
|
145
|
+
})()
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './logic'
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { PageManager } from './../../utils/manager/pageManager';
|
|
2
|
+
import { reactive, watch, inject } from 'vue'
|
|
3
|
+
import type { FormDataModel } from '@epic-designer/core/types/epic-designer'
|
|
4
|
+
import { deepEqual } from '@epic-designer/utils'
|
|
5
|
+
import { LogicRules, ConditionItem, Condition, ActionItem } from '../antd/formLogic/types'
|
|
6
|
+
export function useFormLogic(clearValidate: any = null) {
|
|
7
|
+
const formData = reactive<FormDataModel>({})
|
|
8
|
+
const pageManager = inject('pageManager') as PageManager
|
|
9
|
+
let logicRules: LogicRules = []
|
|
10
|
+
|
|
11
|
+
watch(() => formData, () => {
|
|
12
|
+
logicRules.forEach(rule => {
|
|
13
|
+
// 验证是否满足规则条件
|
|
14
|
+
if (validateConditions(rule.condition)) {
|
|
15
|
+
// 满足条件,执行动作
|
|
16
|
+
rule.actions.forEach(action => {
|
|
17
|
+
handleAction(action)
|
|
18
|
+
})
|
|
19
|
+
} else {
|
|
20
|
+
// 不满足条件,执行动作(反向)
|
|
21
|
+
rule.actions.forEach(action => {
|
|
22
|
+
handleAction(action, true)
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
}, { deep: true })
|
|
28
|
+
|
|
29
|
+
function validateConditions(condition: Condition) {
|
|
30
|
+
if (condition.operator === 'and') {
|
|
31
|
+
return condition.conditions.every(conditionItem => {
|
|
32
|
+
if (!conditionItem.field) return true
|
|
33
|
+
const fieldValue = formData[conditionItem.field];
|
|
34
|
+
return validateField(fieldValue, conditionItem);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (condition.operator === 'or') {
|
|
39
|
+
return condition.conditions.some(conditionItem => {
|
|
40
|
+
if (!conditionItem.field) return true
|
|
41
|
+
const fieldValue = formData[conditionItem.field];
|
|
42
|
+
return validateField(fieldValue, conditionItem);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function validateField(value: any, conditionItem: ConditionItem): boolean {
|
|
50
|
+
if (!conditionItem.value) return false
|
|
51
|
+
switch (conditionItem.operator) {
|
|
52
|
+
case 'eq':
|
|
53
|
+
return typeof value === 'object' ? deepEqual(value, conditionItem.value) : value === conditionItem.value;
|
|
54
|
+
case 'neq':
|
|
55
|
+
return typeof value === 'object' ? !deepEqual(value, conditionItem.value) : value !== conditionItem.value;
|
|
56
|
+
case 'gt':
|
|
57
|
+
// 确保 value 和 conditionItem.value 都是数字或可以比较的字符串
|
|
58
|
+
return (typeof value === 'number' || typeof value === 'string') && value > conditionItem.value;
|
|
59
|
+
case 'gte':
|
|
60
|
+
// 确保 value 和 conditionItem.value 都是数字或可以比较的字符串
|
|
61
|
+
return (typeof value === 'number' || typeof value === 'string') && value >= conditionItem.value;
|
|
62
|
+
case 'lt':
|
|
63
|
+
// 确保 value 和 conditionItem.value 都是数字或可以比较的字符串
|
|
64
|
+
return (typeof value === 'number' || typeof value === 'string') && value < conditionItem.value;
|
|
65
|
+
case 'lte':
|
|
66
|
+
// 确保 value 和 conditionItem.value 都是数字或可以比较的字符串
|
|
67
|
+
return (typeof value === 'number' || typeof value === 'string') && value <= conditionItem.value;
|
|
68
|
+
case 'in':
|
|
69
|
+
// value 可以是conditionItem.value中的一个元素
|
|
70
|
+
return conditionItem.value.includes(value);
|
|
71
|
+
case 'nin':
|
|
72
|
+
// value 不能是conditionItem.value中的一个元素
|
|
73
|
+
return !conditionItem.value.includes(value);
|
|
74
|
+
case 'null':
|
|
75
|
+
return value === null || value === undefined || value === '';
|
|
76
|
+
case 'notNull':
|
|
77
|
+
return value !== null && value !== undefined && value !== '';
|
|
78
|
+
default:
|
|
79
|
+
// 未知操作符,默认返回 true
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 执行特定动作
|
|
85
|
+
function handleAction(action: ActionItem, reverse = false) {
|
|
86
|
+
if (!action.field) return
|
|
87
|
+
|
|
88
|
+
const instance = pageManager.find(action.field) as any
|
|
89
|
+
|
|
90
|
+
switch (action.trigger) {
|
|
91
|
+
case 'hide':
|
|
92
|
+
instance.setAttr('hidden', !reverse)
|
|
93
|
+
break
|
|
94
|
+
case 'show':
|
|
95
|
+
instance.setAttr('hidden', reverse)
|
|
96
|
+
break
|
|
97
|
+
case 'required':
|
|
98
|
+
instance.setAttr('required', !reverse); clearValidate?.();
|
|
99
|
+
break
|
|
100
|
+
case 'notRequired':
|
|
101
|
+
instance.setAttr('required', reverse); clearValidate?.();
|
|
102
|
+
break
|
|
103
|
+
case 'readonly':
|
|
104
|
+
instance.setAttr('readOnly', !reverse)
|
|
105
|
+
break
|
|
106
|
+
case 'readWrite':
|
|
107
|
+
instance.setAttr('readOnly', reverse)
|
|
108
|
+
break
|
|
109
|
+
case 'disabled':
|
|
110
|
+
instance.setAttr('disabled', !reverse)
|
|
111
|
+
break
|
|
112
|
+
case 'enabled':
|
|
113
|
+
instance.setAttr('disabled', reverse)
|
|
114
|
+
break
|
|
115
|
+
case 'setValue':
|
|
116
|
+
!reverse && action.value && instance.setValue((pageManager.find(action.value) as any).getValue())
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function setLogicRules(rules: LogicRules) {
|
|
122
|
+
logicRules = rules
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
formData,
|
|
127
|
+
setLogicRules
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { pluginManager } from "@epic-designer/utils";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export function setupAntd() {
|
|
5
|
+
import("./antd").then(({ setupAntd }) => {
|
|
6
|
+
setupAntd.bind(null, pluginManager)();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function setupElementPlus() {
|
|
11
|
+
import("./elementPlus").then(({ setupElementPlus }) => {
|
|
12
|
+
setupElementPlus.bind(null, pluginManager)();
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function setupNaiveUi() {
|
|
17
|
+
import("./naiveUi").then(({ setupNaiveUi }) => {
|
|
18
|
+
setupNaiveUi.bind(null, pluginManager)();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
import { defineComponent, h, renderSlot } from 'vue'
|
|
3
|
+
import { NButton } from 'naive-ui'
|
|
4
|
+
import { type ComponentSchema } from '@epic-designer/core/types/epic-designer'
|
|
5
|
+
|
|
6
|
+
// 二次封装组件
|
|
7
|
+
export default defineComponent({
|
|
8
|
+
props: {
|
|
9
|
+
componentSchema: {
|
|
10
|
+
type: Object as PropType<ComponentSchema>,
|
|
11
|
+
default: () => ({})
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup (props, { slots }) {
|
|
15
|
+
return () => {
|
|
16
|
+
const componentProps: Record<string, any> = {
|
|
17
|
+
...props.componentSchema?.componentProps
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return h(NButton, componentProps, {
|
|
21
|
+
default: () => renderSlot(slots, 'default', {}, () => [props.componentSchema?.label])
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
})
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type ComponentConfigModel } from "@epic-designer/utils";
|
|
2
|
+
export default {
|
|
3
|
+
component: () => import("./button"),
|
|
4
|
+
groupName: "表单",
|
|
5
|
+
icon: "epic-icon-button-remove",
|
|
6
|
+
defaultSchema: {
|
|
7
|
+
label: "按钮",
|
|
8
|
+
type: "button",
|
|
9
|
+
field: "input",
|
|
10
|
+
input: false,
|
|
11
|
+
componentProps: {
|
|
12
|
+
bordered: true,
|
|
13
|
+
type: "default",
|
|
14
|
+
size: "medium",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
config: {
|
|
18
|
+
attribute: [
|
|
19
|
+
{
|
|
20
|
+
label: "标题",
|
|
21
|
+
type: "input",
|
|
22
|
+
field: "label",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "类型",
|
|
26
|
+
type: "select",
|
|
27
|
+
componentProps: {
|
|
28
|
+
placeholder: "请选择",
|
|
29
|
+
options: [
|
|
30
|
+
{
|
|
31
|
+
label: "default",
|
|
32
|
+
value: "default",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: "tertiary",
|
|
36
|
+
value: "tertiary",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: "primary",
|
|
40
|
+
value: "primary",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "success",
|
|
44
|
+
value: "success",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "info",
|
|
48
|
+
value: "info",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: "warning",
|
|
52
|
+
value: "warning",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "error",
|
|
56
|
+
value: "error",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
field: "componentProps.type",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "尺寸",
|
|
64
|
+
type: "select",
|
|
65
|
+
defaultValue: "default",
|
|
66
|
+
componentProps: {
|
|
67
|
+
placeholder: "请选择",
|
|
68
|
+
options: [
|
|
69
|
+
{
|
|
70
|
+
label: "tiny",
|
|
71
|
+
value: "tiny",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "large",
|
|
75
|
+
value: "large",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
label: "medium",
|
|
79
|
+
value: "medium",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: "small",
|
|
83
|
+
value: "small",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
field: "componentProps.size",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: "是否块级",
|
|
91
|
+
type: "switch",
|
|
92
|
+
field: "componentProps.block",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: "显示边框",
|
|
96
|
+
type: "switch",
|
|
97
|
+
field: "componentProps.bordered",
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "虚线框",
|
|
101
|
+
type: "switch",
|
|
102
|
+
field: "componentProps.dashed",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: "圆角按钮",
|
|
106
|
+
type: "switch",
|
|
107
|
+
field: "componentProps.round",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: "圆形按钮",
|
|
111
|
+
type: "switch",
|
|
112
|
+
field: "componentProps.circle",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: "按钮颜色",
|
|
116
|
+
type: "color-picker",
|
|
117
|
+
field: "componentProps.color",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "是否透明",
|
|
121
|
+
type: "switch",
|
|
122
|
+
field: "componentProps.ghost",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: "禁用",
|
|
126
|
+
type: "switch",
|
|
127
|
+
field: "componentProps.disabled",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: "隐藏",
|
|
131
|
+
type: "switch",
|
|
132
|
+
field: "componentProps.hidden",
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
event: [
|
|
136
|
+
{
|
|
137
|
+
type: "click",
|
|
138
|
+
describe: "点击按钮时",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: "dblclick",
|
|
142
|
+
describe: "双击按钮时",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
} as ComponentConfigModel;
|