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,134 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<el-dialog
|
3
|
-
class="cus-dialog-container"
|
4
|
-
:title="title"
|
5
|
-
:visible.sync="dialogVisible"
|
6
|
-
:close-on-click-modal="false"
|
7
|
-
append-to-body
|
8
|
-
center
|
9
|
-
:width="width"
|
10
|
-
ref="elDialog"
|
11
|
-
:id="id"
|
12
|
-
>
|
13
|
-
<span v-if="show">
|
14
|
-
<slot></slot>
|
15
|
-
</span>
|
16
|
-
|
17
|
-
<span v-if="action" slot="footer" class="dialog-footer" v-loading="loading"
|
18
|
-
:element-loading-text="loadingText">
|
19
|
-
<slot name="action">
|
20
|
-
<el-button @click="close">取 消</el-button>
|
21
|
-
<el-button type="primary" @click="submit" >确 定</el-button>
|
22
|
-
</slot>
|
23
|
-
</span>
|
24
|
-
</el-dialog>
|
25
|
-
</template>
|
26
|
-
|
27
|
-
<script>
|
28
|
-
export default {
|
29
|
-
props: {
|
30
|
-
visible: Boolean,
|
31
|
-
loadingText: {
|
32
|
-
type: String,
|
33
|
-
default: ''
|
34
|
-
},
|
35
|
-
title: {
|
36
|
-
type: String,
|
37
|
-
default: ''
|
38
|
-
},
|
39
|
-
width: {
|
40
|
-
type: String,
|
41
|
-
default: '600px'
|
42
|
-
},
|
43
|
-
form: {
|
44
|
-
type: Boolean,
|
45
|
-
default: true
|
46
|
-
},
|
47
|
-
action: {
|
48
|
-
type: Boolean,
|
49
|
-
default: true
|
50
|
-
}
|
51
|
-
},
|
52
|
-
computed: {
|
53
|
-
show () {
|
54
|
-
if (this.form) {
|
55
|
-
return this.showForm
|
56
|
-
} else {
|
57
|
-
return true
|
58
|
-
}
|
59
|
-
}
|
60
|
-
},
|
61
|
-
data () {
|
62
|
-
return {
|
63
|
-
loading: false,
|
64
|
-
dialogVisible: this.visible,
|
65
|
-
id: 'dialog_' + new Date().getTime(),
|
66
|
-
showForm: false
|
67
|
-
}
|
68
|
-
},
|
69
|
-
methods: {
|
70
|
-
close () {
|
71
|
-
this.dialogVisible = false
|
72
|
-
},
|
73
|
-
submit () {
|
74
|
-
this.loading = true
|
75
|
-
|
76
|
-
this.$emit('on-submit')
|
77
|
-
},
|
78
|
-
end () {
|
79
|
-
this.loading = false
|
80
|
-
}
|
81
|
-
},
|
82
|
-
mounted () {
|
83
|
-
},
|
84
|
-
watch: {
|
85
|
-
dialogVisible (val) {
|
86
|
-
if (!val) {
|
87
|
-
this.loading = false
|
88
|
-
this.$emit('on-close')
|
89
|
-
setTimeout(() => {
|
90
|
-
this.showForm = false
|
91
|
-
}, 300)
|
92
|
-
} else {
|
93
|
-
this.showForm = true
|
94
|
-
}
|
95
|
-
},
|
96
|
-
visible (val) {
|
97
|
-
this.dialogVisible = val
|
98
|
-
}
|
99
|
-
}
|
100
|
-
}
|
101
|
-
</script>
|
102
|
-
|
103
|
-
<style lang="scss">
|
104
|
-
.cus-dialog-container{
|
105
|
-
.el-dialog__footer{
|
106
|
-
margin: 0 20px;
|
107
|
-
// border-top: 1px dashed #ccc;
|
108
|
-
padding: 15px 0 16px;
|
109
|
-
text-align: center;
|
110
|
-
position: relative;
|
111
|
-
|
112
|
-
.dialog-footer{
|
113
|
-
display: block;
|
114
|
-
|
115
|
-
.circular{
|
116
|
-
display: inline-block;
|
117
|
-
vertical-align: middle;
|
118
|
-
margin-right: 5px;
|
119
|
-
width: 24px;
|
120
|
-
height: 24px;
|
121
|
-
}
|
122
|
-
|
123
|
-
.el-loading-text{
|
124
|
-
display: inline-block;
|
125
|
-
vertical-align: middle;
|
126
|
-
}
|
127
|
-
|
128
|
-
.el-loading-spinner{
|
129
|
-
margin-top: -12px;
|
130
|
-
}
|
131
|
-
}
|
132
|
-
}
|
133
|
-
}
|
134
|
-
</style>
|
@@ -1,174 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="fm-style">
|
3
|
-
<el-form
|
4
|
-
ref="generateForm"
|
5
|
-
label-suffix=":"
|
6
|
-
:size="data.config.size"
|
7
|
-
:model="models"
|
8
|
-
:rules="rules"
|
9
|
-
:label-position="data.config.labelPosition"
|
10
|
-
:label-width="data.config.labelWidth + 'px'"
|
11
|
-
>
|
12
|
-
<genetate-form-item
|
13
|
-
v-for="item in data.list"
|
14
|
-
:key="item.key"
|
15
|
-
:models.sync="models"
|
16
|
-
:rules="rules"
|
17
|
-
:widget="item"
|
18
|
-
:slotKeys="slotKeys"
|
19
|
-
@input-change="onInputChange"
|
20
|
-
:remote="remote"
|
21
|
-
>
|
22
|
-
<template v-for="name in slotKeys" :slot="name">
|
23
|
-
<slot :name="name" />
|
24
|
-
</template>
|
25
|
-
</genetate-form-item>
|
26
|
-
</el-form>
|
27
|
-
</div>
|
28
|
-
</template>
|
29
|
-
|
30
|
-
<script>
|
31
|
-
import GenetateFormItem from "./GenerateFormItem";
|
32
|
-
|
33
|
-
export default {
|
34
|
-
name: "fm-generate-form",
|
35
|
-
components: {
|
36
|
-
GenetateFormItem
|
37
|
-
},
|
38
|
-
props: ["data", "remote", "value", "insite", "slotKeys"],
|
39
|
-
data() {
|
40
|
-
return {
|
41
|
-
models: {},
|
42
|
-
rules: {}
|
43
|
-
};
|
44
|
-
},
|
45
|
-
created() {
|
46
|
-
this.generateModle(this.data.list);
|
47
|
-
},
|
48
|
-
mounted() {},
|
49
|
-
methods: {
|
50
|
-
generateModle(genList, obj) {
|
51
|
-
genList.map(item => {
|
52
|
-
if (item.type === "grid") {
|
53
|
-
item.columns.forEach(item => {
|
54
|
-
this.generateModle(item.list, obj);
|
55
|
-
});
|
56
|
-
} else if (item.type === "tabs") {
|
57
|
-
if (obj) {
|
58
|
-
obj[item.model] = {};
|
59
|
-
item.tabs.forEach(item2 => {
|
60
|
-
obj[item.model][item2.value] = {};
|
61
|
-
this.generateModle(
|
62
|
-
item2.list,
|
63
|
-
obj[item.model][item2.value]
|
64
|
-
);
|
65
|
-
});
|
66
|
-
} else {
|
67
|
-
this.models[item.model] = {};
|
68
|
-
item.tabs.forEach(item2 => {
|
69
|
-
this.models[item.model][item2.value] = {};
|
70
|
-
this.generateModle(
|
71
|
-
item2.list,
|
72
|
-
this.models[item.model][item2.value]
|
73
|
-
);
|
74
|
-
});
|
75
|
-
}
|
76
|
-
} else if (obj) {
|
77
|
-
obj[item.model] = JSON.parse(
|
78
|
-
JSON.stringify(item.options.defaultValue || "")
|
79
|
-
);
|
80
|
-
} else {
|
81
|
-
if (this.value && Object.keys(this.value).indexOf(item.model) >= 0) {
|
82
|
-
this.models[item.model] = this.value[item.model];
|
83
|
-
} else {
|
84
|
-
if (item.type === "blank") {
|
85
|
-
this.$set(
|
86
|
-
this.models,
|
87
|
-
item.model,
|
88
|
-
item.options.defaultType === "String"
|
89
|
-
? ""
|
90
|
-
: item.options.defaultType === "Object"
|
91
|
-
? {}
|
92
|
-
: []
|
93
|
-
);
|
94
|
-
} else {
|
95
|
-
this.models[item.model] = JSON.parse(
|
96
|
-
JSON.stringify(item.options.defaultValue || "")
|
97
|
-
);
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
if (item.type === "table") {
|
102
|
-
this.generateRules(item);
|
103
|
-
item.list.forEach(item2 => {
|
104
|
-
this.generateRules(item2);
|
105
|
-
});
|
106
|
-
} else {
|
107
|
-
this.generateRules(item);
|
108
|
-
}
|
109
|
-
}
|
110
|
-
});
|
111
|
-
},
|
112
|
-
generateRules(item) {
|
113
|
-
if (this.rules[item.model]) {
|
114
|
-
this.rules[item.model] = [
|
115
|
-
...this.rules[item.model],
|
116
|
-
...item.rules.map(rule => {
|
117
|
-
if (rule.pattern) {
|
118
|
-
return { ...rule, pattern: new RegExp(rule.pattern) };
|
119
|
-
} else {
|
120
|
-
return { ...rule };
|
121
|
-
}
|
122
|
-
})
|
123
|
-
];
|
124
|
-
} else {
|
125
|
-
this.rules[item.model] = [
|
126
|
-
...item.rules.map(rule => {
|
127
|
-
if (rule.pattern) {
|
128
|
-
return { ...rule, pattern: new RegExp(rule.pattern) };
|
129
|
-
} else {
|
130
|
-
return { ...rule };
|
131
|
-
}
|
132
|
-
})
|
133
|
-
];
|
134
|
-
}
|
135
|
-
},
|
136
|
-
getData() {
|
137
|
-
return new Promise((resolve, reject) => {
|
138
|
-
this.$refs.generateForm.validate(valid => {
|
139
|
-
if (valid) {
|
140
|
-
resolve(this.models);
|
141
|
-
} else {
|
142
|
-
reject(new Error("表单数据校验失败").message);
|
143
|
-
}
|
144
|
-
});
|
145
|
-
});
|
146
|
-
},
|
147
|
-
reset() {
|
148
|
-
this.$refs.generateForm.resetFields();
|
149
|
-
},
|
150
|
-
onInputChange(value, field) {
|
151
|
-
this.$emit("on-change", field, value, this.models);
|
152
|
-
},
|
153
|
-
refresh() {}
|
154
|
-
},
|
155
|
-
watch: {
|
156
|
-
data: {
|
157
|
-
deep: true,
|
158
|
-
handler(val) {
|
159
|
-
// this.generateModle(val.list);
|
160
|
-
}
|
161
|
-
},
|
162
|
-
value: {
|
163
|
-
deep: true,
|
164
|
-
handler(val) {
|
165
|
-
this.models = { ...this.models, ...val };
|
166
|
-
}
|
167
|
-
}
|
168
|
-
}
|
169
|
-
};
|
170
|
-
</script>
|
171
|
-
|
172
|
-
<style lang="scss">
|
173
|
-
// @import '../styles/cover.scss';
|
174
|
-
</style>
|