TeachEvaDet.vue 2.7 KB
<template>
  <!-- 个人中心 测评管理 -->
  <div class="personal_manage">
    <div class="test_content clearfix" v-if="testList.length>0">
      <!-- 具体内容 -->
      <div class="test_det clearfix">
        <div class="test_det_list clearfix" v-for="item in testList" :key="item.id">
          <!-- 测评类型 -->
          <div class="test_style clearfix">
            <div class="test_style_l">
              <div class="test_interest">
                <p>{{item.type_category_text}}</p>
                <p>{{item.title}}</p>
              </div>
              <div class="test_start_end">
                <p>开始时间:{{item.starttime}}</p>
                <p>结束时间:{{item.endtime}}</p>
              </div>
            </div>
          </div>
          <!-- 测评说明 -->
          <div class="test_induction clearfix">
            <!-- 左侧 -->
            <div class="test_induction_l">
              <div class="test_l_title">测评说明:</div>
              <div class="test_l_content">{{item.text}}</div>
            </div>

            <!-- 右侧 -->
            <div class="test_induction_r layout align_center justify_center">
              <div class="test_btn" @click="toDetail(item)">查看详情</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 暂无测评 -->
    <div class="no_test_lis" v-else>暂无测评</div>
    <!-- 分页 -->
    <el-pagination
      background
      layout="prev, pager, next"
      :page-count="total"
      @current-change="handleCurrentChange"
    ></el-pagination>
  </div>
</template>
<script>
import { post } from "@/api/http";
export default {
  data() {
    return {
      testList: [],
      total:null,
      page:"",
    };
  },
  methods: {
    // 分页
    handleCurrentChange(val){
      this.page = val;
      this.getTestList();
    },
    // 查看详情
    toDetail(item) {
      console.log(item);
      let type = "";
      if(item.test_category == "interest"){
        type = 1
      }else{
        type = 2
      }
      this.$router.push({path:'/TeachEvalute',query:{id:item.id,type:type}})
    },
    // 已发布的测评
    getTestList: function() {
      let url = "/api/teacher/testList";
      let params = {
        id: localStorage.getItem("termId"),
        page:this.page
      };
      post(url, params).then(res => {
        this.testList = res.test_list;
        this.total = res.total_page;
      });
    }
  },
  mounted() {
    this.getTestList();
  }
};
</script>
<style scoped>
@import "../../../style/evaluteManage.css";
/* 暂无测评 */
.no_test_lis {
  font-size: 16px;
  font-weight: bold;
  color: #34485e;
  margin: 100px auto;
}
</style>