Merge branch 'master-500-dev-lushangqing' into 'master-500-dev'
自定义水球组件及配置 See merge request !32
Showing
6 changed files
with
666 additions
and
4 deletions
@@ -19,7 +19,7 @@ import echarts from 'echarts'; | @@ -19,7 +19,7 @@ import echarts from 'echarts'; | ||
19 | import ECharts from 'vue-echarts' | 19 | import ECharts from 'vue-echarts' |
20 | import 'echarts/lib/chart/bar' | 20 | import 'echarts/lib/chart/bar' |
21 | import 'echarts/lib/component/tooltip' | 21 | import 'echarts/lib/component/tooltip' |
22 | -//import 'echarts-liquidfill' | 22 | +// import 'echarts-liquidfill' |
23 | // import 'echarts-gl' | 23 | // import 'echarts-gl' |
24 | Vue.component('v-chart', ECharts) | 24 | Vue.component('v-chart', ECharts) |
25 | 25 |
1 | +/* | ||
2 | + * @Descripttion: 百分比图 json | ||
3 | + * @version: | ||
4 | + * @Author: qianlishi | ||
5 | + * @Date: 2021-08-29 07:34:01 | ||
6 | + * @LastEditors: qianlishi | ||
7 | + * @LastEditTime: 2021-09-28 14:18:45 | ||
8 | + */ | ||
9 | +export const monitorCustomLiquidFillChart = { | ||
10 | + code: 'monitor-custom-liquid-fill-chart', | ||
11 | + type: 'chart', | ||
12 | + label: '水球', | ||
13 | + icon: 'iconbaifenbi', | ||
14 | + options: { | ||
15 | + // 配置 | ||
16 | + setup: [ | ||
17 | + { | ||
18 | + type: 'el-input-text', | ||
19 | + label: '图层名称', | ||
20 | + name: 'layerName', | ||
21 | + required: false, | ||
22 | + placeholder: '', | ||
23 | + value: '水球', | ||
24 | + }, | ||
25 | + { | ||
26 | + type: 'vue-color', | ||
27 | + label: '背景颜色', | ||
28 | + name: 'background', | ||
29 | + required: false, | ||
30 | + placeholder: '', | ||
31 | + value: '' | ||
32 | + }, | ||
33 | + { | ||
34 | + type: 'el-select', | ||
35 | + label: '显示', | ||
36 | + name: 'flexFlow', | ||
37 | + required: false, | ||
38 | + placeholder: '', | ||
39 | + selectOptions: [ | ||
40 | + {code: 'row', name: '横排'}, | ||
41 | + {code: 'column', name: '竖排'}, | ||
42 | + ], | ||
43 | + value: 'column' | ||
44 | + }, | ||
45 | + [ | ||
46 | + { | ||
47 | + name: '标题设置', | ||
48 | + list: [ | ||
49 | + /*{ | ||
50 | + type: 'el-select', | ||
51 | + label: '字体位置', | ||
52 | + name: 'textAlign', | ||
53 | + required: false, | ||
54 | + placeholder: '', | ||
55 | + selectOptions: [ | ||
56 | + {code: 'center', name: '居中'}, | ||
57 | + {code: 'left', name: '左对齐'}, | ||
58 | + {code: 'right', name: '右对齐'}, | ||
59 | + ], | ||
60 | + value: 'center' | ||
61 | + },*/ | ||
62 | + { | ||
63 | + type: 'el-switch', | ||
64 | + label: '是否有标题', | ||
65 | + name: 'isTitle', | ||
66 | + required: false, | ||
67 | + placeholder: '', | ||
68 | + value: true, | ||
69 | + }, | ||
70 | + { | ||
71 | + type: 'el-input-number', | ||
72 | + label: '字体大小', | ||
73 | + name: 'titleFontSize', | ||
74 | + required: false, | ||
75 | + placeholder: '', | ||
76 | + value: '16' | ||
77 | + }, | ||
78 | + { | ||
79 | + type: 'vue-color', | ||
80 | + label: '字体颜色', | ||
81 | + name: 'titleColor', | ||
82 | + required: false, | ||
83 | + placeholder: '', | ||
84 | + value: '#666' | ||
85 | + }, | ||
86 | + { | ||
87 | + type: 'el-select', | ||
88 | + label: '字体粗细', | ||
89 | + name: 'titleFontWeight', | ||
90 | + required: false, | ||
91 | + placeholder: '', | ||
92 | + selectOptions: [ | ||
93 | + {code: 'normal', name: '正常'}, | ||
94 | + {code: 'bold', name: '粗体'}, | ||
95 | + {code: 'bolder', name: '特粗体'}, | ||
96 | + {code: 'lighter', name: '细体'} | ||
97 | + ], | ||
98 | + value: 'normal' | ||
99 | + }, | ||
100 | + ] | ||
101 | + }, | ||
102 | + { | ||
103 | + name: '数值设置', | ||
104 | + list: [ | ||
105 | + { | ||
106 | + type: 'vue-color', | ||
107 | + label: '数值颜色', | ||
108 | + name: 'textNumColor', | ||
109 | + required: false, | ||
110 | + placeholder: '', | ||
111 | + value: '#666' | ||
112 | + }, | ||
113 | + { | ||
114 | + type: 'el-input-number', | ||
115 | + label: '数值字体', | ||
116 | + name: 'textNumFontSize', | ||
117 | + required: false, | ||
118 | + placeholder: '', | ||
119 | + value: 40 | ||
120 | + }, | ||
121 | + { | ||
122 | + type: 'el-select', | ||
123 | + label: '字体粗细', | ||
124 | + name: 'textNumFontWeight', | ||
125 | + required: false, | ||
126 | + placeholder: '', | ||
127 | + selectOptions: [ | ||
128 | + {code: 'normal', name: '正常'}, | ||
129 | + {code: 'bold', name: '粗体'}, | ||
130 | + {code: 'bolder', name: '特粗体'}, | ||
131 | + {code: 'lighter', name: '细体'} | ||
132 | + ], | ||
133 | + value: 'normal' | ||
134 | + }, | ||
135 | + { | ||
136 | + type: 'vue-color', | ||
137 | + label: '%号颜色', | ||
138 | + name: 'textPerColor', | ||
139 | + required: false, | ||
140 | + placeholder: '', | ||
141 | + value: '#fff' | ||
142 | + }, | ||
143 | + { | ||
144 | + type: 'el-input-number', | ||
145 | + label: '%号字体', | ||
146 | + name: 'textPerFontSize', | ||
147 | + required: false, | ||
148 | + placeholder: '', | ||
149 | + value: 20 | ||
150 | + }, | ||
151 | + { | ||
152 | + type: 'el-select', | ||
153 | + label: '字体粗细', | ||
154 | + name: 'textPerFontWeight', | ||
155 | + required: false, | ||
156 | + placeholder: '', | ||
157 | + selectOptions: [ | ||
158 | + {code: 'normal', name: '正常'}, | ||
159 | + {code: 'bold', name: '粗体'}, | ||
160 | + {code: 'bolder', name: '特粗体'}, | ||
161 | + {code: 'lighter', name: '细体'} | ||
162 | + ], | ||
163 | + value: 'normal' | ||
164 | + } | ||
165 | + ], | ||
166 | + }, | ||
167 | + | ||
168 | + { | ||
169 | + name: '圆环设置', | ||
170 | + list: [ | ||
171 | + { | ||
172 | + type: 'vue-color', | ||
173 | + label: '圆环颜色(上)', | ||
174 | + name: 'lineColor', | ||
175 | + required: false, | ||
176 | + placeholder: '', | ||
177 | + value: '#aeedf1' | ||
178 | + }, | ||
179 | + { | ||
180 | + type: 'vue-color', | ||
181 | + label: '圆环颜色(下)', | ||
182 | + name: 'lineColorDark', | ||
183 | + required: false, | ||
184 | + placeholder: '', | ||
185 | + value: '#5a8ef5' | ||
186 | + }, | ||
187 | + { | ||
188 | + type: 'el-input-number', | ||
189 | + label: '圆环宽度', | ||
190 | + name: 'lineWidth', | ||
191 | + required: false, | ||
192 | + placeholder: '', | ||
193 | + value: 3 | ||
194 | + }, | ||
195 | + { | ||
196 | + type: 'el-input-number', | ||
197 | + label: '圆球宽高', | ||
198 | + name: 'widthHeight', | ||
199 | + required: false, | ||
200 | + placeholder: '', | ||
201 | + value: '' | ||
202 | + }, | ||
203 | + ] | ||
204 | + }, | ||
205 | + { | ||
206 | + name: '渐变色', | ||
207 | + list: [ | ||
208 | + { | ||
209 | + type: 'vue-color', | ||
210 | + label: '0%处颜色', | ||
211 | + name: 'color0Start', | ||
212 | + required: false, | ||
213 | + placeholder: '', | ||
214 | + value: '#5a8ef5' | ||
215 | + }, | ||
216 | + { | ||
217 | + type: 'vue-color', | ||
218 | + label: '100%颜色', | ||
219 | + name: 'color100End', | ||
220 | + required: false, | ||
221 | + placeholder: '', | ||
222 | + value: '#aeedf1' | ||
223 | + }, | ||
224 | + { | ||
225 | + type: 'vue-color', | ||
226 | + label: '余处颜色', | ||
227 | + name: 'colorsurplus', | ||
228 | + required: false, | ||
229 | + placeholder: '', | ||
230 | + value: '#5a8ef5' | ||
231 | + }, | ||
232 | + ] | ||
233 | + } | ||
234 | + ], | ||
235 | + ], | ||
236 | + // 数据 | ||
237 | + data: [ | ||
238 | + { | ||
239 | + type: 'el-radio-group', | ||
240 | + label: '数据类型', | ||
241 | + name: 'dataType', | ||
242 | + require: false, | ||
243 | + placeholder: '', | ||
244 | + selectValue: true, | ||
245 | + selectOptions: [ | ||
246 | + { | ||
247 | + code: 'staticData', | ||
248 | + name: '静态数据', | ||
249 | + }, | ||
250 | + { | ||
251 | + code: 'dynamicData', | ||
252 | + name: '动态数据', | ||
253 | + }, | ||
254 | + ], | ||
255 | + value: 'staticData', | ||
256 | + }, | ||
257 | + { | ||
258 | + type: 'el-input-number', | ||
259 | + label: '刷新时间(毫秒)', | ||
260 | + name: 'refreshTime', | ||
261 | + relactiveDom: 'dataType', | ||
262 | + relactiveDomValue: 'dynamicData', | ||
263 | + value: 5000 | ||
264 | + }, | ||
265 | + { | ||
266 | + type: 'el-button', | ||
267 | + label: '静态数据', | ||
268 | + name: 'staticData', | ||
269 | + required: false, | ||
270 | + placeholder: '', | ||
271 | + relactiveDom: 'dataType', | ||
272 | + relactiveDomValue: 'staticData', | ||
273 | + value: [ | ||
274 | + {"num":60},{"num":80} | ||
275 | + ], | ||
276 | + }, | ||
277 | + { | ||
278 | + type: 'dycustComponents', | ||
279 | + label: '', | ||
280 | + name: 'dynamicData', | ||
281 | + required: false, | ||
282 | + placeholder: '', | ||
283 | + relactiveDom: 'dataType', | ||
284 | + chartType: 'widget-piechart', | ||
285 | + dictKey: 'TEXT_PROPERTIES', | ||
286 | + relactiveDomValue: 'dynamicData', | ||
287 | + value: '', | ||
288 | + }, | ||
289 | + ], | ||
290 | + // 坐标 | ||
291 | + position: [ | ||
292 | + { | ||
293 | + type: 'el-input-number', | ||
294 | + label: '左边距', | ||
295 | + name: 'left', | ||
296 | + required: false, | ||
297 | + placeholder: '', | ||
298 | + value: 0, | ||
299 | + }, | ||
300 | + { | ||
301 | + type: 'el-input-number', | ||
302 | + label: '上边距', | ||
303 | + name: 'top', | ||
304 | + required: false, | ||
305 | + placeholder: '', | ||
306 | + value: 0, | ||
307 | + }, | ||
308 | + { | ||
309 | + type: 'el-input-number', | ||
310 | + label: '宽度', | ||
311 | + name: 'width', | ||
312 | + required: false, | ||
313 | + placeholder: '该容器在1920px大屏中的宽度', | ||
314 | + value: 300, | ||
315 | + }, | ||
316 | + { | ||
317 | + type: 'el-input-number', | ||
318 | + label: '高度', | ||
319 | + name: 'height', | ||
320 | + required: false, | ||
321 | + placeholder: '该容器在1080px大屏中的高度', | ||
322 | + value: 400, | ||
323 | + }, | ||
324 | + ], | ||
325 | + } | ||
326 | +} |
@@ -47,6 +47,7 @@ import {monitorCustomLineStack} from "./echartsConfigJson/monitorConfigJson/moni | @@ -47,6 +47,7 @@ import {monitorCustomLineStack} from "./echartsConfigJson/monitorConfigJson/moni | ||
47 | import {monitorCustomBarLineChart} from "./echartsConfigJson/monitorConfigJson/monitor-custom-bar-line-chart"; | 47 | import {monitorCustomBarLineChart} from "./echartsConfigJson/monitorConfigJson/monitor-custom-bar-line-chart"; |
48 | import {monitorButtonGroup} from "./echartsConfigJson/monitorConfigJson/monitor-button-group"; | 48 | import {monitorButtonGroup} from "./echartsConfigJson/monitorConfigJson/monitor-button-group"; |
49 | import {monitorCustomLineTrend} from "./echartsConfigJson/monitorConfigJson/monitor-custom-line-trend"; | 49 | import {monitorCustomLineTrend} from "./echartsConfigJson/monitorConfigJson/monitor-custom-line-trend"; |
50 | +import {monitorCustomLiquidFillChart} from "./echartsConfigJson/monitorConfigJson/monitor-custom-liquid-Fill-chart"; | ||
50 | 51 | ||
51 | 52 | ||
52 | export const {widgetTool,monitor} = { | 53 | export const {widgetTool,monitor} = { |
@@ -105,6 +106,8 @@ export const {widgetTool,monitor} = { | @@ -105,6 +106,8 @@ export const {widgetTool,monitor} = { | ||
105 | //月季度年按钮 | 106 | //月季度年按钮 |
106 | monitorButtonGroup, | 107 | monitorButtonGroup, |
107 | //折线趋势图 | 108 | //折线趋势图 |
108 | - monitorCustomLineTrend | 109 | + monitorCustomLineTrend, |
110 | + //水球 | ||
111 | + monitorCustomLiquidFillChart | ||
109 | ] | 112 | ] |
110 | } | 113 | } |
1 | +<template> | ||
2 | + <div :style="styleObj" class="fillContainer"> | ||
3 | + <div class="fill-item" :style="fillItemStyle" v-for="item in fillData"> | ||
4 | + <div class="circle" :style="circleStyle"> | ||
5 | + <div class="wave"> | ||
6 | + <div class="wave1" :style="[wave1Style,topStyle(item.num)]"></div> | ||
7 | + <div class="wave-val"> | ||
8 | + <span :style="numStyle">{{ item.num }}</span><span :style="pieStyle">%</span> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + <div class="wave-title" :style="titleStyle">当前使用率</div> | ||
13 | + </div> | ||
14 | + | ||
15 | + <!-- <v-chart :options="options" autoresize/>--> | ||
16 | + </div> | ||
17 | +</template> | ||
18 | + | ||
19 | +<script> | ||
20 | +var per = 60; | ||
21 | +export default { | ||
22 | + name: "customLiquidFillChart",//百分比图参考:https://www.makeapie.com/editor.html?c=xFkzKG-bpl | ||
23 | + components: {}, | ||
24 | + props: { | ||
25 | + value: Object, | ||
26 | + ispreview: Boolean | ||
27 | + }, | ||
28 | + data() { | ||
29 | + return { | ||
30 | + // topStyle:'',//水波纹的大小 | ||
31 | + fillData:[],//数据 | ||
32 | + topNum:0,//水波纹的大小 | ||
33 | + nums:0, | ||
34 | + options: { | ||
35 | + title: { | ||
36 | + text: '{nums|' + per + '}{percent|%}', | ||
37 | + x: 'center', | ||
38 | + y: 'center', | ||
39 | + textStyle: { | ||
40 | + rich: { | ||
41 | + nums: { | ||
42 | + fontSize: 60, | ||
43 | + color: '#29EEF3', | ||
44 | + }, | ||
45 | + percent: { | ||
46 | + fontSize: 30, | ||
47 | + color: '#29EEF3', | ||
48 | + }, | ||
49 | + }, | ||
50 | + }, | ||
51 | + }, | ||
52 | + legend: { | ||
53 | + type: 'plain', | ||
54 | + orient: 'vertical', | ||
55 | + right: 0, | ||
56 | + top: '10%', | ||
57 | + align: 'auto', | ||
58 | + data: [{ | ||
59 | + name: '1', | ||
60 | + icon: "circle" | ||
61 | + }, { | ||
62 | + name: '2', | ||
63 | + icon: "circle" | ||
64 | + }, { | ||
65 | + name: '3', | ||
66 | + icon: "circle" | ||
67 | + }, { | ||
68 | + name: '4', | ||
69 | + icon: "circle" | ||
70 | + }], | ||
71 | + textStyle: { | ||
72 | + color: 'white', | ||
73 | + fontSize: 16, | ||
74 | + padding: [10, 1, 10, 0], | ||
75 | + }, | ||
76 | + selectedMode: false, | ||
77 | + }, | ||
78 | + series: [ | ||
79 | + { | ||
80 | + type: "liquidFill", | ||
81 | + data: [0.47], | ||
82 | + direction: "right", //波浪方向或者静止 | ||
83 | + radius: "80%", | ||
84 | + // 水球颜色 | ||
85 | + color: ["#00c2ff"], | ||
86 | + center: ["50%", "50%"], //水球位置 | ||
87 | + // outline 外边 | ||
88 | + outline: { | ||
89 | + // show: false | ||
90 | + borderDistance: 3, //内环padding值 | ||
91 | + itemStyle: { | ||
92 | + borderWidth: 8, //圆边线宽度 | ||
93 | + borderColor: "#00c2ff", | ||
94 | + shadowBlur: 10, | ||
95 | + shadowColor: 'rgba(63, 218, 255, 0.5)' | ||
96 | + } | ||
97 | + }, | ||
98 | + backgroundStyle: { | ||
99 | + // borderWidth: 5, | ||
100 | + // borderColor: 'rgb(255,0,255,0.9)', | ||
101 | + color: 'rgb(255,0,255,0.01)' | ||
102 | + }, | ||
103 | + label: { | ||
104 | + show: false | ||
105 | + } | ||
106 | + } | ||
107 | + ], | ||
108 | + }, | ||
109 | + optionsStyle: {}, // 样式 | ||
110 | + optionsData: {}, // 数据 | ||
111 | + optionsCollapse: {}, // 图标属性 | ||
112 | + optionsSetup: {} | ||
113 | + }; | ||
114 | + }, | ||
115 | + computed: { | ||
116 | + styleObj() { | ||
117 | + return { | ||
118 | + position: this.ispreview ? "absolute" : "static", | ||
119 | + width: this.optionsStyle.width + "px", | ||
120 | + height: this.optionsStyle.height + "px", | ||
121 | + left: this.optionsStyle.left + "px", | ||
122 | + top: this.optionsStyle.top + "px", | ||
123 | + background: this.optionsSetup.background, | ||
124 | + 'flex-flow':this.optionsSetup.flexFlow | ||
125 | + }; | ||
126 | + }, | ||
127 | + //圆环边框设置 | ||
128 | + circleStyle(){ | ||
129 | + return{ | ||
130 | + 'background-image': 'linear-gradient(20deg, '+this.optionsSetup.lineColorDark+','+this.optionsSetup.lineColor+')', | ||
131 | + 'padding':this.optionsSetup.lineWidth+'px' | ||
132 | + } | ||
133 | + }, | ||
134 | + //多个水球样式 | ||
135 | + fillItemStyle(){ | ||
136 | + let length=this.fillData.length; | ||
137 | + let widthCirle=this.optionsSetup.flexFlow=='column'?this.optionsStyle.height:this.optionsStyle.width; | ||
138 | + let num=this.optionsSetup.flexFlow=='column'?60:20; | ||
139 | + let width=widthCirle/length-num; | ||
140 | + return { | ||
141 | + width: width + "px", | ||
142 | + height: width + "px", | ||
143 | + } | ||
144 | + }, | ||
145 | + //波纹样式 | ||
146 | + wave1Style(){ | ||
147 | + let optionsSetup=this.optionsSetup; | ||
148 | + return{ | ||
149 | + 'background-color':this.optionsSetup.color0Start, | ||
150 | + // 'top':this.topNum+'%', | ||
151 | + 'background-image':'radial-gradient( '+optionsSetup.color0Start+' , '+optionsSetup.colorsurplus+', '+optionsSetup.color100End+')', | ||
152 | + } | ||
153 | + }, | ||
154 | + //百分比样式 | ||
155 | + pieStyle(){ | ||
156 | + return{ | ||
157 | + 'font-size':this.optionsSetup.textPerFontSize+'px', | ||
158 | + color: this.optionsSetup.textPerColor, | ||
159 | + 'font-weight': this.optionsSetup.textPerFontWeight | ||
160 | + | ||
161 | + } | ||
162 | + }, | ||
163 | + //数值样式 | ||
164 | + numStyle(){ | ||
165 | + let optionsSetup=this.optionsSetup; | ||
166 | + return{ | ||
167 | + 'font-size': optionsSetup.textNumFontSize+'px', | ||
168 | + color: optionsSetup.textNumColor, | ||
169 | + 'font-weight': optionsSetup.textNumFontWeight | ||
170 | + } | ||
171 | + }, | ||
172 | + //下方标题样式 | ||
173 | + titleStyle(){ | ||
174 | + let optionsSetup=this.optionsSetup; | ||
175 | + return{ | ||
176 | + 'display':optionsSetup.isTitle?'block':'none', | ||
177 | + 'font-size':optionsSetup.titleFontSize+'px', | ||
178 | + color: optionsSetup.titleColor, | ||
179 | + 'font-weight': optionsSetup.titleFontWeight | ||
180 | + | ||
181 | + } | ||
182 | + } | ||
183 | + }, | ||
184 | + watch: { | ||
185 | + value: { | ||
186 | + handler(val) { | ||
187 | + this.optionsStyle = val.position; | ||
188 | + this.optionsData = val.data; | ||
189 | + this.optionsCollapse = val.collapse; | ||
190 | + this.optionsSetup = val.setup; | ||
191 | + this.editorOptions(); | ||
192 | + }, | ||
193 | + deep: true | ||
194 | + } | ||
195 | + }, | ||
196 | + created() { | ||
197 | + this.optionsStyle = this.value.position; | ||
198 | + this.optionsData = this.value.data; | ||
199 | + this.optionsCollapse = this.value.collapse; | ||
200 | + this.optionsSetup = this.value.setup; | ||
201 | + this.editorOptions(); | ||
202 | + }, | ||
203 | + mounted() { | ||
204 | + | ||
205 | + }, | ||
206 | + methods: { | ||
207 | + | ||
208 | + editorOptions() { | ||
209 | + this.setOptionsData(); | ||
210 | + }, | ||
211 | + // 数据解析 | ||
212 | + setOptionsData() { | ||
213 | + const optionsData = this.optionsData; // 数据类型 静态 or 动态 | ||
214 | + optionsData.dataType == "staticData" | ||
215 | + ? this.staticDataFn(optionsData.staticData) | ||
216 | + : this.dynamicDataFn( | ||
217 | + optionsData.dynamicData, | ||
218 | + optionsData.refreshTime | ||
219 | + ); | ||
220 | + }, | ||
221 | + staticDataFn(val) { | ||
222 | + const title = this.options.title; | ||
223 | + const num = val[0]['num']; | ||
224 | + if(val && val.length>0) { | ||
225 | + this.fillData=val; | ||
226 | + } | ||
227 | + this.nums = num ; | ||
228 | + this.topNum=100-num; | ||
229 | + | ||
230 | + }, | ||
231 | + topStyle(val){ | ||
232 | + let num=100-val; | ||
233 | + return { | ||
234 | + 'top':num+'%' | ||
235 | + }; | ||
236 | + }, | ||
237 | + dynamicDataFn(val, refreshTime) { | ||
238 | + if (!val) return; | ||
239 | + if (this.ispreview) { | ||
240 | + this.getEchartData(val); | ||
241 | + this.flagInter = setInterval(() => { | ||
242 | + this.getEchartData(val); | ||
243 | + }, refreshTime); | ||
244 | + } else { | ||
245 | + this.getEchartData(val); | ||
246 | + } | ||
247 | + }, | ||
248 | + getEchartData(val) { | ||
249 | + const data = this.queryEchartsData(val); | ||
250 | + data.then(res => { | ||
251 | + | ||
252 | + this.nums = res[0].value ; | ||
253 | + if(res && res.length>0){ | ||
254 | + this.fillData=res; | ||
255 | + } | ||
256 | + this.topNum=100-this.nums; | ||
257 | + }); | ||
258 | + }, | ||
259 | + } | ||
260 | +}; | ||
261 | +</script> | ||
262 | + | ||
263 | +<style scoped lang="scss"> | ||
264 | +.echarts { | ||
265 | + width: 100%; | ||
266 | + height: 100%; | ||
267 | + overflow: hidden; | ||
268 | +} | ||
269 | +.fillContainer{ | ||
270 | + box-sizing: content-box; | ||
271 | + display: flex; | ||
272 | + align-items: center; | ||
273 | + justify-content: space-around; | ||
274 | +} | ||
275 | +.fill-item{ | ||
276 | + width:100%;height:100%; | ||
277 | + //flex: 1; | ||
278 | + margin:10px; | ||
279 | +} | ||
280 | +.circle{ | ||
281 | + background-image: linear-gradient(20deg, #5a8ef5 , #aeedf1); | ||
282 | + width: 100%; | ||
283 | + height: 100%; | ||
284 | + border-radius: 50%; | ||
285 | + padding:4px; | ||
286 | + box-sizing: content-box; | ||
287 | +} | ||
288 | +.wave{ | ||
289 | + background: #FFFFFF; | ||
290 | + position: relative; | ||
291 | + width: 100%; | ||
292 | + height: 100%; | ||
293 | + border-radius: 50%; | ||
294 | + line-height: 50px; | ||
295 | + margin: 0 auto; | ||
296 | + font-size: 14px; | ||
297 | + text-align: center; | ||
298 | + overflow: hidden; | ||
299 | + animation: water-wave linear infinite; | ||
300 | +} | ||
301 | +.wave1{ | ||
302 | + position: absolute; | ||
303 | + top: 40%; | ||
304 | + left: -70%; | ||
305 | + background: #5a8ef5; | ||
306 | + background-image: radial-gradient( #5a8ef5 , #aeedf1, #aeedf1, #5a8ef5); | ||
307 | + opacity: .7; | ||
308 | + width: 200%; | ||
309 | + height: 200%; | ||
310 | + border-radius: 40%; | ||
311 | + animation: inherit; | ||
312 | + animation-duration: 5s; | ||
313 | +} | ||
314 | +@keyframes water-wave{ | ||
315 | + 0% {transform: rotate(0deg);} | ||
316 | + 100% {transform: rotate(360deg);} | ||
317 | +} | ||
318 | +.wave-val{ | ||
319 | + height: 100%; | ||
320 | + display: flex; | ||
321 | + align-items: center; | ||
322 | + justify-content: center; | ||
323 | + position: relative; | ||
324 | + font-size: 20px; | ||
325 | +} | ||
326 | +.wave-title{ | ||
327 | + padding:10px; | ||
328 | +} | ||
329 | +</style> |
@@ -50,6 +50,7 @@ import monitorCustomLineStack from "./monitor/customLineStack"; | @@ -50,6 +50,7 @@ import monitorCustomLineStack from "./monitor/customLineStack"; | ||
50 | import monitorCustomBarLineChart from "./monitor/customBarLineChart"; | 50 | import monitorCustomBarLineChart from "./monitor/customBarLineChart"; |
51 | import monitorButtonGroup from "./monitor/buttonGroup"; | 51 | import monitorButtonGroup from "./monitor/buttonGroup"; |
52 | import monitorCustomLineTrend from "./monitor/customLineTrend"; | 52 | import monitorCustomLineTrend from "./monitor/customLineTrend"; |
53 | +import monitorCustomLiquidFillChart from "./monitor/customLiquidFillChart"; | ||
53 | 54 | ||
54 | export default { | 55 | export default { |
55 | name: "WidgetTemp", | 56 | name: "WidgetTemp", |
@@ -92,7 +93,8 @@ export default { | @@ -92,7 +93,8 @@ export default { | ||
92 | monitorCustomLineStack, | 93 | monitorCustomLineStack, |
93 | monitorCustomBarLineChart, | 94 | monitorCustomBarLineChart, |
94 | monitorButtonGroup, | 95 | monitorButtonGroup, |
95 | - monitorCustomLineTrend | 96 | + monitorCustomLineTrend, |
97 | + monitorCustomLiquidFillChart | ||
96 | }, | 98 | }, |
97 | model: { | 99 | model: { |
98 | prop: "value", | 100 | prop: "value", |
@@ -61,6 +61,7 @@ import monitorCustomLineStack from "./monitor/customLineStack"; | @@ -61,6 +61,7 @@ import monitorCustomLineStack from "./monitor/customLineStack"; | ||
61 | import monitorCustomBarLineChart from "./monitor/customBarLineChart"; | 61 | import monitorCustomBarLineChart from "./monitor/customBarLineChart"; |
62 | import monitorButtonGroup from "./monitor/buttonGroup"; | 62 | import monitorButtonGroup from "./monitor/buttonGroup"; |
63 | import monitorCustomLineTrend from "./monitor/customLineTrend"; | 63 | import monitorCustomLineTrend from "./monitor/customLineTrend"; |
64 | +import monitorCustomLiquidFillChart from "./monitor/customLiquidFillChart"; | ||
64 | 65 | ||
65 | export default { | 66 | export default { |
66 | name: "Widget", | 67 | name: "Widget", |
@@ -102,7 +103,8 @@ export default { | @@ -102,7 +103,8 @@ export default { | ||
102 | monitorCustomLineStack, | 103 | monitorCustomLineStack, |
103 | monitorCustomBarLineChart, | 104 | monitorCustomBarLineChart, |
104 | monitorButtonGroup, | 105 | monitorButtonGroup, |
105 | - monitorCustomLineTrend | 106 | + monitorCustomLineTrend, |
107 | + monitorCustomLiquidFillChart | ||
106 | }, | 108 | }, |
107 | model: { | 109 | model: { |
108 | prop: "value", | 110 | prop: "value", |
-
Please register or login to post a comment