|
@@ -1,19 +1,384 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div ref="courseDom" class="main_container">
|
|
<div ref="courseDom" class="main_container">
|
|
|
<div class="page_item end_item">
|
|
<div class="page_item end_item">
|
|
|
-
|
|
|
|
|
|
|
+ <div class="page_search">
|
|
|
|
|
+ <div class="search_content">
|
|
|
|
|
+ <div class="conent_left">
|
|
|
|
|
+ <TabSearch
|
|
|
|
|
+ :tabList="viewModeTabList"
|
|
|
|
|
+ tabType="box"
|
|
|
|
|
+ :defaultTabKey="defaultViewMode"
|
|
|
|
|
+ @tabChange="HandleTabChage"
|
|
|
|
|
+ />
|
|
|
|
|
+ <FormSearchGroup :search-list="searchList"
|
|
|
|
|
+ @searchChange="HandleSearchChange"></FormSearchGroup>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="conent_right">
|
|
|
|
|
+ <el-button class="button_background" @click="GoToCreateQuestionnaire">创建评价</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="page_jg_20"></div>
|
|
|
|
|
+
|
|
|
|
|
+ <SearchBlock
|
|
|
|
|
+ :searchList="statusSearchList"
|
|
|
|
|
+ @searchChange="HandleSearchChange">
|
|
|
|
|
+ </SearchBlock>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="page_jg_20"></div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 视图展示数据 -->
|
|
|
|
|
+ <QuestionnaireCard
|
|
|
|
|
+ v-if="defaultViewMode == 'view'"
|
|
|
|
|
+ :cardStatusMsg="cardStatusMsg"
|
|
|
|
|
+ :cardTypeMsg="cardTypeMsg"
|
|
|
|
|
+ :questionnaireList="questionnaireList"
|
|
|
|
|
+ cardType="reviewManage"
|
|
|
|
|
+ @switchOnOff="HandleCardSwitchOnOff"
|
|
|
|
|
+ >
|
|
|
|
|
+
|
|
|
|
|
+ <template #default="{row}">
|
|
|
|
|
+
|
|
|
|
|
+ <el-button class="button_background">查看详情</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ :class="[Number(row.useStatus) === 1 ? 'is-disabled' : 'button_border']"
|
|
|
|
|
+ @click="Number(row.useStatus) === 1 ? '' : GoToCreateQuestionnaire(row)"
|
|
|
|
|
+ >编辑</el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ :class="[Number(row.useStatus) === 1 ? 'is-disabled' : 'delete_button_border']"
|
|
|
|
|
+ @click="Number(row.useStatus) === 1 ? '' : OpenDeleteDialog(row)"
|
|
|
|
|
+ >删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </QuestionnaireCard>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 列表展示数据 -->
|
|
|
|
|
+ <Table v-else
|
|
|
|
|
+ :currentPage="currentPage"
|
|
|
|
|
+ :pageSize="pageSize"
|
|
|
|
|
+ :totalNum="totalNum"
|
|
|
|
|
+ :tableData="questionnaireList"
|
|
|
|
|
+ :tableColumns="questionnaireTableColumns"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #num="{currentIndex}">
|
|
|
|
|
+ {{ currentIndex + pageSize * (currentPage - 1)}}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #reviewType="{row}">
|
|
|
|
|
+ {{ cardTypeMsg.find(item=>{return item.type === row.reviewType})?.title }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #useStatus="{row}">
|
|
|
|
|
+ <TableRowStatus :useStatus="row.useStatus" :statusMsg="useStatusConvert"></TableRowStatus>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #isOpen="{row}">
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <el-switch
|
|
|
|
|
+ v-model="row.cardOnOff"
|
|
|
|
|
+ :active-value="true"
|
|
|
|
|
+ @change="(val)=>HandleCardSwitchOnOff(val,row)"
|
|
|
|
|
+ style="--el-switch-on-color: #2e64fa; --el-switch-off-color: #bbbbbb"
|
|
|
|
|
+ />
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <template #operation="{row}">
|
|
|
|
|
+ <div class="table_row_option">
|
|
|
|
|
+ <span
|
|
|
|
|
+ :class="[Number(row.useStatus) === 1 ? 'editor_disable' : 'el_button_editor']"
|
|
|
|
|
+ @click="Number(row.useStatus) === 1 ? '' : GoToCreateQuestionnaire(row)"
|
|
|
|
|
+ >编辑</span>
|
|
|
|
|
+ <span
|
|
|
|
|
+ :class="[Number(row.useStatus) === 1 ? 'editor_disable' : 'el_button_delete']"
|
|
|
|
|
+ @click="Number(row.useStatus) === 1 ? '' : OpenDeleteDialog(row)"
|
|
|
|
|
+ >删除</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </Table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <Dialog
|
|
|
|
|
+ :visible="dialogVisible"
|
|
|
|
|
+ :submitLoading="dialogSubmitLoading"
|
|
|
|
|
+ @close="HandleDialogClose"
|
|
|
|
|
+ @confirm="HandleDialogConfirm"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="dialog_alert">确定删除 [ <span class="title">{{ currentOperationRow?.assessmentTitle}}</span> ] 吗</span>
|
|
|
|
|
+ </Dialog>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import {onMounted, ref} from 'vue'
|
|
import {onMounted, ref} from 'vue'
|
|
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
|
|
+
|
|
|
|
|
+import Table from '@/baseComponents/Table.vue';
|
|
|
|
|
+import TabSearch from '@/baseComponents/TabSearch.vue';
|
|
|
|
|
+import TableRowStatus from '@/baseComponents/TableRowStatus.vue';
|
|
|
|
|
+import Dialog from '@/baseComponents/Dialog.vue';
|
|
|
|
|
+
|
|
|
|
|
+import QuestionnaireCard from '@/components/questionnaireCard/QuestionnaireCard.vue';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+import {searchList, viewModeTabList, statusSearchList} from './searchListConfig'
|
|
|
|
|
+import { questionnaireTableColumns } from './table';
|
|
|
|
|
+import {useStatusConvert, cardTypeMsg} from '@/components/statusDict'
|
|
|
|
|
+
|
|
|
|
|
+import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
|
|
|
+import SearchBlock from '@/baseComponents/SearchBlock.vue';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+interface QuestionnaireItm {
|
|
|
|
|
+ id:Number | String,
|
|
|
|
|
+ assessmentTitle:String, //标题
|
|
|
|
|
+
|
|
|
|
|
+ teacherName:String, //创建人
|
|
|
|
|
+ // createdAt:String, //创建时间
|
|
|
|
|
+ startTime:String, //创建时间
|
|
|
|
|
+ endTime:String, //创建时间
|
|
|
|
|
+ useStatus:Number, //1 已使用 0 未使用
|
|
|
|
|
+ cardStatus:Number,
|
|
|
|
|
+ cardOnOff:Boolean,
|
|
|
|
|
+ reviewType:Number|String,
|
|
|
|
|
+
|
|
|
|
|
+ time:String,
|
|
|
|
|
+ isOpen:Boolean,
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+const router = useRouter()
|
|
|
|
|
+
|
|
|
|
|
+// 1. 视图模式切换
|
|
|
|
|
+const defaultViewMode = ref('list')
|
|
|
|
|
+const HandleTabChage = (val)=>{
|
|
|
|
|
+ defaultViewMode.value = val
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 查询参数
|
|
|
|
|
+const searchParams = ref()
|
|
|
|
|
+const HandleSearchChange = (params,key)=>{
|
|
|
|
|
+ console.log('获取到的查询参数',params)
|
|
|
|
|
+ searchParams.value = {
|
|
|
|
|
+ ...searchParams.value,
|
|
|
|
|
+ ...params
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+//. 问卷列表
|
|
|
|
|
+const currentPage = ref(1)
|
|
|
|
|
+const totalNum = ref(0)
|
|
|
|
|
+const pageSize = ref(20)
|
|
|
|
|
+const questionnaireList = ref<QuestionnaireItm[]>([
|
|
|
|
|
+ {
|
|
|
|
|
+ "id": '655355453521268736',
|
|
|
|
|
+ // "createdAt": "2026-06-29 10:28",
|
|
|
|
|
+ startTime:'2026-06-29 16:00',
|
|
|
|
|
+ endTime:'2026-06-29 16:00',
|
|
|
|
|
+ time:'2026-06-29 16:00 至 2026-06-29 16:00',
|
|
|
|
|
+
|
|
|
|
|
+ // "teacherId": "510448965049651259",
|
|
|
|
|
+ "teacherName": "李敏",
|
|
|
|
|
+ "assessmentTitle": "f制",
|
|
|
|
|
+ // "assessmentIllustrate": "fdsf",
|
|
|
|
|
+ // "assessmentScore": "30.00",
|
|
|
|
|
+ // "assessmentSortCode": 111,
|
|
|
|
|
+ "useStatus": 0,
|
|
|
|
|
+ // "questionData": null,
|
|
|
|
|
+ isOpen:true,
|
|
|
|
|
+ 'cardOnOff':true,
|
|
|
|
|
+ cardStatus:0,
|
|
|
|
|
+ reviewType:0
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ "id": '6553554535212687236',
|
|
|
|
|
+ // "createdAt": "2026-06-29 10:28",
|
|
|
|
|
+
|
|
|
|
|
+ startTime:'2026-06-29 16:00',
|
|
|
|
|
+ endTime:'2026-06-29 16:00',
|
|
|
|
|
+ time:'2026-06-29 16:00 至 2026-06-29 16:00',
|
|
|
|
|
+ // "teacherId": "510448965049651259",
|
|
|
|
|
+ "teacherName": "李敏",
|
|
|
|
|
+ "assessmentTitle": "fd-复制",
|
|
|
|
|
+ // "assessmentIllustrate": "fdsf",
|
|
|
|
|
+ // "assessmentScore": "30.00",
|
|
|
|
|
+ // "assessmentSortCode": 111,
|
|
|
|
|
+ "useStatus": 1,
|
|
|
|
|
+ // "questionData": null,
|
|
|
|
|
+ isOpen:true,
|
|
|
|
|
+ 'cardOnOff':false,
|
|
|
|
|
+ cardStatus:0,
|
|
|
|
|
+ reviewType:1
|
|
|
|
|
+ },
|
|
|
|
|
+]);
|
|
|
|
|
+
|
|
|
|
|
+// 问卷状态展示
|
|
|
|
|
+const cardStatusMsg = ref([
|
|
|
|
|
+ {
|
|
|
|
|
+ statusFlag:0,
|
|
|
|
|
+ title:'进行中',
|
|
|
|
|
+ themeClass:'ongoing'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ statusFlag:1,
|
|
|
|
|
+ title:'已结束',
|
|
|
|
|
+ themeClass:'end'
|
|
|
|
|
+ },
|
|
|
|
|
+])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+// 问卷开关切换
|
|
|
|
|
+const HandleCardSwitchOnOff = (params)=>{
|
|
|
|
|
+ const {id,onOffVal} = params
|
|
|
|
|
+ console.log('当前值',onOffVal)
|
|
|
|
|
+ // 实际需要调用接口
|
|
|
|
|
+ questionnaireList.value = questionnaireList.value.map(item=>{
|
|
|
|
|
+ if(item.id == id){
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ cardOnOff:onOffVal
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return item
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-onMounted(async ()=>{
|
|
|
|
|
|
|
+const GetQuestionnaireList = async ()=>{
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ pageNum:currentPage.value,
|
|
|
|
|
+ pageSize: pageSize.value
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = await getQuestionnaireListApi(params)
|
|
|
|
|
+
|
|
|
|
|
+ if(res.code == 200){
|
|
|
|
|
+ questionnaireList.value = res.data.records.map(item=>{
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ cardStatus:item.useStatus
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// 2. 跳转创建问卷 /修改文件
|
|
|
|
|
+const GoToCreateQuestionnaire = (row?:any)=>{
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// 删除问卷
|
|
|
|
|
+const dialogVisible= ref(false)
|
|
|
|
|
+const dialogSubmitLoading = ref(false)
|
|
|
|
|
+const currentOperationRow = ref()
|
|
|
|
|
+// 打开删除弹窗
|
|
|
|
|
+const OpenDeleteDialog = (row)=>{
|
|
|
|
|
+ dialogVisible.value = true
|
|
|
|
|
+ currentOperationRow.value = row
|
|
|
|
|
+}
|
|
|
|
|
+// 关闭删除弹窗
|
|
|
|
|
+const HandleDialogClose = ()=>{
|
|
|
|
|
+ dialogVisible.value = false
|
|
|
|
|
+ currentOperationRow.value = null
|
|
|
|
|
+ dialogSubmitLoading.value = false
|
|
|
|
|
+}
|
|
|
|
|
+// 确认删除操作
|
|
|
|
|
+const HandleDialogConfirm = async ()=>{
|
|
|
|
|
+ dialogSubmitLoading.value = true
|
|
|
|
|
+ let res = undefined
|
|
|
|
|
+ try{
|
|
|
|
|
+ // res = await deleteQuestionnaireApi(currentOperationRow.value.id)
|
|
|
|
|
+ }catch{}
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ ElMessage.success(res?.msg)
|
|
|
|
|
+ HandleDialogClose()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ dialogSubmitLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const GetSchoolYearList = ()=>{
|
|
|
|
|
+ let schoolYearOpt = [
|
|
|
|
|
+ {
|
|
|
|
|
+ label:'全部',
|
|
|
|
|
+ value:'all'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label:'2024-2025学年',
|
|
|
|
|
+ value:'2024-2025'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ searchList.value = searchList.value.map(item=>{
|
|
|
|
|
+ if(item.key == 'schoolYear'){
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ options:schoolYearOpt,
|
|
|
|
|
+ defaultValue:'all'
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return item
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+onMounted(async()=>{
|
|
|
|
|
+ GetSchoolYearList()
|
|
|
|
|
+ // await GetQuestionnaireList()
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+
|
|
|
|
|
+.conent_left{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap:20px;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+
|
|
|
|
|
+ .simple_filter{
|
|
|
|
|
+ gap:20px
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.box_tab){
|
|
|
|
|
+ .selected{
|
|
|
|
|
+ &.prefix{
|
|
|
|
|
+ background: #2E64FA;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ border:none
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+.dialog_alert{
|
|
|
|
|
+ color:#666;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ .title{
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</style>
|
|
</style>
|