|
@@ -1,7 +1,6 @@
|
|
|
<template>
|
|
|
<div class="class-report" >
|
|
|
<HeaderPart ></HeaderPart>
|
|
|
-
|
|
|
<!-- 封面 -->
|
|
|
<div class="rd-info" :style="{ backgroundImage: `url(${getImageUrl('semester-bg')})`, backgroundColor: '#fff' }" >
|
|
|
<div class="rd-info-cover" :style="{ backgroundImage: `url(${getImageUrl('empty-cover')})`}">
|
|
@@ -72,7 +71,7 @@
|
|
|
学生各领域表现阶段汇总
|
|
|
</div>
|
|
|
<div class="total-scene" >
|
|
|
- <!-- <div class="total-table" >
|
|
|
+ <div class="total-table-small htmlToPng" id="htmlToPng" >
|
|
|
<div class="total-table-item" >
|
|
|
<div
|
|
|
:class="['total-table-item-cell', index === 0 ? 'total-table-item-title border-white' : '']"
|
|
@@ -92,23 +91,28 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="total-table-item" >
|
|
|
- <div class="performances-title border-white">
|
|
|
+ <div class="performances-title">
|
|
|
观察进阶
|
|
|
</div>
|
|
|
<div class="performances-item-content" >
|
|
|
<div class="performances-item-conten-card" v-for="(item, index) in tableData.performances.data" :key="index">
|
|
|
- <div :class="['total-table-item-cell', index === 0 ? 'border-white performances-subtitle': '']" v-for="(_, index) in item" :key="index" >
|
|
|
+ <div
|
|
|
+ :class="['total-table-item-cell-small', index === 0 ? 'border-white performances-subtitle first-cell': '']"
|
|
|
+ v-for="(_, index) in item"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
{{_}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div> -->
|
|
|
- <div class="total-table-small" id="htmlToPng" >
|
|
|
+ </div>
|
|
|
+ <span class="htmlToPng-copy" v-for="count in calclHtmlToPngCount" :key="count" >
|
|
|
+ <div class="total-table-small" :id="`htmlToPng${count}`" >
|
|
|
<div class="total-table-item" >
|
|
|
<div
|
|
|
:class="['total-table-item-cell', index === 0 ? 'total-table-item-title border-white' : '']"
|
|
|
- v-for="(item, index) in tableData.name.data"
|
|
|
+ v-for="(item, index) in tableData.name.data.slice( (count - 1) * 12, count * 12)"
|
|
|
:key="index"
|
|
|
>
|
|
|
{{item}}
|
|
@@ -117,7 +121,7 @@
|
|
|
<div class="total-table-item" >
|
|
|
<div
|
|
|
:class="['total-table-item-cell', index === 0 ? 'total-table-item-title border-white' : '']"
|
|
|
- v-for="(item, index) in tableData.record.data"
|
|
|
+ v-for="(item, index) in tableData.record.data.slice( (count - 1) * 12, count * 12)"
|
|
|
:key="index"
|
|
|
>
|
|
|
{{item}}
|
|
@@ -131,7 +135,7 @@
|
|
|
<div class="performances-item-conten-card" v-for="(item, index) in tableData.performances.data" :key="index">
|
|
|
<div
|
|
|
:class="['total-table-item-cell-small', index === 0 ? 'border-white performances-subtitle first-cell': '']"
|
|
|
- v-for="(_, index) in item"
|
|
|
+ v-for="(_, index) in item.slice( (count - 1) * 12, count * 12)"
|
|
|
:key="index"
|
|
|
>
|
|
|
{{_}}
|
|
@@ -140,6 +144,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="report-clazz-base data-desc">
|
|
@@ -159,8 +164,8 @@
|
|
|
<script lang='ts' setup >
|
|
|
// @ts-nocheck
|
|
|
import HeaderPart from './components/HeaderPart.vue'
|
|
|
-import { getImageUrl, getTestTeachToken } from "@/utils";
|
|
|
-import { ref, onMounted, nextTick } from 'vue'
|
|
|
+import { getImageUrl, getTestTeachToken, getAppToken } from "@/utils";
|
|
|
+import { ref, onMounted, nextTick, computed } from 'vue'
|
|
|
import * as echarts from 'echarts'
|
|
|
import exportButton from '@/components/exportButton.vue'
|
|
|
import { useClazzStore } from '@/store/index'
|
|
@@ -268,6 +273,8 @@ const { p } = useRoute().query;
|
|
|
observeChart.value.setOption(options);
|
|
|
}
|
|
|
|
|
|
+ const calclHtmlToPngCount = computed(() => Math.ceil(tableData.value.name.data.length / 12))
|
|
|
+
|
|
|
const htmlToPng = () => {
|
|
|
return new Promise((resolve) => {
|
|
|
html2canvas(document.querySelector("#capture")!).then(canvas => {
|
|
@@ -276,13 +283,12 @@ const { p } = useRoute().query;
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const studentChartHtmlToPng = () => {
|
|
|
+ const studentChartHtmlToPng = (id) => {
|
|
|
return new Promise((resolve) => {
|
|
|
const style = document.createElement('style');
|
|
|
document.head.appendChild(style);
|
|
|
style.sheet?.insertRule('body > div:last-child img { display: inline-block; }');
|
|
|
-
|
|
|
- html2canvas(document.querySelector("#htmlToPng")!).then(canvas => {
|
|
|
+ html2canvas(document.querySelector(id)!).then(canvas => {
|
|
|
style.remove();
|
|
|
resolve(canvas.toDataURL(''))
|
|
|
});
|
|
@@ -296,7 +302,12 @@ const { p } = useRoute().query;
|
|
|
const exportReport = () => {
|
|
|
nextTick(async () => {
|
|
|
loading.value = true
|
|
|
- console.log('recordChart:', recordChart);
|
|
|
+ const studentPngs = []
|
|
|
+ for (let index = 0; index < calclHtmlToPngCount.value; index++) {
|
|
|
+ studentPngs.push( await studentChartHtmlToPng(`#htmlToPng${index + 1}`))
|
|
|
+ }
|
|
|
+ console.log(studentPngs);
|
|
|
+
|
|
|
const $par = {
|
|
|
baseData: baseData.value,
|
|
|
clazzDomainData: clazzDomainData.value,
|
|
@@ -305,8 +316,12 @@ const { p } = useRoute().query;
|
|
|
clazzDomainChart: recordChart.value.getDataURL(),
|
|
|
clazzSceneChart: observeChart.value.getDataURL(),
|
|
|
basePng: await htmlToPng(),
|
|
|
- studentPng: await studentChartHtmlToPng(),
|
|
|
+ studentPng: await studentChartHtmlToPng('#htmlToPng'),
|
|
|
+ calclHtmlToPngCount: calclHtmlToPngCount.value,
|
|
|
+ studentPngs: studentPngs,
|
|
|
}
|
|
|
+ console.log('$par:', $par);
|
|
|
+
|
|
|
exportClazzPDF($par, async (progress: number) => {
|
|
|
const r = (progress * 100).toFixed(0)
|
|
|
if (r === '100') {
|
|
@@ -318,10 +333,11 @@ const { p } = useRoute().query;
|
|
|
}
|
|
|
|
|
|
onMounted( async () => {
|
|
|
- // await getAppToken()
|
|
|
- await getTestTeachToken()
|
|
|
- // const $par = JSON.parse(decodeURIComponent(atob(p)))
|
|
|
- const $par = {"classIds":["1655822889577734146"],"gradeSemesterIds":["00","11","01","-10","-11","20","10","21"],"schoolId":"1304705665728421889","teacherIds":["1450638512771702786","1436187006844682241","1304705367924449281","1711187837184294914","1800414891962654721","1778693522847088641"]}
|
|
|
+ await getAppToken()
|
|
|
+ // await getTestTeachToken()
|
|
|
+ const $par = JSON.parse(decodeURIComponent(atob(p)))
|
|
|
+ // const $par = JSON.parse(decodeURIComponent(atob('eyJjbGFzc0lkcyI6WyIxNzc2OTA4Mjc2MDMxOTkxODEwIl0sImdyYWRlU2VtZXN0ZXJJZHMiOlsiMDAiLCIxMSIsIjAxIiwiLTEwIiwiLTExIiwiMjAiLCIxMCIsIjIxIl0sInNjaG9vbElkIjoiMTc3NjkwNzcwMzQyOTgwNDAzMyIsInRlYWNoZXJJZHMiOlsiMTc3NjkxMTk2MDU2MDI4MzY1MCIsIjE3NzY5MDk4MzQ2ODU2ODk4NTciLCIxNzc2OTEyMDgwOTk1NTI4NzA2IiwiMTUxMTk3NTE1NjI0OTQ1MjU0NiJdfQ==')))
|
|
|
+ // const $par = {"classIds":["1655822889577734146"],"gradeSemesterIds":["00","11","01","-10","-11","20","10","21"],"schoolId":"1304705665728421889","teacherIds":["1450638512771702786","1436187006844682241","1304705367924449281","1711187837184294914","1800414891962654721","1778693522847088641"]}
|
|
|
getClazzBase($par)
|
|
|
getClazzDomain($par).then(() => {
|
|
|
|
|
@@ -490,12 +506,14 @@ const { p } = useRoute().query;
|
|
|
}
|
|
|
.total-scene {
|
|
|
display: flex;
|
|
|
+ position: relative;
|
|
|
.total-table-small {
|
|
|
width: 100%;
|
|
|
overflow: hidden;
|
|
|
overflow-x: scroll;
|
|
|
display: flex;
|
|
|
font-size: 10px;
|
|
|
+ background-color: #fff;
|
|
|
.total-table-item {
|
|
|
.performances-title {
|
|
|
width: 100%;
|
|
@@ -576,6 +594,15 @@ const { p } = useRoute().query;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ .htmlToPng {
|
|
|
+ position: relative;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+ .htmlToPng-copy {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 1;
|
|
|
+ // visibility: hidden;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|