123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <template>
- <view class="chart-list-container">
- <!-- 头部区域 -->
- <top-box v-bind:timeStamp="timeStamp"></top-box>
- <!-- 缩略图区域 -->
- <view class="mini-chart-list">
- <view class="mini-chart-item">
- <view class="mainchart-container">
- <view class="mainchart-name">
- <view class="t-icon t-icon-xtubiao-4"></view>
- <text class="mainchart-text">学期成绩走势</text>
- </view>
- <view class="mainchart-box">
- <qiun-data-charts class="chart" :canvas2d='true' canvasId='canvans5' type="mainline"
- :chartData="gradeData.mainLineChart" :loadingType="4" />
- </view>
- </view>
- </view>
- <view class="mini-chart-item">
- <view class="chart-container" @click="navLineChart">
- <view class="chart-name">
- <view class="t-icon t-icon-xtubiao-4"></view>
- <text class="chart-name-text">学期走势</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="mini-line" :chartData="gradeData.semesterLineChart.lineComparison"
- :loadingType="4" background="none" :tapLegend="false" :canvas2d='true'
- canvasId='canvans3' />
- </view>
- </view>
- </view>
- <view class="mini-chart-item">
- <view class="chart-container" @click="navAreaChart">
- <view class="chart-name">
- <view class="t-icon t-icon-xtubiao-4"></view>
- <text class="chart-name-text">单科走势</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="mini-area" :chartData="gradeData.subjectAreaChart.areaComparison"
- :loadingType="4" background="none" :tapLegend="false" :canvas2d='true'
- canvasId='canvans1' />
- </view>
- </view>
- </view>
- <view class="mini-chart-item">
- <view class="chart-container" @click="navColumnChart">
- <view class="chart-name">
- <view class="t-icon t-icon-xtubiao-2"></view>
- <text class="chart-name-text">最近成绩</text>
- </view>
- <view class="charts-box">
- <qiun-data-charts type="mini-column" :chartData="gradeData.recentColumnChart.columnComparison"
- :loadingType="4" background="none" :tapLegend="false" :canvas2d='true'
- canvasId='canvans2' />
- </view>
- </view>
- </view>
- <!-- 分析模块 -->
- <view class="mini-chart-item">
- <analysis-box></analysis-box>
- </view>
- </view>
- <!-- 成绩表单 -->
- <view class="table-card">
- <view class="table-name">
- <view class="t-icon t-icon-xtubiao-5"></view>
- <text class="table-name-text">成绩概览</text>
- </view>
- <z-table class="table" :tableData="gradeData.tableData" :columns="gradeData.columns" stickSide="true">
- </z-table>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex'
- export default {
- computed: {
- ...mapState('m_children', ['childreninfo', 'semester']),
- ...mapState('m_chart', ['gradeData'])
- },
- data() {
- return {
- //时间戳
- timeStamp: '',
- }
- },
- methods: {
- //导航柱状图页面
- navColumnChart(e) {
- console.log(e);
- uni.navigateTo({
- url: "/gradepkg/column-chart/column-chart"
- })
- },
- //导航面积折线图页面
- navAreaChart(e) {
- console.log(e);
- uni.navigateTo({
- url: "/gradepkg/area-chart/area-chart"
- })
- },
- //导航折线图页面
- navLineChart(e) {
- console.log(e);
- uni.navigateTo({
- url: "/gradepkg/line-chart/line-chart"
- })
- },
- //更新时间戳
- getTimeStamp() {
- var date = new Date(),
- hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
- minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
- this.timeStamp = (hour + ':' + minute).toString();
- }
- },
- onLoad() {
- this.getTimeStamp()
- },
- //刷新页面
- onPullDownRefresh() {
- this.getTimeStamp()
- console.log('refresh');
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- }
- }
- </script>
- <style lang="scss">
- .chart-list-container {
- width: 100%;
- height: 100%;
- overflow-x:hidden; //隐藏多余的页面
- .home-topinfo {
- background: linear-gradient(#ff8caf, #f1f3f5);
- }
- //缩略图列表
- .mini-chart-list {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- margin: -50rpx 20rpx 0 20rpx;
- justify-content: space-between;
- .mini-chart-item {
- margin: 10rpx 0;
- display: flex;
- flex-direction: column;
- }
- }
- }
- //总成绩折线图
- .mainchart-container {
- border-radius: 16rpx;
- display: flex;
- align-items: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
- width: 100%;
- .mainchart-name {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- width: 100%;
- margin: 20rpx 0 20rpx 40rpx;
- .mainchart-text {
- margin-left: 20rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #3B4144;
- }
- }
- .mainchart-box {
- width: 710rpx;
- height: 300rpx;
- }
- }
- //缩略图
- .chart-container {
- border-radius: 16rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
- width: 347rpx;
- height: 345rpx;
- .chart-name {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- width: 100%;
- margin: 20rpx 0 35rpx 40rpx;
- .chart-name-text {
- margin-left: 20rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #3B4144;
- }
- }
- .charts-box {
- width: 100%;
- height: 250rpx;
- }
- }
- //表格
- .table-card {
- margin: 10rpx 20rpx;
- border-radius: 16rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
- .table-name {
- width: 100%;
- text-align: left;
- margin: 20rpx 0 0 50rpx;
- display: flex;
- align-items: center;
- font-weight: bold;
- color: #3B4144;
- .table-name-text {
- font-size: 30rpx;
- margin-left: 20rpx;
- }
- }
- .table {
- margin: 20rpx;
- width: 92%;
- }
- }
- //图标
- .t-icon {
- width: 40rpx;
- height: 40rpx;
- }
- </style>
|