cloud-web-corejs 1.0.54-dev.673 → 1.0.54-dev.675
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 copy.vue +988 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +87 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +14 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onDynamicColumns-editor.vue +44 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -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 +438 -21
- package/src/index.js +72 -61
- package/src/utils/vab.js +88 -107
|
@@ -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,72 @@
|
|
|
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
|
-
<el-form-item label="
|
|
131
|
+
<el-form-item label="动态列模式">
|
|
132
|
+
<el-select v-model="optionModel.dynamicColumnMode" style="width: 100%">
|
|
133
|
+
<el-option label="追加到静态列" value="append"></el-option>
|
|
134
|
+
<el-option label="替换静态列" value="replace"></el-option>
|
|
135
|
+
</el-select>
|
|
136
|
+
</el-form-item>
|
|
137
|
+
<el-form-item label="启用接口动态列">
|
|
138
|
+
<el-switch
|
|
139
|
+
v-model="optionModel.dynamicColumnScriptEnabled"
|
|
140
|
+
@change="handleDynamicColumnScriptEnabledChange"
|
|
141
|
+
></el-switch>
|
|
142
|
+
</el-form-item>
|
|
143
|
+
<div
|
|
144
|
+
v-if="optionModel.dynamicColumnScriptEnabled"
|
|
145
|
+
class="data-table-editor-subsection"
|
|
146
|
+
>
|
|
147
|
+
<el-form-item label="脚本编码">
|
|
148
|
+
<el-input
|
|
149
|
+
v-model="optionModel.dynamicColumnScriptCode"
|
|
150
|
+
clearable
|
|
151
|
+
placeholder="如 getDynamicColumns"
|
|
152
|
+
></el-input>
|
|
153
|
+
</el-form-item>
|
|
154
|
+
<el-form-item label="请求参数">
|
|
155
|
+
<a
|
|
156
|
+
href="javascript:void(0);"
|
|
157
|
+
class="a-link link-oneLind"
|
|
158
|
+
@click="editEventHandler('dynamicColumnScriptParam', tableConfigParams)"
|
|
159
|
+
>
|
|
160
|
+
<span>{{ optionModel.dynamicColumnScriptParam }}</span>
|
|
161
|
+
<i class="el-icon-edit"></i>
|
|
162
|
+
</a>
|
|
163
|
+
</el-form-item>
|
|
164
|
+
<el-form-item label="转换脚本">
|
|
165
|
+
<a
|
|
166
|
+
href="javascript:void(0);"
|
|
167
|
+
class="a-link link-oneLind"
|
|
168
|
+
@click="editEventHandler('onDynamicColumnsConvert', ['res'])"
|
|
169
|
+
>
|
|
170
|
+
<span>{{ optionModel.onDynamicColumnsConvert }}</span>
|
|
171
|
+
<i class="el-icon-edit"></i>
|
|
172
|
+
</a>
|
|
173
|
+
</el-form-item>
|
|
174
|
+
<el-form-item>
|
|
175
|
+
<span slot="label">
|
|
176
|
+
加载后自动请求
|
|
177
|
+
<el-tooltip
|
|
178
|
+
effect="light"
|
|
179
|
+
placement="top"
|
|
180
|
+
content="默认开启。打开表单时先请求动态列,再一次性渲染完整表格。"
|
|
181
|
+
>
|
|
182
|
+
<i class="el-icon-info"></i>
|
|
183
|
+
</el-tooltip>
|
|
184
|
+
</span>
|
|
185
|
+
<el-switch v-model="optionModel.dynamicColumnAutoLoad"></el-switch>
|
|
186
|
+
</el-form-item>
|
|
187
|
+
</div>
|
|
188
|
+
<el-form-item label="自定义表格配置">
|
|
126
189
|
<a
|
|
127
190
|
href="javascript:void(0);"
|
|
128
191
|
class="a-link link-oneLind"
|
|
@@ -153,7 +216,7 @@
|
|
|
153
216
|
<el-form-item :label="i18nt('明细导出脚本编码')">
|
|
154
217
|
<el-input v-model="optionModel.exportItemScriptCode"></el-input>
|
|
155
218
|
</el-form-item>
|
|
156
|
-
<el-form-item label="自定义明细导出参数"
|
|
219
|
+
<el-form-item label="自定义明细导出参数">
|
|
157
220
|
<a
|
|
158
221
|
href="javascript:void(0);"
|
|
159
222
|
class="a-link link-oneLind"
|
|
@@ -163,7 +226,7 @@
|
|
|
163
226
|
<i class="el-icon-edit"></i>
|
|
164
227
|
</a>
|
|
165
228
|
</el-form-item>
|
|
166
|
-
<el-form-item label="明细导出列维护"
|
|
229
|
+
<el-form-item label="明细导出列维护">
|
|
167
230
|
<a
|
|
168
231
|
href="javascript:void(0);"
|
|
169
232
|
class="a-link link-oneLind"
|
|
@@ -605,6 +668,11 @@ export default {
|
|
|
605
668
|
}
|
|
606
669
|
},
|
|
607
670
|
methods: {
|
|
671
|
+
handleDynamicColumnScriptEnabledChange(enabled) {
|
|
672
|
+
if (enabled) {
|
|
673
|
+
this.$set(this.optionModel, "dynamicColumnAutoLoad", true);
|
|
674
|
+
}
|
|
675
|
+
},
|
|
608
676
|
dragSort: function () {
|
|
609
677
|
var e = this.$refs.singleTable.$el.querySelectorAll(
|
|
610
678
|
".el-table__body-wrapper > table > tbody"
|
|
@@ -931,3 +999,18 @@ export default {
|
|
|
931
999
|
content: "\e61d";
|
|
932
1000
|
}
|
|
933
1001
|
</style>
|
|
1002
|
+
|
|
1003
|
+
<style scoped>
|
|
1004
|
+
.data-table-editor-subsection {
|
|
1005
|
+
margin: 0 0 4px 8px;
|
|
1006
|
+
padding-left: 12px;
|
|
1007
|
+
border-left: 2px solid #ebeef5;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.form-section-label {
|
|
1011
|
+
font-size: 12px;
|
|
1012
|
+
color: #606266;
|
|
1013
|
+
line-height: 22px;
|
|
1014
|
+
margin-bottom: 8px;
|
|
1015
|
+
}
|
|
1016
|
+
</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>
|
|
@@ -1321,6 +1331,7 @@ export default {
|
|
|
1321
1331
|
rowEditAuthName: this.createRowAuthName("Edit"),
|
|
1322
1332
|
rowAddShow: null,
|
|
1323
1333
|
rowEditShow: null,
|
|
1334
|
+
columnShow: null,
|
|
1324
1335
|
utcTransformEnabled: false,
|
|
1325
1336
|
labelIconClass: null,
|
|
1326
1337
|
labelIconPosition: "rear",
|
|
@@ -1845,6 +1856,9 @@ export default {
|
|
|
1845
1856
|
confirmEditFormatConfigDialog(columnSelectedWidget, row) {
|
|
1846
1857
|
row.editWidget = columnSelectedWidget;
|
|
1847
1858
|
},
|
|
1859
|
+
openColumnShowDialog(row) {
|
|
1860
|
+
this.editFormEventHandler(row, this.rowDataIndex, "columnShow");
|
|
1861
|
+
},
|
|
1848
1862
|
openTableColumnConfigDialog(row, index) {
|
|
1849
1863
|
this.operateIndex = index;
|
|
1850
1864
|
this.currentTableColumn = row;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form-item label-width="150px">
|
|
3
|
+
<span slot="label">
|
|
4
|
+
onDynamicColumns
|
|
5
|
+
<el-tooltip effect="light" placement="top">
|
|
6
|
+
<div slot="content" style="line-height: 1.4; max-width: 320px">
|
|
7
|
+
同步脚本:直接 return 列配置(字段同设计器列:prop、label、formatS、editFormatS 等)。<br />
|
|
8
|
+
接口动态列请使用「接口动态列」配置或 loadDynamicColumnsFromApi。
|
|
9
|
+
</div>
|
|
10
|
+
<i class="el-icon-info"></i>
|
|
11
|
+
</el-tooltip>
|
|
12
|
+
</span>
|
|
13
|
+
<a
|
|
14
|
+
href="javascript:void(0);"
|
|
15
|
+
class="a-link link-oneLind"
|
|
16
|
+
@click="editEventHandler('onDynamicColumns', eventParams)"
|
|
17
|
+
>
|
|
18
|
+
<span>{{ optionModel.onDynamicColumns }}</span>
|
|
19
|
+
<i class="el-icon-edit"></i>
|
|
20
|
+
</a>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
26
|
+
import eventMixin from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: "onDynamicColumns-editor",
|
|
30
|
+
mixins: [i18n, eventMixin],
|
|
31
|
+
props: {
|
|
32
|
+
designer: Object,
|
|
33
|
+
selectedWidget: Object,
|
|
34
|
+
optionModel: Object,
|
|
35
|
+
},
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
eventParams: [],
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped></style>
|
|
@@ -256,6 +256,7 @@ const EVENT_PROPERTIES = {
|
|
|
256
256
|
onCheckboxChange: "onCheckboxChange-editor",
|
|
257
257
|
onSearchTable: "onSearchTable-editor",
|
|
258
258
|
onResetTable: "onResetTable-editor",
|
|
259
|
+
onDynamicColumns: "onDynamicColumns-editor",
|
|
259
260
|
|
|
260
261
|
//tree事件
|
|
261
262
|
onNodeClick: "onNodeClick-editor",
|
|
@@ -234,6 +234,13 @@ export const containers = [
|
|
|
234
234
|
onCellDblclick: "",
|
|
235
235
|
onSearchTable: "",
|
|
236
236
|
onResetTable: "",
|
|
237
|
+
onDynamicColumns: "",
|
|
238
|
+
dynamicColumnMode: "append",
|
|
239
|
+
dynamicColumnScriptEnabled: false,
|
|
240
|
+
dynamicColumnScriptCode: null,
|
|
241
|
+
dynamicColumnScriptParam: null,
|
|
242
|
+
onDynamicColumnsConvert: null,
|
|
243
|
+
dynamicColumnAutoLoad: false,
|
|
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
|
|