gaoluyang
3 天以前 92230c9a97dc9ce9df3313d11d26999c04bb6b26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<template>
    <view class="body window">
        <view class="topLine" :style="{ height: topBar + 'px' }"></view>
        <view class="nav row_align_center" id="nav">
            <li class="li_6" :class="['iconfont icon-zuojiantou back']" @click="gotoBack()"></li>
            <text class="title">{{ title ? title : '' }}</text>
            <li class="iconfont icon-zuojiantou back hidden li_6"></li>
        </view>
        <view class="data_body">
            <scroll-view class="scroll_list" scroll-y :style="{ height: scrollHeight }">
                <!-- 教学科研情况 -->
                <view class="view_block">
                    <view class="title">教学科研情况</view>
                    <progress-bar :content="RankData" @updateRanking="updateRanking"></progress-bar>
                </view>
                <!-- 学历分布状况 -->
                <view class="view_block">
                    <view class="title">学历分布状况
                        <text class="font-small" style="color: #ccc;">(教职工)</text>
                    </view>
                    <view class="charts-box" style="height: 300px;">
                        <qiun-data-charts type="rose" :chartData="ProductRateData" canvasId="school_a"
                            :canvas2d="isCanvas2d" :resshow="delayload" />
                    </view>
                </view>
                <!-- 学业成绩 -->
                <view class="view_block">
                    <view class="title">学业成绩分布图
                        <text class="font-small" style="color: #ccc;">(班级)</text>
                    </view>
                    <view class="charts-box" style="height: 300px;">
                        <qiun-data-charts type="radar" :chartData="RadarModel" background="none" canvasId="school_b"
                            :animation="false" :canvas2d="isCanvas2d" :resshow="delayload" />
                    </view>
                </view>
                <!-- 图书借阅情况 -->
                <view class="view_block">
                    <view class="title">图书借阅情况</view>
                    <view class="charts-box" style="height: 300px;">
                        <qiun-data-charts type="line" canvasId="school_c" :canvas2d="isCanvas2d" :resshow="delayload"
                            :ontouch="true"
                            :opts="{ enableScroll: true, xAxis: { scrollShow: true, itemCount: 4, disableGrid: true }, series: { style: 'curve' } }"
                            :chartData="friendTrand" />
                    </view>
                </view>
            </scroll-view>
        </view>
    </view>
</template>
 
<script>
import ProgressBar from "../../components/progress-bar/progress-bar.vue"
import RankData from '../../static/json/school/1.json';
import ProductRateData from '../../static/json/school/2.json';
import RadarModel from '../../static/json/school/3.json';
import friendTrand from '../../static/json/school/4.json';
import Config from '../../static/js/config'
import Common from '../../static/js/common'
 
export default {
    components: {
        ProgressBar
    },
    data() {
        return {
            info: "大便超人", //用户数据
            title: "智慧教育报表中心", //标题
            showDataTime: "today", //选中的时间
            tabCur: 0, //标签头下标
            topBar: 17, //导航高
            top: '180', //下拉栏位置
            scrollHeight: "1400rpx", //数据展示体高度
            friendTrand,
            RankData,
            ProductRateData,
            RadarModel,
            isCanvas2d: Config.ISCANVAS2D,
            delayload: false, //延时加载图表,否则会出现图表加载完后定位错乱
        };
    },
    computed: {
        locationArray() {
            return [{ value: "GDBJ-ENTRY-1", text: "天猫" }, { value: "GDBJ-ENTRY-201", text: "京东" }];
        }
    },
    methods: {
        async getData() {
            uni.showLoading();
            await setTimeout(() => {
                this.delayload = true;
                uni.hideLoading();
            }, 1000)
        },
        gotoBack() {
            Common.navigateBack("/index/index");
        },
        //获取设备信息
        async getTelephoneInfo() {
            var telephoneInfo = await Common.getTelephoneInfo();
            let hasHeight = 0;
            if (telephoneInfo.top >= 40) {
                this.top = telephoneInfo.statusBarHeight * 2 + 150;
                this.topBar = telephoneInfo.statusBarHeight;
            }
            // 设置滚动高度
            const query = wx.createSelectorQuery();
            query.select('#nav').boundingClientRect();
            query.exec(res => {
                res.map((item, index) => {
                    hasHeight += item.height;
                })
                this.scrollHeight = (telephoneInfo.screenHeight - hasHeight - this.topBar) + 'px';
            })
        },
        updateRanking(nVal) {
            this.RankData = nVal;
        },
    },
    onLoad() {
        //#ifndef H5
        uni.showShareMenu();
        //#endif
        this.getData()
        this.getTelephoneInfo();
    }
}
</script>
 
<style scoped lang="scss">
.body {
    height: 100vh;
    margin: 0;
    padding: 0 20rpx;
    font-family: "montserrat";
    background-image: linear-gradient(125deg, #CB9FFE, #5894F7, #ABCDFA, #74A3F6, #CB9FFE);
    background-size: 400%;
    animation: bganimation 15s infinite;
}
 
.li_6 {
    list-style-type: none;
}
 
page,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}
 
.window {
    height: 100vh;
    overflow: hidden;
 
    .topLine {
        width: 100%;
    }
 
    scroll-view {
        box-sizing: border-box;
    }
 
    .swiper {
        box-sizing: border-box;
    }
 
    .nav {
        background-size: 100% 100%;
 
        .back {
            font-size: 54rpx;
            padding: 20rpx 14rpx 15rpx 14rpx;
            color: #fff;
        }
 
        .title {
            color: #fff;
            font-size: 30rpx;
            flex: 1;
            text-align: center;
        }
 
        .hidden {
            visibility: hidden;
        }
    }
 
    .head {
        padding: 0 16rpx 14rpx 16rpx;
        color: #fff;
        background-color: #40A2ED;
        justify-content: space-between;
        font-size: 26rpx !important;
 
        .calendar_drag {
            width: 340rpx;
            display: flex;
            justify-content: center;
            align-items: center;
 
            .calendar_name {
                margin-right: 10rpx;
            }
 
            .icon-calendar {
                font-size: 26rpx;
                margin-top: 4rpx;
            }
        }
    }
 
    .data_body {
        overflow: auto;
        text-align: center;
        color: #333333;
        background-repeat: repeat;
        height: 100%;
 
        .scroll_list {
            height: 100%;
 
            .view_block {
                background-color: #fff;
                padding: 16rpx 20rpx 10rpx 20rpx;
                border-radius: 20rpx;
                margin-bottom: 40rpx;
 
                .title {
                    text-align: left;
                    margin-bottom: 30rpx;
                    font-size: 30rpx;
                }
 
                .trend_title {
                    text-align: right;
                    font-size: 22rpx;
                    color: #ff9900;
                    margin-top: 50rpx;
                }
            }
        }
    }
}
 
@keyframes bganimation {
    0% {
        background-position: 0% 50%;
    }
 
    50% {
        background-position: 100% 50%;
    }
 
    100% {
        background-position: 0% 50%;
    }
}
</style>