|
|
@@ -3,7 +3,7 @@
|
|
|
<div class=" page_search">
|
|
|
<div class="search_content">
|
|
|
<div class="content_left">
|
|
|
- <FormSearchGroup :searchList="searchList"></FormSearchGroup>
|
|
|
+ <FormSearchGroup :searchList="searchList" @searchChange="HandleSelectSearchChange"></FormSearchGroup>
|
|
|
</div>
|
|
|
<div class="content_right">
|
|
|
<el-button class="button_refresh">导出PDF</el-button>
|
|
|
@@ -53,7 +53,8 @@ import { searchList } from './formSearchGroup';
|
|
|
import { generateCodeTableColumns } from './table';
|
|
|
|
|
|
import {
|
|
|
- generateReviewCodeListApi,finishReviewAccountApi,getReviewAccountListApi
|
|
|
+ generateReviewCodeListApi,finishReviewAccountApi,getReviewAccountListApi,
|
|
|
+ getGradeAndClassListApi,
|
|
|
} from '@/api/step4Component'
|
|
|
import { onMounted } from 'vue';
|
|
|
|
|
|
@@ -102,20 +103,15 @@ const GetReviewCode = async ()=>{
|
|
|
// 获取评价码信息
|
|
|
let params = {
|
|
|
evaluationId: route.query.id,
|
|
|
-
|
|
|
- evaluationGradeId:'',
|
|
|
- evaluationClassId:'',
|
|
|
- gender:'',
|
|
|
-
|
|
|
-
|
|
|
+ evaluationGradeId: searchParams.value.evaluationGradeId == 'all' ? '' : JSON.parse(searchParams.value.evaluationGradeId || '{}')?.id,
|
|
|
+ evaluationClassId:searchParams.value.evaluationClassId == 'all' ? '' : searchParams.value.evaluationClassId ,
|
|
|
+ gender:searchParams.value.gender == 'all' ? '' : searchParams.value.gender,
|
|
|
pageNum: currentPage.value,
|
|
|
pageSize: pageSize.value
|
|
|
}
|
|
|
let res = await getReviewAccountListApi(params)
|
|
|
if(res?.code == 200){
|
|
|
const {codeDataList} = res.data
|
|
|
-
|
|
|
-
|
|
|
tableData.value = await Promise.all(codeDataList.records.map(async item=>{
|
|
|
return {
|
|
|
...item,
|
|
|
@@ -123,7 +119,6 @@ const GetReviewCode = async ()=>{
|
|
|
}
|
|
|
}))
|
|
|
|
|
|
- console.log('表行数据---',tableData.value)
|
|
|
totalNum.value = codeDataList.total
|
|
|
}
|
|
|
}
|
|
|
@@ -138,11 +133,89 @@ const HandlePaginationChange = async (params)=>{
|
|
|
|
|
|
//3. 查询参数变更
|
|
|
const searchParams = ref({
|
|
|
- evaluationGradeId:'', //年级
|
|
|
- evaluationClassId:'', //班级
|
|
|
- gender:2, //性别
|
|
|
+ evaluationGradeId:'all', //年级
|
|
|
+ evaluationClassId:'all', //班级
|
|
|
+ gender:'all', //性别
|
|
|
})
|
|
|
|
|
|
+// 获取 评价账号 年级/班级 筛选下拉
|
|
|
+const GetGradeAndClassListOption = async ()=>{
|
|
|
+ let res = await getGradeAndClassListApi(route.query.id)
|
|
|
+ if(res?.code == 200){
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
+ let gradeOptions = res.data?.map(item=>{
|
|
|
+ return {
|
|
|
+ label:item.gradeName,
|
|
|
+ value:JSON.stringify({
|
|
|
+ id:item.id,
|
|
|
+ classData:item.classData
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }) || []
|
|
|
+ // 初始赋值,班级只展示 [全部] 项
|
|
|
+ let classOptions = [
|
|
|
+ {
|
|
|
+ label:'全部班级',
|
|
|
+ value:'all'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ searchList.value = searchList.value.map(item=>{
|
|
|
+ if(item.key == 'evaluationGradeId'){
|
|
|
+ item.options = [
|
|
|
+ {
|
|
|
+ label:'全部年级',
|
|
|
+ value:'all'
|
|
|
+ },
|
|
|
+ ...gradeOptions
|
|
|
+ ]
|
|
|
+ }else if(item.key == 'evaluationClassId'){
|
|
|
+ item.options = classOptions
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 搜索项下拉列表变更
|
|
|
+const HandleSelectSearchChange = async (params,key)=>{
|
|
|
+ console.log('查询搜素项参数__',params)
|
|
|
+ searchParams.value = {...searchParams.value,...params}
|
|
|
+ searchList.value = searchList.value.map(item=>{
|
|
|
+ switch(item.key){
|
|
|
+ case 'evaluationClassId':{
|
|
|
+ // 当前触发的是年级下拉变更
|
|
|
+ if(key == 'evaluationGradeId'){
|
|
|
+ // 重置班级的默认值
|
|
|
+ searchParams.value.evaluationClassId = 'all'
|
|
|
+ if(params.evaluationGradeId == 'all'){
|
|
|
+ // 班级下拉置空,只剩全部
|
|
|
+ item.options = [{label:'全部班级', value:'all' }]
|
|
|
+ }else{
|
|
|
+ // 班级下拉 动态变更
|
|
|
+ let classOptions = (JSON.parse(params.evaluationGradeId || '{}')?.classData || [])?.map(item=>{
|
|
|
+ return {
|
|
|
+ label:item.name,
|
|
|
+ value:item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ item.options = [{label:'全部班级', value:'all'},
|
|
|
+ ...classOptions]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ defaultValue:searchParams.value[item.key]
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 调用查询接口
|
|
|
+ await GetReviewCode()
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
// 3. 完成评价账号
|
|
|
@@ -172,7 +245,8 @@ watch(()=>evaluationManageData.isGenerateAccountByGender,(newVal)=>{
|
|
|
onMounted(async ()=>{
|
|
|
let generateFlag = await GenerateReviewCode()
|
|
|
if(generateFlag){ // 这一步成功 才执行下一步
|
|
|
- await GetReviewCode()
|
|
|
+ await GetGradeAndClassListOption()
|
|
|
+ await GetReviewCode()
|
|
|
}else{
|
|
|
// 评价码生成失败 返回配置页
|
|
|
router.push(`reviewAccount?id=${route.query.id}`)
|