centaline-data-driven-v3 0.0.90 → 0.0.92
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 +53 -34
- package/src/components/common/iframe.vue +4 -1
- package/src/components/web/ComboBox.vue +14 -5
- package/src/components/web/ContainerControl.vue +1 -1
- package/src/components/web/File.vue +16 -4
- package/src/components/web/Form.vue +29 -7
- 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 +17 -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 +60 -1
- package/src/main.js +3 -3
- package/src/utils/common.js +4 -1
- package/src/utils/formData.js +285 -180
- package/src/utils/mixins.js +0 -18
- package/src/utils/request.js +10 -5
package/src/utils/formData.js
CHANGED
|
@@ -1,158 +1,214 @@
|
|
|
1
1
|
import common from './common';
|
|
2
2
|
import Enum from './Enum';
|
|
3
3
|
import request from './request';
|
|
4
|
-
import Form from '../loader/src/Form';
|
|
5
4
|
const formData = {
|
|
6
|
-
install(app) {
|
|
7
|
-
app.config.globalProperties.$formData = formData;
|
|
8
|
-
},
|
|
9
5
|
form: null,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
formTable: null,
|
|
7
|
+
excuteData: null,//fields
|
|
8
|
+
fieldsDic: null,//fieldsDic
|
|
9
|
+
source:null,
|
|
10
|
+
_excuteListData: undefined,
|
|
11
|
+
enableRelationFields(FlagRelation) {
|
|
16
12
|
this.form.enableRelationFields = FlagRelation
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
},
|
|
14
|
+
//获取code1
|
|
15
|
+
getCode1ByField1(id) {
|
|
20
16
|
var rtn1 = this.fieldsDic[id];
|
|
21
17
|
if (rtn1) {
|
|
22
|
-
|
|
18
|
+
return rtn1.code1;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
//获取code2
|
|
23
|
+
getCode2ByField1(id) {
|
|
27
24
|
var rtn1 = this.fieldsDic[id];
|
|
28
25
|
if (rtn1) {
|
|
29
|
-
|
|
26
|
+
return rtn1.code2;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setActionRouter(id, attrKey, attrValue) {
|
|
30
|
+
var router = this.form.actionRouters.find((v1) => {
|
|
31
|
+
return v1.key === id;
|
|
32
|
+
});
|
|
33
|
+
if (router) {
|
|
34
|
+
router[attrKey] = attrValue;
|
|
30
35
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
},
|
|
37
|
+
//获取Field的属性attrKey的值
|
|
38
|
+
getValueByFieldName(id, attrKey) {
|
|
34
39
|
attrKey = common.initialsToLowerCase(attrKey);
|
|
35
40
|
var rtn1 = this.fieldsDic[id];
|
|
36
41
|
if (rtn1) {
|
|
37
|
-
|
|
42
|
+
return rtn1[attrKey];
|
|
38
43
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
},
|
|
45
|
+
getValueByFieldNameFromParent(id, attrKey) {
|
|
46
|
+
if (this.form && this.form.parentModelForm) {
|
|
47
|
+
return this.form.parentModelForm.getValueByFieldName(id, attrKey);
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
},
|
|
51
|
+
//设置Field的属性attrKey的值
|
|
52
|
+
setValueByFieldName(id, attrKey, attrValue) {
|
|
42
53
|
attrKey = common.initialsToLowerCase(attrKey);
|
|
43
54
|
var rtn1 = this.fieldsDic[id];
|
|
44
55
|
if (rtn1) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
if (attrKey == 'code1' && rtn1.controlType === Enum.ControlType.NumericTextBox
|
|
57
|
+
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
58
|
+
if (rtn1.decimals1 != undefined && rtn1.decimals1 != null && rtn1.decimals1 > -1) {
|
|
59
|
+
attrValue = Number(attrValue).toFixed(rtn1.decimals1)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (attrKey == 'code1' && (rtn1.controlType === Enum.ControlType.File
|
|
63
|
+
|| rtn1.controlType === Enum.ControlType.SliceUpload || rtn1.controlType === Enum.ControlType.PhotoSelect)
|
|
64
|
+
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
65
|
+
rtn1.jsSetFile(attrValue, rtn1);
|
|
66
|
+
}
|
|
67
|
+
rtn1[attrKey] = attrValue;
|
|
68
|
+
if (rtn1.controlType === Enum.ControlType.Tags) {
|
|
69
|
+
rtn1["value"] = JSON.parse(attrValue);
|
|
70
|
+
}
|
|
71
|
+
if (rtn1.controlType === Enum.ControlType.SearchListBox
|
|
72
|
+
|| rtn1.controlType === Enum.ControlType.ComboBox
|
|
73
|
+
|| rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
|
|
74
|
+
|| rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
|
|
75
|
+
) {
|
|
76
|
+
if (rtn1["options"].length == 0) {
|
|
77
|
+
rtn1["options"] = [{ value: '', label: '' }];
|
|
50
78
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
79
|
+
if (attrKey == 'code1') {
|
|
80
|
+
rtn1["value"] = attrValue;
|
|
81
|
+
rtn1["options"][0]["value"] = attrValue
|
|
82
|
+
}
|
|
83
|
+
if (attrKey == 'name1') {
|
|
84
|
+
rtn1["options"][0]["label"] = attrValue
|
|
85
|
+
}
|
|
86
|
+
if (rtn1.itemKey) rtn1.itemKey = Math.random()
|
|
87
|
+
}
|
|
88
|
+
if (rtn1.is == 'ct-button') {
|
|
89
|
+
if (common.flagApp() && this.form.$vue.loaded) {
|
|
90
|
+
this.form.$vue.loaded(this.form)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
this.source.hiddenHandle(rtn1, this.form);
|
|
94
|
+
if(this.source.requiredHandle){
|
|
95
|
+
this.source.requiredHandle(rtn1, this.form);
|
|
96
|
+
}
|
|
54
97
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
98
|
+
},
|
|
99
|
+
setValueByFieldNameFromParent(id, attrKey, attrValue) {
|
|
100
|
+
if (this.form && this.form.parentModelForm) {
|
|
101
|
+
return this.form.parentModelForm.setValueByFieldName(id, attrKey, attrValue);
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
},
|
|
105
|
+
//设置Field的v1、v2的值
|
|
106
|
+
setV1AndV2ByField1(id, code1, code2) {
|
|
58
107
|
var rtn1 = this.fieldsDic[id];
|
|
59
108
|
if (rtn1) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
109
|
+
if (typeof rtn1.code1 !== 'undefined') {
|
|
110
|
+
rtn1.code1 = code1;
|
|
111
|
+
this.source.hiddenHandle(rtn1);//隐藏关联的
|
|
112
|
+
}
|
|
113
|
+
if (typeof rtn1.code2 !== 'undefined') {
|
|
114
|
+
rtn1.code2 = code2;
|
|
115
|
+
}
|
|
67
116
|
}
|
|
68
|
-
|
|
69
|
-
|
|
117
|
+
},
|
|
118
|
+
clearMedia(id) {
|
|
119
|
+
var rtn1 = this.fieldsDic[id];
|
|
120
|
+
for (let i = 0; i < rtn1.fileSourceList.length; i++) {
|
|
121
|
+
rtn1.fileSourceList[i].flagDeleted = true;
|
|
122
|
+
}
|
|
123
|
+
rtn1.fileList = [];
|
|
124
|
+
},
|
|
125
|
+
setTabsSelect(id) {
|
|
70
126
|
if (this.form && this.form.$vue) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
127
|
+
var f = this.fieldsDic[id];
|
|
128
|
+
if (this.form.isHorizontalLayout) {
|
|
129
|
+
this.form.$vue.activeName = f.collapseName.toString() === '-1' ? this.form.$vue.activeName : f.collapseName.toString();
|
|
130
|
+
}
|
|
75
131
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
132
|
+
},
|
|
133
|
+
//路由提交
|
|
134
|
+
submit(fieldName1) {
|
|
79
135
|
if (this.form && this.form.$vue) {
|
|
80
|
-
|
|
136
|
+
this.form.$vue.fieldClickHandler({ fieldName1: fieldName1 });
|
|
81
137
|
}
|
|
82
|
-
|
|
138
|
+
},
|
|
83
139
|
|
|
84
|
-
|
|
85
|
-
|
|
140
|
+
//获取列表数据
|
|
141
|
+
get excuteListData() {
|
|
86
142
|
if (this._excuteListData) {
|
|
87
|
-
|
|
143
|
+
return this._excuteListData;
|
|
88
144
|
}
|
|
89
145
|
else {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
146
|
+
if (this.excuteData !== null) {
|
|
147
|
+
this._excuteListData = this.excuteData.filter((v) => {
|
|
148
|
+
return typeof v.is !== undefined && (v.is === 'ct-formlist' || v.is === 'ct-repeat');
|
|
149
|
+
});
|
|
150
|
+
}
|
|
95
151
|
}
|
|
96
152
|
return this._excuteListData;
|
|
97
|
-
|
|
98
|
-
|
|
153
|
+
},
|
|
154
|
+
setExcuteListData(fields) {
|
|
99
155
|
this._excuteListData = null;
|
|
100
156
|
if (fields !== null) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
157
|
+
this.excuteData = fields;
|
|
158
|
+
this._excuteListData = fields.filter((v) => {
|
|
159
|
+
return typeof v.is !== undefined && (v.is === 'ct-formlist' || v.is === 'ct-repeat');
|
|
160
|
+
});
|
|
105
161
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
162
|
+
},
|
|
163
|
+
//获取列表的Field
|
|
164
|
+
getListField(tableName, rowNum, fiedlId) {
|
|
109
165
|
let listData = this.excuteListData.find((v) => {
|
|
110
|
-
|
|
166
|
+
return v.name === tableName;
|
|
111
167
|
});
|
|
112
168
|
if (listData) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
169
|
+
let field = null;
|
|
170
|
+
//正在编辑的Field
|
|
171
|
+
if (rowNum === null && (fiedlId === null || listData.currentEventField.fieldName1 === fiedlId)) {
|
|
172
|
+
field = listData.currentEventField;
|
|
173
|
+
}
|
|
174
|
+
//正在编辑的行
|
|
175
|
+
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
176
|
+
let fields = listData.currentRow.data;
|
|
177
|
+
field = fields[fiedlId];
|
|
178
|
+
}
|
|
179
|
+
//源数据
|
|
180
|
+
else {
|
|
181
|
+
if (rowNum === null && listData.currentRowIndex) {
|
|
182
|
+
rowNum = listData.currentRowIndex;
|
|
117
183
|
}
|
|
118
|
-
//正在编辑的行
|
|
119
|
-
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
120
|
-
let fields = listData.currentRow.data;
|
|
121
|
-
field = fields[fiedlId];
|
|
122
|
-
}
|
|
123
|
-
//源数据
|
|
124
|
-
else {
|
|
125
|
-
if (rowNum === null && listData.currentRowIndex) {
|
|
126
|
-
rowNum = listData.currentRowIndex;
|
|
127
|
-
}
|
|
128
184
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
}
|
|
185
|
+
if (rowNum === 0 || (rowNum && fiedlId)) {
|
|
186
|
+
try {
|
|
187
|
+
let fields = listData.rows[rowNum].field;
|
|
188
|
+
field = fields.find((v) => {
|
|
189
|
+
return v.fieldName1 === fiedlId;
|
|
190
|
+
});
|
|
191
|
+
} catch (e) {
|
|
192
|
+
if (listData.rows.length <= rowNum) {
|
|
193
|
+
common.message('获取列表行索引超出界限', 'error')
|
|
140
194
|
}
|
|
195
|
+
}
|
|
141
196
|
}
|
|
197
|
+
}
|
|
142
198
|
|
|
143
|
-
|
|
199
|
+
return { listData: listData, field: field };
|
|
144
200
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
201
|
+
},
|
|
202
|
+
//获取列表的行数(注意 这里包括列头)
|
|
203
|
+
getListCount(tableName) {
|
|
148
204
|
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
149
205
|
let data = this.getListField(tableName, null, null);
|
|
150
206
|
if (data) {
|
|
151
|
-
|
|
207
|
+
return data.listData.rows.length;
|
|
152
208
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
209
|
+
},
|
|
210
|
+
//获取表格某行某列的值
|
|
211
|
+
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
156
212
|
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
157
213
|
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
158
214
|
|
|
@@ -160,27 +216,27 @@ const formData = {
|
|
|
160
216
|
attrName = attrName ? attrName : 'code1';
|
|
161
217
|
|
|
162
218
|
if (!fiedlId) {
|
|
163
|
-
|
|
219
|
+
fiedlId = data.listData.currentEventField.fieldName1;
|
|
164
220
|
}
|
|
165
221
|
if (fiedlId && rowNum === null && fiedlId === data.listData.currentEventField.fieldName1) {
|
|
166
|
-
|
|
222
|
+
data.field = data.listData.currentEventField;
|
|
167
223
|
}
|
|
168
224
|
rowNum = rowNum !== null ? rowNum : data.listData.currentRowIndex;
|
|
169
225
|
|
|
170
226
|
//若该行正在编辑,则取编辑状态的。
|
|
171
227
|
if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId]
|
|
172
|
-
|
|
173
|
-
|
|
228
|
+
&& data.listData.currentRow.data.$sourceIndex === rowNum && data.listData.currentRow.isSet) {
|
|
229
|
+
return data.listData.currentRow.data[fiedlId][attrName];
|
|
174
230
|
}
|
|
175
231
|
else if (data && data.field) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
232
|
+
if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
|
|
233
|
+
return defaultValue;
|
|
234
|
+
}
|
|
235
|
+
return data.field[attrName];
|
|
180
236
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
237
|
+
},
|
|
238
|
+
//设置表格某行某列的值
|
|
239
|
+
setListFieldValue(value, tableName, rowNum, fiedlId, attrName, flagTemplate) {
|
|
184
240
|
value = value == undefined ? "" : value.toString();
|
|
185
241
|
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
186
242
|
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
@@ -189,70 +245,119 @@ const formData = {
|
|
|
189
245
|
attrName = attrName ? attrName : 'code1';
|
|
190
246
|
|
|
191
247
|
if (!fiedlId) {
|
|
192
|
-
|
|
248
|
+
fiedlId = data.listData.currentEventField.id;
|
|
193
249
|
}
|
|
194
250
|
|
|
195
251
|
rowNum = rowNum ? rowNum : data.listData.currentRowIndex;
|
|
196
252
|
|
|
197
253
|
if (data) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
if (data.field) {
|
|
208
|
-
data.field[attrName] = value;
|
|
209
|
-
}
|
|
254
|
+
//正在编辑的行
|
|
255
|
+
if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && rowNum > -1
|
|
256
|
+
&& data.listData.currentRow.data.$sourceIndex === data.listData.source.rows[rowNum].$sourceIndex) {
|
|
257
|
+
let currentField = data.listData.currentRow.data[fiedlId];
|
|
258
|
+
currentField[attrName] = value;
|
|
259
|
+
//校验自己
|
|
260
|
+
if (currentField.validExcute) {
|
|
261
|
+
currentField.validExcute();
|
|
210
262
|
}
|
|
211
|
-
|
|
212
|
-
|
|
263
|
+
if (data.field) {
|
|
264
|
+
data.field[attrName] = value;
|
|
213
265
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if (data.
|
|
217
|
-
|
|
218
|
-
|
|
266
|
+
}
|
|
267
|
+
else if (data.field) {
|
|
268
|
+
if (data.field) {
|
|
269
|
+
data.field[attrName] = value;
|
|
270
|
+
}
|
|
271
|
+
if (data.field.source) {
|
|
272
|
+
data.field.source[attrName] = value;
|
|
273
|
+
}
|
|
274
|
+
if (flagTemplate) {
|
|
275
|
+
data.field[attrName] = value;
|
|
276
|
+
}
|
|
277
|
+
if (data.listData.flagTemplate && data.listData.$vue) {
|
|
278
|
+
data.listData.$vue.itemKey = Math.random()
|
|
219
279
|
}
|
|
280
|
+
}
|
|
220
281
|
|
|
221
|
-
|
|
282
|
+
//如果有汇总列,触发重新计算汇总
|
|
283
|
+
if (data.listData.showSummary) {
|
|
284
|
+
data.listData.tableData.push({});
|
|
285
|
+
data.listData.tableData.pop();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return true;
|
|
222
289
|
}
|
|
223
290
|
return false;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
291
|
+
},
|
|
292
|
+
//设置表格选择路由
|
|
293
|
+
setListSelectRouter(tableId, attrKey, attrValue) {
|
|
227
294
|
let listData = this.excuteListData.find((v) => {
|
|
228
|
-
|
|
295
|
+
return v.fieldName1 === tableId;
|
|
229
296
|
});
|
|
230
|
-
listData
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
297
|
+
if (listData) {
|
|
298
|
+
var router = listData.selectRouter;
|
|
299
|
+
if (router) {
|
|
300
|
+
router[attrKey] = attrValue;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
//设置表格属性值
|
|
305
|
+
setListAttr(tableId, attrName, attrValue) {
|
|
234
306
|
let listData = this.excuteListData.find((v) => {
|
|
235
|
-
|
|
307
|
+
return v.fieldName1 === tableId;
|
|
236
308
|
});
|
|
237
|
-
listData
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
309
|
+
if (listData) {
|
|
310
|
+
listData[attrName] = attrValue
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
//新增表格数据
|
|
314
|
+
insertRow(tableId, rows) {
|
|
241
315
|
let listData = this.excuteListData.find((v) => {
|
|
242
|
-
|
|
316
|
+
return v.fieldName1 === tableId;
|
|
243
317
|
});
|
|
244
|
-
listData
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
318
|
+
if (listData) {
|
|
319
|
+
listData.$vue.insertRow(rows);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
//添加单选表格数据
|
|
323
|
+
insertSingleRow(tableId, row) {
|
|
248
324
|
let listData = this.excuteListData.find((v) => {
|
|
249
|
-
|
|
325
|
+
return v.fieldName1 === tableId;
|
|
250
326
|
});
|
|
251
|
-
listData
|
|
252
|
-
|
|
327
|
+
if (listData) {
|
|
328
|
+
listData.$vue.insertSingleRow(row);
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
//新增或替换表格数据
|
|
332
|
+
insertOrUpdateRow(tableId, row) {
|
|
333
|
+
let listData = this.excuteListData.find((v) => {
|
|
334
|
+
return v.fieldName1 === tableId;
|
|
335
|
+
});
|
|
336
|
+
if (listData) {
|
|
337
|
+
listData.$vue.insertOrUpdateRow(row);
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
//删除表格数据
|
|
341
|
+
deleteRow(tableId, row) {
|
|
342
|
+
let listData = this.excuteListData.find((v) => {
|
|
343
|
+
return v.id === tableId;
|
|
344
|
+
});
|
|
345
|
+
if (listData) {
|
|
346
|
+
listData.$vue.delRow(row);
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
//清空表格数据
|
|
350
|
+
clear(tableId) {
|
|
351
|
+
let listData = this.excuteListData.find((v) => {
|
|
352
|
+
return v.fieldName1 === tableId;
|
|
353
|
+
});
|
|
354
|
+
if (listData) {
|
|
355
|
+
listData.$vue.deleteAll();
|
|
356
|
+
}
|
|
357
|
+
},
|
|
253
358
|
|
|
254
|
-
|
|
255
|
-
|
|
359
|
+
//获取后台数据,并返回脚本。
|
|
360
|
+
execServerScript(action, object, successCallback) {
|
|
256
361
|
let formData = this;//作用域保存
|
|
257
362
|
|
|
258
363
|
//是否是行内触发的
|
|
@@ -260,33 +365,33 @@ const formData = {
|
|
|
260
365
|
object.editMode = data ? 1 : 0;
|
|
261
366
|
|
|
262
367
|
request.postHandler(common.globalUri(), { action: action, para: object }).then(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
368
|
+
function (response) {
|
|
369
|
+
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
370
|
+
var data = response.content;
|
|
371
|
+
if (response.clientActionType === Enum.ClientActionType.ExcuteScript && data) {
|
|
372
|
+
common.excute.call(formData.form.scripts, data);
|
|
373
|
+
}
|
|
374
|
+
else
|
|
375
|
+
if (response.clientActionType === Enum.ClientActionType.None && data && successCallback) {
|
|
376
|
+
//因为要传参,并直接执行方法,故successCallback回调里要使用formData的话,要加this
|
|
377
|
+
//若不能接受this,也可修改common.excute方法
|
|
378
|
+
//successCallback.call(formData.form.scripts, data);
|
|
274
379
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
380
|
+
//优化,不需要加this
|
|
381
|
+
common.excuteFun.call(formData.form.scripts, successCallback, data);
|
|
278
382
|
}
|
|
279
383
|
}
|
|
384
|
+
}
|
|
280
385
|
);
|
|
281
|
-
|
|
282
|
-
|
|
386
|
+
},
|
|
387
|
+
execRouter(routerKey) {
|
|
283
388
|
let field = { fieldName1: routerKey };
|
|
284
389
|
this.form.$vue.fieldClickHandler(field);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
390
|
+
},
|
|
391
|
+
//消息提示 type主题:success/warning/info/error。 duration 显示时间, 毫秒。设为 0 则不会自动关闭。 showClose 是否显示关闭按钮。
|
|
392
|
+
message(message, type, center, duration, showClose, dangerouslyUseHTMLString) {
|
|
288
393
|
common.message(message, type, center, duration, showClose, dangerouslyUseHTMLString)
|
|
289
|
-
|
|
394
|
+
},
|
|
290
395
|
};
|
|
291
396
|
|
|
292
397
|
export default formData;
|
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) {
|