SAchooseattention.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <Row class="attention_box">
  3. <Col span="24">
  4. <Sider ref="side1" v-model="isCollapsed">
  5. <Menu active-name="1-1" theme="dark" width="100%">
  6. <MenuItem name="1-1">
  7. <Icon type="ios-home-outline"/>
  8. <span>{{$t('saindex.index')}}</span>
  9. </MenuItem>
  10. <MenuItem name="1-2">
  11. <Icon type="ios-clipboard-outline"/>
  12. <span>{{$t('saindex.grade')}}</span>
  13. </MenuItem>
  14. <MenuItem name="1-3">
  15. <Icon type="md-checkmark-circle-outline"/>
  16. <span>{{$t('saindex.droppoint')}}</span>
  17. </MenuItem>
  18. <MenuItem name="1-4">
  19. <Icon type="ios-create-outline"/>
  20. <span>{{$t('saindex.examination')}}</span>
  21. </MenuItem>
  22. <MenuItem name="1-5">
  23. <Icon type="ios-medal-outline"/>
  24. <span>{{$t('saindex.knowledge')}}</span>
  25. </MenuItem>
  26. </Menu>
  27. </Sider>
  28. </Col>
  29. <Col span="24" class="choose">
  30. <div class="select">
  31. <p class="choose_box_tilte" v-if="this.now_url == '/saindex'">{{$t('sasidebar.class')}}</p>
  32. <Cascader :data="selectgrade" v-model="grade" placeholder="请选择年级" @on-change="listchange" v-if="this.now_url == '/saindex'"></Cascader>
  33. <p class="choose_box_tilte">{{$t('sasidebar.term')}}</p>
  34. <Cascader :data="selectterm" v-model="semester" placeholder="请选择年级" @on-change="listterm"></Cascader>
  35. <p class="choose_box_tilte" v-if="this.now_url == '/teach'">{{$t('sasidebar.compare')}}</p>
  36. <Select v-model="model1" style="width:200px" placeholder="请选择比较的数据" v-if="this.now_url == '/teach'" @on-change="datacompare">
  37. <Option v-for="item in selectcontrast" :value="item.value" :key="item.value">{{ item.label }}</Option>
  38. </Select>
  39. </div>
  40. </Col>
  41. </Row>
  42. </template>
  43. <script>
  44. export default {
  45. name: "ChooseAttention",
  46. data() {
  47. return {
  48. isCollapsed: false,
  49. value1: [],
  50. grade: [],
  51. semester: [],
  52. cityList: [],
  53. model1:[],
  54. now_url:this.$route.path,
  55. }
  56. },
  57. created() {
  58. this.init();
  59. this.inits();
  60. this.contrast();
  61. },
  62. computed: {
  63. // 命令发布监听
  64. selectgrade() {
  65. return this.$store.state.selectgrade
  66. },
  67. selectterm(){
  68. return this.$store.state.selectterm
  69. },
  70. selectcontrast() {
  71. return this.$store.state.selectcontrast
  72. },
  73. },
  74. methods: {
  75. //获取关注年级数据
  76. init(){
  77. this.$api.FindGrade({})
  78. .then((response) => {
  79. //console.log(response.result.data, 11111);
  80. this.$store.state.selectgrade = response.result.data;
  81. //console.log(this.$store.state.selectgrade, 888855)
  82. })
  83. },
  84. //获取关注学年期
  85. inits() {
  86. if (this.now_url == '/saindex') {
  87. this.$api.FindTerm({})
  88. .then((response) => {
  89. //console.log(response.result.data,11111);
  90. this.$store.state.selectterm = response.result.data
  91. })
  92. } else if (this.now_url == '/teach') {
  93. this.$api.FindTeachTerm({})
  94. .then((response) => {
  95. this.$store.state.selectterm = response.result.data;
  96. })
  97. }
  98. },
  99. //获取数据比较
  100. contrast(){
  101. this.$api.FindTeachContrast({})
  102. .then((response) => {
  103. this.$store.state.selectcontrast=response.result.data
  104. })
  105. },
  106. //获取关注年级值
  107. listchange(value, selectedData) {
  108. let xueduan = value[0];
  109. let nianjinum = value[1];
  110. if (xueduan == 'gaozhong' && nianjinum != 1) {
  111. this.$store.state.wenli_show = true;
  112. } else {
  113. this.$store.state.wenli_show = false;
  114. }
  115. //console.log(value,33333);
  116. this.$api.FindSelectGrade({})
  117. .then((response) => {
  118. //console.log(response.result.data, 789789789);
  119. //获取新的年级选择
  120. this.$store.state.selectgrade = response.result.data.selectgrade
  121. //获取新的学年期
  122. this.$store.state.selectterm = response.result.data.term
  123. //获取新的考试次数情况
  124. this.$store.state.selectexam = response.result.data.exam[0].data;
  125. //获取新的基础信息
  126. this.$store.state.basicsdata = response.result.data.base;
  127. //获取新的各校成绩排名
  128. this.$store.state.zhuxhuang = response.result.data.barecharts;
  129. //获取新的各项科目表现
  130. this.$store.state.leida = response.result.data.leida;
  131. //获取新的科目表现对比
  132. this.$store.state.pie = response.result.data.pie
  133. //获取新的考试类型
  134. this.$store.state.examtype = response.result.data.examtype;
  135. //获取新的各校历次总分统计图
  136. this.$store.state.linechart = response.result.data.linechart;
  137. })
  138. },
  139. //获取关注学年期
  140. listterm(value, selectedData) {
  141. if (this.now_url == '/saindex') {
  142. this.$api.FindSelectTerm({})
  143. .then((response) => {
  144. //console.log(response.result.data);
  145. //获取新的关注年级
  146. this.$store.state.selectgrade = response.result.data.selectgrade
  147. //获取新的学年期
  148. this.$store.state.selectterm = response.result.data.term
  149. //获取新的考试次数情况
  150. this.$store.state.selectexam = response.result.data.exam[0].data;
  151. //获取新的基础信息
  152. this.$store.state.basicsdata = response.result.data.base;
  153. //获取新的各校成绩排名
  154. this.$store.state.zhuxhuang = response.result.data.barecharts;
  155. //获取新的各项科目表现
  156. this.$store.state.leida = response.result.data.leida;
  157. //获取新的科目表现对比
  158. this.$store.state.pie = response.result.data.pie
  159. //获取新的考试类型
  160. this.$store.state.examtype = response.result.data.examtype;
  161. //获取新的各校历次总分统计图
  162. this.$store.state.linechart = response.result.data.linechart;
  163. })
  164. } else if (this.now_url =='/teach') {
  165. this.$api.FindDynamicTerm({})
  166. .then((response) => {
  167. //console.log(response.result.data,33333)
  168. //获取新的学年期
  169. this.$store.state.selectterm = response.result.data.term;
  170. //获取新的数据对比
  171. this.$store.state.selectcontrast = response.result.data.selectcontrast;
  172. //获取新的考试次数情况
  173. this.$store.state.selectexam = response.result.data.exam[0].data;
  174. //获取新的基础信息
  175. this.$store.state.basicsdata = response.result.data.base;
  176. //获取各班平均分数排名
  177. this.$store.state.barline = response.result.data.barecharts;
  178. //获取及格率比较
  179. this.$store.state.annulus = response.result.data.annulus;
  180. //获取PR百分等级
  181. this.$store.state.accuracyPR = response.result.data.accuracyPR;
  182. //获取历次总分统计图
  183. this.$store.state.linechart = response.result.data.linechart;
  184. })
  185. }
  186. },
  187. //动态数据比较
  188. datacompare(value, selectedData) {
  189. this.$api.FindDatacompare({})
  190. .then((response) => {
  191. //获取新的学年期
  192. this.$store.state.selectterm = response.result.data.term;
  193. //获取新的数据对比
  194. this.$store.state.selectcontrast = response.result.data.selectcontrast;
  195. //获取新的考试次数情况
  196. this.$store.state.selectexam = response.result.data.exam[0].data;
  197. //获取新的基础信息
  198. this.$store.state.basicsdata = response.result.data.base;
  199. //获取各班平均分数排名
  200. this.$store.state.barline = response.result.data.barecharts;
  201. //获取及格率比较
  202. this.$store.state.annulus = response.result.data.annulus;
  203. //获取PR百分等级
  204. this.$store.state.accuracyPR = response.result.data.accuracyPR;
  205. //获取历次总分统计图
  206. this.$store.state.linechart = response.result.data.linechart;
  207. })
  208. }
  209. },
  210. }
  211. </script>
  212. <style scoped>
  213. .ivu-select-selection {
  214. background-color: #cfd4da !important;
  215. }
  216. .ivu-input {
  217. font-size: 14px !important;
  218. background-color: #cfd4da;
  219. color: #4d5760 !important;
  220. border: 1px solid #cfd4da;
  221. }
  222. .ivu-input-wrapper {
  223. color: #000 !important;
  224. }
  225. .ivu-input:hover {
  226. border: 1px solid #fff;
  227. }
  228. .ivu-select {
  229. width: 100% !important;
  230. }
  231. </style>
  232. <style scoped>
  233. .choose {
  234. padding-top: 5%;
  235. background-color: #cfd4da;
  236. }
  237. .ivu-dropdown {
  238. width: 100%;
  239. }
  240. .choose_box_tilte {
  241. font-size: 0.95rem;
  242. color: #7d868d;
  243. margin-top: 8%;
  244. margin-bottom: 5%;
  245. }
  246. .select {
  247. width: 100%;
  248. padding: 1% 10% 15% 8%;
  249. }
  250. .ivu-layout-sider {
  251. width: 100% !important;
  252. min-width: 100% !important;
  253. }
  254. .ivu-menu-dark {
  255. background-color: #b3bdc6 !important;
  256. border-bottom: 1px solid #8d97a1;
  257. }
  258. .ivu-menu-item {
  259. font-size: 1.1rem !important;
  260. color: #4b555e !important;
  261. }
  262. .ivu-menu-item-active, .ivu-menu-item-selected {
  263. color: #fff !important;
  264. }
  265. .ivu-menu-item:hover {
  266. color: #fff !important;
  267. }
  268. </style>