cloud-web-corejs 1.0.54-dev.674 → 1.0.54-dev.676
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/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +164 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +15 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +7 -0
- package/src/components/xform/form-render/container-item/data-table-item.vue +0 -9
- package/src/components/xform/form-render/container-item/data-table-mixin.js +503 -26
- package/src/components/xform/form-render/indexMixin.js +15 -9
- package/src/components/xform/mixins/scriptHttp.js +176 -5
- package/src/components/xform/utils/util.js +11 -0
- package/src/utils/vab.js +87 -107
package/package.json
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
<el-form-item :label="i18nt('合并行唯一字段')">
|
|
23
23
|
<el-input v-model="optionModel.mergeRowKey"></el-input>
|
|
24
24
|
</el-form-item>
|
|
25
|
+
<el-form-item label-width="0">
|
|
26
|
+
<el-divider class="custom-divider-margin-top">查询与分页</el-divider>
|
|
27
|
+
</el-form-item>
|
|
25
28
|
<el-form-item label="查询列表">
|
|
26
29
|
<el-switch v-model="optionModel.isQueryTable"></el-switch>
|
|
27
30
|
</el-form-item>
|
|
@@ -50,8 +53,8 @@
|
|
|
50
53
|
:max="10000"
|
|
51
54
|
/>
|
|
52
55
|
</el-form-item>
|
|
53
|
-
<el-form-item :label="i18nt('可选择每页查询数')"></el-form-item>
|
|
54
56
|
<el-form-item label-width="0">
|
|
57
|
+
<div class="form-section-label">{{ i18nt("可选择每页查询数") }}</div>
|
|
55
58
|
<template v-if="optionModel.gridPageSizeList">
|
|
56
59
|
<draggable
|
|
57
60
|
tag="ul"
|
|
@@ -117,12 +120,128 @@
|
|
|
117
120
|
<el-option v-for="e in widgetSizes" :key="e.value" :value="e.value" :label="e.label"></el-option>
|
|
118
121
|
</el-select>
|
|
119
122
|
</el-form-item> -->
|
|
123
|
+
<el-form-item label-width="0">
|
|
124
|
+
<el-divider class="custom-divider-margin-top">列与动态列</el-divider>
|
|
125
|
+
</el-form-item>
|
|
120
126
|
<el-form-item :label="i18nt('designer.setting.tableColEdit')">
|
|
121
127
|
<el-button type="primary" plain="" round="" @click="openSetting"
|
|
122
128
|
>{{ i18nt("designer.setting.editAction") }}
|
|
123
129
|
</el-button>
|
|
124
130
|
</el-form-item>
|
|
125
|
-
<
|
|
131
|
+
<div class="dynamic-column-hint">
|
|
132
|
+
动态列来源<strong>二选一</strong>:前端列脚本(同步算列)或接口动态列(后端拉取)。同时配置时<strong>列脚本优先</strong>。
|
|
133
|
+
</div>
|
|
134
|
+
<div class="dynamic-column-block">
|
|
135
|
+
<div class="form-section-label">前端列脚本</div>
|
|
136
|
+
<div class="form-section-desc">不调接口,脚本直接 return 列配置</div>
|
|
137
|
+
<div class="data-table-editor-subsection">
|
|
138
|
+
<el-form-item label="列脚本">
|
|
139
|
+
<a
|
|
140
|
+
href="javascript:void(0);"
|
|
141
|
+
class="a-link link-oneLind"
|
|
142
|
+
@click="
|
|
143
|
+
editEventHandler('dynamicColumnsScript', defaultEventParams)
|
|
144
|
+
"
|
|
145
|
+
>
|
|
146
|
+
<span>{{ optionModel.dynamicColumnsScript }}</span>
|
|
147
|
+
<i class="el-icon-edit"></i>
|
|
148
|
+
</a>
|
|
149
|
+
</el-form-item>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="dynamic-column-block">
|
|
153
|
+
<div class="form-section-label">接口动态列</div>
|
|
154
|
+
<div class="form-section-desc">打开表单时请求后端脚本,返回列配置</div>
|
|
155
|
+
<div class="data-table-editor-subsection">
|
|
156
|
+
<el-form-item label="启用">
|
|
157
|
+
<el-switch
|
|
158
|
+
v-model="optionModel.dynamicColumnScriptEnabled"
|
|
159
|
+
></el-switch>
|
|
160
|
+
</el-form-item>
|
|
161
|
+
<template v-if="optionModel.dynamicColumnScriptEnabled">
|
|
162
|
+
<el-form-item label="脚本编码">
|
|
163
|
+
<el-input
|
|
164
|
+
v-model="optionModel.dynamicColumnScriptCode"
|
|
165
|
+
clearable
|
|
166
|
+
placeholder="如 getDynamicColumns"
|
|
167
|
+
></el-input>
|
|
168
|
+
</el-form-item>
|
|
169
|
+
<el-form-item label="请求参数">
|
|
170
|
+
<a
|
|
171
|
+
href="javascript:void(0);"
|
|
172
|
+
class="a-link link-oneLind"
|
|
173
|
+
@click="
|
|
174
|
+
editEventHandler('dynamicColumnScriptParam', tableConfigParams)
|
|
175
|
+
"
|
|
176
|
+
>
|
|
177
|
+
<span>{{ optionModel.dynamicColumnScriptParam }}</span>
|
|
178
|
+
<i class="el-icon-edit"></i>
|
|
179
|
+
</a>
|
|
180
|
+
</el-form-item>
|
|
181
|
+
<el-form-item>
|
|
182
|
+
<span slot="label">
|
|
183
|
+
响应转换
|
|
184
|
+
<el-tooltip effect="light" placement="top">
|
|
185
|
+
<div slot="content" style="line-height: 1.4; max-width: 320px">
|
|
186
|
+
将接口返回的
|
|
187
|
+
<code>res</code> 转为列数组;不配置则按平台默认结构解析。
|
|
188
|
+
</div>
|
|
189
|
+
<i class="el-icon-info"></i>
|
|
190
|
+
</el-tooltip>
|
|
191
|
+
</span>
|
|
192
|
+
<a
|
|
193
|
+
href="javascript:void(0);"
|
|
194
|
+
class="a-link link-oneLind"
|
|
195
|
+
@click="editEventHandler('onDynamicColumnsConvert', ['res'])"
|
|
196
|
+
>
|
|
197
|
+
<span>{{ optionModel.onDynamicColumnsConvert }}</span>
|
|
198
|
+
<i class="el-icon-edit"></i>
|
|
199
|
+
</a>
|
|
200
|
+
</el-form-item>
|
|
201
|
+
<el-form-item>
|
|
202
|
+
<span slot="label">
|
|
203
|
+
默认加载判断
|
|
204
|
+
<el-tooltip effect="light" placement="top">
|
|
205
|
+
<div slot="content" style="line-height: 1.4; max-width: 320px">
|
|
206
|
+
启用后打开表单时<strong>默认</strong>自动请求动态列。<br />
|
|
207
|
+
同步:仅写 <code>return false</code> /
|
|
208
|
+
<code>return null</code> 跳过。<br />
|
|
209
|
+
异步:先写异步逻辑,末尾
|
|
210
|
+
<code>return false</code>;条件满足时调用
|
|
211
|
+
<code>done()</code>(无参)。
|
|
212
|
+
</div>
|
|
213
|
+
<i class="el-icon-info"></i>
|
|
214
|
+
</el-tooltip>
|
|
215
|
+
</span>
|
|
216
|
+
<a
|
|
217
|
+
href="javascript:void(0);"
|
|
218
|
+
class="a-link link-oneLind"
|
|
219
|
+
@click="editEventHandler('dynamicColumnAutoLoadScript', ['done'])"
|
|
220
|
+
>
|
|
221
|
+
<span>{{ optionModel.dynamicColumnAutoLoadScript }}</span>
|
|
222
|
+
<i class="el-icon-edit"></i>
|
|
223
|
+
</a>
|
|
224
|
+
</el-form-item>
|
|
225
|
+
</template>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
<el-form-item label="动态列模式">
|
|
229
|
+
<span slot="label">
|
|
230
|
+
动态列模式
|
|
231
|
+
<el-tooltip effect="light" placement="top">
|
|
232
|
+
<div slot="content" style="line-height: 1.4; max-width: 320px">
|
|
233
|
+
对<strong>生效的动态列</strong>与静态列的合并方式:<br />
|
|
234
|
+
追加 — 静态列 + 动态列;替换 — 仅动态列。
|
|
235
|
+
</div>
|
|
236
|
+
<i class="el-icon-info"></i>
|
|
237
|
+
</el-tooltip>
|
|
238
|
+
</span>
|
|
239
|
+
<el-select v-model="optionModel.dynamicColumnMode" style="width: 100%">
|
|
240
|
+
<el-option label="追加到静态列" value="append"></el-option>
|
|
241
|
+
<el-option label="替换静态列" value="replace"></el-option>
|
|
242
|
+
</el-select>
|
|
243
|
+
</el-form-item>
|
|
244
|
+
<el-form-item label="自定义表格配置">
|
|
126
245
|
<a
|
|
127
246
|
href="javascript:void(0);"
|
|
128
247
|
class="a-link link-oneLind"
|
|
@@ -153,7 +272,7 @@
|
|
|
153
272
|
<el-form-item :label="i18nt('明细导出脚本编码')">
|
|
154
273
|
<el-input v-model="optionModel.exportItemScriptCode"></el-input>
|
|
155
274
|
</el-form-item>
|
|
156
|
-
<el-form-item label="自定义明细导出参数"
|
|
275
|
+
<el-form-item label="自定义明细导出参数">
|
|
157
276
|
<a
|
|
158
277
|
href="javascript:void(0);"
|
|
159
278
|
class="a-link link-oneLind"
|
|
@@ -163,7 +282,7 @@
|
|
|
163
282
|
<i class="el-icon-edit"></i>
|
|
164
283
|
</a>
|
|
165
284
|
</el-form-item>
|
|
166
|
-
<el-form-item label="明细导出列维护"
|
|
285
|
+
<el-form-item label="明细导出列维护">
|
|
167
286
|
<a
|
|
168
287
|
href="javascript:void(0);"
|
|
169
288
|
class="a-link link-oneLind"
|
|
@@ -553,6 +672,7 @@ export default {
|
|
|
553
672
|
},
|
|
554
673
|
defaultCheckedKeys: [],
|
|
555
674
|
tableConfigParams: ["dataId", "formCode"],
|
|
675
|
+
defaultEventParams: ["dataId", "formCode"],
|
|
556
676
|
showExportItemColumnsDialog: false,
|
|
557
677
|
};
|
|
558
678
|
},
|
|
@@ -931,3 +1051,43 @@ export default {
|
|
|
931
1051
|
content: "\e61d";
|
|
932
1052
|
}
|
|
933
1053
|
</style>
|
|
1054
|
+
|
|
1055
|
+
<style scoped>
|
|
1056
|
+
.data-table-editor-subsection {
|
|
1057
|
+
margin: 0 0 4px 8px;
|
|
1058
|
+
padding-left: 12px;
|
|
1059
|
+
border-left: 2px solid #ebeef5;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
.form-section-label {
|
|
1063
|
+
font-size: 13px;
|
|
1064
|
+
font-weight: 500;
|
|
1065
|
+
color: #303133;
|
|
1066
|
+
line-height: 22px;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
.form-section-desc {
|
|
1070
|
+
font-size: 12px;
|
|
1071
|
+
color: #909399;
|
|
1072
|
+
line-height: 18px;
|
|
1073
|
+
margin: 2px 0 8px 8px;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
.dynamic-column-hint {
|
|
1077
|
+
font-size: 12px;
|
|
1078
|
+
color: #606266;
|
|
1079
|
+
line-height: 1.5;
|
|
1080
|
+
margin: 0 0 12px;
|
|
1081
|
+
padding: 8px 10px;
|
|
1082
|
+
background: #f4f4f5;
|
|
1083
|
+
border-radius: 4px;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
.dynamic-column-block {
|
|
1087
|
+
margin-bottom: 12px;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.dynamic-column-block .data-table-editor-subsection {
|
|
1091
|
+
margin-top: 0;
|
|
1092
|
+
}
|
|
1093
|
+
</style>
|
|
@@ -534,6 +534,16 @@
|
|
|
534
534
|
<el-form-item :label="i18nt('designer.setting.visibleColumn')">
|
|
535
535
|
<el-switch v-model="rowData.show"></el-switch>
|
|
536
536
|
</el-form-item>
|
|
537
|
+
<el-form-item label="动态显示脚本">
|
|
538
|
+
<a
|
|
539
|
+
href="javascript:void(0);"
|
|
540
|
+
class="a-link link-oneLind"
|
|
541
|
+
@click="openColumnShowDialog(rowData)"
|
|
542
|
+
>
|
|
543
|
+
<span>{{ rowData.columnShow }}</span>
|
|
544
|
+
<i class="el-icon-edit"></i>
|
|
545
|
+
</a>
|
|
546
|
+
</el-form-item>
|
|
537
547
|
<el-form-item :label="i18nt('designer.setting.sortableColumn')">
|
|
538
548
|
<el-switch v-model="rowData.sortable"></el-switch>
|
|
539
549
|
</el-form-item>
|
|
@@ -962,6 +972,7 @@ export default {
|
|
|
962
972
|
|
|
963
973
|
eventParamsMap: {
|
|
964
974
|
footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
|
|
975
|
+
columnShow: "columnShow(dataId,formCode,columnConfig) {",
|
|
965
976
|
},
|
|
966
977
|
|
|
967
978
|
showColumnRenderDialog: false,
|
|
@@ -1321,6 +1332,7 @@ export default {
|
|
|
1321
1332
|
rowEditAuthName: this.createRowAuthName("Edit"),
|
|
1322
1333
|
rowAddShow: null,
|
|
1323
1334
|
rowEditShow: null,
|
|
1335
|
+
columnShow: null,
|
|
1324
1336
|
utcTransformEnabled: false,
|
|
1325
1337
|
labelIconClass: null,
|
|
1326
1338
|
labelIconPosition: "rear",
|
|
@@ -1845,6 +1857,9 @@ export default {
|
|
|
1845
1857
|
confirmEditFormatConfigDialog(columnSelectedWidget, row) {
|
|
1846
1858
|
row.editWidget = columnSelectedWidget;
|
|
1847
1859
|
},
|
|
1860
|
+
openColumnShowDialog(row) {
|
|
1861
|
+
this.editFormEventHandler(row, this.rowDataIndex, "columnShow");
|
|
1862
|
+
},
|
|
1848
1863
|
openTableColumnConfigDialog(row, index) {
|
|
1849
1864
|
this.operateIndex = index;
|
|
1850
1865
|
this.currentTableColumn = row;
|
|
@@ -234,6 +234,13 @@ export const containers = [
|
|
|
234
234
|
onCellDblclick: "",
|
|
235
235
|
onSearchTable: "",
|
|
236
236
|
onResetTable: "",
|
|
237
|
+
dynamicColumnsScript: null,
|
|
238
|
+
dynamicColumnMode: "append",
|
|
239
|
+
dynamicColumnScriptEnabled: false,
|
|
240
|
+
dynamicColumnScriptCode: null,
|
|
241
|
+
dynamicColumnScriptParam: null,
|
|
242
|
+
onDynamicColumnsConvert: null,
|
|
243
|
+
dynamicColumnAutoLoadScript: null,
|
|
237
244
|
accessType: "1",
|
|
238
245
|
accessUrl: null,
|
|
239
246
|
accessReturnType: "1",
|
|
@@ -322,15 +322,6 @@ export default {
|
|
|
322
322
|
...FieldComponents,
|
|
323
323
|
},
|
|
324
324
|
mixins: [dataTableMixin],
|
|
325
|
-
computed: {
|
|
326
|
-
/*heightStyle() {
|
|
327
|
-
let tableHeight = this.widget.options.tableHeight;
|
|
328
|
-
if (tableHeight && (tableHeight == 'auto' || tableHeight.slice(-1) == '%')) {
|
|
329
|
-
return 'height:100%';
|
|
330
|
-
}
|
|
331
|
-
return '';
|
|
332
|
-
}*/
|
|
333
|
-
},
|
|
334
325
|
};
|
|
335
326
|
</script>
|
|
336
327
|
|