xuqiang 4 жил өмнө
parent
commit
a4ef16b50c

+ 6 - 1
src/main/vue/src/components/BarChart.vue

@@ -5,8 +5,13 @@ export default {
     name: 'stat',
     extends: Bar,
     mixins: [reactiveProp],
+    props: ['chartData', 'options'],
     mounted() {
-        this.renderChart(this.chartData, { responsive: true, maintainAspectRatio: false });
+        this.renderChart(this.chartData, {
+            responsive: true,
+            maintainAspectRatio: false,
+            ...(this.options || {})
+        });
     }
 };
 </script>

+ 15 - 14
src/main/vue/src/widgets/RecentDemand.vue

@@ -9,7 +9,7 @@
                     <el-radio-button label="2">年</el-radio-button>
                 </el-radio-group>
             </div>
-            <bar-chart :chart-data="chartData" v-if="chartData"> </bar-chart>
+            <bar-chart :chart-data="chartData" v-if="chartData" :options="options"> </bar-chart>
         </div>
     </widget-card>
 </template>
@@ -25,7 +25,19 @@ export default {
             },
             chartData: null,
             recentDays: '2',
-            loading: false
+            loading: false,
+            options: {
+                scales: {
+                    yAxes: [
+                        {
+                            min: 0,
+                            ticks: {
+                                beginAtZero: true
+                            }
+                        }
+                    ]
+                }
+            }
         };
     },
     created() {
@@ -67,18 +79,7 @@ export default {
                                 ],
                                 borderWidth: 1
                             }
-                        ],
-                        options: {
-                            scales: {
-                                yAxes: [
-                                    {
-                                        ticks: {
-                                            min: 0
-                                        }
-                                    }
-                                ]
-                            }
-                        }
+                        ]
                     };
                 })
                 .catch(e => {

+ 15 - 2
src/main/vue/src/widgets/RecentDemandWidget.vue

@@ -30,6 +30,7 @@ export default {
     methods: {
         getData() {
             this.$http.post('/statistic/getDemand', { type: this.recentDays }).then(res => {
+                console.log(res);
                 this.loading = true;
                 var chartDom = document.getElementById('demand');
                 var myChart = echarts.init(chartDom);
@@ -69,9 +70,21 @@ export default {
                                 { value: res.COPY, name: '版权' },
                                 { value: res.SOFT, name: '软著' },
                                 { value: res.TECHNOLOGY, name: '技术' },
-                                { value: res.PRODUCT, name: '产品' }
+                                { value: res.PRODUCT, name: '产品' },
+                                { value: res.SERVICE, name: '服务' },
+                                { value: res.FUNDING, name: '资金' }
+                            ],
+                            color: [
+                                '#EE6767',
+                                '#73A0FA',
+                                '#73DEB3',
+                                '#3BA271',
+                                '#9B60B4',
+                                '#7585A2',
+                                '#F7C739',
+                                '#FF9246',
+                                '#C985FF'
                             ],
-                            color: ['#EE6767', '#73A0FA', '#73DEB3', '#3BA271', '#9B60B4', '#7585A2', '#F7C739'],
                             emphasis: {
                                 itemStyle: {
                                     shadowBlur: 10,

+ 15 - 3
src/main/vue/src/widgets/RecentSupply.vue

@@ -9,7 +9,7 @@
                     <el-radio-button label="2">年</el-radio-button>
                 </el-radio-group>
             </div>
-            <bar-chart :chart-data="chartData" v-if="chartData"> </bar-chart>
+            <bar-chart :chart-data="chartData" v-if="chartData" :options="options"> </bar-chart>
         </div>
     </widget-card>
 </template>
@@ -25,7 +25,19 @@ export default {
             },
             chartData: null,
             recentDays: '2',
-            loading: false
+            loading: false,
+            options: {
+                scales: {
+                    yAxes: [
+                        {
+                            min: 0,
+                            ticks: {
+                                beginAtZero: true
+                            }
+                        }
+                    ]
+                }
+            }
         };
     },
     created() {
@@ -70,7 +82,7 @@ export default {
                         ],
                         options: {
                             scales: {
-                                yAxes: [
+                                xAxes: [
                                     {
                                         ticks: {
                                             min: 0

+ 14 - 2
src/main/vue/src/widgets/RecentSupplyWidget.vue

@@ -69,9 +69,21 @@ export default {
                                 { value: res.COPY, name: '版权' },
                                 { value: res.SOFT, name: '软著' },
                                 { value: res.TECHNOLOGY, name: '技术' },
-                                { value: res.PRODUCT, name: '产品' }
+                                { value: res.PRODUCT, name: '产品' },
+                                { value: res.SERVICE, name: '服务' },
+                                { value: res.MANAGER, name: '技术经理人' }
+                            ],
+                            color: [
+                                '#EE6767',
+                                '#73A0FA',
+                                '#73DEB3',
+                                '#3BA271',
+                                '#9B60B4',
+                                '#7585A2',
+                                '#F7C739',
+                                '#FF9246',
+                                '#C985FF'
                             ],
-                            color: ['#EE6767', '#73A0FA', '#73DEB3', '#3BA271', '#9B60B4', '#7585A2', '#F7C739'],
                             emphasis: {
                                 itemStyle: {
                                     shadowBlur: 10,