centaline-data-driven-v3 0.0.90 → 0.0.91
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/dist/centaline-data-driven-v3.umd.js +141 -141
- package/package.json +1 -1
- package/src/assets/commonApp.css +1 -0
- package/src/components/app/ComboBox.vue +3 -3
- package/src/components/app/Form.vue +2 -2
- package/src/components/app/FormList.vue +20 -0
- package/src/components/app/SearchList/SearchTable.vue +3 -1
- package/src/components/app/TextBox.vue +1 -1
- package/src/components/app/searchScreen.vue +52 -34
- package/src/components/common/iframe.vue +4 -1
- package/src/components/web/ComboBox.vue +14 -5
- package/src/components/web/File.vue +16 -4
- package/src/components/web/Form.vue +25 -5
- package/src/components/web/MapBaidu.vue +10 -2
- package/src/components/web/PhotoSelect.vue +10 -2
- package/src/components/web/Progress.vue +17 -3
- package/src/components/web/SearchList/SearchTable.vue +15 -5
- package/src/components/web/SearchList.vue +5 -4
- package/src/components/web/SearchScreen.vue +16 -6
- package/src/components/web/Tree/Tree.vue +11 -4
- package/src/components/web/Tree.vue +11 -2
- package/src/components/web/ViewerFile.vue +7 -2
- package/src/components/web/appContainer.vue +4 -1
- package/src/components/web/dialog.vue +5 -2
- package/src/components/web/other/PopupSearchListTable.vue +6 -1
- package/src/components/web/photo.vue +16 -3
- package/src/loader/src/Field.js +5 -0
- package/src/loader/src/SearchScreen.js +447 -1
- package/src/main.js +2 -2
- package/src/utils/common.js +4 -1
- package/src/utils/mixins.js +0 -18
- package/src/utils/request.js +10 -5
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import base from '../index';
|
|
1
2
|
import LibFunction from './LibFunction';
|
|
2
3
|
import Enum from '../../utils/Enum';
|
|
3
4
|
import common from '../../utils/common';
|
|
@@ -26,6 +27,395 @@ function loadSearchScreenApi(action, callBack, screenPara, prevParam, failCallBa
|
|
|
26
27
|
}
|
|
27
28
|
function loadSearchScreenModel(source, prevParam) {
|
|
28
29
|
let rtn = {
|
|
30
|
+
formData: {
|
|
31
|
+
form: null,
|
|
32
|
+
formTable: null,
|
|
33
|
+
excuteData: null,//fields
|
|
34
|
+
fieldsDic: null,//fieldsDic
|
|
35
|
+
_excuteListData: undefined,
|
|
36
|
+
enableRelationFields(FlagRelation) {
|
|
37
|
+
this.form.enableRelationFields = FlagRelation
|
|
38
|
+
},
|
|
39
|
+
//获取code1
|
|
40
|
+
getCode1ByField1(id) {
|
|
41
|
+
var rtn1 = this.fieldsDic[id];
|
|
42
|
+
if (rtn1) {
|
|
43
|
+
return rtn1.code1;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
//获取code2
|
|
48
|
+
getCode2ByField1(id) {
|
|
49
|
+
var rtn1 = this.fieldsDic[id];
|
|
50
|
+
if (rtn1) {
|
|
51
|
+
return rtn1.code2;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setActionRouter(id, attrKey, attrValue) {
|
|
55
|
+
var router = this.form.actionRouters.find((v1) => {
|
|
56
|
+
return v1.key === id;
|
|
57
|
+
});
|
|
58
|
+
if (router) {
|
|
59
|
+
router[attrKey] = attrValue;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
//获取Field的属性attrKey的值
|
|
63
|
+
getValueByFieldName(id, attrKey) {
|
|
64
|
+
attrKey = common.initialsToLowerCase(attrKey);
|
|
65
|
+
var rtn1 = this.fieldsDic[id];
|
|
66
|
+
if (rtn1) {
|
|
67
|
+
return rtn1[attrKey];
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
getValueByFieldNameFromParent(id, attrKey) {
|
|
71
|
+
if (this.form && this.form.parentModelForm) {
|
|
72
|
+
return this.form.parentModelForm.getValueByFieldName(id, attrKey);
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
},
|
|
76
|
+
//设置Field的属性attrKey的值
|
|
77
|
+
setValueByFieldName(id, attrKey, attrValue) {
|
|
78
|
+
attrKey = common.initialsToLowerCase(attrKey);
|
|
79
|
+
var rtn1 = this.fieldsDic[id];
|
|
80
|
+
if (rtn1) {
|
|
81
|
+
if (attrKey == 'code1' && rtn1.controlType === Enum.ControlType.NumericTextBox
|
|
82
|
+
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
83
|
+
if (rtn1.decimals1 != undefined && rtn1.decimals1 != null && rtn1.decimals1 > -1) {
|
|
84
|
+
attrValue = Number(attrValue).toFixed(rtn1.decimals1)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else if (attrKey == 'code1' && (rtn1.controlType === Enum.ControlType.File
|
|
88
|
+
|| rtn1.controlType === Enum.ControlType.SliceUpload || rtn1.controlType === Enum.ControlType.PhotoSelect)
|
|
89
|
+
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
90
|
+
rtn1.jsSetFile(attrValue, rtn1);
|
|
91
|
+
}
|
|
92
|
+
rtn1[attrKey] = attrValue;
|
|
93
|
+
if (rtn1.controlType === Enum.ControlType.Tags) {
|
|
94
|
+
rtn1["value"] = JSON.parse(attrValue);
|
|
95
|
+
}
|
|
96
|
+
if (rtn1.controlType === Enum.ControlType.SearchListBox
|
|
97
|
+
|| rtn1.controlType === Enum.ControlType.ComboBox
|
|
98
|
+
|| rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
|
|
99
|
+
|| rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
|
|
100
|
+
) {
|
|
101
|
+
if (rtn1["options"].length == 0) {
|
|
102
|
+
rtn1["options"] = [{ value: '', label: '' }];
|
|
103
|
+
}
|
|
104
|
+
if (attrKey == 'code1') {
|
|
105
|
+
rtn1["value"] = attrValue;
|
|
106
|
+
rtn1["options"][0]["value"] = attrValue
|
|
107
|
+
}
|
|
108
|
+
if (attrKey == 'name1') {
|
|
109
|
+
rtn1["options"][0]["label"] = attrValue
|
|
110
|
+
}
|
|
111
|
+
if (rtn1.itemKey) rtn1.itemKey = Math.random()
|
|
112
|
+
}
|
|
113
|
+
if (rtn1.is == 'ct-button') {
|
|
114
|
+
if (common.flagApp() && this.form.$vue.loaded) {
|
|
115
|
+
this.form.$vue.loaded(this.form)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
hiddenHandle(rtn1, this.form);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
setValueByFieldNameFromParent(id, attrKey, attrValue) {
|
|
122
|
+
if (this.form && this.form.parentModelForm) {
|
|
123
|
+
return this.form.parentModelForm.setValueByFieldName(id, attrKey, attrValue);
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
},
|
|
127
|
+
//设置Field的v1、v2的值
|
|
128
|
+
setV1AndV2ByField1(id, code1, code2) {
|
|
129
|
+
var rtn1 = this.fieldsDic[id];
|
|
130
|
+
if (rtn1) {
|
|
131
|
+
if (typeof rtn1.code1 !== 'undefined') {
|
|
132
|
+
rtn1.code1 = code1;
|
|
133
|
+
hiddenHandle(rtn1);//隐藏关联的
|
|
134
|
+
}
|
|
135
|
+
if (typeof rtn1.code2 !== 'undefined') {
|
|
136
|
+
rtn1.code2 = code2;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
clearMedia(id) {
|
|
141
|
+
var rtn1 = this.fieldsDic[id];
|
|
142
|
+
for (let i = 0; i < rtn1.fileSourceList.length; i++) {
|
|
143
|
+
rtn1.fileSourceList[i].flagDeleted = true;
|
|
144
|
+
}
|
|
145
|
+
rtn1.fileList = [];
|
|
146
|
+
},
|
|
147
|
+
setTabsSelect(id) {
|
|
148
|
+
if (this.form && this.form.$vue) {
|
|
149
|
+
var f = this.fieldsDic[id];
|
|
150
|
+
if (this.form.isHorizontalLayout) {
|
|
151
|
+
this.form.$vue.activeName = f.collapseName.toString() === '-1' ? this.form.$vue.activeName : f.collapseName.toString();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
//路由提交
|
|
156
|
+
submit(fieldName1) {
|
|
157
|
+
if (this.form && this.form.$vue) {
|
|
158
|
+
this.form.$vue.fieldClickHandler({ fieldName1: fieldName1 });
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
//获取列表数据
|
|
163
|
+
get excuteListData() {
|
|
164
|
+
if (this._excuteListData) {
|
|
165
|
+
return this._excuteListData;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
if (this.excuteData !== null) {
|
|
169
|
+
this._excuteListData = this.excuteData.filter((v) => {
|
|
170
|
+
return typeof v.is !== undefined && (v.is === 'ct-formlist' || v.is === 'ct-repeat');
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return this._excuteListData;
|
|
175
|
+
},
|
|
176
|
+
setExcuteListData(fields) {
|
|
177
|
+
this._excuteListData = null;
|
|
178
|
+
if (fields !== null) {
|
|
179
|
+
this.excuteData = fields;
|
|
180
|
+
this._excuteListData = fields.filter((v) => {
|
|
181
|
+
return typeof v.is !== undefined && (v.is === 'ct-formlist' || v.is === 'ct-repeat');
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
//获取列表的Field
|
|
186
|
+
getListField(tableName, rowNum, fiedlId) {
|
|
187
|
+
let listData = this.excuteListData.find((v) => {
|
|
188
|
+
return v.name === tableName;
|
|
189
|
+
});
|
|
190
|
+
if (listData) {
|
|
191
|
+
let field = null;
|
|
192
|
+
//正在编辑的Field
|
|
193
|
+
if (rowNum === null && (fiedlId === null || listData.currentEventField.fieldName1 === fiedlId)) {
|
|
194
|
+
field = listData.currentEventField;
|
|
195
|
+
}
|
|
196
|
+
//正在编辑的行
|
|
197
|
+
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
198
|
+
let fields = listData.currentRow.data;
|
|
199
|
+
field = fields[fiedlId];
|
|
200
|
+
}
|
|
201
|
+
//源数据
|
|
202
|
+
else {
|
|
203
|
+
if (rowNum === null && listData.currentRowIndex) {
|
|
204
|
+
rowNum = listData.currentRowIndex;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (rowNum === 0 || (rowNum && fiedlId)) {
|
|
208
|
+
try {
|
|
209
|
+
let fields = listData.rows[rowNum].field;
|
|
210
|
+
field = fields.find((v) => {
|
|
211
|
+
return v.fieldName1 === fiedlId;
|
|
212
|
+
});
|
|
213
|
+
} catch (e) {
|
|
214
|
+
if (listData.rows.length <= rowNum) {
|
|
215
|
+
common.message('获取列表行索引超出界限', 'error')
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return { listData: listData, field: field };
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
//获取列表的行数(注意 这里包括列头)
|
|
225
|
+
getListCount(tableName) {
|
|
226
|
+
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
227
|
+
let data = this.getListField(tableName, null, null);
|
|
228
|
+
if (data) {
|
|
229
|
+
return data.listData.rows.length;
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
//获取表格某行某列的值
|
|
233
|
+
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
234
|
+
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
235
|
+
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
236
|
+
|
|
237
|
+
attrName = common.initialsToLowerCase(attrName);
|
|
238
|
+
attrName = attrName ? attrName : 'code1';
|
|
239
|
+
|
|
240
|
+
if (!fiedlId) {
|
|
241
|
+
fiedlId = data.listData.currentEventField.fieldName1;
|
|
242
|
+
}
|
|
243
|
+
if (fiedlId && rowNum === null && fiedlId === data.listData.currentEventField.fieldName1) {
|
|
244
|
+
data.field = data.listData.currentEventField;
|
|
245
|
+
}
|
|
246
|
+
rowNum = rowNum !== null ? rowNum : data.listData.currentRowIndex;
|
|
247
|
+
|
|
248
|
+
//若该行正在编辑,则取编辑状态的。
|
|
249
|
+
if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId]
|
|
250
|
+
&& data.listData.currentRow.data.$sourceIndex === rowNum && data.listData.currentRow.isSet) {
|
|
251
|
+
return data.listData.currentRow.data[fiedlId][attrName];
|
|
252
|
+
}
|
|
253
|
+
else if (data && data.field) {
|
|
254
|
+
if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
|
|
255
|
+
return defaultValue;
|
|
256
|
+
}
|
|
257
|
+
return data.field[attrName];
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
//设置表格某行某列的值
|
|
261
|
+
setListFieldValue(value, tableName, rowNum, fiedlId, attrName, flagTemplate) {
|
|
262
|
+
value = value == undefined ? "" : value.toString();
|
|
263
|
+
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
264
|
+
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
265
|
+
|
|
266
|
+
attrName = common.initialsToLowerCase(attrName);
|
|
267
|
+
attrName = attrName ? attrName : 'code1';
|
|
268
|
+
|
|
269
|
+
if (!fiedlId) {
|
|
270
|
+
fiedlId = data.listData.currentEventField.id;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
rowNum = rowNum ? rowNum : data.listData.currentRowIndex;
|
|
274
|
+
|
|
275
|
+
if (data) {
|
|
276
|
+
//正在编辑的行
|
|
277
|
+
if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && rowNum > -1
|
|
278
|
+
&& data.listData.currentRow.data.$sourceIndex === data.listData.source.rows[rowNum].$sourceIndex) {
|
|
279
|
+
let currentField = data.listData.currentRow.data[fiedlId];
|
|
280
|
+
currentField[attrName] = value;
|
|
281
|
+
//校验自己
|
|
282
|
+
if (currentField.validExcute) {
|
|
283
|
+
currentField.validExcute();
|
|
284
|
+
}
|
|
285
|
+
if (data.field) {
|
|
286
|
+
data.field[attrName] = value;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
else if (data.field) {
|
|
290
|
+
if (data.field) {
|
|
291
|
+
data.field[attrName] = value;
|
|
292
|
+
}
|
|
293
|
+
if (data.field.source) {
|
|
294
|
+
data.field.source[attrName] = value;
|
|
295
|
+
}
|
|
296
|
+
if (flagTemplate) {
|
|
297
|
+
data.field[attrName] = value;
|
|
298
|
+
}
|
|
299
|
+
if (data.listData.flagTemplate && data.listData.$vue) {
|
|
300
|
+
data.listData.$vue.itemKey = Math.random()
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
//如果有汇总列,触发重新计算汇总
|
|
305
|
+
if (data.listData.showSummary) {
|
|
306
|
+
data.listData.tableData.push({});
|
|
307
|
+
data.listData.tableData.pop();
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
return false;
|
|
313
|
+
},
|
|
314
|
+
//设置表格选择路由
|
|
315
|
+
setListSelectRouter(tableId, attrKey, attrValue) {
|
|
316
|
+
let listData = this.excuteListData.find((v) => {
|
|
317
|
+
return v.fieldName1 === tableId;
|
|
318
|
+
});
|
|
319
|
+
if (listData) {
|
|
320
|
+
var router = listData.selectRouter;
|
|
321
|
+
if (router) {
|
|
322
|
+
router[attrKey] = attrValue;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
//设置表格属性值
|
|
327
|
+
setListAttr(tableId, attrName, attrValue) {
|
|
328
|
+
let listData = this.excuteListData.find((v) => {
|
|
329
|
+
return v.fieldName1 === tableId;
|
|
330
|
+
});
|
|
331
|
+
if (listData) {
|
|
332
|
+
listData[attrName] = attrValue
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
//新增表格数据
|
|
336
|
+
insertRow(tableId, rows) {
|
|
337
|
+
let listData = this.excuteListData.find((v) => {
|
|
338
|
+
return v.fieldName1 === tableId;
|
|
339
|
+
});
|
|
340
|
+
if (listData) {
|
|
341
|
+
listData.$vue.insertRow(rows);
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
//添加单选表格数据
|
|
345
|
+
insertSingleRow(tableId, row) {
|
|
346
|
+
let listData = this.excuteListData.find((v) => {
|
|
347
|
+
return v.fieldName1 === tableId;
|
|
348
|
+
});
|
|
349
|
+
if (listData) {
|
|
350
|
+
listData.$vue.insertSingleRow(row);
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
//新增或替换表格数据
|
|
354
|
+
insertOrUpdateRow(tableId, row) {
|
|
355
|
+
let listData = this.excuteListData.find((v) => {
|
|
356
|
+
return v.fieldName1 === tableId;
|
|
357
|
+
});
|
|
358
|
+
if (listData) {
|
|
359
|
+
listData.$vue.insertOrUpdateRow(row);
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
//删除表格数据
|
|
363
|
+
deleteRow(tableId, row) {
|
|
364
|
+
let listData = this.excuteListData.find((v) => {
|
|
365
|
+
return v.id === tableId;
|
|
366
|
+
});
|
|
367
|
+
if (listData) {
|
|
368
|
+
listData.$vue.delRow(row);
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
//清空表格数据
|
|
372
|
+
clear(tableId) {
|
|
373
|
+
let listData = this.excuteListData.find((v) => {
|
|
374
|
+
return v.fieldName1 === tableId;
|
|
375
|
+
});
|
|
376
|
+
if (listData) {
|
|
377
|
+
listData.$vue.deleteAll();
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
|
|
381
|
+
//获取后台数据,并返回脚本。
|
|
382
|
+
execServerScript(action, object, successCallback) {
|
|
383
|
+
let formData = this;//作用域保存
|
|
384
|
+
|
|
385
|
+
//是否是行内触发的
|
|
386
|
+
let data = this.getListField(this.form.scripts.$fd, null, null);
|
|
387
|
+
object.editMode = data ? 1 : 0;
|
|
388
|
+
|
|
389
|
+
request.postHandler(common.globalUri(), { action: action, para: object }).then(
|
|
390
|
+
function (response) {
|
|
391
|
+
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
392
|
+
var data = response.content;
|
|
393
|
+
if (response.clientActionType === Enum.ClientActionType.ExcuteScript && data) {
|
|
394
|
+
common.excute.call(formData.form.scripts, data);
|
|
395
|
+
}
|
|
396
|
+
else
|
|
397
|
+
if (response.clientActionType === Enum.ClientActionType.None && data && successCallback) {
|
|
398
|
+
//因为要传参,并直接执行方法,故successCallback回调里要使用formData的话,要加this
|
|
399
|
+
//若不能接受this,也可修改common.excute方法
|
|
400
|
+
//successCallback.call(formData.form.scripts, data);
|
|
401
|
+
|
|
402
|
+
//优化,不需要加this
|
|
403
|
+
common.excuteFun.call(formData.form.scripts, successCallback, data);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
},
|
|
409
|
+
execRouter(routerKey) {
|
|
410
|
+
let field = { fieldName1: routerKey };
|
|
411
|
+
this.form.$vue.fieldClickHandler(field);
|
|
412
|
+
},
|
|
413
|
+
//消息提示 type主题:success/warning/info/error。 duration 显示时间, 毫秒。设为 0 则不会自动关闭。 showClose 是否显示关闭按钮。
|
|
414
|
+
message(message, type, center, duration, showClose, dangerouslyUseHTMLString) {
|
|
415
|
+
common.message(message, type, center, duration, showClose, dangerouslyUseHTMLString)
|
|
416
|
+
},
|
|
417
|
+
|
|
418
|
+
},
|
|
29
419
|
get title() {
|
|
30
420
|
return source.title;
|
|
31
421
|
},
|
|
@@ -41,6 +431,22 @@ function loadSearchScreenModel(source, prevParam) {
|
|
|
41
431
|
get parameterAction() {
|
|
42
432
|
return source.parameterAction
|
|
43
433
|
},
|
|
434
|
+
_scripts: null,
|
|
435
|
+
get scripts() {
|
|
436
|
+
if (rtn._scripts !== null) {
|
|
437
|
+
return rtn._scripts;
|
|
438
|
+
}
|
|
439
|
+
else {
|
|
440
|
+
if (source.scripts) {
|
|
441
|
+
rtn._scripts = base.common.eval(source.scripts);
|
|
442
|
+
return rtn._scripts;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
rtn._scripts = base.common.eval("");
|
|
446
|
+
return rtn._scripts;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
},
|
|
44
450
|
_screen: null,
|
|
45
451
|
_btnScreen: null,
|
|
46
452
|
_highScreen: null,
|
|
@@ -415,12 +821,52 @@ function getAction(api, callback) {
|
|
|
415
821
|
}
|
|
416
822
|
});
|
|
417
823
|
}
|
|
824
|
+
function changeHandler(field, model){
|
|
825
|
+
hiddenHandle(field, model);
|
|
826
|
+
clearRelatedHandle(field, model.screen)
|
|
827
|
+
if (field.onChanged) {
|
|
828
|
+
if (model.scripts) {
|
|
829
|
+
model.scripts.formData.setExcuteListData(model.screen);
|
|
830
|
+
}
|
|
831
|
+
model.scripts.$fd = field.id;
|
|
832
|
+
common.excute.call(model.scripts, field.onChanged);
|
|
833
|
+
}
|
|
834
|
+
if (field.onAfterChanged && field.controlType !== Enum.ControlType.NumericTextBox) {
|
|
835
|
+
var router = model.actionRouters.find((v) => {
|
|
836
|
+
return v.key === field.onAfterChanged;
|
|
837
|
+
});
|
|
838
|
+
if (router) {
|
|
839
|
+
model.$vue.clickHandler(router);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
if (model.scripts) {
|
|
843
|
+
model.scripts.formData.setExcuteListData(model.fields);
|
|
844
|
+
}
|
|
845
|
+
model.scripts.$fd = field.id;
|
|
846
|
+
common.excute.call(model.scripts, field.onAfterChanged);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
//清除关联当前组件的组件值
|
|
851
|
+
function clearRelatedHandle(field, fields) {
|
|
852
|
+
var f = fields.filter((v) => {
|
|
853
|
+
return v.parentField && field.fieldName1 && (',' + v.parentField + ',').indexOf(',' + field.fieldName1 + ',') > -1;
|
|
854
|
+
});
|
|
855
|
+
f.forEach((v) => {
|
|
856
|
+
if (v.reset) {
|
|
857
|
+
v.reset();
|
|
858
|
+
}
|
|
859
|
+
clearRelatedHandle(v, fields)
|
|
860
|
+
});
|
|
861
|
+
}
|
|
418
862
|
const SearchScreen = {
|
|
419
863
|
loadSearchScreenApi,
|
|
420
864
|
loadSearchScreenModel,
|
|
421
865
|
hiddenHandle,
|
|
422
866
|
isHandle,
|
|
423
867
|
getNewSearchValue,
|
|
424
|
-
getAction
|
|
868
|
+
getAction,
|
|
869
|
+
changeHandler,
|
|
870
|
+
clearRelatedHandle
|
|
425
871
|
};
|
|
426
872
|
export default SearchScreen;
|
package/src/main.js
CHANGED
|
@@ -33,7 +33,7 @@ app.use(centaline, {
|
|
|
33
33
|
flagApp: true,//是否app端
|
|
34
34
|
zindex: 999,
|
|
35
35
|
showRequestSuccessMessage: true,
|
|
36
|
-
showRequestErrorMessage:
|
|
36
|
+
showRequestErrorMessage: false,
|
|
37
37
|
language: 'HK',
|
|
38
38
|
handler: {
|
|
39
39
|
// 打开tab页
|
|
@@ -68,7 +68,7 @@ app.use(centaline, {
|
|
|
68
68
|
//authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
|
|
69
69
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
70
70
|
//authObject: '{token:"1-bce18a8d-21f0-4022-a6ca-450de105cafc"}',
|
|
71
|
-
authObject: '{EmpID:"
|
|
71
|
+
authObject: '{EmpID:"Token_19b970bd-bd37-4ded-853c-c0c001270a60",MachineCode:"7c4b2ffd-920a-462c-a586-37bbfb45c4fe",SSO_Token:"SSOToken_19b970bd-bd37-4ded-853c-c0c001270a60",Platform:"IOS"}',
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
74
|
getToken() {
|
package/src/utils/common.js
CHANGED
|
@@ -285,7 +285,10 @@ const common = {
|
|
|
285
285
|
showDialog({ title: '提示', message: message, closeOnClickOverlay: true, confirmButtonText: this.LocalizedString('确定', '確認'), className: 'showDialogMessage' });
|
|
286
286
|
}
|
|
287
287
|
else {
|
|
288
|
-
showToast(
|
|
288
|
+
showToast({
|
|
289
|
+
message: message,
|
|
290
|
+
duration: 3000,
|
|
291
|
+
});
|
|
289
292
|
}
|
|
290
293
|
|
|
291
294
|
}
|
package/src/utils/mixins.js
CHANGED
|
@@ -164,9 +164,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
164
164
|
progressKey: res.content.key,
|
|
165
165
|
progressType: field.isExport ? 'export' : 'import',
|
|
166
166
|
onFinished(data) {
|
|
167
|
-
if (common.flagApp()) {
|
|
168
|
-
closeToast()
|
|
169
|
-
}
|
|
170
167
|
field.disabled = false;
|
|
171
168
|
model.pageDisabled = false;
|
|
172
169
|
common.closeDialog(dialogOption);
|
|
@@ -197,9 +194,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
197
194
|
model.$vue.emit('submit', { formData: model, responseData: data });
|
|
198
195
|
},
|
|
199
196
|
onError(data) {
|
|
200
|
-
if (common.flagApp()) {
|
|
201
|
-
closeToast()
|
|
202
|
-
}
|
|
203
197
|
field.disabled = false;
|
|
204
198
|
model.pageDisabled = false;
|
|
205
199
|
common.closeDialog(dialogOption);
|
|
@@ -231,9 +225,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
231
225
|
progressKey: res202.content.key,
|
|
232
226
|
progressType: field.isExport ? 'export' : 'import',
|
|
233
227
|
onFinished(data) {
|
|
234
|
-
if (common.flagApp()) {
|
|
235
|
-
closeToast()
|
|
236
|
-
}
|
|
237
228
|
field.disabled = false;
|
|
238
229
|
model.pageDisabled = false;
|
|
239
230
|
common.closeDialog(dialogOption);
|
|
@@ -264,9 +255,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
264
255
|
model.$vue.emit('submit', { formData: model, responseData: data });
|
|
265
256
|
},
|
|
266
257
|
onError(data) {
|
|
267
|
-
if (common.flagApp()) {
|
|
268
|
-
closeToast()
|
|
269
|
-
}
|
|
270
258
|
field.disabled = false;
|
|
271
259
|
model.pageDisabled = false;
|
|
272
260
|
common.closeDialog(dialogOption);
|
|
@@ -280,9 +268,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
280
268
|
}
|
|
281
269
|
});
|
|
282
270
|
}).catch(() => {
|
|
283
|
-
if (common.flagApp()) {
|
|
284
|
-
closeToast()
|
|
285
|
-
}
|
|
286
271
|
field.disabled = false;
|
|
287
272
|
model.pageDisabled = false;
|
|
288
273
|
});
|
|
@@ -291,9 +276,6 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
|
|
|
291
276
|
}
|
|
292
277
|
else {
|
|
293
278
|
field.doAction(model.$vue.getFormObj(), (data) => {
|
|
294
|
-
if (common.flagApp()) {
|
|
295
|
-
closeToast()
|
|
296
|
-
}
|
|
297
279
|
field.disabled = false;
|
|
298
280
|
model.pageDisabled = false;
|
|
299
281
|
if (data.rtnCode === Enum.ReturnCode.Successful) {
|
package/src/utils/request.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Axios from 'axios';
|
|
2
2
|
import Enum from './Enum';
|
|
3
3
|
import common from './common';
|
|
4
|
+
import { closeToast } from "vant";
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
Axios.defaults.headers.post['Content-Type'] = 'application/json';
|
|
@@ -15,7 +16,7 @@ const request = {
|
|
|
15
16
|
params = params.para;
|
|
16
17
|
}
|
|
17
18
|
else if (common.flagRouterSelf()) {
|
|
18
|
-
url = url + (url=='' || url.substr(-1)=='/'?'':'/') +
|
|
19
|
+
url = url + (url == '' || url.substr(-1) == '/' ? '' : '/') + (params.action.charAt(0) == '/' ? params.action.substr(1) : params.action);
|
|
19
20
|
params = params.para;
|
|
20
21
|
}
|
|
21
22
|
return Axios.get(url, params, {
|
|
@@ -34,7 +35,7 @@ const request = {
|
|
|
34
35
|
params = params.para;
|
|
35
36
|
}
|
|
36
37
|
else if (common.flagRouterSelf()) {
|
|
37
|
-
url = url + (url=='' || url.substr(-1)=='/'?'':'/') +
|
|
38
|
+
url = url + (url == '' || url.substr(-1) == '/' ? '' : '/') + (params.action.charAt(0) == '/' ? params.action.substr(1) : params.action);
|
|
38
39
|
params = params.para;
|
|
39
40
|
}
|
|
40
41
|
return Axios.post(url, params, {
|
|
@@ -48,6 +49,10 @@ const request = {
|
|
|
48
49
|
);
|
|
49
50
|
},
|
|
50
51
|
postThenHandler: function (response, scripts) {
|
|
52
|
+
//移动端请求完 关闭正在处理弹层
|
|
53
|
+
if (common.flagApp()) {
|
|
54
|
+
closeToast()
|
|
55
|
+
}
|
|
51
56
|
var data = response.data;
|
|
52
57
|
if (typeof common.getDataDrivenOpts().handler.requestComplete === 'function') {
|
|
53
58
|
common.getDataDrivenOpts().handler.requestComplete(response);
|
|
@@ -127,7 +132,7 @@ const request = {
|
|
|
127
132
|
params = params.para;
|
|
128
133
|
}
|
|
129
134
|
else if (common.flagRouterSelf()) {
|
|
130
|
-
url = url + (url=='' || url.substr(-1)=='/'?'':'/') + (params.action.charAt(0)=='/'? params.action.substr(1):params.action);
|
|
135
|
+
url = url + (url == '' || url.substr(-1) == '/' ? '' : '/') + (params.action.charAt(0) == '/' ? params.action.substr(1) : params.action);
|
|
131
136
|
params = params.para;
|
|
132
137
|
}
|
|
133
138
|
return Axios.post(url, params, {
|
|
@@ -150,7 +155,7 @@ const request = {
|
|
|
150
155
|
params = params.para;
|
|
151
156
|
}
|
|
152
157
|
else if (common.flagRouterSelf()) {
|
|
153
|
-
url = url + (url == '' || url.substr(-1) == '/' ? '' : '/') + (params.action.charAt(0)=='/'? params.action.substr(1):params.action);
|
|
158
|
+
url = url + (url == '' || url.substr(-1) == '/' ? '' : '/') + (params.action.charAt(0) == '/' ? params.action.substr(1) : params.action);
|
|
154
159
|
params = params.para;
|
|
155
160
|
}
|
|
156
161
|
return Axios.post(url, params, {
|
|
@@ -175,7 +180,7 @@ const request = {
|
|
|
175
180
|
params = params.para;
|
|
176
181
|
}
|
|
177
182
|
else if (common.flagRouterSelf()) {
|
|
178
|
-
url = url + (url=='' || url.substr(-1)=='/'?'':'/') +
|
|
183
|
+
url = url + (url == '' || url.substr(-1) == '/' ? '' : '/') + (params.action.charAt(0) == '/' ? params.action.substr(1) : params.action);
|
|
179
184
|
params = params.para;
|
|
180
185
|
}
|
|
181
186
|
return Axios.post(url, params, {
|