centaline-data-driven 1.2.30 → 1.2.31

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven",
3
- "version": "1.2.30",
3
+ "version": "1.2.31",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
@@ -780,3 +780,6 @@ html {
780
780
  .current-row .el-table__cell .el-input-group__prepend{
781
781
  min-width: 0!important;
782
782
  }
783
+ .list-button .max-btn-add{
784
+ width: 85px;
785
+ }
@@ -47,7 +47,6 @@
47
47
  height: 26px;
48
48
  background: #EE6B6B;
49
49
  border-color:#EE6B6B;
50
- width: 85px;
51
50
  box-shadow: 0px 2px 4px 0px rgba(238,107,107,0.25);
52
51
  border-radius: 6px;
53
52
  }
@@ -71,6 +71,7 @@
71
71
  //row.flagRow && row.columnShow===column.id?'ct-td3':null,
72
72
  rowBorderLeftColumns.includes(column.id)?'ct-td4':null,
73
73
  rowBorderRightColumns.includes(column.id)?'ct-td5':null,
74
+ model.rowHiddenKeyData.indexOf(row[model.rowHiddenKey])%2?'ct-tdDouble':'ct-tdSingle',
74
75
  selectKey===row[model.rowHiddenKey]?'select':null,
75
76
  colIndex === leftShadow?'shadowLeft':null,
76
77
  colIndex === rightShadow?'shadowRight':null,
@@ -503,6 +504,7 @@
503
504
  border-bottom: 0px;
504
505
  width: 100%;
505
506
  outline: 0;
507
+ padding: 0px;
506
508
  }
507
509
  .ct-searchtable .ct-table {
508
510
  min-width: 100%;
@@ -536,6 +538,12 @@
536
538
  .ct-searchtable .ct-tr > .ct-td5 {
537
539
  border-right: 1px solid #e7e8eb;
538
540
  }
541
+ .ct-searchtable .ct-tr > .ct-tdSingle {
542
+ background-color: rgb(255 243 244);
543
+ }
544
+ .ct-searchtable .ct-tr > .ct-tdDouble {
545
+ background-color: rgb(239 255 239);
546
+ }
539
547
  .shadowLeft {
540
548
  border-right: 1px solid #e7e8eb;
541
549
  box-shadow: 2px 0 3px -1px rgba(0,0,0,0.1);
@@ -26,7 +26,7 @@
26
26
  :class="['ct-table',model.attrs.size?'ct-table-'+model.attrs.size:'']">
27
27
  <!--表头-->
28
28
  <thead ref="tableHead">
29
- <tr class="ct-tr" ref="headTr" v-for="(columns,columnsIndex) in model.columnsArr">
29
+ <tr class="ct-tr" ref="headTr" v-for="(columns,columnsIndex) in model.columnsArr" :key="columnsIndex">
30
30
  <th v-if="model.isMulti && columnsIndex === 0" ref="headLeftThs" class="ct-td left-fixation-th checkbox-td" :class="[model.tdClass]">
31
31
  <label class="el-checkbox"><span class="el-checkbox__input" :class="model.selectAllType">
32
32
  <span class="el-checkbox__inner"></span>
@@ -37,7 +37,7 @@
37
37
 
38
38
 
39
39
  </th>
40
- <th :ref="column.fixed?(column.fixed==='left'?'headLeftThs':'headRightThs'):'headThs'" v-for="(column,colIndex) in columns"
40
+ <th :ref="column.fixed?(column.fixed==='left'?'headLeftThs':'headRightThs'):'headThs'" v-for="(column,colIndex) in columns" :key="colIndex"
41
41
  v-if="column.show" class="ct-td ct-searchtable-th"
42
42
  :rowspan="column.rowspan"
43
43
  :colspan="column.colspan"
@@ -75,7 +75,7 @@
75
75
  </td>
76
76
  </tr>-->
77
77
  <!--可视区域的行数据-->
78
- <tr v-for="(row,rowindex) in model.listData"
78
+ <tr v-for="(row,rowindex) in model.listData" :key="rowindex"
79
79
  v-if="pageRowMin <= rowindex && rowindex <= pageRowMax"
80
80
  :ref="'rows.'+rowindex" @click="rowClickHandle($event,rowindex)"
81
81
  class="ct-tr"
@@ -89,7 +89,7 @@
89
89
  </label>
90
90
  </td>
91
91
  <td :ref="column.fixed?(column.fixed==='left'?'headLeftTds':'headRightTds'):null"
92
- v-for="(column,colIndex) in model.dataFieldcolumns"
92
+ v-for="(column,colIndex) in model.dataFieldcolumns" :key="colIndex"
93
93
  v-if="tdShow(column, row)"
94
94
  :rowspan="tdRowspan(column, row)"
95
95
  class="ct-td"
@@ -15,6 +15,7 @@ const ContactList = function (source,para ,callBack) {
15
15
  _columns: [],
16
16
  _columnsArr: [],
17
17
  _dataFieldcolumns: [],
18
+ _dataFieldcolumnsShow: [],
18
19
  _listData: [],
19
20
  _scripts: null,
20
21
  isMergeTitle: false,//是否合并标题
@@ -23,6 +24,7 @@ const ContactList = function (source,para ,callBack) {
23
24
  rowHiddenKey:'contactID',
24
25
  rowHiddenColumns:['contactNameDesc','propertyIdentityTypeID'],
25
26
  columnShow:'contactNoTypeDesc',
27
+ rowHiddenKeyData:[],
26
28
  attrs: {
27
29
  size: 'mini'
28
30
  },
@@ -91,7 +93,7 @@ const ContactList = function (source,para ,callBack) {
91
93
  var newRow = {};
92
94
  newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
93
95
  newRow.descNewRow = v.descNewRow;
94
- newRow.colspan = rtn.dataFieldcolumns.length-rtn.rowMergedColumns.length;
96
+ newRow.colspan = rtn.dataFieldcolumnsShow.length-rtn.rowMergedColumns.length;
95
97
  newRow.columnShow=rtn.columnShow;
96
98
  newRow.flagRow=true;
97
99
  rtn._listData.push(newRow);
@@ -101,6 +103,11 @@ const ContactList = function (source,para ,callBack) {
101
103
  }
102
104
  return rtn._listData;
103
105
  },
106
+ set listData(v) {
107
+ if (v) {
108
+ rtn._listData=v;
109
+ }
110
+ },
104
111
  get columns() {
105
112
  var self = this;
106
113
  if (self._columns.length > 0) {
@@ -282,6 +289,20 @@ const ContactList = function (source,para ,callBack) {
282
289
  self._dataFieldcolumns = arr;
283
290
  return self._dataFieldcolumns;
284
291
  }
292
+ },
293
+ get dataFieldcolumnsShow() {
294
+ var self = this;
295
+ if (self._dataFieldcolumnsShow.length > 0) {
296
+ return self._dataFieldcolumnsShow;
297
+ }
298
+ else {
299
+ var arr = self.columns.filter(v => {
300
+ return v.isDataField !== false && v.show
301
+ });
302
+
303
+ self._dataFieldcolumnsShow = arr;
304
+ return self._dataFieldcolumnsShow;
305
+ }
285
306
  },
286
307
  get rowMergedColumns() {
287
308
  return source.rowMergedColumns || [];
@@ -314,44 +335,10 @@ const ContactList = function (source,para ,callBack) {
314
335
  if (response.rtnCode === Enum.ReturnCode.Successful) {
315
336
  if (response.content.rows.length > 0) {
316
337
  if(router.flagAddRowAfterAction){
317
- response.content.rows.forEach((v) => {
318
- if(v.descNewRow){
319
- var newRow = {};
320
- newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
321
- newRow.descNewRow = v.descNewRow;
322
- newRow.colspan = rtn.dataFieldcolumns.length-rtn.rowMergedColumns.length;
323
- newRow.columnShow=rtn.columnShow;
324
- newRow.flagRow=true;
325
- rtn._listData.unshift(newRow);
326
- }
327
- rtn._listData.unshift(v);
328
- });
329
- rtn.setHiddenRow();
338
+ rtn.doNew(response.content.rows);
330
339
  }
331
340
  else{
332
- let updateData=[];
333
- response.content.rows.forEach((v) => {
334
- updateData.push(v);
335
- if(v.descNewRow){
336
- var newRow = {};
337
- newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
338
- newRow.descNewRow = v.descNewRow;
339
- newRow.colspan = rtn.dataFieldcolumns.length-rtn.rowMergedColumns.length;
340
- newRow.columnShow=rtn.columnShow;
341
- newRow.flagRow=true;
342
- updateData.push(newRow);
343
- }
344
- });
345
- let strat=0;
346
- let count=0;
347
- rtn._listData.forEach((v,i) => {
348
- if(v[rtn.rowHiddenKey]===searchValue1){
349
- if(strat===0)strat=i;
350
- count=count+1;
351
- }
352
- });
353
- rtn._listData.splice(strat, count,updateData);
354
- rtn.setHiddenRow();
341
+ rtn.doUpdate(response.content.rows,searchValue1);
355
342
  }
356
343
  }
357
344
  }
@@ -387,46 +374,12 @@ const ContactList = function (source,para ,callBack) {
387
374
  break;
388
375
  case Enum.ActionType.New://新增
389
376
  case Enum.ActionType.CloseTabThenNew://新增
390
- response.content.forEach((v) => {
391
- if(v.descNewRow){
392
- var newRow = {};
393
- newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
394
- newRow.descNewRow = v.descNewRow;
395
- newRow.colspan = rtn.dataFieldcolumns.length-rtn.rowMergedColumns.length;
396
- newRow.columnShow=rtn.columnShow;
397
- newRow.flagRow=true;
398
- rtn._listData.unshift(newRow);
399
- }
400
- rtn._listData.unshift(v);
401
- });
402
- rtn.setHiddenRow();
377
+ rtn.doNew(response.content);
403
378
  break;
404
379
  case Enum.ActionType.Update://修改
405
380
  case Enum.ActionType.CloseTabThenUpdate://修改
406
381
  var searchValue1=rtn.listData[rtn.selectIndex][self.primaryKey];
407
- let updateData=[];
408
- response.content.forEach((v) => {
409
- updateData.push(v);
410
- if(v.descNewRow){
411
- var newRow = {};
412
- newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
413
- newRow.descNewRow = v.descNewRow;
414
- newRow.colspan = rtn.dataFieldcolumns.length-rtn.rowMergedColumns.length;
415
- newRow.columnShow=rtn.columnShow;
416
- newRow.flagRow=true;
417
- updateData.push(newRow);
418
- }
419
- });
420
- let strat=0;
421
- let count=0;
422
- rtn._listData.forEach((v,i) => {
423
- if(v[rtn.rowHiddenKey]===searchValue1){
424
- if(strat===0)strat=i;
425
- count=count+1;
426
- }
427
- });
428
- rtn._listData.splice(strat, count,updateData);
429
- rtn.setHiddenRow();
382
+ rtn.doUpdate(response.content,searchValue1);
430
383
  break;
431
384
  default:
432
385
  break;
@@ -434,6 +387,63 @@ const ContactList = function (source,para ,callBack) {
434
387
  }
435
388
  rtn.$vue.$forceUpdate();
436
389
  },
390
+ doNew(data){
391
+ data.forEach((v) => {
392
+ if(v.descNewRow){
393
+ var newRow = {};
394
+ newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
395
+ newRow.descNewRow = v.descNewRow;
396
+ newRow.colspan = rtn.dataFieldcolumnsShow.length-rtn.rowMergedColumns.length;
397
+ newRow.columnShow=rtn.columnShow;
398
+ newRow.flagRow=true;
399
+ rtn._listData.unshift(newRow);
400
+ }
401
+ rtn._listData.unshift(v);
402
+ });
403
+ rtn.setHiddenRow();
404
+ },
405
+ doUpdate(data,searchValue1){
406
+ let updateData=[];
407
+ data.forEach((v) => {
408
+ updateData.push(v);
409
+ if(v.descNewRow){
410
+ var newRow = {};
411
+ newRow[rtn.rowHiddenKey]=v[rtn.rowHiddenKey];
412
+ newRow.descNewRow = v.descNewRow;
413
+ newRow.colspan = rtn.dataFieldcolumnsShow.length-rtn.rowMergedColumns.length;
414
+ newRow.columnShow=rtn.columnShow;
415
+ newRow.flagRow=true;
416
+ updateData.push(newRow);
417
+ }
418
+ });
419
+ let strat=0;
420
+ let count=0;
421
+ rtn._listData.forEach((v,i) => {
422
+ if(v[rtn.rowHiddenKey]===searchValue1){
423
+ if(strat===0)strat=i;
424
+ count=count+1;
425
+ }
426
+ });
427
+ if(updateData.length===1){
428
+ rtn._listData.splice(strat, count,updateData[0]);
429
+ }
430
+ else if(updateData.length===2){
431
+ rtn._listData.splice(strat, count,updateData[0],updateData[1]);
432
+ }
433
+ else if(updateData.length===3){
434
+ rtn._listData.splice(strat, count,updateData[0],updateData[1],updateData[2]);
435
+ }
436
+ else if(updateData.length===4){
437
+ rtn._listData.splice(strat, count,updateData[0],updateData[1],updateData[2],updateData[3]);
438
+ }
439
+ else if(updateData.length===5){
440
+ rtn._listData.splice(strat, count,updateData[0],updateData[1],updateData[2],updateData[3],updateData[4]);
441
+ }
442
+ else if(updateData.length===6){
443
+ rtn._listData.splice(strat, count,updateData[0],updateData[1],updateData[2],updateData[3],updateData[4],updateData[5]);
444
+ }
445
+ rtn.setHiddenRow();
446
+ },
437
447
  get scripts() {
438
448
  if (rtn._scripts !== null) {
439
449
  return rtn._scripts;
@@ -471,7 +481,11 @@ const ContactList = function (source,para ,callBack) {
471
481
  let lastKey='';
472
482
  let count=1;
473
483
  let firstIndex=0;
484
+ rtn.rowHiddenKeyData=[];
474
485
  for (let i = 0; i < rtn.listData.length; i++) {
486
+ if(!rtn.rowHiddenKeyData.includes(rtn.listData[i][rtn.rowHiddenKey])){
487
+ rtn.rowHiddenKeyData.push(rtn.listData[i][rtn.rowHiddenKey])
488
+ }
475
489
  rtn.listData[i].$rowspan=0;
476
490
  if(lastKey){
477
491
  if(rtn.listData[i][rtn.rowHiddenKey]){