centaline-data-driven 1.2.73 → 1.2.76

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.
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div v-if="model.routerKey" :style="model.styleObject">
3
+ <a href="javascript:void(0);" @click="clickHandler($event)" class="ct-tablecurrencyItem">
4
+ {{model.value}}
5
+ </a>
6
+ </div>
7
+ <div v-else :style="model.styleObject" v-html="model.value">
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import dynamicElement from '../../mixins/dynamicElement'
13
+ export default {
14
+ name: 'ct-layoutlabel',
15
+ mixins: [dynamicElement],
16
+ props: {
17
+ vmodel: Object,
18
+ rowindex: Number
19
+ },
20
+ data() {
21
+ return {
22
+ }
23
+ },
24
+ created() {
25
+ this.model = this.loaderObj.CellLayout(this.vmodel);
26
+ },
27
+
28
+ methods: {
29
+ clickHandler(ev) {
30
+ this.$emit('click', this.model.routerKey, this.rowindex);
31
+ }
32
+ },
33
+ computed: {
34
+
35
+ }
36
+ }
37
+ </script>
38
+ <style>
39
+ .ct-tablecurrencyItem {
40
+ text-decoration: none;
41
+ padding-left: 0px;
42
+ padding-right: 4px;
43
+ cursor: pointer;
44
+ color: #388cd3;
45
+ }
46
+
47
+ .ct-tablecurrencyItem:hover {
48
+ color: #23527c;
49
+ }
50
+
51
+ .ct-tablecurrencyImg {
52
+ width: 24px;
53
+ margin-top: 2px;
54
+ }
55
+ </style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div :style="model.styleObject"></div>
3
+ </template>
4
+
5
+ <script>
6
+ import dynamicElement from '../../mixins/dynamicElement'
7
+ export default {
8
+ name: 'ct-layoutline',
9
+ mixins: [dynamicElement],
10
+ props: {
11
+ vmodel: Object,
12
+ rowindex: Number
13
+ },
14
+ data() {
15
+ return {
16
+ }
17
+ },
18
+ created() {
19
+ this.model = this.loaderObj.CellLayout(this.vmodel);
20
+ },
21
+
22
+ methods: {
23
+
24
+ },
25
+ computed: {
26
+
27
+ }
28
+ }
29
+ </script>
@@ -17,7 +17,7 @@
17
17
  @rowClickHandle="rowClickHandle"
18
18
  @showTitle="showTitleHandler"></ct-searchtable>
19
19
  </div>
20
- <div v-if="flagSideBar && flagSideBarOfData"
20
+ <div ref="sidebar" v-if="flagSideBar && flagSideBarOfData"
21
21
  :style="{'height': pageHeight? pageHeight:'100%','width':sideBarWidth+'px',right:sideBarRight+'px'}"
22
22
  class="sidebar">
23
23
  <ct-Detail ref="detail" :api="sideBarApi" :apiParam="sideBarApiParam" :pageType="sideBarPageType"
@@ -72,6 +72,15 @@
72
72
  },
73
73
  computed: {
74
74
  },
75
+ activated() {
76
+ this.$nextTick(() => {
77
+ if(this.$refs.detail){
78
+ if(this.$refs.detail.$children && this.$refs.detail.$children.length>0){
79
+ this.$refs.detail.$children[0].refreshPage();
80
+ }
81
+ }
82
+ })
83
+ },
75
84
  data() {
76
85
  return {
77
86
  loaded: {
@@ -200,6 +209,7 @@
200
209
  }
201
210
  }
202
211
  }
212
+ this.$emit('tableLoaded', this.$refs.table.model);
203
213
  },
204
214
  rowClickHandle() {
205
215
  var self = this;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div style="width:100%;" class="ct-searchtable" ref="searchTable">
2
+ <div style="width:100%;" class="ct-searchtable" ref="searchTable" :style="{'margin-top':isLayout?'0':'','padding':isLayout?'0':''}">
3
3
  <ct-tableStats ref="tableStats" class="ct-search-table-list-header"
4
4
  v-if="!isLoading&&searchStatsApi"
5
5
  :api="searchStatsApi"
@@ -16,24 +16,25 @@
16
16
  <div v-loading="operationLoading">
17
17
  </div>
18
18
  <div class="ct-tableParent" ref="tableParent" v-bind="model.attrs" v-if="!isLoading"
19
- :style="{'height':from=='form'?'100%':model.tableHeight+'px'}"
19
+ :style="{'height':from=='form'?'100%':model.tableHeight+'px','border-bottom':isLayout?'none':''}"
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,14 @@
131
133
  </tbody>
132
134
  </table>
133
135
  </div>
136
+ <div v-else>
137
+ <div v-for="(row,rowindex) in model.listData" :key="rowindex">
138
+ <ct-layout :vmodel="row" :cellLayout="model.cellLayout" :rowindex="rowindex" :actionRouter="model.actionRouter"></ct-layout>
139
+ </div>
140
+ </div>
134
141
  </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>
142
+ <ct-tabletip ref="listFooter" class="ct-search-table-list-footer" :tip="model.listFooter" v-if="!isLoading&&!isLayout"></ct-tabletip>
143
+ <ct-tabletip ref="footer" class="ct-search-table-footer" :tip="model.footer" v-if="!isLoading&&!isLayout"></ct-tabletip>
137
144
  <div v-if="isLoading && searchLoading" v-loading="isLoading" style="top:30px;">
138
145
  </div>
139
146
  </div>
@@ -143,13 +150,15 @@
143
150
  import dynamicTableTip from './dynamicTableTip.vue';
144
151
  import dynamicTableToolbar from './dynamicTableToolbar.vue';
145
152
  import dynamicTableStats from './dynamicTableStats.vue';
153
+ import dynamicLayout from '../../dynamicLayout/src/dynamicLayout.vue';
146
154
  export default {
147
155
  name: 'ct-searchtable',
148
156
  mixins: [dynamicElement],
149
157
  components: {
150
158
  'ct-tabletip': dynamicTableTip,
151
159
  'ct-tabletoolbar': dynamicTableToolbar,
152
- 'ct-tableStats': dynamicTableStats
160
+ 'ct-tableStats': dynamicTableStats,
161
+ 'ct-layout': dynamicLayout
153
162
  },
154
163
  props: {
155
164
  vmodel: Object,
@@ -171,6 +180,7 @@
171
180
  return {
172
181
  currentTh: null,
173
182
  isLoading: true,
183
+ isLayout: false,
174
184
  searchLoading: true,
175
185
  tableLoading: false,//表格等待
176
186
  operationLoading: false,//操作等待
@@ -229,7 +239,9 @@
229
239
  self.colHasWidth[vi] = 'nowidth';
230
240
  }
231
241
  });
232
-
242
+ if (typeof self.model.cellLayout !== 'undefined') {
243
+ self.isLayout = true;
244
+ }
233
245
  self.isLoading = false;
234
246
  self.$forceUpdate();
235
247
  this.model.scripts.formData = this.model.formData;
@@ -520,20 +532,36 @@
520
532
  setTableHeight() {
521
533
  var self = this;
522
534
  this.$nextTick(() => {
523
- if (this.$refs.searchTable && this.$refs.toolbar && this.$refs.searchTable.parentElement) {
535
+ if (this.$refs.searchTable && this.$refs.toolbar && this.$refs.searchTable.parentElement && !self.isLayout) {
524
536
  var h1 = this.$refs.searchTable.parentElement.offsetHeight | 0;
525
537
  var h2 = this.$refs.searchTable.offsetTop | 0;
526
538
  var h3 = this.$refs.toolbar.$el.offsetHeight | 0;
527
539
  var h4 = this.$refs.footer.$el.offsetHeight | 0;
528
540
  var h5 = this.$refs.listHeader.$el.offsetHeight | 0;
529
541
  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;
542
+ var h7 = this.$refs.tableStats ? (this.$refs.tableStats.$el.offsetHeight + 7 | 0) : 0;
543
+ let tableHeight = h1 - h2 - h3 - h4 - h5 - h6 - h7 - 22;
532
544
  this.model.tableHeight = tableHeight < 40 ? 350 : tableHeight;
533
545
  this.$nextTick(() => {
534
546
  self.getScrollAttr();
535
547
  });
536
548
  }
549
+ else {
550
+ if (this.$parent.$parent.$vnode.componentOptions.tag === 'ct-PropertySimpleDetailRET') {
551
+ var h1 = this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight | 0;
552
+ var h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
553
+ var h3 = this.$parent.$parent.$refs.title.offsetHeight | 0;
554
+ let tableHeight = h1 - h2 - h3 - 270;
555
+ if (h2 == 0) {
556
+ tableHeight = tableHeight + 15;
557
+ }
558
+ this.model.tableHeight = tableHeight;
559
+ this.$nextTick(() => {
560
+ self.getScrollAttr();
561
+ });
562
+ }
563
+
564
+ }
537
565
  });
538
566
  },
539
567
  scrollHandle(ev) {
@@ -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) {
@@ -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;