centaline-data-driven 1.2.71 → 1.2.74
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/build/centaline/centaline.path.js +1 -0
- package/package.json +1 -1
- package/src/Form.vue +2 -2
- package/src/SearchList.vue +4 -4
- package/src/assets/more.png +0 -0
- package/src/centaline/dynamicBtn/src/dynamicBtn.vue +1 -1
- package/src/centaline/dynamicContact/src/dynamicContact.vue +4 -4
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +8 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +29 -19
- package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +52 -22
- package/src/centaline/dynamicForm/src/dynamicForm.vue +50 -11
- package/src/centaline/dynamicInputNumber/src/dynamicInputNumber.vue +2 -6
- package/src/centaline/dynamicLayout/index.js +11 -0
- package/src/centaline/dynamicLayout/src/dynamicLayout.vue +311 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutChildren.vue +44 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutImage.vue +39 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +55 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +29 -0
- package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +21 -5
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +60 -37
- package/src/centaline/dynamicSearchList/src/dynamicTableStats.vue +4 -0
- package/src/centaline/dynamicT/src/dynamicT.vue +2 -0
- package/src/centaline/formData/index.js +46 -28
- package/src/centaline/loader/src/ctl/Button.js +3 -0
- package/src/centaline/loader/src/ctl/CellLayout.js +135 -0
- package/src/centaline/loader/src/ctl/Form.js +318 -3
- package/src/centaline/loader/src/ctl/FormList.js +69 -11
- package/src/centaline/loader/src/ctl/SearchTable.js +132 -127
- package/src/centaline/loader/src/ctl.js +1 -0
- package/src/centaline/selectOption/src/selectOptionVertical.vue +8 -0
- package/src/main.js +6 -6
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -4,7 +4,7 @@ import Enum from './lib/Enum';
|
|
|
4
4
|
import Router from './Router';
|
|
5
5
|
import valid from '../../../validate/index';
|
|
6
6
|
import common from '../../../common';
|
|
7
|
-
import
|
|
7
|
+
import Axios from 'axios';
|
|
8
8
|
import Vue from 'vue';
|
|
9
9
|
|
|
10
10
|
const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
@@ -163,8 +163,297 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
163
163
|
get onload() {
|
|
164
164
|
return source.onload;
|
|
165
165
|
},
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
formData:{
|
|
167
|
+
common: common,
|
|
168
|
+
Axios: Axios,
|
|
169
|
+
form: null,
|
|
170
|
+
formTable:null,
|
|
171
|
+
excuteData: null,//fields
|
|
172
|
+
fieldsDic: null,//fieldsDic
|
|
173
|
+
_excuteListData: undefined,
|
|
174
|
+
|
|
175
|
+
//获取code1
|
|
176
|
+
getCode1ByField1(id) {
|
|
177
|
+
var rtn1 = this.fieldsDic[id];
|
|
178
|
+
if (rtn1) {
|
|
179
|
+
return rtn1.value;
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
//获取code2
|
|
183
|
+
getCode2ByField1(id) {
|
|
184
|
+
var rtn1 = this.fieldsDic[id];
|
|
185
|
+
if (rtn1) {
|
|
186
|
+
return rtn1.value1;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
//获取Field的属性attrKey的值
|
|
190
|
+
getValueByFieldName(id, attrKey) {
|
|
191
|
+
attrKey = this.common.initialsToUpperCase(attrKey);
|
|
192
|
+
var rtn1 = this.fieldsDic[id];
|
|
193
|
+
if (rtn1) {
|
|
194
|
+
return rtn1.source[attrKey];
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
//设置Field的属性attrKey的值
|
|
198
|
+
setValueByFieldName(id, attrKey, attrValue) {
|
|
199
|
+
attrKey = this.common.initialsToUpperCase(attrKey);
|
|
200
|
+
var rtn1 = this.fieldsDic[id];
|
|
201
|
+
if (rtn1) {
|
|
202
|
+
rtn1.source[attrKey] = attrValue;
|
|
203
|
+
this.form.hatchHandle(id, attrKey, attrValue, rtn1);
|
|
204
|
+
//this.form.hiddenHandle(rtn1);//隐藏关联的
|
|
205
|
+
|
|
206
|
+
//用于处理源数据改动,强制更新视图数据 todo
|
|
207
|
+
if (rtn1.self.$forceUpdate) {
|
|
208
|
+
rtn1.self.$forceUpdate();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
//设置Field的v1、v2的值
|
|
213
|
+
setV1AndV2ByField1(id, code1, code2) {
|
|
214
|
+
var rtn1 = this.fieldsDic[id];
|
|
215
|
+
if (rtn1) {
|
|
216
|
+
if (typeof rtn1.value !== 'undefined') {
|
|
217
|
+
rtn1.value = code1;
|
|
218
|
+
|
|
219
|
+
this.form.validMrf(rtn1);//验证必填关联组件
|
|
220
|
+
this.form.hiddenHandle(rtn1, true);//隐藏关联的
|
|
221
|
+
}
|
|
222
|
+
if (typeof rtn1.value1 !== 'undefined') {
|
|
223
|
+
rtn1.value1 = code2;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (rtn1.self.$forceUpdate) {
|
|
227
|
+
rtn1.self.$forceUpdate();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
//获取列表数据
|
|
233
|
+
get excuteListData() {
|
|
234
|
+
if (this._excuteListData) {
|
|
235
|
+
return this._excuteListData;
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
if (this.excuteData !== null) {
|
|
239
|
+
this._excuteListData = this.excuteData.filter((v) => {
|
|
240
|
+
return typeof v.is !== undefined && v.is === 'ct-form-list-table';
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return this._excuteListData;
|
|
245
|
+
},
|
|
246
|
+
setExcuteListData(fields) {
|
|
247
|
+
this._excuteListData=null;
|
|
248
|
+
if (fields !== null) {
|
|
249
|
+
this.excuteData=fields;
|
|
250
|
+
this._excuteListData = fields.filter((v) => {
|
|
251
|
+
return typeof v.is !== undefined && v.is === 'ct-form-list-table';
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
//获取列表的Field
|
|
256
|
+
getListField(tableName, rowNum, fiedlId) {
|
|
257
|
+
let listData = this.excuteListData.find((v) => {
|
|
258
|
+
return v.id === tableName;
|
|
259
|
+
});
|
|
260
|
+
if (listData) {
|
|
261
|
+
let field = null;
|
|
262
|
+
//正在编辑的Field
|
|
263
|
+
if (rowNum === null && (fiedlId === null || listData.currentEventField.id === fiedlId)) {
|
|
264
|
+
field = listData.currentEventField;
|
|
265
|
+
}
|
|
266
|
+
//正在编辑的行
|
|
267
|
+
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
268
|
+
let fields = listData.currentRow.data;
|
|
269
|
+
field = fields[fiedlId];
|
|
270
|
+
}
|
|
271
|
+
//源数据
|
|
272
|
+
else {
|
|
273
|
+
if (rowNum === null && listData.currentRowIndex) {
|
|
274
|
+
rowNum = listData.currentRowIndex;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (rowNum === 0 || (rowNum && fiedlId)) {
|
|
278
|
+
try {
|
|
279
|
+
let fields = listData.rows[rowNum].field;
|
|
280
|
+
field = fields.find((v) => {
|
|
281
|
+
return v.id === fiedlId;
|
|
282
|
+
});
|
|
283
|
+
} catch (e) {
|
|
284
|
+
if (listData.rows.length <= rowNum) {
|
|
285
|
+
var checkMsg = "获取列表行索引超出界限";
|
|
286
|
+
this.message(checkMsg);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return { listData: listData, field: field };
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
//获取列表的行数(注意 这里包括列头)
|
|
296
|
+
getListCount(tableName) {
|
|
297
|
+
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
298
|
+
let data = this.getListField(tableName, null, null);
|
|
299
|
+
if (data) {
|
|
300
|
+
return data.listData.rows.length;
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
//获取表格某行某列的值
|
|
304
|
+
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
305
|
+
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
306
|
+
|
|
307
|
+
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
308
|
+
|
|
309
|
+
attrName = this.common.initialsToUpperCase(attrName);
|
|
310
|
+
attrName = attrName ? attrName : 'code1';
|
|
311
|
+
|
|
312
|
+
if (!fiedlId) {
|
|
313
|
+
fiedlId = data.listData.currentEventField.id;
|
|
314
|
+
}
|
|
315
|
+
if (fiedlId && rowNum === null && fiedlId === data.listData.currentEventField.id) {
|
|
316
|
+
data.field = data.listData.currentEventField;
|
|
317
|
+
}
|
|
318
|
+
rowNum = rowNum !== null ? rowNum : data.listData.currentRowIndex;
|
|
319
|
+
|
|
320
|
+
//若该行正在编辑,则取编辑状态的。
|
|
321
|
+
if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId]
|
|
322
|
+
&& data.listData.currentRow.data.$sourceIndex === rowNum && data.listData.currentRow.isSet) {
|
|
323
|
+
return data.listData.currentRow.data[fiedlId].source[attrName];
|
|
324
|
+
}
|
|
325
|
+
else if (data && data.field) {
|
|
326
|
+
if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
|
|
327
|
+
return defaultValue;
|
|
328
|
+
}
|
|
329
|
+
return data.field.source[attrName];
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
//设置表格某行某列的值
|
|
333
|
+
setListFieldValue(value, tableName, rowNum, fiedlId, attrName) {
|
|
334
|
+
value = value==undefined?"":value.toString();
|
|
335
|
+
tableName = tableName ? tableName : this.form.scripts.$fd;
|
|
336
|
+
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
337
|
+
|
|
338
|
+
attrName = this.common.initialsToUpperCase(attrName);
|
|
339
|
+
attrName = attrName ? attrName : 'code1';
|
|
340
|
+
|
|
341
|
+
if (!fiedlId) {
|
|
342
|
+
fiedlId = data.listData.currentEventField.id;
|
|
343
|
+
}
|
|
344
|
+
if (fiedlId && !rowNum && fiedlId === data.listData.currentEventField.id) {
|
|
345
|
+
//data.field = data.listData.currentEventField;
|
|
346
|
+
}
|
|
347
|
+
rowNum = rowNum ? rowNum : data.listData.currentRowIndex;
|
|
348
|
+
|
|
349
|
+
if (data) {
|
|
350
|
+
if (data.field) {
|
|
351
|
+
data.field.source[attrName] = value;
|
|
352
|
+
data.listData.updateListField(data.listData.refFieldsLabel, rowNum, fiedlId);
|
|
353
|
+
}
|
|
354
|
+
//data.field.self.$forceUpdate();
|
|
355
|
+
|
|
356
|
+
//正在编辑的行
|
|
357
|
+
if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && data.listData.currentRow.data.$sourceIndex === rowNum) {
|
|
358
|
+
let currentField = data.listData.currentRow.data[fiedlId];
|
|
359
|
+
currentField.source[attrName] = value;
|
|
360
|
+
//校验自己
|
|
361
|
+
if (currentField.self && currentField.self.validExcute) {
|
|
362
|
+
currentField.self.validExcute();
|
|
363
|
+
}
|
|
364
|
+
if (typeof currentField.self.$forceUpdate === "function") {
|
|
365
|
+
currentField.self.$forceUpdate();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
//如果有汇总列,触发重新计算汇总
|
|
370
|
+
if (data.listData.showSummary) {
|
|
371
|
+
data.listData.tableData.push({});
|
|
372
|
+
data.listData.tableData.pop();
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
return false;
|
|
378
|
+
},
|
|
379
|
+
//设置表格属性值
|
|
380
|
+
setListAttr(tableId, attrName, attrValue) {
|
|
381
|
+
let listData = this.excuteListData.find((v) => {
|
|
382
|
+
return v.id === tableId;
|
|
383
|
+
});
|
|
384
|
+
listData[attrName] = attrValue
|
|
385
|
+
},
|
|
386
|
+
//新增表格数据
|
|
387
|
+
insertRow(tableId,rows) {
|
|
388
|
+
let listData = this.excuteListData.find((v) => {
|
|
389
|
+
return v.id === tableId;
|
|
390
|
+
});
|
|
391
|
+
listData.insertRow(rows);
|
|
392
|
+
},
|
|
393
|
+
//新增或替换表格数据
|
|
394
|
+
insertOrUpdateRow(tableId,row) {
|
|
395
|
+
let listData = this.excuteListData.find((v) => {
|
|
396
|
+
return v.id === tableId;
|
|
397
|
+
});
|
|
398
|
+
listData.insertOrUpdateRow(row);
|
|
399
|
+
},
|
|
400
|
+
//清空表格数据
|
|
401
|
+
clear(tableId) {
|
|
402
|
+
let listData = this.excuteListData.find((v) => {
|
|
403
|
+
return v.id === tableId;
|
|
404
|
+
});
|
|
405
|
+
listData.deleteAll();
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
//获取后台数据,并返回脚本。
|
|
409
|
+
execServerScript(action, object, successCallback) {
|
|
410
|
+
let formData = this;//作用域保存
|
|
411
|
+
|
|
412
|
+
//是否是行内触发的
|
|
413
|
+
let data = this.getListField(this.form.scripts.$fd, null, null);
|
|
414
|
+
object.editMode = data ? 1 : 0;
|
|
415
|
+
|
|
416
|
+
Vue.prototype.$api.postHandler(this.common.globalUri(), { action: action, para: object }).then(
|
|
417
|
+
function (response) {
|
|
418
|
+
if (response.rtnCode === Enum.ReturnCode.Successful) {
|
|
419
|
+
var data = response.content;
|
|
420
|
+
if (response.clientActionType === Enum.ClientActionType.ExcuteScript && data) {
|
|
421
|
+
formData.common.excute.call(formData.form.scripts, data);
|
|
422
|
+
}
|
|
423
|
+
else
|
|
424
|
+
if (response.clientActionType === Enum.ClientActionType.None && data && successCallback) {
|
|
425
|
+
//因为要传参,并直接执行方法,故successCallback回调里要使用formData的话,要加this
|
|
426
|
+
//若不能接受this,也可修改common.excute方法
|
|
427
|
+
//successCallback.call(formData.form.scripts, data);
|
|
428
|
+
|
|
429
|
+
//优化,不需要加this
|
|
430
|
+
formData.common.excuteFun.call(formData.form.scripts, successCallback, data);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
},
|
|
436
|
+
//消息提示 type主题:success/warning/info/error。 duration 显示时间, 毫秒。设为 0 则不会自动关闭。 showClose 是否显示关闭按钮。
|
|
437
|
+
message(message, type, center, duration, showClose, dangerouslyUseHTMLString) {
|
|
438
|
+
if (typeof center === 'undefined') {
|
|
439
|
+
center = true;
|
|
440
|
+
}
|
|
441
|
+
if (typeof duration === 'undefined') {
|
|
442
|
+
duration = 1500;
|
|
443
|
+
}
|
|
444
|
+
if (typeof showClose === 'undefined') {
|
|
445
|
+
showClose = false;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
Vue.prototype.$message({
|
|
449
|
+
message: message,//消息文字
|
|
450
|
+
dangerouslyUseHTMLString: dangerouslyUseHTMLString || false,
|
|
451
|
+
type: type || 'error',//主题:success/warning/info/error
|
|
452
|
+
center: center,//是否居中
|
|
453
|
+
duration: duration, //显示时间, 毫秒。设为 0 则不会自动关闭
|
|
454
|
+
showClose: showClose,//是否显示关闭按钮
|
|
455
|
+
});
|
|
456
|
+
},
|
|
168
457
|
},
|
|
169
458
|
getFormObj() {
|
|
170
459
|
var rtnFormObj = {};
|
|
@@ -356,6 +645,32 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
356
645
|
button.is = "ct-btn";
|
|
357
646
|
return button;
|
|
358
647
|
},
|
|
648
|
+
export(btn, submitData) {
|
|
649
|
+
Vue.prototype.$api.postHandler(common.globalUri(),{
|
|
650
|
+
action: btn.action,
|
|
651
|
+
para: submitData
|
|
652
|
+
});
|
|
653
|
+
},
|
|
654
|
+
doAction(response) {
|
|
655
|
+
if (response.responseData) {
|
|
656
|
+
response = response.responseData;
|
|
657
|
+
}
|
|
658
|
+
switch (response.notification) {
|
|
659
|
+
case Enum.ActionType.Export://导出
|
|
660
|
+
var fileName = response.content.fieldName1;
|
|
661
|
+
var fileContent = window.atob(response.content.code1);
|
|
662
|
+
common.saveFile(fileName, fileContent);
|
|
663
|
+
break;
|
|
664
|
+
case Enum.ActionType.Refersh://刷新
|
|
665
|
+
break;
|
|
666
|
+
case Enum.ActionType.RefreshParent://刷新父页面
|
|
667
|
+
rtn.self.$emit('refreshParent');
|
|
668
|
+
break;
|
|
669
|
+
default:
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
rtn.self.$forceUpdate();
|
|
673
|
+
},
|
|
359
674
|
};
|
|
360
675
|
valid.InitForm(rtn);
|
|
361
676
|
return rtn;
|
|
@@ -108,8 +108,7 @@ const FormList = function (source, master) {
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
_rows:null,
|
|
111
|
-
get rows() {
|
|
112
|
-
|
|
111
|
+
get rows() {
|
|
113
112
|
if (this._rows) {
|
|
114
113
|
return this._rows;
|
|
115
114
|
}
|
|
@@ -285,13 +284,17 @@ const FormList = function (source, master) {
|
|
|
285
284
|
cancelButtonText: "取消",
|
|
286
285
|
//type: 'warning'
|
|
287
286
|
}).then(() => {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
287
|
+
rtn.rows.forEach((row,i) => {
|
|
288
|
+
if(row.$sourceIndex===index){
|
|
289
|
+
if (row.isNewFlag) {
|
|
290
|
+
rtn.rows.splice(i, 1);
|
|
291
|
+
source.rows.splice(i, 1);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
rtn.rows[i].deleted = true;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
295
298
|
callback();
|
|
296
299
|
}).catch(() => {
|
|
297
300
|
});
|
|
@@ -349,7 +352,6 @@ const FormList = function (source, master) {
|
|
|
349
352
|
common.openDialog(dialogOption);
|
|
350
353
|
},
|
|
351
354
|
addSourceRow(row) {
|
|
352
|
-
//let sourceRow = JSON.parse(JSON.stringify(source.Rows[0]));
|
|
353
355
|
let sourceRow = JSON.parse(JSON.stringify(source.rows[0]));
|
|
354
356
|
for (let k in sourceRow.columns) {
|
|
355
357
|
//sourceRow.Row[k] = row.field[k].source;
|
|
@@ -418,7 +420,63 @@ const FormList = function (source, master) {
|
|
|
418
420
|
}]
|
|
419
421
|
};
|
|
420
422
|
common.openDialog(dialogOption);
|
|
421
|
-
}
|
|
423
|
+
},
|
|
424
|
+
deleteAll() {
|
|
425
|
+
if(rtn._rows && rtn._rows.length>1){
|
|
426
|
+
let index=0;
|
|
427
|
+
var newRows=[]
|
|
428
|
+
rtn._rows.forEach((r) => {
|
|
429
|
+
if(index>0){
|
|
430
|
+
if (!r.isNewFlag) {
|
|
431
|
+
r.deleted = true;
|
|
432
|
+
newRows.push(r);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
else{
|
|
436
|
+
index++;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
rtn._tableData.splice(0,rtn._tableData.length);
|
|
440
|
+
source.rows.splice(1, source.rows.length-1,newRows);
|
|
441
|
+
rtn._rows.splice(1, rtn._rows.length-1,newRows);
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
insertRow(rows) {
|
|
445
|
+
if(rows && rows.length>0){
|
|
446
|
+
rows.forEach((r) => {
|
|
447
|
+
source.rows.push(r);
|
|
448
|
+
let iRow = this.initRow(r);
|
|
449
|
+
iRow.isNewFlag = true;
|
|
450
|
+
rtn._rows.push(iRow);
|
|
451
|
+
Vue.set(r, 'edit', iRow.edit);
|
|
452
|
+
Vue.set(r, 'delete', iRow.delete);
|
|
453
|
+
rtn._rows[rtn._rows.length - 1].$sourceIndex = rtn._rows.length - 1;
|
|
454
|
+
|
|
455
|
+
let rowData = rtn.rowsItemToTableData(iRow)
|
|
456
|
+
rowData.$sourceIndex = rtn._rows.length - 1;
|
|
457
|
+
rowData.edit = iRow.edit;
|
|
458
|
+
rowData.delete = iRow.delete;
|
|
459
|
+
rtn._tableData.push(rowData);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
insertOrUpdateRow(row) {
|
|
464
|
+
if(row){
|
|
465
|
+
source.rows.push(r);
|
|
466
|
+
let iRow = this.initRow(r);
|
|
467
|
+
iRow.isNewFlag = true;
|
|
468
|
+
rtn._rows.push(iRow);
|
|
469
|
+
Vue.set(r, 'edit', iRow.edit);
|
|
470
|
+
Vue.set(r, 'delete', iRow.delete);
|
|
471
|
+
r.$sourceIndex = rtn._rows.length - 1;
|
|
472
|
+
|
|
473
|
+
let rowData = rtn.rowsItemToTableData(iRow)
|
|
474
|
+
rowData.$sourceIndex = rtn._rows.length - 1;
|
|
475
|
+
rowData.edit = iRow.edit;
|
|
476
|
+
rowData.delete = iRow.delete;
|
|
477
|
+
rtn._tableData.push(rowData);
|
|
478
|
+
}
|
|
479
|
+
},
|
|
422
480
|
};
|
|
423
481
|
return rtn;
|
|
424
482
|
};
|