cloud-web-corejs 1.0.54-dev.702 → 1.0.54-dev.704
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/package.json +1 -1
- package/src/components/xform/docs//345/220/216/345/217/260/345/255/227/346/256/265/357/274/210/345/212/250/346/200/201/347/224/237/346/210/220/357/274/211JSON /350/257/264/346/230/216.md" +41 -16
- package/src/components/xform/docs//346/225/260/346/215/256/350/241/250/346/240/274/345/212/250/346/200/201/345/210/227 JSON /350/257/264/346/230/216.md" +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +1 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +207 -215
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/cascader-multiple-editor.vue +8 -3
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +7 -2
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +90 -10
- package/src/components/xform/utils/dynamicSchemaUtil.js +3 -0
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +85 -11
- package/src/views/user/home/default2.vue +1148 -0
|
@@ -1,95 +1,163 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="table-dynamic-field-editor">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<el-form-item>
|
|
3
|
+
<el-form-item label-width="0">
|
|
4
|
+
<el-divider class="custom-divider-margin-top">
|
|
5
|
+
动态字段
|
|
6
|
+
<el-tooltip effect="light" placement="top">
|
|
7
|
+
<div slot="content" class="field-tip-content">
|
|
8
|
+
字段「显隐/必填/只读/禁用/取值」等动态规则请到「表单设置 -
|
|
9
|
+
动态字段规则」统一配置
|
|
10
|
+
</div>
|
|
11
|
+
<i class="el-icon-info label-tip-icon"></i>
|
|
12
|
+
</el-tooltip>
|
|
13
|
+
</el-divider>
|
|
14
|
+
</el-form-item>
|
|
15
|
+
<el-form-item label="动态字段来源">
|
|
16
|
+
<el-radio-group v-model="optionModel.dynamicSchemaSourceType">
|
|
17
|
+
<el-radio label="none">无</el-radio>
|
|
18
|
+
<el-radio label="script">前端字段脚本</el-radio>
|
|
19
|
+
<el-radio label="api">接口动态字段</el-radio>
|
|
20
|
+
</el-radio-group>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
<div
|
|
23
|
+
v-if="optionModel.dynamicSchemaSourceType === 'script'"
|
|
24
|
+
class="dynamic-column-block"
|
|
25
|
+
>
|
|
26
|
+
<div class="form-section-label">
|
|
27
|
+
前端字段脚本
|
|
28
|
+
<el-tooltip effect="light" placement="top">
|
|
29
|
+
<div slot="content" class="field-tip-content">
|
|
30
|
+
不调接口,脚本直接 return 字段定义数组或 { fields: [...] }
|
|
31
|
+
</div>
|
|
32
|
+
<i class="el-icon-info label-tip-icon"></i>
|
|
33
|
+
</el-tooltip>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="data-table-editor-subsection">
|
|
36
|
+
<el-form-item label="字段脚本">
|
|
37
|
+
<a
|
|
38
|
+
href="javascript:void(0);"
|
|
39
|
+
class="a-link link-oneLind"
|
|
40
|
+
@click="editEventHandler('dynamicSchemaScript', defaultEventParams)"
|
|
41
|
+
>
|
|
42
|
+
<span>{{ optionModel.dynamicSchemaScript }}</span>
|
|
43
|
+
<i class="el-icon-edit"></i>
|
|
44
|
+
</a>
|
|
45
|
+
</el-form-item>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div
|
|
49
|
+
v-if="optionModel.dynamicSchemaSourceType === 'api'"
|
|
50
|
+
class="dynamic-column-block"
|
|
51
|
+
>
|
|
52
|
+
<div class="form-section-label">
|
|
53
|
+
接口动态字段
|
|
54
|
+
<el-tooltip effect="light" placement="top">
|
|
55
|
+
<div slot="content" class="field-tip-content">
|
|
56
|
+
打开表单时请求后台脚本,返回字段定义(格式与数据表格动态列一致,详见
|
|
57
|
+
docs/后台字段(动态生成)JSON 说明.md)
|
|
58
|
+
</div>
|
|
59
|
+
<i class="el-icon-info label-tip-icon"></i>
|
|
60
|
+
</el-tooltip>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="data-table-editor-subsection">
|
|
63
|
+
<el-form-item label="脚本编码">
|
|
64
|
+
<el-input
|
|
65
|
+
v-model="optionModel.dynamicSchemaScriptCode"
|
|
66
|
+
clearable
|
|
67
|
+
placeholder="scriptCode 或 formCode/scriptCode"
|
|
68
|
+
></el-input>
|
|
69
|
+
</el-form-item>
|
|
70
|
+
<el-form-item>
|
|
71
|
+
<span slot="label">
|
|
72
|
+
额外参数
|
|
73
|
+
<el-tooltip effect="light" placement="top">
|
|
74
|
+
<div slot="content" class="field-tip-content">
|
|
75
|
+
格式: return { bizType: this.formModel.type }
|
|
76
|
+
</div>
|
|
77
|
+
<i class="el-icon-info label-tip-icon"></i>
|
|
78
|
+
</el-tooltip>
|
|
79
|
+
</span>
|
|
80
|
+
<a
|
|
81
|
+
href="javascript:void(0);"
|
|
82
|
+
class="a-link link-oneLind"
|
|
83
|
+
@click="
|
|
84
|
+
editEventHandler('dynamicSchemaScriptParam', tableConfigParams)
|
|
85
|
+
"
|
|
86
|
+
>
|
|
87
|
+
<span>{{ optionModel.dynamicSchemaScriptParam }}</span>
|
|
88
|
+
<i class="el-icon-edit"></i>
|
|
89
|
+
</a>
|
|
90
|
+
</el-form-item>
|
|
91
|
+
<el-form-item>
|
|
92
|
+
<span slot="label">
|
|
93
|
+
转换脚本
|
|
94
|
+
<el-tooltip effect="light" placement="top">
|
|
95
|
+
<div slot="content" class="field-tip-content">
|
|
96
|
+
可选。入参 res,返回标准定义数组;不填时默认取
|
|
97
|
+
res.objx(数组)或 res.objx.fields / res.objx.columns
|
|
98
|
+
</div>
|
|
99
|
+
<i class="el-icon-info label-tip-icon"></i>
|
|
100
|
+
</el-tooltip>
|
|
101
|
+
</span>
|
|
102
|
+
<a
|
|
103
|
+
href="javascript:void(0);"
|
|
104
|
+
class="a-link link-oneLind"
|
|
105
|
+
@click="editDynamicSchemaConvert"
|
|
106
|
+
>
|
|
107
|
+
<span>{{ dynamicSchemaConvertDisplay }}</span>
|
|
108
|
+
<i class="el-icon-edit"></i>
|
|
109
|
+
</a>
|
|
110
|
+
</el-form-item>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div
|
|
114
|
+
v-if="optionModel.dynamicSchemaSourceType !== 'none'"
|
|
115
|
+
class="dynamic-column-block"
|
|
116
|
+
>
|
|
117
|
+
<div class="data-table-editor-subsection">
|
|
118
|
+
<el-form-item>
|
|
119
|
+
<span slot="label">
|
|
120
|
+
加载条件
|
|
121
|
+
<el-tooltip effect="light" placement="top">
|
|
122
|
+
<div slot="content" class="field-tip-content">
|
|
123
|
+
表单初始化加载动态字段前执行。<br />
|
|
124
|
+
<code>return false</code> 时不加载;不配置则默认加载。
|
|
125
|
+
</div>
|
|
126
|
+
<i class="el-icon-info label-tip-icon"></i>
|
|
127
|
+
</el-tooltip>
|
|
128
|
+
</span>
|
|
129
|
+
<a
|
|
130
|
+
href="javascript:void(0);"
|
|
131
|
+
class="a-link link-oneLind"
|
|
132
|
+
@click="
|
|
133
|
+
editEventHandler('dynamicSchemaLoadScript', tableConfigParams)
|
|
134
|
+
"
|
|
135
|
+
>
|
|
136
|
+
<span>{{ optionModel.dynamicSchemaLoadScript }}</span>
|
|
137
|
+
<i class="el-icon-edit"></i>
|
|
138
|
+
</a>
|
|
139
|
+
</el-form-item>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<el-form-item v-if="optionModel.dynamicSchemaSourceType !== 'none'">
|
|
16
143
|
<span slot="label">
|
|
17
|
-
|
|
144
|
+
生成模式
|
|
18
145
|
<el-tooltip effect="light" placement="top">
|
|
19
146
|
<div slot="content" class="field-tip-content">
|
|
20
|
-
|
|
147
|
+
对<strong>生效的动态字段</strong>与静态字段的合并方式:<br />
|
|
148
|
+
追加 — 静态字段 + 动态字段;替换 — 仅动态字段;锚点插入 —
|
|
149
|
+
插到占位行位置。
|
|
21
150
|
</div>
|
|
22
151
|
<i class="el-icon-info label-tip-icon"></i>
|
|
23
152
|
</el-tooltip>
|
|
24
153
|
</span>
|
|
25
|
-
<el-
|
|
154
|
+
<el-select v-model="optionModel.dynamicSchemaMode" style="width: 100%">
|
|
155
|
+
<el-option label="追加到静态字段" value="append"></el-option>
|
|
156
|
+
<el-option label="替换静态字段" value="replace"></el-option>
|
|
157
|
+
<el-option label="锚点插入" value="anchor"></el-option>
|
|
158
|
+
</el-select>
|
|
26
159
|
</el-form-item>
|
|
27
|
-
|
|
28
|
-
<template v-if="optionModel.dynamicSchemaEnabled">
|
|
29
|
-
<el-form-item label="脚本编码">
|
|
30
|
-
<el-input
|
|
31
|
-
v-model="optionModel.dynamicSchemaScriptCode"
|
|
32
|
-
size="mini"
|
|
33
|
-
placeholder="scriptCode 或 formCode/scriptCode"
|
|
34
|
-
></el-input>
|
|
35
|
-
</el-form-item>
|
|
36
|
-
<el-form-item>
|
|
37
|
-
<span slot="label">
|
|
38
|
-
额外参数
|
|
39
|
-
<el-tooltip effect="light" placement="top">
|
|
40
|
-
<div slot="content" class="field-tip-content">
|
|
41
|
-
与数据表格动态列一致:return { bizType: this.formModel.type },固定附带
|
|
42
|
-
formData
|
|
43
|
-
</div>
|
|
44
|
-
<i class="el-icon-info label-tip-icon"></i>
|
|
45
|
-
</el-tooltip>
|
|
46
|
-
</span>
|
|
47
|
-
<a
|
|
48
|
-
href="javascript:void(0);"
|
|
49
|
-
class="a-link link-oneLind"
|
|
50
|
-
@click="editSchemaScriptParam"
|
|
51
|
-
>
|
|
52
|
-
<span>{{ optionModel.dynamicSchemaScriptParam }}</span>
|
|
53
|
-
<i class="el-icon-edit"></i>
|
|
54
|
-
</a>
|
|
55
|
-
</el-form-item>
|
|
56
|
-
<el-form-item>
|
|
57
|
-
<span slot="label">
|
|
58
|
-
转换脚本
|
|
59
|
-
<el-tooltip effect="light" placement="top">
|
|
60
|
-
<div slot="content" class="field-tip-content">
|
|
61
|
-
可选。入参 res,返回标准定义数组或 { fields/columns: [...] };不填时默认取
|
|
62
|
-
res.objx(数组)或 res.objx.fields / res.objx.columns
|
|
63
|
-
</div>
|
|
64
|
-
<i class="el-icon-info label-tip-icon"></i>
|
|
65
|
-
</el-tooltip>
|
|
66
|
-
</span>
|
|
67
|
-
<a
|
|
68
|
-
href="javascript:void(0);"
|
|
69
|
-
class="a-link link-oneLind"
|
|
70
|
-
@click="editSchemaConvert"
|
|
71
|
-
>
|
|
72
|
-
<span>{{ optionModel.dynamicSchemaConvert }}</span>
|
|
73
|
-
<i class="el-icon-edit"></i>
|
|
74
|
-
</a>
|
|
75
|
-
</el-form-item>
|
|
76
|
-
<el-form-item>
|
|
77
|
-
<span slot="label">
|
|
78
|
-
生成模式
|
|
79
|
-
<el-tooltip effect="light" placement="top">
|
|
80
|
-
<div slot="content" class="field-tip-content">
|
|
81
|
-
追加=保留已配字段并在其后生成;替换=清空已配行后全部由后台生成;锚点插入=插到设计期某占位行位置
|
|
82
|
-
</div>
|
|
83
|
-
<i class="el-icon-info label-tip-icon"></i>
|
|
84
|
-
</el-tooltip>
|
|
85
|
-
</span>
|
|
86
|
-
<el-radio-group v-model="optionModel.dynamicSchemaMode" size="mini">
|
|
87
|
-
<el-radio-button label="append">追加</el-radio-button>
|
|
88
|
-
<el-radio-button label="replace">替换</el-radio-button>
|
|
89
|
-
<el-radio-button label="anchor">锚点插入</el-radio-button>
|
|
90
|
-
</el-radio-group>
|
|
91
|
-
</el-form-item>
|
|
92
|
-
|
|
160
|
+
<template v-if="optionModel.dynamicSchemaSourceType !== 'none'">
|
|
93
161
|
<template v-if="optionModel.dynamicSchemaMode === 'anchor'">
|
|
94
162
|
<el-form-item>
|
|
95
163
|
<span slot="label">
|
|
@@ -103,7 +171,6 @@
|
|
|
103
171
|
</span>
|
|
104
172
|
<el-select
|
|
105
173
|
v-model="optionModel.dynamicSchemaAnchorRowId"
|
|
106
|
-
size="mini"
|
|
107
174
|
style="width: 100%"
|
|
108
175
|
placeholder="选择设计期的占位行"
|
|
109
176
|
>
|
|
@@ -116,21 +183,21 @@
|
|
|
116
183
|
</el-select>
|
|
117
184
|
</el-form-item>
|
|
118
185
|
<el-form-item label="插入位置">
|
|
119
|
-
<el-
|
|
186
|
+
<el-select
|
|
120
187
|
v-model="optionModel.dynamicSchemaAnchorPosition"
|
|
121
|
-
|
|
188
|
+
style="width: 100%"
|
|
122
189
|
>
|
|
123
|
-
<el-
|
|
124
|
-
<el-
|
|
125
|
-
<el-
|
|
126
|
-
</el-
|
|
190
|
+
<el-option label="替换占位行" value="replace"></el-option>
|
|
191
|
+
<el-option label="之前" value="before"></el-option>
|
|
192
|
+
<el-option label="之后" value="after"></el-option>
|
|
193
|
+
</el-select>
|
|
127
194
|
</el-form-item>
|
|
128
195
|
<el-form-item>
|
|
129
196
|
<span slot="label">
|
|
130
197
|
继承行布局
|
|
131
198
|
<el-tooltip effect="light" placement="top">
|
|
132
199
|
<div slot="content" class="field-tip-content">
|
|
133
|
-
|
|
200
|
+
开启后生成行沿用占位行的单元格数量/宽度/跨列,否则按「每行列数」平铺
|
|
134
201
|
</div>
|
|
135
202
|
<i class="el-icon-info label-tip-icon"></i>
|
|
136
203
|
</el-tooltip>
|
|
@@ -140,111 +207,32 @@
|
|
|
140
207
|
></el-switch>
|
|
141
208
|
</el-form-item>
|
|
142
209
|
</template>
|
|
143
|
-
|
|
144
210
|
<el-form-item
|
|
145
|
-
label="每行列数"
|
|
146
211
|
v-if="
|
|
147
212
|
optionModel.dynamicSchemaMode !== 'anchor' ||
|
|
148
213
|
!optionModel.dynamicSchemaInheritLayout
|
|
149
214
|
"
|
|
215
|
+
label="每行列数"
|
|
150
216
|
>
|
|
151
217
|
<el-input-number
|
|
152
218
|
v-model="optionModel.dynamicSchemaColumns"
|
|
153
219
|
:min="1"
|
|
154
220
|
:max="12"
|
|
155
|
-
|
|
221
|
+
controls-position="right"
|
|
222
|
+
style="width: 100%"
|
|
156
223
|
></el-input-number>
|
|
157
224
|
</el-form-item>
|
|
158
225
|
</template>
|
|
159
|
-
|
|
160
|
-
<el-dialog
|
|
161
|
-
title="额外参数"
|
|
162
|
-
:visible.sync="scriptParamDialogVisible"
|
|
163
|
-
v-if="scriptParamDialogVisible"
|
|
164
|
-
:show-close="true"
|
|
165
|
-
custom-class="dialog-style list-dialog"
|
|
166
|
-
v-dialog-drag
|
|
167
|
-
:close-on-click-modal="false"
|
|
168
|
-
:close-on-press-escape="false"
|
|
169
|
-
:destroy-on-close="true"
|
|
170
|
-
:append-to-body="true"
|
|
171
|
-
:modal-append-to-body="true"
|
|
172
|
-
>
|
|
173
|
-
<div class="cont">
|
|
174
|
-
<code-editor
|
|
175
|
-
:mode="'javascript'"
|
|
176
|
-
:readonly="false"
|
|
177
|
-
v-model="editingScriptParam"
|
|
178
|
-
ref="schemaScriptParamEditor"
|
|
179
|
-
></code-editor>
|
|
180
|
-
</div>
|
|
181
|
-
<div slot="footer" class="dialog-footer">
|
|
182
|
-
<el-button
|
|
183
|
-
@click="scriptParamDialogVisible = false"
|
|
184
|
-
class="button-sty"
|
|
185
|
-
icon="el-icon-close"
|
|
186
|
-
>
|
|
187
|
-
{{ i18nt("designer.hint.cancel") }}
|
|
188
|
-
</el-button>
|
|
189
|
-
<el-button
|
|
190
|
-
type="primary"
|
|
191
|
-
@click="saveSchemaScriptParam"
|
|
192
|
-
class="button-sty"
|
|
193
|
-
icon="el-icon-check"
|
|
194
|
-
>
|
|
195
|
-
{{ i18nt("designer.hint.confirm") }}
|
|
196
|
-
</el-button>
|
|
197
|
-
</div>
|
|
198
|
-
</el-dialog>
|
|
199
|
-
|
|
200
|
-
<el-dialog
|
|
201
|
-
title="转换脚本"
|
|
202
|
-
:visible.sync="convertDialogVisible"
|
|
203
|
-
v-if="convertDialogVisible"
|
|
204
|
-
:show-close="true"
|
|
205
|
-
custom-class="dialog-style list-dialog"
|
|
206
|
-
v-dialog-drag
|
|
207
|
-
:close-on-click-modal="false"
|
|
208
|
-
:close-on-press-escape="false"
|
|
209
|
-
:destroy-on-close="true"
|
|
210
|
-
:append-to-body="true"
|
|
211
|
-
:modal-append-to-body="true"
|
|
212
|
-
>
|
|
213
|
-
<div class="cont">
|
|
214
|
-
<code-editor
|
|
215
|
-
:mode="'javascript'"
|
|
216
|
-
:readonly="false"
|
|
217
|
-
v-model="editingConvert"
|
|
218
|
-
ref="schemaConvertEditor"
|
|
219
|
-
></code-editor>
|
|
220
|
-
</div>
|
|
221
|
-
<div slot="footer" class="dialog-footer">
|
|
222
|
-
<el-button
|
|
223
|
-
@click="convertDialogVisible = false"
|
|
224
|
-
class="button-sty"
|
|
225
|
-
icon="el-icon-close"
|
|
226
|
-
>
|
|
227
|
-
{{ i18nt("designer.hint.cancel") }}
|
|
228
|
-
</el-button>
|
|
229
|
-
<el-button
|
|
230
|
-
type="primary"
|
|
231
|
-
@click="saveSchemaConvert"
|
|
232
|
-
class="button-sty"
|
|
233
|
-
icon="el-icon-check"
|
|
234
|
-
>
|
|
235
|
-
{{ i18nt("designer.hint.confirm") }}
|
|
236
|
-
</el-button>
|
|
237
|
-
</div>
|
|
238
|
-
</el-dialog>
|
|
239
226
|
</div>
|
|
240
227
|
</template>
|
|
241
228
|
|
|
242
229
|
<script>
|
|
243
230
|
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
231
|
+
import eventMixin from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
|
244
232
|
|
|
245
233
|
export default {
|
|
246
234
|
name: "table-dynamicField-editor",
|
|
247
|
-
mixins: [i18n],
|
|
235
|
+
mixins: [i18n, eventMixin],
|
|
248
236
|
props: {
|
|
249
237
|
designer: Object,
|
|
250
238
|
selectedWidget: Object,
|
|
@@ -252,13 +240,30 @@ export default {
|
|
|
252
240
|
},
|
|
253
241
|
data() {
|
|
254
242
|
return {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
editingScriptParam: "",
|
|
258
|
-
editingConvert: "",
|
|
243
|
+
tableConfigParams: ["dataId", "formCode"],
|
|
244
|
+
defaultEventParams: ["dataId", "formCode"],
|
|
259
245
|
};
|
|
260
246
|
},
|
|
247
|
+
created() {
|
|
248
|
+
if (this.optionModel.dynamicSchemaSourceType === undefined) {
|
|
249
|
+
const legacyEnabled = this.optionModel.dynamicSchemaEnabled;
|
|
250
|
+
this.$set(
|
|
251
|
+
this.optionModel,
|
|
252
|
+
"dynamicSchemaSourceType",
|
|
253
|
+
legacyEnabled ? "api" : "none"
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
if (this.optionModel.dynamicSchemaScript === undefined) {
|
|
257
|
+
this.$set(this.optionModel, "dynamicSchemaScript", null);
|
|
258
|
+
}
|
|
259
|
+
if (this.optionModel.dynamicSchemaLoadScript === undefined) {
|
|
260
|
+
this.$set(this.optionModel, "dynamicSchemaLoadScript", null);
|
|
261
|
+
}
|
|
262
|
+
},
|
|
261
263
|
computed: {
|
|
264
|
+
dynamicSchemaConvertDisplay() {
|
|
265
|
+
return this.optionModel.dynamicSchemaConvert || "";
|
|
266
|
+
},
|
|
262
267
|
rowOptions() {
|
|
263
268
|
const rows = (this.selectedWidget && this.selectedWidget.rows) || [];
|
|
264
269
|
return rows.map((row, idx) => {
|
|
@@ -275,43 +280,8 @@ export default {
|
|
|
275
280
|
},
|
|
276
281
|
},
|
|
277
282
|
methods: {
|
|
278
|
-
|
|
279
|
-
this.
|
|
280
|
-
this.scriptParamDialogVisible = true;
|
|
281
|
-
},
|
|
282
|
-
saveSchemaScriptParam() {
|
|
283
|
-
if (!this.validateEditor("schemaScriptParamEditor")) return;
|
|
284
|
-
this.optionModel.dynamicSchemaScriptParam = this.editingScriptParam;
|
|
285
|
-
this.scriptParamDialogVisible = false;
|
|
286
|
-
},
|
|
287
|
-
editSchemaConvert() {
|
|
288
|
-
this.editingConvert = this.optionModel.dynamicSchemaConvert || "";
|
|
289
|
-
this.convertDialogVisible = true;
|
|
290
|
-
},
|
|
291
|
-
saveSchemaConvert() {
|
|
292
|
-
if (!this.validateEditor("schemaConvertEditor")) return;
|
|
293
|
-
this.optionModel.dynamicSchemaConvert = this.editingConvert;
|
|
294
|
-
this.convertDialogVisible = false;
|
|
295
|
-
},
|
|
296
|
-
validateEditor(refName) {
|
|
297
|
-
const editor = this.$refs[refName];
|
|
298
|
-
if (!editor) return true;
|
|
299
|
-
const codeHints = editor.getEditorAnnotations();
|
|
300
|
-
let syntaxErrorFlag = false;
|
|
301
|
-
if (codeHints && codeHints.length > 0) {
|
|
302
|
-
codeHints.forEach((chItem) => {
|
|
303
|
-
if (chItem.type === "error") {
|
|
304
|
-
syntaxErrorFlag = true;
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
if (syntaxErrorFlag) {
|
|
308
|
-
this.$message.error(
|
|
309
|
-
this.i18nt("designer.setting.syntaxCheckWarning")
|
|
310
|
-
);
|
|
311
|
-
return false;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return true;
|
|
283
|
+
editDynamicSchemaConvert() {
|
|
284
|
+
this.editEventHandler("dynamicSchemaConvert", ["res"]);
|
|
315
285
|
},
|
|
316
286
|
collectFields(list, out) {
|
|
317
287
|
(list || []).forEach((w) => {
|
|
@@ -337,6 +307,20 @@ export default {
|
|
|
337
307
|
</script>
|
|
338
308
|
|
|
339
309
|
<style lang="scss" scoped>
|
|
310
|
+
.data-table-editor-subsection {
|
|
311
|
+
margin: 0 0 4px 8px;
|
|
312
|
+
padding-left: 12px;
|
|
313
|
+
border-left: 2px solid #ebeef5;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.form-section-label {
|
|
317
|
+
font-size: 13px;
|
|
318
|
+
font-weight: 500;
|
|
319
|
+
color: #303133;
|
|
320
|
+
line-height: 22px;
|
|
321
|
+
margin-bottom: 8px;
|
|
322
|
+
}
|
|
323
|
+
|
|
340
324
|
.label-tip-icon {
|
|
341
325
|
margin-left: 4px;
|
|
342
326
|
color: #909399;
|
|
@@ -349,4 +333,12 @@ export default {
|
|
|
349
333
|
line-height: 1.4;
|
|
350
334
|
max-width: 320px;
|
|
351
335
|
}
|
|
336
|
+
|
|
337
|
+
.dynamic-column-block {
|
|
338
|
+
margin-bottom: 12px;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.dynamic-column-block .data-table-editor-subsection {
|
|
342
|
+
margin-top: 0;
|
|
343
|
+
}
|
|
352
344
|
</style>
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<el-
|
|
4
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item :label="i18nt('designer.setting.multiple')">
|
|
4
|
+
<el-switch v-model="optionModel.multiple"></el-switch>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<el-form-item :label="i18nt('平铺选项')">
|
|
7
|
+
<el-switch v-model="optionModel.flatCollapseTags"></el-switch>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
</div>
|
|
5
10
|
</template>
|
|
6
11
|
|
|
7
12
|
<script>
|
|
@@ -108,7 +108,7 @@ const COMMON_PROPERTIES = {
|
|
|
108
108
|
detailPaneContainer: "detail-pane-editor",
|
|
109
109
|
vabSearchField: "vabSearchField-editor",
|
|
110
110
|
fullWidth: "table-fullWidth-editor",
|
|
111
|
-
|
|
111
|
+
dynamicSchemaSourceType: "table-dynamicField-editor",
|
|
112
112
|
dataTable: "data-table-editor",
|
|
113
113
|
accessUrl: "accessUrl-editor",
|
|
114
114
|
formulaEnabled: "formulaEnabled-editor",
|
|
@@ -31,8 +31,12 @@ export const containers = [
|
|
|
31
31
|
customClass: "",
|
|
32
32
|
styleTableClass: "",
|
|
33
33
|
fullWidth: false,
|
|
34
|
-
//
|
|
35
|
-
|
|
34
|
+
// 动态字段来源:none=不加载,script=前端字段脚本,api=接口动态字段
|
|
35
|
+
dynamicSchemaSourceType: "none",
|
|
36
|
+
// 前端字段脚本:直接 return 字段定义数组或 { fields: [...] }
|
|
37
|
+
dynamicSchemaScript: null,
|
|
38
|
+
// 加载条件:return false 时不加载;不配置则默认加载
|
|
39
|
+
dynamicSchemaLoadScript: null,
|
|
36
40
|
// 后台脚本编码(支持 "formCode/scriptCode"),返回标准字段定义数组
|
|
37
41
|
dynamicSchemaScriptCode: null,
|
|
38
42
|
// 额外请求参数(JSON 字符串)
|
|
@@ -3688,6 +3692,7 @@ export const advancedFields = [
|
|
|
3688
3692
|
clearable: true,
|
|
3689
3693
|
filterable: false,
|
|
3690
3694
|
multiple: false,
|
|
3695
|
+
flatCollapseTags: false,
|
|
3691
3696
|
checkStrictly: false, //可选择任意一级选项,默认不开启
|
|
3692
3697
|
showAllLevels: true, //显示完整路径
|
|
3693
3698
|
dsEnabled: false, // 是否使用数据源数据
|