|
@@ -35,6 +35,9 @@
|
|
|
chart
|
|
chart
|
|
|
</template>
|
|
</template>
|
|
|
</classToggle>
|
|
</classToggle>
|
|
|
|
|
+ <div class="exportButton">
|
|
|
|
|
+ <button @click="exportData">导出数据</button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<div class="Loading" v-show="!DataLoading">Loading...</div>
|
|
<div class="Loading" v-show="!DataLoading">Loading...</div>
|
|
@@ -137,8 +140,10 @@ import classToggle from './components/classToggle.vue'
|
|
|
import {onMounted, ref, computed, watch, nextTick } from 'vue';
|
|
import {onMounted, ref, computed, watch, nextTick } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { useStore } from "@/store"
|
|
import { useStore } from "@/store"
|
|
|
|
|
+import {ElLoading, ElMessage} from "element-plus";
|
|
|
import * as echarts from 'echarts'
|
|
import * as echarts from 'echarts'
|
|
|
import useApis from "@/apis";
|
|
import useApis from "@/apis";
|
|
|
|
|
+import { log } from 'console';
|
|
|
|
|
|
|
|
const apis = useApis()
|
|
const apis = useApis()
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
@@ -166,7 +171,6 @@ const Homeworksdata = ref([])
|
|
|
|
|
|
|
|
const sortMethods = ["默认","成绩从低到高","成绩从高到低","未批改优先","未提交优先"]
|
|
const sortMethods = ["默认","成绩从低到高","成绩从高到低","未批改优先","未提交优先"]
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const chartRef1 = ref(null)
|
|
const chartRef1 = ref(null)
|
|
|
const chartRef2 = ref(null)
|
|
const chartRef2 = ref(null)
|
|
|
const setChart = () => {
|
|
const setChart = () => {
|
|
@@ -277,6 +281,33 @@ const setChart = () => {
|
|
|
chartInstance2.setOption(option2)
|
|
chartInstance2.setOption(option2)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const exportData = () => {
|
|
|
|
|
+ console.log('exportData',classId,ShowTheHomeworkId.value)
|
|
|
|
|
+ // apis.downLoadAllBehaviorDataByClass(classId,ShowTheHomeworkId.value)
|
|
|
|
|
+ // apis.downLoadAllBehaviorData(ShowTheHomeworkId.value)
|
|
|
|
|
+ apis.downLoadAllBehaviorDataByClass(classId,ShowTheHomeworkId.value)
|
|
|
|
|
+ .then((res:any) => {
|
|
|
|
|
+ if (res && res.status === 200){
|
|
|
|
|
+ let blob = res.data as Blob;
|
|
|
|
|
+ const fileName = `${ShowTheHomework.value}作业行为数据.xlsx`;
|
|
|
|
|
+ if ('download' in document.createElement('a')) {
|
|
|
|
|
+ const link = document.createElement('a');
|
|
|
|
|
+ link.download = fileName;
|
|
|
|
|
+ link.style.display = 'none';
|
|
|
|
|
+ link.href = URL.createObjectURL(blob);
|
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
|
+ link.click();
|
|
|
|
|
+ ElMessage.success('下载成功')
|
|
|
|
|
+ URL.revokeObjectURL(link.href); // 释放URL对象
|
|
|
|
|
+ document.body.removeChild(link);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err:any) => {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ ElMessage.success('下载失败')
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const identify = () => {
|
|
const identify = () => {
|
|
|
if(store.user.role === "STUDENT"){
|
|
if(store.user.role === "STUDENT"){
|
|
@@ -436,6 +467,23 @@ onMounted(async () => {
|
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
|
|
|
+ .exportButton{
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-left: 20px;
|
|
|
|
|
+ button{
|
|
|
|
|
+ height: 27px;
|
|
|
|
|
+ padding: 0 10px;
|
|
|
|
|
+ border: 2px solid #e4e7ed;
|
|
|
|
|
+ border-radius: 7px;
|
|
|
|
|
+ background-color: #4a90c4;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.searchInput{
|
|
.searchInput{
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display: flex;
|
|
display: flex;
|