ExamSituation.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. <!-- 考试情况统计 -->
  2. <template>
  3. <div class="exam-situation-card">
  4. <div class="card-header">
  5. <span class="card-title">考试情况统计</span>
  6. <div class="header-right">
  7. <el-select v-model="valueYear" @change="topChange()" size="small" style="width:220px">
  8. <el-option
  9. v-for="dict in optionList"
  10. :key="dict.value"
  11. :label="dict.label"
  12. :value="dict.value"
  13. />
  14. </el-select>
  15. <!-- 分组按钮 -->
  16. <div class="table-top-button-box">
  17. <div>
  18. <p @click="checkButton(3)" :class="checkIndex == 3?'check-table-button':''">本科</p>
  19. <p @click="checkButton(2)" :class="checkIndex == 2?'check-table-button':''">硕士研究生</p>
  20. <p @click="checkButton(4)" :class="checkIndex == 4?'check-table-button':''">博士研究生</p>
  21. <p @click="checkButton(1)" :class="checkIndex == 1?'check-table-button':''">教职工</p>
  22. </div>
  23. </div>
  24. <!-- 导出按钮 -->
  25. <p class="export-btn" @click="exportButton()">
  26. <i class="el-icon-download"></i> 导出数据
  27. </p>
  28. </div>
  29. </div>
  30. <!-- 图表区 -->
  31. <div class="chart-area">
  32. <!-- 堆叠柱状图 -->
  33. <p class="bar-chart-wrap" v-if="!chartData.deptStats[0]" style="color:#999;font-size:14px;line-height:260px;text-align: center;">暂无数据</p>
  34. <div class="bar-chart-wrap" v-if="chartData.deptStats[0]" id="bar-chart-wrap" ref="barChart"></div>
  35. <!-- 环形图 -->
  36. <p class="pie-chart-wrap" v-if="!chartData.deptStats[0]" style="color:#999;font-size:14px;line-height:260px;text-align: center;">暂无数据</p>
  37. <div class="pie-chart-wrap" v-if="chartData.deptStats[0]" id="pie-chart-wrap" ref="pieChart"></div>
  38. </div>
  39. <!-- 筛选 -->
  40. <div class="filter-row">
  41. <!--<el-cascader-->
  42. <!--v-if="adminType == 1"-->
  43. <!--style="width: 180px"-->
  44. <!--clearable-->
  45. <!--v-model="queryParams.deptId"-->
  46. <!--:options="optionListA"-->
  47. <!--:props="{-->
  48. <!--emitPath:false,-->
  49. <!--checkStrictly: true,-->
  50. <!--value: 'deptId',-->
  51. <!--label: 'deptName',-->
  52. <!--children: 'child',-->
  53. <!--}"-->
  54. <!--:show-all-levels="false"-->
  55. <!--filterable-->
  56. <!--placeholder="筛选学院"-->
  57. <!--@change="queryParamsChange"-->
  58. <!--&gt;</el-cascader>-->
  59. <el-select v-if="adminType == 1"
  60. @change="queryParamsChange"
  61. clearable v-model="queryParams.deptId" placeholder="学院" style="width: 180px">
  62. <el-option
  63. v-for="dict in optionListA"
  64. :key="dict.deptId"
  65. :label="dict.deptName"
  66. :value="dict.deptId"
  67. />
  68. </el-select>
  69. <el-select
  70. @change="queryParamsChange"
  71. v-model="queryParams.examTypeId" clearable placeholder="考试类型" style="width: 160px">
  72. <el-option
  73. v-for="dict in optionListB"
  74. :key="dict.id"
  75. :label="dict.examTypeName"
  76. :value="dict.id"
  77. />
  78. </el-select>
  79. </div>
  80. <!-- 统计表格 -->
  81. <div class="page-content-box">
  82. <el-table class="table-box" :data="dataList" border :span-method="objectSpanMethod">
  83. <el-table-column prop="deptName" label="学院">
  84. <template slot-scope="scope">
  85. <span :style="scope.row.type == 3?'color:#184c93;font-weight:700;':''">{{scope.row.deptName}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="examTypeName" label="考试类型" width="200">
  89. <template slot-scope="scope">
  90. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.examTypeName}}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop="expectedCount" label="应考人数" width="160" align="center">
  94. <template slot-scope="scope">
  95. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.expectedCount}}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column prop="examCount" label="实考人数" width="160" align="center">
  99. <template slot-scope="scope">
  100. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.examCount}}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column prop="passedCount" label="通过人数" width="160" align="center">
  104. <template slot-scope="scope">
  105. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.passedCount}}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop="notPassedCount" label="未通过人数" width="160" align="center">
  109. <template slot-scope="scope">
  110. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.notPassedCount}}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="absentCount" label="未考人数" width="160" align="center">
  114. <template slot-scope="scope">
  115. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.absentCount}}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column prop="passRate" label="通过率" width="160" align="center">
  119. <template slot-scope="scope">
  120. <span :style="scope.row.type == 2?'color:#184c93;font-weight:700;':''">{{scope.row.passRate}}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="操作" width="200" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. <div class="table-button-box">
  126. <p class="table-button-null"></p>
  127. <p class="table-button-p"
  128. v-if="scope.row.type != 2"
  129. @click="tableButton(1,scope.row)"
  130. >人员明细</p>
  131. <p class="table-button-null"></p>
  132. </div>
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <pagination :page-sizes="[20, 30, 40, 50]"
  137. v-show="total>0"
  138. :total="total"
  139. :page.sync="queryParams.page"
  140. :limit.sync="queryParams.pageSize"
  141. @pagination="examElStatisticsExamGroupedList"
  142. />
  143. </div>
  144. <el-drawer
  145. size="100%"
  146. custom-class="examSituation-index-drawer"
  147. :append-to-body="true"
  148. :title="drawerTitle"
  149. ref="drawer"
  150. :visible.sync="drawer"
  151. @close="drawerReturnButton"
  152. direction="rtl">
  153. <userListPage :drawerPropsData="drawerPropsData" v-if="drawerType == 1"></userListPage>
  154. </el-drawer>
  155. </div>
  156. </template>
  157. <script>
  158. import echarts from 'echarts'
  159. import {
  160. systemUserGetPost,
  161. } from "@/api/basicsModules/index";
  162. import {
  163. examElStatisticsGetAcademicYear,examElStatisticsExamGroupedList,examElStatisticsExamGroupedChart,
  164. examElExamTypeList,systemDeptCurrentDept,
  165. } from "@/api/safetyEducationExaminationNew/index";
  166. import userListPage from "./userListPage.vue";
  167. export default {
  168. name: 'ExamSituation',
  169. components: {
  170. userListPage,
  171. },
  172. data() {
  173. return {
  174. adminType:0,
  175. chartData: {
  176. deptStats:[],
  177. barGroups: []
  178. },
  179. chartList:[],
  180. spanMap: {},
  181. optionList:[],
  182. optionListA:[],
  183. optionListB:[],
  184. valueYear:'',
  185. checkIndex:3,
  186. queryParams:{
  187. page:1,
  188. pageSize:20,
  189. deptId:'',
  190. examTypeId:'',
  191. },
  192. dataList:[],
  193. total:0,
  194. //弹窗相关
  195. drawerTitle: '',
  196. drawerType: '',
  197. drawer: false,
  198. drawerPropsData:{},
  199. }
  200. },
  201. created() {
  202. },
  203. mounted() {
  204. this.systemUserGetPost();
  205. },
  206. beforeDestroy() {
  207. if (this._barChart) this._barChart.dispose()
  208. if (this._pieChart) this._pieChart.dispose()
  209. },
  210. methods: {
  211. //操作按钮
  212. tableButton(type,row){
  213. if(type == 1){
  214. this.$set(this, 'drawerTitle', row.examTypeName+'人员明细')
  215. let obj = {
  216. adminType:this.adminType,
  217. valueYear:this.valueYear,
  218. personType:this.checkIndex,
  219. deptId:row.deptId,
  220. examTypeId:row.examTypeId,
  221. }
  222. this.$set(this, 'drawerPropsData', obj)
  223. this.$set(this, 'drawerType', 1)
  224. this.$set(this, 'drawer', true)
  225. }
  226. },
  227. //弹窗返回
  228. drawerReturnButton(){
  229. this.$set(this, 'drawerType', 0)
  230. },
  231. //查询当前登录用户身份-校级/院级
  232. systemUserGetPost(){
  233. systemUserGetPost({}).then(response => {
  234. for(let i=0;i<response.data.length;i++){
  235. if(response.data[i].postCode == 'school_level_admin'){
  236. if(response.data[i].isPost){
  237. this.$set(this,'adminType','1');
  238. }
  239. }else if(response.data[i].postCode == 'college_admin'){
  240. if(response.data[i].isPost){
  241. this.$set(this,'adminType','2');
  242. }
  243. }
  244. }
  245. this.examElExamTypeList();
  246. this.systemDeptCurrentDept();
  247. this.examElStatisticsGetAcademicYear();
  248. });
  249. },
  250. //导出
  251. exportButton(){
  252. let self = this;
  253. self.$confirm(`确认导出数据?`, "提示", {
  254. confirmButtonText: "确定",
  255. cancelButtonText: "取消",
  256. type: "warning"
  257. }).then(async () => {
  258. let obj = {
  259. academicYear:this.valueYear,
  260. personType:this.checkIndex,
  261. examTypeId:this.queryParams.examTypeId,
  262. };
  263. if(this.adminType == 1){
  264. obj.deptId = this.queryParams.deptId;
  265. }else{
  266. obj.deptId = localStorage.getItem('deptId');
  267. }
  268. self.download('/exam/elStatistics/exam/grouped/list-export', {...obj}, '考试情况统计.xlsx')
  269. }).catch(() => {})
  270. },
  271. //图表
  272. initBarChart() {
  273. const groups = this.chartData.deptStats
  274. const chart = echarts.init(this.$refs.barChart)
  275. this._barChart = chart
  276. const PAGE_SIZE = 6 // 每屏最多 6 个学院
  277. // ① 展平数据,并在每个学院的分组之间插入一个空槽位(形成组间距)
  278. const categories = []
  279. groups.forEach((g, gi) => {
  280. (g.examTypeGroup || []).forEach(t => {
  281. categories.push({
  282. deptName: g.deptName,
  283. examTypeName: t.examTypeName,
  284. passedCount: t.passedCount,
  285. notPassedCount: t.notPassedCount,
  286. absentCount: t.absentCount,
  287. isGap: false,
  288. })
  289. })
  290. // 最后一个学院后面不再插空槽
  291. if (gi < groups.length - 1) {
  292. categories.push({ isGap: true })
  293. }
  294. })
  295. // 每个学院下的考试类型数量(不写死 3)
  296. const examTypeCount = groups.length
  297. ? Math.max(...groups.map(g => (g.examTypeGroup || []).length))
  298. : 1
  299. // ② 每屏窗口:6 个学院 × (考试类型数 + 1 个空槽) - 尾部空槽
  300. const pageSpan = Math.min(PAGE_SIZE * (examTypeCount + 1) - 2, categories.length - 1)
  301. // ③ 第二根轴:学院名放在每组中间位置
  302. const middle = Math.floor(examTypeCount / 2)
  303. const groupAxisData = categories.map((c, i) => {
  304. if (c.isGap) return ''
  305. const posInGroup = i % (examTypeCount + 1)
  306. return posInGroup === middle ? c.deptName : ''
  307. })
  308. chart.setOption({
  309. legend: {
  310. data: ['通过', '未通过', '未考'],
  311. top: 10,
  312. itemWidth: 14,
  313. itemHeight: 14,
  314. textStyle: { fontSize: 12, color: '#555' },
  315. },
  316. grid: { top: 60, bottom: 90, left: 40, right: 10, containLabel: false },
  317. xAxis: [
  318. {
  319. // 柱子定位用,不显示标签
  320. type: 'category',
  321. data: categories.map(c => c.examTypeName || ''),
  322. axisLine: { show: false },
  323. axisLabel: { show: false },
  324. axisTick: { show: false },
  325. },
  326. {
  327. // 只显示学院名
  328. type: 'category',
  329. data: groupAxisData,
  330. position: 'bottom',
  331. offset: 8,
  332. axisLine: { lineStyle: { color: '#ddd' } },
  333. axisTick: { show: false },
  334. axisLabel: {
  335. fontSize: 11,
  336. color: '#666',
  337. interval: 0,
  338. rotate: 25,
  339. fontWeight: 600,
  340. },
  341. },
  342. ],
  343. yAxis: {
  344. type: 'value',
  345. max: (value) => {
  346. // value.max 是三个 series 中的最大值,向上取整到 50 的倍数
  347. return Math.ceil(value.max / 50) * 50
  348. },
  349. splitNumber:5,
  350. splitLine: { lineStyle: { color: '#f0f0f0' } },
  351. axisLabel: { fontSize: 11, color: '#aaa' },
  352. axisLine: { show: false },
  353. axisTick: { show: false },
  354. },
  355. dataZoom: [
  356. {
  357. type: 'slider',
  358. xAxisIndex: [0, 1],
  359. startValue: 0,
  360. endValue: pageSpan,
  361. height: 18,
  362. bottom: 8,
  363. borderColor: '#e0e0e0',
  364. fillerColor: 'rgba(79, 190, 126, 0.15)',
  365. handleStyle: { color: '#4fbe7e' },
  366. moveHandleStyle: { color: '#4fbe7e' },
  367. textStyle: { color: '#aaa', fontSize: 10 },
  368. brushSelect: false,
  369. },
  370. {
  371. type: 'inside',
  372. xAxisIndex: [0, 1],
  373. startValue: 0,
  374. endValue: pageSpan,
  375. zoomLock: true,
  376. },
  377. ],
  378. series: [
  379. {
  380. name: '通过',
  381. type: 'bar',
  382. stack: 'total',
  383. xAxisIndex: 0,
  384. barMaxWidth: 40,
  385. data: categories.map(c => (c.isGap ? null : c.passedCount)),
  386. itemStyle: { color: '#4fbe7e' },
  387. label: { show: true, position: 'inside', fontSize: 12, color: '#fff',
  388. formatter: (p) => p.value > 0 ? p.value : '' },
  389. },
  390. {
  391. name: '未通过',
  392. type: 'bar',
  393. stack: 'total',
  394. xAxisIndex: 0,
  395. barMaxWidth: 40,
  396. data: categories.map(c => (c.isGap ? null : c.notPassedCount)),
  397. itemStyle: { color: '#f56c6c' },
  398. label: { show: true, position: 'inside', fontSize: 12, color: '#fff',
  399. formatter: (p) => p.value > 0 ? p.value : '' },
  400. },
  401. {
  402. name: '未考',
  403. type: 'bar',
  404. stack: 'total',
  405. xAxisIndex: 0,
  406. barMaxWidth: 40,
  407. data: categories.map(c => (c.isGap ? null : c.absentCount)),
  408. itemStyle: { color: '#c0c4cc' },
  409. label: { show: true, position: 'inside', fontSize: 12, color: '#fff',
  410. formatter: (p) => p.value > 0 ? p.value : '' },
  411. },
  412. ],
  413. tooltip: {
  414. trigger: 'axis',
  415. axisPointer: { type: 'shadow' },
  416. formatter: (params) => {
  417. if (!params || !params.length) return ''
  418. const c = categories[params[0].dataIndex]
  419. if (!c || c.isGap) return '' // 空槽位不弹提示
  420. // let html = `<div style="font-weight:600;margin-bottom:4px">${c.deptName} · ${c.examTypeName}</div>`
  421. let html = `<div style="font-weight:600;margin-bottom:4px">${c.examTypeName}</div>`
  422. params.forEach(p => {
  423. html += `<div>${p.marker}${p.seriesName}:<b>${p.value}</b></div>`
  424. })
  425. return html
  426. },
  427. },
  428. })
  429. },
  430. //图表
  431. initPieChart() {
  432. const pass = this.chartData.totalPassed
  433. const fail = this.chartData.totalNotPassed
  434. const notExam = this.chartData.totalAbsent
  435. const chart = echarts.init(this.$refs.pieChart)
  436. this._pieChart = chart
  437. chart.setOption({
  438. legend: {
  439. orient: 'horizontal',
  440. bottom: 0,
  441. data: ['通过', '未通过', '未考'],
  442. itemWidth: 12,
  443. itemHeight: 12,
  444. textStyle: { fontSize: 12, color: '#555' },
  445. },
  446. series: [
  447. {
  448. type: 'pie',
  449. radius: ['45%', '68%'],
  450. center: ['50%', '45%'],
  451. label: {
  452. formatter: '{b}',
  453. fontSize: 12,
  454. color: '#555',
  455. },
  456. labelLine: { length: 12, length2: 8 },
  457. data: [
  458. { value: pass, name: '通过', itemStyle: { color: '#4fbe7e' } },
  459. { value: fail, name: '未通过', itemStyle: { color: '#f56c6c' } },
  460. { value: notExam, name: '未考', itemStyle: { color: '#c0c4cc' } },
  461. ],
  462. emphasis: {
  463. itemStyle: { shadowBlur: 6, shadowOffsetX: 0, shadowColor: 'rgba(0,0,0,0.2)' }
  464. },
  465. },
  466. ],
  467. tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' },
  468. })
  469. },
  470. //顶部学年切换
  471. topChange(){
  472. this.$set(this.queryParams,'page',1);
  473. this.examElStatisticsExamGroupedChart();
  474. this.examElStatisticsExamGroupedList();
  475. },
  476. //身份切换
  477. checkButton(val){
  478. if(this.checkIndex!=val){
  479. this.$set(this,'checkIndex',val);
  480. this.$set(this.queryParams,'page',1);
  481. this.examElStatisticsExamGroupedChart();
  482. this.examElStatisticsExamGroupedList();
  483. }
  484. },
  485. //条件变更
  486. queryParamsChange(){
  487. this.$set(this.queryParams,'page',1);
  488. this.examElStatisticsExamGroupedChart();
  489. this.examElStatisticsExamGroupedList();
  490. },
  491. //数据合并
  492. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  493. // 只对第一列(学院列,columnIndex === 0)进行合并
  494. if (columnIndex === 0) {
  495. const list = this.dataList;
  496. // 如果是第一行,或者当前行的学院与上一行的学院不同,则开始合并计算
  497. if (rowIndex === 0 || row.deptName !== list[rowIndex - 1].deptName) {
  498. let rowspan = 1;
  499. // 向下遍历,统计有多少行是相同的学院
  500. for (let i = rowIndex + 1; i < list.length; i++) {
  501. if (list[i].deptName === row.deptName) {
  502. rowspan++;
  503. } else {
  504. break; // 遇到不同的学院,停止计算
  505. }
  506. }
  507. return { rowspan, colspan: 1 };
  508. } else {
  509. // 如果当前行的学院与上一行相同,则隐藏当前单元格(被合并了)
  510. return { rowspan: 0, colspan: 0 };
  511. }
  512. }
  513. // 其他列正常显示
  514. return { rowspan: 1, colspan: 1 };
  515. },
  516. //考试统计图表
  517. examElStatisticsExamGroupedChart(){
  518. let obj = {
  519. academicYear:this.valueYear,
  520. personType:this.checkIndex,
  521. }
  522. if(this.adminType == 1){
  523. obj.deptId = this.queryParams.deptId;
  524. }else if(this.adminType == 2){
  525. obj.deptId = localStorage.getItem('deptId');
  526. }
  527. examElStatisticsExamGroupedChart(obj).then(response => {
  528. this.$set(this,'chartData',response.data);
  529. this.$nextTick(() => {
  530. if(response.data.deptStats[0]){
  531. this.$nextTick(() => {
  532. this.initBarChart()
  533. this.initPieChart()
  534. })
  535. }
  536. })
  537. });
  538. },
  539. //考试统计列表
  540. examElStatisticsExamGroupedList(){
  541. let obj = {
  542. page:this.queryParams.page,
  543. pageSize:this.queryParams.pageSize,
  544. academicYear:this.valueYear,
  545. personType:this.checkIndex,
  546. examTypeId:this.queryParams.examTypeId,
  547. }
  548. if(this.adminType == 1){
  549. obj.deptId = this.queryParams.deptId;
  550. }else{
  551. obj.deptId = localStorage.getItem('deptId');
  552. }
  553. examElStatisticsExamGroupedList(obj).then(response => {
  554. // this.$set(this,'dataList',response.data.records);
  555. let list = [];
  556. for(let i=0;i<response.data.deptStats.length;i++){
  557. for(let o=0;o<response.data.deptStats[i].examTypeGroup.length;o++){
  558. list.push({
  559. deptName:response.data.deptStats[i].deptName,
  560. deptId:response.data.deptStats[i].deptId,
  561. examTypeId:response.data.deptStats[i].examTypeGroup[o].examTypeId,
  562. examTypeName:response.data.deptStats[i].examTypeGroup[o].examTypeName,
  563. expectedCount:response.data.deptStats[i].examTypeGroup[o].expectedCount,
  564. examCount:response.data.deptStats[i].examTypeGroup[o].examCount,
  565. passedCount:response.data.deptStats[i].examTypeGroup[o].passedCount,
  566. notPassedCount:response.data.deptStats[i].examTypeGroup[o].notPassedCount,
  567. absentCount:response.data.deptStats[i].examTypeGroup[o].absentCount,
  568. passRate:response.data.deptStats[i].examTypeGroup[o].passRate,
  569. type:1,
  570. })
  571. }
  572. list.push({
  573. deptName:response.data.deptStats[i].deptName,
  574. examTypeName:'汇总',
  575. expectedCount:response.data.deptStats[i].summary.expectedCount,
  576. examCount:response.data.deptStats[i].summary.examCount,
  577. passedCount:response.data.deptStats[i].summary.passedCount,
  578. notPassedCount:response.data.deptStats[i].summary.notPassedCount,
  579. absentCount:response.data.deptStats[i].summary.absentCount,
  580. passRate:response.data.deptStats[i].summary.passRate,
  581. type:2,
  582. })
  583. }
  584. if(this.adminType == 1&&!this.queryParams.deptId){
  585. for(let o=0;o<response.data.schoolStats.examTypeGroup.length;o++){
  586. list.push({
  587. deptName:response.data.schoolStats.deptName,
  588. deptId:'',
  589. examTypeId:response.data.schoolStats.examTypeGroup[o].examTypeId,
  590. examTypeName:response.data.schoolStats.examTypeGroup[o].examTypeName,
  591. expectedCount:response.data.schoolStats.examTypeGroup[o].expectedCount,
  592. examCount:response.data.schoolStats.examTypeGroup[o].examCount,
  593. passedCount:response.data.schoolStats.examTypeGroup[o].passedCount,
  594. notPassedCount:response.data.schoolStats.examTypeGroup[o].notPassedCount,
  595. absentCount:response.data.schoolStats.examTypeGroup[o].absentCount,
  596. passRate:response.data.schoolStats.examTypeGroup[o].passRate,
  597. type:3,
  598. })
  599. }
  600. list.push({
  601. deptName:response.data.schoolStats.deptName,
  602. examTypeName:'汇总',
  603. expectedCount:response.data.schoolStats.summary.expectedCount,
  604. examCount:response.data.schoolStats.summary.examCount,
  605. passedCount:response.data.schoolStats.summary.passedCount,
  606. notPassedCount:response.data.schoolStats.summary.notPassedCount,
  607. absentCount:response.data.schoolStats.summary.absentCount,
  608. passRate:response.data.schoolStats.summary.passRate,
  609. type:2,
  610. })
  611. }
  612. this.$set(this,'dataList',list);
  613. this.$set(this,'total',response.data.total);
  614. });
  615. },
  616. //查询全部考试类型
  617. examElExamTypeList(){
  618. examElExamTypeList({}).then(response => {
  619. let list = [];
  620. for(let i=0;i<response.data.length;i++){
  621. if(response.data[i].examTypeCode == 'CLASSIFIED' || response.data[i].examTypeCode == 'yzyh' || response.data[i].examTypeCode == 'STUDENT'){
  622. list.push(response.data[i]);
  623. }
  624. }
  625. this.$set(this,'optionListB',list);
  626. });
  627. },
  628. //学院列表
  629. systemDeptCurrentDept(){
  630. systemDeptCurrentDept({}).then(response => {
  631. const list = response.data || [];
  632. this.formatTreeData(list);
  633. if(list[0]){
  634. this.$set(this,'optionListA',list[0].child);
  635. }else{
  636. this.$set(this,'optionListA',[]);
  637. }
  638. });
  639. },
  640. //学年列表
  641. examElStatisticsGetAcademicYear(){
  642. examElStatisticsGetAcademicYear({}).then(response => {
  643. this.$set(this,'optionList',response.data);
  644. this.$set(this,'valueYear',response.data[0].value);
  645. this.examElStatisticsExamGroupedList();
  646. this.examElStatisticsExamGroupedChart();
  647. });
  648. },
  649. }
  650. }
  651. </script>
  652. <style scoped lang="scss">
  653. .exam-situation-card {
  654. background: #fff;
  655. /*border-radius: 6px;*/
  656. padding: 20px;
  657. margin-bottom: 12px;
  658. /*box-shadow: 0 1px 4px rgba(0,0,0,0.06);*/
  659. background: rgba(255, 255, 255, 0.95);
  660. border: 1px solid #e8edf5;
  661. border-radius: 16px;
  662. box-shadow: 0 4px 20px rgba(37, 50, 74, 0.06);
  663. .card-header {
  664. display: flex;
  665. justify-content: space-between;
  666. align-items: center;
  667. margin-bottom: 16px;
  668. .card-title { font-size: 16px; font-weight: 700; color: #222; }
  669. .header-right { display: flex; align-items: center; gap: 20px; }
  670. }
  671. /* 分组筛选按钮 */
  672. .table-top-button-box {
  673. display: inline-block;
  674. vertical-align: top;
  675. div {
  676. display: flex;
  677. p {
  678. border: 1px solid #DCDFE6;
  679. padding:0 20px;
  680. /*width: 80px;*/
  681. text-align: center;
  682. height: 40px;
  683. line-height: 40px;
  684. cursor: pointer;
  685. font-size: 14px;
  686. &:nth-child(1) { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
  687. &:nth-child(2) { border-left: none; border-right: none; }
  688. &:nth-child(3) { border-right: none; }
  689. &:nth-child(4) { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
  690. }
  691. .check-table-button{
  692. border: 1px solid #0183fa!important;
  693. background-color: #0183fa!important;;
  694. color:#fff!important;;
  695. }
  696. }
  697. }
  698. /* 导出按钮 */
  699. .export-btn {
  700. display: inline-block;
  701. padding: 0 16px;
  702. height: 40px;
  703. line-height: 40px;
  704. border-radius: 4px;
  705. font-size: 14px;
  706. cursor: pointer;
  707. background-color: #0183fa;
  708. color: #fff;
  709. border: 1px solid #0183fa;
  710. }
  711. .chart-area {
  712. display: flex;
  713. gap: 0;
  714. margin-bottom: 16px;
  715. border: 1px solid #eee;
  716. border-radius: 6px;
  717. overflow: hidden;
  718. .bar-chart-wrap {
  719. flex: 1;
  720. height: 280px;
  721. border-right: 1px solid #eee;
  722. }
  723. .pie-chart-wrap {
  724. width: 320px;
  725. height: 280px;
  726. }
  727. }
  728. .filter-row {
  729. display: flex;
  730. gap: 20px;
  731. margin-bottom: 12px;
  732. }
  733. .page-content-box{
  734. height:500px;
  735. padding:0;
  736. ::v-deep .el-table--medium td:nth-child(1){
  737. border-left:1px solid #dfe6ec!important;
  738. }
  739. ::v-deep .el-table__row:nth-child(4n){
  740. /*border-left:none!important;*/
  741. /*color:#184c93;*/
  742. /*background-color: #edf5ff;*/
  743. }
  744. }
  745. .link-blue { color: #409eff; }
  746. }
  747. </style>
  748. <style lang="scss">
  749. .examSituation-index-drawer{
  750. .el-drawer__body{
  751. padding:0;
  752. }
  753. .el-drawer__header{
  754. margin:0;
  755. }
  756. }
  757. </style>