lambo-design-bi 0.0.159 → 0.0.161

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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <LamboNumberInfoBi :title="title" :sub-title="subTitle" :num="num" :sub-num1="subNum1" :trend1="trend1"
3
- :sub-num2="subNum2" :trend2="trend2">
3
+ :sub-num2="subNum2" :trend2="trend2" :polar1="polar1" :polar2="polar2">
4
4
  </LamboNumberInfoBi>
5
5
  </template>
6
6
  <script>
@@ -28,8 +28,10 @@ export default {
28
28
  num: null,
29
29
  subNum1: null,
30
30
  trend1: null,
31
+ polar1: null,
31
32
  subNum2: null,
32
- trend2: null
33
+ trend2: null,
34
+ polar2: null
33
35
  }
34
36
  },
35
37
  methods: {
@@ -55,6 +57,12 @@ export default {
55
57
  this.trend1 = row['trend1']
56
58
  this.subNum2 = row['sub_num2']
57
59
  this.trend2 = row['trend2']
60
+ if (Object.prototype.hasOwnProperty.call(row, 'polar1')) {
61
+ this.polar1 = row['polar1']
62
+ }
63
+ if (Object.prototype.hasOwnProperty.call(row, 'polar2')) {
64
+ this.polar2 = row['polar2']
65
+ }
58
66
  }
59
67
  }
60
68
  }
@@ -212,6 +212,6 @@ export default {
212
212
  display: none
213
213
  }
214
214
  .lambo-query-class {
215
- width: 200px;
215
+ width: 250px;
216
216
  }
217
217
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.159",
3
+ "version": "0.0.161",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",
@@ -14,15 +14,25 @@
14
14
  <slot name="subNum">
15
15
  <template v-if="subNum1">
16
16
  <template v-if="trend1">
17
- <Trend :flag="trend1" text-color>{{ subNum1 }}</Trend>
17
+ <template v-if="polar1 === 'pos'">
18
+ <Trend :flag="trend1" text-color reverse-color>{{ subNum1 }}</Trend>
19
+ </template>
20
+ <template v-else>
21
+ <Trend :flag="trend1" text-color>{{ subNum1 }}</Trend>
22
+ </template>
18
23
  </template>
19
24
  <template v-else>
20
25
  {{ subNum1 }}
21
26
  </template>
22
27
  </template>
23
28
  <template v-if="subNum2">
24
- <template v-if="trend1">
25
- <Trend :flag="trend2" text-color>{{ subNum2 }}</Trend>
29
+ <template v-if="trend2">
30
+ <template v-if="polar2 === 'pos'">
31
+ <Trend :flag="trend2" text-color reverse-color>{{ subNum2 }}</Trend>
32
+ </template>
33
+ <template v-else>
34
+ <Trend :flag="trend2" text-color>{{ subNum2 }}</Trend>
35
+ </template>
26
36
  </template>
27
37
  <template v-else>
28
38
  {{ subNum2 }}
@@ -59,6 +69,13 @@ export default {
59
69
  return oneOf(value, ['up', 'down']);
60
70
  }
61
71
  },
72
+ polar1: {
73
+ type: String,
74
+ required: false,
75
+ validator(value) {
76
+ return !value || ['pos', 'neg'].includes(value);
77
+ }
78
+ },
62
79
  subNum2: {
63
80
  type: [String, Number]
64
81
  },
@@ -67,6 +84,13 @@ export default {
67
84
  return oneOf(value, ['up', 'down']);
68
85
  }
69
86
  },
87
+ polar2: {
88
+ type: String,
89
+ required: false,
90
+ validator(value) {
91
+ return !value || ['pos', 'neg'].includes(value);
92
+ }
93
+ },
70
94
  gap: {
71
95
  type: [String, Number],
72
96
  default: 6
@@ -92,6 +116,7 @@ export default {
92
116
  display: flex;
93
117
  flex-direction: column;
94
118
  }
119
+
95
120
  .ivu-number-info-title-lambo {
96
121
  margin-bottom: 9px;
97
122
  color: #17233d;