|
|
@@ -12,19 +12,20 @@
|
|
|
@searchChange="HandleSearchChange">
|
|
|
</FormSearchGroup>
|
|
|
|
|
|
- <el-button class="el-button-refresh">导出Excel</el-button>
|
|
|
+ <el-button class="el-button-refresh" @click="HandleExportExcel">导出Excel</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Table :currentPage="currentPage" :pageSize="pageSize"
|
|
|
:tableColumns="reviewAccountUseTableColumns"
|
|
|
:tableData="tableData"
|
|
|
- :totalNum="totalNum">
|
|
|
+ :totalNum="totalNum"
|
|
|
+ @paginationChange="HandlePaginationChange">
|
|
|
<template #num="{row,currentIndex}">
|
|
|
{{ currentIndex + pageSize * (currentPage - 1) }}
|
|
|
</template>
|
|
|
- <template #status="{row}">
|
|
|
- <TableRowStatus :statusMsg="statusMsg" :useStatus="row.status">
|
|
|
+ <template #evaluationStatus="{row}">
|
|
|
+ <TableRowStatus :statusMsg="statusMsg" :useStatus="row.evaluationStatus">
|
|
|
</TableRowStatus>
|
|
|
</template>
|
|
|
</Table>
|
|
|
@@ -42,8 +43,7 @@ import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
|
import {searchList} from './formSearchGroup'
|
|
|
import TableRowStatus from '@/baseComponents/TableRowStatus.vue';
|
|
|
|
|
|
-
|
|
|
-import { getEvaluationAccountUseStatisticsApi } from '@/api/evaluationProgressComponent.js';
|
|
|
+import { getEvaluationAccountUseStatisticsApi, reviewAccountGradeListApi, reviewAccountDataExportExcelApi } from '@/api/evaluationProgressComponent.js';
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
@@ -51,78 +51,7 @@ const currentPage = ref(1)
|
|
|
const pageSize = ref(20)
|
|
|
const totalNum = ref(0)
|
|
|
|
|
|
-const tableData = ref([
|
|
|
- {
|
|
|
- grade: '七年级', // 年级
|
|
|
- className: '1班', // 班级
|
|
|
- gender: '男', // 性别
|
|
|
- code: '272839201', // 评价码
|
|
|
- status: '1', // 状态 1 已提交 0 未使用
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '0',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '0',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '0',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '1',
|
|
|
- },
|
|
|
- {
|
|
|
- grade: '七年级',
|
|
|
- className: '1班',
|
|
|
- gender: '男',
|
|
|
- code: '272839201',
|
|
|
- status: '1',
|
|
|
- }
|
|
|
-])
|
|
|
+const tableData = ref([])
|
|
|
|
|
|
const statusMsg = ref([
|
|
|
{
|
|
|
@@ -132,25 +61,108 @@ const statusMsg = ref([
|
|
|
},
|
|
|
{
|
|
|
statusFlag:1,
|
|
|
+ title:'已使用',
|
|
|
+ themeClass:'not_included_icon',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ statusFlag:2,
|
|
|
title:'已提交',
|
|
|
themeClass:'normal_icon',
|
|
|
},
|
|
|
+
|
|
|
])
|
|
|
|
|
|
|
|
|
-const searchParams = ref({})
|
|
|
-const HandleSearchChange = (params,key)=>{}
|
|
|
+const searchParams = ref({
|
|
|
+ grade:'',
|
|
|
+ status:''
|
|
|
+})
|
|
|
|
|
|
+// 处理查询条件的变更
|
|
|
+const HandleSearchChange = async (params,key)=>{
|
|
|
+ console.log('触发的查询参数___',params)
|
|
|
+ searchParams.value = {
|
|
|
+ ...searchParams.value,
|
|
|
+ ...params
|
|
|
+ }
|
|
|
+ await GetEvaluationAccountUseStatistics()
|
|
|
+}
|
|
|
|
|
|
-onMounted(async()=>{
|
|
|
- let res = await getEvaluationAccountUseStatisticsApi(route.query.id)
|
|
|
+// 处理表格分页
|
|
|
+const HandlePaginationChange = async (params)=>{
|
|
|
+ const { type, val } = params
|
|
|
+ if(type == 'currentPage'){
|
|
|
+ currentPage.value = val
|
|
|
+ await GetEvaluationAccountUseStatistics()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 获取评价账号使用统计表的数据
|
|
|
+const GetEvaluationAccountUseStatistics = async ()=>{
|
|
|
+ let params = {
|
|
|
+ evaluationId: route.query.id,
|
|
|
+ evaluationGradeId: searchParams.value.grade == 'all' ? '' : searchParams.value.grade, //年级id
|
|
|
+ pageNum: currentPage.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ evaluationStatus: searchParams.value.status == 'all' ? '' : searchParams.value.status // 评价码状态
|
|
|
+ }
|
|
|
+ let res = await getEvaluationAccountUseStatisticsApi(params)
|
|
|
+ if(res?.code == 200){
|
|
|
+ tableData.value = res?.data?.records || []
|
|
|
+ totalNum.value = res?.data?.total
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 获取年级列表
|
|
|
+const GetGradeList = async ()=> {
|
|
|
+ let res = await reviewAccountGradeListApi(route.query.id)
|
|
|
if(res?.code == 200){
|
|
|
+ let gradeOption = res.data.map(item=>{
|
|
|
+ return {
|
|
|
+ label:item.evaluationGradeName,
|
|
|
+ value:item.evaluationGradeId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 初始化年级下拉
|
|
|
+ searchList.value = searchList.value.map(item=>{
|
|
|
+ if(item.key == 'grade'){
|
|
|
+ item.options = [
|
|
|
+ {
|
|
|
+ label:'全部年级',
|
|
|
+ value:'all'
|
|
|
+ },
|
|
|
+ ...gradeOption
|
|
|
+ ]
|
|
|
+ item.defaultValue = 'all'
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- // 待完善————————
|
|
|
|
|
|
+// 处理excel导出 —— 待完善
|
|
|
+const HandleExportExcel = async ()=>{
|
|
|
+ let params = {
|
|
|
+ evaluationGenderStatus:null, //性别 必传,值为空
|
|
|
+ evaluationId: route.query.id,
|
|
|
+ evaluationGradeId: searchParams.value.grade == 'all' ? '' : searchParams.value.grade, //年级id
|
|
|
+ pageNum: currentPage.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ evaluationStatus: searchParams.value.status == 'all' ? '' : searchParams.value.status // 评价码状态
|
|
|
}
|
|
|
+ let res = await reviewAccountDataExportExcelApi(params)
|
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
+ // 待完善
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(async()=>{
|
|
|
+ await GetGradeList()
|
|
|
+ await GetEvaluationAccountUseStatistics()
|
|
|
})
|
|
|
</script>
|
|
|
|