index.vue 5.8 KB

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