|
@@ -13,40 +13,36 @@
|
|
|
.s-row{/* background-color: antiquewhite; */ padding: 0 14px; padding-bottom: 0px;}
|
|
|
.s-row-1{padding-top: 14px;}
|
|
|
.s-row-2{/* margin-top: -10px; */}
|
|
|
- .s-row-2 .el-card .el-card__body{height: 250px;}
|
|
|
+ .s-row-2 .el-card .el-card__body{height: 230px;}
|
|
|
.s-row-3 .el-card{/* height: 100%; */}
|
|
|
-
|
|
|
.echarts-div{height: 100%;}
|
|
|
.s-row-3 .el-alert{margin-bottom: 14px;}
|
|
|
+ .years {float: right;margin-top: -63px;overflow: hidden;}
|
|
|
+ .ctype {float: left;margin-right: 30px;}
|
|
|
+ .year {float: left;padding: 5px 10px;background-color: #f6f6f6;cursor: pointer;font-size: 14px;color: #545555;}
|
|
|
+ .year.active{background-color: rgba(37, 97, 239, 1);color: white;}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="vue-box" style="display: none;" :style="'display: block;'">
|
|
|
-
|
|
|
<!-- ------------ 第一栏 - 统计数据 ------------- -->
|
|
|
<div class="s-row s-row-1">
|
|
|
- <com-sta-data></com-sta-data>
|
|
|
+ <com-sta-data :sta="sta"></com-sta-data>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- ------------ 第二栏 - 图表 ------------- -->
|
|
|
<div class="s-row s-row-2">
|
|
|
- <el-row :gutter="14">
|
|
|
- <el-col :lg="8" :xs="24">
|
|
|
- <el-card shadow="never" header="柱状图">
|
|
|
- <com-chart-1></com-chart-1>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- <el-col :lg="8" :xs="24">
|
|
|
- <el-card shadow="never" header="饼图">
|
|
|
- <com-chart-2></com-chart-2>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- <el-col :lg="8" :xs="24">
|
|
|
- <el-card shadow="never" header="折线图">
|
|
|
- <com-chart-3></com-chart-3>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-card shadow="never" header="订单交易额">
|
|
|
+ <div class="years">
|
|
|
+ <div class="ctype">
|
|
|
+ <div class="year" :class="{ active: currentType == index }" @click="currentType = index" v-for="(item, index) in types" :key="index">{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="year" :class="{ active: currentYear == index }" v-for="(item, index) in year" :key="index" @click="selectYear(index)">{{ item.year}}年</div>
|
|
|
+ </div>
|
|
|
+ <com-chart-1 :chart-data="chartData.money" :type="types[currentType].value"></com-chart-1>
|
|
|
+ </el-card>
|
|
|
+ <el-card shadow="never" header="订单交易量">
|
|
|
+ <com-chart-1 :chart-data="chartData.count" :type="types[currentType].value"></com-chart-1>
|
|
|
+ </el-card>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
|
|
@@ -57,7 +53,7 @@
|
|
|
<script src="https://unpkg.com/echarts@4.6.0/dist/echarts-en.min.js"></script>
|
|
|
<script src="../../static/sa.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
- var app = new Vue({
|
|
|
+ new Vue({
|
|
|
components: {
|
|
|
'com-sta-data': httpVueLoader('com-sta-data.vue'),
|
|
|
'com-chart-1': httpVueLoader('com-chart-1.vue'),
|
|
@@ -66,14 +62,46 @@
|
|
|
'com-stack': httpVueLoader('com-stack.vue'),
|
|
|
'com-update-log': httpVueLoader('com-update-log.vue'),
|
|
|
'com-origin': httpVueLoader('com-origin.vue'),
|
|
|
- // 'com-intro': httpVueLoader('com-intro.vue'),
|
|
|
},
|
|
|
el: '.vue-box',
|
|
|
data: {
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ sta: {bm: 0,purchaser: 0,orderCount: 0,totalMoney: 0,orders: 0,finishMoney: 0,},
|
|
|
+ chartData: {money: [],count: []},
|
|
|
+ year: [], //订单所有年份
|
|
|
+ currentType: 0, //当前图表类型
|
|
|
+ currentYear: 0, //当前年份
|
|
|
+ types: [{name: '柱状图',value: 'bar'}, {name: '折线图',value: 'line'}],
|
|
|
},
|
|
|
mounted: function() {
|
|
|
+ this.getYear();
|
|
|
+ this.getUsers();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getOrderStatistics() {
|
|
|
+ sa.ajax('/level-two-server/TbOrders/orderStatistics', {year: this.year[this.currentYear].year}, res => {
|
|
|
+ this.chartData = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getUsers() {
|
|
|
+ sa.ajax('/sp-admin/AppUser/selectUsers', res => {
|
|
|
+ this.sta.bm=parseInt(res.data.bmzz)+parseInt(res.data.bm);
|
|
|
+ this.sta.purchaser=res.data.purchaser;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getYear() {
|
|
|
+ sa.ajax('/level-two-server/TbOrders/selectYear', res => {
|
|
|
+ this.year = res.data.year;
|
|
|
+ this.currentYear = this.year.length - 1;
|
|
|
+ this.sta.totalMoney = res.data.count.totalMoney;
|
|
|
+ this.sta.finishMoney = res.data.count.finishMoney;
|
|
|
+ this.sta.orders = res.data.count.orders;
|
|
|
+ this.getOrderStatistics();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectYear(index) {
|
|
|
+ this.currentYear = index;
|
|
|
+ this.getOrderStatistics();
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -87,7 +115,8 @@
|
|
|
</script>
|
|
|
<!-- 百度统计(下载到本地后请删除) -->
|
|
|
<div style="height: 0px; overflow: hidden;">
|
|
|
- <script type="text/javascript" src="https://v1.cnzz.com/z_stat.php?id=1279021391&web_id=1279021391"></script>
|
|
|
+ <script type="text/javascript" src="https://v1.cnzz.com/z_stat.php?id=1279021391&web_id=1279021391">
|
|
|
+ </script>
|
|
|
</div>
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|