centaline-data-driven 1.2.50 → 1.2.53

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 (26) hide show
  1. package/build/centaline/centaline.path.js +2 -0
  2. package/package.json +1 -1
  3. package/src/Detail.vue +1 -1
  4. package/src/centaline/css/common.css +4 -2
  5. package/src/centaline/css/max.css +3 -0
  6. package/src/centaline/dynamicBtn/src/dynamicBtn.vue +66 -8
  7. package/src/centaline/dynamicCompound/index.js +14 -0
  8. package/src/centaline/dynamicCompound/src/dynamicCompound.vue +89 -0
  9. package/src/centaline/dynamicContact/index.js +11 -0
  10. package/src/centaline/dynamicContact/src/dynamicContact.vue +293 -0
  11. package/src/centaline/dynamicDetail/src/dynamicDetail.vue +17 -1
  12. package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +136 -35
  13. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +42 -5
  14. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +27 -5
  15. package/src/centaline/loader/src/ctl/Compound.js +59 -0
  16. package/src/centaline/loader/src/ctl/Contact.js +354 -0
  17. package/src/centaline/loader/src/ctl/Detail.js +18 -0
  18. package/src/centaline/loader/src/ctl/Router.js +3 -0
  19. package/src/centaline/loader/src/ctl/lib/Enum.js +9 -0
  20. package/src/centaline/loader/src/ctl/lib/LibFunction.js +5 -0
  21. package/src/centaline/loader/src/ctl.js +2 -0
  22. package/src/centaline/selectOption/src/selectOptionVertical.vue +1 -1
  23. package/src/centaline/templateControls/src/dynamicTableCurrency.vue +3 -3
  24. package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
  25. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
  26. package/src/assets/ewmA.png +0 -0
@@ -0,0 +1,354 @@
1
+ import base from '../../index';
2
+ import Base from './Base';
3
+ import Enum from './lib/Enum';
4
+ import common from '../../../common';
5
+ import Router from './Router';
6
+ import Vue from 'vue';
7
+ const ContactList = function (source,para ,callBack) {
8
+ var init = function (data) {
9
+ var rtn = {
10
+ $vue: null,
11
+ _buttons: null,
12
+ _actionRouter: null,
13
+ _rowRouter: null,
14
+ _columns: [],
15
+ _listData: [],
16
+ _scripts: null,
17
+ options: [],
18
+ isMergeTitle: false,//是否合并标题
19
+ text:'',
20
+ value:0,
21
+ currentRow: null,
22
+ attrs: {
23
+ size: 'mini'
24
+ },
25
+ optionAttrs: {
26
+ value: 'code',
27
+ label: 'name',
28
+ displayLabel:'displayName',
29
+ actionType: 'actionType',
30
+ flagDeleted: 'flagDeleted'
31
+ },
32
+ get lock() {
33
+ return false;
34
+ },
35
+ get primaryKey() {
36
+ return common.initialsToUpperCase(data.content.primaryFieldName);
37
+ },
38
+ get primaryFieldMappingDBName() {
39
+ return data.content.primaryFieldMappingDBName;
40
+ },
41
+ get buttons() {
42
+ if (rtn._buttons !== null) {
43
+ return rtn._buttons;
44
+ }
45
+ else {
46
+ if (data.content.toolButtons) {
47
+ rtn._buttons = [];
48
+ data.content.toolButtons.forEach((v) => {
49
+ var button = Router(v);
50
+ button.is = "ct-btn";
51
+ button.attrs = { size: "mini", class: 'max-btn-gray' }
52
+ rtn._buttons.push(button);
53
+ });
54
+ }
55
+ return rtn._buttons;
56
+ }
57
+ },
58
+ get actionRouter() {
59
+ if (rtn._actionRouter !== null) {
60
+ return rtn._actionRouter;
61
+ }
62
+ else {
63
+ rtn._actionRouter = [];
64
+ if (data.content.actionRouters) {
65
+ data.content.actionRouters.forEach((v) => {
66
+ var router = Router(v);
67
+ router.is = "ct-btn";
68
+ router.attrs = { size: "mini" }
69
+ rtn._actionRouter.push(router);
70
+ });
71
+ }
72
+ return rtn._actionRouter;
73
+ }
74
+ },
75
+ get rowRouter() {
76
+ if (rtn._rowRouter !== null) {
77
+ return rtn._rowRouter;
78
+ }
79
+ else {
80
+ rtn._rowRouter = [];
81
+ if (rtn.actionRouter) {
82
+ rtn.actionRouter.forEach((v) => {
83
+ if (v.show) {
84
+ rtn._rowRouter.push(v);
85
+ }
86
+ });
87
+ }
88
+ return rtn._rowRouter;
89
+ }
90
+ },
91
+ get listData() {
92
+ if (rtn._listData.length<=0) {
93
+ if(data.content.rows && data.content.rows.length>0){
94
+ data.content.rows.forEach((v,i) => {
95
+ rtn._listData.push(v);
96
+ });
97
+ }
98
+ }
99
+ return rtn._listData;
100
+ },
101
+ set listData(v) {
102
+ if (v) {
103
+ rtn._listData=v;
104
+ }
105
+ },
106
+ get columns() {
107
+ var self = this;
108
+ if (self._columns.length > 0) {
109
+ return self._columns;
110
+ }
111
+ else {
112
+ var lockLeft = true;
113
+
114
+ self.isMergeTitle = data.content.columns.some(v => {
115
+ return v.trOrder === 2;
116
+ });
117
+
118
+ data.content.columns.forEach((v) => {
119
+ v.columnWidth = v.columnWidth ? v.columnWidth : 'auto';
120
+ var col = {
121
+ fixedSize: 0,
122
+ get source() {
123
+ return v;
124
+ },
125
+ get id() {
126
+ return common.initialsToUpperCase(v.fieldName);
127
+ },
128
+ get name() {
129
+ return v.displayName;
130
+ },
131
+ get sort() {
132
+ return v.flagSort;
133
+ },
134
+ get sortName() {
135
+ return v.sortBy;
136
+ },
137
+ get sortAction() {
138
+ return v.sc;
139
+ },
140
+ set sortAction(v1) {
141
+ v.sc = v1;
142
+ },
143
+ get style() {
144
+ return v.columnStyle;
145
+ },
146
+ get show() {
147
+ return v.visible;
148
+ },
149
+ get rowspan() {
150
+ return v.rowSpan || 1;
151
+ },
152
+ get colspan() {
153
+ return v.colSpan || 1;
154
+ },
155
+ get trOrder() {
156
+ return v.trOrder || 1;
157
+ },
158
+ get isDataField() {
159
+ return v.isDataField;
160
+ },
161
+ get width() {
162
+ return v.columnWidth ? v.columnWidth : undefined;
163
+ },
164
+ set width(widthV) {
165
+ v.columnWidth = widthV;
166
+ },
167
+ get lock() {
168
+ return v.frozen;
169
+ },
170
+ get routerKey() {
171
+ return v.routerKey;
172
+ },
173
+ _router: null,
174
+ get router() {
175
+ if (col._router !== null) {
176
+ return col._router;
177
+ }
178
+ //todo
179
+ if (typeof v.routerKey !== "undefined") {
180
+ let router = rtn.actionRouter.find(b => {
181
+ return b.id === v.routerKey;
182
+ });
183
+ return router;
184
+ }
185
+ return null;
186
+ },
187
+ //是否高度自适应
188
+ get autoRowHeight() {
189
+ return v.autoRowHeight;
190
+ },
191
+ attrs: {
192
+ get style() {
193
+ let styleObj = v.cs ? JSON.parse(v.cs) : {};
194
+ if (rtn.$vue !== null) {
195
+ if (v.frozen) {
196
+ if (col.fixed === 'right') {
197
+ styleObj.right = col.fixedSize + 'px'
198
+ }
199
+ else if (col.fixed === 'left') {
200
+ styleObj.left = col.fixedSize + 'px'
201
+ }
202
+ }
203
+ }
204
+
205
+ if (col.width) {
206
+ styleObj["width"] = col.width + 'px';//列宽
207
+ styleObj["min-width"] = col.width + 'px';//列宽
208
+ }
209
+ styleObj["text-align"] = col.align;//水平位置
210
+
211
+ return styleObj;
212
+ // return ;
213
+ },
214
+ get align() {//水平位置
215
+ if (v.align === Enum.HalignType.Left) {
216
+ return 'left';
217
+ }
218
+ if (v.align === Enum.HalignType.Right) {
219
+ return 'right';
220
+ }
221
+ return 'center';
222
+ },
223
+ get valign() {//垂直位置 TODO
224
+ return v.valign || 'center';
225
+ },
226
+ get title() {
227
+ return v.columnToolTip;
228
+ }
229
+ }
230
+ };
231
+ if (col.show) {
232
+ //合并表头时暂不支持固定列
233
+ if (col.lock && !self.isMergeTitle) {
234
+ if (lockLeft) {
235
+ col.fixed = 'left';
236
+ }
237
+ else {
238
+ col.fixed = 'right';
239
+ }
240
+ }
241
+ else {
242
+ lockLeft = false;
243
+ }
244
+ }
245
+ self._columns.push(col);
246
+ });
247
+ }
248
+ return self._columns;
249
+ },
250
+ set columns(v) {
251
+ this._columns = [];
252
+ data.content.columns = v;
253
+ },
254
+ get apiRouter() {
255
+ return data.apiRouter;
256
+ },
257
+ getOptions(){
258
+ if (rtn.options.length<=0) {
259
+ let label=rtn.columns[0].id;
260
+ rtn.listData.forEach((v,i) => {
261
+ rtn.options.push({code:i,name:v[label]})
262
+ });
263
+ }
264
+ },
265
+ getCurrentRowApiData(rtnData,router) {
266
+ var self = this;
267
+ var searchFields = self.apiRouter.getSearchPara();
268
+ var searchValue1=router.flagAddRowAfterAction? rtnData.content: rtn.listData[rtn.selectIndex][self.primaryKey];
269
+ if (self.primaryKey) {
270
+ searchFields.fields.push({
271
+ fieldName1: self.primaryFieldMappingDBName ? self.primaryFieldMappingDBName : self.primaryKey,
272
+ groupName: self.primaryKey,
273
+ operation: Enum.SearchOperation.等于,
274
+ searchDataType: Enum.SearchDataType.Text,
275
+ searchValue1: searchValue1,
276
+ });
277
+ }
278
+ Vue.prototype.$api.postHandler(common.globalUri(), {
279
+ action: rtn.apiRouter.action,
280
+ para: {
281
+ searchFields: searchFields,
282
+ pageAttribute: { pageIndex: 1 },
283
+ flagSearch: true
284
+ }
285
+ })
286
+ .then(function (response) {
287
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
288
+ if (response.content.rows.length > 0) {
289
+ if(router.flagAddRowAfterAction){
290
+ rtn.doNew(response.content.rows);
291
+ }
292
+ else{
293
+ rtn.doUpdate(response.content.rows,searchValue1);
294
+ }
295
+ }
296
+ }
297
+ })
298
+ .catch((error) => {
299
+ });
300
+ },
301
+ doAction(response,field) {
302
+ if (response.responseData) {
303
+ response = response.responseData;
304
+ }
305
+ if(field.flagFreshCurrentRow || field.flagAddRowAfterAction){
306
+ rtn.getCurrentRowApiData(response,field);
307
+ }
308
+ else{
309
+ switch (response.notification) {
310
+ case Enum.ActionType.Delete://删除
311
+ case Enum.ActionType.CloseTabThenDelete://删除
312
+
313
+ break;
314
+ case Enum.ActionType.New://新增
315
+ case Enum.ActionType.CloseTabThenNew://新增
316
+
317
+ break;
318
+ case Enum.ActionType.Update://修改
319
+ case Enum.ActionType.CloseTabThenUpdate://修改
320
+
321
+ break;
322
+ default:
323
+ break;
324
+ }
325
+ }
326
+ },
327
+ };
328
+ return rtn;
329
+ }
330
+ if (typeof source === 'string') {
331
+ let paras= {
332
+ searchFields: para,
333
+ pageAttribute: { pageIndex: 1 },
334
+ flagSearch: true
335
+ }
336
+ Vue.prototype.$api.postHandler(common.globalUri(), { action: source,para:paras}).then(
337
+ function (response) {
338
+ if (response.rtnCode === Enum.ReturnCode.Successful) {
339
+ var rtn = init(response);
340
+ if (callBack) {
341
+ callBack(rtn);
342
+ }
343
+ }
344
+ }
345
+ );
346
+ }
347
+ else {
348
+ var rtn = init(source);
349
+ if (callBack) {
350
+ callBack(rtn);
351
+ }
352
+ }
353
+ }
354
+ export default ContactList;
@@ -14,6 +14,7 @@ const Detail = function (source,para ,callBack) {
14
14
  _otherTradeActionRouter: null,//对应另外种交易的 router 如:本盘出售 则可能对应的出租的交易,没有则为空
15
15
  _actionRouters:null,//页面上的动作行为
16
16
  _actionRoutersMoreList:null,//页面上的更多动作行为
17
+ _actionRoutersSimple:null,//页面上的动作行为
17
18
  _contactApiRouter:null,//查看联系人
18
19
  _commissionApiRouter:null,//查看角色
19
20
  detailHeight:750,
@@ -191,6 +192,23 @@ const Detail = function (source,para ,callBack) {
191
192
  return rtn._actionRoutersMoreList;
192
193
  }
193
194
  },
195
+ get actionRoutersSimple() {
196
+ if (rtn._actionRoutersSimple !== null) {
197
+ return rtn._actionRoutersSimple;
198
+ }
199
+ else {
200
+ rtn._actionRoutersSimple = [];
201
+ if (data.actionRouters) {
202
+ data.actionRouters.forEach((v,i) => {
203
+ var router = Router(v);
204
+ router.is = "ct-btn";
205
+ router.attrs = { size: "mini" }
206
+ rtn._actionRoutersSimple.push(router);
207
+ });
208
+ }
209
+ return rtn._actionRoutersSimple;
210
+ }
211
+ },
194
212
  get tags1() {
195
213
  return data.tags1;
196
214
  },
@@ -38,6 +38,9 @@ const Router = function (source) {
38
38
  get isDropdown() {
39
39
  return source.buttonType === Enum.ButtonType.Dropdown;
40
40
  },
41
+ get isCallTel() {
42
+ return source.actionType === Enum.ActionType.CallTel;
43
+ },
41
44
  get alert() {
42
45
  return source.flagAlert === true;
43
46
  },
@@ -229,6 +229,10 @@ const Enum = {
229
229
  /// 重复控件
230
230
  /// </summary>
231
231
  Repeat: 47,
232
+ /// <summary>
233
+ /// 复合控件
234
+ /// </summary>
235
+ Compound: 48,
232
236
  },
233
237
 
234
238
  //返回状态码
@@ -368,6 +372,11 @@ const Enum = {
368
372
  /// 替换当前表单内容
369
373
  /// </summary>
370
374
  Replace: 18,
375
+
376
+ /// <summary>
377
+ /// 执行 拨打电话 的动作
378
+ /// </summary>
379
+ CallTel: 19,
371
380
  },
372
381
 
373
382
  /// <summary>
@@ -33,6 +33,7 @@ import SensitiveEye from '../SensitiveEye';
33
33
  import Cb from '../Cb';
34
34
  import PhotoSelect from '../PhotoSelect';
35
35
  import Repeat from '../Repeat';
36
+ import Compound from '../Compound';
36
37
 
37
38
  const LibFunction = {
38
39
  install(Vue) {
@@ -218,6 +219,10 @@ const LibFunction = {
218
219
  item = Repeat(listobj, field);
219
220
  item.is = 'ct-repeat';
220
221
  break;
222
+ case Enum.ControlType.Compound://复合
223
+ item = Compound(field);
224
+ item.is = 'ct-compound';
225
+ break;
221
226
  case Enum.ControlType.Hidden://隐藏控件
222
227
  item = Hd(field);
223
228
  break;
@@ -39,6 +39,8 @@ const loader = {
39
39
  QuickInputSos: require("./ctl/QuickInputSos.js").default,
40
40
  ContactList: require("./ctl/ContactList.js").default,
41
41
  Repeat: require("./ctl/Repeat.js").default,
42
+ Compound: require("./ctl/Compound.js").default,
43
+ Contact: require("./ctl/Contact.js").default,
42
44
  };
43
45
 
44
46
  export default loader;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="ct-selectOptionVertical" style="">
3
3
  <ul>
4
- <li v-for="op in model.options" :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':'']" @click="selectOption(op[model.optionAttrs.value])">
5
5
  <span>{{op[model.optionAttrs.displayLabel]||op[model.optionAttrs.label]}}</span>
6
6
  </li>
7
7
  </ul>
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <div :class="isOperationalColumn?'subdiv_allinline':''" v-if="isShowLabel" @click="clickHandler($event)">
3
- <img v-if="router.imgUrl && isShowImg" class="ct-tablecurrencyImg ct-tablecurrencyItem" :src="router.imgUrl" :title="router.label" />
4
- <a v-else href="javascript:void(0);" class="ct-tablecurrencyItem" >
2
+ <div :class="isOperationalColumn?'subdiv_allinline':''" v-if="isShowLabel" @click="isOperationalColumn?clickHandler($event):null">
3
+ <img v-if="router.imgUrl && isShowImg" class="ct-tablecurrencyImg ct-tablecurrencyItem" :src="router.imgUrl" :title="router.label" @click="!isOperationalColumn?clickHandler($event):null"/>
4
+ <a v-else href="javascript:void(0);" class="ct-tablecurrencyItem" @click="!isOperationalColumn?clickHandler($event):null">
5
5
  {{label}}
6
6
  </a>
7
7
  </div>