centaline-data-driven 1.3.18 → 1.3.21

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 (31) hide show
  1. package/package.json +1 -1
  2. package/src/Detail.vue +1 -1
  3. package/src/Form.vue +2 -2
  4. package/src/SearchList.vue +4 -2
  5. package/src/centaline/common/index.js +123 -92
  6. package/src/centaline/css/common.css +15 -2
  7. package/src/centaline/dynamicBtn/src/dynamicBtn.vue +8 -0
  8. package/src/centaline/dynamicDetail/src/dynamicContactList.vue +4 -0
  9. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +17 -4
  10. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +83 -149
  11. package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +13 -8
  12. package/src/centaline/dynamicForm/src/dynamicForm.vue +19 -14
  13. package/src/centaline/dynamicLayout/src/dynamicLayout.vue +5 -2
  14. package/src/centaline/dynamicLayout/src/dynamicLayoutChildren.vue +9 -3
  15. package/src/centaline/dynamicLayout/src/dynamicLayoutChildrenFor.vue +7 -2
  16. package/src/centaline/dynamicLayout/src/dynamicLayoutImage.vue +13 -2
  17. package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +7 -2
  18. package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +4 -1
  19. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +6 -2
  20. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +1340 -1153
  21. package/src/centaline/loader/src/ctl/CellLayout.js +13 -1
  22. package/src/centaline/loader/src/ctl/Contact.js +1 -1
  23. package/src/centaline/loader/src/ctl/ContactList.js +1 -1
  24. package/src/centaline/loader/src/ctl/Detail.js +22 -0
  25. package/src/centaline/loader/src/ctl/Router.js +35 -31
  26. package/src/centaline/loader/src/ctl/SearchTable.js +1 -1
  27. package/src/centaline/loader/src/ctl/lib/Enum.js +124 -133
  28. package/src/centaline/quickInputSos/src/quickInput.vue +19 -30
  29. package/src/main.js +6 -4
  30. package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
  31. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue';
2
2
  import Enum from './lib/Enum';
3
3
  import common from '../../../common';
4
- const CellLayout = function (source) {
4
+ const CellLayout = function (source, actionRouter,rowdata, forname, forrowindex) {
5
5
  var rtn = {
6
6
  get fields() {
7
7
  return source.fields;
@@ -49,6 +49,18 @@ const CellLayout = function (source) {
49
49
  return source.forrowindex;
50
50
  },
51
51
  get rightRouter() {
52
+ if (forname) {
53
+ var forrightRouter = false;
54
+ let field = actionRouter.find(b => {
55
+ return b.id === source.routerKey;
56
+ });
57
+ if (typeof field !== "undefined") {
58
+ if (!field.rightField || rowdata[forname][forrowindex][field.rightField] == 1) {
59
+ forrightRouter=true;
60
+ }
61
+ }
62
+ return forrightRouter;
63
+ }
52
64
  return source.rightRouter;
53
65
  },
54
66
  _styleObject: {},
@@ -132,7 +132,7 @@ const ContactList = function (source,para ,callBack) {
132
132
  return v.flagSort;
133
133
  },
134
134
  get sortName() {
135
- return v.sortBy;
135
+ return v.sortBy || v.fieldName;
136
136
  },
137
137
  get sortAction() {
138
138
  return v.sc;
@@ -137,7 +137,7 @@ const ContactList = function (source,para ,callBack) {
137
137
  return v.flagSort;
138
138
  },
139
139
  get sortName() {
140
- return v.sortBy;
140
+ return v.sortBy || v.fieldName;
141
141
  },
142
142
  get sortAction() {
143
143
  return v.sc;
@@ -65,9 +65,15 @@ const Detail = function (source, para, callBack) {
65
65
  get fields1() {
66
66
  return data.fields1;
67
67
  },
68
+ set fields1(v) {
69
+ data.fields1=v;
70
+ },
68
71
  get fields2() {
69
72
  return data.fields2;
70
73
  },
74
+ set fields2(v) {
75
+ data.fields2=v;
76
+ },
71
77
  get labels() {
72
78
  return data.labels;
73
79
  },
@@ -245,6 +251,9 @@ const Detail = function (source, para, callBack) {
245
251
  get tags1() {
246
252
  return data.tags1;
247
253
  },
254
+ set tags1(v) {
255
+ data.tags1 = v;
256
+ },
248
257
  get searchConditionApiTags1() {
249
258
  if (rtn._searchConditionApiTags1 !== null) {
250
259
  return rtn._searchConditionApiTags1;
@@ -440,6 +449,19 @@ const Detail = function (source, para, callBack) {
440
449
  }
441
450
  return rtn;
442
451
  },
452
+ loadBaseInfo(){
453
+ Vue.prototype.$api.postHandler(common.globalUri(), { action: source, para: para }).then(
454
+ function (response) {
455
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
456
+ rtn._fields1Dic=null;
457
+ rtn._fields2Dic=null;
458
+ rtn.fields1=response.content.fields1;
459
+ rtn.fields2=response.content.fields2;
460
+ rtn.$vue.loadFields();
461
+ }
462
+ }
463
+ );
464
+ },
443
465
  };
444
466
  return rtn;
445
467
  }
@@ -98,7 +98,7 @@ const Router = function (source) {
98
98
  get isSearchPageWithList() {
99
99
  return source.pageStyle === Enum.PageStyle.SearchPageWithList;
100
100
  },
101
- get isUrlInLayer(){
101
+ get isUrlInLayer() {
102
102
  return source.pageStyle === Enum.PageStyle.UrlInLayer;
103
103
  },
104
104
  get isOpenUrlInBrowse() {
@@ -110,6 +110,9 @@ const Router = function (source) {
110
110
  get isSeeVoice() {
111
111
  return source.actionType === Enum.ActionType.SeeVoice;
112
112
  },
113
+ get isBrowseAttachment() {
114
+ return source.actionType === Enum.ActionType.BrowseAttachment;
115
+ },
113
116
  //打开页面(1Form,2SearchList(弹在tab),3Tab,4执行客户端脚本,5SearchList(弹出))
114
117
  get navToNewPage() {
115
118
  return source.navToNewPage;
@@ -136,7 +139,7 @@ const Router = function (source) {
136
139
  let pageName = "";
137
140
  if (source.pageStyle === Enum.PageStyle.FormPageInLayer)
138
141
  pageName = 'ct-form';
139
- else if(source.pageStyle === Enum.PageStyle.SearchPageInLayer)
142
+ else if (source.pageStyle === Enum.PageStyle.SearchPageInLayer)
140
143
  pageName = 'ct-searchlist';
141
144
  //todo
142
145
  return pageName;
@@ -164,8 +167,8 @@ const Router = function (source) {
164
167
  return common.initialsToLowerCase(source.rightField);
165
168
  },
166
169
  get submitFormField() {
167
-
168
- if (typeof source.refFieldName === 'undefined' || source.refFieldName === null|| source.refFieldName.trim() === '') {
170
+
171
+ if (typeof source.refFieldName === 'undefined' || source.refFieldName === null || source.refFieldName.trim() === '') {
169
172
  return [];
170
173
  }
171
174
  var submitArr = [];
@@ -175,7 +178,7 @@ const Router = function (source) {
175
178
  return submitArr;
176
179
  },
177
180
  get submitListField() {
178
- if (typeof source.refFieldName === 'undefined' || source.refFieldName === null|| source.refFieldName.trim() === '') {
181
+ if (typeof source.refFieldName === 'undefined' || source.refFieldName === null || source.refFieldName.trim() === '') {
179
182
  return [];
180
183
  }
181
184
  var submitArr = [];
@@ -202,14 +205,14 @@ const Router = function (source) {
202
205
  return source.flagFreshCurrentRow;
203
206
  },
204
207
  set flagFreshCurrentRow(v) {
205
- source.flagFreshCurrentRow=v;
208
+ source.flagFreshCurrentRow = v;
206
209
  },
207
210
  //路由操作完成后是根据返回ID读取数据新增行
208
211
  get flagAddRowAfterAction() {
209
212
  return source.flagAddRowAfterAction;
210
213
  },
211
214
  set flagAddRowAfterAction(v) {
212
- source.flagAddRowAfterAction=v;
215
+ source.flagAddRowAfterAction = v;
213
216
  },
214
217
  get textColor() {
215
218
  return source.textColor || '';
@@ -221,13 +224,12 @@ const Router = function (source) {
221
224
  return source.borderColor ? source.borderColor : (source.bgColor || '');
222
225
  },
223
226
  attrs: {
224
- set class(v)
225
- {
226
- source.className=v
227
+ set class(v) {
228
+ source.className = v
227
229
  },
228
230
  get class() {
229
231
  var size = this.size ? this.size : "mini";
230
- source.className=source.className||'ct-font-size-' + size;
232
+ source.className = source.className || 'ct-font-size-' + size;
231
233
  return source.className;
232
234
  }
233
235
  },
@@ -245,12 +247,11 @@ const Router = function (source) {
245
247
  jsonData: data
246
248
  }
247
249
  };
248
- }
249
- else {
250
+ } else {
250
251
  data.actionType = rtn.actionType;
251
252
  data = Object.assign(data, rtn.queryPara);
252
- if(rtn.isDropdown && rtn.selectOptionCode){
253
- data[rtn.paramName]=rtn.selectOptionCode;
253
+ if (rtn.isDropdown && rtn.selectOptionCode) {
254
+ data[rtn.paramName] = rtn.selectOptionCode;
254
255
  }
255
256
  params = {
256
257
  action: rtn.action,
@@ -259,20 +260,23 @@ const Router = function (source) {
259
260
  }
260
261
  return params;
261
262
  },
262
- doAction(data, callback,scripts) {
263
+ doAction(data, callback, scripts) {
263
264
  if (rtn.action) {
264
- Vue.prototype.$api.postHandler(common.globalUri(), rtn.getActionPara(data),scripts).then((response) => {
265
+ Vue.prototype.$api.postHandler(common.globalUri(), rtn.getActionPara(data), scripts).then((response) => {
265
266
  callback(response);
266
267
  }).catch((ex) => {
267
- callback(ex);//里面需要有data.rtnCode === 200的处理
268
+ callback(ex); //里面需要有data.rtnCode === 200的处理
269
+ });
270
+ } else {
271
+ callback({
272
+ rtnCode: Enum.ReturnCode.Successful
268
273
  });
269
- }
270
- else {
271
- callback({ rtnCode: Enum.ReturnCode.Successful });
272
274
  }
273
275
  },
274
276
  getSearchPara() {
275
- let params = { fields: [] };
277
+ let params = {
278
+ fields: []
279
+ };
276
280
  if (source.queryString) {
277
281
  var arr = source.queryString.split("&");
278
282
  for (var i = 0; i < arr.length; i++) {
@@ -293,14 +297,15 @@ const Router = function (source) {
293
297
  Vue.prototype.$api.postHandler(common.globalUri(), data).then((response) => {
294
298
  callback(response);
295
299
  }).catch((ex) => {
296
- callback(ex);//里面需要有data.rtnCode === 200的处理
300
+ callback(ex); //里面需要有data.rtnCode === 200的处理
301
+ });
302
+ } else {
303
+ callback({
304
+ rtnCode: Enum.ReturnCode.Successful
297
305
  });
298
- }
299
- else {
300
- callback({ rtnCode: Enum.ReturnCode.Successful });
301
306
  }
302
307
  },
303
- selectOptionCode:'',
308
+ selectOptionCode: '',
304
309
  _elementOptions: [],
305
310
  get elementOptions() {
306
311
  return this._elementOptions;
@@ -333,15 +338,14 @@ const Router = function (source) {
333
338
  },
334
339
  get flagVerifyData() {
335
340
  //提交表单时是否校验数据
336
- if(source.flagVerifyData!=undefined){
341
+ if (source.flagVerifyData != undefined) {
337
342
  return source.flagVerifyData;
338
- }
339
- else{
343
+ } else {
340
344
  return true;
341
345
  }
342
346
  },
343
347
  get buttonHeight() {
344
- return source.buttonHeight||24;
348
+ return source.buttonHeight || 24;
345
349
  },
346
350
  };
347
351
  return rtn;
@@ -67,7 +67,7 @@ const SearchTable = function (data, callBack, searchModel, flagSearch, defaultSe
67
67
  return v.flagSort;
68
68
  },
69
69
  get sortName() {
70
- return v.sortBy;
70
+ return v.sortBy || v.fieldName;
71
71
  },
72
72
  get sortAction() {
73
73
  return v.sc;