|
@@ -1,143 +1,61 @@
|
|
<template>
|
|
<template>
|
|
<div class="statistics-container container">
|
|
<div class="statistics-container container">
|
|
- <el-row :gutter="20">
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <div id="fieldType" style="width: 100%;height: 500px"></div>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <div id="appType"></div>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- <el-row :gutter="20">
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <div id="testType"></div>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
-<!-- <div id="appType"></div>-->
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
|
|
+ <el-card shadow="hover" class="project-statistics-card" v-for="item in agencyList">
|
|
|
|
+ <div class="project-statistics-card-title">{{Object.keys(item)[0]}}</div>
|
|
|
|
+ <div class="project-statistics-card-number">{{item[Object.keys(item)[0]]}}</div>
|
|
|
|
+ </el-card>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {notify} from "../../constants";
|
|
import {notify} from "../../constants";
|
|
import Http from '@/js/http.js';
|
|
import Http from '@/js/http.js';
|
|
- import {storageGet} from '@/js/index.js'
|
|
|
|
- import Apis from '@/js/api'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "StatisticsReport",
|
|
name: "StatisticsReport",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- user: {},
|
|
|
|
- typeChartData:{}
|
|
|
|
|
|
+ agencyList:{}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- setUserInfo() {
|
|
|
|
- this.user = storageGet('user') && storageGet('user').userVO;
|
|
|
|
- },
|
|
|
|
- getTypeChartData(){
|
|
|
|
- Http.get('/api/common/statistics/count').then(res=>{
|
|
|
|
- this.typeChartData = res;
|
|
|
|
|
|
+ getAgencyList(){
|
|
|
|
+ Http.get('/api/common/agency/project/count').then(res=>{
|
|
|
|
+ this.agencyList = res.data;
|
|
|
|
+ }).catch((err)=>{
|
|
|
|
+ notify('error',err)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //画领域类型的柱状图
|
|
|
|
- drawFieldTypeChart() {
|
|
|
|
- // 基于准备好的dom,初始化echarts实例
|
|
|
|
- let myChart = this.$echarts.init(document.getElementById("fieldType"));
|
|
|
|
- // 指定图表的配置项和数据
|
|
|
|
- let option = {
|
|
|
|
- title: {
|
|
|
|
- text: "领域类型项目数量"
|
|
|
|
- },
|
|
|
|
- tooltip: {},
|
|
|
|
- legend: {
|
|
|
|
- data: ["数量"]
|
|
|
|
- },
|
|
|
|
- xAxis: {
|
|
|
|
- data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
|
|
|
|
- },
|
|
|
|
- yAxis: {},
|
|
|
|
- series: [
|
|
|
|
- {
|
|
|
|
- name: "销量",
|
|
|
|
- type: "bar",
|
|
|
|
- data: [5, 20, 36, 10, 10, 20]
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- };
|
|
|
|
- // 使用刚指定的配置项和数据显示图表。
|
|
|
|
- myChart.setOption(option);
|
|
|
|
- },
|
|
|
|
- //画应用类型的柱状图
|
|
|
|
- drawAPPTypeChart() {
|
|
|
|
- // 基于准备好的dom,初始化echarts实例
|
|
|
|
- let myChart = this.$echarts.init(document.getElementById("appType"));
|
|
|
|
- // 指定图表的配置项和数据
|
|
|
|
- let option = {
|
|
|
|
- title: {
|
|
|
|
- text: "应用类型项目数量"
|
|
|
|
- },
|
|
|
|
- tooltip: {},
|
|
|
|
- legend: {
|
|
|
|
- data: ["数量"]
|
|
|
|
- },
|
|
|
|
- xAxis: {
|
|
|
|
- data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
|
|
|
|
- },
|
|
|
|
- yAxis: {},
|
|
|
|
- series: [
|
|
|
|
- {
|
|
|
|
- name: "销量",
|
|
|
|
- type: "bar",
|
|
|
|
- data: [5, 20, 36, 10, 10, 20]
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- };
|
|
|
|
- // 使用刚指定的配置项和数据显示图表。
|
|
|
|
- myChart.setOption(option);
|
|
|
|
- },
|
|
|
|
- //画测试类型的柱状图
|
|
|
|
- drawTestTypeChart() {
|
|
|
|
- // 基于准备好的dom,初始化echarts实例
|
|
|
|
- let myChart = this.$echarts.init(document.getElementById("testType"));
|
|
|
|
- // 指定图表的配置项和数据
|
|
|
|
- let option = {
|
|
|
|
- title: {
|
|
|
|
- text: "测试类型项目数量"
|
|
|
|
- },
|
|
|
|
- tooltip: {},
|
|
|
|
- legend: {
|
|
|
|
- data: ["数量"]
|
|
|
|
- },
|
|
|
|
- xAxis: {
|
|
|
|
- data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
|
|
|
|
- },
|
|
|
|
- yAxis: {},
|
|
|
|
- series: [
|
|
|
|
- {
|
|
|
|
- name: "销量",
|
|
|
|
- type: "bar",
|
|
|
|
- data: [5, 20, 36, 10, 10, 20]
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- };
|
|
|
|
- // 使用刚指定的配置项和数据显示图表。
|
|
|
|
- myChart.setOption(option);
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.setUserInfo();
|
|
|
|
- this.getProjectCount();
|
|
|
|
- // this.getTypeChartData();
|
|
|
|
- // this.drawFieldTypeChart();
|
|
|
|
- // this.drawAPPTypeChart();
|
|
|
|
- // this.drawTestTypeChart();
|
|
|
|
|
|
+ this.getAgencyList();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
|
-
|
|
|
|
|
|
+<style scoped lang="less">
|
|
|
|
+.statistics-container{
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-wrap:wrap;
|
|
|
|
+ .project-statistics-card{
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ flex: 0 0 32%;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+ .project-statistics-card-title {
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ .project-statistics-card-number {
|
|
|
|
+ margin: 10px auto;
|
|
|
|
+ text-align: center;
|
|
|
|
+ font-weight: bolder;
|
|
|
|
+ font-size: 28px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .project-statistics-card:last-child{
|
|
|
|
+ margin-right: 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|