@cicctencent/formily 0.0.0-stage → 0.0.1
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 +40 -0
- package/.prettierrc.js +28 -0
- package/.vscode/launch.json +23 -0
- package/CHANGELOG.md +8 -0
- package/README.md +22 -2
- package/babel.config.js +3 -0
- package/build/build.js +96 -0
- package/build/rollup.config.bundle.js +63 -0
- package/build/update.version.js +35 -0
- package/dist/index.css +2516 -0
- package/dist/index.js +8377 -0
- package/dist/schema-field/index.css +2466 -0
- package/dist/schema-field/index.js +8213 -0
- package/dist/transform/index.js +551 -0
- package/dist/validate/index.js +1104 -0
- package/dist/vue-form/index.css +2516 -0
- package/dist/vue-form/index.js +8359 -0
- package/docs/.vuepress/client.ts +15 -0
- package/docs/.vuepress/components/code-preview.vue +203 -0
- package/docs/.vuepress/components/highlight.ts +53 -0
- package/docs/.vuepress/config.ts +39 -0
- package/docs/.vuepress/util.ts +7 -0
- package/docs/README.md +30 -0
- package/docs/components/anyOf.md +26 -0
- package/docs/components/array-cards.md +12 -0
- package/docs/components/array-collapse.md +12 -0
- package/docs/components/array-items.md +12 -0
- package/docs/components/array-table.md +12 -0
- package/docs/components/array-tabs.md +16 -0
- package/docs/components/cascader.md +12 -0
- package/docs/components/checkbox.md +12 -0
- package/docs/components/event.md +27 -0
- package/docs/components/hotArea.md +25 -0
- package/docs/components/index.md +4 -0
- package/docs/components/input.md +30 -0
- package/docs/components/layout-group.md +19 -0
- package/docs/components/link.md +22 -0
- package/docs/components/oneOf.md +8 -0
- package/docs/components/radio.md +12 -0
- package/docs/components/rich-editor.md +21 -0
- package/docs/components/select.md +34 -0
- package/docs/components/space.md +11 -0
- package/docs/components/switch.md +20 -0
- package/docs/components/text.md +21 -0
- package/docs/components/time-picker.md +11 -0
- package/docs/components/transfer.md +14 -0
- package/docs/components/upload-button.md +28 -0
- package/docs/demos/any-of/index.vue +66 -0
- package/docs/demos/array-cards/index.vue +105 -0
- package/docs/demos/array-collapse/index.vue +155 -0
- package/docs/demos/array-items/index.vue +171 -0
- package/docs/demos/array-table/index.vue +115 -0
- package/docs/demos/array-tabs/index.vue +56 -0
- package/docs/demos/cascader/index.vue +297 -0
- package/docs/demos/checkbox/index.vue +39 -0
- package/docs/demos/event/index.vue +436 -0
- package/docs/demos/hotArea/index.vue +240 -0
- package/docs/demos/index.vue +36 -0
- package/docs/demos/input/index.vue +46 -0
- package/docs/demos/layout-group/index.vue +51 -0
- package/docs/demos/link/index.vue +32 -0
- package/docs/demos/radio/index.vue +36 -0
- package/docs/demos/rich-editor/index.vue +22 -0
- package/docs/demos/select/index.vue +76 -0
- package/docs/demos/space/index.vue +93 -0
- package/docs/demos/switch/index.vue +31 -0
- package/docs/demos/text/index.vue +38 -0
- package/docs/demos/time-picker/index.vue +39 -0
- package/docs/demos/transfer/index.vue +26 -0
- package/docs/demos/upload-button/index.vue +27 -0
- package/docs/demos/x-data/add-button-title.vue +101 -0
- package/docs/demos/x-data/send-message.vue +33 -0
- package/docs/demos/x-reactions/any-of.vue +40 -0
- package/docs/demos/x-reactions/x-reactions.vue +39 -0
- package/docs/guide/component-extend.md +23 -0
- package/docs/guide/extra-bury-report.md +64 -0
- package/docs/guide/schema.md +22 -0
- package/docs/guide/x-data.md +41 -0
- package/docs/guide/x-reactions.md +20 -0
- package/example/.browserslistrc +4 -0
- package/example/.eslintrc.js +20 -0
- package/example/README.md +24 -0
- package/example/index.html +15 -0
- package/example/jest.config.js +26 -0
- package/example/package.json +50 -0
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +17 -0
- package/example/src/App.vue +25 -0
- package/example/src/assets/logo.png +0 -0
- package/example/src/components/HelloWorld.vue +148 -0
- package/example/src/components/group/index.vue +16 -0
- package/example/src/components/uploadBtn/index.vue +44 -0
- package/example/src/components/uploadBtn/upload-icon.svg +6 -0
- package/example/src/layout/component/Aside.vue +39 -0
- package/example/src/layout/component/Main.vue +9 -0
- package/example/src/layout/index.vue +15 -0
- package/example/src/main.ts +17 -0
- package/example/src/router/index.ts +99 -0
- package/example/src/shims-vue.d.ts +6 -0
- package/example/src/store/index.ts +9 -0
- package/example/src/views/demo/any-of/data.ts +38 -0
- package/example/src/views/demo/any-of/index.vue +35 -0
- package/example/src/views/demo/array-cards/data.ts +65 -0
- package/example/src/views/demo/array-cards/index.vue +33 -0
- package/example/src/views/demo/array-items/data.ts +29 -0
- package/example/src/views/demo/array-items/index.vue +33 -0
- package/example/src/views/demo/cloud-button/data.ts +14 -0
- package/example/src/views/demo/cloud-button/index.vue +22 -0
- package/example/src/views/demo/color-group/data.ts +15 -0
- package/example/src/views/demo/color-group/index.vue +22 -0
- package/example/src/views/demo/color-picker/data.ts +21 -0
- package/example/src/views/demo/color-picker/index.vue +33 -0
- package/example/src/views/demo/datatime/data.ts +62 -0
- package/example/src/views/demo/datatime/index.vue +22 -0
- package/example/src/views/demo/event/data.ts +184 -0
- package/example/src/views/demo/event/index.vue +33 -0
- package/example/src/views/demo/hot-area/data.ts +196 -0
- package/example/src/views/demo/hot-area/index.vue +33 -0
- package/example/src/views/demo/input/data.ts +39 -0
- package/example/src/views/demo/input/index.vue +33 -0
- package/example/src/views/demo/link/data.ts +23 -0
- package/example/src/views/demo/link/index.vue +22 -0
- package/example/src/views/demo/one-of/data.ts +139 -0
- package/example/src/views/demo/one-of/index.vue +33 -0
- package/example/src/views/demo/rich-editor/data.ts +12 -0
- package/example/src/views/demo/rich-editor/index.vue +24 -0
- package/example/src/views/demo/select/data.ts +38 -0
- package/example/src/views/demo/select/index.vue +33 -0
- package/example/src/views/demo/upload-button/data1.ts +11 -0
- package/example/src/views/demo/upload-button/data2.ts +12 -0
- package/example/src/views/demo/upload-button/index.vue +42 -0
- package/example/tsconfig.json +32 -0
- package/example/vite.config.ts +12 -0
- package/jest.config.js +4 -0
- package/package.json +92 -4
- package/src/components/__builtins__/configs/index.ts +1 -0
- package/src/components/__builtins__/index.ts +2 -0
- package/src/components/__builtins__/shared/create-context.ts +54 -0
- package/src/components/__builtins__/shared/index.ts +7 -0
- package/src/components/__builtins__/shared/loading.ts +20 -0
- package/src/components/__builtins__/shared/portal.ts +43 -0
- package/src/components/__builtins__/shared/resolve-component.ts +22 -0
- package/src/components/__builtins__/shared/transform-component.ts +33 -0
- package/src/components/__builtins__/shared/types.ts +8 -0
- package/src/components/__builtins__/shared/utils.ts +35 -0
- package/src/components/__builtins__/styles/common.scss +22 -0
- package/src/components/__builtins__/styles/element-plus.scss +1094 -0
- package/src/components/any-of/index.ts +20 -0
- package/src/components/array-base/index.ts +413 -0
- package/src/components/array-base/style.scss +53 -0
- package/src/components/array-base/style.ts +2 -0
- package/src/components/array-cards/index.ts +253 -0
- package/src/components/array-cards/style.scss +33 -0
- package/src/components/array-cards/style.ts +7 -0
- package/src/components/array-collapse/index.ts +381 -0
- package/src/components/array-collapse/style.scss +38 -0
- package/src/components/array-collapse/style.ts +10 -0
- package/src/components/array-items/index.ts +213 -0
- package/src/components/array-items/style.scss +82 -0
- package/src/components/array-items/style.ts +4 -0
- package/src/components/array-table/index.ts +567 -0
- package/src/components/array-table/style.scss +84 -0
- package/src/components/array-table/style.ts +11 -0
- package/src/components/array-tabs/index.ts +141 -0
- package/src/components/array-tabs/style.scss +16 -0
- package/src/components/array-tabs/style.ts +5 -0
- package/src/components/base/AnyOf/index.ts +155 -0
- package/src/components/base/AnyOf/index.vue +111 -0
- package/src/components/base/CloudButton/index.ts +46 -0
- package/src/components/base/CloudButton/index.vue +128 -0
- package/src/components/base/ColorGroup/index.ts +57 -0
- package/src/components/base/ColorGroup/index.vue +30 -0
- package/src/components/base/ColorPicker/index.ts +45 -0
- package/src/components/base/ColorPicker/index.vue +50 -0
- package/src/components/base/Container/index.vue +39 -0
- package/src/components/base/HotArea/index.ts +698 -0
- package/src/components/base/HotArea/index.vue +565 -0
- package/src/components/base/HotArea/type.ts +18 -0
- package/src/components/base/Input/index.vue +150 -0
- package/src/components/base/LayoutGroup/index.vue +40 -0
- package/src/components/base/Link/index.vue +43 -0
- package/src/components/base/Middleware/index.ts +235 -0
- package/src/components/base/Middleware/index.vue +169 -0
- package/src/components/base/OneOf/index.ts +105 -0
- package/src/components/base/OneOf/index.vue +85 -0
- package/src/components/base/RichEditor/index.ts +13 -0
- package/src/components/base/RichEditor/index.vue +120 -0
- package/src/components/base/RichEditor/options.ts +24 -0
- package/src/components/base/Select/index.ts +106 -0
- package/src/components/base/Select/index.vue +161 -0
- package/src/components/base/Switch/index.vue +42 -0
- package/src/components/base/Text/index.vue +47 -0
- package/src/components/base/event/index.ts +226 -0
- package/src/components/base/event/index.vue +356 -0
- package/src/components/cascader/index.ts +48 -0
- package/src/components/cascader/style.ts +5 -0
- package/src/components/checkbox/index.ts +166 -0
- package/src/components/checkbox/style.ts +5 -0
- package/src/components/cloud-button/index.ts +21 -0
- package/src/components/color-group/index.ts +18 -0
- package/src/components/color-picker/index.ts +18 -0
- package/src/components/container/index.ts +18 -0
- package/src/components/data-time/index.ts +24 -0
- package/src/components/date-picker/index.ts +51 -0
- package/src/components/date-picker/style.ts +4 -0
- package/src/components/editable/index.ts +261 -0
- package/src/components/editable/style.scss +55 -0
- package/src/components/editable/style.ts +5 -0
- package/src/components/el-form-item/index.ts +21 -0
- package/src/components/el-form-item/style.ts +3 -0
- package/src/components/event/index.ts +16 -0
- package/src/components/form/index.ts +94 -0
- package/src/components/form/style.scss +0 -0
- package/src/components/form/style.ts +3 -0
- package/src/components/form-button-group/index.ts +74 -0
- package/src/components/form-button-group/style.scss +0 -0
- package/src/components/form-button-group/style.ts +4 -0
- package/src/components/form-collapse/index.ts +215 -0
- package/src/components/form-collapse/style.scss +6 -0
- package/src/components/form-collapse/style.ts +4 -0
- package/src/components/form-dialog/index.ts +433 -0
- package/src/components/form-dialog/style.ts +4 -0
- package/src/components/form-drawer/index.ts +424 -0
- package/src/components/form-drawer/style.scss +21 -0
- package/src/components/form-drawer/style.ts +4 -0
- package/src/components/form-grid/index.ts +181 -0
- package/src/components/form-grid/style.scss +5 -0
- package/src/components/form-grid/style.ts +1 -0
- package/src/components/form-item/animation.scss +72 -0
- package/src/components/form-item/grid.scss +171 -0
- package/src/components/form-item/index.ts +642 -0
- package/src/components/form-item/style.scss +521 -0
- package/src/components/form-item/style.ts +2 -0
- package/src/components/form-item/var.scss +17 -0
- package/src/components/form-layout/index.ts +161 -0
- package/src/components/form-layout/style.scss +6 -0
- package/src/components/form-layout/style.ts +1 -0
- package/src/components/form-layout/useResponsiveFormLayout.ts +118 -0
- package/src/components/form-step/index.ts +210 -0
- package/src/components/form-step/style.ts +2 -0
- package/src/components/form-tab/index.ts +172 -0
- package/src/components/form-tab/style.scss +6 -0
- package/src/components/form-tab/style.ts +4 -0
- package/src/components/hot-area/index.ts +20 -0
- package/src/components/index.ts +49 -0
- package/src/components/input/index.ts +35 -0
- package/src/components/input/style.ts +4 -0
- package/src/components/input-number/index.ts +36 -0
- package/src/components/input-number/style.ts +3 -0
- package/src/components/layout-group/index.ts +18 -0
- package/src/components/link/index.ts +18 -0
- package/src/components/middleware/index.ts +21 -0
- package/src/components/one-of/index.ts +20 -0
- package/src/components/placeholder-input/index.ts +21 -0
- package/src/components/placeholder-input/index.vue +87 -0
- package/src/components/preview-text/index.ts +303 -0
- package/src/components/preview-text/style.ts +9 -0
- package/src/components/radio/index.ts +109 -0
- package/src/components/radio/style.ts +3 -0
- package/src/components/reset/index.ts +52 -0
- package/src/components/reset/style.ts +1 -0
- package/src/components/rich-editor/index.ts +18 -0
- package/src/components/row/index.ts +20 -0
- package/src/components/row/index.vue +53 -0
- package/src/components/select/index.ts +19 -0
- package/src/components/select/style.ts +5 -0
- package/src/components/space/index.ts +98 -0
- package/src/components/space/style.scss +24 -0
- package/src/components/space/style.ts +1 -0
- package/src/components/submit/index.ts +59 -0
- package/src/components/submit/style.ts +1 -0
- package/src/components/switch/index.ts +9 -0
- package/src/components/switch/style.ts +1 -0
- package/src/components/text/index.ts +21 -0
- package/src/components/time-picker/index.ts +21 -0
- package/src/components/time-picker/style.ts +4 -0
- package/src/components/transfer/index.ts +12 -0
- package/src/components/transfer/style.ts +1 -0
- package/src/components/upload/index.ts +136 -0
- package/src/components/upload/style.ts +2 -0
- package/src/components/upload-button/index.ts +21 -0
- package/src/components/upload-button/index.vue +199 -0
- package/src/createScemaField.ts +14 -0
- package/src/index.ts +41 -0
- package/src/schema-field/index.ts +11 -0
- package/src/scope.ts +29 -0
- package/src/transform/core.ts +404 -0
- package/src/transform/index.ts +11 -0
- package/src/transform/transform.ts +59 -0
- package/src/transform/utils/constant.ts +79 -0
- package/src/transform/utils/func.ts +145 -0
- package/src/typings/common.ts +37 -0
- package/src/typings/vue-shim.d.ts +7 -0
- package/src/typings/vue-test-utils.d.ts +11 -0
- package/src/utils/anyof_utils.ts +95 -0
- package/src/utils/common.ts +15 -0
- package/src/validate/index.ts +648 -0
- package/src/validate/utils/constant.ts +2 -0
- package/src/vue-form/index.ts +18 -0
- package/src/vue-form/index.vue +106 -0
- package/src/vue-form/useForm.ts +112 -0
- package/tests/data/anyof.ts +40 -0
- package/tests/data/image.ts +472 -0
- package/tests/fixtures/validate.ts +63 -0
- package/tests/unit/transform.spec.ts +253 -0
- package/tests/unit/utils.spec.ts +10 -0
- package/tests/unit/validate.spec.ts +256 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<div>
|
|
4
|
+
<VueForm :schema="schema"></VueForm>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref } from "vue";
|
|
10
|
+
|
|
11
|
+
const schema = ref({
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties:{
|
|
14
|
+
phone:{
|
|
15
|
+
title: '手机号',
|
|
16
|
+
type: 'string',
|
|
17
|
+
'x-component-props':{
|
|
18
|
+
maxlength: 11
|
|
19
|
+
},
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
test2:{
|
|
23
|
+
title: '密码',
|
|
24
|
+
type: 'string',
|
|
25
|
+
'x-component-props':{
|
|
26
|
+
type:'password'
|
|
27
|
+
},
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style scoped>
|
|
35
|
+
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue'
|
|
9
|
+
const formData = ref({});
|
|
10
|
+
const schema = ref({
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties:{
|
|
13
|
+
demo1:{
|
|
14
|
+
type: 'string',
|
|
15
|
+
title: '隐示转换',
|
|
16
|
+
},
|
|
17
|
+
demo2:{
|
|
18
|
+
type: 'string',
|
|
19
|
+
title: '指定组件渲染',
|
|
20
|
+
'x-component': 'Input'
|
|
21
|
+
},
|
|
22
|
+
demo4:{
|
|
23
|
+
type: 'string',
|
|
24
|
+
title: '颜色输入框2',
|
|
25
|
+
'x-component': 'Input',
|
|
26
|
+
'x-component-props':{
|
|
27
|
+
inputType: 'color'
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
demo5:{
|
|
31
|
+
type: 'string',
|
|
32
|
+
title: '必填参数',
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
demo6:{
|
|
36
|
+
type: 'string',
|
|
37
|
+
title: 'tips提示',
|
|
38
|
+
description: '这是tips提示'
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped>
|
|
45
|
+
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue'
|
|
9
|
+
const formData = ref({});
|
|
10
|
+
const schema = ref({
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties:{
|
|
13
|
+
_group1:{
|
|
14
|
+
type: 'void',
|
|
15
|
+
'x-decorator': 'LayoutGroup',
|
|
16
|
+
'x-decorator-props': { title: '页面信息',style:{background:'#86909c'},borderBottom:true },
|
|
17
|
+
properties:{
|
|
18
|
+
demo1:{
|
|
19
|
+
type: 'string',
|
|
20
|
+
title: '隐示转换',
|
|
21
|
+
},
|
|
22
|
+
demo2:{
|
|
23
|
+
type: 'string',
|
|
24
|
+
title: '指定组件渲染',
|
|
25
|
+
'x-component': 'Input'
|
|
26
|
+
},
|
|
27
|
+
demo4:{
|
|
28
|
+
type: 'string',
|
|
29
|
+
title: '颜色输入框2',
|
|
30
|
+
'x-component': 'Input',
|
|
31
|
+
'x-component-props':{
|
|
32
|
+
inputType: 'color'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
demo5:{
|
|
36
|
+
type: 'string',
|
|
37
|
+
title: '必填参数',
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
demo6:{
|
|
41
|
+
type: 'string',
|
|
42
|
+
title: 'tips提示',
|
|
43
|
+
description: '这是tips提示'
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
<style scoped>
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue'
|
|
9
|
+
const formData = ref({});
|
|
10
|
+
const schema = ref({
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties:{
|
|
13
|
+
demo1:{
|
|
14
|
+
type: 'void',
|
|
15
|
+
title: '超链接',
|
|
16
|
+
'x-component': 'Link',
|
|
17
|
+
'x-component-props':{
|
|
18
|
+
type: 'danger',
|
|
19
|
+
links: [{
|
|
20
|
+
label: '金腾官网',
|
|
21
|
+
href: 'https://www.jintengtech.com/'
|
|
22
|
+
},{
|
|
23
|
+
label: 'github',
|
|
24
|
+
href: 'http://git.jintengoa.com/jvfe/base/ark/-/tree/master/packages/jt-formily'
|
|
25
|
+
}]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
31
|
+
<style scoped>
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue';
|
|
9
|
+
const formData = ref({});
|
|
10
|
+
const schema = {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
radio: {
|
|
14
|
+
type: 'boolean',
|
|
15
|
+
title: '单选',
|
|
16
|
+
enum: [
|
|
17
|
+
{
|
|
18
|
+
label: '选项1',
|
|
19
|
+
value: 1,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: '选项2',
|
|
23
|
+
value: 2,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'x-decorator': 'FormItem',
|
|
27
|
+
'x-component': 'Radio.Group',
|
|
28
|
+
'x-component-props': {
|
|
29
|
+
optionType: 'button',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
<style scoped>
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
const formData = ref({});
|
|
9
|
+
const schema = ref({
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties:{
|
|
12
|
+
demo1:{
|
|
13
|
+
type: 'string',
|
|
14
|
+
title: '富文本编辑',
|
|
15
|
+
required: true,
|
|
16
|
+
'x-component': 'RichEditor'
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
<style scoped>
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData" @getData="getData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue'
|
|
9
|
+
const formData = ref({})
|
|
10
|
+
const schema = ref({
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties:{
|
|
13
|
+
demo1:{
|
|
14
|
+
type: 'number',
|
|
15
|
+
enum:[{ label: '选项1', value: 1},{ label: '选项2', value: 2}],
|
|
16
|
+
title: '普通下拉框',
|
|
17
|
+
},
|
|
18
|
+
demo2:{
|
|
19
|
+
type: 'number',
|
|
20
|
+
enum:[{ label: '选项1', value: {name: 'Jerry'}},{ label: '选项2', value: {name: 'Tom'}}],
|
|
21
|
+
title: '对象类型下拉框',
|
|
22
|
+
'x-component-props':{
|
|
23
|
+
valueKey: 'name'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
demo3:{
|
|
27
|
+
type: 'number',
|
|
28
|
+
enum:[],
|
|
29
|
+
title: '远程数据加载(5秒)',
|
|
30
|
+
'x-component-props':{
|
|
31
|
+
cmdname: 'userList'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
demo4:{
|
|
35
|
+
type: 'number',
|
|
36
|
+
enum:[{ label: '选项1', value: 1},{ label: '选项2', value: 2}],
|
|
37
|
+
title: '只读',
|
|
38
|
+
readOnly: true
|
|
39
|
+
},
|
|
40
|
+
demo5:{
|
|
41
|
+
type: 'number',
|
|
42
|
+
enum:[{label: '喜羊羊', value: 1}, {label: '美羊羊', value: 2},{label: '懒羊羊', value: 3},{label: '沸羊羊', value: 4}],
|
|
43
|
+
title: '带有前缀',
|
|
44
|
+
'x-component-props':{
|
|
45
|
+
prefix: '青青草原羊村'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
demo6:{
|
|
49
|
+
type: 'number',
|
|
50
|
+
title: 'options传值',
|
|
51
|
+
'x-component':'Select',
|
|
52
|
+
'x-component-props':{
|
|
53
|
+
options: [{label: '熊大', value: 1}, {label: '熊二', value: 2}]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
demo7:{
|
|
57
|
+
type: 'number',
|
|
58
|
+
title: '默认值',
|
|
59
|
+
'x-component':'Select',
|
|
60
|
+
default: 1,
|
|
61
|
+
'x-component-props':{
|
|
62
|
+
options: [{label: '熊大', value: 1}, {label: '熊二', value: 2}]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
function getData(cmdname:string, done:any, params: any){
|
|
68
|
+
setTimeout(()=>{
|
|
69
|
+
done([{label: '喜羊羊', value: 1}, {label: '美羊羊', value: 2},{label: '懒羊羊', value: 3},{label: '沸羊羊', value: 4}])
|
|
70
|
+
},5000)
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style scoped>
|
|
75
|
+
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
import { ref } from 'vue';
|
|
9
|
+
const formData = ref({});
|
|
10
|
+
const schema = {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
name: {
|
|
14
|
+
type: 'void',
|
|
15
|
+
title: '姓名',
|
|
16
|
+
'x-decorator': 'FormItem',
|
|
17
|
+
'x-decorator-props': {
|
|
18
|
+
asterisk: true,
|
|
19
|
+
feedbackLayout: 'none',
|
|
20
|
+
},
|
|
21
|
+
'x-component': 'Space',
|
|
22
|
+
properties: {
|
|
23
|
+
firstName: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
'x-decorator': 'FormItem',
|
|
26
|
+
'x-component': 'Input',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
lastName: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
'x-decorator': 'FormItem',
|
|
32
|
+
'x-component': 'Input',
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
texts: {
|
|
38
|
+
type: 'void',
|
|
39
|
+
title: '文本串联',
|
|
40
|
+
'x-decorator': 'FormItem',
|
|
41
|
+
'x-decorator-props': {
|
|
42
|
+
asterisk: true,
|
|
43
|
+
feedbackLayout: 'none',
|
|
44
|
+
},
|
|
45
|
+
'x-component': 'Space',
|
|
46
|
+
properties: {
|
|
47
|
+
aa: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
'x-decorator': 'FormItem',
|
|
50
|
+
'x-decorator-props': {
|
|
51
|
+
addonAfter: '单位',
|
|
52
|
+
},
|
|
53
|
+
'x-component': 'Input',
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
bb: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
'x-decorator': 'FormItem',
|
|
59
|
+
'x-decorator-props': {
|
|
60
|
+
addonAfter: '单位',
|
|
61
|
+
},
|
|
62
|
+
'x-component': 'Input',
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
cc: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
'x-decorator': 'FormItem',
|
|
68
|
+
'x-decorator-props': {
|
|
69
|
+
addonAfter: '单位',
|
|
70
|
+
},
|
|
71
|
+
'x-component': 'Input',
|
|
72
|
+
required: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
textarea: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
title: '文本框',
|
|
80
|
+
'x-decorator': 'FormItem',
|
|
81
|
+
'x-component': 'Input.TextArea',
|
|
82
|
+
'x-component-props': {
|
|
83
|
+
style: {
|
|
84
|
+
width: 400,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
required: true,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
</script>
|
|
92
|
+
<style scoped>
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
const formData = ref({});
|
|
9
|
+
const schema = ref({
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties:{
|
|
12
|
+
demo1:{
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
title: '自动转换',
|
|
15
|
+
},
|
|
16
|
+
demo2:{
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
title: '显示',
|
|
19
|
+
'x-component': 'Switch'
|
|
20
|
+
},
|
|
21
|
+
demo3:{
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
title: 'tips',
|
|
24
|
+
'x-component': 'Switch',
|
|
25
|
+
description: '这是tips提示'
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
<style scoped>
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
const formData = ref({});
|
|
9
|
+
const schema = ref({
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties:{
|
|
12
|
+
demo1:{
|
|
13
|
+
type: 'void',
|
|
14
|
+
'x-component':'Text',
|
|
15
|
+
'x-component-props':{
|
|
16
|
+
text: '<h1>这是一个标签</h1>'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
demo2:{
|
|
20
|
+
type: 'void',
|
|
21
|
+
'x-component':'Text',
|
|
22
|
+
'x-component-props':{
|
|
23
|
+
text: '纯文字'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
demo3:{
|
|
27
|
+
type: 'void',
|
|
28
|
+
'x-component':'Text',
|
|
29
|
+
'x-component-props':{
|
|
30
|
+
text: '带颜色的文字',
|
|
31
|
+
color: '#fa5'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
<style scoped>
|
|
38
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
const formData = ref({});
|
|
9
|
+
const schema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
time: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
title: '时间',
|
|
15
|
+
'x-decorator': 'FormItem',
|
|
16
|
+
'x-component': 'TimePicker',
|
|
17
|
+
'x-component-props': {
|
|
18
|
+
style: {
|
|
19
|
+
width: '240px',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
'[startTime,endTime]': {
|
|
24
|
+
title: '时间范围',
|
|
25
|
+
'x-decorator': 'FormItem',
|
|
26
|
+
'x-component': 'TimePicker',
|
|
27
|
+
'x-component-props': {
|
|
28
|
+
isRange: true,
|
|
29
|
+
style: {
|
|
30
|
+
width: '240px',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
type: 'string',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
<style scoped>
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
const formData = ref({});
|
|
9
|
+
const schema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
transfer: {
|
|
13
|
+
type: 'array',
|
|
14
|
+
title: '穿梭框',
|
|
15
|
+
enum: [
|
|
16
|
+
{ label: '选项1', key: 1 },
|
|
17
|
+
{ label: '选项2', key: 2 },
|
|
18
|
+
],
|
|
19
|
+
'x-decorator': 'FormItem',
|
|
20
|
+
'x-component': 'Transfer',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
<style scoped>
|
|
26
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData" @fileUpload="handleFileUpload"></VueForm>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
const formData = ref({});
|
|
9
|
+
const schema = ref({
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties:{
|
|
12
|
+
demo1:{
|
|
13
|
+
type: 'string',
|
|
14
|
+
'x-component':'UploadButton',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
function handleFileUpload(file,done){
|
|
20
|
+
console.log(file);
|
|
21
|
+
setTimeout(()=>{
|
|
22
|
+
done('https://jtcospublic.ciccten.com/low-code/files/c3c3pg/logo%20%281%291660803134226.png')
|
|
23
|
+
},5000)
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
<style scoped>
|
|
27
|
+
</style>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<VueForm :schema="schema" v-model="formData"></VueForm>
|
|
4
|
+
<VueForm :schema="schema1" v-model="formData1"></VueForm>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref } from 'vue'
|
|
10
|
+
const formData = ref({});
|
|
11
|
+
const formData1 = ref({});
|
|
12
|
+
const schema = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
string_array: {
|
|
16
|
+
type: 'array',
|
|
17
|
+
'x-component': 'ArrayCards',
|
|
18
|
+
maxItems: 3,
|
|
19
|
+
'x-decorator': 'FormItem',
|
|
20
|
+
'x-component-props': {
|
|
21
|
+
},
|
|
22
|
+
title:'默认的按钮文案为:添加条目',
|
|
23
|
+
items: {
|
|
24
|
+
type: 'void',
|
|
25
|
+
properties: {
|
|
26
|
+
index: {
|
|
27
|
+
type: 'void',
|
|
28
|
+
'x-component': 'ArrayCards.Index',
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
'x-decorator': 'FormItem',
|
|
33
|
+
title: 'Input',
|
|
34
|
+
required: true,
|
|
35
|
+
'x-component': 'Input',
|
|
36
|
+
},
|
|
37
|
+
remove: {
|
|
38
|
+
type: 'void',
|
|
39
|
+
'x-component': 'ArrayCards.Remove',
|
|
40
|
+
},
|
|
41
|
+
moveUp: {
|
|
42
|
+
type: 'void',
|
|
43
|
+
'x-component': 'ArrayCards.MoveUp',
|
|
44
|
+
},
|
|
45
|
+
moveDown: {
|
|
46
|
+
type: 'void',
|
|
47
|
+
'x-component': 'ArrayCards.MoveDown',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const schema1 = {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
string_array: {
|
|
58
|
+
type: 'array',
|
|
59
|
+
'x-component': 'ArrayCards',
|
|
60
|
+
maxItems: 3,
|
|
61
|
+
'x-decorator': 'FormItem',
|
|
62
|
+
'x-component-props': {
|
|
63
|
+
},
|
|
64
|
+
title:'成功更改按钮文案:添加Item',
|
|
65
|
+
items: {
|
|
66
|
+
type: 'void',
|
|
67
|
+
properties: {
|
|
68
|
+
index: {
|
|
69
|
+
type: 'void',
|
|
70
|
+
'x-component': 'ArrayCards.Index',
|
|
71
|
+
},
|
|
72
|
+
input: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
'x-decorator': 'FormItem',
|
|
75
|
+
title: 'Input',
|
|
76
|
+
required: true,
|
|
77
|
+
'x-component': 'Input',
|
|
78
|
+
},
|
|
79
|
+
remove: {
|
|
80
|
+
type: 'void',
|
|
81
|
+
'x-component': 'ArrayCards.Remove',
|
|
82
|
+
},
|
|
83
|
+
moveUp: {
|
|
84
|
+
type: 'void',
|
|
85
|
+
'x-component': 'ArrayCards.MoveUp',
|
|
86
|
+
},
|
|
87
|
+
moveDown: {
|
|
88
|
+
type: 'void',
|
|
89
|
+
'x-component': 'ArrayCards.MoveDown',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
'x-data':{
|
|
93
|
+
addButtonTitle:'添加Item',
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
</script>
|
|
100
|
+
<style scoped>
|
|
101
|
+
</style>
|