lambo-design-bi 0.0.182 → 0.0.183

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.
@@ -107,7 +107,7 @@ export default {
107
107
  if (rows && rows.length > 0) {
108
108
  let rowData = rows[0]
109
109
  if(rowData && Object.prototype.hasOwnProperty.call(rowData, "val")){
110
- this.chartsNote = rowData["val"]
110
+ this.chartsNote = rowData["val"] || ''
111
111
  }
112
112
  }
113
113
  } else {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <LamboNumberInfoBi :title="title" :sub-title="subTitle" :num="num" :sub-num1="subNum1" :trend1="trend1"
3
- :is-drill="isDrill" @on-drill="onDrill" :sub-num2="subNum2" :trend2="trend2" :polar1="polar1" :polar2="polar2">
3
+ :is-drill="isDrill" @on-drill="onDrill" :sub-num2="subNum2" :trend2="trend2" :polar1="polar1" :polar2="polar2" :eva-level="evaLevel">
4
4
  </LamboNumberInfoBi>
5
5
  </template>
6
6
  <script>
@@ -41,7 +41,8 @@ export default {
41
41
  drillK2: null,
42
42
  drillV2: null,
43
43
  drillK3: null,
44
- dirllV3: null
44
+ dirllV3: null,
45
+ evaLevel: null
45
46
  }
46
47
  },
47
48
  methods: {
@@ -90,6 +91,9 @@ export default {
90
91
  this.drillK3 = row['drill_k3'] || ''
91
92
  this.drillV3 = row['drill_v3'] || ''
92
93
  }
94
+ if (Object.prototype.hasOwnProperty.call(row, 'eva_level')) {
95
+ this.evaLevel = row['eva_level'] || ''
96
+ }
93
97
  }
94
98
  }
95
99
  }
@@ -8,7 +8,7 @@ import BiRow2 from "../layout/row2.vue"
8
8
  import BiCol from "../layout/col.vue"
9
9
  import BiDetailTable from "../table/detail-table.vue"
10
10
  import BiCharts from "../charts/index.vue"
11
- import BiTextGroup from '../text/text-group.vue';
11
+ import BiTextGroup from '../text/text-group.vue'
12
12
 
13
13
  /**
14
14
  * Strictly define the order to prevent circular references. For component reuse, copy new components instead of direct references.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambo-design-bi",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "description": "Vue2 BI 数据可视化组件库",
5
5
  "main": "index.js",
6
6
  "author": "finch",
@@ -1,158 +1,187 @@
1
- <template>
2
- <div class="ivu-number-info">
3
- <div class="ivu-number-info-title-lambo title-div" :class="{ 'isDrill': isDrill }" v-if="title || $slots.title"
4
- @click="drill">
5
- <slot name="title">{{ title }}</slot>
6
- <Icon v-if="isDrill" type="ios-redo-outline" />
7
- </div>
8
- <div v-if="subTitle" class="ivu-number-info-subTitle">
9
- <slot name="subTitle">{{ subTitle }}</slot>
10
- </div>
11
- <div class="ivu-number-info-value-lambo" :style="valueStyle">
12
- <span class="ivu-number-info-total">
13
- <slot name="num">{{ num }}</slot>
14
- </span>
15
- <span class="ivu-number-info-subTotal" v-if="subNum1 || subNum2">
16
- <slot name="subNum">
17
- <template v-if="subNum1">
18
- <template v-if="trend1">
19
- <template v-if="polar1 === 'pos'">
20
- <Trend :flag="trend1" text-color reverse-color>{{ subNum1 }}</Trend>
21
- </template>
22
- <template v-else>
23
- <Trend :flag="trend1" text-color>{{ subNum1 }}</Trend>
24
- </template>
25
- </template>
26
- <template v-else>
27
- {{ subNum1 }}
28
- </template>
29
- </template>
30
- <template v-if="subNum2">
31
- <template v-if="trend2">
32
- <template v-if="polar2 === 'pos'">
33
- <Trend :flag="trend2" text-color reverse-color>{{ subNum2 }}</Trend>
34
- </template>
35
- <template v-else>
36
- <Trend :flag="trend2" text-color>{{ subNum2 }}</Trend>
37
- </template>
38
- </template>
39
- <template v-else>
40
- {{ subNum2 }}
41
- </template>
42
- </template>
43
- </slot>
44
- </span>
45
- </div>
46
- </div>
47
- </template>
48
- <script>
49
- import { oneOf } from 'view-ui-plus/src/utils/assist'
50
- import Trend from 'view-ui-plus/src/components/trend'
51
- import 'view-ui-plus/dist/styles/viewuiplus.css'
52
-
53
- export default {
54
- name: 'LamboNumberInfoBi',
55
- components: { Trend },
56
- props: {
57
- title: {
58
- type: String
59
- },
60
- subTitle: {
61
- type: String,
62
- default: ''
63
- },
64
- num: {
65
- type: [String, Number]
66
- },
67
- subNum1: {
68
- type: [String, Number]
69
- },
70
- trend1: {
71
- validator(value) {
72
- return oneOf(value, ['up', 'down']);
73
- }
74
- },
75
- polar1: {
76
- type: String,
77
- required: false,
78
- validator(value) {
79
- return !value || ['pos', 'neg'].includes(value);
80
- }
81
- },
82
- subNum2: {
83
- type: [String, Number]
84
- },
85
- trend2: {
86
- validator(value) {
87
- return oneOf(value, ['up', 'down']);
88
- }
89
- },
90
- polar2: {
91
- type: String,
92
- required: false,
93
- validator(value) {
94
- return !value || ['pos', 'neg'].includes(value);
95
- }
96
- },
97
- gap: {
98
- type: [String, Number],
99
- default: 6
100
- },
101
- isDrill: {
102
- type: Boolean,
103
- default: false
104
- }
105
- },
106
- computed: {
107
- valueStyle() {
108
- return {
109
- 'margin-top': this.gap + 'px'
110
- };
111
- }
112
- },
113
- methods: {
114
- drill() {
115
- if (this.isDrill) {
116
- console.log("number-info 点击了下钻按钮")
117
- this.$emit('on-drill', {})
118
- }
119
- }
120
- }
121
- };
122
- </script>
123
- <style scoped lang="less">
124
- .ivu-number-info-value-lambo {
125
- margin-top: 4px;
126
- overflow: hidden;
127
- font-size: 0;
128
- white-space: nowrap;
129
- text-overflow: ellipsis;
130
- word-break: break-all;
131
- display: flex;
132
- flex-direction: column;
133
- }
134
-
135
- .ivu-number-info-title-lambo {
136
- margin-bottom: 9px;
137
- color: #17233d;
138
- font-size: 16px;
139
- -webkit-transition: all .2s;
140
- transition: all .2s
141
- }
142
-
143
- .title-div {
144
- display: flex;
145
- justify-content: space-between;
146
- align-items: center;
147
- transition: all 0.2s ease;
148
- border-radius: 5px;
149
- }
150
-
151
- .title-div.isDrill {
152
- cursor: pointer;
153
- }
154
-
155
- .title-div.isDrill:hover {
156
- transform: scale(1.02);
157
- }
158
- </style>
1
+ <template>
2
+ <div class="ivu-number-info">
3
+ <div class="ivu-number-info-title-lambo title-div" :class="{ 'isDrill': isDrill }" v-if="title" @click="drill">
4
+ <slot name="title">{{ title }}</slot>
5
+ <div class="cd-right-top">
6
+ <Icon v-if="isDrill" type="ios-redo-outline" />
7
+
8
+ <img class="badge-img" v-if="evaLevel == 'high'"
9
+ src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M32 0 L32 32 L0 0 Z' fill='%2321DA2E'/%3E%3Ctext x='24' y='12' font-size='12' font-weight='bold' text-anchor='end' fill='white' font-family='system-ui, sans-serif'%3E优%3C/text%3E%3C/svg%3E"
10
+ alt="优">
11
+ <img class="badge-img" v-if="evaLevel == 'mid'"
12
+ src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M32 0 L32 32 L0 0 Z' fill='%231E58F8'/%3E%3Ctext x='24' y='12' font-size='12' font-weight='bold' text-anchor='end' fill='white' font-family='system-ui, sans-serif'%3E中%3C/text%3E%3C/svg%3E"
13
+ alt="中">
14
+ <img class="badge-img" v-if="evaLevel == 'low'"
15
+ src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M32 0 L32 32 L0 0 Z' fill='%23ff9900'/%3E%3Ctext x='24' y='12' font-size='12' font-weight='bold' text-anchor='end' fill='white' font-family='system-ui, sans-serif'%3E低%3C/text%3E%3C/svg%3E"
16
+ alt="低">
17
+ </div>
18
+
19
+ </div>
20
+ <div v-if="subTitle" class="ivu-number-info-subTitle">
21
+ <slot name="subTitle">{{ subTitle }}</slot>
22
+ </div>
23
+ <div class="ivu-number-info-value-lambo" :style="valueStyle">
24
+ <span class="ivu-number-info-total">
25
+ <slot name="num">{{ num }}</slot>
26
+ </span>
27
+ <span class="ivu-number-info-subTotal" v-if="subNum1 || subNum2">
28
+ <slot name="subNum">
29
+ <template v-if="subNum1">
30
+ <template v-if="trend1">
31
+ <template v-if="polar1 === 'pos'">
32
+ <Trend :flag="trend1" text-color reverse-color>{{ subNum1 }}</Trend>
33
+ </template>
34
+ <template v-else>
35
+ <Trend :flag="trend1" text-color>{{ subNum1 }}</Trend>
36
+ </template>
37
+ </template>
38
+ <template v-else>
39
+ {{ subNum1 }}
40
+ </template>
41
+ </template>
42
+ <template v-if="subNum2">
43
+ <template v-if="trend2">
44
+ <template v-if="polar2 === 'pos'">
45
+ <Trend :flag="trend2" text-color reverse-color>{{ subNum2 }}</Trend>
46
+ </template>
47
+ <template v-else>
48
+ <Trend :flag="trend2" text-color>{{ subNum2 }}</Trend>
49
+ </template>
50
+ </template>
51
+ <template v-else>
52
+ {{ subNum2 }}
53
+ </template>
54
+ </template>
55
+ </slot>
56
+ </span>
57
+ </div>
58
+ </div>
59
+ </template>
60
+ <script>
61
+ import { oneOf } from 'view-ui-plus/src/utils/assist'
62
+ import Trend from 'view-ui-plus/src/components/trend'
63
+ import 'view-ui-plus/dist/styles/viewuiplus.css'
64
+
65
+ export default {
66
+ name: 'LamboNumberInfoBi',
67
+ components: { Trend },
68
+ props: {
69
+ title: {
70
+ type: String
71
+ },
72
+ subTitle: {
73
+ type: String,
74
+ default: ''
75
+ },
76
+ num: {
77
+ type: [String, Number]
78
+ },
79
+ subNum1: {
80
+ type: [String, Number]
81
+ },
82
+ trend1: {
83
+ validator(value) {
84
+ return oneOf(value, ['up', 'down']);
85
+ }
86
+ },
87
+ polar1: {
88
+ type: String,
89
+ required: false,
90
+ validator(value) {
91
+ return !value || ['pos', 'neg'].includes(value);
92
+ }
93
+ },
94
+ subNum2: {
95
+ type: [String, Number]
96
+ },
97
+ trend2: {
98
+ validator(value) {
99
+ return oneOf(value, ['up', 'down']);
100
+ }
101
+ },
102
+ polar2: {
103
+ type: String,
104
+ required: false,
105
+ validator(value) {
106
+ return !value || ['pos', 'neg'].includes(value);
107
+ }
108
+ },
109
+ gap: {
110
+ type: [String, Number],
111
+ default: 6
112
+ },
113
+ isDrill: {
114
+ type: Boolean,
115
+ default: false
116
+ },
117
+ evaLevel: {
118
+ type: String,
119
+ default: ''
120
+ }
121
+ },
122
+ computed: {
123
+ valueStyle() {
124
+ return {
125
+ 'margin-top': this.gap + 'px'
126
+ };
127
+ }
128
+ },
129
+ methods: {
130
+ drill() {
131
+ if (this.isDrill) {
132
+ console.log("number-info 点击了下钻按钮")
133
+ this.$emit('on-drill', {})
134
+ }
135
+ }
136
+ }
137
+ };
138
+ </script>
139
+ <style scoped lang="less">
140
+ .ivu-number-info-value-lambo {
141
+ margin-top: 4px;
142
+ overflow: hidden;
143
+ font-size: 0;
144
+ white-space: nowrap;
145
+ text-overflow: ellipsis;
146
+ word-break: break-all;
147
+ display: flex;
148
+ flex-direction: column;
149
+ }
150
+
151
+ .ivu-number-info-title-lambo {
152
+ margin-bottom: 9px;
153
+ color: #17233d;
154
+ font-size: 16px;
155
+ -webkit-transition: all .2s;
156
+ transition: all .2s
157
+ }
158
+
159
+ .title-div {
160
+ display: flex;
161
+ justify-content: space-between;
162
+ align-items: center;
163
+ transition: all 0.2s ease;
164
+ border-radius: 5px;
165
+ }
166
+
167
+ .title-div.isDrill {
168
+ cursor: pointer;
169
+ }
170
+
171
+ .title-div.isDrill:hover {
172
+ transform: scale(1.02);
173
+ }
174
+
175
+ .cd-right-top {
176
+ display: flex;
177
+ justify-content: end;
178
+ }
179
+
180
+ .badge-img {
181
+ width: 32px;
182
+ height: 32px;
183
+ margin-top: -8px;
184
+ margin-right: -8px;
185
+ border-top-right-radius: 6px;
186
+ }
187
+ </style>
@@ -59,6 +59,6 @@ export default {
59
59
  padding: 20px 5px 15px 5px;
60
60
  border-radius: 5px;
61
61
  line-height: 1.6;
62
- font-size: 14px;
62
+ font-size: 15px;
63
63
  }
64
64
  </style>