work_analysis.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <section class="content">
  3. <div class="breadcrumb">
  4. <el-breadcrumb separator="/">
  5. <el-breadcrumb-item><a href="/">阅卷管理</a></el-breadcrumb-item>
  6. <el-breadcrumb-item>成绩分析</el-breadcrumb-item>
  7. </el-breadcrumb>
  8. </div>
  9. <el-form :model="params" label-width="80px" class="filter-form" :inine="true">
  10. <el-row>
  11. <el-col :span="4">
  12. <el-form-item label="学校">
  13. <el-select size="mini" v-model="params.school_id">
  14. <el-option label="人大附中" value="人大附中">人大附中</el-option>
  15. </el-select>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="4">
  19. <el-form-item label="年级" v-model="params.grade_id">
  20. <el-select v-model="params.school_id" size="mini">
  21. <el-option label="高三一班" value="高三一班">高三一班</el-option>
  22. </el-select>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="8">
  26. <el-form-item label-width="10" style="margin-left: 10px">
  27. <el-button type="primary" @click="get_list()" size="mini">筛选</el-button>
  28. <!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button> -->
  29. </el-form-item>
  30. </el-col>
  31. </el-row>
  32. </el-form>
  33. <el-table :data="tableData" stripe style="width: 100%" height="65vh">
  34. <el-table-column prop="name" label="作业名称"> </el-table-column>
  35. <el-table-column prop="score" label="满分">
  36. <template slot-scope="scope">
  37. <div class="bold">{{ scope.row.full_score }}</div>
  38. </template>
  39. </el-table-column>
  40. <el-table-column prop="max_score" label="最高分">
  41. <template slot-scope="scope">
  42. <div class="bold">{{ scope.row.max_score }}</div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="avg_score" label="平均分">
  46. <template slot-scope="scope">
  47. <div class="bold">{{ scope.row.avg_score }}</div>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="pass_rate" label="及格率">
  51. <template slot-scope="scope">
  52. <div class="bold">
  53. {{ scope.row.pass_rate }}
  54. </div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="phone" label="答题人数">
  58. <template slot-scope="scope">
  59. <div style="color: #0a9dff">
  60. <span>{{ scope.row.marked_students }}/</span>
  61. <span>{{ scope.row.total_students }}</span>
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="ctime" label="上传时间" width="180">
  66. </el-table-column>
  67. <el-table-column prop="phone" label="操作" width="80">
  68. <template slot-scope="scope">
  69. <el-button
  70. type="text"
  71. size="small"
  72. @click="jump('/task/answer_analysis?title=' + scope.row.name + '&id=' + scope.row.id)"
  73. >查看</el-button
  74. >
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. <Page ref="pageButton" :current="params.page" :page_size="params.page_size" :total="total" @pageChange="gopage" />
  79. </section>
  80. </template>
  81. <script>
  82. import Page from "../../components/Page";
  83. export default {
  84. components: {
  85. Page,
  86. },
  87. data() {
  88. return {
  89. params: {
  90. cid: '',
  91. year: "",
  92. page: 1,
  93. page_size: 10,
  94. mtype: "work",
  95. },
  96. value1: "",
  97. yearL: [],
  98. classL: [],
  99. tableData: [],
  100. total: 0,
  101. navKey: 2,
  102. };
  103. },
  104. methods: {
  105. gopage(size) {
  106. if (size) {
  107. this.params.page_size = size;
  108. }
  109. this.params.page = this.$refs.pageButton.page;
  110. this.get_list();
  111. },
  112. //筛选
  113. nav_change() {
  114. // this.getList();
  115. },
  116. //折线图
  117. getList() {
  118. var obj = {};
  119. var that = this;
  120. if (this.params.year) {
  121. obj.year = this.params.year;
  122. }
  123. obj.cid = this.params.cid?obj.cid=this.params.cid:0;
  124. this.$api.getStatistic(obj).then((res) => {
  125. if (res.errcode == 0) {
  126. if (that.navKey == 2) {
  127. this.drawLine(
  128. res.data.avg_score.x,
  129. res.data.score.y,
  130. res.data.high_score.y,
  131. res.data.avg_score.y,
  132. res.data.low_scores.y
  133. );
  134. }
  135. }else{
  136. that.$message.warning(res.mess)
  137. }
  138. });
  139. if (!this.params.year) {
  140. delete this.params.year;
  141. }
  142. this.get_list(this.params);
  143. },
  144. jump(url) {
  145. if (url) {
  146. this.$router.push(url);
  147. }
  148. },
  149. get_list(obj1) {
  150. // if (!obj1.cid) {
  151. // delete obj1.cid;
  152. // }
  153. this.$api.getMarkTaskList(this.params).then((res) => {
  154. if (res.data.code == 0) {
  155. this.tableData = res.data.data.list;
  156. this.total = res.data.data.total;
  157. }
  158. });
  159. },
  160. //分页
  161. handleCurrentChange(val) {
  162. this.params.page = val;
  163. this.getList();
  164. },
  165. drawLine(xdata, ydata1, ydata2, ydata3, ydata4) {
  166. let myChart = this.$echarts.init(document.getElementById("myChart"));
  167. // 绘制图表
  168. myChart.setOption({
  169. color: ["#80FFA5", "#00DDFF", "#37A2FF", "#FF0087", "#FFBF00"],
  170. tooltip: {
  171. trigger: "axis",
  172. axisPointer: {
  173. type: "line",
  174. label: {
  175. backgroundColor: "#6a7985",
  176. },
  177. },
  178. },
  179. title: {
  180. text: "作业分数分布",
  181. padding: [2, 0, 0, 21],
  182. },
  183. grid: {
  184. left: "0%",
  185. right: "4%",
  186. bottom: "3%",
  187. containLabel: true,
  188. },
  189. xAxis: [
  190. {
  191. type: "category",
  192. boundaryGap: false,
  193. data: xdata,
  194. axisLine: {
  195. lineStyle: {
  196. color: "#D9D9D9",
  197. },
  198. },
  199. axisLabel: {
  200. //x轴文字的配置
  201. show: true,
  202. textStyle: {
  203. color: "#999",
  204. fontSize: 13,
  205. align: "center",
  206. },
  207. },
  208. axisTick: {
  209. show: false,
  210. },
  211. },
  212. ],
  213. yAxis: [
  214. {
  215. type: "value",
  216. axisLabel: {
  217. formatter: "{value}",
  218. textStyle: {
  219. color: "#999",
  220. },
  221. },
  222. splitLine: {
  223. show: true,
  224. lineStyle: {
  225. type: "dashed",
  226. color: "#D9D9D9",
  227. },
  228. },
  229. axisTick: {
  230. //y轴刻度线
  231. show: false,
  232. },
  233. axisLine: {
  234. //y轴
  235. show: false,
  236. },
  237. axisLabel: {
  238. //x轴文字的配置
  239. show: true,
  240. margin: 40,
  241. textStyle: {
  242. color: "#999",
  243. fontSize: 13,
  244. align: "left",
  245. },
  246. },
  247. },
  248. ],
  249. legend: {
  250. // orient: 'vertical',
  251. left: "right",
  252. top: "top",
  253. padding: [5, 40, 0, 0],
  254. data: ["满分", "最高分", "平均分", "最低分"],
  255. },
  256. series: [
  257. {
  258. name: "满分",
  259. type: "line",
  260. lineStyle: {
  261. width: 0,
  262. color: "#eee",
  263. },
  264. showSymbol: false,
  265. itemStyle: {
  266. normal: {
  267. color: "#1839E0",
  268. lineStyle: {
  269. width: 2,
  270. color: "#1839E0",
  271. type: "dotted", //'dotted'虚线 'solid'实线
  272. },
  273. },
  274. },
  275. smooth: true,
  276. data: ydata1,
  277. },
  278. {
  279. name: "最高分",
  280. type: "line",
  281. showSymbol: false,
  282. itemStyle: {
  283. normal: {
  284. color: "#FA0A2F", //改变折线点的颜色
  285. },
  286. },
  287. smooth: true,
  288. data: ydata2,
  289. },
  290. {
  291. name: "平均分",
  292. type: "line",
  293. showSymbol: false,
  294. itemStyle: {
  295. normal: {
  296. color: "#FFB95F", //改变折线点的颜色
  297. },
  298. },
  299. smooth: true,
  300. data: ydata3,
  301. },
  302. {
  303. name: "最低分",
  304. type: "line",
  305. showSymbol: false,
  306. itemStyle: {
  307. normal: {
  308. color: "#26C999", //改变折线点的颜色
  309. },
  310. },
  311. smooth: true,
  312. data: ydata4,
  313. },
  314. ],
  315. });
  316. },
  317. },
  318. created() {
  319. this.get_list();
  320. },
  321. };
  322. </script>
  323. <style>
  324. .prosss_box .el-progress.el-progress--line {
  325. width: 88px;
  326. margin: auto 5px auto 0;
  327. }
  328. .prosss_box .el-progress-bar {
  329. padding-right: 0;
  330. }
  331. .prosss_box .el-progress__text {
  332. display: none;
  333. }
  334. .prosss_box{
  335. display:flex;
  336. }
  337. </style>