zhouwx
2024-10-21 c36b440848d5d78f29c583080e0b86a51488917c
src/views/onlineEducation/questionManage/index.vue
@@ -1,36 +1,86 @@
<template>
  <div class="app-container">
    <el-table v-loading="loading" :data="expertList">
      <el-table-column label="月份" align="center" prop="month" />
      <el-table-column label="平台名称" align="center" prop="name" />
      <el-table-column label="上月题库总题目数" align="center" prop="totalNum" />
      <el-table-column label="新增题目数量" align="center" prop="addQuestionNum" />
      <el-table-column label="减少题目数" align="center" prop="reduceQuestionNum" />
      <el-table-column label="刷题应用率" align="center" prop="brushQuestionsRate" />
      <el-table-column label="组卷应用率" align="center" prop="testPaperRate" />
      <el-table-column label="上报时间" align="center" prop="time" />
      <el-table-column label="组卷预览" align="center" class-name="small-padding fixed-width">
    <div style="display: flex">
      <div>
        <span style="font-size: 14px;margin-right:10px">题库名称:</span>
        <el-input v-model="queryParams.name" style="width: 200px" placeholder="请输入题库名称" clearable></el-input>
        <span style="font-size: 14px;margin: 0 20px">平台:</span>
        <el-select v-model="queryParams.institutionId" placeholder="请选择平台" clearable>
          <el-option
            v-for="item in platformList"
            :key="item.id"
            :label="item.institutionalName"
            :value="item.id">
          </el-option>
        </el-select>
        <el-button
          size="small"
          type="primary"
          style="margin-bottom: 10px;margin-left: 20px"
          @click="handleQuery()"
        >查询</el-button>
        <el-button
          plain
          size="small"
          type="primary"
          style="margin-bottom: 10px"
          @click="resetQuery()"
        >重置</el-button>
      </div>
    </div>
    <el-table v-loading="loading" :data="dataList">
      <el-table-column label="序号" align="center" type="index" width="80" />
      <el-table-column label="更新时间" align="center" prop="updateTime" />
      <el-table-column label="平台名称" align="center" prop="institutionName" />
      <el-table-column label="题库名称" align="center" prop="name" />
      <el-table-column label="题库题目总数" align="center" prop="totalCount" />
      <el-table-column label="单选题数量" align="center" prop="singleCount" />
      <el-table-column label="多选题数量" align="center" prop="multiCount" />
      <el-table-column label="判断题数量" align="center" prop="judgeCount" />
      <el-table-column label="简答题数量" align="center" prop="easyCount" />
      <el-table-column label="混合题数量" align="center" prop="mixCount" />
      <el-table-column label="其他题目数量" align="center" prop="otherCount" />
      <el-table-column label="删除标识" align="center">
        <template #default="scope">
          {{scope.row.delFlag == 0 ? '未删除' : scope.row.delFlag == 2 ?'已删除' : ''}}
        </template>
      </el-table-column>
      <el-table-column label="模拟考核组卷" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
            size="mini"
            type="text"
            style="color: #1890ff"
            @click="handleView(scope.row)"
          >点击预览</el-button>
            :loading="btnLoading"
            type="primary"
            @click="groupExam(scope.row)"
          >立即组卷</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageIndex"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <el-dialog
      :visible.sync="showDialog"
      width="500px"
      :before-close="handleClose">
      <div style="font-size: 16px">
        <div>已向 <span class="titleText">{{chooseItem.institutionName}}</span> 发送基于题库 <span class="titleText">{{chooseItem.name}}</span> 的组卷要求,学员可登录平台进行模拟考试。</div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleClose">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { delPlat, listPlatSelect } from '@/api/onlineEducation/plat'
import { getQuestion } from '@/api/onlineEducation/question'
export default {
  name: "nPeopleManage",
  dicts: [],
@@ -44,60 +94,92 @@
      addForm: false,
      total: 0,
      expertTypes: [],
      expertList: [],
      dataList: [],
      queryParams: {
        pageIndex: 1,
        pageSize: 10
        name: '',
        institutionId: null,
        pageNum: 1,
        pageSize: 10,
      },
      platformList: [],
      btnLoading:false,
      showDialog:false,
      chooseItem: {}
    };
  },
  created() {
    this.getPlat();
    this.getList();
  },
  methods: {
    getList(){
      this.loading = true;
      this.expertList = [
        {
          id: 1,
          month: '2024年6月',
          name: '测试数据1',
          totalNum: 120,
          addQuestionNum: 20,
          reduceQuestionNum: 10,
          brushQuestionsRate: '80%',
          testPaperRate: '75%',
          time: '2024-6-11 10:32:00 '
        },
        {
          id: 2,
          month: '2024年6月',
          name: '测试数据2',
          totalNum: 100,
          addQuestionNum: 10,
          reduceQuestionNum: 15,
          brushQuestionsRate: '90%',
          testPaperRate: '85%',
          time: '2024-6-11 10:32:00 '
      getQuestion(this.queryParams).then(res => {
        if(res.code === 200){
          this.dataList = res.rows
          this.total = res.total
          this.loading = false;
        }else {
          this.$message({
            message: res.msg,
            type: 'warning'
          })
        }
      ]
      this.total = 2
      this.loading = false;
      })
    },
    getPlat() {
      listPlatSelect().then((res) => {
        if (res.code == 200) {
          this.platformList = res.data
        }
      })
    },
    handleChange(){
    },
    handleQuery(){
      this.getList();
    },
    resetQuery(){
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        institutionId: '',
        name: ''
      }
      this.getList();
    },
    handleView(){
    groupExam(row){
      this.$confirm('确认立即组卷该题库?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.btnLoading = true
        setTimeout(() => {
          this.chooseItem = row
          console.log('row',row)
         this.showDialog = true
          this.btnLoading = false
        }, 1500);
      })
    },
    handleClose() {
      this.chooseItem = {}
      this.showDialog = false
    }
  }
};
</script>
<style lang="scss" scoped>
.titleText{
  font-size: 16px;
  font-weight: 600;
  color: #1890ff;
}
.dialog-footer{
  display: flex;
  justify-content: center;
}
</style>