centaline-data-driven 1.2.71 → 1.2.74

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 (33) hide show
  1. package/build/centaline/centaline.path.js +1 -0
  2. package/package.json +1 -1
  3. package/src/Form.vue +2 -2
  4. package/src/SearchList.vue +4 -4
  5. package/src/assets/more.png +0 -0
  6. package/src/centaline/dynamicBtn/src/dynamicBtn.vue +1 -1
  7. package/src/centaline/dynamicContact/src/dynamicContact.vue +4 -4
  8. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +8 -1
  9. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +29 -19
  10. package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +52 -22
  11. package/src/centaline/dynamicForm/src/dynamicForm.vue +50 -11
  12. package/src/centaline/dynamicInputNumber/src/dynamicInputNumber.vue +2 -6
  13. package/src/centaline/dynamicLayout/index.js +11 -0
  14. package/src/centaline/dynamicLayout/src/dynamicLayout.vue +311 -0
  15. package/src/centaline/dynamicLayout/src/dynamicLayoutChildren.vue +44 -0
  16. package/src/centaline/dynamicLayout/src/dynamicLayoutImage.vue +39 -0
  17. package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +55 -0
  18. package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +29 -0
  19. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +21 -5
  20. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +60 -37
  21. package/src/centaline/dynamicSearchList/src/dynamicTableStats.vue +4 -0
  22. package/src/centaline/dynamicT/src/dynamicT.vue +2 -0
  23. package/src/centaline/formData/index.js +46 -28
  24. package/src/centaline/loader/src/ctl/Button.js +3 -0
  25. package/src/centaline/loader/src/ctl/CellLayout.js +135 -0
  26. package/src/centaline/loader/src/ctl/Form.js +318 -3
  27. package/src/centaline/loader/src/ctl/FormList.js +69 -11
  28. package/src/centaline/loader/src/ctl/SearchTable.js +132 -127
  29. package/src/centaline/loader/src/ctl.js +1 -0
  30. package/src/centaline/selectOption/src/selectOptionVertical.vue +8 -0
  31. package/src/main.js +6 -6
  32. package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
  33. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
@@ -20,20 +20,21 @@
20
20
  @scroll="scrollHandle($event)" :v-focus="model.flagFocus"
21
21
  @keydown.up="rowKeyDownHandle($event,0)" @keydown.down="rowKeyDownHandle($event,1)"
22
22
  tabindex="-1">
23
- <div class="ct-table-content">
23
+ <div class="ct-table-content" v-if="!isLayout">
24
24
  <table border="0" cellpadding="0" cellspacing="0"
25
25
  :class="['ct-table',model.attrs.size?'ct-table-'+model.attrs.size:'']">
26
26
  <!--表头-->
27
27
  <thead ref="tableHead">
28
28
  <tr class="ct-tr" ref="headTr" v-for="(columns,columnsIndex) in model.columnsArr" :key="columnsIndex">
29
29
  <th v-if="model.isMulti && columnsIndex === 0" ref="headLeftThs" class="ct-td left-fixation-th checkbox-td" :class="[model.tdClass]">
30
- <label class="el-checkbox"><span class="el-checkbox__input" :class="model.selectAllType">
31
- <span class="el-checkbox__inner"></span>
32
- <input type="checkbox" @click="selectAll($event)" v-model="model.selectAll" class="el-checkbox__original checkbox-td-1" aria-hidden="false" />
30
+ <label class="el-checkbox">
31
+ <span class="el-checkbox__input" :class="model.selectAllType">
32
+ <span class="el-checkbox__inner"></span>
33
+ <input type="checkbox" @click="selectAll($event)" v-model="model.selectAll" class="el-checkbox__original checkbox-td-1" aria-hidden="false" />
33
34
  </span>
34
35
  </label>
35
36
  </th>
36
- <th :ref="column.fixed?(column.fixed==='left'?'headLeftThs':'headRightThs'):'headThs'"
37
+ <th :ref="column.fixed?(column.fixed==='left'?'headLeftThs':'headRightThs'):'headThs'"
37
38
  v-for="(column,colIndex) in columns" :key="colIndex"
38
39
  v-if="column.show" class="ct-td ct-searchtable-th"
39
40
  :rowspan="column.rowspan"
@@ -55,8 +56,8 @@
55
56
  </th>
56
57
 
57
58
  <!--<th v-if="model.rowRouter.length > 0" class="ct-td tdFiexd" :class="[-1 === rightShadow?'shadowRight':null]" :style="{'min-width':'20px','transform':'translate('+scrollRight+'px, '+scrollTop+'px)'}">
58
- 操作
59
- </th>-->
59
+ 操作
60
+ </th>-->
60
61
  </tr>
61
62
  </thead>
62
63
  <!--表体-->
@@ -68,11 +69,12 @@
68
69
  class="ct-tr"
69
70
  :style="row.$style">
70
71
  <td v-if="model.isMulti" class="ct-td tdFiexd left-fixation checkbox-td" :class="[model.tdClass]" align="center">
71
- <label v-if="!model.rightMulti || row[model.rightMulti] == 1" class="el-checkbox is-checked"><span class="el-checkbox__input" :class="rowCheckClass(row)">
72
- <span class="el-checkbox__inner"></span>
73
- <input type="checkbox" v-model="row.$select" @change="selectOne($event)" class="el-checkbox__original checkbox-td-1" />
74
- </span>
75
- </label>
72
+ <label v-if="!model.rightMulti || row[model.rightMulti] == 1" class="el-checkbox is-checked">
73
+ <span class="el-checkbox__input" :class="rowCheckClass(row)">
74
+ <span class="el-checkbox__inner"></span>
75
+ <input type="checkbox" v-model="row.$select" @change="selectOne($event)" class="el-checkbox__original checkbox-td-1" />
76
+ </span>
77
+ </label>
76
78
  </td>
77
79
  <td :ref="column.fixed?(column.fixed==='left'?'headLeftTds':'headRightTds'):null"
78
80
  v-for="(column,colIndex) in model.dataFieldcolumns" :key="colIndex"
@@ -88,17 +90,17 @@
88
90
  v-bind="column.attrs">
89
91
  <!--操作列-->
90
92
  <div v-if="column.id==='operation'" class="div_allinline" :class="column.autoRowHeight ? 'lineFeedCell':'cell'">
91
- <ct-tablecurrency v-for="(router,rowRouterIndex) in getRowRouterShow(row)" :key="rowRouterIndex"
92
- v-if="!router.rightField || row[router.rightField] == 1" :isOperationalColumn="true"
93
- :router="router" :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
93
+ <ct-tablecurrency v-for="(router,rowRouterIndex) in getRowRouterShow(row)" :key="rowRouterIndex"
94
+ v-if="!router.rightField || row[router.rightField] == 1" :isOperationalColumn="true"
95
+ :router="router" :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
94
96
  </ct-tablecurrency>
95
97
  <el-popover v-if="getRowRouterDisplay(row).length>0" :ref="'popover'+rowindex" :append-to-table="option.appendId?option.appendId:''" class="Stats-popover" popper-class="el-popover1"
96
- :placement="option.placement?option.placement:'left'"
97
- :trigger="option.trigger?option.trigger:''">
98
+ :placement="option.placement?option.placement:'left'"
99
+ :trigger="option.trigger?option.trigger:''">
98
100
  <div class="tab-list" style="border-bottom:none">
99
- <ct-tablecurrency v-for="(router,rowRouterIndex) in getRowRouterDisplay(row)" :key="rowRouterIndex"
100
- v-if="!router.rightField || row[router.rightField] == 1" :isOperationalColumn="true" :isShowImg="false" :rowindex="rowindex"
101
- :router="router" :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
101
+ <ct-tablecurrency v-for="(router,rowRouterIndex) in getRowRouterDisplay(row)" :key="rowRouterIndex"
102
+ v-if="!router.rightField || row[router.rightField] == 1" :isOperationalColumn="true" :isShowImg="false" :rowindex="rowindex"
103
+ :router="router" :colValue="router.label" :rowData="row" @click="rolRouterClickHandler">
102
104
  </ct-tablecurrency>
103
105
  </div>
104
106
  <span :slot="getRowRouterDisplay(row).length>0?'reference':''" class="icon-more"></span>
@@ -112,7 +114,7 @@
112
114
 
113
115
 
114
116
  <!--正常的列-->
115
- <div v-else-if="column.flagHtml" v-html="row[column.id]" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :style="column.style ? column.style:''">
117
+ <div v-else-if="column.flagHtml" v-html="row[column.id]" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :style="column.style ? column.style:''">
116
118
  </div>
117
119
  <div v-else-if="typeof column.template === 'undefined'" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :style="column.style ? column.style:''">
118
120
  {{row[column.id]}}
@@ -120,10 +122,10 @@
120
122
 
121
123
  <!--模版列(启用)-->
122
124
  <!--<component v-else :is="column.template(row).component" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :vmodel="column.template(row)" :style="{'width': column.width + 'px'}">
123
- <template slot="value">
124
- {{row[column.id]}}
125
- </template>
126
- </component>-->
125
+ <template slot="value">
126
+ {{row[column.id]}}
127
+ </template>
128
+ </component>-->
127
129
  </td>
128
130
  </tr>
129
131
  <!--适配滚动条-->
@@ -131,9 +133,12 @@
131
133
  </tbody>
132
134
  </table>
133
135
  </div>
136
+ <div v-else>
137
+ <ct-layout ref="CellLayout" :vmodel="model.source.content"></ct-layout>
138
+ </div>
134
139
  </div>
135
- <ct-tabletip ref="listFooter" class="ct-search-table-list-footer" :tip="model.listFooter" v-if="!isLoading"></ct-tabletip>
136
- <ct-tabletip ref="footer" class="ct-search-table-footer" :tip="model.footer" v-if="!isLoading"></ct-tabletip>
140
+ <ct-tabletip ref="listFooter" class="ct-search-table-list-footer" :tip="model.listFooter" v-if="!isLoading&&!isLayout"></ct-tabletip>
141
+ <ct-tabletip ref="footer" class="ct-search-table-footer" :tip="model.footer" v-if="!isLoading&&!isLayout"></ct-tabletip>
137
142
  <div v-if="isLoading && searchLoading" v-loading="isLoading" style="top:30px;">
138
143
  </div>
139
144
  </div>
@@ -143,13 +148,15 @@
143
148
  import dynamicTableTip from './dynamicTableTip.vue';
144
149
  import dynamicTableToolbar from './dynamicTableToolbar.vue';
145
150
  import dynamicTableStats from './dynamicTableStats.vue';
151
+ import dynamicLayout from '../../dynamicLayout/src/dynamicLayout.vue';
146
152
  export default {
147
153
  name: 'ct-searchtable',
148
154
  mixins: [dynamicElement],
149
155
  components: {
150
156
  'ct-tabletip': dynamicTableTip,
151
157
  'ct-tabletoolbar': dynamicTableToolbar,
152
- 'ct-tableStats': dynamicTableStats
158
+ 'ct-tableStats': dynamicTableStats,
159
+ 'ct-layout': dynamicLayout
153
160
  },
154
161
  props: {
155
162
  vmodel: Object,
@@ -171,6 +178,7 @@
171
178
  return {
172
179
  currentTh: null,
173
180
  isLoading: true,
181
+ isLayout: false,
174
182
  searchLoading: true,
175
183
  tableLoading: false,//表格等待
176
184
  operationLoading: false,//操作等待
@@ -229,7 +237,9 @@
229
237
  self.colHasWidth[vi] = 'nowidth';
230
238
  }
231
239
  });
232
-
240
+ if (typeof self.model.cellLayout !== 'undefined') {
241
+ self.isLayout = true;
242
+ }
233
243
  self.isLoading = false;
234
244
  self.$forceUpdate();
235
245
  this.model.scripts.formData = this.model.formData;
@@ -253,7 +263,7 @@
253
263
  window.addEventListener("resize", (ev) => {
254
264
  self.setTableHeight();
255
265
  });
256
- //self.rowColorChange();
266
+ self.rowColorChange();
257
267
  self.fiexdHead();
258
268
 
259
269
  //当表格没有占满表格框时,主动请求下一页
@@ -520,22 +530,35 @@
520
530
  setTableHeight() {
521
531
  var self = this;
522
532
  this.$nextTick(() => {
523
- if (this.$refs.searchTable && this.$refs.toolbar && this.$refs.searchTable.parentElement) {
533
+ if (this.$refs.searchTable && this.$refs.toolbar && this.$refs.searchTable.parentElement && !self.isLayout) {
524
534
  var h1 = this.$refs.searchTable.parentElement.offsetHeight | 0;
525
535
  var h2 = this.$refs.searchTable.offsetTop | 0;
526
536
  var h3 = this.$refs.toolbar.$el.offsetHeight | 0;
527
537
  var h4 = this.$refs.footer.$el.offsetHeight | 0;
528
538
  var h5 = this.$refs.listHeader.$el.offsetHeight | 0;
529
539
  var h6 = this.$refs.listFooter.$el.offsetHeight | 0;
530
- var h7 = this.$refs.tableStats?(this.$refs.tableStats.$el.offsetHeight+7 | 0):0;
531
- let tableHeight = h1 - h2 - h3 - h4 - h5 - h6 - h7-22;
540
+ var h7 = this.$refs.tableStats ? (this.$refs.tableStats.$el.offsetHeight + 7 | 0) : 0;
541
+ let tableHeight = h1 - h2 - h3 - h4 - h5 - h6 - h7 - 22;
532
542
  this.model.tableHeight = tableHeight < 40 ? 350 : tableHeight;
533
543
  this.$nextTick(() => {
534
544
  self.getScrollAttr();
535
545
  });
536
546
  }
547
+ else {
548
+ var h1 = document.body.offsetHeight | 0;
549
+ if (this.$parent.$parent.$vnode.componentOptions.tag === 'ct-PropertySimpleDetailRET') {
550
+ var h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
551
+ var h3 = this.$parent.$parent.$refs.title.offsetHeight | 0;
552
+ let tableHeight = h1 - h2-h3 - 300;
553
+ this.model.tableHeight = tableHeight;
554
+ this.$nextTick(() => {
555
+ self.getScrollAttr();
556
+ });
557
+ }
558
+
559
+ }
537
560
  });
538
- },
561
+ },
539
562
  scrollHandle(ev) {
540
563
  var self = this;
541
564
  if ((this.$refs.tableParent.scrollTop + this.$refs.tableParent.clientHeight) >= (this.$refs.tableParent.scrollHeight - 5)) {
@@ -817,12 +840,12 @@
817
840
  else {
818
841
  // let parm={submitData:submitData,field:field}
819
842
  // self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
843
+ // var fun = self.model.scripts.formData[action];
844
+ // fun(submitData,field);
820
845
  let title = field.pageTitle == undefined ? field.label : field.pageTitle;
821
846
  submitData.actionType = field.actionType;
822
847
  var fun = self.$common.getDataDrivenOpts().handler[action];
823
- fun(submitData, title, self.model);
824
- // var fun = self.model.scripts.formData[action];
825
- // fun(submitData,field);
848
+ fun(submitData, title, self.$parent);
826
849
  }
827
850
  }
828
851
 
@@ -176,6 +176,10 @@
176
176
  </style>
177
177
 
178
178
  <style>
179
+ .ct-table-Statistics{
180
+ height: 20px;
181
+ margin-bottom: 10px;
182
+ }
179
183
  .tab-list {
180
184
  position: relative;
181
185
  margin-bottom: 10px;
@@ -67,6 +67,8 @@
67
67
  },
68
68
  clearClickHandle: function (event) {
69
69
  this.model.value = '';
70
+ this.inputHandler(this.model.value);
71
+ this.changeHandler(this.model.value);
70
72
  this.isShowClear();
71
73
  event.stopPropagation();
72
74
  },
@@ -73,6 +73,7 @@ const formData = {
73
73
  }
74
74
  }
75
75
  },
76
+
76
77
  //获取列表数据
77
78
  get excuteListData() {
78
79
  if (this._excuteListData) {
@@ -183,7 +184,7 @@ const formData = {
183
184
  attrName = attrName ? attrName : 'code1';
184
185
 
185
186
  if (!fiedlId) {
186
- fiedlId = data.listData.currentEventField.id;
187
+ fiedlId = data.listData.currentEventField.id;
187
188
  }
188
189
  if (fiedlId && !rowNum && fiedlId === data.listData.currentEventField.id) {
189
190
  //data.field = data.listData.currentEventField;
@@ -191,32 +192,32 @@ const formData = {
191
192
  rowNum = rowNum ? rowNum : data.listData.currentRowIndex;
192
193
 
193
194
  if (data) {
194
- if (data.field) {
195
- data.field.source[attrName] = value;
196
- data.listData.updateListField(data.listData.refFieldsLabel, rowNum, fiedlId);
197
- }
198
- //data.field.self.$forceUpdate();
199
-
200
- //正在编辑的行
201
- if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && data.listData.currentRow.data.$sourceIndex === rowNum) {
202
- let currentField = data.listData.currentRow.data[fiedlId];
203
- currentField.source[attrName] = value;
204
- //校验自己
205
- if (currentField.self && currentField.self.validExcute) {
206
- currentField.self.validExcute();
195
+ if (data.field) {
196
+ data.field.source[attrName] = value;
197
+ data.listData.updateListField(data.listData.refFieldsLabel, rowNum, fiedlId);
207
198
  }
208
- if (typeof currentField.self.$forceUpdate === "function") {
209
- currentField.self.$forceUpdate();
199
+ //data.field.self.$forceUpdate();
200
+
201
+ //正在编辑的行
202
+ if (data.listData.currentRow.data && data.listData.currentRow.data[fiedlId] && data.listData.currentRow.data.$sourceIndex === rowNum) {
203
+ let currentField = data.listData.currentRow.data[fiedlId];
204
+ currentField.source[attrName] = value;
205
+ //校验自己
206
+ if (currentField.self && currentField.self.validExcute) {
207
+ currentField.self.validExcute();
208
+ }
209
+ if (typeof currentField.self.$forceUpdate === "function") {
210
+ currentField.self.$forceUpdate();
211
+ }
210
212
  }
211
- }
212
213
 
213
- //如果有汇总列,触发重新计算汇总
214
- if (data.listData.showSummary) {
215
- data.listData.tableData.push({});
216
- data.listData.tableData.pop();
217
- }
214
+ //如果有汇总列,触发重新计算汇总
215
+ if (data.listData.showSummary) {
216
+ data.listData.tableData.push({});
217
+ data.listData.tableData.pop();
218
+ }
218
219
 
219
- return true;
220
+ return true;
220
221
  }
221
222
  return false;
222
223
  },
@@ -227,6 +228,28 @@ const formData = {
227
228
  });
228
229
  listData[attrName] = attrValue
229
230
  },
231
+ //新增表格数据
232
+ insertRow(tableId,rows) {
233
+ let listData = this.excuteListData.find((v) => {
234
+ return v.id === tableId;
235
+ });
236
+ listData.insertRow(rows);
237
+ },
238
+ //新增或替换表格数据
239
+ insertOrUpdateRow(tableId,row) {
240
+ let listData = this.excuteListData.find((v) => {
241
+ return v.id === tableId;
242
+ });
243
+ listData.insertOrUpdateRow(row);
244
+ },
245
+ //清空表格数据
246
+ clear(tableId) {
247
+ let listData = this.excuteListData.find((v) => {
248
+ return v.id === tableId;
249
+ });
250
+ listData.deleteAll();
251
+ },
252
+
230
253
  //获取后台数据,并返回脚本。
231
254
  execServerScript(action, object, successCallback) {
232
255
  let formData = this;//作用域保存
@@ -276,11 +299,6 @@ const formData = {
276
299
  showClose: showClose,//是否显示关闭按钮
277
300
  });
278
301
  },
279
- //打开商铺房源详情页
280
- openPropertyDetailRET(parm){
281
- let title=parm.field.pageTitle==undefined ?parm.field.label:parm.field.pageTitle;
282
- common.getDataDrivenOpts().handler.openPropertyDetailRET(parm.submitData, title,this.form);
283
- },
284
302
  };
285
303
 
286
304
  if (typeof window !== 'undefined' && window.Vue) {
@@ -38,6 +38,9 @@ const Button = function (source, router) {
38
38
  },
39
39
  icon:'',
40
40
  };
41
+ if(router){
42
+ rtn=base.copy(rtn,router);
43
+ }
41
44
  rtn = base.copy(Base(source), rtn);
42
45
  return rtn;
43
46
  }
@@ -0,0 +1,135 @@
1
+ import Vue from 'vue';
2
+ import Enum from './lib/Enum';
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
+
56
+ }
57
+ else {
58
+ _styleObject.width = source.width + "px";
59
+ _styleObject.flex = "0 0 "+source.width + "px";
60
+ }
61
+ }
62
+ if (typeof source.height !== 'undefined') {
63
+ if (source.height == "0") {
64
+ _styleObject.height = "100%";
65
+ }
66
+ else if (source.height == "-1") {
67
+ }
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";
81
+ }
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"
101
+ }
102
+ else {
103
+ _styleObject.alignItems = source.align;
104
+ }
105
+
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);
119
+ }
120
+ }
121
+ else {
122
+ if (failCallBack) {
123
+ failCallBack();
124
+ }
125
+ }
126
+ }
127
+ );
128
+ }
129
+ else {
130
+ var data = source;
131
+ return init(data);
132
+ }
133
+ };
134
+
135
+ export default CellLayout;