lambo-design-bi 0.0.228 → 0.0.229

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.
@@ -200,6 +200,25 @@ export default {
200
200
  link.click();
201
201
  document.body.removeChild(link);
202
202
  },
203
+ getRankIcon(rank) {
204
+ if (rank === 1) return '🥇'
205
+ if (rank === 2) return '🥈'
206
+ if (rank === 3) return '🥉'
207
+ return rank
208
+ },
209
+ getRankTableIndex(index, row) {
210
+ const rowIndex = typeof index === 'number' ? index : row._index
211
+ const table = this.$refs.table || {}
212
+ const pageSize = Number(table.limitNumber || this.widget.options.pageSize) || 0
213
+ const currentPage = table.currentPage || 1
214
+ return pageSize ? (currentPage - 1) * pageSize + rowIndex + 1 : rowIndex + 1
215
+ },
216
+ isRankTable() {
217
+ return String(this.widget.options.tableType) === '2'
218
+ },
219
+ isRankColumn(column) {
220
+ return this.isRankTable() && (column.type === 'index' || column.key === 'index' || column.title === '序号')
221
+ },
203
222
  renderCellContent(h, params) {
204
223
  const key = params.column.key
205
224
  const children = [params.row[key]]
@@ -262,6 +281,10 @@ export default {
262
281
  try {
263
282
  columns = JSON.parse(this.widget.options.columns)
264
283
  columns.forEach((column) => {
284
+ if (this.isRankColumn(column)) {
285
+ column.type = 'index'
286
+ column.indexMethod = (row, index) => this.getRankIcon(this.getRankTableIndex(index, row))
287
+ }
265
288
  if (column.detailName) {
266
289
  let self = this
267
290
  column.render = function (h, params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.228",
3
+ "version": "0.0.229",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",
@@ -204,6 +204,9 @@ export default {
204
204
  </script>
205
205
  <style scoped lang="less">
206
206
  .ivu-number-info-value-lambo {
207
+ font-family: var("DIN Alternate", "Roboto Mono", Menlo, Consolas, monospace);
208
+ font-variant-numeric: tabular-nums;
209
+ font-feature-settings: "tnum";
207
210
  margin-top: 4px;
208
211
  overflow: hidden;
209
212
  font-size: 0;