cloud-web-corejs 1.0.54-dev.337 → 1.0.54-dev.339
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/form-widget/field-widget/fieldMixin.js +4 -1
- package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +84 -70
- package/src/components/xform/form-render/container-item/data-table-item.vue +2 -2
- package/src/components/xform/form-render/container-item/data-table-mixin.js +139 -113
package/package.json
CHANGED
@@ -259,6 +259,9 @@ modules = {
|
|
259
259
|
this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel),
|
260
260
|
void this.initFileList();
|
261
261
|
}*/
|
262
|
+
if(this.field.options.name=="status85657"){
|
263
|
+
debugger
|
264
|
+
}
|
262
265
|
let defaultValue = this.field.options.defaultValue;
|
263
266
|
let dataId = this.getFormRef()?.dataId ?? null;
|
264
267
|
let nullValue = null;
|
@@ -668,7 +671,7 @@ modules = {
|
|
668
671
|
if(formScriptEnabledTypes.includes(widgetType)){
|
669
672
|
this.field.options.optionItems = rows || [];
|
670
673
|
}else if(widgetType=="status"){
|
671
|
-
|
674
|
+
this.field.options.statusParam = rows || [];
|
672
675
|
}
|
673
676
|
},
|
674
677
|
loadTableOtions(e) {
|
@@ -1,23 +1,35 @@
|
|
1
1
|
<template>
|
2
|
-
<static-content-wrapper
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
<static-content-wrapper
|
3
|
+
:designer="designer"
|
4
|
+
:field="field"
|
5
|
+
:design-state="designState"
|
6
|
+
:display-style="field.options.displayStyle"
|
7
|
+
:parent-widget="parentWidget"
|
8
|
+
:parent-list="parentList"
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
12
|
+
:sub-form-row-id="subFormRowId"
|
13
|
+
>
|
14
|
+
<vxe-grid
|
15
|
+
ref="table-m1"
|
16
|
+
:data="oplogDTOs"
|
17
|
+
v-bind="m1Option"
|
18
|
+
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
19
|
+
@custom="$vxeTableUtil.customHandle"
|
20
|
+
></vxe-grid>
|
9
21
|
</static-content-wrapper>
|
10
22
|
</template>
|
11
23
|
|
12
24
|
<script>
|
13
|
-
import StaticContentWrapper from
|
14
|
-
import emitter from
|
25
|
+
import StaticContentWrapper from "./static-content-wrapper";
|
26
|
+
import emitter from "../../../utils/emitter";
|
15
27
|
import i18n from "../../../utils/i18n";
|
16
28
|
import fieldMixin from "./fieldMixin";
|
17
29
|
|
18
30
|
export default {
|
19
31
|
name: "oplog-widget",
|
20
|
-
componentName:
|
32
|
+
componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
21
33
|
mixins: [emitter, fieldMixin, i18n],
|
22
34
|
props: {
|
23
35
|
field: Object,
|
@@ -28,106 +40,108 @@ export default {
|
|
28
40
|
|
29
41
|
designState: {
|
30
42
|
type: Boolean,
|
31
|
-
default: false
|
43
|
+
default: false,
|
32
44
|
},
|
33
45
|
|
34
|
-
subFormRowIndex: {
|
35
|
-
type: Number,
|
36
|
-
default: -1
|
46
|
+
subFormRowIndex: {
|
47
|
+
/* 子表单组件行索引,从0开始计数 */ type: Number,
|
48
|
+
default: -1,
|
37
49
|
},
|
38
|
-
subFormColIndex: {
|
39
|
-
type: Number,
|
40
|
-
default: -1
|
50
|
+
subFormColIndex: {
|
51
|
+
/* 子表单组件列索引,从0开始计数 */ type: Number,
|
52
|
+
default: -1,
|
41
53
|
},
|
42
|
-
subFormRowId: {
|
43
|
-
type: String,
|
44
|
-
default:
|
54
|
+
subFormRowId: {
|
55
|
+
/* 子表单组件行Id,唯一id且不可变 */ type: String,
|
56
|
+
default: "",
|
45
57
|
},
|
46
|
-
|
47
58
|
},
|
48
59
|
components: {
|
49
60
|
StaticContentWrapper,
|
50
61
|
},
|
51
62
|
computed: {
|
52
|
-
showLabel(){
|
53
|
-
return this.field.options.labelHidden? null: this.label;
|
63
|
+
showLabel() {
|
64
|
+
return this.field.options.labelHidden ? null : this.label;
|
54
65
|
},
|
55
66
|
label() {
|
56
|
-
return this.field.options.isFormLabel
|
67
|
+
return this.field.options.isFormLabel
|
68
|
+
? this.currentValue
|
69
|
+
: this.getI18nLabel(this.field.options.label);
|
57
70
|
},
|
58
71
|
widgetClass() {
|
59
72
|
let list = [];
|
60
|
-
let optionModel = this.field.options
|
73
|
+
let optionModel = this.field.options;
|
61
74
|
if (optionModel.colorClass) list.push(optionModel.colorClass);
|
62
|
-
if (optionModel.underline) list.push(
|
63
|
-
if (optionModel.disabled) list.push(
|
64
|
-
return list
|
65
|
-
}
|
75
|
+
if (optionModel.underline) list.push("underLine");
|
76
|
+
if (optionModel.disabled) list.push("is-disabled");
|
77
|
+
return list;
|
78
|
+
},
|
66
79
|
},
|
67
80
|
beforeCreate() {
|
68
81
|
/* 这里不能访问方法和属性!! */
|
69
82
|
},
|
70
|
-
data(){
|
83
|
+
data() {
|
71
84
|
return {
|
72
|
-
m1Option:{},
|
73
|
-
oplogDTOs:[]
|
74
|
-
}
|
85
|
+
m1Option: {},
|
86
|
+
oplogDTOs: [],
|
87
|
+
};
|
75
88
|
},
|
76
89
|
|
77
90
|
created() {
|
78
91
|
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
79
92
|
需要在父组件created中初始化!! */
|
80
|
-
this.registerToRefList()
|
81
|
-
this.initEventHandler()
|
93
|
+
this.registerToRefList();
|
94
|
+
this.initEventHandler();
|
82
95
|
|
83
|
-
this.handleOnCreated()
|
96
|
+
this.handleOnCreated();
|
84
97
|
},
|
85
98
|
|
86
99
|
mounted() {
|
87
|
-
this.handleOnMounted()
|
100
|
+
this.handleOnMounted();
|
88
101
|
this.initOplogDTOs();
|
89
102
|
},
|
90
103
|
|
91
104
|
beforeDestroy() {
|
92
|
-
this.unregisterFromRefList()
|
105
|
+
this.unregisterFromRefList();
|
93
106
|
},
|
94
107
|
|
95
108
|
methods: {
|
96
109
|
initOplogDTOs() {
|
97
110
|
const tableOption = {
|
98
111
|
vue: this,
|
99
|
-
tableRef:
|
100
|
-
tableName:
|
101
|
-
columns: [
|
102
|
-
type: 'checkbox',
|
103
|
-
fixed: 'left',
|
104
|
-
width: 48,
|
105
|
-
resizable: false
|
106
|
-
},
|
112
|
+
tableRef: "table-m1",
|
113
|
+
tableName: "xform-oplog-oplogList-m1Grid",
|
114
|
+
columns: [
|
107
115
|
{
|
108
|
-
|
109
|
-
|
110
|
-
width:
|
116
|
+
type: "checkbox",
|
117
|
+
fixed: "left",
|
118
|
+
width: 48,
|
119
|
+
resizable: false,
|
111
120
|
},
|
112
121
|
{
|
113
|
-
title: this.$t2(
|
114
|
-
field:
|
115
|
-
width: 150
|
122
|
+
title: this.$t2("操作时间", "components.oplogTable.createDate"),
|
123
|
+
field: "create_date",
|
124
|
+
width: 150,
|
116
125
|
},
|
117
126
|
{
|
118
|
-
title: this.$t2(
|
119
|
-
field:
|
120
|
-
width: 150
|
127
|
+
title: this.$t2("操作人员", "components.oplogTable.createBy"),
|
128
|
+
field: "_createBy",
|
129
|
+
width: 150,
|
130
|
+
},
|
131
|
+
{
|
132
|
+
title: this.$t2("操作日志", "components.oplogTable.content"),
|
133
|
+
field: "content",
|
134
|
+
width: 250,
|
121
135
|
},
|
122
136
|
{
|
123
137
|
width: 47,
|
124
|
-
fixed:
|
125
|
-
title:
|
126
|
-
sortable: false
|
127
|
-
}
|
128
|
-
]
|
138
|
+
fixed: "right",
|
139
|
+
title: "",
|
140
|
+
sortable: false,
|
141
|
+
},
|
142
|
+
],
|
129
143
|
};
|
130
|
-
this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
|
144
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
131
145
|
this.m1Option = opts;
|
132
146
|
});
|
133
147
|
this.initData();
|
@@ -140,7 +154,7 @@ export default {
|
|
140
154
|
let oplogBusinessKey = this.field.options.oplogBusinessKey || "id";
|
141
155
|
if (!scriptCode) return;
|
142
156
|
let business_code = this.formModel[oplogBusinessKey];
|
143
|
-
if(!business_code) return;
|
157
|
+
if (!business_code) return;
|
144
158
|
this.formHttp({
|
145
159
|
scriptCode: scriptCode,
|
146
160
|
data: {
|
@@ -148,18 +162,19 @@ export default {
|
|
148
162
|
formVersion: reportTemplate.formVersion,
|
149
163
|
data: {
|
150
164
|
log_type: oplogTypeCode,
|
151
|
-
business_code: business_code
|
152
|
-
}
|
165
|
+
business_code: business_code,
|
166
|
+
},
|
153
167
|
},
|
154
|
-
|
168
|
+
addCreateInfo: true,
|
169
|
+
queryCreateInfo: true,
|
170
|
+
callback: (res) => {
|
155
171
|
let rows = res.objx || [];
|
156
172
|
this.oplogDTOs = rows;
|
157
|
-
}
|
173
|
+
},
|
158
174
|
});
|
159
175
|
},
|
160
|
-
}
|
161
|
-
|
162
|
-
}
|
176
|
+
},
|
177
|
+
};
|
163
178
|
</script>
|
164
179
|
|
165
180
|
<style lang="scss" scoped>
|
@@ -167,5 +182,4 @@ export default {
|
|
167
182
|
a.is-disabled {
|
168
183
|
cursor: not-allowed;
|
169
184
|
}
|
170
|
-
|
171
185
|
</style>
|
@@ -212,11 +212,11 @@
|
|
212
212
|
<template v-if="isShowColumnStatusWidget(obj,item)">
|
213
213
|
<span
|
214
214
|
v-if="getTableColumnWidget(obj).options.formScriptEnabled || getTableColumnWidget(obj).options.commonAttributeEnabled"
|
215
|
-
:key="getTableColumnWidget(obj).id+'-'+index">{{ getI18nLabel(item
|
215
|
+
:key="getTableColumnWidget(obj).id+'-'+index">{{ getI18nLabel(item[getTableColumnStatusWidgetLabelKey(obj)]) }}</span>
|
216
216
|
<span
|
217
217
|
v-else
|
218
218
|
:key="getTableColumnWidget(obj).id+'-'+index" class="list-tag"
|
219
|
-
:class="item.type">{{ getI18nLabel(item
|
219
|
+
:class="item.type">{{ getI18nLabel(item[getTableColumnStatusWidgetLabelKey(obj)]) }}</span>
|
220
220
|
</template>
|
221
221
|
</template>
|
222
222
|
</template>
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
deepClone,
|
14
14
|
loopHandleWidget,
|
15
15
|
columnFormatMap,
|
16
|
-
traverseAllWidgetsNew
|
16
|
+
traverseAllWidgetsNew,
|
17
17
|
} from "../../../../components/xform/utils/util";
|
18
18
|
import { tableTreeMixins } from "../../../../mixins/tableTree/index.js";
|
19
19
|
|
@@ -177,7 +177,7 @@ modules = {
|
|
177
177
|
},
|
178
178
|
mounted: async function () {
|
179
179
|
this.handleOnMounted();
|
180
|
-
this.initColumnWidgetConfig(()=>{
|
180
|
+
this.initColumnWidgetConfig(() => {
|
181
181
|
this.initTableList();
|
182
182
|
});
|
183
183
|
},
|
@@ -185,103 +185,115 @@ modules = {
|
|
185
185
|
this.unregisterFromRefList();
|
186
186
|
},
|
187
187
|
methods: {
|
188
|
-
|
188
|
+
getTableColumnStatusWidgetLabelKey(obj) {
|
189
|
+
let widget = this.getTableColumnWidget(obj);
|
190
|
+
return widget ? this.getOptionItemLabelKey(widget) : null;
|
191
|
+
},
|
192
|
+
getOptionItemValueKey(widget) {
|
193
|
+
return widget.options.valueKey || "value";
|
194
|
+
},
|
195
|
+
getOptionItemLabelKey(widget) {
|
196
|
+
return widget.options.labelKey || "label";
|
197
|
+
},
|
198
|
+
getTableColumnWidget(obj) {
|
189
199
|
let item = this.fieldSchemaMap[obj.row._X_ROW_KEY];
|
190
|
-
return item ? item[obj.column.params?.widget.id]: null;
|
200
|
+
return item ? item[obj.column.params?.widget.id] : null;
|
191
201
|
},
|
192
|
-
isShowColumnStatusWidget(obj,item){
|
202
|
+
isShowColumnStatusWidget(obj, item) {
|
193
203
|
let widget = this.getTableColumnWidget(obj);
|
194
|
-
let valueKey = widget.options.valueKey || "value"
|
195
|
-
return
|
204
|
+
let valueKey = widget.options.valueKey || "value";
|
205
|
+
return (
|
206
|
+
obj.row[this.getTableColumnWidgetFieldKeyName(obj)] === item[valueKey]
|
207
|
+
);
|
196
208
|
},
|
197
|
-
getTableColumnWidgetFieldKeyName(obj){
|
209
|
+
getTableColumnWidgetFieldKeyName(obj) {
|
198
210
|
let widget = this.getTableColumnWidget(obj);
|
199
|
-
return widget ? this.getFieldKeyName(widget): null;
|
211
|
+
return widget ? this.getFieldKeyName(widget) : null;
|
200
212
|
},
|
201
|
-
initColumnWidgetConfig(callback){
|
213
|
+
initColumnWidgetConfig(callback) {
|
202
214
|
let tableColumns = this.widget.options.tableColumns;
|
203
215
|
let requests = [];
|
204
|
-
this.loodHandleColumns(tableColumns, (row)=>{
|
205
|
-
requests.push(this.handleColumnWidgetConfig(row.widget))
|
206
|
-
requests.push(this.handleColumnWidgetConfig(row.editWidget))
|
216
|
+
this.loodHandleColumns(tableColumns, (row) => {
|
217
|
+
requests.push(this.handleColumnWidgetConfig(row.widget));
|
218
|
+
requests.push(this.handleColumnWidgetConfig(row.editWidget));
|
207
219
|
let widgetList = row.widgetList;
|
208
|
-
if(widgetList && widgetList.length){
|
209
|
-
traverseAllWidgetsNew(widgetList, (widget)=>{
|
210
|
-
requests.push(this.handleColumnWidgetConfig(widget))
|
211
|
-
})
|
220
|
+
if (widgetList && widgetList.length) {
|
221
|
+
traverseAllWidgetsNew(widgetList, (widget) => {
|
222
|
+
requests.push(this.handleColumnWidgetConfig(widget));
|
223
|
+
});
|
212
224
|
}
|
213
|
-
})
|
214
|
-
if(requests.length){
|
215
|
-
Promise.all(requests).then(()=>{
|
216
|
-
callback()
|
217
|
-
})
|
218
|
-
}else{
|
219
|
-
callback()
|
225
|
+
});
|
226
|
+
if (requests.length) {
|
227
|
+
Promise.all(requests).then(() => {
|
228
|
+
callback();
|
229
|
+
});
|
230
|
+
} else {
|
231
|
+
callback();
|
220
232
|
}
|
221
|
-
|
222
233
|
},
|
223
|
-
fillColumnWidgetOptionItems(widget,rows){
|
234
|
+
fillColumnWidgetOptionItems(widget, rows) {
|
224
235
|
let widgetType = widget.type;
|
225
|
-
let formScriptEnabledTypes = [
|
226
|
-
if(formScriptEnabledTypes.includes(widgetType)){
|
236
|
+
let formScriptEnabledTypes = ["select", "checkbox", "radio"];
|
237
|
+
if (formScriptEnabledTypes.includes(widgetType)) {
|
227
238
|
widget.options.optionItems = rows || [];
|
228
|
-
}else if(widgetType=="status"){
|
239
|
+
} else if (widgetType == "status") {
|
229
240
|
widget.options.statusParam = rows || [];
|
230
241
|
}
|
231
242
|
widget._syncInited = true;
|
232
243
|
},
|
233
|
-
async handleColumnWidgetConfig(widget,callback){
|
234
|
-
if(!widget)return
|
244
|
+
async handleColumnWidgetConfig(widget, callback) {
|
245
|
+
if (!widget) return;
|
235
246
|
let widgetType = widget.type;
|
236
|
-
let formScriptEnabledTypes = [
|
237
|
-
if(!formScriptEnabledTypes.includes(widgetType))return
|
238
|
-
|
247
|
+
let formScriptEnabledTypes = ["select", "checkbox", "radio", "status"];
|
248
|
+
if (!formScriptEnabledTypes.includes(widgetType)) return;
|
249
|
+
|
239
250
|
let formScriptEnabled = widget.options.formScriptEnabled || false;
|
240
|
-
let commonAttributeEnabled =
|
251
|
+
let commonAttributeEnabled =
|
252
|
+
widget.options.commonAttributeEnabled || false;
|
241
253
|
let commonAttributeCode = widget.options.commonAttributeCode;
|
242
254
|
if (commonAttributeEnabled) {
|
243
255
|
if (!commonAttributeCode) return;
|
244
256
|
}
|
245
257
|
|
246
|
-
if(!formScriptEnabled && !commonAttributeEnabled)return
|
258
|
+
if (!formScriptEnabled && !commonAttributeEnabled) return;
|
247
259
|
|
248
260
|
let reportTemplate = this.getFormRef().reportTemplate;
|
249
261
|
let formCode = reportTemplate.formCode;
|
250
262
|
let scriptCode = widget.options.formScriptCode || "getList";
|
251
|
-
let fieldKeyName = this.getFieldKeyName(widget)
|
263
|
+
let fieldKeyName = this.getFieldKeyName(widget);
|
252
264
|
|
253
265
|
if (formScriptEnabled) {
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
266
|
+
let accessParam = this.handleCustomEvent(
|
267
|
+
widget.options.formScriptParam
|
268
|
+
);
|
269
|
+
return this.formHttp({
|
270
|
+
scriptCode: scriptCode,
|
271
|
+
data: {
|
272
|
+
formCode: formCode,
|
273
|
+
formVersion: reportTemplate.formVersion,
|
274
|
+
taBm: fieldKeyName,
|
263
275
|
data: {
|
264
276
|
...accessParam,
|
265
277
|
},
|
266
278
|
},
|
267
279
|
success: (res) => {
|
268
280
|
let rows = res.objx || [];
|
269
|
-
this.fillColumnWidgetOptionItems(widget,rows)
|
270
|
-
}
|
281
|
+
this.fillColumnWidgetOptionItems(widget, rows);
|
282
|
+
},
|
271
283
|
});
|
272
284
|
} else if (commonAttributeEnabled) {
|
273
285
|
let accessParam = this.handleCustomEvent(
|
274
286
|
widget.options.formScriptParam
|
275
287
|
);
|
276
|
-
|
277
|
-
|
288
|
+
|
289
|
+
return this.$getBaseDicts({
|
278
290
|
code: commonAttributeCode,
|
279
|
-
data:{
|
280
|
-
...accessParam
|
291
|
+
data: {
|
292
|
+
...accessParam,
|
293
|
+
},
|
294
|
+
success: ({ dicts, dictMap }) => {
|
295
|
+
this.fillColumnWidgetOptionItems(widget, dicts);
|
281
296
|
},
|
282
|
-
success: ({dicts, dictMap}) => {
|
283
|
-
this.fillColumnWidgetOptionItems(widget,dicts)
|
284
|
-
}
|
285
297
|
});
|
286
298
|
}
|
287
299
|
},
|
@@ -730,10 +742,6 @@ modules = {
|
|
730
742
|
return this.$baseLodash.cloneDeep(newColumns);
|
731
743
|
},
|
732
744
|
async initTableList() {
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
745
|
let that = this;
|
738
746
|
let path = null;
|
739
747
|
let paramFun = null;
|
@@ -982,14 +990,16 @@ modules = {
|
|
982
990
|
|
983
991
|
let gridPageSize = this.widget.options.gridPageSize;
|
984
992
|
let gridPageSizeList = this.widget.options.gridPageSizeList || [];
|
985
|
-
if(!gridPageSizeList || !gridPageSizeList.length){
|
986
|
-
pagerConfig.pageSizes = [50,100,200,500]
|
987
|
-
if(!gridPageSize)gridPageSize = 100
|
988
|
-
pagerConfig.pageSize = gridPageSize
|
989
|
-
}else{
|
990
|
-
pagerConfig.pageSizes = gridPageSizeList
|
991
|
-
|
992
|
-
|
993
|
+
if (!gridPageSizeList || !gridPageSizeList.length) {
|
994
|
+
pagerConfig.pageSizes = [50, 100, 200, 500];
|
995
|
+
if (!gridPageSize) gridPageSize = 100;
|
996
|
+
pagerConfig.pageSize = gridPageSize;
|
997
|
+
} else {
|
998
|
+
pagerConfig.pageSizes = gridPageSizeList
|
999
|
+
.filter((item) => item.value)
|
1000
|
+
.map((item) => item.value);
|
1001
|
+
if (!gridPageSize) gridPageSize = pagerConfig.pageSizes[0];
|
1002
|
+
pagerConfig.pageSize = gridPageSize;
|
993
1003
|
}
|
994
1004
|
|
995
1005
|
//标题颜色
|
@@ -1322,7 +1332,7 @@ modules = {
|
|
1322
1332
|
let columnLoopDo = (t, e) => {
|
1323
1333
|
callback && callback(t);
|
1324
1334
|
if (t.children && t.children.length) {
|
1325
|
-
this.loodHandleColumns(t.children,callback)
|
1335
|
+
this.loodHandleColumns(t.children, callback);
|
1326
1336
|
/* for (let item of t.children) {
|
1327
1337
|
columnLoopDo(item);
|
1328
1338
|
} */
|
@@ -1608,7 +1618,7 @@ modules = {
|
|
1608
1618
|
this.removeTreeRow({ row });
|
1609
1619
|
return;
|
1610
1620
|
}
|
1611
|
-
|
1621
|
+
delete this.fieldSchemaMap[row._X_ROW_KEY];
|
1612
1622
|
let $grid = this.getGridTable();
|
1613
1623
|
$grid.remove(row);
|
1614
1624
|
let tableData = $grid.getTableData();
|
@@ -1621,46 +1631,60 @@ modules = {
|
|
1621
1631
|
});
|
1622
1632
|
// this.deleteRowWidgets(row);
|
1623
1633
|
},
|
1624
|
-
isSingerlSearch(widget){
|
1634
|
+
isSingerlSearch(widget) {
|
1625
1635
|
let widgetType = widget?.type;
|
1626
|
-
let result =
|
1627
|
-
|
1636
|
+
let result =
|
1637
|
+
widgetType === "singerSearch" ||
|
1638
|
+
(widgetType === "vabsearch" && !widget.options.multipleChoices);
|
1639
|
+
return result;
|
1628
1640
|
},
|
1629
|
-
getColumnNullValue(widget){
|
1630
|
-
if(!widget)return null
|
1641
|
+
getColumnNullValue(widget) {
|
1642
|
+
if (!widget) return null;
|
1631
1643
|
let nullValue = null;
|
1632
1644
|
let widgetType = widget.type;
|
1633
|
-
let multiWidgetTypes = [
|
1645
|
+
let multiWidgetTypes = [
|
1646
|
+
"checkbox",
|
1647
|
+
"time-range",
|
1648
|
+
"baseAttachment",
|
1649
|
+
"vabUpload",
|
1650
|
+
"project-tag",
|
1651
|
+
];
|
1634
1652
|
|
1635
1653
|
let defaultValue = widget.options.defaultValue;
|
1636
|
-
if (
|
1637
|
-
|
1638
|
-
|
1654
|
+
if (
|
1655
|
+
defaultValue !== undefined &&
|
1656
|
+
defaultValue !== null &&
|
1657
|
+
defaultValue !== ""
|
1658
|
+
) {
|
1659
|
+
nullValue = defaultValue;
|
1660
|
+
} else if (widgetType === "select" && widget.options.multiple) {
|
1639
1661
|
nullValue = [];
|
1640
|
-
} else if (widgetType ===
|
1662
|
+
} else if (widgetType === "date" && widget.options.type == "dates") {
|
1641
1663
|
nullValue = [];
|
1642
|
-
}else if (widgetType ===
|
1664
|
+
} else if (widgetType === "vabsearch" && widget.options.multipleChoices) {
|
1643
1665
|
nullValue = [];
|
1644
|
-
} else if (multiWidgetTypes.includes(widgetType)){
|
1666
|
+
} else if (multiWidgetTypes.includes(widgetType)) {
|
1645
1667
|
nullValue = [];
|
1646
1668
|
}
|
1647
1669
|
return nullValue;
|
1648
1670
|
},
|
1649
|
-
getIsFormWidget(widget){
|
1671
|
+
getIsFormWidget(widget) {
|
1650
1672
|
let widgetTypes = ["baseAttachment"];
|
1651
1673
|
let result = false;
|
1652
|
-
if(widget.formItemFlag){
|
1674
|
+
if (widget.formItemFlag) {
|
1653
1675
|
result = true;
|
1654
1676
|
}
|
1655
1677
|
return result;
|
1656
1678
|
},
|
1657
|
-
handleWidgetNullValue(widget,newData){
|
1658
|
-
if(!widget || !newData)return
|
1659
|
-
if(this.getIsFormWidget(widget)){
|
1660
|
-
let field = this.getFieldKeyName(widget)
|
1661
|
-
let nullValue = newData.hasOwnProperty(field)
|
1679
|
+
handleWidgetNullValue(widget, newData) {
|
1680
|
+
if (!widget || !newData) return;
|
1681
|
+
if (this.getIsFormWidget(widget)) {
|
1682
|
+
let field = this.getFieldKeyName(widget);
|
1683
|
+
let nullValue = newData.hasOwnProperty(field)
|
1684
|
+
? null
|
1685
|
+
: this.getColumnNullValue(widget);
|
1662
1686
|
newData[field] = nullValue;
|
1663
|
-
if(this.isSingerlSearch(widget)){
|
1687
|
+
if (this.isSingerlSearch(widget)) {
|
1664
1688
|
let vabSearchName = widget.options.vabSearchName;
|
1665
1689
|
if (vabSearchName) newData[vabSearchName] = null;
|
1666
1690
|
}
|
@@ -1671,28 +1695,27 @@ modules = {
|
|
1671
1695
|
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
1672
1696
|
if (!item.children?.length && item.prop && item.label) {
|
1673
1697
|
let formatS = !isEdit ? item.formatS : item.editFormatS;
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1698
|
+
let widget = null;
|
1699
|
+
if (isEdit) {
|
1700
|
+
widget = item.editWidget || item.widget;
|
1701
|
+
} else {
|
1702
|
+
widget = item.widget;
|
1703
|
+
}
|
1704
|
+
if (formatS == "widgetRender") {
|
1705
|
+
if (item.widgetList) {
|
1706
|
+
loopHandleWidget(item.widgetList, (w, p) => {
|
1707
|
+
this.handleWidgetNullValue(w, newData);
|
1708
|
+
});
|
1679
1709
|
}
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
}
|
1686
|
-
}else {
|
1687
|
-
if(widget){
|
1688
|
-
this.handleWidgetNullValue(widget, newData);
|
1689
|
-
}else {
|
1690
|
-
newData[item.prop] = null
|
1691
|
-
}
|
1710
|
+
} else {
|
1711
|
+
if (widget) {
|
1712
|
+
this.handleWidgetNullValue(widget, newData);
|
1713
|
+
} else {
|
1714
|
+
newData[item.prop] = null;
|
1692
1715
|
}
|
1716
|
+
}
|
1693
1717
|
}
|
1694
1718
|
});
|
1695
|
-
|
1696
1719
|
/* let vailColumns = this.widget.options.tableColumns.filter(
|
1697
1720
|
(item) => item.prop && item.label
|
1698
1721
|
);
|
@@ -1872,7 +1895,7 @@ modules = {
|
|
1872
1895
|
let rowIndex = Math.max(obj.rowIndex, 0);
|
1873
1896
|
|
1874
1897
|
let propName = fieldKeyName + "." + rowIndex + "." + property;
|
1875
|
-
return propName
|
1898
|
+
return propName;
|
1876
1899
|
},
|
1877
1900
|
getColumnProp(widget, obj, isEdit) {
|
1878
1901
|
if (!widget) {
|
@@ -1883,9 +1906,12 @@ modules = {
|
|
1883
1906
|
}*/
|
1884
1907
|
let isQueryTable = this.widget.options.isQueryTable || false;
|
1885
1908
|
if (isEdit || !isQueryTable) {
|
1886
|
-
let sourceWidgetId = isEdit
|
1887
|
-
|
1888
|
-
|
1909
|
+
let sourceWidgetId = isEdit
|
1910
|
+
? obj.column.params.editWidget.id
|
1911
|
+
: obj.column.params.widget.id;
|
1912
|
+
if (!this.fieldSchemaMap[obj.row._X_ROW_KEY]) return "false";
|
1913
|
+
let fieldWidget =
|
1914
|
+
this.fieldSchemaMap[obj.row._X_ROW_KEY][sourceWidgetId];
|
1889
1915
|
if (!fieldWidget) {
|
1890
1916
|
return "false";
|
1891
1917
|
}
|
@@ -1894,8 +1920,8 @@ modules = {
|
|
1894
1920
|
let rowIndex = Math.max(obj.rowIndex, 0);
|
1895
1921
|
|
1896
1922
|
let property = this.getFieldKeyName(fieldWidget);
|
1897
|
-
if(obj.row[property] && Array.isArray(obj.row[property])){
|
1898
|
-
return "false"
|
1923
|
+
if (obj.row[property] && Array.isArray(obj.row[property])) {
|
1924
|
+
return "false";
|
1899
1925
|
}
|
1900
1926
|
// let property = obj.column.property
|
1901
1927
|
if (this.isVabsearchFlagWidget(fieldWidget)) {
|