许成详 hace 6 años
padre
commit
83480b382d
Se han modificado 3 ficheros con 9 adiciones y 5 borrados
  1. 1
    1
      dist/index.html
  2. 7
    3
      src/components/dashboard/index.vue
  3. 1
    1
      src/pages/system/dashboard/index.vue

+ 1
- 1
dist/index.html Ver fichero

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.7a8db4949a29531aab9b167e3ef01c7f.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.992319e39e0ff64940a3.js></script><script type=text/javascript src=./static/js/app.97dbba826dd528cbc785.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.07d77dd745edc91d4fb8eb2986e77d9a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.992319e39e0ff64940a3.js></script><script type=text/javascript src=./static/js/app.48bea48f544369af0d47.js></script></body></html>

+ 7
- 3
src/components/dashboard/index.vue Ver fichero

@@ -24,9 +24,13 @@ export default {
24 24
     })
25 25
   },
26 26
   methods: {
27
+    returnValue (val) {
28
+      return String(val).substring(0, 2).split('').join('.') - 0
29
+    },
27 30
     init () {
28 31
       var _that = this
29 32
       var Shape = G2.Shape
33
+      var aValue = _that.returnValue(_that.data.value)
30 34
       // 自定义Shape 部分
31 35
       Shape.registerShape('point', 'pointer', {
32 36
         drawShape: function drawShape (cfg, group) {
@@ -65,7 +69,7 @@ export default {
65 69
         height: 400,
66 70
         padding: [0, 0, 30, 0]
67 71
       })
68
-      chart.source(_that.data.value)
72
+      chart.source([{ value: aValue }])
69 73
 
70 74
       chart.coord('polar', {
71 75
         startAngle: -9 / 8 * Math.PI,
@@ -122,7 +126,7 @@ export default {
122 126
       chart.guide().arc({
123 127
         zIndex: 1,
124 128
         start: [0, 0.945],
125
-        end: [_that.data.value[0].value, 0.945],
129
+        end: [aValue, 0.945],
126 130
         style: {
127 131
           stroke: '#1890FF',
128 132
           lineWidth: 18
@@ -131,7 +135,7 @@ export default {
131 135
       // 绘制指标数字
132 136
       chart.guide().html({
133 137
         position: ['50%', '100%'],
134
-        html: '<div style="width: 300px;text-align: center;">' + '<p style="font-size: 20px; color: #545454;margin: 0;">' + _that.data.title + '</p>' + '<p style="font-size: 36px;color: #545454;margin: 0;">' + _that.data.list[0].value * 10 + '%</p>' + '</div>'
138
+        html: '<div style="width: 300px;text-align: center;">' + '<p style="font-size: 20px; color: #545454;margin: 0;">' + _that.data.title + '</p>' + '<p style="font-size: 36px;color: #545454;margin: 0;">' + aValue * 10 + '%</p>' + '</div>'
135 139
       })
136 140
 
137 141
       chart.render()

+ 1
- 1
src/pages/system/dashboard/index.vue Ver fichero

@@ -27,7 +27,7 @@
27 27
         <div v-if="subItem.type === 'ringChart' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
28 28
           <ringChart :data="subItem" :index="index + '-' + subIndex"></ringChart>
29 29
         </div>
30
-        <div v-if="subItem.type === 'dashboard' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
30
+        <div v-if="subItem.type === 'dashboard'">
31 31
           <dashboard :data="subItem" :index="index + '-' + subIndex"></dashboard>
32 32
         </div>
33 33
         <div v-if="subItem.type === 'brokenLineGraphGroup' && typeof(subItem.value) === 'object' && (subItem.value || []).length">