centaline-data-driven 1.2.78 → 1.2.81

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.
Files changed (32) hide show
  1. package/build/centaline/centaline.path.js +0 -2
  2. package/package.json +1 -1
  3. package/src/Form.vue +5 -4
  4. package/src/SearchList.vue +9 -3
  5. package/src/centaline/css/max.css +4 -1
  6. package/src/centaline/dynamicContact/src/dynamicContact.vue +5 -1
  7. package/src/centaline/dynamicDetail/src/dynamicContactList.vue +6 -1
  8. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +5 -1
  9. package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +5 -1
  10. package/src/centaline/dynamicForm/index.js +0 -4
  11. package/src/centaline/dynamicForm/src/dynamicForm.vue +12 -3
  12. package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +7 -0
  13. package/src/centaline/dynamicLayout/src/dynamicLayout.vue +16 -270
  14. package/src/centaline/dynamicLayout/src/dynamicLayoutChildren.vue +6 -12
  15. package/src/centaline/dynamicLayout/src/dynamicLayoutImage.vue +55 -6
  16. package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +11 -7
  17. package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +3 -1
  18. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +206 -6
  19. package/src/centaline/loader/src/ctl/CellLayout.js +234 -115
  20. package/src/centaline/loader/src/ctl/Form.js +11 -4
  21. package/src/centaline/loader/src/ctl/FormList.js +81 -13
  22. package/src/centaline/loader/src/ctl/RichText.js +3 -0
  23. package/src/centaline/loader/src/ctl/SearchScreen.js +22 -22
  24. package/src/centaline/loader/src/ctl/SearchTable.js +215 -8
  25. package/src/centaline/loader/src/ctl/lib/LibFunction.js +6 -3
  26. package/src/main.js +6 -3
  27. package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
  28. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
  29. package/src/centaline/dynamicLabel/index.js +0 -11
  30. package/src/centaline/dynamicLabel/src/dynamicLabel.vue +0 -73
  31. package/src/centaline/dynamicLs/index.js +0 -22
  32. package/src/centaline/dynamicLs/src/dynamicLs.vue +0 -233
@@ -1,135 +1,254 @@
1
1
  import Vue from 'vue';
2
2
  import Enum from './lib/Enum';
3
3
  import common from '../../../common';
4
- const CellLayout = function (source, callBack, apiParam, failCallBack) {
5
- var init = function (source) {
6
- var rtn = source;
7
- var _styleObject = {};
8
- if (typeof source.fontWeight !== 'undefined') {
9
- _styleObject.fontWeight = source.fontWeight;
10
- }
11
- if (typeof source.fontSize !== 'undefined') {
12
- _styleObject.fontSize = source.fontSize + "px";
13
- }
14
- if (typeof source.textColor !== 'undefined') {
15
- _styleObject.color = source.textColor;
16
- }
17
- if (typeof source.textColor !== 'undefined') {
18
- _styleObject.color = source.textColor;
19
- }
20
- if (typeof source.margin !== 'undefined') {
21
- _styleObject.margin = source.margin.replace(/\s+/g, "px ") + 'px';
22
- }
23
- if (typeof source.marginTop !== 'undefined') {
24
- _styleObject.marginTop = source.marginTop + "px";
25
- }
26
- if (typeof source.marginLeft !== 'undefined') {
27
- _styleObject.marginLeft = source.marginLeft + "px";
28
- }
29
- if (typeof source.marginRight !== 'undefined') {
30
- _styleObject.marginRight = source.marginRight + "px";
31
- }
32
- if (typeof source.marginBottom !== 'undefined') {
33
- _styleObject.marginBottom = source.marginBottom + "px";
34
- }
35
- if (typeof source.padding !== 'undefined') {
36
- _styleObject.padding = source.padding.replace(/\s+/g, "px ") + 'px';
37
- }
38
- if (typeof source.paddingTop !== 'undefined') {
39
- _styleObject.paddingTop = source.paddingTop + "px";
40
- }
41
- if (typeof source.paddingLeft !== 'undefined') {
42
- _styleObject.paddingLeft = source.paddingLeft + "px";
43
- }
44
- if (typeof source.paddingRight !== 'undefined') {
45
- _styleObject.paddingRight = source.paddingRight + "px";
46
- }
47
- if (typeof source.paddingBottom !== 'undefined') {
48
- _styleObject.paddingBottom = source.paddingBottom + "px";
49
- }
50
- if (typeof source.width !== 'undefined') {
51
- if (source.width == "0") {
52
- _styleObject.width = "100%";
53
- }
54
- else if (source.width == "-1") {
55
-
4
+ const CellLayout = function (source) {
5
+ var rtn = {
6
+ get fields() {
7
+ return source.fields;
8
+ },
9
+ get is() {
10
+ return source.is;
11
+ },
12
+ get value() {
13
+ if (source.scale) {
14
+ var reg = /\d+(\.\d+)?/;
15
+ if (reg.test(source.value)) {
16
+ return parseFloat(source.value).toFixed(source.scale); ;
17
+ }
18
+ return source.value;
56
19
  }
57
- else {
58
- _styleObject.width = source.width + "px";
59
- _styleObject.flex = "0 0 "+source.width + "px";
20
+ return source.value;
21
+ },
22
+ get routerKey() {
23
+ return source.routerKey;
24
+ },
25
+ get orientation() {
26
+ return source.orientation;
27
+ },
28
+ get placeholder() {
29
+ return source.placeholder;
30
+ },
31
+ get errorPlaceholder() {
32
+ return source.errorPlaceholder;
33
+ },
34
+ get errorPlaceholder() {
35
+ return source.errorPlaceholder;
36
+ },
37
+ get forname() {
38
+ return source.for;
39
+ },
40
+ get forrowindex() {
41
+ return source.forrowindex;
42
+ },
43
+ get rightRouter() {
44
+ return source.rightRouter;
45
+ },
46
+ _styleObject: {},
47
+ get styleObject() {
48
+ var self = this;
49
+ if (typeof source.fontWeight !== 'undefined') {
50
+ self._styleObject.fontWeight = source.fontWeight;
60
51
  }
61
- }
62
- if (typeof source.height !== 'undefined') {
63
- if (source.height == "0") {
64
- _styleObject.height = "100%";
52
+ if (typeof source.fontSize !== 'undefined') {
53
+ self._styleObject.fontSize = source.fontSize + "px";
65
54
  }
66
- else if (source.height == "-1") {
55
+ if (typeof source.textColor !== 'undefined') {
56
+ self._styleObject.color = source.textColor;
67
57
  }
68
- else {
69
- _styleObject.height = source.height + "px";
70
- }
71
- }
72
- if (typeof source.background !== 'undefined') {
73
- _styleObject.background = source.background;
74
- }
75
- if (typeof source.textAlign !== 'undefined') {
76
- _styleObject.textAlign = source.textAlign;
77
- }
78
- if (typeof source.textDecoration !== 'undefined') {
79
- if (source.textDecoration == "overline") {
80
- _styleObject.textDecoration = "line-through";
58
+ if (typeof source.textColor !== 'undefined') {
59
+ self._styleObject.color = source.textColor;
81
60
  }
82
- else {
83
- _styleObject.textDecoration = source.textDecoration;
84
- }
85
- }
86
- if (typeof source.borderRadius !== 'undefined') {
87
- _styleObject.borderRadius = source.borderRadius + "px";
88
- }
89
- if (typeof source.borderWidth !== 'undefined') {
90
- _styleObject.borderWidth = source.borderWidth + "px";
91
- }
92
- if (typeof source.borderColor !== 'undefined') {
93
- _styleObject.borderColor = source.borderColor;
94
- }
95
- if (typeof source.valign !== 'undefined') {
96
- _styleObject.justifyContent = source.valign;
97
- }
98
- if (typeof source.align !== 'undefined') {
99
- if (source.valign == "bottom") {
100
- _styleObject.alignItems = "end"
61
+ if (typeof source.margin !== 'undefined') {
62
+ self._styleObject.margin = source.margin.replace(/\s+/g, "px ") + 'px';
101
63
  }
102
- else {
103
- _styleObject.alignItems = source.align;
64
+ if (typeof source.marginTop !== 'undefined') {
65
+ self._styleObject.marginTop = source.marginTop + "px";
66
+ }
67
+ if (typeof source.marginLeft !== 'undefined') {
68
+ self._styleObject.marginLeft = source.marginLeft + "px";
69
+ }
70
+ if (typeof source.marginRight !== 'undefined') {
71
+ self._styleObject.marginRight = source.marginRight + "px";
104
72
  }
73
+ if (typeof source.marginBottom !== 'undefined') {
74
+ self._styleObject.marginBottom = source.marginBottom + "px";
75
+ }
76
+ if (typeof source.padding !== 'undefined') {
77
+ self._styleObject.padding = source.padding.replace(/\s+/g, "px ") + 'px';
78
+ }
79
+ if (typeof source.paddingTop !== 'undefined') {
80
+ self._styleObject.paddingTop = source.paddingTop + "px";
81
+ }
82
+ if (typeof source.paddingLeft !== 'undefined') {
83
+ self._styleObject.paddingLeft = source.paddingLeft + "px";
84
+ }
85
+ if (typeof source.paddingRight !== 'undefined') {
86
+ self._styleObject.paddingRight = source.paddingRight + "px";
87
+ }
88
+ if (typeof source.paddingBottom !== 'undefined') {
89
+ self._styleObject.paddingBottom = source.paddingBottom + "px";
90
+ }
91
+ if (typeof source.width !== 'undefined') {
92
+ if (source.width == "0") {
93
+ self._styleObject.width = "100%";
94
+ }
95
+ else if (source.width == "-1") {
96
+ }
97
+ else {
98
+ self._styleObject.width = source.width + "px";
99
+ self._styleObject.flex = "0 0 " + source.width + "px";
100
+ }
101
+ }
102
+ if (typeof source.height !== 'undefined') {
103
+ if (source.height == "0") {
104
+ self._styleObject.height = "100%";
105
+ }
106
+ else if (source.height == "-1") {
107
+
108
+ }
109
+ else {
110
+ self._styleObject.height = source.height + "px";
111
+ }
112
+ }
113
+ if (typeof source.background !== 'undefined') {
114
+ self._styleObject.background = source.background;
115
+ }
116
+ if (typeof source.textAlign !== 'undefined') {
117
+ self._styleObject.textAlign = source.textAlign;
118
+ }
119
+ if (typeof source.textDecoration !== 'undefined') {
120
+ if (source.textDecoration == "overline") {
121
+ self._styleObject.textDecoration = "line-through";
122
+ }
123
+ else {
124
+ self._styleObject.textDecoration = source.textDecoration;
125
+ }
126
+ }
127
+ if (typeof source.borderRadius !== 'undefined') {
128
+ if (source.borderRadius.trim().indexOf(" ") != -1) {
129
+ self._styleObject.borderRadius = source.borderRadius.replace(/\s+/g, "px ") + 'px';
130
+ }
131
+ else {
132
+ self._styleObject.borderRadius = source.borderRadius + "px";
133
+ }
105
134
 
106
- }
107
- rtn.styleObject = _styleObject;
108
- return rtn;
109
- }
110
- if (typeof source === 'string') {
111
- apiParam = apiParam ? apiParam : {};
112
- Vue.prototype.$api.postHandler(common.globalUri(), { "action": source, "para": apiParam }).then(
113
- function (response) {
114
- if (response.rtnCode === Enum.ReturnCode.Successful) {
115
- var data = response.content;
116
- var rtn = init(data);
117
- if (callBack) {
118
- callBack(rtn);
135
+ }
136
+ if (typeof source.borderWidth !== 'undefined' && typeof source.borderColor !== 'undefined') {
137
+ self._styleObject.border = source.borderWidth + "px" + " solid " + source.borderColor;
138
+ }
139
+
140
+ if (typeof source.valign !== 'undefined') {
141
+ self._styleObject.justifyContent = source.valign;
142
+ }
143
+ if (typeof source.align !== 'undefined') {
144
+ if (source.align == "bottom") {
145
+ self._styleObject.alignItems = "end"
146
+ }
147
+ else {
148
+ self._styleObject.alignItems = source.align;
149
+ }
150
+
151
+ }
152
+ if (typeof source.shadowWidth !== 'undefined' && typeof source.shadowColor !== 'shadowColor') {
153
+ if (source.shadowWidth.trim().indexOf(" ") != -1) {
154
+ self._styleObject.boxShadow = source.shadowWidth.replace(/\s+/g, "px ") + 'px ' + source.shadowColor;
155
+ }
156
+ else {
157
+ self._styleObject.boxShadow = source.shadowWidth + 'px ' + source.shadowWidth + 'px ' + source.shadowColor;
158
+ }
159
+ }
160
+ if (typeof source.gradientColor !== 'undefined') {
161
+ if (typeof source.gradientDirection !== 'undefined') {
162
+ if (source.gradientDirection == 'vertical') {
163
+ self._styleObject.backgroundImage = 'linear-gradient(to right,' + source.gradientColor.replace(/-/g, ",") + ')';
164
+ }
165
+ else {
166
+ self._styleObject.backgroundImage = 'linear-gradient(' + source.gradientColor.replace(/-/g, ",") + ')';
119
167
  }
168
+
120
169
  }
121
170
  else {
122
- if (failCallBack) {
123
- failCallBack();
171
+ self._styleObject.backgroundImage = 'linear-gradient(' + source.gradientColor.replace(/-/g, ",") + ')';
172
+ }
173
+ }
174
+ if (typeof source.visibility !== 'undefined') {
175
+ self._styleObject.visibility = source.visibility;
176
+ }
177
+ if (typeof source.weight !== 'undefined') {
178
+ self._styleObject.flex = source.weight;
179
+ }
180
+ if (typeof source.maxLines !== 'undefined') {
181
+ self._styleObject.WebkitLineClamp = source.maxLines;
182
+ self._styleObject.WebkitBoxOrient = "vertical";
183
+ self._styleObject.display = "-webkit-box";
184
+ self._styleObject.overflow = "hidden";
185
+ }
186
+ return self._styleObject;
187
+ },
188
+ getCurrentRowApiData(rtnData, router) {
189
+ var self = this;
190
+ var searchFields = router.getSearchPara();
191
+ var searchValue1 = router.flagAddRowAfterAction ? rtnData.content : rtn.listData[rtn.selectIndex][self.primaryKey];
192
+ if (self.primaryKey) {
193
+ searchFields.fields.push({
194
+ fieldName1: self.primaryFieldMappingDBName ? self.primaryFieldMappingDBName : self.primaryKey,
195
+ groupName: self.primaryKey,
196
+ operation: Enum.SearchOperation.等于,
197
+ searchDataType: Enum.SearchDataType.Text,
198
+ searchValue1: searchValue1,
199
+ });
200
+ }
201
+ Vue.prototype.$api.postHandler(common.globalUri(), {
202
+ action: rtn.apiRouter.action,
203
+ para: {
204
+ searchFields: searchFields,
205
+ pageAttribute: { pageIndex: 1 },
206
+ flagSearch: true
207
+ }
208
+ })
209
+ .then(function (response) {
210
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
211
+ if (response.content.rows.length > 0) {
212
+ if (router.flagAddRowAfterAction) {
213
+ rtn.doNew(response.content.rows);
214
+ }
215
+ else {
216
+ rtn.doUpdate(response.content.rows, searchValue1);
217
+ }
218
+ }
124
219
  }
220
+ })
221
+ .catch((error) => {
222
+ });
223
+ },
224
+ doAction(response, field) {
225
+ if (response.responseData) {
226
+ response = response.responseData;
227
+ }
228
+ if (field.flagFreshCurrentRow || field.flagAddRowAfterAction) {
229
+ rtn.getCurrentRowApiData(response, field);
230
+ }
231
+ else {
232
+ switch (response.notification) {
233
+ case Enum.ActionType.Delete://删除
234
+ case Enum.ActionType.CloseTabThenDelete://删除
235
+
236
+ break;
237
+ case Enum.ActionType.New://新增
238
+ case Enum.ActionType.CloseTabThenNew://新增
239
+
240
+ break;
241
+ case Enum.ActionType.Update://修改
242
+ case Enum.ActionType.CloseTabThenUpdate://修改
243
+
244
+ break;
245
+ default:
246
+ break;
125
247
  }
126
248
  }
127
- );
128
- }
129
- else {
130
- var data = source;
131
- return init(data);
132
- }
249
+ },
250
+ };
251
+ return rtn;
133
252
  };
134
253
 
135
254
  export default CellLayout;
@@ -392,10 +392,17 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
392
392
  },
393
393
  //新增或替换表格数据
394
394
  insertOrUpdateRow(tableId,row) {
395
- let listData = this.excuteListData.find((v) => {
396
- return v.id === tableId;
397
- });
398
- listData.insertOrUpdateRow(row);
395
+ let listData = this.excuteListData.find((v) => {
396
+ return v.id === tableId;
397
+ });
398
+ listData.insertOrUpdateRow(row);
399
+ },
400
+ //删除表格数据
401
+ deleteRow(tableId,row) {
402
+ let listData = this.excuteListData.find((v) => {
403
+ return v.id === tableId;
404
+ });
405
+ listData.delRow(row);
399
406
  },
400
407
  //清空表格数据
401
408
  clear(tableId) {
@@ -465,19 +465,87 @@ const FormList = function (source, master) {
465
465
  },
466
466
  insertOrUpdateRow(row) {
467
467
  if(row){
468
- source.rows.push(r);
469
- let iRow = this.initRow(r);
470
- iRow.isNewFlag = true;
471
- rtn._rows.push(iRow);
472
- Vue.set(r, 'edit', iRow.edit);
473
- Vue.set(r, 'delete', iRow.delete);
474
- r.$sourceIndex = rtn._rows.length - 1;
475
-
476
- let rowData = rtn.rowsItemToTableData(iRow)
477
- rowData.$sourceIndex = rtn._rows.length - 1;
478
- rowData.edit = iRow.edit;
479
- rowData.delete = iRow.delete;
480
- rtn._tableData.push(rowData);
468
+ if(rtn.primaryKeys && rtn.primaryKeys.length>0){
469
+ let iRow = this.initRow(row);
470
+ let flagAdd=true;
471
+ rtn.rows.forEach((r,i) => {
472
+ let countKey=0;
473
+ rtn.primaryKeys.forEach((k) => {
474
+ let fieldOld=r.field.find((v) => {
475
+ return v.id === k;
476
+ });
477
+ let fieldNew=iRow.field.find((v) => {
478
+ return v.id === k;
479
+ });
480
+ if(fieldOld.code1===fieldNew.code1){
481
+ countKey++;
482
+ }
483
+ })
484
+ if(countKey===rtn.primaryKeys.length){
485
+ flagAdd=false;
486
+ if(iRow.deleted){
487
+ rtn.tableData.forEach((d,index) => {
488
+ if(d.$sourceIndex===r.$sourceIndex){
489
+ rtn.tableData.splice(index, 1);
490
+ }
491
+ });
492
+ if (r.isNewFlag) {
493
+ rtn.rows.splice(i, 1);
494
+ source.rows.splice(i, 1);
495
+ }
496
+ else {
497
+ rtn.rows[i].deleted = true;
498
+ }
499
+ }
500
+ else{
501
+ rtn.rows.splice(i, 1,iRow);
502
+ }
503
+ }
504
+ });
505
+ if(flagAdd){
506
+ let rows=[];
507
+ rows.push(row);
508
+ rtn.insertRow(rows)
509
+ }
510
+ }
511
+ else{
512
+ let rows=[];
513
+ rows.push(row);
514
+ rtn.insertRow(rows)
515
+ }
516
+ }
517
+ },
518
+ delRow(row) {
519
+ if(row && rtn.primaryKeys && rtn.primaryKeys.length>0){
520
+ let iRow = this.initRow(row);
521
+ rtn.rows.forEach((r,i) => {
522
+ let countKey=0;
523
+ rtn.primaryKeys.forEach((k) => {
524
+ let fieldOld=r.field.find((v) => {
525
+ return v.id === k;
526
+ });
527
+ let fieldNew=iRow.field.find((v) => {
528
+ return v.id === k;
529
+ });
530
+ if(fieldOld.code1===fieldNew.code1){
531
+ countKey++;
532
+ }
533
+ })
534
+ if(countKey===rtn.primaryKeys.length){
535
+ rtn.tableData.forEach((d,index) => {
536
+ if(d.$sourceIndex===r.$sourceIndex){
537
+ rtn.tableData.splice(index, 1);
538
+ }
539
+ });
540
+ if (r.isNewFlag) {
541
+ rtn.rows.splice(i, 1);
542
+ source.rows.splice(i, 1);
543
+ }
544
+ else {
545
+ rtn.rows[i].deleted = true;
546
+ }
547
+ }
548
+ });
481
549
  }
482
550
  },
483
551
  };
@@ -16,6 +16,9 @@ const RichText = function (source, router) {
16
16
  get action() {
17
17
  return router &&router.action ? router.action : "";//上传完整地址
18
18
  },
19
+ set action(v) {
20
+ source.action = v;
21
+ },
19
22
  };
20
23
  rtn = base.copy(Base(source), rtn);
21
24
  rtn = base.copy(rtn, valid.Init(rtn));
@@ -204,28 +204,28 @@ const SearchScreen = function (source, callBack, screenPara) {
204
204
  }
205
205
  return result;
206
206
  },
207
- // 1 是字符串 2是数字
208
- getDataType(searchDataType)
209
- {
210
- let dataType=1;
211
- switch(searchDataType)
212
- {
213
- case 2:
214
- case 6:
215
- dataType=2;
216
- break;
217
- case 1:
218
- case 3:
219
- case 4:
220
- case 5:
221
- dataType=1;
222
- break;
223
- default:
224
- dataType=1;
225
- break;
226
- }
227
- return dataType;
228
- },
207
+ // 1 是字符串 2是数字
208
+ getDataType(searchDataType)
209
+ {
210
+ let dataType=1;
211
+ switch(searchDataType)
212
+ {
213
+ case 2:
214
+ case 6:
215
+ dataType=2;
216
+ break;
217
+ case 1:
218
+ case 3:
219
+ case 4:
220
+ case 5:
221
+ dataType=1;
222
+ break;
223
+ default:
224
+ dataType=1;
225
+ break;
226
+ }
227
+ return dataType;
228
+ },
229
229
  initScreen(screens) {
230
230
  var rtnscreens = [];
231
231