@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,46 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeProps} from '../../utils';
3
+
4
+ const label = '开关';
5
+ const name = 'switch';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-switch',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change'],
14
+ rule({t}) {
15
+ return {
16
+ type: name,
17
+ field: uniqueId(),
18
+ title: t('com.switch.name'),
19
+ info: '',
20
+ $required: false,
21
+ props: {
22
+ activeValue: true,
23
+ inactiveValue: false,
24
+ },
25
+ };
26
+ },
27
+ props(_, {t}) {
28
+ return localeProps(t, name + '.props', [{
29
+ type: 'switch',
30
+ field: 'disabled'
31
+ }, {
32
+ type: 'inputNumber',
33
+ field: 'width',
34
+ props: {min: 0},
35
+ }, {type: 'input', field: 'activeText'}, {
36
+ type: 'input',
37
+ field: 'inactiveText'
38
+ }, {type: 'ValueInput', field: 'activeValue'}, {
39
+ type: 'ValueInput',
40
+ field: 'inactiveValue'
41
+ }, {type: 'ColorInput', field: 'activeColor'}, {
42
+ type: 'ColorInput',
43
+ field: 'inactiveColor'
44
+ }]);
45
+ }
46
+ };
@@ -0,0 +1,29 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = '选项卡';
4
+ const name = 'elTabPane';
5
+
6
+ export default {
7
+ label,
8
+ name,
9
+ inside: true,
10
+ drag: true,
11
+ dragBtn: false,
12
+ mask: false,
13
+ rule({t}) {
14
+ return {
15
+ type: name,
16
+ props: {label: t('com.elTabPane.name')},
17
+ children: []
18
+ };
19
+ },
20
+ props(_, {t}) {
21
+ return localeProps(t, name + '.props', [{type: 'input', field: 'label'}, {
22
+ type: 'switch',
23
+ field: 'disabled'
24
+ }, {type: 'input', field: 'name'}, {
25
+ type: 'switch',
26
+ field: 'lazy'
27
+ }]);
28
+ }
29
+ };
@@ -0,0 +1,37 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = '表格布局';
4
+ const name = 'fcTable';
5
+
6
+ export default {
7
+ menu: 'layout',
8
+ icon: 'icon-table',
9
+ label,
10
+ name,
11
+ inside: false,
12
+ mask: false,
13
+ rule() {
14
+ return {
15
+ type: name,
16
+ props: {
17
+ rule: {
18
+ row: 3,
19
+ col: 4,
20
+ style: {},
21
+ class: {},
22
+ layout: []
23
+ }
24
+ },
25
+ children: []
26
+ };
27
+ },
28
+ props(_, {t}) {
29
+ return localeProps(t, name + '.props', [
30
+ {type: 'switch', field: 'border', value: true},
31
+ {type: 'switch', field: 'mini'},
32
+ {type: 'switch', field: 'formStyle'},
33
+ {type: 'ColorInput', field: 'borderColor'},
34
+ {type: 'input', field: 'borderWidth'},
35
+ ]);
36
+ }
37
+ };
@@ -0,0 +1,115 @@
1
+ import unique from '@form-create/utils/lib/unique';
2
+ import {getInjectArg, localeProps} from '../../utils';
3
+
4
+ const label = '表格表单';
5
+ const name = 'tableForm';
6
+
7
+ export default {
8
+ menu: 'subform',
9
+ icon: 'icon-table-form',
10
+ label,
11
+ name,
12
+ mask: false,
13
+ input: true,
14
+ subForm: 'array',
15
+ languageKey: ['add', 'operation', 'dataEmpty'],
16
+ event: ['change', 'add', 'delete'],
17
+ children: 'tableFormColumn',
18
+ loadRule(rule) {
19
+ if (!rule.props) rule.props = {};
20
+ const columns = rule.props.columns || [];
21
+ rule.children = columns.map(column => {
22
+ return {
23
+ type: 'tableFormColumn',
24
+ _fc_drag_tag: 'tableFormColumn',
25
+ props: {
26
+ label: column.label,
27
+ align: column.align,
28
+ required: column.required || false,
29
+ hidden: column.hidden || false,
30
+ width: column.style.width || '',
31
+ color: column.style.color || '',
32
+ },
33
+ children: column.rule || [],
34
+ };
35
+ });
36
+ delete rule.props.columns;
37
+ },
38
+ parseRule(rule) {
39
+ const children = rule.children || [];
40
+ rule.props.columns = children.map(column => {
41
+ return {
42
+ label: column.props.label,
43
+ required: column.props.required,
44
+ hidden: column.hidden,
45
+ align: column.props.align,
46
+ style: {
47
+ width: column.props.width,
48
+ color: column.props.color,
49
+ },
50
+ rule: column.children || [],
51
+ };
52
+ });
53
+ rule.children = [];
54
+ },
55
+ rule({t}) {
56
+ return {
57
+ type: name,
58
+ field: unique(),
59
+ title: t('com.tableForm.name'),
60
+ info: '',
61
+ props: {},
62
+ children: [],
63
+ };
64
+ },
65
+ props(_, {t}) {
66
+ return localeProps(t, name + '.props', [
67
+ {
68
+ type: 'switch',
69
+ field: 'disabled',
70
+ },
71
+ {
72
+ type: 'switch',
73
+ field: 'addable',
74
+ value: true,
75
+ },
76
+ {
77
+ type: 'switch',
78
+ field: 'deletable',
79
+ value: true,
80
+ },
81
+ {
82
+ type: 'switch',
83
+ field: 'showIndex',
84
+ value: true,
85
+ },
86
+ {
87
+ type: 'FnInput',
88
+ field: 'beforeRemove',
89
+ warning: t('com.tableForm.info'),
90
+ props: {
91
+ body: true,
92
+ button: true,
93
+ fnx: true,
94
+ args: [getInjectArg(t)],
95
+ name: 'beforeRemove',
96
+ },
97
+ },
98
+ {
99
+ type: 'switch',
100
+ field: 'filterEmptyColumn',
101
+ value: true,
102
+ },
103
+ {
104
+ type: 'inputNumber',
105
+ field: 'min',
106
+ props: {min: 0},
107
+ },
108
+ {
109
+ type: 'inputNumber',
110
+ field: 'max',
111
+ props: {min: 0},
112
+ },
113
+ ]);
114
+ },
115
+ };
@@ -0,0 +1,55 @@
1
+ import {localeProps, localeOptions} from '../../utils';
2
+
3
+ const name = 'tableFormColumn';
4
+
5
+ export default {
6
+ icon: 'icon-cell',
7
+ name,
8
+ aide: true,
9
+ drag: true,
10
+ dragBtn: false,
11
+ mask: false,
12
+ style: false,
13
+ rule({t}) {
14
+ return {
15
+ type: name,
16
+ props: {
17
+ label: t('com.tableFormColumn.label'),
18
+ width: 'auto',
19
+ },
20
+ children: [],
21
+ };
22
+ },
23
+ props(_, {t}) {
24
+ return localeProps(t, name + '.props', [
25
+ {
26
+ type: 'input',
27
+ field: 'label',
28
+ },
29
+ {
30
+ type: 'select',
31
+ field: 'align',
32
+ options: localeOptions(t, [
33
+ {label: 'left', value: 'left'},
34
+ {label: 'center', value: 'center'},
35
+ {
36
+ label: 'right',
37
+ value: 'right',
38
+ },
39
+ ]),
40
+ },
41
+ {
42
+ type: 'switch',
43
+ field: 'required',
44
+ },
45
+ {
46
+ type: 'input',
47
+ field: 'width',
48
+ },
49
+ {
50
+ type: 'ColorInput',
51
+ field: 'color',
52
+ },
53
+ ]);
54
+ },
55
+ };
@@ -0,0 +1,38 @@
1
+ import {localeOptions, localeProps} from '../../utils';
2
+
3
+ const label = '标签页';
4
+ const name = 'elTabs';
5
+
6
+ export default {
7
+ menu: 'layout',
8
+ icon: 'icon-tab',
9
+ label,
10
+ name,
11
+ mask: false,
12
+ event: ['tabClick', 'tabChange', 'tabRemove', 'tabAdd', 'edit'],
13
+ children: 'elTabPane',
14
+ rule() {
15
+ return {
16
+ type: name,
17
+ style: {width: '100%'},
18
+ children: []
19
+ };
20
+ },
21
+ props(_, {t}) {
22
+ return localeProps(t, name + '.props', [{
23
+ type: 'select',
24
+ field: 'type',
25
+ options: [{
26
+ label: 'card',
27
+ value: 'card'
28
+ }, {label: 'border-card', value: 'border-card'}]
29
+ }, {type: 'switch', field: 'closable'}, {
30
+ type: 'select',
31
+ field: 'tabPosition',
32
+ options: localeOptions(t, [{label: 'top', value: 'top'}, {label: 'right', value: 'right'}, {
33
+ label: 'left',
34
+ value: 'left'
35
+ }])
36
+ }, {type: 'switch', field: 'stretch'}]);
37
+ }
38
+ };
@@ -0,0 +1,69 @@
1
+ import {localeOptions, localeProps} from '../../utils';
2
+
3
+ const label = '标签';
4
+ const name = 'elTag';
5
+
6
+ export default {
7
+ menu: 'aide',
8
+ icon: 'icon-tag',
9
+ label,
10
+ name,
11
+ mask: true,
12
+ event: ['click', 'close'],
13
+ rule({t}) {
14
+ return {
15
+ type: name,
16
+ title: '',
17
+ native: true,
18
+ children: [t('com.elTag.name')]
19
+ };
20
+ },
21
+ watch: {
22
+ formCreateNative({value, rule}) {
23
+ if (value) {
24
+ rule.title = '';
25
+ }
26
+ }
27
+ },
28
+ props(_, {t}) {
29
+ return localeProps(t, name + '.props', [
30
+ {
31
+ type: 'input',
32
+ field: 'formCreateChild'
33
+ }, {
34
+ type: 'select',
35
+ field: 'type',
36
+ options: [{label: 'primary', value: 'primary'}, {
37
+ label: 'success',
38
+ value: 'success'
39
+ }, {label: 'warning', value: 'warning'}, {label: 'danger', value: 'danger'}, {
40
+ label: 'info',
41
+ value: 'info'
42
+ }]
43
+ }, {
44
+ type: 'select',
45
+ field: 'size',
46
+ options: localeOptions(t, [{label: 'large', value: 'large'}, {
47
+ label: 'default',
48
+ value: 'default'
49
+ }, {label: 'small', value: 'small'}])
50
+ }, {
51
+ type: 'select',
52
+ field: 'effect',
53
+ options: [{label: 'dark', value: 'dark'}, {
54
+ label: 'light',
55
+ value: 'light'
56
+ }, {label: 'plain', value: 'plain'}]
57
+ }, {
58
+ type: 'switch', field: 'closable'
59
+ }, {
60
+ type: 'switch', field: 'disableTransitions'
61
+ }, {
62
+ type: 'switch', field: 'hit'
63
+ }, {
64
+ type: 'switch', field: 'round'
65
+ }, {
66
+ type: 'ColorInput', field: 'color'
67
+ }]);
68
+ }
69
+ };
@@ -0,0 +1,41 @@
1
+ import {localeProps} from '../../utils';
2
+
3
+ const label = '文字';
4
+ const name = 'text';
5
+
6
+ export default {
7
+ menu: 'aide',
8
+ icon: 'icon-span',
9
+ label,
10
+ name,
11
+ rule({t}) {
12
+ return {
13
+ type: 'div',
14
+ title: '',
15
+ native: true,
16
+ style: {
17
+ whiteSpace: 'pre-line',
18
+ width: '100%',
19
+ },
20
+ children: [t('com.text.name')],
21
+ };
22
+ },
23
+ watch: {
24
+ formCreateNative({value, rule}) {
25
+ if (value) {
26
+ rule.title = '';
27
+ }
28
+ }
29
+ },
30
+ props(_, {t}) {
31
+ return localeProps(t, name + '.props', [
32
+ {
33
+ type: 'input',
34
+ field: 'formCreateChild',
35
+ props: {
36
+ type: 'textarea'
37
+ }
38
+ }
39
+ ]);
40
+ }
41
+ };
@@ -0,0 +1,63 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeProps} from '../../utils';
3
+
4
+ const label = '多行输入框';
5
+ const name = 'textarea';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-textarea',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['blur', 'focus', 'change', 'input'],
14
+ validate: ['string'],
15
+ rule({t}) {
16
+ return {
17
+ type: 'input',
18
+ field: uniqueId(),
19
+ title: t('com.textarea.name'),
20
+ info: '',
21
+ $required: false,
22
+ props: {
23
+ type: 'textarea'
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: 'switch',
44
+ field: 'showWordLimit'
45
+ },
46
+ {
47
+ type: 'input',
48
+ field: 'placeholder'
49
+ },
50
+ {
51
+ type: 'inputNumber',
52
+ field: 'rows',
53
+ props: {
54
+ min: 0
55
+ }
56
+ },
57
+ {
58
+ type: 'switch',
59
+ field: 'autosize'
60
+ },
61
+ ]);
62
+ }
63
+ };
@@ -0,0 +1,58 @@
1
+ import uniqueId from '@form-create/utils/lib/unique';
2
+ import {localeOptions, localeProps} from '../../utils';
3
+
4
+ const label = '时间';
5
+ const name = 'timePicker';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-time',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change', 'blur', 'focus', 'visibleChange'],
14
+ rule({t}) {
15
+ return {
16
+ type: name,
17
+ field: uniqueId(),
18
+ title: t('com.timePicker.name'),
19
+ info: '',
20
+ $required: false,
21
+ props: {},
22
+ };
23
+ },
24
+ watch: {
25
+ isRange({rule}) {
26
+ rule.key = uniqueId();
27
+ }
28
+ },
29
+ props(_, {t}) {
30
+ return localeProps(t, name + '.props', [{type: 'switch', field: 'readonly'}, {
31
+ type: 'switch',
32
+ field: 'disabled'
33
+ }, {
34
+ type: 'switch',
35
+ field: 'isRange'
36
+ }, {
37
+ type: 'switch',
38
+ field: 'clearable',
39
+ value: true
40
+ }, {type: 'switch', field: 'editable', value: true}, {
41
+ type: 'input',
42
+ field: 'placeholder'
43
+ }, {
44
+ type: 'input',
45
+ field: 'startPlaceholder'
46
+ }, {type: 'input', field: 'endPlaceholder'}, {
47
+ type: 'switch',
48
+ field: 'arrowControl'
49
+ }, {
50
+ type: 'select',
51
+ field: 'align',
52
+ options: localeOptions(t, [{label: 'left', value: 'left'}, {label: 'center', value: 'center'}, {
53
+ label: 'right',
54
+ value: 'right'
55
+ }])
56
+ }]);
57
+ }
58
+ };
@@ -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 = 'timeRange';
6
+
7
+ export default {
8
+ menu: 'main',
9
+ icon: 'icon-time-range',
10
+ label,
11
+ name,
12
+ input: true,
13
+ event: ['change', 'blur', 'focus', 'visibleChange'],
14
+ rule({t}) {
15
+ return {
16
+ type: 'timePicker',
17
+ field: uniqueId(),
18
+ title: t('com.timeRange.name'),
19
+ info: '',
20
+ $required: false,
21
+ props: {
22
+ isRange: true,
23
+ },
24
+ };
25
+ },
26
+ props(_, {t}) {
27
+ return localeProps(t, 'timePicker.props', [{type: 'switch', field: 'readonly'}, {
28
+ type: 'switch',
29
+ field: 'disabled'
30
+ }, {
31
+ type: 'switch',
32
+ field: 'clearable',
33
+ value: true
34
+ }, {type: 'switch', field: 'editable', value: true}, {
35
+ type: 'input',
36
+ field: 'startPlaceholder'
37
+ }, {type: 'input', field: 'endPlaceholder'}, {
38
+ type: 'switch',
39
+ field: 'arrowControl'
40
+ }, {
41
+ type: 'select',
42
+ field: 'align',
43
+ options: localeOptions(t, [{label: 'left', value: 'left'}, {label: 'center', value: 'center'}, {
44
+ label: 'right',
45
+ value: 'right'
46
+ }])
47
+ }]);
48
+ }
49
+ };
@@ -0,0 +1,37 @@
1
+ import {localeOptions, localeProps} from '../../utils';
2
+
3
+ const label = '标题';
4
+ const name = 'fcTitle';
5
+
6
+ export default {
7
+ menu: 'aide',
8
+ icon: 'icon-title',
9
+ label,
10
+ name,
11
+ event: [],
12
+ rule({t}) {
13
+ return {
14
+ type: 'fcTitle',
15
+ props: {
16
+ title: t('props.title'),
17
+ },
18
+ };
19
+ },
20
+ props(_, {t}) {
21
+ return localeProps(t, name + '.props', [{type: 'input', field: 'title'}, {
22
+ type: 'select',
23
+ field: 'size',
24
+ value: 'H2',
25
+ options: [1, 2, 3, 4, 5, 6].map(k => {
26
+ return {label: 'H' + k, value: 'h' + k};
27
+ })
28
+ }, {
29
+ type: 'select',
30
+ field: 'align',
31
+ options: localeOptions(t, [{label: 'left', value: 'left'}, {label: 'center', value: 'center'}, {
32
+ label: 'right',
33
+ value: 'right'
34
+ }])
35
+ }]);
36
+ }
37
+ };