<template>
  <div class="content-box">
    <div v-if="pageIndex == 1">
      <div class="left">
        <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
        <span class="cameratxt">学生综合素质评价</span>
      </div>
      <div class="scroll">
        <div class="middle">
          <div class="filter">
            <div class="condition">
              <el-input
                :clearable="true"
                @clear="searchBtn"
                v-model.trim="searchInput.keyWord"
                class="sel"
                placeholder="请输入学生姓名或学号"
              /><el-button
                color="rgba(0, 97, 255, 1)"
                type="primary"
                class="search"
                @click="searchBtn"
                >查询</el-button
              >
            </div>
            <div class="condition">
              <span class="title">学期 :</span>
              <el-select
                v-model="searchInput.semester"
                class="sel"
                placeholder="请选择学期"
              >
                <el-option label="全部" value="1" />
                <el-option label="2019-2020秋季学期（下学期）" value="2" />
              </el-select>
            </div>
            <div class="condition">
              <span class="title">年级 :</span>
              <el-select
                v-model="searchInput.grade"
                class="sel"
                placeholder="请选择年级"
              >
                <el-option label="全部" value="1" />
                <el-option label="七年级" value="2" />
                <el-option label="八年级" value="2" />
              </el-select>
            </div>
            <div class="condition">
              <span class="title">班级 :</span>
              <el-select
                v-model="searchInput.class"
                class="sel"
                placeholder="请选择学期"
              >
                <el-option label="全部" value="1" />
                <el-option label="一班" value="2" />
                <el-option label="二班" value="2" />
              </el-select>
            </div>
            <div class="condition">
              <span class="title">测评等级 :</span>
              <el-select
                v-model="searchInput.appraisal"
                class="sel"
                placeholder="请选择测评等级"
              >
                <el-option label="全部" value="1" />
                <el-option label="优等" value="2" />
                <el-option label="良" value="2" />
              </el-select>
            </div>
          </div>
          <!-- 按钮列表 -->
          <!-- <div class="gongneng">
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              plain
              @click="scoringItemsClick"
              >评分项管理</el-button
            >
            <el-button
              type="primary"
              color="rgba(0, 97, 255, 1)"
              @click="importExcel"
              plain
              >导出</el-button
            >
          </div> -->
        </div>
        <div class="footer" v-loading="loading">
          <el-table
            :row-class-name="tableRowClassName"
            :data="tableData.list"
            @selection-change="handleSelectionChange"
            style="width: 100%"
            :header-cell-style="{
              background: 'rgba(240, 243, 247, 1)',
              height: '50px',
              border: 0,
            }"
          >
            <el-table-column align="center" type="selection" width="80" />
            <el-table-column align="center" type="index" label="序号" />
            <el-table-column
              align="center"
              prop="type"
              width="200"
              label="学期"
            />
            <!-- <el-table-column align="center" prop="name" label="教师姓名">
              <template #default="scope">
                <span class="normal" @click="teacherInfoClick(scope.row)"
                  >教师姓名</span
                >
              </template>
            </el-table-column> -->
            <el-table-column align="center" prop="status" label="年级" />
            <el-table-column align="center" prop="status" label="班级" />
            <el-table-column align="center" prop="status" label="姓名" />
            <el-table-column align="center" prop="status" label="测评等级" />
            <el-table-column align="center" label="操作">
              <template #default="scope">
                <div class="edit">
                  <div class="look" @click="teacherInfoClick(scope.row)">
                    查看详情
                  </div>
                  <!-- <el-popconfirm
                  width="220"
                  confirm-button-text="确认"
                  cancel-button-text="取消"
                  :icon="InfoFilled"
                  icon-color="#f89626"
                  title="是否删除此房型?"
                  @confirm="del(scope.row)"
                  @cancel="cancelEvent"
                >
                  <template #reference>
                    <div class="del">删除</div>
                  </template>
                </el-popconfirm> -->
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>

        <!-- 分页组件 -->
        <div class="pageSize">
          <span></span>
          <el-pagination
            background
            :current-page="currentPage"
            :page-size="pageSize"
            layout="total, prev, pager, next, jumper, slot"
            :total="total"
            @update:current-page="handleCurrentChange"
          />
        </div>
      </div>
    </div>
    <div v-if="pageIndex == 2" class="teacherInfo">
      <div class="left">
        <img
          src="@/assets/images/close.png"
          alt=""
          @click="teacherInfoConcel"
        />
        <span class="cameratxt">学生综合素质评价/详情</span>
      </div>
      <div class="scroll_score">
        <div class="semester">
          <div class="title">2019-2020秋季学期（下学期）</div>
          <div class="score">
            <div class="score_left">
              <img src="" alt="" />
              <div class="info">
                <div class="info_name">
                  <span class="name">李四</span>
                  <span class="class"> / 八一班</span>
                </div>
                <div class="info_object">
                  出生日期: 1996.03.16&nbsp;&nbsp;&nbsp;学工号:
                  2210&nbsp;&nbsp;&nbsp;政治面貌 : 团员
                </div>
                <div class="info_object">
                  名族: 汉族&nbsp;&nbsp;&nbsp;身体健康状况:
                  良好&nbsp;&nbsp;&nbsp;兴趣爱好 : 打篮球
                </div>
                <div class="info_object">
                  家庭住址: 山西省太原市小店区南中环小区12-2-2
                </div>
              </div>
            </div>
            <!-- <div class="score_right"><span class="num">93</span>分</div> -->
          </div>
        </div>
        <div class="scoreList">
          <div class="changeInfo">
            <span
              @click="infoClick(1)"
              :class="studentIndex == 1 ? 'sel_info' : ''"
              >综合测评</span
            >
            <span
              @click="infoClick(2)"
              :class="studentIndex == 2 ? 'sel_info' : ''"
              >教师评语</span
            >
          </div>
          <!-- 综合测评 -->
          <div class="synthesis" v-if="studentIndex == 1">
            <div class="score_footer">
              <div class="footer_left">
                <div id="scoreEcharts"></div>
              </div>
              <div class="footer_right">
                <div class="title">
                  <el-button
                    color="rgba(0, 97, 255, 1)"
                    type="primary"
                    class="btn"
                    plain
                    @click="objectClick"
                    >学科管理</el-button
                  >
                  <el-button
                    color="rgba(0, 97, 255, 1)"
                    type="primary"
                    class="btn"
                    plain
                    @click="criterionClick"
                    >评分标准</el-button
                  >
                </div>
                <el-table
                  :row-class-name="tableRowClassName"
                  :data="synthesisData.list"
                  :span-method="objectSpanMethod"
                  :header-cell-style="{
                    background: 'rgba(240, 243, 247, 1)',
                    height: '50px',
                  }"
                >
                  <el-table-column align="center" prop="object" label="学科" />
                  <el-table-column align="center" prop="status" label="等级" />
                  <el-table-column align="center" prop="score" label="成绩" />
                  <el-table-column align="center" prop="status" label="操作">
                    <template #default="scope">
                      <div style="color: rgba(0, 97, 255, 1)">评分</div>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </div>
          <!-- 教师评语 -->
          <div class="synthesis" v-if="studentIndex == 2">
            <div class="teacher_footer">
              <div class="info">
                <div class="info_img">
                  <img src="" alt="" />
                </div>
                <div class="info_content">
                  <div class="info_name">班主任</div>
                  <div class="info_time">2023.09.08 09:20:20</div>
                </div>
              </div>
              <div class="comment">
                <el-input
                  v-model.trim="traComment"
                  maxlength="1000"
                  placeholder="请老师输入评语"
                  show-word-limit
                  type="textarea"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 评分标准按钮 -->
    <el-dialog
      class="criterionDialog"
      v-model="criterionVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="评分标准"
      align-center
      width="825"
      :before-close="cancelCriterion"
    >
      <div class="criterion">
        <div class="selObject">
          <ul>
            <li
              v-for="(item, index) in objectList.list"
              :class="objectIndex == index ? 'sel' : ''"
              @click="objectSelClick(index)"
            >
              {{ item }}
            </li>
          </ul>
        </div>
        <el-table
          :row-class-name="tableRowClassName"
          :data="scoreScope.list"
          :header-cell-style="{
            background: 'rgba(240, 243, 247, 1)',
            height: '50px',
          }"
        >
          <el-table-column
            width="160"
            align="center"
            type="index"
            label="序号"
          />
          <el-table-column
            width="208"
            align="center"
            prop="status"
            label="等级"
          >
            <template #default="{ row, index }">
              <el-input
                :clearable="true"
                @clear="searchBtn"
                v-model.trim="row.status"
                class="grade_right"
                placeholder="请输入等级"
                style="width: 180px"
                v-if="row.flag"
              />
              <span v-else>{{ row.status }}</span>
            </template>
          </el-table-column>
          <el-table-column
            width="230"
            align="center"
            prop="score"
            label="分值区间"
          >
            <template #default="{ row, index }">
              <div class="grade" v-if="row.flag">
                <el-input
                  :clearable="true"
                  @clear="searchBtn"
                  v-model.trim="row.scoreB"
                  class="grade_left"
                  placeholder="最低区间"
                  style="width: 90px"
                />
                <span class="line">-</span>
                <el-input
                  :clearable="true"
                  @clear="searchBtn"
                  v-model.trim="row.scoreT"
                  class="grade_right"
                  placeholder="最高区间"
                  style="width: 90px"
                />
              </div>
              <span v-else>{{ row.scoreB }}-{{ row.scoreT }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="status" label="操作">
            <template #default="{ index, row }">
              <div class="edit" @click="editScoreScope(index, row)">编辑</div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="options">
        <el-button
          color="rgba(41, 109, 227, 1)"
          class="queding"
          type="primary"
          @click="confirmCriterion"
        >
          确认
        </el-button>
        <el-button @click="cancelCriterion">取消</el-button>
      </div>
    </el-dialog>

    <!-- 学科管理按钮 -->
    <el-dialog
      class="objectDialog"
      v-model="objectVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      title="学科管理"
      align-center
      width="825"
      :before-close="cancelObject"
    >
      <div class="criterion">
        <div class="selObject">
          <span class="warning">注：只能选择6个维度进行展示</span>
          <el-button
            color="rgba(0, 97, 255, 1)"
            class="queding"
            type="primary"
            plain
            @click="addObject"
          >
            新增学科
          </el-button>
        </div>
        <el-table
          :row-class-name="tableRowClassName"
          :data="objectData.list"
          :header-cell-style="{
            background: 'rgba(240, 243, 247, 1)',
            height: '50px',
          }"
        >
          <el-table-column
            width="160"
            align="center"
            type="index"
            label="序号"
          />
          <el-table-column
            width="160"
            align="center"
            prop="object"
            label="学科"
          />
          <el-table-column
            width="208"
            align="center"
            prop="status"
            label="是否展示"
          >
            <template #default="{ row, index }">
              <el-radio-group v-model="row.flag">
                <el-radio :label="1">是</el-radio>
                <el-radio :label="2">否</el-radio>
              </el-radio-group>
              <!-- <el-checkbox v-model="row.flag" label="1" size="large" />
    <el-checkbox v-model="row.flag" label="2" size="large" /> -->
            </template>
          </el-table-column>

          <el-table-column align="center" prop="status" label="操作">
            <template #default="{ index, row }">
              <div class="edit" @click="delObject(index, row)">删除</div>
            </template>
          </el-table-column>
        </el-table>

        <!-- <video class="tvhou" width="400" height="250" 
    controls="controls" autoplay="autoplay" 
    x-webkit-airplay="true" x5-video-player-fullscreen="true" 
    preload="auto" playsinline="true" webkit-playsinline 
    x5-video-player-typ="h5"> 
    <source type="application/x-mpegURL" src="http://192.168.161.72:83/openUrl/E1Wp0UU/playback.m3u8?beginTime=20231228T172400&endTime=20231228T172500"> 
</video>  -->
      </div>
      <div class="options">
        <el-button
          color="rgba(41, 109, 227, 1)"
          class="queding"
          type="primary"
          @click="confirmObject"
        >
          确认
        </el-button>
        <el-button @click="cancelObject">取消</el-button>
      </div>
    </el-dialog>

    <!-- 添加项弹窗 -->
    <el-dialog
      class="addItemDialog"
      v-model="addItemVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :title="addItemTitle"
      align-center
      width="550"
      :before-close="cancelAddItem"
    >
      <el-form
        ref="addItemRef"
        :model="addItemRuleForm"
        :rules="addItemRules"
        label-width="100px"
        class="demo-ruleForm"
        :size="formSize"
        label-position="right"
        status-icon
      >
        <el-form-item
          v-if="addItemTitle == '添加评分项'"
          label="评分项 :"
          prop="bigitem"
        >
          <el-input
            v-model.trim="addItemRuleForm.bigitem"
            placeholder="请输入评分项"
            style="width: 300px"
          />
        </el-form-item>
        <el-form-item label="评分子项 :" prop="subitem">
          <el-input
            v-model.trim="addItemRuleForm.subitem"
            placeholder="请输入评分子项"
            style="width: 300px"
          />
        </el-form-item>
        <el-form-item label="分值 :" prop="score">
          <el-input
            v-model.trim="addItemRuleForm.score"
            placeholder="请输入分值"
            style="width: 300px"
          />
        </el-form-item>
        <el-form-item class="options">
          <el-button
            color="rgba(41, 109, 227, 1)"
            class="queding"
            type="primary"
            @click="confirmAddItem(addItemRef)"
          >
            确认
          </el-button>
          <el-button @click="cancelAddItem">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script setup>
import * as echarts from "echarts";
import { markRaw } from "vue";
import {
  ref,
  reactive,
  watch,
  nextTick,
  onBeforeMount,
  onMounted,
  onUnmounted,
} from "vue";
import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { Calendar } from "@element-plus/icons-vue";
import vidiconsApi from "@/api/vidicons.js";
import { dayjs } from "element-plus";
import lodash from "lodash";
import axios from "axios";
import { useStore } from "vuex";
const store = useStore();
const api = ref("");
const router = useRouter();
// 表格数据
const loading = ref(false);
const tableData = reactive({
  list: [
    {
      type: "2019-2020秋季学期（下学期）",
      name: "消息平台",
      link: "2020152",
      status: 1,
      describe: "消息平台",
    },
    {
      type: "2019-2020秋季学期（下学期）",
      name: "学工数据库",
      link: "456952",
      status: 1,
      describe: "学工数据库",
    },
    {
      type: "2019-2020秋季学期（下学期）",
      name: "教务中间库",
      link: "9879845665",
      status: 1,
      describe: "教务中间库",
    },
    {
      type: "2019-2020秋季学期（下学期）",
      name: "新认证正式库",
      link: "6665156156",
      status: 1,
      describe: "新认证正式库",
    },
    {
      type: "2019-2020秋季学期（下学期）",
      name: "迎新系统",
      link: "56922",
      status: 1,
      describe: "迎新系统",
    },
  ],
});

const searchInput = reactive({
  keyWord: "",
  semester: "1", // 学期
  grade: "1", // 年级
  class: "1", // 班级
  appraisal: "1", // 测评等级
}); // 搜索按钮数据

const currentPage = ref(1); // 当前页
const pageSize = ref(10);
const total = ref(5); // 当前总数
const selectData = reactive({
  list: [
    { a: 1, b: 2, c: 1, d: 1, e: 1, f: 1, g: 1, h: 1, i: 1, j: 1, k: 1, l: 1 },
  ],
}); // 表格勾选的数据

// 去评分弹窗 (----------------------------------------------------)
const scoreVisible = ref(false);
const scoreData = reactive({ list: [] });

// 评分项管弹窗 (----------------------------------------------------)
const scoringItemsVisible = ref(false);
const resetTable = ref(); // 表格ref
const scoringItemsData = reactive({
  list: [
    { pf: "德", index: 1, pfz: "", fz: "15" },
    { pf: "德", pfz: "为人师表", fz: "15" },
    { pf: "德", pfz: "关爱学生", fz: "15" },
    { pf: "德", pfz: "爱岗敬业", fz: "15" },
    { pf: "能", index: 1, pfz: "", fz: "15" },
    { pf: "能", pfz: "基础能力", fz: "15" },
    { pf: "能", pfz: "教学能力", fz: "15" },
    { pf: "能", pfz: "学习能力", fz: "15" },
    { pf: "能", pfz: "创新能力", fz: "15" },
    { pf: "智", index: 1, pfz: "", fz: "15" },
    { pf: "智", pfz: "基础能力", fz: "15" },
    { pf: "智", pfz: "教学能力", fz: "15" },
  ],
});
const resetTableIndex = ref(); // 表格ref
const mergeArr = reactive({ list: [] }); // 合并的表格规律

// 添加项功能弹窗 (----------------------------------------------------)
const addItemTitle = ref("");
const addItemVisible = ref(false);
const addItemRef = ref();
const addItemRuleForm = reactive({
  bigitem: "", // 评分项
  subitem: "", // 评分子项
  score: "", // 分值
  id: "",
});
const validateScore = (rule, value, callback) => {
  if (/^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,2})?$/.test(value)) {
    callback();
  } else {
    callback(new Error("请输入正确的分值"));
  }
};
// 表单验证
const addItemRules = reactive({
  bigitem: [{ required: true, message: "评分项不能为空", trigger: "blur" }],
  subitem: [
    {
      required: true,
      message: "评分子项不能为空",
      trigger: "blur",
    },
  ],
  score: [
    {
      required: true,
      message: "分值不能为空",
      trigger: "blur",
    },
    { validator: validateScore, trigger: "blur" },
  ],
});

// 学生综合素质评价/详情 页面 (----------------------------------------------------)
const pageIndex = ref(1); // 切换到详情页面
const scoreEcharts = ref(); // 评分对比统计图
const studentIndex = ref(1); // 学生详情页面中 综合测评 /教师评语切换
const synthesisData = reactive({
  list: [
    { object: "数学", status: "A", score: 80 },
    { object: "英语", status: "A", score: 80 },
    { object: "语文", status: "A", score: 80 },
    { object: "政治", status: "A", score: 80 },
    { object: "历史", status: "A", score: 80 },
    { object: "生物", status: "A", score: 80 },
    { object: "物理", status: "A", score: 80 },
  ],
}); // 综合测评表格数据
const traComment = ref(); // 教师评语

// 评分标准按钮 (\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\)
const criterionVisible = ref(false);
const objectIndex = ref(1);
const objectList = reactive({
  list: ["语文", "数学", "化学", "生物", "英语", "物理", "历史"],
});
// 评分表格数据
const scoreScope = reactive({
  list: [
    {
      status: "A",
      scoreT: "80",
      scoreB: "90",
      flag: false,
    },
    {
      status: "B",
      scoreT: "80",
      scoreB: "90",
      flag: false,
    },
    {
      status: "C",
      scoreT: "80",
      scoreB: "90",
      flag: false,
    },
    {
      status: "D",
      scoreT: "80",
      scoreB: "90",
      flag: false,
    },
  ],
});

// 学科管理按钮  (--------------------------------------------------------)
const objectVisible = ref(false);

// 学科管理数据
const objectData = reactive({
  list: [
    {
      object: "数学",
      flag: 1,
    },
    {
      object: "语文",
      flag: 2,
    },
    {
      object: "英语",
      flag: 2,
    },
    {
      object: "物理",
      flag: 1,
    },
  ],
});

// 学生列表
const getList = async () => {
  //   loading.value = true;
  //   let data = {
  //     page: currentPage.value,
  //     rows: pageSize.value,
  //     hName: searchInput.keyWord, // 房型名称
  //     managerId: sessionStorage.getItem("token"),
  //   };
  //   let res = await axios({
  //     method: "post",
  //     url: api.value + "/mhotel/housequeryPage.action",
  //     headers: {
  //       // token: sessionStorage.getItem("token"),
  //       // user_head: sessionStorage.getItem("userhead"),
  //     },
  //     params: data,
  //   });
  //   console.log(res, "房型管理");
  //   if (res.data.code == 200) {
  //     loading.value = false;
  //     tableData.list = res.data.data.pageList;
  //     total.value = res.data.data.total;
  //     // ElMessage({
  //     //   type: "success",
  //     //   showClose: true,
  //     //   message: res.data.message,
  //     //   center: true,
  //     // });
  //   } else {
  //     loading.value = false;
  //     ElMessage({
  //       type: "error",
  //       showClose: true,
  //       message: res.data.message,
  //       center: true,
  //     });
  //   }
};

// 搜索功能
const searchBtn = lodash.debounce(async () => {
  getList();
}, 300);

const handleSelectionChange = () => {};

//导出功能 (-------------------------------------------------)
const importExcel = async () => {
  // if (searchInput.createTime == null) {
  //   searchInput.createTime = "";
  // }
  // let data = new FormData();
  // data.set("car_number", searchInput.carnumber);
  // data.set("create_time", searchInput.createTime);
  // let res = await axios({
  //   method: "post",
  //   url: api.value + "/carBook/cinfotoExcel.action",
  //   headers: {
  //     token: sessionStorage.getItem("token"),
  //   },
  //   data: data,
  // });
  // // console.log(res, "导出账号");
  // if (res.data.code == 200) {
  //   // const elt = document.createElement("a");
  //   // elt.setAttribute(
  //   //   "href",
  //   //   "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
  //   // );
  //   // elt.setAttribute("download", "file.png");
  //   // elt.style.display = "none";
  //   // document.body.appendChild(elt);
  //   // elt.click();
  //   var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
  //   console.log("获得地址数据:", downloadPath);
  //   var downloadLink = document.createElement("a");
  //   downloadLink.style.display = "none"; // 使其隐藏
  //   downloadLink.href = downloadPath;
  //   downloadLink.download = "";
  //   downloadLink.click();
  //   document.body.appendChild(downloadLink);
  //   document.body.removeChild(downloadLink);
  //   ElMessage({
  //     type: "success",
  //     showClose: true,
  //     message: res.data.message,
  //     center: true,
  //   });
  // } else {
  //   ElMessage({
  //     type: "error",
  //     showClose: true,
  //     message: res.data.message,
  //     center: true,
  //   });
  // }
};

// 点击查看详情 （---------------------------------------------）
const teacherInfoClick = (row) => {
  pageIndex.value = 2;
  nextTick(() => {
    scoreEchart();
  });
};
// 切换 综合测评 /教师评语
const infoClick = (flag) => {
  studentIndex.value = flag;
  if (flag == 1) {
    nextTick(() => {
      scoreEchart();
    });
  }
};
// 合并表格
const objectSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
  if (columnIndex === 3) {
    if (rowIndex == 0) {
      return {
        rowspan: synthesisData.list.length,
        colspan: 1,
      };
    } else {
      return {
        rowspan: 0,
        colspan: 0,
      };
    }
  }
};
// 取消查看老师详情
const teacherInfoConcel = () => {
  pageIndex.value = 1;
};
// 综合评测雷达图
const scoreEchart = () => {
  scoreEcharts.value = markRaw(
    echarts.init(document.getElementById("scoreEcharts"))
  );
  scoreEcharts.value.setOption({
    // backgroundColor: "#0A2E5D",
    tooltip: {},

    radar: {
      radius: "50%", //大小
      nameGap: 30, // 图中工艺等字距离图的距离
      center: ["50%", "50%"], // 图的位置
      name: {
        textStyle: {
          color: "rgba(0,0,0, 1)",
          fontSize: 16,
        },
        formatter: function (name) {
          return name;
        },
      },
      indicator: [
        { name: "语文", max: "100" },
        { name: "数学", max: "100" },
        { name: "英语", max: "100" },
        { name: "化学", max: "100" },
        { name: "生物", max: "100" },
        { name: "物理", max: "100" },
      ],
      axisLine: {
        lineStyle: {
          color: "rgba(152, 161, 177, 0.3)",
        },
        show: true,
        symbolSize: [20, 15],
        symbol: ["none", "arrow"],
        symbolOffset: [0, 15],
      },
      splitArea: {
        show: false,
        areaStyle: {
          color: "rgba(255,0,0,0)", // 图表背景的颜色
        },
      },
      splitLine: {
        show: true,
        lineStyle: {
          width: 2,
          color: "rgba(152, 161, 177, 0.3)", // 设置网格的颜色
        },
      },
    },

    series: [
      {
        name: "综合测评分析",
        type: "radar",
        symbol: "angle",
        itemStyle: {
          normal: {
            areaStyle: { type: "default" },
          },
        },
        data: [
          {
            symbol: "circle",
            symbolSize: 0,
            value: [70, 62, 63, 84, 75, 74, 60],
            // areaStyle: { color: "rgba(64, 205, 241, 0.2)" },
            // itemStyle: {
            //   normal: {
            //     borderWidth: 1,
            //     color: "RGBA(255,255,255,1)",
            //     borderColor: "rgba(146, 225, 255, 1)",
            //   },
            // },
            lineStyle: {
              color: "rgba(0, 97, 255, 0.5)",
              width: 2,
            },
            areaStyle: {
              // 单项区域填充样式
              color: {
                type: "linear",
                x: 0, //右
                y: 0, //下
                x2: 1, //左
                y2: 1, //上
                colorStops: [
                  {
                    offset: 0,
                    color: "rgba(0, 173, 252, 1)",
                  },
                  {
                    offset: 1,
                    color: "rgba(0, 130, 252, 1)",
                  },
                ],
                global: false,
              },
              opacity: 0.5, // 区域透明度
            },
          },
        ],
      },
    ],
  });
};
// 确定评分标准
const confirmCriterion = () => {};

// 点击详情里面的评分标准按钮 （----------------------------------------------------------------）
const criterionClick = () => {
  criterionVisible.value = true;
};
// 标准评分里面的学科
const objectSelClick = (flag) => {
  objectIndex.value = flag;
};
const editScoreScope = (index, row) => {
  row.flag = true;
};
const cancelCriterion = () => {
  criterionVisible.value = false;
};

// 点击查看详情里面的学科管理 （---------------------------------------------------------------------）
const objectClick = () => {
  objectVisible.value = true;
};
const confirmObject = () => {};
const cancelObject = () => {
  objectVisible.value = false;
};

// 表格斑马纹颜色修改
const tableRowClassName = ({ row, rowIndex }) => {
  if (rowIndex % 2 === 0) {
    return "even";
  } else if (rowIndex % 2 !== 0) {
    return "odd";
  }
  return "";
};
// 分页
const handleCurrentChange = (value) => {
  // console.log(value);
  currentPage.value = value;
  getList();
};

onBeforeMount(async () => {
  api.value = store.state.user.api;
  getList();
  window.addEventListener("resize", function () {
    scoreEcharts.value.resize();
  });
});
onMounted(() => {});
onUnmounted(() => {
  // scoreEcharts.value.dispose();
});
</script>

<style scoped lang="scss">
.content-box {
  min-width: 1000px;
  width: calc(100vw - 260px);
  height: calc(100vh - 105px);
  margin: 20px auto;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);

  .left {
    // width: calc(100wh - 40px);
    display: flex;
    align-items: center;
    height: 60px;
    margin: 0 30px;
    border-bottom: 1px solid #ccc;
    color: rgb(0, 0, 0);
    font-size: 18px;
    font-weight: 600;

    span {
      display: block;
      height: 60px;
      line-height: 60px;
    }

    .is_active {
      color: rgba(111, 182, 184, 1);
    }
  }
  .scroll {
    height: calc(100% - 61px);
    overflow: auto;
  }
  .middle {
    width: 96%;
    margin: 0 auto;

    color: #000;

    // border-bottom: 1px solid rgb(231, 231, 231);
    .filter {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      margin: 10px 0 0 0;

      .search {
        color: #fff;
      }

      .condition {
        display: flex;
        align-items: center;
        margin: 10px 30px 10px 0;
        .title {
          padding-right: 5px;
        }
        .sel {
          margin-right: 10px;
        }
        :deep(.el-input .el-input__inner) {
          font-size: 14px;
        }
      }
    }

    .gongneng {
      margin: 10px 0 20px 0;

      span {
        color: #fff;
      }
      .el-button {
        margin-right: 10px;
      }
    }

    :deep(.download) {
      display: flex;
      align-items: center;
      margin: 10px;
    }

    :deep(.download span) {
      font-size: 16px;
      margin-left: 20px;
    }
  }
  .footer {
    width: 96%;
    // height: 550px;
    margin: 10px auto 30px;

    .el-table--fit {
      // height: 100%;

      :deep(.el-table__header-wrapper) {
        background-color: #000;
        font-size: 14px;
      }

      :deep(.el-table__row) {
        height: 50px;
        font-size: 14px;
        // color: #000;

        &:hover {
          td {
            background-color: rgba(223, 236, 254, 1);
          }
        }
      }

      :deep(.el-table__row td) {
        padding: 0;
        .normal {
          cursor: pointer;
          color: rgba(0, 97, 255, 1);
        }
      }

      .el-button--primary {
        margin-left: 5px;
      }

      :deep(.el-table__body .even) {
        background-color: #fff;
      }

      :deep(.el-table__body .odd) {
        background-color: rgba(240, 243, 247, 1);
      }

      :deep(.edit) {
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(111, 182, 184, 1);
      }

      :deep(.look) {
        padding: 0 10px;
        cursor: pointer;
        color: rgba(30, 125, 251, 1);
      }

      .del {
        padding: 0 10px;
        color: rgba(212, 48, 48, 1);
        cursor: pointer;
      }

      // :deep(.look):hover {
      //   color: red;
      // }
      // :deep(.del):hover {
      //   color: red;
      // }
    }
  }

  // 教师综合素质评价
  .teacherInfo {
    height: 100%;
    .left {
      // width: calc(100wh - 40px);
      display: flex;
      align-items: center;
      height: 60px;
      border-bottom: 1px solid #ccc;
      color: rgb(0, 0, 0);
      font-size: 18px;
      font-weight: 600;
      img {
        width: 18px;
        height: 18px;
        cursor: pointer;
        margin-right: 10px;
      }
      .add {
        margin-left: 20px !important;
        font-size: 20px !important;
        color: rgba(0, 0, 0, 1) !important;
      }
    }
    .scroll_score {
      width: calc(100% - 60px);
      height: calc(100% - 61px);
      margin: 0 auto;
      overflow: auto;
      .semester {
        .title {
          font-size: 20px;
          height: 60px;
          line-height: 60px;
          text-align: center;
          color: rgba(0, 0, 0, 1);
        }
        .score {
          height: 168px;
          border-radius: 8px;
          background: rgba(240, 244, 250, 1);
          display: flex;
          align-items: center;
          justify-content: space-between;
          .score_left {
            display: flex;
            align-items: center;
            img {
              width: 90px;
              height: 90px;
              margin: 0 20px;
              border-radius: 50%;
              border: 1px solid rgba(0, 97, 255, 1);
            }
            .info {
              .info_name {
                .name {
                  font-size: 20px;
                  color: #000;
                }
                .class {
                  font-size: 16px;
                  color: rgba(128, 128, 128, 1);
                }
              }
              .info_object {
                color: rgba(128, 128, 128, 1);
                font-size: 16px;
                margin-top: 5px;
              }
            }
          }
          .score_right {
            color: #000;
            margin-right: 30px;
            .num {
              display: inline-block;
              font-size: 60px;
              color: rgba(0, 97, 255, 1);
            }
          }
        }
      }
      .scoreList {
        height: calc(100% - 228px);

        .changeInfo {
          span {
            display: inline-block;
            margin-right: 20px;
            height: 58px;
            line-height: 58px;
            cursor: pointer;
          }
          .sel_info {
            color: rgba(0, 97, 255, 1);
            border-bottom: 2px solid rgba(0, 97, 255, 1);
          }
        }
        // 详情下面的切换样式
        .synthesis {
          display: flex;
          align-items: center;
          height: calc(100% - 60px);
          color: rgb(0, 0, 0);
          font-size: 20px;
          font-weight: 600;
          // 综合测评
          .score_footer {
            width: 100%;
            height: 100%;
            display: flex;
            .footer_left {
              width: 40%;
              height: 100%;
              #scoreEcharts {
                width: 100%;
                height: 100%;
              }
            }
            .footer_right {
              width: 60%;
              height: 100%;
              .title {
                display: flex;
                align-items: center;
                flex-direction: row-reverse;
                .btn {
                  margin: 15px 10px 25px 10px;
                }
                .title_ranking {
                  display: flex;
                  align-items: center;
                  height: 60px;
                  color: rgb(0, 0, 0);
                  font-size: 20px;
                  font-weight: 600;
                  img {
                    width: 29px;
                    height: 20px;
                    margin-right: 8px;
                  }
                }
              }

              .el-table--fit {
                height: calc(100% - 92px);
                :deep(.el-table__header-wrapper) {
                  font-size: 14px;
                  .cell {
                    color: #000;
                  }
                }

                :deep(.el-table__row) {
                  height: 50px;
                  font-size: 14px;
                  color: #000;

                  td {
                    padding: 0;
                    border-right: 1px solid rgba(230, 230, 230, 1);
                    &:nth-child(1) {
                      border-left: 1px solid rgba(230, 230, 230, 1);
                    }
                  }
                  &:hover {
                    td {
                      // background-color: rgba(223, 236, 254, 0.6);
                      background-color: transparent;
                    }
                  }
                }
              }
            }
          }
          // 教师评语
          .teacher_footer {
            width: 100%;
            height: 100%;
            .info {
              margin: 20px 0 25px;
              display: flex;

              .info_img {
                display: flex;
                align-items: center;
                img {
                  width: 50px;
                  height: 50px;
                  border-radius: 50%;
                  border: 1px solid rgba(0, 97, 255, 1);
                  margin: 0 16px 0 0;
                }
              }
              .info_content {
                .info_name {
                  font-weight: 400;
                  margin-bottom: 5px;
                }
                .info_time {
                  font-size: 12px;
                  font-weight: 400;
                }
              }
            }
            .comment {
              height: calc(100% - 118px);
              .el-textarea {
                height: 100%;
                :deep(.el-textarea__inner) {
                  height: 100%;
                }
              }
            }
          }
        }
      }
    }
  }
  // 去评分按钮
  :deep(.criterionDialog) {
    //   height: 420px;
    border-radius: 11px;
    .el-dialog__header {
      border-radius: 11px 11px 0 0;
      background: rgba(237, 241, 245, 1);
      font-weight: 600;
      margin: 0;
      .el-dialog__headerbtn {
        outline: none;
      }
    }
    .el-dialog__body {
      padding: 15px 30px 30px 30px;
      .criterion {
        .selObject {
          ul {
            display: flex;
            list-style: none;
            padding: 0;
            li {
              width: 70px;
              height: 37px;
              text-align: center;
              line-height: 37px;
              padding: 0;
              margin-right: 10px;
              border-radius: 5px;
              background: rgba(242, 242, 242, 1);
              border: 1px solid rgba(204, 204, 204, 1);
              color: rgba(166, 166, 166, 1);
              cursor: pointer;
            }
            .sel {
              color: rgba(0, 97, 255, 1);
              background: rgba(235, 242, 255, 1);
              border: 1px solid rgba(0, 97, 255, 1);
            }
          }
        }
        .el-table--fit {
          height: calc(100% - 92px);
          .el-table__header-wrapper {
            font-size: 14px;
            .cell {
              color: #000;
            }
          }

          .el-table__row {
            height: 50px;
            font-size: 14px;
            color: #000;

            td {
              padding: 0;
              border-right: 1px solid rgba(230, 230, 230, 1);
              &:nth-child(1) {
                border-left: 1px solid rgba(230, 230, 230, 1);
              }
            }
            .edit {
              color: rgba(0, 97, 255, 1);
              cursor: pointer;
            }
            .grade {
              display: flex;
              justify-content: center;
              .el-input {
                .el-input__wrapper {
                  box-shadow: none;
                }
              }
              .grade_left {
                border-top: 1px solid #dcdfe6;
                border-bottom: 1px solid #dcdfe6;
                border-left: 1px solid #dcdfe6;
                border-top-left-radius: 4px;
                border-bottom-left-radius: 4px;
              }
              .line {
                display: block;
                height: 32px;
                line-height: 32px;
                padding: 0 8px;
                border-top: 1px solid #dcdfe6;
                border-bottom: 1px solid #dcdfe6;
              }
              .grade_right {
                border-top: 1px solid #dcdfe6;
                border-bottom: 1px solid #dcdfe6;
                border-right: 1px solid #dcdfe6;
                border-top-right-radius: 4px;
                border-bottom-right-radius: 4px;
              }
            }
            &:hover {
              td {
                // background-color: rgba(223, 236, 254, 0.6);
                background-color: transparent;
              }
            }
          }
        }
      }
      .options {
        margin: 30px 20px 0 0;
        width: 100%;
        display: flex;
        flex-direction: row-reverse;

        .queding {
          color: #fff;
          margin-left: 15px;
        }
      }
    }
  }

  // 学科管理按钮
  :deep(.objectDialog) {
    //   height: 420px;
    border-radius: 11px;
    .el-dialog__header {
      border-radius: 11px 11px 0 0;
      background: rgba(237, 241, 245, 1);
      font-weight: 600;
      margin: 0;
      .el-dialog__headerbtn {
        outline: none;
      }
    }
    .el-dialog__body {
      padding: 0 30px 30px 30px;
      .criterion {
        .selObject {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin: 15px 0;
          .warning {
            color: rgba(212, 48, 48, 1);
            font-size: 12px;
          }
        }
        .el-table--fit {
          height: calc(100% - 92px);
          .el-table__header-wrapper {
            font-size: 14px;
            .cell {
              color: #000;
            }
          }

          .el-table__row {
            height: 50px;
            font-size: 14px;
            color: #000;

            td {
              padding: 0;
              border-right: 1px solid rgba(230, 230, 230, 1);
              &:nth-child(1) {
                border-left: 1px solid rgba(230, 230, 230, 1);
              }
            }
            .edit {
              color: rgba(0, 97, 255, 1);
              cursor: pointer;
            }
            .grade {
              display: flex;
              justify-content: center;
              .el-input {
                .el-input__wrapper {
                  box-shadow: none;
                }
              }
              .grade_left {
                border-top: 1px solid #dcdfe6;
                border-bottom: 1px solid #dcdfe6;
                border-left: 1px solid #dcdfe6;
                border-top-left-radius: 4px;
                border-bottom-left-radius: 4px;
              }
              .line {
                display: block;
                height: 32px;
                line-height: 32px;
                padding: 0 8px;
                border-top: 1px solid #dcdfe6;
                border-bottom: 1px solid #dcdfe6;
              }
              .grade_right {
                border-top: 1px solid #dcdfe6;
                border-bottom: 1px solid #dcdfe6;
                border-right: 1px solid #dcdfe6;
                border-top-right-radius: 4px;
                border-bottom-right-radius: 4px;
              }
            }
            &:hover {
              td {
                // background-color: rgba(223, 236, 254, 0.6);
                background-color: transparent;
              }
            }
          }
        }
      }
      .options {
        margin: 30px 20px 0 0;
        width: 100%;
        display: flex;
        flex-direction: row-reverse;

        .queding {
          color: #fff;
          margin-left: 15px;
        }
      }
    }
  }

  .pageSize {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 30px;

    span {
      color: #000;
    }

    .el-pagination {
      // width: 1600px;
      :deep(.el-pagination__total) {
        color: #000;
      }

      :deep(.el-pagination__goto) {
        color: #000;
      }

      :deep(.el-pagination__classifier) {
        color: #000;
      }

      :deep(.el-input__wrapper) {
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        box-shadow: none;
      }

      :deep(.el-pager li) {
        margin: 0 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }

      :deep(.el-pager li.is-active) {
        // background-color: rgba(0, 97, 255, 0.8);
        border: 1px solid rgba(0, 97, 255, 1);
        color: rgba(0, 97, 255, 1);
      }

      :deep(.btn-prev) {
        margin-right: 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }

      :deep(.btn-next) {
        margin-left: 5px;
        border: 1px solid rgba(0, 0, 0, 1);
        border-radius: 5px;
        background-color: transparent;
      }
    }
  }
}

.el-input {
  width: 192px;
}
</style>
