DetailStudentTarget.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <el-dialog
  3. class="page-dialog"
  4. :visible.sync="modalIsShow"
  5. :close-on-click-modal="false"
  6. :close-on-press-escape="false"
  7. append-to-body
  8. fullscreen
  9. >
  10. <div slot="title">{{ rowData.name }}毕业要求达成情况</div>
  11. <div class="part-box part-box-pad">
  12. <div class="part-title">
  13. <h2>个人与本院对比情况</h2>
  14. <div class="chart-box" style="height: 400px">
  15. <v-chart v-if="chartOption" :option="chartOption"></v-chart>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="part-box part-box-pad">
  20. <div class="part-title">
  21. <h2>个人毕业要求达成度情况</h2>
  22. </div>
  23. <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
  24. <el-form-item label-width="0px">
  25. <semester-select v-model="filter.semesterId"></semester-select>
  26. </el-form-item>
  27. <el-form-item label-width="0px">
  28. <el-button type="primary" @click="search">查询</el-button>
  29. </el-form-item>
  30. </el-form>
  31. <el-table ref="TableList" :data="dataList">
  32. <el-table-column label="课程名称(代码)" min-width="200">
  33. <template slot-scope="scope">
  34. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="semesterName" label="所属学期">
  38. </el-table-column>
  39. <el-table-column prop="score" label="期末成绩"> </el-table-column>
  40. <el-table-column
  41. v-for="(column, cindex) in columns"
  42. :key="cindex"
  43. :label="column"
  44. >
  45. <template slot-scope="scope">
  46. {{ scope.row.requirements[cindex] }}
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. </div>
  51. <div slot="footer"></div>
  52. </el-dialog>
  53. </template>
  54. <script>
  55. import { studentTargetDetail } from "../../api";
  56. export default {
  57. name: "detail-requirement-statistics",
  58. props: {
  59. rowData: {
  60. type: Object,
  61. default() {
  62. return {};
  63. },
  64. },
  65. },
  66. data() {
  67. return {
  68. modalIsShow: false,
  69. dataList: [],
  70. chartOption: null,
  71. filter: { semesterId: "" },
  72. columns: [],
  73. tableData: [],
  74. };
  75. },
  76. methods: {
  77. cancel() {
  78. this.modalIsShow = false;
  79. },
  80. open() {
  81. this.modalIsShow = true;
  82. },
  83. async search() {
  84. const res = await studentTargetDetail({
  85. cultureProgramId: this.rowData.id,
  86. studentCode: this.rowData.studentCode,
  87. ...this.filter,
  88. });
  89. this.dataList = res.studentTotalRequirementList || [];
  90. this.updateChartOption();
  91. this.tableData = res.studentCourseRequirementList || [];
  92. this.columns = !this.tableData[0]
  93. ? []
  94. : this.tableData[0].requirementDetailList.map(
  95. (item) => item.requirementName
  96. );
  97. },
  98. updateChartOption() {
  99. const option = {
  100. color: ["#3a5ae5", "#fe5d4e"],
  101. grid: {
  102. left: 40,
  103. top: 40,
  104. right: 80,
  105. bottom: 50,
  106. containLabel: true,
  107. },
  108. legend: {
  109. top: 0,
  110. data: ["个人达成情况", "专业达成情况"],
  111. itemWidth: 12,
  112. itemHeight: 4,
  113. itemGap: 22,
  114. left: 40,
  115. },
  116. xAxis: {
  117. type: "category",
  118. name: "课程目标",
  119. nameTextStyle: {
  120. color: "#363D59",
  121. },
  122. data: this.dataList.map((item) => item.requirementName),
  123. axisLabel: {
  124. color: "#6F7482",
  125. interval: 0,
  126. fontSize: 12,
  127. margin: 12,
  128. },
  129. axisLine: {
  130. show: true,
  131. lineStyle: {
  132. color: "#EFF0F5",
  133. },
  134. },
  135. splitLine: {
  136. show: false,
  137. },
  138. axisTick: {
  139. show: false,
  140. },
  141. axisPointer: {
  142. type: "shadow",
  143. },
  144. },
  145. yAxis: {
  146. type: "value",
  147. name: "达成值",
  148. min: 0,
  149. max: 1,
  150. interval: 0.1,
  151. nameTextStyle: {
  152. color: "#363D59",
  153. },
  154. axisLabel: {
  155. color: "#6F7482",
  156. },
  157. axisLine: {
  158. lineStyle: {
  159. color: "#EFF0F5",
  160. },
  161. },
  162. splitLine: {
  163. lineStyle: {
  164. color: "#EFF0F5",
  165. },
  166. },
  167. },
  168. series: [
  169. {
  170. name: "个人达成情况",
  171. type: "bar",
  172. barWidth: 20,
  173. data: this.dataList.map((item) => item.studentDegree),
  174. },
  175. {
  176. name: "专业达成情况",
  177. type: "bar",
  178. barWidth: 20,
  179. data: this.dataList.map((item) => item.professionalDegree),
  180. },
  181. ],
  182. };
  183. this.chartOption = option;
  184. },
  185. },
  186. };
  187. </script>