@houaoran/designer 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.
Files changed (126) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/components.es.js +11424 -0
  4. package/dist/components.umd.js +878 -0
  5. package/dist/index.es.js +39113 -0
  6. package/dist/index.umd.js +1187 -0
  7. package/package.json +96 -0
  8. package/src/components/DragBox.vue +49 -0
  9. package/src/components/DragTool.vue +235 -0
  10. package/src/components/EventConfig.vue +557 -0
  11. package/src/components/FcDesigner.vue +2569 -0
  12. package/src/components/FcTitle.vue +69 -0
  13. package/src/components/FetchConfig.vue +415 -0
  14. package/src/components/FieldInput.vue +371 -0
  15. package/src/components/FnConfig.vue +315 -0
  16. package/src/components/FnEditor.vue +327 -0
  17. package/src/components/FnInput.vue +103 -0
  18. package/src/components/FormLabel.vue +47 -0
  19. package/src/components/HtmlEditor.vue +125 -0
  20. package/src/components/JsonPreview.vue +146 -0
  21. package/src/components/OptionsTextInput.vue +151 -0
  22. package/src/components/PropsInput.vue +72 -0
  23. package/src/components/Required.vue +75 -0
  24. package/src/components/Row.vue +26 -0
  25. package/src/components/SignaturePad.vue +176 -0
  26. package/src/components/Struct.vue +153 -0
  27. package/src/components/StructEditor.vue +121 -0
  28. package/src/components/StructTree.vue +209 -0
  29. package/src/components/TableOptions.vue +164 -0
  30. package/src/components/TreeOptions.vue +167 -0
  31. package/src/components/TypeSelect.vue +144 -0
  32. package/src/components/Validate.vue +302 -0
  33. package/src/components/ValueInput.vue +89 -0
  34. package/src/components/Warning.vue +46 -0
  35. package/src/components/ai/AiPanel.vue +1122 -0
  36. package/src/components/ai/MarkdownRenderer.vue +548 -0
  37. package/src/components/language/LanguageConfig.vue +174 -0
  38. package/src/components/language/LanguageInput.vue +191 -0
  39. package/src/components/style/BackgroundInput.vue +315 -0
  40. package/src/components/style/BorderInput.vue +242 -0
  41. package/src/components/style/BoxSizeInput.vue +166 -0
  42. package/src/components/style/BoxSpaceInput.vue +269 -0
  43. package/src/components/style/ColorInput.vue +90 -0
  44. package/src/components/style/ConfigItem.vue +118 -0
  45. package/src/components/style/FontInput.vue +197 -0
  46. package/src/components/style/PositionInput.vue +146 -0
  47. package/src/components/style/RadiusInput.vue +164 -0
  48. package/src/components/style/ShadowContent.vue +335 -0
  49. package/src/components/style/ShadowInput.vue +91 -0
  50. package/src/components/style/SizeInput.vue +118 -0
  51. package/src/components/style/StyleConfig.vue +307 -0
  52. package/src/components/table/Table.vue +252 -0
  53. package/src/components/table/TableView.vue +1058 -0
  54. package/src/components/tableForm/TableForm.vue +471 -0
  55. package/src/components/tableForm/TableFormColumnView.vue +103 -0
  56. package/src/components/tableForm/TableFormView.vue +46 -0
  57. package/src/components/tree/FcTree.vue +713 -0
  58. package/src/components/tree/FcTreeNode.vue +216 -0
  59. package/src/config/base/field.js +43 -0
  60. package/src/config/base/form.js +132 -0
  61. package/src/config/base/style.js +26 -0
  62. package/src/config/base/validate.js +15 -0
  63. package/src/config/index.js +70 -0
  64. package/src/config/menu.js +24 -0
  65. package/src/config/rule/alert.js +45 -0
  66. package/src/config/rule/button.js +49 -0
  67. package/src/config/rule/card.js +40 -0
  68. package/src/config/rule/cascader.js +121 -0
  69. package/src/config/rule/checkbox.js +68 -0
  70. package/src/config/rule/col.js +86 -0
  71. package/src/config/rule/collapse.js +30 -0
  72. package/src/config/rule/collapseItem.js +36 -0
  73. package/src/config/rule/color.js +53 -0
  74. package/src/config/rule/date.js +66 -0
  75. package/src/config/rule/dateRange.js +60 -0
  76. package/src/config/rule/divider.js +31 -0
  77. package/src/config/rule/editor.js +31 -0
  78. package/src/config/rule/group.js +86 -0
  79. package/src/config/rule/html.js +43 -0
  80. package/src/config/rule/image.js +32 -0
  81. package/src/config/rule/input.js +62 -0
  82. package/src/config/rule/number.js +49 -0
  83. package/src/config/rule/password.js +52 -0
  84. package/src/config/rule/radio.js +43 -0
  85. package/src/config/rule/rate.js +44 -0
  86. package/src/config/rule/row.js +46 -0
  87. package/src/config/rule/select.js +70 -0
  88. package/src/config/rule/signaturePad.js +59 -0
  89. package/src/config/rule/slider.js +53 -0
  90. package/src/config/rule/space.js +44 -0
  91. package/src/config/rule/subForm.js +47 -0
  92. package/src/config/rule/switch.js +46 -0
  93. package/src/config/rule/tabPane.js +29 -0
  94. package/src/config/rule/table.js +37 -0
  95. package/src/config/rule/tableForm.js +115 -0
  96. package/src/config/rule/tableFormColumn.js +55 -0
  97. package/src/config/rule/tabs.js +38 -0
  98. package/src/config/rule/tag.js +69 -0
  99. package/src/config/rule/text.js +41 -0
  100. package/src/config/rule/textarea.js +63 -0
  101. package/src/config/rule/time.js +58 -0
  102. package/src/config/rule/timeRange.js +49 -0
  103. package/src/config/rule/title.js +37 -0
  104. package/src/config/rule/transfer.js +59 -0
  105. package/src/config/rule/tree.js +70 -0
  106. package/src/config/rule/treeSelect.js +77 -0
  107. package/src/config/rule/upload.js +107 -0
  108. package/src/form/index.js +19 -0
  109. package/src/index.js +173 -0
  110. package/src/locale/en.js +981 -0
  111. package/src/locale/zh-cn.js +983 -0
  112. package/src/style/fonts/fc-icons.woff +0 -0
  113. package/src/style/icon.css +1052 -0
  114. package/src/style/index.css +836 -0
  115. package/src/utils/form.js +9 -0
  116. package/src/utils/highlight/highlight.min.js +307 -0
  117. package/src/utils/highlight/javascript.min.js +80 -0
  118. package/src/utils/highlight/style.css +1 -0
  119. package/src/utils/highlight/xml.min.js +29 -0
  120. package/src/utils/hintStubs.js +120 -0
  121. package/src/utils/index.js +544 -0
  122. package/src/utils/jsonDiff.js +173 -0
  123. package/src/utils/locale.js +23 -0
  124. package/src/utils/message.js +19 -0
  125. package/src/utils/template.js +105 -0
  126. package/types/index.d.ts +575 -0
@@ -0,0 +1,43 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = 'HTML';
4
+ const name = 'html';
5
+
6
+ export default {
7
+ menu: 'aide',
8
+ icon: 'icon-html',
9
+ label,
10
+ name,
11
+ rule() {
12
+ return {
13
+ type: name,
14
+ title: '',
15
+ native: true,
16
+ attrs: {
17
+ innerHTML: ''
18
+ },
19
+ style: {
20
+ display: 'block',
21
+ width: '100%',
22
+ },
23
+ children: ['<div style="color:blue;">\n' +
24
+ ' html html html html html html html html html\n' +
25
+ ' </div>'],
26
+ };
27
+ },
28
+ watch: {
29
+ formCreateNative({value, rule}) {
30
+ if (value) {
31
+ rule.title = '';
32
+ }
33
+ }
34
+ },
35
+ props(_, {t}) {
36
+ return localeProps(t, name + '.props', [
37
+ {
38
+ type: 'HtmlEditor',
39
+ field: 'formCreateChild',
40
+ }
41
+ ]);
42
+ }
43
+ };
@@ -0,0 +1,32 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = '图片';
4
+ const name = 'elImage';
5
+
6
+ export default {
7
+ menu: 'aide',
8
+ icon: 'icon-image',
9
+ label,
10
+ name,
11
+ rule() {
12
+ return {
13
+ type: name,
14
+ title: '',
15
+ style: {
16
+ width: '100px',
17
+ height: '100px',
18
+ },
19
+ props: {
20
+ src: 'https://static.form-create.com/example.png',
21
+ }
22
+ };
23
+ },
24
+ props(_, {t}) {
25
+ return localeProps(t, name + '.props', [
26
+ {
27
+ type: 'input',
28
+ field: 'src',
29
+ }
30
+ ]);
31
+ }
32
+ };
@@ -0,0 +1,62 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeOptions, localeProps} from '../../utils';
3
+
4
+ const label = '输入框';
5
+ const name = 'input';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-input',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['blur', 'focus', 'change', 'input', 'clear'],
14
+ validate: ['string', 'url', 'email'],
15
+ rule({t}) {
16
+ return {
17
+ type: name,
18
+ field: uniqueId(),
19
+ title: t('com.input.name'),
20
+ info: '',
21
+ $required: false,
22
+ props: {}
23
+ };
24
+ },
25
+ props(_, {t}) {
26
+ return localeProps(t, name + '.props', [
27
+ {
28
+ type: 'switch',
29
+ field: 'disabled'
30
+ },
31
+ {
32
+ type: 'switch',
33
+ field: 'readonly'
34
+ },
35
+ {
36
+ type: 'select',
37
+ field: 'type',
38
+ options: localeOptions(t, [
39
+ {label: 'text', value: 'text'},
40
+ {label: 'number', value: 'number'},
41
+ {label: 'time', value: 'time'},
42
+ {label: 'date', value: 'date'},
43
+ {label: 'month', value: 'month'},
44
+ {label: 'datetime-local', value: 'datetime-local'},
45
+ ])
46
+ },
47
+ {
48
+ type: 'inputNumber',
49
+ field: 'maxlength',
50
+ props: {min: 0}
51
+ },
52
+ {
53
+ type: 'input',
54
+ field: 'placeholder'
55
+ },
56
+ {
57
+ type: 'switch',
58
+ field: 'clearable'
59
+ },
60
+ ]);
61
+ }
62
+ };
@@ -0,0 +1,49 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeOptions, localeProps} from '../../utils';
3
+
4
+ const label = '计数器';
5
+ const name = 'inputNumber';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-number',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['blur', 'focus', 'change'],
14
+ validate: ['number', 'integer', 'float'],
15
+ rule({t}) {
16
+ return {
17
+ type: name,
18
+ field: uniqueId(),
19
+ title: t('com.inputNumber.name'),
20
+ info: '',
21
+ $required: false,
22
+ props: {}
23
+ };
24
+ },
25
+ props(_, {t}) {
26
+ return localeProps(t, name + '.props', [{type: 'switch', field: 'disabled'}, {
27
+ type: 'inputNumber',
28
+ field: 'min'
29
+ }, {
30
+ type: 'inputNumber',
31
+ field: 'max',
32
+ }, {
33
+ type: 'inputNumber',
34
+ title: 'precision',
35
+ field: 'precision',
36
+ }, {type: 'inputNumber', field: 'step', props: {min: 0}}, {
37
+ type: 'switch',
38
+ field: 'stepStrictly'
39
+ }, {
40
+ type: 'switch',
41
+ field: 'controls',
42
+ value: true
43
+ }, {
44
+ type: 'select',
45
+ field: 'controlsPosition',
46
+ options: localeOptions(t, [{label: 'default', value: ''}, {label: 'right', value: 'right'}])
47
+ }, {type: 'input', field: 'placeholder'}]);
48
+ }
49
+ };
@@ -0,0 +1,52 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeProps} from '../../utils';
3
+
4
+ const label = '密码输入框';
5
+ const name = 'password';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-password',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['blur', 'focus', 'change', 'input', 'clear'],
14
+ validate: ['string'],
15
+ rule({t}) {
16
+ return {
17
+ type: 'input',
18
+ field: uniqueId(),
19
+ title: t('com.password.name'),
20
+ info: '',
21
+ $required: false,
22
+ props: {
23
+ type: 'password'
24
+ }
25
+ };
26
+ },
27
+ props(_, {t}) {
28
+ return localeProps(t, name + '.props', [
29
+ {
30
+ type: 'switch',
31
+ field: 'disabled'
32
+ },
33
+ {
34
+ type: 'switch',
35
+ field: 'readonly'
36
+ },
37
+ {
38
+ type: 'inputNumber',
39
+ field: 'maxlength',
40
+ props: {min: 0}
41
+ },
42
+ {
43
+ type: 'input',
44
+ field: 'placeholder'
45
+ },
46
+ {
47
+ type: 'switch',
48
+ field: 'clearable'
49
+ },
50
+ ]);
51
+ }
52
+ };
@@ -0,0 +1,43 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeProps, makeOptionsRule, makeTreeOptions} from '../../utils/index';
3
+
4
+ const label = '单选框';
5
+ const name = 'radio';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-radio',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change'],
14
+ validate: ['string', 'number'],
15
+ rule({t}) {
16
+ return {
17
+ type: name,
18
+ field: uniqueId(),
19
+ title: t('com.radio.name'),
20
+ info: '',
21
+ effect: {
22
+ fetch: ''
23
+ },
24
+ $required: false,
25
+ props: {},
26
+ options: makeTreeOptions(t('props.option'), {label: 'label', value: 'value'}, 1)
27
+ };
28
+ },
29
+ props(_, {t}) {
30
+ return localeProps(t, name + '.props', [
31
+ makeOptionsRule(t, 'options'),
32
+ {type: 'switch', field: 'disabled'},
33
+ {type: 'switch', field: 'input'},
34
+ {
35
+ type: 'switch',
36
+ field: 'type',
37
+ props: {activeValue: 'button', inactiveValue: 'default'}
38
+ }, {type: 'ColorInput', field: 'textColor'}, {
39
+ type: 'ColorInput',
40
+ field: 'fill'
41
+ }]);
42
+ }
43
+ };
@@ -0,0 +1,44 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeProps} from '../../utils';
3
+
4
+ const label = '评分';
5
+ const name = 'rate';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-rate',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change'],
14
+ validate: ['number'],
15
+ rule({t}) {
16
+ return {
17
+ type: name,
18
+ field: uniqueId(),
19
+ title: t('com.rate.name'),
20
+ info: '',
21
+ $required: false,
22
+ props: {},
23
+ };
24
+ },
25
+ props(_, {t}) {
26
+ return localeProps(t, name + '.props', [
27
+ {type: 'inputNumber', field: 'max', props: {min: 0}}, {
28
+ type: 'switch',
29
+ field: 'disabled'
30
+ }, {type: 'switch', field: 'allowHalf'}, {
31
+ type: 'ColorInput',
32
+ field: 'voidColor'
33
+ }, {type: 'ColorInput', field: 'disabledVoidColor'}, {
34
+ type: 'input',
35
+ field: 'voidIconClass'
36
+ }, {type: 'input', field: 'disabledVoidIconClass'}, {
37
+ type: 'switch',
38
+ field: 'showScore'
39
+ }, {type: 'ColorInput', field: 'textColor'}, {
40
+ type: 'input',
41
+ field: 'scoreTemplate'
42
+ }]);
43
+ }
44
+ };
@@ -0,0 +1,46 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = '栅格布局';
4
+ const name = 'fcRow';
5
+
6
+ export default {
7
+ menu: 'layout',
8
+ icon: 'icon-row',
9
+ label,
10
+ name,
11
+ mask: false,
12
+ children: 'col',
13
+ childrenLen: 2,
14
+ rule() {
15
+ return {
16
+ type: name,
17
+ props: {},
18
+ children: []
19
+ };
20
+ },
21
+ props(_, {t}) {
22
+ return localeProps(t, name + '.props', [{
23
+ type: 'inputNumber',
24
+ field: 'gutter',
25
+ props: {min: 0}
26
+ }, {
27
+ type: 'switch',
28
+ field: 'type',
29
+ props: {activeValue: 'flex', inactiveValue: 'default'}
30
+ }, {
31
+ type: 'select',
32
+ field: 'justify',
33
+ options: [{label: 'start', value: 'start'}, {label: 'end', value: 'end'}, {
34
+ label: 'center',
35
+ value: 'center'
36
+ }, {label: 'space-around', value: 'space-around'}, {label: 'space-between', value: 'space-between'}]
37
+ }, {
38
+ type: 'select',
39
+ field: 'align',
40
+ options: [{label: 'top', value: 'top'}, {label: 'middle', value: 'middle'}, {
41
+ label: 'bottom',
42
+ value: 'bottom'
43
+ }]
44
+ }]);
45
+ }
46
+ };
@@ -0,0 +1,70 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {getInjectArg, localeProps, makeOptionsRule, makeTreeOptions} from '../../utils/index';
3
+
4
+ const label = '选择器';
5
+ const name = 'select';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-select',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change', 'visibleChange', 'removeTag', 'clear', 'blur', 'focus'],
14
+ validate: ['string', 'number', 'array'],
15
+ rule({t}) {
16
+ return {
17
+ type: name,
18
+ field: uniqueId(),
19
+ title: t('com.select.name'),
20
+ info: '',
21
+ effect: {
22
+ fetch: ''
23
+ },
24
+ $required: false,
25
+ props: {},
26
+ options: makeTreeOptions(t('props.option'), {label: 'label', value: 'value'}, 1)
27
+ };
28
+ },
29
+ watch: {
30
+ multiple({rule}) {
31
+ rule.key = uniqueId();
32
+ }
33
+ },
34
+ props(_, {t}) {
35
+ return localeProps(t, name + '.props', [
36
+ makeOptionsRule(t, 'options'),
37
+ {type: 'switch', field: 'multiple'}, {
38
+ type: 'switch',
39
+ field: 'disabled'
40
+ }, {type: 'switch', field: 'clearable'}, {
41
+ type: 'switch',
42
+ field: 'collapseTags'
43
+ }, {
44
+ type: 'inputNumber',
45
+ field: 'multipleLimit',
46
+ props: {min: 0}
47
+ }, {type: 'input', field: 'placeholder'}, {
48
+ type: 'switch',
49
+ field: 'filterable'
50
+ }, {
51
+ type: 'switch',
52
+ field: 'remote',
53
+ }, {
54
+ type: 'FnInput',
55
+ field: 'remoteMethod',
56
+ props: {
57
+ body: true,
58
+ fnx: true,
59
+ name: 'remoteMethod',
60
+ args: [getInjectArg(t)],
61
+ },
62
+ }, {type: 'switch', field: 'allowCreate'}, {
63
+ type: 'input',
64
+ field: 'noMatchText'
65
+ }, {type: 'input', field: 'noDataText'}, {
66
+ type: 'switch',
67
+ field: 'reserveKeyword'
68
+ }, {type: 'switch', field: 'defaultFirstOption'}])
69
+ }
70
+ };
@@ -0,0 +1,59 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {getInjectArg, localeProps} from '../../utils';
3
+
4
+ const label = '手写签名';
5
+ const name = 'signaturePad';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-sign',
10
+ label: label,
11
+ name: name,
12
+ input: true,
13
+ mask: true,
14
+ languageKey: ['signaturePadTip', 'signaturePadTitle', 'reset', 'ok'],
15
+ event: ['change', 'remove'],
16
+ rule({t}) {
17
+ return {
18
+ type: name,
19
+ field: uniqueId(),
20
+ title: t('com.signaturePad.name'),
21
+ info: '',
22
+ $required: false,
23
+ props: {},
24
+ };
25
+ },
26
+ props(_, {t}) {
27
+ return localeProps(t, name + '.props', [
28
+ {
29
+ type: 'input',
30
+ field: 'tip',
31
+ },
32
+ {
33
+ type: 'input',
34
+ field: 'padTitle',
35
+ },
36
+ {
37
+ type: 'ColorInput',
38
+ field: 'penColor',
39
+ },
40
+ {
41
+ type: 'switch',
42
+ field: 'disabled',
43
+ },
44
+ {
45
+ type: 'FnInput',
46
+ field: 'beforeRemove',
47
+ warning: t('com.signaturePad.info'),
48
+ props: {
49
+ body: true,
50
+ button: true,
51
+ fnx: true,
52
+ args: [getInjectArg(t)],
53
+ name: 'beforeRemove',
54
+ }
55
+ },
56
+ ]);
57
+ },
58
+ };
59
+
@@ -0,0 +1,53 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeProps} from '../../utils';
3
+
4
+ const label = '滑块';
5
+ const name = 'slider';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-slider',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change', 'input'],
14
+ validate: ['number', 'array'],
15
+ rule({t}) {
16
+ return {
17
+ type: name,
18
+ field: uniqueId(),
19
+ title: t('com.slider.name'),
20
+ info: '',
21
+ $required: false,
22
+ props: {},
23
+ };
24
+ },
25
+ props(_, {t}) {
26
+ return localeProps(t, name + '.props', [{type: 'switch', field: 'disabled'}, {
27
+ type: 'switch',
28
+ field: 'range'
29
+ }, {
30
+ type: 'inputNumber',
31
+ field: 'min',
32
+ props: {min: 0}
33
+ }, {
34
+ type: 'inputNumber',
35
+ field: 'max',
36
+ props: {min: 0},
37
+ }, {
38
+ type: 'inputNumber',
39
+ field: 'step',
40
+ props: {min: 0},
41
+ }, {type: 'switch', field: 'showInput'}, {
42
+ type: 'switch',
43
+ field: 'showInputControls',
44
+ value: true
45
+ }, {type: 'switch', field: 'showStops'}, {
46
+ type: 'switch',
47
+ field: 'vertical'
48
+ }, {
49
+ type: 'input',
50
+ field: 'height'
51
+ }]);
52
+ }
53
+ };
@@ -0,0 +1,44 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = '间距';
4
+ const name = 'space';
5
+
6
+ export default {
7
+ menu: 'layout',
8
+ icon: 'icon-space',
9
+ label,
10
+ name,
11
+ rule() {
12
+ return {
13
+ type: 'div',
14
+ wrap: {
15
+ show: false
16
+ },
17
+ native: true,
18
+ style: {
19
+ width: '100%',
20
+ height: '20px',
21
+ },
22
+ children: []
23
+ };
24
+ },
25
+ props(_, {t}) {
26
+ return [
27
+ {
28
+ type: 'object',
29
+ field: 'formCreateStyle',
30
+ native: true,
31
+ props: {
32
+ rule: localeProps(t, name + '.props', [
33
+ {
34
+ type: 'input',
35
+ field: 'height',
36
+ title: 'height',
37
+ },
38
+ ])
39
+ }
40
+ }
41
+
42
+ ];
43
+ }
44
+ };
@@ -0,0 +1,47 @@
1
+ import {localeProps} from '../../utils';
2
+ import uniqueId from '@form-create/utils/lib/unique';
3
+
4
+ const label = '分组';
5
+ const name = 'subForm';
6
+
7
+ export default {
8
+ menu: 'subform',
9
+ icon: 'icon-group',
10
+ label,
11
+ name,
12
+ inside: false,
13
+ drag: true,
14
+ dragBtn: true,
15
+ mask: false,
16
+ input: true,
17
+ subForm: 'object',
18
+ event: ['change'],
19
+ loadRule(rule) {
20
+ rule.children = rule.props.rule || [];
21
+ rule.type = 'FcRow';
22
+ delete rule.props.rule;
23
+ },
24
+ parseRule(rule) {
25
+ rule.props.rule = rule.children;
26
+ rule.type = 'subForm';
27
+ delete rule.children;
28
+ },
29
+ rule({t}) {
30
+ return {
31
+ type: 'fcRow',
32
+ field: uniqueId(),
33
+ title: t('com.subForm.name'),
34
+ info: '',
35
+ $required: false,
36
+ props: {},
37
+ children: []
38
+ };
39
+ },
40
+ props(_, {t}) {
41
+ return localeProps(t, name + '.props', [{
42
+ type: 'switch',
43
+ field: 'disabled'
44
+ }, {type: 'switch', field: 'syncDisabled', value: true},
45
+ ]);
46
+ }
47
+ };