|
@@ -1,426 +1,473 @@
|
|
|
<template>
|
|
|
- <div id="artIndex" ref="appRef">
|
|
|
- <div class="bg">
|
|
|
- <dv-loading v-if="loading">{{ $t('researchCenter.dashboard.loading') }}</dv-loading>
|
|
|
- <div v-else class="host-body">
|
|
|
- <!-- 实时北京时间 -->
|
|
|
- <div class="tools">
|
|
|
- <span class="time-text">{{ dateYear }} <span style="display: inline-block; margin: 0 5px;color: #0fa2fe;">{{ dateDay }}</span> </span>
|
|
|
- <span class="icon iconfont icon-download" v-if="!isNoData" style="font-size: 22px;margin-right:10px" :title="`下载艺术评测数据表`" @click="exportArtTable"></span>
|
|
|
- <span class="icon iconfont icon-tuichuquanping" style="font-size: 22px;" :title="$t('researchCenter.dashboard.quit')" @click="goBack"></span>
|
|
|
- </div>
|
|
|
- <!-- 学校基础信息 及 活动、科目选择 -->
|
|
|
- <div class="school-info">
|
|
|
- <img :src="schoolInfo.schoolLogo">
|
|
|
- <span class="school-info-name">{{ schoolInfo.schoolName }}</span>
|
|
|
- <span class="school-info-period">{{ schoolInfo.periodName }}</span>
|
|
|
- <span class="school-info-semester" v-if="!$route.params.artInfo">{{ schoolInfo.curSemester }}</span>
|
|
|
- <div style="margin-left: 15px">
|
|
|
- <Select v-model="activeAcIndex" @on-change="onAcChange">
|
|
|
- <Option v-for="(item,index) in acList" :value="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- <div class="dashboard-select-subject">
|
|
|
- <Select v-model="curSubjectIndex" @on-change="onSubjectChange">
|
|
|
- <Option v-for="(item,index) in subjectList" :value="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 头部标题 -->
|
|
|
- <div class="d-flex jc-center" style="margin-top:-5px">
|
|
|
- <dv-decoration-10 class="dv-dec-10" />
|
|
|
- <div class="d-flex jc-center">
|
|
|
- <dv-decoration-8 class="dv-dec-8" :color="['#568aea', '#000000']" />
|
|
|
- <div class="title">
|
|
|
- <span class="dash-title-text">艺术测评看板</span>
|
|
|
- <dv-decoration-6 class="dv-dec-6" :reverse="true" :color="['#50e3c2', '#67a1e5']" />
|
|
|
- </div>
|
|
|
- <dv-decoration-8 class="dv-dec-8" :reverse="true" :color="['#568aea', '#000000']" />
|
|
|
- </div>
|
|
|
- <dv-decoration-10 class="dv-dec-10-s" />
|
|
|
- </div>
|
|
|
- <div v-if="isNoData">
|
|
|
- <dv-border-box-12 class="no-data-wrap">
|
|
|
- <p style="color:#50e3c2">【 {{ artName }} 】</p>
|
|
|
- <p style="margin-top:20px">暂无评测数据</p>
|
|
|
- </dv-border-box-12>
|
|
|
- </div>
|
|
|
- <!-- 图表区域 -->
|
|
|
- <div class="body-box" v-if="!isNoData">
|
|
|
- <div class="left-box">
|
|
|
- <div class="left-box-top">
|
|
|
- <dv-border-box-12>
|
|
|
- <LeftTop />
|
|
|
- </dv-border-box-12>
|
|
|
- </div>
|
|
|
- <div class="left-box-center">
|
|
|
- <dv-border-box-12>
|
|
|
- <RightTop />
|
|
|
- </dv-border-box-12>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div id="artIndex" ref="appRef">
|
|
|
+ <div class="bg">
|
|
|
+ <dv-loading v-if="loading">{{ $t("researchCenter.dashboard.loading") }}</dv-loading>
|
|
|
+ <div v-else class="host-body">
|
|
|
+ <!-- 实时北京时间 -->
|
|
|
+ <div class="tools">
|
|
|
+ <Select v-model="semesterValue" @on-change="onSemesterChange" style="width: 160px; margin-right: 60px">
|
|
|
+ <Option v-for="(item, index) in semesterList" :value="index">{{ item.year }}{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ <!-- <span class="time-text">{{ dateYear }} <span style="display: inline-block; margin: 0 5px;color: #0fa2fe;">{{ dateDay }}</span> </span> -->
|
|
|
+ <span class="icon iconfont icon-download" v-if="!isNoData" style="font-size: 22px; margin-right: 10px" :title="`下载艺术评测数据表`" @click="exportArtTable"></span>
|
|
|
+ <span class="icon iconfont icon-tuichuquanping" style="font-size: 22px" :title="$t('researchCenter.dashboard.quit')" @click="goBack"></span>
|
|
|
+ </div>
|
|
|
+ <!-- 学校基础信息 及 活动、科目选择 -->
|
|
|
+ <div class="school-info">
|
|
|
+ <img :src="schoolInfo.schoolLogo" />
|
|
|
+ <span class="school-info-name">{{ schoolInfo.schoolName }}</span>
|
|
|
+ <span class="school-info-period">{{ schoolInfo.periodName }}</span>
|
|
|
+ <!-- <span class="school-info-semester" v-if="!$route.params.artInfo">{{ schoolInfo.curSemester }}</span> -->
|
|
|
+ <div style="margin-left: 15px">
|
|
|
+ <Select v-model="activeAcIndex" @on-change="onAcChange">
|
|
|
+ <Option v-for="(item, index) in acList" :value="index">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ <div class="dashboard-select-subject">
|
|
|
+ <Select v-model="curSubjectIndex" @on-change="onSubjectChange">
|
|
|
+ <Option v-for="(item, index) in subjectList" :value="index">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 头部标题 -->
|
|
|
+ <div class="d-flex jc-center" style="margin-top: -5px">
|
|
|
+ <dv-decoration-10 class="dv-dec-10" />
|
|
|
+ <div class="d-flex jc-center">
|
|
|
+ <dv-decoration-8 class="dv-dec-8" :color="['#568aea', '#000000']" />
|
|
|
+ <div class="title">
|
|
|
+ <span class="dash-title-text">艺术测评看板</span>
|
|
|
+ <dv-decoration-6 class="dv-dec-6" :reverse="true" :color="['#50e3c2', '#67a1e5']" />
|
|
|
+ </div>
|
|
|
+ <dv-decoration-8 class="dv-dec-8" :reverse="true" :color="['#568aea', '#000000']" />
|
|
|
+ </div>
|
|
|
+ <dv-decoration-10 class="dv-dec-10-s" />
|
|
|
+ </div>
|
|
|
+ <div v-if="isNoData">
|
|
|
+ <dv-border-box-12 class="no-data-wrap">
|
|
|
+ <p style="color: #50e3c2">【 {{ artName }} 】</p>
|
|
|
+ <p style="margin-top: 20px">暂无评测数据</p>
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ <div v-if="isNoAc">
|
|
|
+ <dv-border-box-12 class="no-data-wrap">
|
|
|
+ <p style="margin-top: 20px">该学期暂无评测记录</p>
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ <!-- 图表区域 -->
|
|
|
+ <div class="body-box" v-if="!isNoData">
|
|
|
+ <div class="left-box">
|
|
|
+ <div class="left-box-top">
|
|
|
+ <dv-border-box-12>
|
|
|
+ <LeftTop />
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ <div class="left-box-center">
|
|
|
+ <dv-border-box-12>
|
|
|
+ <RightTop />
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="right-box">
|
|
|
- <div class="right-box-top">
|
|
|
- <dv-border-box-12>
|
|
|
- <LeftBottom />
|
|
|
- </dv-border-box-12>
|
|
|
- </div>
|
|
|
- <div class="right-box-bottom">
|
|
|
- <div class="right-bottom-single">
|
|
|
- <dv-border-box-12>
|
|
|
- <RightBotL />
|
|
|
- </dv-border-box-12>
|
|
|
- </div>
|
|
|
- <div class="right-bottom-single">
|
|
|
- <dv-border-box-12>
|
|
|
- <RightBotR />
|
|
|
- </dv-border-box-12>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="right-box">
|
|
|
+ <div class="right-box-top">
|
|
|
+ <dv-border-box-12>
|
|
|
+ <LeftBottom />
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ <div class="right-box-bottom">
|
|
|
+ <div class="right-bottom-single">
|
|
|
+ <dv-border-box-12>
|
|
|
+ <RightBotL />
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ <div class="right-bottom-single">
|
|
|
+ <dv-border-box-12>
|
|
|
+ <RightBotR />
|
|
|
+ </dv-border-box-12>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import excel from '@/utils/excel.js'
|
|
|
-import RightBotR from '@/components/dashboard/art/RightBotR'
|
|
|
-import RightBotL from '@/components/dashboard/art/RightBotL'
|
|
|
-import LeftTop from '@/components/dashboard/art/LeftTop'
|
|
|
-import LeftCenter from '@/components/dashboard/art/LeftCenter'
|
|
|
-import LeftBottom from '@/components/dashboard/art/LeftBottom'
|
|
|
-import RightTop from '@/components/dashboard/art/RightTop'
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- artName: '',
|
|
|
- isNoData: false,
|
|
|
- activeAcIndex: 0,
|
|
|
- acList: [],
|
|
|
- curAcSummary: null,
|
|
|
- subjectList: [],
|
|
|
- activeMenu: 'music',
|
|
|
- activeClassIndex: -1,
|
|
|
- activeGradeIndex: 0,
|
|
|
- curSubjectIndex: 0,
|
|
|
- timing: null,
|
|
|
- loading: true,
|
|
|
- dateDay: null,
|
|
|
- dateYear: null,
|
|
|
- dateWeek: null,
|
|
|
- }
|
|
|
- },
|
|
|
- components: {
|
|
|
- RightBotR,
|
|
|
- RightBotL,
|
|
|
- LeftTop,
|
|
|
- LeftCenter,
|
|
|
- LeftBottom,
|
|
|
- RightTop,
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // setTimeout(() => {
|
|
|
- // this.$tools.fullScreen(document.getElementById('artIndex'))
|
|
|
- // }, 600)
|
|
|
- this.timeFn()
|
|
|
- },
|
|
|
- beforeDestroy() {
|
|
|
- clearInterval(this.timing)
|
|
|
- },
|
|
|
- created() {
|
|
|
- let params = this.$route.params
|
|
|
- /* 从区级选择任意一个学校跳转过来的 */
|
|
|
- console.log(params)
|
|
|
- if (params.artInfo) {
|
|
|
- this.findAreaSchoolAnalysis(params.artInfo)
|
|
|
- this.$tools.fullScreen(document.getElementById('artIndex'))
|
|
|
- } else {
|
|
|
- this.findArtList()
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /* 查询区级任意一个学校的艺术评测看板数据 */
|
|
|
- findAreaSchoolAnalysis(artInfo) {
|
|
|
- this.$api.areaArt.findArtSummary({
|
|
|
- id: artInfo.artId,
|
|
|
- code: artInfo.code
|
|
|
- }).then(
|
|
|
- (res) => {
|
|
|
- if (!res.error) {
|
|
|
- this.curAcSummary = res.art
|
|
|
- // 根据勾选的指标 展示表格的列 其中用户信息列和总分列是固定展示
|
|
|
- this.subjectList = res.art.subjects
|
|
|
- this.curSubjectIndex = 0
|
|
|
- let curSubjectId = this.subjectList[this.curSubjectIndex].id
|
|
|
- this.acList = [{
|
|
|
- id: artInfo.artId,
|
|
|
- name: res.art.name
|
|
|
- }]
|
|
|
- this.loading = true
|
|
|
- // 获取看板数据
|
|
|
- this.$api.areaArt.findArtDashAnalysis({
|
|
|
- "code": artInfo.code,
|
|
|
- "periodId": artInfo.perId,
|
|
|
- "subjectId": curSubjectId,
|
|
|
- "areaId": sessionStorage.getItem('areaId'),
|
|
|
- "id": artInfo.artId,
|
|
|
- "classIds": res.art.classes,
|
|
|
- 'examId': res.art.settings.find(i => i.id === 'quota_21').task.find(k => k.subject === curSubjectId).acId
|
|
|
- }).then(analysisRes => {
|
|
|
- console.log(`output->analysisRes`, analysisRes)
|
|
|
- this.artName = this.acList[this.activeAcIndex].name
|
|
|
- if (analysisRes.code === 500) {
|
|
|
- this.isNoData = true
|
|
|
- } else {
|
|
|
- this.isNoData = false
|
|
|
- // 保存到vuex
|
|
|
- this.$store.commit('artDashboard/setAnalysisJson', analysisRes)
|
|
|
- }
|
|
|
+ import excel from "@/utils/excel.js";
|
|
|
+ import RightBotR from "@/components/dashboard/art/RightBotR";
|
|
|
+ import RightBotL from "@/components/dashboard/art/RightBotL";
|
|
|
+ import LeftTop from "@/components/dashboard/art/LeftTop";
|
|
|
+ import LeftCenter from "@/components/dashboard/art/LeftCenter";
|
|
|
+ import LeftBottom from "@/components/dashboard/art/LeftBottom";
|
|
|
+ import RightTop from "@/components/dashboard/art/RightTop";
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ artName: "",
|
|
|
+ isNoData: false,
|
|
|
+ isNoAc:false,
|
|
|
+ activeAcIndex: 0,
|
|
|
+ acList: [],
|
|
|
+ curAcSummary: null,
|
|
|
+ subjectList: [],
|
|
|
+ activeMenu: "music",
|
|
|
+ activeClassIndex: -1,
|
|
|
+ activeGradeIndex: 0,
|
|
|
+ curSubjectIndex: 0,
|
|
|
+ timing: null,
|
|
|
+ loading: true,
|
|
|
+ dateDay: null,
|
|
|
+ dateYear: null,
|
|
|
+ dateWeek: null,
|
|
|
+ semesterList: [],
|
|
|
+ filterSemesterId: "",
|
|
|
+ semesterValue: 1,
|
|
|
+ curSemester: null
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ RightBotR,
|
|
|
+ RightBotL,
|
|
|
+ LeftTop,
|
|
|
+ LeftCenter,
|
|
|
+ LeftBottom,
|
|
|
+ RightTop
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$tools.fullScreen(document.getElementById('artIndex'))
|
|
|
+ // }, 600)
|
|
|
+ this.timeFn();
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.timing);
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ let params = this.$route.params;
|
|
|
+ /* 从区级选择任意一个学校跳转过来的 */
|
|
|
+ console.log(params);
|
|
|
+ if (params.artInfo) {
|
|
|
+ this.findAreaSchoolAnalysis(params.artInfo);
|
|
|
+ this.$tools.fullScreen(document.getElementById("artIndex"));
|
|
|
+ } else {
|
|
|
+ this.findArtList();
|
|
|
+ }
|
|
|
+ this.getSemesterList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getSemesterList() {
|
|
|
+ let curYear = new Date().getFullYear();
|
|
|
+ let curPeriod = this.$store.state.user.curPeriod;
|
|
|
+ let semesterArr = this._.cloneDeep(curPeriod.semesters).sort((a, b) => b.start - a.start);
|
|
|
+ this.curSemester = this.$store.state.user.curSemester;
|
|
|
+ let gradeCount = curPeriod.grades.length;
|
|
|
+ // let listYearCount = gradeCount + 1; // 可选年份范围是当前学段下年级数量 再往后推一年(可能会查看未来的排课表)
|
|
|
+ let listYearCount = 1; // 可选年份范围是当前学段下年级数量 再往后推一年(可能会查看未来的排课表)
|
|
|
+ let oldYear = curYear - 1;
|
|
|
+ let arr = [];
|
|
|
+ for (let i = 0; i <= listYearCount; i++) {
|
|
|
+ for (let j = 0; j < semesterArr.length; j++) {
|
|
|
+ arr.push({
|
|
|
+ year: oldYear + i,
|
|
|
+ name: semesterArr[j].name,
|
|
|
+ index: curPeriod.semesters.findIndex(k => k.id === semesterArr[j].id),
|
|
|
+ id: semesterArr[j].id
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.semesterList = arr;
|
|
|
+ this.semesterValue = this.semesterList.findIndex((i) => i.year === this.curSemester.year && i.id === this.curSemester.id);
|
|
|
+ this.studyYear = this.curSemester.year;
|
|
|
+ },
|
|
|
+ onSemesterChange(val) {
|
|
|
+ console.log(JSON.stringify(this.semesterList[val]))
|
|
|
+ this.findArtList(this.semesterList[val]);
|
|
|
+ },
|
|
|
+ /* 查询区级任意一个学校的艺术评测看板数据 */
|
|
|
+ findAreaSchoolAnalysis(artInfo) {
|
|
|
+ this.$api.areaArt
|
|
|
+ .findArtSummary({
|
|
|
+ id: artInfo.artId,
|
|
|
+ code: artInfo.code
|
|
|
+ })
|
|
|
+ .then(
|
|
|
+ (res) => {
|
|
|
+ if (!res.error) {
|
|
|
+ this.curAcSummary = res.art;
|
|
|
+ // 根据勾选的指标 展示表格的列 其中用户信息列和总分列是固定展示
|
|
|
+ this.subjectList = res.art.subjects;
|
|
|
+ this.curSubjectIndex = 0;
|
|
|
+ let curSubjectId = this.subjectList[this.curSubjectIndex].id;
|
|
|
+ this.acList = [
|
|
|
+ {
|
|
|
+ id: artInfo.artId,
|
|
|
+ name: res.art.name
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ this.loading = true;
|
|
|
+ // 获取看板数据
|
|
|
+ this.$api.areaArt
|
|
|
+ .findArtDashAnalysis({
|
|
|
+ code: artInfo.code,
|
|
|
+ periodId: artInfo.perId,
|
|
|
+ subjectId: curSubjectId,
|
|
|
+ areaId: sessionStorage.getItem("areaId"),
|
|
|
+ id: artInfo.artId,
|
|
|
+ classIds: res.art.classes,
|
|
|
+ examId: res.art.settings.find((i) => i.id === "quota_21").task.find((k) => k.subject === curSubjectId).acId
|
|
|
+ })
|
|
|
+ .then((analysisRes) => {
|
|
|
+ console.log(`output->analysisRes`, analysisRes);
|
|
|
+ this.artName = this.acList[this.activeAcIndex].name;
|
|
|
+ if (analysisRes.code === 500) {
|
|
|
+ this.isNoData = true;
|
|
|
+ } else {
|
|
|
+ this.isNoData = false;
|
|
|
+ // 保存到vuex
|
|
|
+ this.$store.commit("artDashboard/setAnalysisJson", analysisRes);
|
|
|
+ }
|
|
|
+ this.cancelLoading();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ this.$Message.error(err);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ /* 查询活动列表 */
|
|
|
+ findArtList(semesterInfo) {
|
|
|
+ let n = semesterInfo || this.$store.state.user.curSemester;
|
|
|
+ let semesterRange = this.$tools.getStTimeByYearAndSemester(n.year, n.index);
|
|
|
+ let curPeriod = JSON.parse(localStorage.getItem("curPeriod"));
|
|
|
+ let params = {
|
|
|
+ code: this.$store.state.userInfo.schoolCode,
|
|
|
+ periodId: curPeriod.id,
|
|
|
+ periodType: curPeriod.periodType,
|
|
|
+ stime: semesterRange.stime,
|
|
|
+ etime: semesterRange.etime
|
|
|
+ };
|
|
|
+ this.loading = true
|
|
|
+ this.$api.areaArt.findArtList(params).then(
|
|
|
+ (res) => {
|
|
|
+ this.acList = res.arts.filter((i) => i.progress === "finish");
|
|
|
+ if (this.acList.length) {
|
|
|
+ this.$tools.fullScreen(document.getElementById("artIndex"));
|
|
|
+ this.onAcChange(0);
|
|
|
+ this.isNoAc = false
|
|
|
+ } else {
|
|
|
+ this.$tools.fullScreen(document.getElementById("artIndex"));
|
|
|
+ this.isNoAc = true
|
|
|
this.cancelLoading()
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- this.$Message.error(err)
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- /* 查询活动列表 */
|
|
|
- findArtList() {
|
|
|
- let curPeriod = JSON.parse(localStorage.getItem('curPeriod'))
|
|
|
- let params = {
|
|
|
- code: this.$store.state.userInfo.schoolCode,
|
|
|
- periodId: curPeriod.id,
|
|
|
- periodType: curPeriod.periodType
|
|
|
- }
|
|
|
- this.$api.areaArt.findArtList(params).then(
|
|
|
- (res) => {
|
|
|
- this.acList = res.arts.filter(i => i.progress === 'finish')
|
|
|
- if (this.acList.length) {
|
|
|
- this.$tools.fullScreen(document.getElementById('artIndex'))
|
|
|
- this.onAcChange(0)
|
|
|
- } else {
|
|
|
- setTimeout(() => {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: '温馨提示',
|
|
|
- content: '<p>未查询到已结束的艺术评测活动!</p>',
|
|
|
- cancelText: '',
|
|
|
- onOk: () => {
|
|
|
- this.$router.go(-1)
|
|
|
- }
|
|
|
- });
|
|
|
- }, 1000)
|
|
|
- // this.cancelLoading()
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => { }
|
|
|
- )
|
|
|
- },
|
|
|
- /* 查询艺术活动详情 */
|
|
|
- findArtSummary(acId) {
|
|
|
- let params = {
|
|
|
- id: acId,
|
|
|
- code: this.$store.state.userInfo.schoolCode
|
|
|
- }
|
|
|
- this.$api.areaArt.findArtSummary(params).then(
|
|
|
- (res) => {
|
|
|
- if (!res.error) {
|
|
|
- this.curAcSummary = res.art
|
|
|
- // 根据勾选的指标 展示表格的列 其中用户信息列和总分列是固定展示
|
|
|
- this.subjectList = res.art.subjects
|
|
|
- this.curSubjectIndex = 0
|
|
|
- this.onSubjectChange()
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- this.$Message.error(err)
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
- /* 活动切换 */
|
|
|
- onAcChange(val) {
|
|
|
- this.activeAcIndex = val
|
|
|
- this.findArtSummary(this.acList[val].id)
|
|
|
- },
|
|
|
- /* 科目切换 */
|
|
|
- onSubjectChange() {
|
|
|
- let curSubjectId = this.subjectList[this.curSubjectIndex].id
|
|
|
- this.loading = true
|
|
|
- // 获取看板数据
|
|
|
- this.$api.areaArt.findArtDashAnalysis({
|
|
|
- "code": this.$store.state.userInfo.schoolCode,
|
|
|
- "periodId": this.schoolInfo.periodId,
|
|
|
- "subjectId": curSubjectId,
|
|
|
- "areaId": sessionStorage.getItem('areaId'),
|
|
|
- "id": this.acList[this.activeAcIndex].id,
|
|
|
- "classIds": this.curAcSummary.classes,
|
|
|
- 'examId': this.curAcSummary.settings.find(i => i.id === 'quota_21').task.find(k => k.subject === curSubjectId).acId
|
|
|
- }).then(res => {
|
|
|
- console.log(`output->res`, res)
|
|
|
- this.artName = this.acList[this.activeAcIndex].name
|
|
|
- if (res.scount) {
|
|
|
- // 保存到vuex
|
|
|
- this.isNoData = false
|
|
|
- this.$store.commit('artDashboard/setAnalysisJson', res)
|
|
|
- } else {
|
|
|
- this.isNoData = true
|
|
|
- }
|
|
|
- this.cancelLoading()
|
|
|
- }).catch(err => {
|
|
|
- console.log(`output->err`, err)
|
|
|
- })
|
|
|
- },
|
|
|
- /* 返回上级 */
|
|
|
- goBack() {
|
|
|
- this.$tools.exitFullscreen()
|
|
|
- this.$router.go(-1)
|
|
|
- },
|
|
|
- exportArtTable() {
|
|
|
- let sheets = []
|
|
|
- let analysisJson = this.$store.state.artDashboard.artAnalysisJson
|
|
|
- // 校级概况sheet
|
|
|
- let schoolHeader = ['应考人数', '实考人数', '最高分(总)', '最低分(总)','平均分(总)','优秀率','及格率','标准差','年级测评平均分', '年级测评最高分', '年级测评优秀率','年级测评及格率']
|
|
|
- let schoolKeys = ['count','scount','max','min','average','excellent','pass','pow','gradeAverage','gradeMax','gradeExcellent','gradePass']
|
|
|
- let schoolDatas = [{
|
|
|
- count:analysisJson.count,
|
|
|
- scount:analysisJson.scount,
|
|
|
- max:analysisJson.max,
|
|
|
- min:analysisJson.min,
|
|
|
- average:analysisJson.average,
|
|
|
- excellent: parseInt(analysisJson.excellent * 100) + '%',
|
|
|
- pass:parseInt(analysisJson.pass * 100) + '%',
|
|
|
- pow:analysisJson.pow,
|
|
|
- gradeAverage:analysisJson.gscore[0].score,
|
|
|
- gradeMax:analysisJson.gscore[0].max,
|
|
|
- gradeExcellent:analysisJson.gscore[0].excellent,
|
|
|
- gradePass:analysisJson.gscore[0].pass
|
|
|
- }]
|
|
|
- const schoolSheet = {
|
|
|
- title: schoolHeader,
|
|
|
- key: schoolKeys,
|
|
|
- data: schoolDatas,
|
|
|
- filename: '校级概况',
|
|
|
- autoWidth: true
|
|
|
- }
|
|
|
- sheets.push(schoolSheet)
|
|
|
- // 班级概况sheet
|
|
|
- let classHeaders = ['班级名称','平均分','最高分','最低分','优秀率','及格率']
|
|
|
- let classKeys = ['name', 'average', 'max', 'min', 'excellent', 'pass']
|
|
|
- let classDatas = analysisJson.cInfo.map(classItem => {
|
|
|
- return {
|
|
|
- name: classItem.name,
|
|
|
- average: classItem.score,
|
|
|
- max: classItem.max,
|
|
|
- min: classItem.min,
|
|
|
- excellent: parseInt(classItem.excellent * 100) + '%',
|
|
|
- pass: parseInt(classItem.pass * 100) + '%'
|
|
|
- }
|
|
|
- })
|
|
|
- const classSheet = {
|
|
|
- title: classHeaders,
|
|
|
- key: classKeys,
|
|
|
- data: classDatas,
|
|
|
- filename: '测评情况统计(班级)',
|
|
|
- autoWidth: true
|
|
|
- }
|
|
|
- sheets.push(classSheet)
|
|
|
- // 学生测评sheet
|
|
|
- let stuHeaders = ['班级名称', '年级', '学生姓名', '学生学号', '测评得分', '测评得分率','稳定度系数','稳定度区级']
|
|
|
- let stuKeys = ['className', 'gradeName', 'name', 'id', 'score', 'pass','sta','stu']
|
|
|
- let stuDatas = analysisJson.students.map(stu => {
|
|
|
- return {
|
|
|
- className: stu.className,
|
|
|
- gradeName: stu.gradeId,
|
|
|
- name: stu.name,
|
|
|
- id: stu.id,
|
|
|
- score: stu.score,
|
|
|
- pass: parseInt(stu.score) + '%',
|
|
|
- sta: stu.sta,
|
|
|
- stu: stu.stu
|
|
|
- }
|
|
|
- })
|
|
|
- const stuSheet = {
|
|
|
- title: stuHeaders,
|
|
|
- key: stuKeys,
|
|
|
- data: stuDatas,
|
|
|
- filename: '测评详细统计(学生)',
|
|
|
- autoWidth: true
|
|
|
- }
|
|
|
- sheets.push(stuSheet)
|
|
|
- // 学生测评sheet
|
|
|
- let knoHeaders = ['知识点名称','知识块名称','知识块配分','知识块维度','知识点得分率']
|
|
|
- let knoKeys = ['pointName', 'blockName', 'blockScore', 'dim', 'pointScoreRate']
|
|
|
- let knoDatas = []
|
|
|
- analysisJson.kno.forEach(point => {
|
|
|
- point.block.forEach(block => {
|
|
|
- knoDatas.push(
|
|
|
- {
|
|
|
- pointName: point.name,
|
|
|
- blockName: block,
|
|
|
- blockScore: analysisJson.blk.find(i => i.name === block).score,
|
|
|
- dim: analysisJson.blk.find(i => i.name === block).dimension[0],
|
|
|
- pointScoreRate: parseInt(point.score * 100) + '%'
|
|
|
- }
|
|
|
- )
|
|
|
- })
|
|
|
- })
|
|
|
- const knoSheet = {
|
|
|
- title: knoHeaders,
|
|
|
- key: knoKeys,
|
|
|
- data: knoDatas,
|
|
|
- filename: '知识点得分率',
|
|
|
- autoWidth:true
|
|
|
- }
|
|
|
- sheets.push(knoSheet)
|
|
|
- excel.export_array_to_sheet(sheets, `${ this.artName }(${ this.subjectList[this.curSubjectIndex].name })- 校级艺术评测报告`)
|
|
|
- },
|
|
|
- /* 格式化最新时间 */
|
|
|
- timeFn() {
|
|
|
- this.timing = setInterval(() => {
|
|
|
- this.dateDay = this.$tools.formatTime(new Date(), 'hh:mm:ss')
|
|
|
- this.dateYear = this.$tools.formatTime(new Date(), 'yyyy-MM-dd')
|
|
|
- }, 1000)
|
|
|
- },
|
|
|
- /* 取消加载 */
|
|
|
- cancelLoading() {
|
|
|
- setTimeout(() => {
|
|
|
- this.loading = false
|
|
|
- }, 100)
|
|
|
- },
|
|
|
- },
|
|
|
- computed: {
|
|
|
- schoolInfo() {
|
|
|
- let artInfo = this.$route.params.artInfo
|
|
|
- if (artInfo) {
|
|
|
- return {
|
|
|
- schoolName: artInfo.name,
|
|
|
- schoolLogo: '',
|
|
|
- periodName: artInfo.perCname,
|
|
|
- periodId: artInfo.perId,
|
|
|
- curSemester: ''
|
|
|
- }
|
|
|
- } else {
|
|
|
- let store_user = this.$store.state.user
|
|
|
- let semesterRange = this.$tools.getSemesterTimeRange()
|
|
|
- return {
|
|
|
- schoolName: store_user.schoolProfile.school_base.name,
|
|
|
- schoolLogo: store_user.schoolProfile.school_base.picture,
|
|
|
- periodName: store_user.curPeriod.name,
|
|
|
- periodId: store_user.curPeriod.id,
|
|
|
- curSemester: semesterRange.name_with_year
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {}
|
|
|
+ );
|
|
|
+ },
|
|
|
+ /* 查询艺术活动详情 */
|
|
|
+ findArtSummary(acId) {
|
|
|
+ let params = {
|
|
|
+ id: acId,
|
|
|
+ code: this.$store.state.userInfo.schoolCode
|
|
|
+ };
|
|
|
+ this.$api.areaArt.findArtSummary(params).then(
|
|
|
+ (res) => {
|
|
|
+ if (!res.error) {
|
|
|
+ this.curAcSummary = res.art;
|
|
|
+ // 根据勾选的指标 展示表格的列 其中用户信息列和总分列是固定展示
|
|
|
+ this.subjectList = res.art.subjects;
|
|
|
+ this.curSubjectIndex = 0;
|
|
|
+ this.onSubjectChange();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ this.$Message.error(err);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ /* 活动切换 */
|
|
|
+ onAcChange(val) {
|
|
|
+ this.activeAcIndex = val;
|
|
|
+ this.findArtSummary(this.acList[val].id);
|
|
|
+ },
|
|
|
+ /* 科目切换 */
|
|
|
+ onSubjectChange() {
|
|
|
+ let curSubjectId = this.subjectList[this.curSubjectIndex].id;
|
|
|
+ this.loading = true;
|
|
|
+ // 获取看板数据
|
|
|
+ this.$api.areaArt
|
|
|
+ .findArtDashAnalysis({
|
|
|
+ code: this.$store.state.userInfo.schoolCode,
|
|
|
+ periodId: this.schoolInfo.periodId,
|
|
|
+ subjectId: curSubjectId,
|
|
|
+ areaId: sessionStorage.getItem("areaId"),
|
|
|
+ id: this.acList[this.activeAcIndex].id,
|
|
|
+ classIds: this.curAcSummary.classes,
|
|
|
+ examId: this.curAcSummary.settings.find((i) => i.id === "quota_21").task.find((k) => k.subject === curSubjectId).acId
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ console.log(`output->res`, res);
|
|
|
+ this.artName = this.acList[this.activeAcIndex].name;
|
|
|
+ if (res.scount) {
|
|
|
+ // 保存到vuex
|
|
|
+ this.isNoData = false;
|
|
|
+ this.$store.commit("artDashboard/setAnalysisJson", res);
|
|
|
+ } else {
|
|
|
+ this.isNoData = true;
|
|
|
+ }
|
|
|
+ this.cancelLoading();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(`output->err`, err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 返回上级 */
|
|
|
+ goBack() {
|
|
|
+ this.$tools.exitFullscreen();
|
|
|
+ this.$router.go(-1);
|
|
|
+ },
|
|
|
+ exportArtTable() {
|
|
|
+ let sheets = [];
|
|
|
+ let analysisJson = this.$store.state.artDashboard.artAnalysisJson;
|
|
|
+ // 校级概况sheet
|
|
|
+ let schoolHeader = ["应考人数", "实考人数", "最高分(总)", "最低分(总)", "平均分(总)", "优秀率", "及格率", "标准差", "年级测评平均分", "年级测评最高分", "年级测评优秀率", "年级测评及格率"];
|
|
|
+ let schoolKeys = ["count", "scount", "max", "min", "average", "excellent", "pass", "pow", "gradeAverage", "gradeMax", "gradeExcellent", "gradePass"];
|
|
|
+ let schoolDatas = [
|
|
|
+ {
|
|
|
+ count: analysisJson.count,
|
|
|
+ scount: analysisJson.scount,
|
|
|
+ max: analysisJson.max,
|
|
|
+ min: analysisJson.min,
|
|
|
+ average: analysisJson.average,
|
|
|
+ excellent: parseInt(analysisJson.excellent * 100) + "%",
|
|
|
+ pass: parseInt(analysisJson.pass * 100) + "%",
|
|
|
+ pow: analysisJson.pow,
|
|
|
+ gradeAverage: analysisJson.gscore[0].score,
|
|
|
+ gradeMax: analysisJson.gscore[0].max,
|
|
|
+ gradeExcellent: analysisJson.gscore[0].excellent,
|
|
|
+ gradePass: analysisJson.gscore[0].pass
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ const schoolSheet = {
|
|
|
+ title: schoolHeader,
|
|
|
+ key: schoolKeys,
|
|
|
+ data: schoolDatas,
|
|
|
+ filename: "校级概况",
|
|
|
+ autoWidth: true
|
|
|
+ };
|
|
|
+ sheets.push(schoolSheet);
|
|
|
+ // 班级概况sheet
|
|
|
+ let classHeaders = ["班级名称", "平均分", "最高分", "最低分", "优秀率", "及格率"];
|
|
|
+ let classKeys = ["name", "average", "max", "min", "excellent", "pass"];
|
|
|
+ let classDatas = analysisJson.cInfo.map((classItem) => {
|
|
|
+ return {
|
|
|
+ name: classItem.name,
|
|
|
+ average: classItem.score,
|
|
|
+ max: classItem.max,
|
|
|
+ min: classItem.min,
|
|
|
+ excellent: parseInt(classItem.excellent * 100) + "%",
|
|
|
+ pass: parseInt(classItem.pass * 100) + "%"
|
|
|
+ };
|
|
|
+ });
|
|
|
+ const classSheet = {
|
|
|
+ title: classHeaders,
|
|
|
+ key: classKeys,
|
|
|
+ data: classDatas,
|
|
|
+ filename: "测评情况统计(班级)",
|
|
|
+ autoWidth: true
|
|
|
+ };
|
|
|
+ sheets.push(classSheet);
|
|
|
+ // 学生测评sheet
|
|
|
+ let stuHeaders = ["班级名称", "年级", "学生姓名", "学生学号", "测评得分", "测评得分率", "稳定度系数", "稳定度区级"];
|
|
|
+ let stuKeys = ["className", "gradeName", "name", "id", "score", "pass", "sta", "stu"];
|
|
|
+ let stuDatas = analysisJson.students.map((stu) => {
|
|
|
+ return {
|
|
|
+ className: stu.className,
|
|
|
+ gradeName: stu.gradeId,
|
|
|
+ name: stu.name,
|
|
|
+ id: stu.id,
|
|
|
+ score: stu.score,
|
|
|
+ pass: parseInt(stu.score) + "%",
|
|
|
+ sta: stu.sta,
|
|
|
+ stu: stu.stu
|
|
|
+ };
|
|
|
+ });
|
|
|
+ const stuSheet = {
|
|
|
+ title: stuHeaders,
|
|
|
+ key: stuKeys,
|
|
|
+ data: stuDatas,
|
|
|
+ filename: "测评详细统计(学生)",
|
|
|
+ autoWidth: true
|
|
|
+ };
|
|
|
+ sheets.push(stuSheet);
|
|
|
+ // 学生测评sheet
|
|
|
+ let knoHeaders = ["知识点名称", "知识块名称", "知识块配分", "知识块维度", "知识点得分率"];
|
|
|
+ let knoKeys = ["pointName", "blockName", "blockScore", "dim", "pointScoreRate"];
|
|
|
+ let knoDatas = [];
|
|
|
+ analysisJson.kno.forEach((point) => {
|
|
|
+ point.block.forEach((block) => {
|
|
|
+ knoDatas.push({
|
|
|
+ pointName: point.name,
|
|
|
+ blockName: block,
|
|
|
+ blockScore: analysisJson.blk.find((i) => i.name === block).score,
|
|
|
+ dim: analysisJson.blk.find((i) => i.name === block).dimension[0],
|
|
|
+ pointScoreRate: parseInt(point.score * 100) + "%"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ const knoSheet = {
|
|
|
+ title: knoHeaders,
|
|
|
+ key: knoKeys,
|
|
|
+ data: knoDatas,
|
|
|
+ filename: "知识点得分率",
|
|
|
+ autoWidth: true
|
|
|
+ };
|
|
|
+ sheets.push(knoSheet);
|
|
|
+ excel.export_array_to_sheet(sheets, `${this.artName}(${this.subjectList[this.curSubjectIndex].name})- 校级艺术评测报告`);
|
|
|
+ },
|
|
|
+ /* 格式化最新时间 */
|
|
|
+ timeFn() {
|
|
|
+ this.timing = setInterval(() => {
|
|
|
+ this.dateDay = this.$tools.formatTime(new Date(), "hh:mm:ss");
|
|
|
+ this.dateYear = this.$tools.formatTime(new Date(), "yyyy-MM-dd");
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ /* 取消加载 */
|
|
|
+ cancelLoading() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ schoolInfo() {
|
|
|
+ let artInfo = this.$route.params.artInfo;
|
|
|
+ if (artInfo) {
|
|
|
+ return {
|
|
|
+ schoolName: artInfo.name,
|
|
|
+ schoolLogo: "",
|
|
|
+ periodName: artInfo.perCname,
|
|
|
+ periodId: artInfo.perId,
|
|
|
+ curSemester: ""
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ let store_user = this.$store.state.user;
|
|
|
+ let semesterRange = this.$tools.getSemesterTimeRange();
|
|
|
+ return {
|
|
|
+ schoolName: store_user.schoolProfile.school_base.name,
|
|
|
+ schoolLogo: store_user.schoolProfile.school_base.picture,
|
|
|
+ periodName: store_user.curPeriod.name,
|
|
|
+ periodId: store_user.curPeriod.id,
|
|
|
+ curSemester: semesterRange.name_with_year
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
-@import "Art.less";
|
|
|
-@import "style.less";
|
|
|
+ @import "Art.less";
|
|
|
+ @import "style.less";
|
|
|
</style>
|
|
|
-
|