centaline-data-driven 1.3.25 → 1.3.28

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.
@@ -180,13 +180,10 @@ const FormList = function (source, master) {
180
180
  for (let i = 1; i < rows.length; i++) {//遍历每一行
181
181
  if (!rows[i].deleted) {
182
182
  row = {};
183
- //row['$sourceIndex'] = i;
184
183
  Vue.set(row, '$sourceIndex', i);
185
184
  for (let j = 0; j < rows[i].field.length; j++) {//遍历每一列
186
- //row[field[j].id] = rows[i].field[j];
187
185
  Vue.set(row, field[j].id, rows[i].field[j]);
188
186
  }
189
- //row.isSet = false;
190
187
  Vue.set(row, 'isSet', false);
191
188
  Vue.set(row, 'edit', rows[i].edit);
192
189
  Vue.set(row, 'delete', rows[i].delete);
@@ -372,8 +369,6 @@ const FormList = function (source, master) {
372
369
  addSourceRow(row) {
373
370
  let sourceRow = JSON.parse(JSON.stringify(source.rows[0]));
374
371
  for (let k in sourceRow.columns) {
375
- //sourceRow.Row[k] = row.field[k].source;
376
- sourceRow.columns[k] = row[sourceRow.columns[k].fieldName1].source;
377
372
  sourceRow.columns[k] = row[sourceRow.columns[k].fieldName1].source;
378
373
  };
379
374
  source.rows.push(sourceRow);
@@ -425,9 +420,7 @@ const FormList = function (source, master) {
425
420
  source.rows.push(row);
426
421
  rtn.rows.push(rowItem);
427
422
  rtn._rows[rtn._rows.length - 1].$sourceIndex = rtn._rows.length - 1;
428
-
429
- rowData.$sourceIndex = source.rows.length - 1;
430
-
423
+ rowData.$sourceIndex = source.rows.length - 1;
431
424
  rowData.edit = rowItem.edit;
432
425
  rowData.delete = rowItem.delete;
433
426
  rowItem.isNewFlag = true;
@@ -473,13 +466,14 @@ const FormList = function (source, master) {
473
466
  insertRow(rows) {
474
467
  if(rows && rows.length>0){
475
468
  rows.forEach((r) => {
476
- source.rows.push(r);
477
- let iRow = this.initRow(r);
469
+ let iRow = rtn.initRow(r);
478
470
  iRow.isNewFlag = true;
471
+ source.rows.push(r);
479
472
  rtn._rows.push(iRow);
480
473
  Vue.set(r, 'edit', iRow.edit);
481
474
  Vue.set(r, 'delete', iRow.delete);
482
475
  rtn._rows[rtn._rows.length - 1].$sourceIndex = rtn._rows.length - 1;
476
+ r.$sourceIndex = rtn._rows.length - 1;
483
477
 
484
478
  let rowData = rtn.rowsItemToTableData(iRow)
485
479
  rowData.$sourceIndex = rtn._rows.length - 1;
@@ -492,43 +486,52 @@ const FormList = function (source, master) {
492
486
  insertOrUpdateRow(row) {
493
487
  if(row){
494
488
  if(rtn.primaryKeys && rtn.primaryKeys.length>0){
495
- let iRow = this.initRow(row);
489
+ let iRow = rtn.initRow(row);
496
490
  let flagAdd=true;
497
491
  rtn.rows.forEach((r,i) => {
498
- let countKey=0;
499
- rtn.primaryKeys.forEach((k) => {
500
- let fieldOld=r.field.find((v) => {
501
- return v.id === k;
502
- });
503
- let fieldNew=iRow.field.find((v) => {
504
- return v.id === k;
505
- });
506
- if(fieldOld.code1===fieldNew.code1){
507
- countKey++;
508
- }
509
- })
510
- if(countKey===rtn.primaryKeys.length){
511
- flagAdd=false;
512
- if(iRow.deleted){
513
- rtn.tableData.forEach((d,index) => {
514
- if(d.$sourceIndex===r.$sourceIndex){
515
- rtn.tableData.splice(index, 1);
492
+ if(i>0){
493
+ let countKey=0;
494
+ rtn.primaryKeys.forEach((k) => {
495
+ let fieldOld=r.field.find((v) => {
496
+ return v.id === k;
497
+ });
498
+ let fieldNew=iRow.field.find((v) => {
499
+ return v.id === k;
500
+ });
501
+ if(fieldOld.code1===fieldNew.code1){
502
+ countKey++;
503
+ }
504
+ })
505
+ if(countKey===rtn.primaryKeys.length){
506
+ flagAdd=false;
507
+ if(iRow.deleted){
508
+ rtn.tableData.forEach((d,index) => {
509
+ if(d.$sourceIndex===r.$sourceIndex){
510
+ rtn.tableData.splice(index, 1);
511
+ }
512
+ });
513
+ if (r.isNewFlag) {
514
+ rtn.rows.splice(i, 1);
515
+ source.rows.splice(i, 1);
516
+ }
517
+ else {
518
+ rtn.rows[i].deleted = true;
516
519
  }
517
- });
518
- if (r.isNewFlag) {
519
- rtn.rows.splice(i, 1);
520
- source.rows.splice(i, 1);
521
520
  }
522
- else {
523
- rtn.rows[i].deleted = true;
521
+ else{
522
+ let rowData = rtn.rowsItemToTableData(iRow)
523
+ iRow.$sourceIndex=r.$sourceIndex;
524
+ rowData.$sourceIndex=r.$sourceIndex;
525
+ rowData.edit = iRow.edit;
526
+ rowData.delete = iRow.delete;
527
+ source.rows.splice(i, 1,row);
528
+ rtn._rows.splice(i, 1,iRow);
529
+ rtn._tableData.splice(i-1, 1,rowData);
524
530
  }
525
531
  }
526
- else{
527
- rtn.rows.splice(i, 1,iRow);
528
- }
529
532
  }
530
533
  });
531
- if(flagAdd){
534
+ if(flagAdd){
532
535
  let rows=[];
533
536
  rows.push(row);
534
537
  rtn.insertRow(rows)
@@ -14,11 +14,10 @@ const QuickInput = function (source, moreActionRouter) {
14
14
  return source.name1;
15
15
  },
16
16
  set text(v) {
17
- if(source.displayName1)
18
- {
17
+ if(source.displayName1){
19
18
  source.displayName1 = v;
20
- }else
21
- {
19
+ }
20
+ else{
22
21
  source.name1 = v;
23
22
  }
24
23
  },
@@ -267,7 +267,8 @@ const Router = function (source) {
267
267
  }).catch((ex) => {
268
268
  callback(ex); //里面需要有data.rtnCode === 200的处理
269
269
  });
270
- } else {
270
+ }
271
+ else {
271
272
  callback({
272
273
  rtnCode: Enum.ReturnCode.Successful
273
274
  });
@@ -347,6 +348,9 @@ const Router = function (source) {
347
348
  get buttonHeight() {
348
349
  return source.buttonHeight || 24;
349
350
  },
351
+ get align() {
352
+ return source.align;
353
+ },
350
354
  };
351
355
  return rtn;
352
356
  }
@@ -400,10 +400,16 @@ const Enum = {
400
400
  /// 在浏览器中打开一个 relationField 执行的URL
401
401
  /// </summary>
402
402
  OpenUrlInBrowse: 22,
403
+
403
404
  /// <summary>
404
405
  /// 浏览附件
405
406
  /// </summary>
406
- BrowseAttachment: 23
407
+ BrowseAttachment: 23,
408
+
409
+ /// <summary>
410
+ /// 更新表格的列
411
+ /// </summary>
412
+ UpdateColumns: 24,
407
413
  },
408
414
 
409
415
  /// <summary>
@@ -118,7 +118,6 @@ const LibFunction = {
118
118
  // item.is = 'ct-iti';
119
119
  // break;
120
120
  case Enum.ControlType.NumericRange://数字区间
121
-
122
121
  item = Iti(field);
123
122
  item.is = 'ct-iti';
124
123
  break;
@@ -8,19 +8,14 @@
8
8
  -->
9
9
  <template>
10
10
  <div class="ct-quickInput">
11
- <el-popover ref="pop" placement="bottom-start" v-model="showDrop" trigger="click" @show="searchInputHandle"
12
- class="more-dropdown">
11
+ <el-popover ref="pop" placement="bottom-start" v-model="showDrop" trigger="click" @show="searchInputHandle" class="more-dropdown">
13
12
  <div>
14
13
  <div>
15
- <el-input ref="searchInput" size="mini" suffix-icon="el-icon-search" v-model="searchText"
16
- @input="searchInputHandle"></el-input>
14
+ <el-input ref="searchInput" size="mini" suffix-icon="el-icon-search" v-model="searchText" @input="searchInputHandle"></el-input>
17
15
  </div>
18
- <ctSelectOptionVertical :model="model" @click="selectOption($event)"></ctSelectOptionVertical>
16
+ <ctSelectOptionVertical :model="model" @click="selectOption"></ctSelectOptionVertical>
19
17
  </div>
20
18
  <i slot="reference" class="el-icon-arrow-down"></i>
21
- <!-- <span slot="reference" style="font-family: Comic Sans MS; font-size: 14px"
22
- ><div class="my-icon-more"></div
23
- ></span> -->
24
19
  </el-popover>
25
20
  </div>
26
21
  </template>
@@ -34,6 +29,10 @@ export default {
34
29
  props: {
35
30
  pn: String,
36
31
  action: String,
32
+ flagNew:{
33
+ type: Boolean,
34
+ default: false
35
+ }
37
36
  },
38
37
  components: {
39
38
  ctSelectOption: selectOption,
@@ -47,7 +46,8 @@ export default {
47
46
  name1: "",
48
47
  paramName1: that.pn,
49
48
  });
50
- } else {
49
+ }
50
+ else {
51
51
  this.model = this.vmodel;
52
52
  }
53
53
  },
@@ -64,6 +64,9 @@ export default {
64
64
  this.model.getOptions(this.action, self.searchText);
65
65
  },
66
66
  searchInputHandle: function () {
67
+ if(this.flagNew){
68
+ this.model.value='';
69
+ }
67
70
  var currentSeatch = this.searchText;
68
71
  this.searchTickControl(currentSeatch);
69
72
  },
@@ -75,15 +78,16 @@ export default {
75
78
  }
76
79
  }, self.model.searchTick);
77
80
  },
78
- selectOption(value) {
81
+ selectOption(value,label) {
79
82
  if (this.model.value === value) {
80
83
  this.$set(this, "showDrop", false);
81
84
  return;
82
- } else {
85
+ }
86
+ else {
83
87
  this.model.value = value;
84
88
  }
85
89
  this.$set(this, "showDrop", false);
86
- this.$emit("click", value);
90
+ this.$emit("click", value,label);
87
91
  },
88
92
  },
89
93
  mounted() { },
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div class="ct-selectOptionVertical" style="">
3
3
  <ul>
4
- <li v-for="(op, index) in model.options" :key="index" :class="[getOptionSelect(op[model.optionAttrs.value])?'select':'']" @click="selectOption(op[model.optionAttrs.value])">
4
+ <li v-for="(op, index) in model.options" :key="index" :class="[getOptionSelect(op[model.optionAttrs.value])?'select':'']"
5
+ @click="selectOption(op[model.optionAttrs.value],op[model.optionAttrs.label])">
5
6
  <div v-html="op[model.optionAttrs.displayLabel]||op[model.optionAttrs.label]"></div>
6
7
  </li>
7
8
  </ul>
@@ -42,8 +43,8 @@
42
43
  }
43
44
  }
44
45
  },
45
- selectOption(value) {
46
- this.$emit('click', value);
46
+ selectOption(value,label) {
47
+ this.$emit('click', value,label);
47
48
  }
48
49
  }
49
50
  }
@@ -134,6 +134,14 @@ const actions = {
134
134
  return true;
135
135
  }
136
136
  },
137
+ validateLen(model) {
138
+ if (model.value && model.value.length>model.max) {
139
+ return false;
140
+ }
141
+ else {
142
+ return true;
143
+ }
144
+ },
137
145
  };
138
146
 
139
147
  const valid = {
@@ -195,6 +203,11 @@ const valid = {
195
203
  message: '请输入正确的联系电话',
196
204
  ticker: 'change'
197
205
  },
206
+ validateLen: {
207
+ action: actions.validateLen,
208
+ message: '输入文字不能超过最大长度',
209
+ ticker: 'input'
210
+ },
198
211
  Init(model) {
199
212
  return {
200
213
  //废弃 todo 删除
@@ -261,6 +274,12 @@ const valid = {
261
274
  case 'p':
262
275
  rtnValidate.push(valid.phone);
263
276
  break;
277
+ case Enum.ControlType.TextBox:
278
+ case Enum.ControlType.MultiLineText:
279
+ if(model.max){
280
+ rtnValidate.push(valid.validateLen);
281
+ }
282
+ break;
264
283
  default:
265
284
  break;
266
285
  }
package/src/main.js CHANGED
@@ -14,9 +14,9 @@ Vue.config.productionTip = false;
14
14
  Vue.use(centaline, {
15
15
  baseUrl: "http://10.88.22.46:7070/v1/form/router",
16
16
  // baseUrl: "http://10.88.23.22:9999/v1/form/router",
17
- // baseUrl: "http://10.88.22.69:8080/",
17
+ baseUrl: "http://10.88.22.69:8080/",
18
18
  // baseUrl: "http://tjcptest.centaline.com.cn/",
19
- // flagRouterSelf: true,
19
+ flagRouterSelf: true,
20
20
  zindex: 999,
21
21
  showRequestSuccessMessage: true,
22
22
  showRequestErrorMessage: true,
@@ -41,7 +41,7 @@ Vue.use(centaline, {
41
41
  // 获取请求头
42
42
  getRequestHeaders: function () {
43
43
  return {
44
- oldToken: 'a9e42494-1e0b-4c46-834e-eea096ba2564',
44
+ oldToken: 'e8f14c4d-5197-427e-9ef5-db1fdac7ae31',
45
45
  originalRequestURL: 'http://10.88.22.67:8080',
46
46
  EstateInfo: ' {"estateId":"201703020943128D8A8FCF463E4016D6","estateName":"%E4%B8%87%E7%A7%91%E4%BA%91%E5%9F%8E"}',
47
47
  Authorization:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjYzMzZiMDJiLTZjOGEtNDIzNC05MGQ5LTliYWI2MTIyNTQzNyJ9.hOxMvGLm03QMPu9C4lgRzkEHC7ECqxJ_L6mfqQRqv39xJ42I8gzSRO-E68vWp-A99ewnxnqvTZ6H_6fOQ9DljQ',