cloud-web-corejs 1.0.54-dev.351 → 1.0.54-dev.353
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/baseInputExport/mixins.js +1 -386
- package/src/components/errorMsg/mixins.js +1 -89
- package/src/components/excelImport/mixins.js +1 -749
- package/src/components/jsonImport/mixins.js +1 -332
- package/src/components/langImport/mixins.js +1 -484
- package/src/components/vb-tabs/x-tabs.vue +36 -27
- package/src/components/wf/mixins/wfFlowEleScriptDialog.js +1 -129
- package/src/components/wf/wf.js +1 -2117
- package/src/components/xform/form-designer/designer.js +1 -1645
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +1 -281
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1 -1328
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +2 -4
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +0 -7
- package/src/components/xform/form-designer/indexMixin.js +1 -823
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +0 -1
- package/src/components/xform/form-render/container-item/containerItemMixin.js +1 -348
- package/src/components/xform/form-render/container-item/table2-item.vue +141 -88
- package/src/components/xform/mixins/scriptHttp.js +62 -63
- package/src/components/xform/utils/util.js +1 -1451
- package/src/utils/request.js +1 -359
- package/src/utils/vab.js +1 -1095
- package/src/views/user/form/view/list.vue +111 -67
- package/src/views/user/notify_message/dialog.vue +0 -1
@@ -1,42 +1,51 @@
|
|
1
1
|
<template>
|
2
2
|
<container-item-wrapper :widget="widget">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
<div :key="widget.id" class="table-container" v-show="!widget.options.hidden">
|
4
|
+
<table
|
5
|
+
:ref="widget.id"
|
6
|
+
class="table-layout table-d-box"
|
7
|
+
:class="[customClass, widget.options.styleTableClass]"
|
8
|
+
:style="tableStyle"
|
9
|
+
>
|
8
10
|
<tbody>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
<tr v-for="(row, rowIdx) in widget.rows" :key="row.id">
|
12
|
+
<template v-for="(colWidget, colIdx) in row.cols">
|
13
|
+
<table-cell-item
|
14
|
+
v-if="!colWidget.merged"
|
15
|
+
:widget="colWidget"
|
16
|
+
:key="colIdx"
|
17
|
+
:parent-list="widget.cols"
|
18
|
+
:row-index="rowIdx"
|
19
|
+
:col-index="colIdx"
|
20
|
+
:parent-widget="widget"
|
21
|
+
:parent-target="_self"
|
22
|
+
:row.sync="rowData"
|
23
|
+
>
|
24
|
+
<!-- 递归传递插槽!!! -->
|
25
|
+
<template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
|
26
|
+
<slot :name="slot" v-bind="scope" />
|
27
|
+
</template>
|
28
|
+
</table-cell-item>
|
29
|
+
</template>
|
30
|
+
</tr>
|
21
31
|
</tbody>
|
22
32
|
</table>
|
23
33
|
</div>
|
24
|
-
|
25
34
|
</container-item-wrapper>
|
26
35
|
</template>
|
27
36
|
|
28
37
|
<script>
|
29
|
-
import emitter from
|
30
|
-
import i18n from "../../../../components/xform/utils/i18n"
|
31
|
-
import refMixin from "../../../../components/xform/form-render/refMixin"
|
32
|
-
import ContainerItemWrapper from
|
33
|
-
import TableCellItem from
|
38
|
+
import emitter from "../../../../components/xform/utils/emitter";
|
39
|
+
import i18n from "../../../../components/xform/utils/i18n";
|
40
|
+
import refMixin from "../../../../components/xform/form-render/refMixin";
|
41
|
+
import ContainerItemWrapper from "./container-item-wrapper";
|
42
|
+
import TableCellItem from "./table2-cell-item";
|
34
43
|
import containerItemMixin from "./containerItemMixin";
|
35
|
-
import {generateId} from "../../../../components/xform/utils/util"
|
44
|
+
import { generateId } from "../../../../components/xform/utils/util";
|
36
45
|
|
37
46
|
export default {
|
38
47
|
name: "table2-item",
|
39
|
-
componentName:
|
48
|
+
componentName: "ContainerItem",
|
40
49
|
mixins: [emitter, i18n, refMixin, containerItemMixin],
|
41
50
|
components: {
|
42
51
|
ContainerItemWrapper,
|
@@ -45,46 +54,46 @@ export default {
|
|
45
54
|
props: {
|
46
55
|
widget: Object,
|
47
56
|
},
|
48
|
-
inject: [
|
57
|
+
inject: ["refList", "sfRefList", "globalModel"],
|
49
58
|
provide: {
|
50
|
-
getRows: () => this.rows
|
59
|
+
getRows: () => this.rows,
|
51
60
|
},
|
52
61
|
computed: {
|
53
62
|
tableStyle() {
|
54
|
-
return this.widget.options.fullWidth ?
|
63
|
+
return this.widget.options.fullWidth ? "width:100%;" : "";
|
55
64
|
},
|
56
65
|
formModel: {
|
57
66
|
cache: !1,
|
58
67
|
get: function () {
|
59
68
|
return this.globalModel.formModel;
|
60
|
-
}
|
69
|
+
},
|
61
70
|
},
|
62
71
|
formDataId() {
|
63
72
|
let formRef = this.getFormRef();
|
64
73
|
return formRef.dataId;
|
65
|
-
}
|
74
|
+
},
|
66
75
|
},
|
67
76
|
created() {
|
68
|
-
this.initRefList()
|
69
|
-
this.handleOnCreated()
|
77
|
+
this.initRefList();
|
78
|
+
this.handleOnCreated();
|
70
79
|
},
|
71
80
|
mounted() {
|
72
|
-
this.handleOnMounted()
|
81
|
+
this.handleOnMounted();
|
73
82
|
},
|
74
83
|
beforeDestroy() {
|
75
|
-
this.unregisterFromRefList()
|
84
|
+
this.unregisterFromRefList();
|
76
85
|
},
|
77
86
|
data() {
|
78
87
|
return {
|
79
88
|
rows: [],
|
80
89
|
rowData: {},
|
81
90
|
typeMap: {
|
82
|
-
0:
|
83
|
-
1:
|
84
|
-
2:
|
85
|
-
3:
|
86
|
-
}
|
87
|
-
}
|
91
|
+
0: "input",
|
92
|
+
1: "textarea",
|
93
|
+
2: "date",
|
94
|
+
3: "number",
|
95
|
+
},
|
96
|
+
};
|
88
97
|
},
|
89
98
|
watch: {},
|
90
99
|
methods: {
|
@@ -95,13 +104,11 @@ export default {
|
|
95
104
|
return this.rows;
|
96
105
|
},
|
97
106
|
getType(f_field_type) {
|
98
|
-
return this.typeMap[f_field_type]
|
107
|
+
return this.typeMap[f_field_type];
|
99
108
|
},
|
100
109
|
setValue(items = []) {
|
101
|
-
|
102
|
-
|
103
110
|
let dataMap = {};
|
104
|
-
let widgetRows = []
|
111
|
+
let widgetRows = [];
|
105
112
|
let currentSpan = 0;
|
106
113
|
let index = -1;
|
107
114
|
|
@@ -111,65 +118,71 @@ export default {
|
|
111
118
|
item.f_field_value = null;
|
112
119
|
}
|
113
120
|
let type = this.getType(item.f_field_type);
|
114
|
-
let tableCell = this.$baseLodash.cloneDeep(
|
121
|
+
let tableCell = this.$baseLodash.cloneDeep(
|
122
|
+
formRef.getContainerByType("table-cell")
|
123
|
+
);
|
115
124
|
tableCell.options.rowIndex = rowIndex;
|
116
125
|
let colspan = 1;
|
117
126
|
let tc = 0;
|
118
127
|
if (type == "textarea") {
|
119
128
|
if (currentSpan && currentSpan < 4) {
|
120
|
-
tc = 4 - currentSpan
|
129
|
+
tc = 4 - currentSpan;
|
121
130
|
}
|
122
|
-
colspan = 4
|
123
|
-
tableCell.options.colspan = 4
|
131
|
+
colspan = 4;
|
132
|
+
tableCell.options.colspan = 4;
|
124
133
|
}
|
125
134
|
|
126
|
-
let widget =
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
135
|
+
let widget = type
|
136
|
+
? this.$baseLodash.cloneDeep(formRef.getFieldWidgetByType(type))
|
137
|
+
: null;
|
138
|
+
if (widget) {
|
139
|
+
let options = widget.options;
|
140
|
+
options.keyNameEnabled = true;
|
141
|
+
options.keyName = item.f_key;
|
142
|
+
options.label = item.f_field_name;
|
143
|
+
options.required = item.f_is_required;
|
144
|
+
tableCell.widgetList.push(widget);
|
145
|
+
}
|
134
146
|
|
135
147
|
if (index === -1) {
|
136
|
-
index
|
148
|
+
index++;
|
137
149
|
widgetRows.push({
|
138
|
-
id:
|
150
|
+
id: "table-row-" + generateId(),
|
139
151
|
merged: false,
|
140
|
-
cols: []
|
141
|
-
})
|
152
|
+
cols: [],
|
153
|
+
});
|
142
154
|
currentSpan = colspan;
|
143
155
|
} else if (currentSpan + colspan > 4) {
|
144
|
-
index
|
156
|
+
index++;
|
145
157
|
widgetRows.push({
|
146
|
-
id:
|
158
|
+
id: "table-row-" + generateId(),
|
147
159
|
merged: false,
|
148
|
-
cols: []
|
149
|
-
})
|
160
|
+
cols: [],
|
161
|
+
});
|
150
162
|
currentSpan = colspan;
|
151
163
|
} else {
|
152
164
|
currentSpan = colspan + currentSpan;
|
153
165
|
}
|
154
166
|
|
155
167
|
for (let i = 0; i < tc; i++) {
|
156
|
-
widgetRows[index - 1].cols.push(
|
168
|
+
widgetRows[index - 1].cols.push(
|
169
|
+
this.$baseLodash.cloneDeep(formRef.getContainerByType("table-cell"))
|
170
|
+
);
|
157
171
|
}
|
158
172
|
|
159
173
|
let cols = widgetRows[index].cols;
|
160
174
|
|
161
|
-
|
162
175
|
cols.push(tableCell);
|
163
176
|
|
164
177
|
dataMap[item.f_key] = item.f_field_value ?? null;
|
165
|
-
})
|
178
|
+
});
|
166
179
|
|
167
180
|
this.rows = items;
|
168
181
|
this.$set(this.formModel, this.fieldKeyName, items);
|
169
182
|
|
170
183
|
this.rowData = dataMap;
|
171
|
-
this.widget.rows.length = 0
|
172
|
-
this.widget.rows.push(...widgetRows)
|
184
|
+
this.widget.rows.length = 0;
|
185
|
+
this.widget.rows.push(...widgetRows);
|
173
186
|
},
|
174
187
|
loadDataDefaultHandle() {
|
175
188
|
/*this.init();
|
@@ -179,9 +192,9 @@ export default {
|
|
179
192
|
let reportTemplate = this.getFormRef().reportTemplate;
|
180
193
|
let formCode = reportTemplate.formCode;
|
181
194
|
let formScriptEnabled = this.widget.options.formScriptEnabled || false;
|
182
|
-
let scriptCode = this.widget.options.formScriptCode
|
195
|
+
let scriptCode = this.widget.options.formScriptCode;
|
183
196
|
if (!scriptCode) return;
|
184
|
-
let accessParam = this.handleCustomEvent(this.widget.options.formScriptParam)
|
197
|
+
let accessParam = this.handleCustomEvent(this.widget.options.formScriptParam);
|
185
198
|
return this.formHttp({
|
186
199
|
scriptCode: scriptCode,
|
187
200
|
data: {
|
@@ -190,31 +203,72 @@ export default {
|
|
190
203
|
taBm: this.fieldKeyName,
|
191
204
|
data: {
|
192
205
|
id: dataId,
|
193
|
-
...accessParam
|
194
|
-
}
|
206
|
+
...accessParam,
|
207
|
+
},
|
195
208
|
},
|
196
|
-
success: res => {
|
209
|
+
success: (res) => {
|
197
210
|
let rows = res.objx || [];
|
198
|
-
this.setValue(rows)
|
199
|
-
}
|
211
|
+
this.setValue(rows);
|
212
|
+
},
|
200
213
|
});
|
201
214
|
},
|
202
215
|
init() {
|
203
216
|
let items = [
|
204
|
-
{
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
217
|
+
{
|
218
|
+
f_field_name: "a",
|
219
|
+
f_key: "a",
|
220
|
+
f_field_type: 0,
|
221
|
+
f_is_required: true,
|
222
|
+
f_field_value: "1",
|
223
|
+
},
|
224
|
+
{
|
225
|
+
f_field_name: "b",
|
226
|
+
f_key: "b",
|
227
|
+
f_field_type: 3,
|
228
|
+
f_is_required: true,
|
229
|
+
f_field_value: 2,
|
230
|
+
},
|
231
|
+
{
|
232
|
+
f_field_name: "c",
|
233
|
+
f_key: "c",
|
234
|
+
f_field_type: 1,
|
235
|
+
f_is_required: true,
|
236
|
+
f_field_value: "11111",
|
237
|
+
},
|
238
|
+
{
|
239
|
+
f_field_name: "d",
|
240
|
+
f_key: "d",
|
241
|
+
f_field_type: 0,
|
242
|
+
f_is_required: true,
|
243
|
+
f_field_value: "3",
|
244
|
+
},
|
245
|
+
{
|
246
|
+
f_field_name: "e",
|
247
|
+
f_key: "e",
|
248
|
+
f_field_type: 0,
|
249
|
+
f_is_required: true,
|
250
|
+
f_field_value: "4",
|
251
|
+
},
|
252
|
+
{
|
253
|
+
f_field_name: "f",
|
254
|
+
f_key: "f",
|
255
|
+
f_field_type: 0,
|
256
|
+
f_is_required: true,
|
257
|
+
f_field_value: "5",
|
258
|
+
},
|
259
|
+
{
|
260
|
+
f_field_name: "g",
|
261
|
+
f_key: "g",
|
262
|
+
f_field_type: 0,
|
263
|
+
f_is_required: true,
|
264
|
+
f_field_value: "6",
|
265
|
+
},
|
211
266
|
];
|
212
|
-
let a = 1
|
267
|
+
let a = 1;
|
213
268
|
this.setValue(items);
|
214
|
-
|
215
|
-
}
|
269
|
+
},
|
216
270
|
},
|
217
|
-
}
|
271
|
+
};
|
218
272
|
</script>
|
219
273
|
|
220
274
|
<style lang="scss" scoped>
|
@@ -225,5 +279,4 @@ div.table-container {
|
|
225
279
|
border-collapse: collapse;
|
226
280
|
}
|
227
281
|
}
|
228
|
-
|
229
282
|
</style>
|
@@ -45,66 +45,66 @@ modules = {
|
|
45
45
|
return this.getFormRef ? this.getFormRef() : this;
|
46
46
|
},
|
47
47
|
formHttp(opts) {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
let error = opts.error;
|
48
|
+
let data = opts.data;
|
49
|
+
let scriptCode = opts.scriptCode ? opts.scriptCode.trim() : null;
|
50
|
+
let formCode = opts.formCode ? opts.formCode.trim() : null;
|
51
|
+
let isLoading = opts.isLoading ?? true;
|
52
|
+
let success = opts.success;
|
53
|
+
let fail = opts.fail;
|
54
|
+
let error = opts.error;
|
56
55
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
65
|
-
}
|
66
|
-
if (!formCode) {
|
67
|
-
formCode = reportTemplate.formCode
|
56
|
+
let that = this;
|
57
|
+
let reportTemplate = that.getFormRef ? that.getFormRef().reportTemplate : that.reportTemplate;
|
58
|
+
if (scriptCode && !formCode) {
|
59
|
+
let arr = scriptCode.split("/").filter(item => item)
|
60
|
+
if (arr.length > 1) {
|
61
|
+
formCode = arr[0];
|
62
|
+
scriptCode = arr[1];
|
68
63
|
}
|
64
|
+
}
|
65
|
+
if (!formCode) {
|
66
|
+
formCode = reportTemplate.formCode
|
67
|
+
}
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
delete opts.data
|
70
|
+
delete opts.scriptCode
|
71
|
+
delete opts.formCode
|
72
|
+
delete opts.isLoading
|
73
|
+
delete opts.success
|
74
|
+
delete opts.fail
|
75
|
+
delete opts.error
|
77
76
|
|
78
77
|
|
79
|
-
|
78
|
+
let getServiceName = (callback) => {
|
80
79
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}
|
80
|
+
if (formCode && formCode !== reportTemplate.formCode) {
|
81
|
+
this.getHttpTarget().$http({
|
82
|
+
aes: true,
|
83
|
+
url: USER_PREFIX + `/formScript/getServiceName`,
|
84
|
+
method: `post`,
|
85
|
+
data: {
|
86
|
+
formCode,
|
87
|
+
scriptCode
|
88
|
+
},
|
89
|
+
isLoading,
|
90
|
+
// loadingTarget: this.getLoadingTarget(),
|
91
|
+
// modalStrictly: true,
|
92
|
+
success: res => {
|
93
|
+
let serviceName = res.objx;
|
94
|
+
if (serviceName) {
|
95
|
+
callback(serviceName)
|
96
|
+
} else {
|
97
|
+
this.$baseAlert("服务名不存在")
|
100
98
|
}
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
|
-
|
105
|
-
|
99
|
+
}
|
100
|
+
});
|
101
|
+
} else {
|
102
|
+
callback(reportTemplate.serviceName)
|
106
103
|
}
|
107
|
-
|
104
|
+
|
105
|
+
}
|
106
|
+
let toDo = () => {
|
107
|
+
return new Promise((resolve, reject) => {
|
108
108
|
getServiceName(searviceName => {
|
109
109
|
let reqData;
|
110
110
|
reqData = data;
|
@@ -112,7 +112,7 @@ modules = {
|
|
112
112
|
let reportGlobalMap = getReportGlobalMap() || {};
|
113
113
|
let url = `/${searviceName}/bd_api/${formCode}/${scriptCode}`;
|
114
114
|
return this.getHttpTarget().$http({
|
115
|
-
// aes: true
|
115
|
+
// aes: true
|
116
116
|
url: url,
|
117
117
|
method: `post`,
|
118
118
|
// loadingTarget: this.getLoadingTarget(),
|
@@ -164,16 +164,15 @@ modules = {
|
|
164
164
|
}
|
165
165
|
});
|
166
166
|
})
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
}
|
173
|
-
|
174
|
-
|
175
|
-
}
|
176
|
-
|
167
|
+
})
|
168
|
+
}
|
169
|
+
if (opts.isConfirm) {
|
170
|
+
this.$baseConfirm(opts.confirmText).then(() => {
|
171
|
+
return toDo();
|
172
|
+
});
|
173
|
+
} else {
|
174
|
+
return toDo();
|
175
|
+
}
|
177
176
|
}
|
178
177
|
}
|
179
178
|
}
|