lambo-design-bi 0.0.222 → 0.0.224

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.
@@ -2,7 +2,8 @@
2
2
  <lambo-indicator-card-bi
3
3
  :has-title="(widget.options && widget.options.title && widget.options.title.length > 0) ? true : false">
4
4
  <template slot="content-title" v-if="(widget.options.title && widget.options.title.length > 0)">
5
- {{ widget.options.title }}
5
+ <div>{{ widget.options.title }}</div>
6
+ <div class="card-subtitle" v-if="subTitle">{{ subTitle }}</div>
6
7
  </template>
7
8
  <div :style="containerStyle || {}">
8
9
  <div v-for="(item, index) in widget.widgets" :key="index">
@@ -36,13 +37,20 @@ export default {
36
37
  data() {
37
38
  return {
38
39
  containerStyle: {},
40
+ subTitle: null
39
41
  }
40
42
  },
41
43
  methods: {
42
44
  getWidgetName,
43
45
  initConfig() {
44
- this.containerStyle = parseStyleStr(this.widget.options.style || {}) || {}
45
- console.log("ContainerCard this.containerStyle:", this.containerStyle)
46
+ if (this.widget.options) {
47
+ if (Object.prototype.hasOwnProperty.call(this.widget.options, "subTitle")) {
48
+ this.subTitle = this.widget.options["subTitle"] || ''
49
+ }
50
+ if (Object.prototype.hasOwnProperty.call(this.widget.options, "style")) {
51
+ this.containerStyle = parseStyleStr(this.widget.options["style"] || {}) || {}
52
+ }
53
+ }
46
54
  }
47
55
  },
48
56
  created() {
@@ -54,4 +62,11 @@ export default {
54
62
  }
55
63
  }
56
64
  </script>
57
- <style scoped></style>
65
+ <style scoped>
66
+ .card-subtitle {
67
+ margin-top: 2px;
68
+ color: #999;
69
+ font-size: 12px;
70
+ line-height: 1.4;
71
+ }
72
+ </style>
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div style="width: 100%">
3
3
  <LamboPagingTableBi ref="table" :auto-search="false" :columns="columns" :dataUrl="widget.options.url"
4
- :show-table-option="true" :exportName="widget.name" :page-disable="widget.options.isPaging === '0'"
5
- :page-size="widget.options.pageSize" :export-request-limit="200" :isSingleSelectModel="true"
6
- :showSummary="widget.options.isAllSum === '1'" :summary-method="handleSummary" @on-data-load="onDataLoad"
7
- :searchParams="tableSearchParams" :show-right-context-menu="hasRightContextMenu">
4
+ :border="tableBorder" :show-table-option="true" :exportName="widget.name"
5
+ :page-disable="widget.options.isPaging === '0'" :page-size="widget.options.pageSize" :export-request-limit="200"
6
+ :isSingleSelectModel="true" :showSummary="widget.options.isAllSum === '1'" :summary-method="handleSummary"
7
+ @on-data-load="onDataLoad" :searchParams="tableSearchParams" :show-right-context-menu="hasRightContextMenu">
8
8
  <div slot="search"></div>
9
9
  </LamboPagingTableBi>
10
10
  <Modal v-model="boxShow" :title="previewFileName" :width="modelWidth" :styles="{ top: '60px' }"
@@ -54,7 +54,8 @@ export default {
54
54
  previewFileType: '',
55
55
  previewFileName: '',
56
56
  boxShow: false,
57
- modelWidth: '78%'
57
+ modelWidth: '78%',
58
+ tableBorder: true
58
59
  }
59
60
  },
60
61
  methods: {
@@ -185,12 +186,42 @@ export default {
185
186
  link.click();
186
187
  document.body.removeChild(link);
187
188
  },
189
+ renderCellContent(h, params) {
190
+ const key = params.column.key
191
+ const children = [params.row[key]]
192
+ if (params.column.isTrend) {
193
+ const increaseValue = params.row[key + '_increase']
194
+ const positiveValue = params.row[key + '_positive']
195
+ const trendText = increaseValue === '1' ? '↑' : increaseValue === '0' ? '↓' : ''
196
+ if (trendText) {
197
+ const trendStyle = {
198
+ marginLeft: '4px',
199
+ fontWeight: 'bold'
200
+ }
201
+ if (positiveValue === 1 || positiveValue === '1') {
202
+ trendStyle.color = '#19be6b'
203
+ } else if (positiveValue === 0 || positiveValue === '0') {
204
+ trendStyle.color = '#ed4014'
205
+ }
206
+ children.push(h('span', { style: trendStyle }, trendText))
207
+ }
208
+ }
209
+ return children
210
+ },
188
211
  onClose() {
189
212
  this.boxShow = false
213
+ },
214
+ initConfig() {
215
+ if (this.widget && this.widget.options && Object.prototype.hasOwnProperty.call(this.widget.options, "tableType")) {
216
+ if (this.widget.options["tableType"] !== '0') {
217
+ this.tableBorder = false
218
+ }
219
+ }
190
220
  }
191
221
  },
192
222
  created() {
193
223
  console.log("BiPagingTable -- created() -- this.widget:", this.widget)
224
+ this.initConfig()
194
225
  },
195
226
  mounted() {
196
227
  this.doSearch()
@@ -215,7 +246,7 @@ export default {
215
246
  },
216
247
  },
217
248
  },
218
- params.row[params.column.key]
249
+ self.renderCellContent(h, params)
219
250
  )
220
251
  }
221
252
  } else if (column.isFile) {
@@ -231,9 +262,14 @@ export default {
231
262
  },
232
263
  },
233
264
  },
234
- params.row[params.column.key]
265
+ self.renderCellContent(h, params)
235
266
  )
236
267
  }
268
+ } else if (column.isTrend) {
269
+ let self = this
270
+ column.render = function (h, params) {
271
+ return h('span', self.renderCellContent(h, params))
272
+ }
237
273
  }
238
274
  })
239
275
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.222",
3
+ "version": "0.0.224",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",