zouyf_dev #350

Merged
zouyf merged 3 commits from zouyf_dev into main 2024-10-21 16:46:42 +08:00
6 changed files with 36 additions and 23 deletions
Showing only changes of commit 8c36d59b19 - Show all commits

View File

@ -1,6 +1,6 @@
{
"name": "aix-win",
"version": "2.1.12",
"version": "2.1.14",
"description": "",
"main": "./out/main/index.js",
"author": "example.com",

View File

@ -10,7 +10,7 @@
等级分布
</div>
</template>
<Distribution></Distribution>
<Distribution :stuHasAnswers=stuHasAnswers></Distribution>
</el-card>
</el-header>
<el-main>
@ -218,8 +218,9 @@ const initData = () => {
return { def: o, id: o.id, type: o.worktype, active: [], points, accSum, rightSum, children,hasAnswers }
})
console.log('获取数据: ', data)
if (data.length === 0) return
if (!data[0].hasAnswers[0]) return
stuHasAnswers.value = [...data[0].hasAnswers]
provide('hasAnswer', stuHasAnswers.value)
}
// 0-100
const percent = v => v > 1 ? 1 : v < 0 ? 0 : Math.round(v * 100)

View File

@ -3,19 +3,26 @@
<el-container>
<el-aside width="400px">
<!-- 柱状图学情分布-->
<Echarts></Echarts>
<Echarts :stuHasAnswers=stuHasAnswers></Echarts>
</el-aside>
<el-main>
<!-- 列表分布的人员-->
<StuList></StuList>
<StuList :stuHasAnswers=stuHasAnswers></StuList>
</el-main>
</el-container>
</div>
</template>
<script setup>
import Echarts from '@/views/classTask/container/classOverview/distribution/echarts.vue'
import StuList from "@/views/classTask/container/classOverview/distribution/stuList.vue";
import { defineProps } from 'vue'
import Echarts from './distribution/echarts.vue'
import StuList from "./distribution/stuList.vue";
const props = defineProps({
stuHasAnswers: {
type: Array,
default: () => []
}
})
</script>
<style scoped>

View File

@ -13,6 +13,13 @@ const useOverview = overviewStore();
//
const chartRef = ref(null);
const props = defineProps({
stuHasAnswers: {
type: Array,
default: () => []
}
})
//
const dataList = ref([
{ name: '完美', value: 0, rating: 1, max: 100, min: 100 },
@ -22,7 +29,6 @@ const dataList = ref([
{ name: '不及格', value: 0, rating: 5, max: 59, min: 0 },
]);
//
const hasAnswersData = ref([]);
const hasStudents = ref([])
//
@ -105,18 +111,12 @@ const showEcharts = () => {
}
//
watch(() => useOverview.tableList, () => {
hasStudents.value = useOverview.tableList.filter(item => hasAnswersData.value.includes(item.studentid)).map(item => item);
hasStudents.value = useOverview.tableList.filter(item => props.stuHasAnswers.includes(item.studentid)).map(item => item);
showEcharts();
nextTick(() => {
initChart();
});
},{deep: true})
//
watchEffect(() => {
const stus = inject('hasAnswer');
if (!stus) return;
hasAnswersData.value = [...stus]
});
</script>
<style scoped>

View File

@ -16,13 +16,19 @@
</template>
<script setup>
import {nextTick, ref, watch,inject,watchEffect} from 'vue'
import {ref, watch} from 'vue'
import overviewStore from '@/store/modules/overview'
const useOverview = overviewStore()
const tabPosition = ref('left')
const props = defineProps({
stuHasAnswers: {
type: Array,
default: () => []
}
})
//
const hasAnswersData = ref([])
const hasStudents = ref([])
const leftList = ref([
{
@ -81,14 +87,9 @@ const showStudents = (index) => {
})
}
watch(() => useOverview.tableList, () => {
hasStudents.value = useOverview.tableList.filter(item => hasAnswersData.value.includes(item.studentid)).map(item => item);
hasStudents.value = useOverview.tableList.filter(item => props.stuHasAnswers.includes(item.studentid)).map(item => item);
showStudents(0)
},{deep: true})
watchEffect(() => {
const stus = inject('hasAnswer')
if(!stus) return
hasAnswersData.value = [...stus]
})
</script>
<style scoped>

View File

@ -570,6 +570,10 @@ const getWorkFeedList = async() =>{
function: 训练报告的处理
*/
const handleClassOverviewOpen = (type) =>{
//
if(type == 'report') {
getWorkFeedList();
}
// ui
isopen_dtwk_table.value = false;
classWorkAnalysis.view = type