Administrator
2022-01-12 21c7375b7b38ebf2c8a2ca8fbf6fe9fb4f28250f
src/views/trainExam/singleperformance.vue
@@ -2,7 +2,7 @@
 * @Author: Morpheus
 * @Date: 2021-07-05 16:31:54
 * @Last Modified by: liu
 * @Last Modified time: 2021-11-23 14:11:16
 * @Last Modified time: 2021-12-10 10:01:11
 * menu-name 成绩查看
 */
<template>
@@ -23,6 +23,7 @@
            :table-loading="questionBankLoading"
            :data="questionBankData"
            ref="questionBankCrud"
            @sort-change="sortChange"
            :permission="permissionList"
            :page.sync="questionBankPage"
            @on-load="questionBankOnLoad"
@@ -149,6 +150,8 @@
        // title: '成绩',
        align: "center",
        height: "auto",
        sort:"",
      sortName:"",
        calcHeight: 80,
        tip: false,
        searchShow: true,
@@ -193,6 +196,7 @@
            prop: "examName",
            search: true,
            searchSpan: 5,
            searchLabelWidth: 80,
            slot: true,
            viewDisplay: false,
            // 表单新增时是否禁止
@@ -222,6 +226,7 @@
            prop: "securityName",
            search: true,
            searchSpan: 3,
            searchLabelWidth: 50,
            slot: true,
            viewDisplay: true,
            // 表单新增时是否禁止
@@ -251,7 +256,7 @@
            label: "身份证号",
            prop: "account",
            search: true,
            searchSpan: 4,
            searchSpan: 5,
            slot: true,
            // 表单新增时是否禁止
            addDisabled: false,
@@ -384,7 +389,7 @@
            type: "select",
            slot: true,
            search: true,
            searchSpan: 3,
            searchSpan: 4,
            dicData: [
              {
                label: "发布成绩",
@@ -393,6 +398,10 @@
              {
                label: "考试中",
                value: 3,
              },
              {
                label: "缺考",
                value: 4,
              },
            ],
            width: 90,
@@ -420,6 +429,7 @@
            label: "理论成绩",
            prop: "theoryGrade",
            slot: true,
            sortable: true,
            // 表单新增时是否禁止
            addDisabled: false,
            // 表单新增时是否可见
@@ -438,6 +448,7 @@
            label: "实操成绩",
            prop: "learnGrade",
            slot: true,
            sortable: true,
            // 表单新增时是否禁止
            addDisabled: false,
            // 表单新增时是否可见
@@ -459,6 +470,7 @@
            label: "总成绩",
            prop: "allGrade",
            slot: true,
            sortable: true,
            // 表单新增时是否禁止
            addDisabled: false,
            // 表单新增时是否可见
@@ -486,8 +498,8 @@
            type: "select",
            slot: true,
            search: true,
            searchSpan: 3,
            width: 110,
            searchSpan: 4,
            // width: 110,
            width: 68,
            dicData: [
              {
@@ -568,6 +580,27 @@
        query: obj,
      });
    },
    //排序
    sortChange(value) {
      if(value.order=="ascending"){
        this.sort = "asc";
      }
      if(value.order=="descending"){
        this.sort = "desc";
      }
      this.sortName = value.prop;
      //字段匹配
      if(value.prop=="theoryGrade"){
        this.sortName = "theory_grade";
      }
      if(value.prop=="learnGrade"){
        this.sortName = "learn_grade";
      }
      if(value.prop=="allGrade"){
        this.sortName = "all_grade";
      }
      this.questionBankOnLoad(this.questionBankPage);
    },
    questionBankOnLoad(page, params = {}) {
      //判断角色,如果是保安公司管理员或保安,只能查看当前公司的考试成绩
      var that = this;
@@ -577,7 +610,11 @@
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
          var roleAlias = res.data.data.roleAlias;
          if (roleAlias == "保安公司管理员" || roleAlias == "保安" || roleAlias == "分公司管理员") {
          if (
            roleAlias == "保安公司管理员" ||
            roleAlias == "保安" ||
            roleAlias == "分公司管理员"
          ) {
            //如果是保安公司管理员
            params["deptId"] = that.userInfo.dept_id;
          }
@@ -587,6 +624,12 @@
          }
          that.questionBankLoading = false;
          params["examType"] = 2;
          if(this.sort){
            params["sort"] = this.sort;
          }
          if(this.sortName){
            params["sortName"] = this.sortName;
          }
          getList(
            page.currentPage,
            page.pageSize,