tianheng-ui 0.0.56 → 0.0.58
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/lib/039af9192b9bb277966ceb4e4ce29c41.js +16 -0
- package/lib/{c755e7fc08446566ee8dd3a8aa8fe43f.js → 2d84c80112a372bc149cad3464e90fa3.js} +404 -502
- package/lib/5977b934a4c6b480790864ea01303173.js +10834 -0
- package/lib/7745f3e776488705a38e62f85adad54d.js +16 -0
- package/lib/de8dee841ffdaaede3a2254deef30376.js +15395 -0
- package/lib/e78eab250e7f8ccac3d918dfdb06ca10.js +8904 -0
- package/lib/index.js +4 -2
- package/lib/theme-chalk/fonts/PingFang.ttf +0 -0
- package/lib/theme-chalk/fonts/bpmn.eot +0 -0
- package/lib/theme-chalk/fonts/bpmn.svg +224 -0
- package/lib/theme-chalk/fonts/bpmn.ttf +0 -0
- package/lib/theme-chalk/fonts/bpmn.woff +0 -0
- package/lib/theme-chalk/fonts/bpmn.woff2 +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.eot +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.svg +2671 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.ttf +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.woff +0 -0
- package/lib/theme-chalk/fonts/fontawesome-webfont.woff2 +0 -0
- package/lib/{iconfont.eot → theme-chalk/fonts/iconfont.eot} +0 -0
- package/lib/{iconfont.svg → theme-chalk/fonts/iconfont.svg} +0 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/images/notData.png +0 -0
- package/lib/theme-chalk/index.scss +30 -0
- package/lib/theme-chalk/styles/button.scss +501 -0
- package/lib/theme-chalk/styles/card.scss +29 -0
- package/lib/theme-chalk/styles/cell.scss +54 -0
- package/lib/theme-chalk/styles/codeEditor.scss +9 -0
- package/lib/theme-chalk/styles/col.scss +151 -0
- package/lib/theme-chalk/styles/dialog.scss +59 -0
- package/lib/theme-chalk/styles/empty.scss +22 -0
- package/lib/theme-chalk/styles/feature.scss +42 -0
- package/lib/theme-chalk/styles/font.css +7 -0
- package/lib/theme-chalk/{icon.css → styles/icon.css} +3 -3
- package/lib/theme-chalk/styles/imagePreview.scss +113 -0
- package/lib/theme-chalk/styles/img.scss +35 -0
- package/lib/theme-chalk/styles/reset.scss +8 -0
- package/lib/theme-chalk/{root.css → styles/root.css} +2 -35
- package/lib/theme-chalk/styles/row.scss +23 -0
- package/lib/theme-chalk/styles/upload.scss +598 -0
- package/lib/theme-chalk/styles/variable.scss +80 -0
- package/lib/tianheng-ui.js +71 -9
- package/package.json +24 -4
- package/packages/Button/index.js +8 -0
- package/packages/Button/index.vue +80 -0
- package/packages/Card/index.js +8 -0
- package/packages/Card/index.vue +37 -0
- package/packages/{cell → Cell}/index.js +0 -0
- package/packages/Cell/index.vue +68 -0
- package/packages/{codeEditor → CodeEditor}/index.js +0 -0
- package/packages/{codeEditor → CodeEditor}/index.vue +73 -108
- package/packages/Col/index.js +8 -0
- package/packages/Col/index.vue +41 -0
- package/packages/{dialog → Dialog}/index.js +0 -0
- package/packages/{dialog → Dialog}/index.vue +19 -10
- package/packages/Empty/images/notData.png +0 -0
- package/packages/{empty → Empty}/index.js +0 -0
- package/packages/Empty/index.vue +35 -0
- package/packages/FormMaking/Container.vue +755 -0
- package/packages/{formMaking → FormMaking}/FormConfig.vue +22 -6
- package/packages/FormMaking/GenerateForm.vue +247 -0
- package/packages/{formMaking → FormMaking}/GenerateFormItem.vue +340 -172
- package/packages/FormMaking/GenerateFormItemH5.vue +828 -0
- package/packages/{formMaking → FormMaking}/Upload/index.vue +0 -0
- package/packages/FormMaking/WidgetConfig.vue +473 -0
- package/packages/{formMaking → FormMaking}/WidgetForm.vue +49 -31
- package/packages/FormMaking/WidgetFormItem.vue +157 -0
- package/packages/{formMaking/componentsConfig.js → FormMaking/custom/config.js} +379 -163
- package/packages/FormMaking/custom/configs/alliance.vue +0 -0
- package/packages/FormMaking/custom/configs/blank.vue +54 -0
- package/packages/FormMaking/custom/configs/button.vue +144 -0
- package/packages/FormMaking/custom/configs/cascader.vue +182 -0
- package/packages/FormMaking/custom/configs/cell.vue +81 -0
- package/packages/FormMaking/custom/configs/checkbox.vue +237 -0
- package/packages/FormMaking/custom/configs/color.vue +137 -0
- package/packages/FormMaking/custom/configs/date.vue +158 -0
- package/packages/FormMaking/custom/configs/divider.vue +61 -0
- package/packages/FormMaking/custom/configs/editor.vue +71 -0
- package/packages/FormMaking/custom/configs/filler.vue +52 -0
- package/packages/FormMaking/custom/configs/grid.vue +103 -0
- package/packages/FormMaking/custom/configs/image.vue +148 -0
- package/packages/FormMaking/custom/configs/input.vue +176 -0
- package/packages/FormMaking/custom/configs/number.vue +140 -0
- package/packages/FormMaking/custom/configs/radio.vue +215 -0
- package/packages/FormMaking/custom/configs/rate.vue +109 -0
- package/packages/FormMaking/custom/configs/select.vue +308 -0
- package/packages/FormMaking/custom/configs/slider.vue +142 -0
- package/packages/FormMaking/custom/configs/switch.vue +130 -0
- package/packages/FormMaking/custom/configs/table.vue +105 -0
- package/packages/FormMaking/custom/configs/table_h5.vue +102 -0
- package/packages/FormMaking/custom/configs/tabs.vue +175 -0
- package/packages/FormMaking/custom/configs/text.vue +71 -0
- package/packages/FormMaking/custom/configs/textarea.vue +167 -0
- package/packages/FormMaking/custom/configs/time.vue +153 -0
- package/packages/FormMaking/custom/configs/upload.vue +150 -0
- package/packages/FormMaking/custom/index.js +33 -0
- package/packages/FormMaking/custom/items/alliance.vue +132 -0
- package/packages/FormMaking/custom/items/blank.vue +16 -0
- package/packages/FormMaking/custom/items/button.vue +27 -0
- package/packages/FormMaking/custom/items/cascader.vue +29 -0
- package/packages/FormMaking/custom/items/cell.vue +18 -0
- package/packages/FormMaking/custom/items/checkbox.vue +46 -0
- package/packages/FormMaking/custom/items/color.vue +19 -0
- package/packages/FormMaking/custom/items/date.vue +29 -0
- package/packages/FormMaking/custom/items/divider.vue +14 -0
- package/packages/FormMaking/custom/items/editor.vue +22 -0
- package/packages/FormMaking/custom/items/filler.vue +17 -0
- package/packages/FormMaking/custom/items/grid.vue +129 -0
- package/packages/FormMaking/custom/items/image.vue +42 -0
- package/packages/FormMaking/custom/items/input.vue +36 -0
- package/packages/FormMaking/custom/items/login.vue +13 -0
- package/packages/FormMaking/custom/items/number.vue +24 -0
- package/packages/FormMaking/custom/items/radio.vue +44 -0
- package/packages/FormMaking/custom/items/rate.vue +20 -0
- package/packages/FormMaking/custom/items/select.vue +32 -0
- package/packages/FormMaking/custom/items/slider.vue +34 -0
- package/packages/FormMaking/custom/items/switch.vue +22 -0
- package/packages/FormMaking/custom/items/table.vue +106 -0
- package/packages/FormMaking/custom/items/table_h5.vue +126 -0
- package/packages/FormMaking/custom/items/tabs.vue +145 -0
- package/packages/FormMaking/custom/items/text.vue +18 -0
- package/packages/FormMaking/custom/items/textarea.vue +37 -0
- package/packages/FormMaking/custom/items/time.vue +32 -0
- package/packages/FormMaking/custom/items/upload.vue +83 -0
- package/packages/FormMaking/custom/mixins/index.js +61 -0
- package/packages/FormMaking/custom/register.js +18 -0
- package/packages/{formMaking → FormMaking}/iconfont/demo.css +0 -0
- package/packages/{formMaking → FormMaking}/iconfont/demo_index.html +0 -0
- package/packages/{formMaking → FormMaking}/iconfont/iconfont.css +0 -0
- package/packages/{formMaking → FormMaking}/iconfont/iconfont.eot +0 -0
- package/packages/{formMaking → FormMaking}/iconfont/iconfont.js +0 -0
- package/packages/{formMaking → FormMaking}/iconfont/iconfont.svg +0 -0
- package/{lib → packages/FormMaking/iconfont}/iconfont.ttf +0 -0
- package/{lib → packages/FormMaking/iconfont}/iconfont.woff +0 -0
- package/packages/{formMaking → FormMaking}/iconfont/iconfont.woff2 +0 -0
- package/packages/FormMaking/index.js +35 -0
- package/packages/{formMaking → FormMaking}/lang/en-US.js +1 -1
- package/packages/{formMaking → FormMaking}/lang/zh-CN.js +1 -1
- package/packages/{formMaking → FormMaking}/styles/cover.scss +1 -1
- package/packages/{formMaking → FormMaking}/styles/index.scss +445 -429
- package/packages/{formMaking → FormMaking/util}/generateCode.js +5 -5
- package/packages/{formMaking → FormMaking}/util/index.js +0 -0
- package/packages/{formMaking → FormMaking}/util/request.js +0 -0
- package/packages/{icons → Icons}/index.js +0 -0
- package/packages/{icons → Icons}/index.vue +26 -9
- package/packages/Image/index.js +8 -0
- package/packages/Image/index.vue +146 -0
- package/packages/ImagePreview/index.js +8 -0
- package/packages/ImagePreview/index.vue +386 -0
- package/packages/Row/index.js +8 -0
- package/packages/Row/index.vue +35 -0
- package/packages/{table → Table}/action.js +0 -0
- package/packages/{table → Table}/action.vue +1 -1
- package/packages/Table/column.vue +63 -0
- package/packages/{table → Table}/index.js +0 -0
- package/packages/{table → Table}/index.vue +25 -23
- package/packages/{table → Table}/search.js +0 -0
- package/packages/{table → Table}/search.vue +2 -2
- package/packages/{table → Table}/tools.js +0 -0
- package/packages/{table → Table}/tools.vue +0 -0
- package/packages/Workflow/Log.js +99 -0
- package/packages/Workflow/designer/ProcessDesigner.vue +628 -0
- package/packages/Workflow/designer/index.js +7 -0
- package/packages/Workflow/designer/plugins/content-pad/contentPadProvider.js +390 -0
- package/packages/Workflow/designer/plugins/content-pad/index.js +6 -0
- package/packages/Workflow/designer/plugins/defaultEmpty.js +24 -0
- package/packages/Workflow/designer/plugins/descriptor/activitiDescriptor.json +1071 -0
- package/packages/Workflow/designer/plugins/descriptor/camundaDescriptor.json +1087 -0
- package/packages/Workflow/designer/plugins/descriptor/flowableDescriptor.json +1215 -0
- package/packages/Workflow/designer/plugins/extension-moddle/activiti/activitiExtension.js +74 -0
- package/packages/Workflow/designer/plugins/extension-moddle/activiti/index.js +9 -0
- package/packages/Workflow/designer/plugins/extension-moddle/camunda/extension.js +148 -0
- package/packages/Workflow/designer/plugins/extension-moddle/camunda/index.js +6 -0
- package/packages/Workflow/designer/plugins/extension-moddle/flowable/flowableExtension.js +74 -0
- package/packages/Workflow/designer/plugins/extension-moddle/flowable/index.js +9 -0
- package/packages/Workflow/designer/plugins/palette/CustomPalette.js +156 -0
- package/packages/Workflow/designer/plugins/palette/index.js +6 -0
- package/packages/Workflow/designer/plugins/palette/paletteProvider.js +160 -0
- package/packages/Workflow/designer/plugins/translate/customTranslate.js +41 -0
- package/packages/Workflow/designer/plugins/translate/zh.js +238 -0
- package/packages/Workflow/highlight/index.js +5 -0
- package/packages/Workflow/index.js +26 -0
- package/packages/Workflow/index.vue +395 -0
- package/packages/Workflow/modules/auto-place/CustomAutoPlace.js +81 -0
- package/packages/Workflow/modules/auto-place/index.js +6 -0
- package/packages/Workflow/modules/custom-renderer/CustomRenderer.js +17 -0
- package/packages/Workflow/modules/custom-renderer/index.js +6 -0
- package/packages/Workflow/modules/rules/CustomRules.js +16 -0
- package/packages/Workflow/modules/rules/index.js +6 -0
- package/packages/Workflow/palette/ProcessPalette.vue +106 -0
- package/packages/Workflow/palette/index.js +7 -0
- package/packages/Workflow/penal/PropertiesPanel.vue +247 -0
- package/packages/Workflow/penal/base/ElementBaseInfo.vue +80 -0
- package/packages/Workflow/penal/flow-condition/FlowCondition.vue +142 -0
- package/packages/Workflow/penal/form/ElementForm.vue +367 -0
- package/packages/Workflow/penal/index.js +7 -0
- package/packages/Workflow/penal/listeners/ElementListeners.vue +299 -0
- package/packages/Workflow/penal/listeners/UserTaskListeners.vue +322 -0
- package/packages/Workflow/penal/listeners/template.js +178 -0
- package/packages/Workflow/penal/listeners/utilSelf.js +62 -0
- package/packages/Workflow/penal/multi-instance/ElementMultiInstance.vue +200 -0
- package/packages/Workflow/penal/other/ElementOtherConfig.vue +59 -0
- package/packages/Workflow/penal/properties/ElementProperties.vue +135 -0
- package/packages/Workflow/penal/signal-message/SignalAndMessage.vue +104 -0
- package/packages/Workflow/penal/task/ElementTask.vue +73 -0
- package/packages/Workflow/penal/task/task-components/ReceiveTask.vue +97 -0
- package/packages/Workflow/penal/task/task-components/ScriptTask.vue +85 -0
- package/packages/Workflow/penal/task/task-components/UserTask.vue +535 -0
- package/packages/Workflow/theme/element-variables.scss +70 -0
- package/packages/Workflow/theme/index.scss +2 -0
- package/packages/Workflow/theme/process-designer.scss +157 -0
- package/packages/Workflow/theme/process-panel.scss +107 -0
- package/packages/Workflow/translations.js +25 -0
- package/packages/Workflow/utils.js +71 -0
- package/packages/upload/ajax.js +85 -0
- package/packages/upload/index.js +8 -0
- package/packages/upload/index.vue +325 -0
- package/packages/upload/locale.js +9 -0
- package/packages/upload/upload-dragger.vue +70 -0
- package/packages/upload/upload-list.vue +123 -0
- package/packages/upload/upload.vue +211 -0
- package/lib/03250ed25fc1b305e9980cf7cf0dfb09.js +0 -1
- package/lib/theme-chalk/cell.css +0 -53
- package/lib/theme-chalk/dialog.css +0 -41
- package/lib/theme-chalk/empty.css +0 -27
- package/lib/theme-chalk/index.css +0 -6
- package/lib/theme-chalk/reset.css +0 -4
- package/lib/tianheng-ui.js.map +0 -1
- package/packages/cell/index.vue +0 -116
- package/packages/empty/index.vue +0 -33
- package/packages/formMaking/Container.vue +0 -591
- package/packages/formMaking/CusDialog.vue +0 -134
- package/packages/formMaking/GenerateForm.vue +0 -174
- package/packages/formMaking/WidgetConfig.vue +0 -1539
- package/packages/formMaking/WidgetFormItem.vue +0 -817
- package/packages/formMaking/iconfont/iconfont.ttf +0 -0
- package/packages/formMaking/iconfont/iconfont.woff +0 -0
- package/packages/formMaking/index.js +0 -77
- package/packages/table/column.vue +0 -111
@@ -1,20 +1,15 @@
|
|
1
1
|
<template>
|
2
2
|
<el-form-item
|
3
|
-
|
4
|
-
:
|
5
|
-
|
6
|
-
widget.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
"
|
12
|
-
:
|
13
|
-
tableInfo
|
14
|
-
? `${tableInfo.data.model}.${tableInfo.index}.${widget.model}`
|
15
|
-
: widget.model
|
16
|
-
"
|
17
|
-
:rules="rules[widget.model]"
|
3
|
+
v-show="!widget.options.hidden"
|
4
|
+
:class="{
|
5
|
+
[widget.model]: true,
|
6
|
+
[`widget-form-list-${widget.type}`]: true
|
7
|
+
}"
|
8
|
+
:label="widget.options.hideLabel ? '' : widget.name"
|
9
|
+
:label-width="labelWidth"
|
10
|
+
:prop="prop ? prop : widget.model"
|
11
|
+
:rules="widget.rules"
|
12
|
+
:ref="widget.model"
|
18
13
|
>
|
19
14
|
<template v-if="widget.type == 'input'">
|
20
15
|
<el-input
|
@@ -26,13 +21,16 @@
|
|
26
21
|
type="number"
|
27
22
|
v-model.number="dataModel"
|
28
23
|
:placeholder="widget.options.placeholder"
|
29
|
-
:style="{ width:
|
24
|
+
:style="{ width: widget.options.width }"
|
30
25
|
:disabled="widget.options.disabled"
|
31
26
|
:readonly="widget.options.readonly"
|
32
27
|
:clearable="widget.options.clearable"
|
33
28
|
:maxlength="widget.options.maxlength"
|
34
29
|
:show-word-limit="widget.options.showWordLimit"
|
35
30
|
:show-password="widget.options.showPassword"
|
31
|
+
@input="handleEventAction(widget.events.onChange)"
|
32
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
33
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
36
34
|
>
|
37
35
|
</el-input>
|
38
36
|
<el-input
|
@@ -40,7 +38,7 @@
|
|
40
38
|
type="text"
|
41
39
|
v-model="dataModel"
|
42
40
|
:placeholder="widget.options.placeholder"
|
43
|
-
:style="{ width:
|
41
|
+
:style="{ width: widget.options.width }"
|
44
42
|
:disabled="widget.options.disabled"
|
45
43
|
:readonly="widget.options.readonly"
|
46
44
|
:clearable="widget.options.clearable"
|
@@ -49,6 +47,9 @@
|
|
49
47
|
:show-password="widget.options.showPassword"
|
50
48
|
:suffix-icon="widget.options.suffixIcon"
|
51
49
|
:prefix-icon="widget.options.prefixIcon"
|
50
|
+
@input="handleEventAction(widget.events.onChange)"
|
51
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
52
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
52
53
|
>
|
53
54
|
<template v-if="widget.options.prepend" slot="prepend">{{
|
54
55
|
widget.options.prepend
|
@@ -65,7 +66,7 @@
|
|
65
66
|
v-model="dataModel"
|
66
67
|
:disabled="widget.options.disabled"
|
67
68
|
:placeholder="widget.options.placeholder"
|
68
|
-
:style="{ width:
|
69
|
+
:style="{ width: widget.options.width }"
|
69
70
|
:maxlength="widget.options.maxlength"
|
70
71
|
:clearable="widget.options.clearable"
|
71
72
|
:show-word-limit="widget.options.showWordLimit"
|
@@ -73,39 +74,64 @@
|
|
73
74
|
minRows: widget.options.minRows,
|
74
75
|
maxRows: widget.options.maxRows
|
75
76
|
}"
|
77
|
+
@input="handleEventAction(widget.events.onChange)"
|
78
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
79
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
76
80
|
></el-input>
|
77
81
|
</template>
|
78
82
|
|
83
|
+
<template v-if="widget.type == 'cell'">
|
84
|
+
<th-cell
|
85
|
+
:title="widget.options.title"
|
86
|
+
:value="widget.options.value"
|
87
|
+
:label="widget.options.label"
|
88
|
+
></th-cell>
|
89
|
+
</template>
|
90
|
+
|
79
91
|
<template v-if="widget.type == 'number'">
|
80
92
|
<el-input-number
|
81
93
|
v-model="dataModel"
|
82
|
-
:style="{ width:
|
94
|
+
:style="{ width: widget.options.width }"
|
83
95
|
:step="widget.options.step"
|
84
96
|
:controls-position="widget.options.controlsPosition ? 'right' : ''"
|
85
97
|
:disabled="widget.options.disabled"
|
86
98
|
:min="widget.options.min"
|
87
99
|
:max="widget.options.max"
|
88
100
|
:precision="widget.options.precision"
|
101
|
+
@change="handleEventAction(widget.events.onChange)"
|
102
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
103
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
89
104
|
></el-input-number>
|
90
105
|
</template>
|
91
106
|
|
107
|
+
<template v-if="widget.type == 'text'">
|
108
|
+
<div
|
109
|
+
:style="{
|
110
|
+
height: widget.options.height,
|
111
|
+
textAlign: widget.options.textAlign
|
112
|
+
}"
|
113
|
+
v-html="dataModel"
|
114
|
+
></div>
|
115
|
+
</template>
|
116
|
+
|
92
117
|
<template v-if="widget.type == 'radio'">
|
93
118
|
<el-radio-group
|
94
119
|
v-model="dataModel"
|
95
|
-
:style="{ width:
|
120
|
+
:style="{ width: widget.options.width }"
|
96
121
|
:disabled="widget.options.disabled"
|
122
|
+
@change="handleEventAction(widget.events.onChange)"
|
97
123
|
>
|
98
124
|
<template v-if="widget.options.buttonType">
|
99
125
|
<el-radio-button
|
100
126
|
:style="{
|
101
127
|
display: widget.options.inline ? 'inline-block' : 'block'
|
102
128
|
}"
|
103
|
-
:label="item.value"
|
104
|
-
:border="widget.options.border"
|
105
129
|
v-for="(item, index) in widget.options.remote
|
106
130
|
? widget.options.remoteOptions
|
107
131
|
: widget.options.options"
|
108
132
|
:key="index"
|
133
|
+
:label="item.value"
|
134
|
+
:border="widget.options.border"
|
109
135
|
>
|
110
136
|
<template v-if="widget.options.remote">{{ item.label }}</template>
|
111
137
|
<template v-else>{{
|
@@ -137,10 +163,11 @@
|
|
137
163
|
<template v-if="widget.type == 'checkbox'">
|
138
164
|
<el-checkbox-group
|
139
165
|
v-model="dataModel"
|
140
|
-
:style="{ width:
|
166
|
+
:style="{ width: widget.options.width }"
|
141
167
|
:disabled="widget.options.disabled"
|
142
168
|
:min="widget.options.min"
|
143
169
|
:max="widget.options.max"
|
170
|
+
@change="handleEventAction(widget.events.onChange)"
|
144
171
|
>
|
145
172
|
<template v-if="widget.options.buttonType">
|
146
173
|
<el-checkbox-button
|
@@ -183,8 +210,8 @@
|
|
183
210
|
|
184
211
|
<template v-if="widget.type == 'time'">
|
185
212
|
<el-time-picker
|
186
|
-
v-if="widget.options.timeType"
|
187
213
|
v-model="dataModel"
|
214
|
+
:style="{ width: widget.options.width }"
|
188
215
|
:is-range="widget.options.isRange"
|
189
216
|
:placeholder="widget.options.placeholder"
|
190
217
|
:start-placeholder="widget.options.startPlaceholder"
|
@@ -195,46 +222,20 @@
|
|
195
222
|
:clearable="widget.options.clearable"
|
196
223
|
:arrowControl="widget.options.arrowControl"
|
197
224
|
:value-format="widget.options.format"
|
198
|
-
:
|
225
|
+
:picker-options="{
|
226
|
+
selectableRange: `${widget.options.pickerOptions.selectableRange[0]} - ${widget.options.pickerOptions.selectableRange[1]}`
|
227
|
+
}"
|
228
|
+
@change="handleEventAction(widget.events.onChange)"
|
229
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
230
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
199
231
|
>
|
200
232
|
</el-time-picker>
|
201
|
-
<template v-else>
|
202
|
-
<el-time-select
|
203
|
-
v-model="dataModel[0]"
|
204
|
-
:placeholder="
|
205
|
-
widget.options.selectRange
|
206
|
-
? widget.options.startPlaceholder
|
207
|
-
: widget.options.placeholder
|
208
|
-
"
|
209
|
-
:readonly="widget.options.readonly"
|
210
|
-
:disabled="widget.options.disabled"
|
211
|
-
:editable="widget.options.editable"
|
212
|
-
:clearable="widget.options.clearable"
|
213
|
-
:arrowControl="widget.options.arrowControl"
|
214
|
-
:style="{ width: width ? width : widget.options.width }"
|
215
|
-
:picker-options="widget.options.stretTimePickerOptions"
|
216
|
-
@change="e => handleTimePicker(e)"
|
217
|
-
>
|
218
|
-
</el-time-select>
|
219
|
-
<el-time-select
|
220
|
-
v-model="dataModel[1]"
|
221
|
-
v-if="widget.options.selectRange"
|
222
|
-
:placeholder="widget.options.endPlaceholder"
|
223
|
-
:readonly="widget.options.readonly"
|
224
|
-
:disabled="widget.options.disabled"
|
225
|
-
:editable="widget.options.editable"
|
226
|
-
:clearable="widget.options.clearable"
|
227
|
-
:arrowControl="widget.options.arrowControl"
|
228
|
-
:style="{ width: width ? width : widget.options.width }"
|
229
|
-
:picker-options="widget.options.endTimePickerOptions"
|
230
|
-
>
|
231
|
-
</el-time-select>
|
232
|
-
</template>
|
233
233
|
</template>
|
234
234
|
|
235
235
|
<template v-if="widget.type == 'date'">
|
236
236
|
<el-date-picker
|
237
237
|
v-model="dataModel"
|
238
|
+
:style="{ width: widget.options.width }"
|
238
239
|
:type="widget.options.type"
|
239
240
|
:is-range="widget.options.isRange"
|
240
241
|
:placeholder="widget.options.placeholder"
|
@@ -244,33 +245,18 @@
|
|
244
245
|
:disabled="widget.options.disabled"
|
245
246
|
:editable="widget.options.editable"
|
246
247
|
:clearable="widget.options.clearable"
|
247
|
-
:
|
248
|
+
:value-format="widget.options.format"
|
249
|
+
@change="handleEventAction(widget.events.onChange)"
|
250
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
251
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
248
252
|
>
|
249
253
|
</el-date-picker>
|
250
254
|
</template>
|
251
255
|
|
252
|
-
<template v-if="widget.type == 'rate'">
|
253
|
-
<el-rate
|
254
|
-
v-model="dataModel"
|
255
|
-
:max="widget.options.max"
|
256
|
-
:disabled="widget.options.disabled"
|
257
|
-
:allow-half="widget.options.allowHalf"
|
258
|
-
:show-text="widget.options.showText"
|
259
|
-
:texts="widget.options.auxiliaryValue"
|
260
|
-
></el-rate>
|
261
|
-
</template>
|
262
|
-
|
263
|
-
<template v-if="widget.type == 'color'">
|
264
|
-
<el-color-picker
|
265
|
-
v-model="dataModel"
|
266
|
-
:disabled="widget.options.disabled"
|
267
|
-
:show-alpha="widget.options.showAlpha"
|
268
|
-
></el-color-picker>
|
269
|
-
</template>
|
270
|
-
|
271
256
|
<template v-if="widget.type == 'select'">
|
272
257
|
<el-select
|
273
258
|
v-model="dataModel"
|
259
|
+
:style="{ width: widget.options.width }"
|
274
260
|
:disabled="widget.options.disabled"
|
275
261
|
:multiple="widget.options.multiple"
|
276
262
|
:clearable="widget.options.clearable"
|
@@ -280,7 +266,9 @@
|
|
280
266
|
:filterable="
|
281
267
|
widget.options.allowCreate ? true : widget.options.filterable
|
282
268
|
"
|
283
|
-
|
269
|
+
@change="handleEventAction(widget.events.onChange)"
|
270
|
+
@focus="handleEventAction(widget.events.onFocus)"
|
271
|
+
@blur="handleEventAction(widget.events.onBlur)"
|
284
272
|
>
|
285
273
|
<el-option
|
286
274
|
v-for="item in widget.options.remote
|
@@ -297,18 +285,48 @@
|
|
297
285
|
</el-select>
|
298
286
|
</template>
|
299
287
|
|
288
|
+
<template v-if="widget.type == 'color'">
|
289
|
+
<el-color-picker
|
290
|
+
v-model="dataModel"
|
291
|
+
:disabled="widget.options.disabled"
|
292
|
+
:show-alpha="widget.options.showAlpha"
|
293
|
+
@change="handleEventAction(widget.events.onChange)"
|
294
|
+
></el-color-picker>
|
295
|
+
</template>
|
296
|
+
|
300
297
|
<template v-if="widget.type == 'switch'">
|
301
298
|
<el-switch
|
302
299
|
v-model="dataModel"
|
300
|
+
:width="widget.options.width - 20"
|
303
301
|
:disabled="widget.options.disabled"
|
304
302
|
:inactive-text="widget.options.switchInactiveText"
|
305
303
|
:active-text="widget.options.switchActiveText"
|
306
304
|
:inactive-color="widget.options.switchInactiveColor"
|
307
305
|
:active-color="widget.options.switchActiveColor"
|
306
|
+
@change="handleEventAction(widget.events.onChange)"
|
308
307
|
>
|
309
308
|
</el-switch>
|
310
309
|
</template>
|
311
310
|
|
311
|
+
<template v-if="widget.type == 'button'">
|
312
|
+
<el-button
|
313
|
+
:style="{
|
314
|
+
width: widget.options.width,
|
315
|
+
height: widget.options.height
|
316
|
+
}"
|
317
|
+
:size="widget.options.buttonSize"
|
318
|
+
:type="widget.options.buttonType"
|
319
|
+
:plain="widget.options.buttonPlain"
|
320
|
+
:round="widget.options.buttonRound"
|
321
|
+
:circle="widget.options.buttonCircle"
|
322
|
+
:loading="widget.options.loading"
|
323
|
+
:disabled="widget.options.disabled"
|
324
|
+
:icon="widget.options.buttonIcon"
|
325
|
+
@click="handleEventAction(widget.events.onClick)"
|
326
|
+
>{{ widget.options.defaultValue }}</el-button
|
327
|
+
>
|
328
|
+
</template>
|
329
|
+
|
312
330
|
<template v-if="widget.type == 'slider'">
|
313
331
|
<el-slider
|
314
332
|
v-model="dataModel"
|
@@ -319,7 +337,7 @@
|
|
319
337
|
:show-input="widget.options.showInput"
|
320
338
|
:range="widget.options.range"
|
321
339
|
:style="{
|
322
|
-
width:
|
340
|
+
width: widget.options.width,
|
323
341
|
height: widget.options.height
|
324
342
|
}"
|
325
343
|
:show-tooltip="widget.options.showTooltip"
|
@@ -328,28 +346,41 @@
|
|
328
346
|
"
|
329
347
|
:show-stops="widget.options.showStops"
|
330
348
|
:vertical="widget.options.vertical"
|
349
|
+
@change="handleEventAction(widget.events.onChange)"
|
331
350
|
></el-slider>
|
332
351
|
</template>
|
333
352
|
|
334
|
-
<template v-if="widget.type == '
|
335
|
-
|
353
|
+
<template v-if="widget.type == 'rate'">
|
354
|
+
<el-rate
|
336
355
|
v-model="dataModel"
|
356
|
+
:max="widget.options.max"
|
337
357
|
:disabled="widget.options.disabled"
|
338
|
-
:
|
339
|
-
:
|
340
|
-
:
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
:length="widget.options.length"
|
345
|
-
:is-qiniu="widget.options.isQiniu"
|
346
|
-
:is-delete="widget.options.isDelete"
|
347
|
-
:min="widget.options.min"
|
348
|
-
:is-edit="widget.options.isEdit"
|
349
|
-
:action="widget.options.action"
|
350
|
-
>
|
351
|
-
</fm-upload> -->
|
358
|
+
:allow-half="widget.options.allowHalf"
|
359
|
+
:show-text="widget.options.showText"
|
360
|
+
:texts="widget.options.auxiliaryValue"
|
361
|
+
@change="handleEventAction(widget.events.onChange)"
|
362
|
+
></el-rate>
|
363
|
+
</template>
|
352
364
|
|
365
|
+
<template v-if="widget.type == 'filler'">
|
366
|
+
<div
|
367
|
+
:style="{
|
368
|
+
width: widget.options.width,
|
369
|
+
height: widget.options.height
|
370
|
+
}"
|
371
|
+
></div>
|
372
|
+
</template>
|
373
|
+
|
374
|
+
<template v-if="widget.type == 'image'">
|
375
|
+
<th-image
|
376
|
+
:src="widget.options.defaultValue"
|
377
|
+
:height="widget.options.height"
|
378
|
+
:width="widget.options.width"
|
379
|
+
:fit="widget.options.fit"
|
380
|
+
></th-image>
|
381
|
+
</template>
|
382
|
+
|
383
|
+
<template v-if="widget.type == 'upload'">
|
353
384
|
<el-upload
|
354
385
|
class="upload-demo"
|
355
386
|
:action="widget.options.remoteFunc"
|
@@ -400,7 +431,7 @@
|
|
400
431
|
<template v-if="widget.type == 'editor'">
|
401
432
|
<vue-editor
|
402
433
|
v-model="dataModel"
|
403
|
-
:style="{ width:
|
434
|
+
:style="{ width: widget.options.width }"
|
404
435
|
:disabled="widget.options.disabled"
|
405
436
|
>
|
406
437
|
</vue-editor>
|
@@ -413,7 +444,7 @@
|
|
413
444
|
:clearable="widget.options.clearable"
|
414
445
|
:placeholder="widget.options.placeholder"
|
415
446
|
:style="{
|
416
|
-
width:
|
447
|
+
width: widget.options.width,
|
417
448
|
height: widget.options.height
|
418
449
|
}"
|
419
450
|
:options="widget.options.remoteOptions"
|
@@ -421,6 +452,7 @@
|
|
421
452
|
:show-all-levels="widget.options.showAllLevels ? false : true"
|
422
453
|
:collapse-tags="widget.options.collapseTags"
|
423
454
|
:filterable="widget.options.filterable"
|
455
|
+
@change="handleEventAction(widget.events.onChange)"
|
424
456
|
>
|
425
457
|
<template slot-scope="{ data }">
|
426
458
|
<span v-html="widget.options.prepend"></span>
|
@@ -430,20 +462,18 @@
|
|
430
462
|
</el-cascader>
|
431
463
|
</template>
|
432
464
|
|
433
|
-
<template v-if="widget.type == 'text'">
|
434
|
-
<span>{{ dataModel }}</span>
|
435
|
-
</template>
|
436
|
-
|
437
465
|
<template v-if="widget.type == 'blank'">
|
438
466
|
<slot :name="widget.model" />
|
439
467
|
</template>
|
440
468
|
|
441
469
|
<template v-if="widget.type == 'table'">
|
442
470
|
<el-table
|
443
|
-
|
471
|
+
style="width:100%"
|
444
472
|
:data="dataModel"
|
445
|
-
|
446
|
-
|
473
|
+
:stripe="widget.options.stripe"
|
474
|
+
:show-header="widget.options.showHeader"
|
475
|
+
:highlight-current-row="widget.options.highlightCurrentRow"
|
476
|
+
:border="widget.options.border"
|
447
477
|
>
|
448
478
|
<el-table-column
|
449
479
|
v-if="widget.options.isSerial"
|
@@ -454,22 +484,21 @@
|
|
454
484
|
>
|
455
485
|
</el-table-column>
|
456
486
|
<el-table-column
|
457
|
-
v-for="
|
458
|
-
:key="
|
459
|
-
:label="
|
460
|
-
:prop="
|
461
|
-
:width="
|
487
|
+
v-for="element in widget.list"
|
488
|
+
:key="`table_${element.key}`"
|
489
|
+
:label="element.name"
|
490
|
+
:prop="element.model"
|
491
|
+
:width="element.options.width"
|
462
492
|
>
|
463
493
|
<template slot-scope="scope">
|
464
494
|
<genetate-form-item
|
465
495
|
:models.sync="dataModel[scope.$index]"
|
466
|
-
:widget="
|
496
|
+
:widget="element"
|
467
497
|
:remote="remote"
|
468
|
-
:
|
469
|
-
:
|
470
|
-
:tableInfo="{ index: scope.$index, data: widget }"
|
471
|
-
width="100%"
|
498
|
+
:config="config"
|
499
|
+
:prop="`${prop}.${scope.$index}.${element.model}`"
|
472
500
|
:slotKeys="slotKeys"
|
501
|
+
:componentsData="componentsData"
|
473
502
|
>
|
474
503
|
<template v-for="name in slotKeys" :slot="name">
|
475
504
|
<slot :name="name" />
|
@@ -488,7 +517,6 @@
|
|
488
517
|
<el-button
|
489
518
|
style="color:#F56C6C"
|
490
519
|
type="text"
|
491
|
-
size="small"
|
492
520
|
@click.native.prevent="handleTableDelete(scope.$index)"
|
493
521
|
>
|
494
522
|
移除
|
@@ -514,51 +542,115 @@
|
|
514
542
|
</el-table>
|
515
543
|
</template>
|
516
544
|
|
545
|
+
<template v-if="widget.type == 'table_h5'">
|
546
|
+
<div class="tableH5">
|
547
|
+
<div
|
548
|
+
v-for="(column, columnIndex) in dataModel"
|
549
|
+
class="tableH5-item"
|
550
|
+
:key="`table_h5_${columnIndex}`"
|
551
|
+
>
|
552
|
+
<div
|
553
|
+
v-for="(element, elementIndex) in widget.list"
|
554
|
+
:key="`table_h5_${columnIndex}_${element.key}`"
|
555
|
+
>
|
556
|
+
<genetate-form-item
|
557
|
+
style="flex:1;"
|
558
|
+
:models.sync="column"
|
559
|
+
:widget="element"
|
560
|
+
:remote="remote"
|
561
|
+
:config="config"
|
562
|
+
:prop="
|
563
|
+
element.type === 'grid'
|
564
|
+
? `${prop}.${columnIndex}`
|
565
|
+
: `${prop}.${columnIndex}.${element.model}`
|
566
|
+
"
|
567
|
+
:slotKeys="slotKeys"
|
568
|
+
:componentsData="componentsData"
|
569
|
+
>
|
570
|
+
<template v-for="name in slotKeys" :slot="name">
|
571
|
+
<slot :name="name" />
|
572
|
+
</template>
|
573
|
+
</genetate-form-item>
|
574
|
+
<div
|
575
|
+
v-if="
|
576
|
+
widget.options.isDelete &&
|
577
|
+
elementIndex === 0 &&
|
578
|
+
columnIndex >= widget.options.deleteIndex
|
579
|
+
"
|
580
|
+
class="actions"
|
581
|
+
>
|
582
|
+
<el-button
|
583
|
+
type="danger"
|
584
|
+
@click.native.prevent="handleTableDelete(columnIndex)"
|
585
|
+
>{{ widget.options.deleteButtonText }}</el-button
|
586
|
+
>
|
587
|
+
</div>
|
588
|
+
</div>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
<div v-if="widget.options.isAdd" style="text-align: center;">
|
592
|
+
<el-button
|
593
|
+
type="text"
|
594
|
+
:disabled="widget.options.disabled"
|
595
|
+
@click="handleTableAdd"
|
596
|
+
>{{ widget.options.addButtonText }}</el-button
|
597
|
+
>
|
598
|
+
</div>
|
599
|
+
</div>
|
600
|
+
</template>
|
601
|
+
|
517
602
|
<template v-if="widget.type == 'grid'">
|
518
|
-
<
|
519
|
-
type="flex"
|
603
|
+
<th-row
|
520
604
|
:gutter="widget.options.gutter ? widget.options.gutter : 0"
|
521
605
|
:justify="widget.options.justify"
|
522
606
|
:align="widget.options.align"
|
523
607
|
>
|
524
|
-
<
|
525
|
-
v-for="(
|
526
|
-
:key="
|
527
|
-
:span="
|
608
|
+
<th-col
|
609
|
+
v-for="(column, columnIndex) in widget.columns"
|
610
|
+
:key="columnIndex"
|
611
|
+
:span="column.span"
|
528
612
|
>
|
529
613
|
<genetate-form-item
|
530
|
-
v-for="
|
531
|
-
:key="
|
614
|
+
v-for="element in column.list"
|
615
|
+
:key="element.key"
|
616
|
+
:widget="element"
|
532
617
|
:models="models"
|
533
|
-
:
|
618
|
+
:config="config"
|
534
619
|
:remote="remote"
|
620
|
+
:prop="prop ? `${prop}.${element.model}` : element.model"
|
535
621
|
:slotKeys="slotKeys"
|
536
|
-
:
|
622
|
+
:componentsData="componentsData"
|
537
623
|
>
|
538
624
|
<template v-for="name in slotKeys" :slot="name">
|
539
625
|
<slot :name="name" />
|
540
626
|
</template>
|
541
627
|
</genetate-form-item>
|
542
|
-
</
|
543
|
-
</
|
628
|
+
</th-col>
|
629
|
+
</th-row>
|
544
630
|
</template>
|
545
631
|
|
546
632
|
<template v-if="widget.type == 'tabs'">
|
547
633
|
<el-tabs v-model="widget.options.defaultValue">
|
548
634
|
<el-tab-pane
|
549
|
-
v-for="
|
550
|
-
:key="
|
551
|
-
:label="
|
552
|
-
:name="
|
635
|
+
v-for="(column, columnIndex) in widget.tabs"
|
636
|
+
:key="`tabs_${columnIndex}`"
|
637
|
+
:label="column.label"
|
638
|
+
:name="column.value"
|
553
639
|
>
|
554
640
|
<genetate-form-item
|
555
|
-
v-for="
|
556
|
-
:key="
|
557
|
-
:
|
558
|
-
:
|
641
|
+
v-for="element in column.list"
|
642
|
+
:key="`tabs_${columnIndex}_${element.key}`"
|
643
|
+
:widget="element"
|
644
|
+
:models.sync="dataModel[column.value]"
|
645
|
+
:config="config"
|
559
646
|
:remote="remote"
|
647
|
+
:prop="
|
648
|
+
element.type === 'grid'
|
649
|
+
? `${prop}.${column.value}`
|
650
|
+
: `${prop}.${column.value}.${element.model}`
|
651
|
+
"
|
560
652
|
:slotKeys="slotKeys"
|
561
|
-
:
|
653
|
+
:componentsData="componentsData"
|
562
654
|
>
|
563
655
|
<template v-for="name in slotKeys" :slot="name">
|
564
656
|
<slot :name="name" />
|
@@ -569,11 +661,8 @@
|
|
569
661
|
</template>
|
570
662
|
|
571
663
|
<template v-if="widget.type == 'divider'">
|
572
|
-
<el-divider
|
573
|
-
|
574
|
-
:style="{ height: `${widget.options.height}px` }"
|
575
|
-
>
|
576
|
-
{{ widget.name }}
|
664
|
+
<el-divider :content-position="widget.options.contentPosition">
|
665
|
+
{{ widget.options.defaultValue }}
|
577
666
|
</el-divider>
|
578
667
|
</template>
|
579
668
|
|
@@ -586,22 +675,23 @@
|
|
586
675
|
<script>
|
587
676
|
import FmUpload from "./Upload";
|
588
677
|
import { VueEditor } from "vue2-editor";
|
678
|
+
import ThCell from "ui/cell/index.vue";
|
679
|
+
import ThImage from "ui/image/index.vue";
|
680
|
+
import ThRow from "ui/row/index.vue";
|
681
|
+
import ThCol from "ui/col/index.vue";
|
682
|
+
|
589
683
|
export default {
|
590
684
|
name: "genetate-form-item",
|
591
685
|
props: [
|
592
686
|
"widget",
|
593
687
|
"models",
|
594
|
-
"rules",
|
595
688
|
"remote",
|
596
|
-
"
|
597
|
-
"
|
598
|
-
"
|
599
|
-
"
|
689
|
+
"prop",
|
690
|
+
"slotKeys",
|
691
|
+
"config",
|
692
|
+
"componentsData"
|
600
693
|
],
|
601
|
-
components: {
|
602
|
-
FmUpload,
|
603
|
-
VueEditor
|
604
|
-
},
|
694
|
+
components: { FmUpload, VueEditor, ThCell, ThImage, ThRow, ThCol },
|
605
695
|
data() {
|
606
696
|
return {
|
607
697
|
dataModel: this.models[this.widget.model],
|
@@ -609,6 +699,34 @@ export default {
|
|
609
699
|
dialogImageUrl: ""
|
610
700
|
};
|
611
701
|
},
|
702
|
+
watch: {
|
703
|
+
dataModel: {
|
704
|
+
deep: true,
|
705
|
+
handler(val) {
|
706
|
+
this.models[this.widget.model] = val;
|
707
|
+
this.$emit("update:models", {
|
708
|
+
...this.models,
|
709
|
+
[this.widget.model]: val
|
710
|
+
});
|
711
|
+
this.$emit("input-change", val, this.widget.model);
|
712
|
+
}
|
713
|
+
},
|
714
|
+
models: {
|
715
|
+
deep: true,
|
716
|
+
handler(val) {
|
717
|
+
this.dataModel = val[this.widget.model];
|
718
|
+
}
|
719
|
+
}
|
720
|
+
},
|
721
|
+
computed: {
|
722
|
+
labelWidth() {
|
723
|
+
if (this.widget.options.hideLabel) return "0";
|
724
|
+
if (this.widget.options.isLabelWidth)
|
725
|
+
return `${this.widget.options.labelWidth}px`;
|
726
|
+
|
727
|
+
return "";
|
728
|
+
}
|
729
|
+
},
|
612
730
|
created() {
|
613
731
|
if (
|
614
732
|
this.widget.options.remote &&
|
@@ -626,17 +744,18 @@ export default {
|
|
626
744
|
}
|
627
745
|
|
628
746
|
if (
|
629
|
-
this.widget.type === "
|
747
|
+
this.widget.type === "upload" &&
|
630
748
|
this.remote[this.widget.options.remoteFunc]
|
631
749
|
) {
|
632
750
|
this.remote[this.widget.options.remoteFunc](data => {
|
633
751
|
this.widget.options.remoteApi = data;
|
634
752
|
});
|
635
753
|
}
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
754
|
+
},
|
755
|
+
mounted() {
|
756
|
+
this.$nextTick(() => {
|
757
|
+
this.componentsData[this.widget.model] = this.widget;
|
758
|
+
});
|
640
759
|
},
|
641
760
|
methods: {
|
642
761
|
handleTimePicker(vals) {
|
@@ -671,31 +790,80 @@ export default {
|
|
671
790
|
handleTableAdd() {
|
672
791
|
let dic = {};
|
673
792
|
this.widget.list.forEach(item => {
|
674
|
-
|
793
|
+
if (item.type === "grid") {
|
794
|
+
for (let i = 0; i < item.columns.length; i++) {
|
795
|
+
const element = item.columns[i];
|
796
|
+
for (let j = 0; j < element.list.length; j++) {
|
797
|
+
const element2 = element.list[j];
|
798
|
+
dic[element2.model] = element2.options.defaultValue;
|
799
|
+
}
|
800
|
+
}
|
801
|
+
} else {
|
802
|
+
dic[item.model] = item.options.defaultValue;
|
803
|
+
}
|
675
804
|
});
|
676
805
|
this.dataModel.push(dic);
|
677
806
|
},
|
678
807
|
handleTableDelete(index) {
|
679
808
|
this.dataModel.splice(index, 1);
|
680
|
-
}
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
809
|
+
},
|
810
|
+
|
811
|
+
// 支撑 JavaScript 动态编译
|
812
|
+
handleEventAction(key) {
|
813
|
+
if (!key) return;
|
814
|
+
const eventScript = this.config.eventScript;
|
815
|
+
for (let i = 0; i < eventScript.length; i++) {
|
816
|
+
const element = eventScript[i];
|
817
|
+
if (element.key === key) {
|
818
|
+
const func = `(item,value)=>{${element.func}}`;
|
819
|
+
eval(func)(this.widget, this.dataModel);
|
820
|
+
}
|
692
821
|
}
|
693
822
|
},
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
823
|
+
// 显示组件
|
824
|
+
display(keys) {
|
825
|
+
if (!keys || keys.length === 0) return;
|
826
|
+
for (let i = 0; i < keys.length; i++) {
|
827
|
+
const key = keys[i];
|
828
|
+
if (this.componentsData[key]) {
|
829
|
+
// this.componentsData[key].options.hidden = false;
|
830
|
+
this.$set(this.componentsData[key].options, "hidden", false);
|
831
|
+
console.log("display =>", keys, this.componentsData);
|
832
|
+
}
|
698
833
|
}
|
834
|
+
},
|
835
|
+
// 隐藏组件
|
836
|
+
hide(keys) {
|
837
|
+
if (!keys || keys.length === 0) return;
|
838
|
+
for (let i = 0; i < keys.length; i++) {
|
839
|
+
const key = keys[i];
|
840
|
+
if (this.componentsData[key]) {
|
841
|
+
// this.componentsData[key].options.hidden = true;
|
842
|
+
this.$set(this.componentsData[key].options, "hidden", true);
|
843
|
+
console.log("hide =>", keys, this.componentsData);
|
844
|
+
}
|
845
|
+
}
|
846
|
+
},
|
847
|
+
// 设置数据,仅支持修改当前组件节点下的数据
|
848
|
+
setData(obj) {
|
849
|
+
const keys = Object.keys(obj);
|
850
|
+
for (let i = 0; i < keys.length; i++) {
|
851
|
+
const arr = keys[i].split(".");
|
852
|
+
if (arr.length === 1) {
|
853
|
+
const key = keys[i];
|
854
|
+
const value = obj[key];
|
855
|
+
this.$set(this.models, key, value);
|
856
|
+
} else {
|
857
|
+
const key = arr.pop();
|
858
|
+
const value = obj[keys[i]];
|
859
|
+
const path = arr.join(".");
|
860
|
+
this.$set(eval(`this.models.${path}`), key, value);
|
861
|
+
}
|
862
|
+
}
|
863
|
+
},
|
864
|
+
// 获取数据,仅支持获取当前组件节点下的数据
|
865
|
+
getData() {
|
866
|
+
return this.models;
|
699
867
|
}
|
700
868
|
}
|
701
869
|
};
|