Просмотр исходного кода

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table into beta

lsc 1 год назад
Родитель
Сommit
2a6e345601

BIN
src/assets/icon/studentEva/star-no.png


BIN
src/assets/icon/studentEva/star.png


+ 2 - 2
src/components/pages/kindStudentEva/index.vue

@@ -1,11 +1,11 @@
 <template>
 <template>
   <div class="tp_body">
   <div class="tp_body">
     <div class="tp_left">
     <div class="tp_left">
-      <infoA :userid="suid" :oid="oid"></infoA>
+      <infoA :userid="suid" :oid="oid" :org="org"></infoA>
       <panelA :userid="suid" :oid="oid" :org="org"></panelA>
       <panelA :userid="suid" :oid="oid" :org="org"></panelA>
     </div>
     </div>
     <div class="tp_right">
     <div class="tp_right">
-      <testA :userid="suid" :oid="oid"></testA>
+      <testA :userid="suid" :oid="oid" :org="org" :cid="cid"></testA>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>

+ 57 - 46
src/components/pages/kindStudentEva/panel/index.vue

@@ -11,11 +11,11 @@
         <div>学习记录</div>
         <div>学习记录</div>
       </div>
       </div>
     </div>
     </div>
-    <div class="i_body_panel" v-for="(item,index) in typeList" :key="index">
+    <div class="i_body_panel" v-for="(item, index) in typeList" :key="index">
       <div class="i_icon"><span></span></div>
       <div class="i_icon"><span></span></div>
       <div class="i_detail">
       <div class="i_detail">
         <div>
         <div>
-          <span>{{ item.value }}</span
+          <span>{{ item.count }}</span
           ><span>个</span>
           ><span>个</span>
         </div>
         </div>
         <div>{{ item.name }}记录</div>
         <div>{{ item.name }}记录</div>
@@ -95,68 +95,79 @@ export default {
       let params = {
       let params = {
         uid: this.userid,
         uid: this.userid,
         oid: this.oid,
         oid: this.oid,
+        org: this.org,
       };
       };
       this.ajax
       this.ajax
         .get(this.$store.state.api + "selectSRecordY", params)
         .get(this.$store.state.api + "selectSRecordY", params)
         .then((res) => {
         .then((res) => {
           this.count = res.data[0].length; //总学习记录数量
           this.count = res.data[0].length; //总学习记录数量
           var data = res.data[0]; //总学习记录
           var data = res.data[0]; //总学习记录
-          var type = res.data[1]; //分类
-          var tOid = res.data[2]; //学校分类
-          if (tOid.length > 0) {
-            for (var i = 0; i < tOid.length; i++) {
-              type.push(tOid[i]);
+          var ftype = res.data[1]; //公共父级分类
+          var stype = res.data[2]; //公共子级分类
+          var sctype = res.data[3]; //该学校子级分类
+          var fctype = res.data[4]; //该学校父级分类
+          var fotype = res.data[5]; //组织父级分类
+          var sotype = res.data[6]; //组织子级分类
+          var allfType = [];
+          var allsType = [];
+          if (fotype.length == 0 && sotype.length == 0) {
+            if (fctype.length == 0 && sctype.length == 0) {
+              for (var i = 0; i < ftype.length; i++) {
+                allfType.push(ftype[i]);
+              }
+              for (var i = 0; i < stype.length; i++) {
+                allsType.push(stype[[i]]);
+              }
+            } else {
+              for (var i = 0; i < fctype.length; i++) {
+                allfType.push(fctype[i]);
+              }
+              for (var i = 0; i < sctype.length; i++) {
+                allsType.push(sctype[[i]]);
+              }
+            }
+          } else {
+            for (var i = 0; i < fotype.length; i++) {
+              allfType.push(fotype[i]);
+            }
+            for (var i = 0; i < sotype.length; i++) {
+              allsType.push(sctysotypepe[[i]]);
             }
             }
           }
           }
-          var typeList = [];
-          var ridList = "";
+          var typeList = []; //记录子分类id(只有id)
           for (var i = 0; i < data.length; i++) {
           for (var i = 0; i < data.length; i++) {
-            if (typeList.length == 0) {
-              ridList = data[i].rid;
-              var a = data[i].type.split(",");
-              if (a.length > 1) {
-                for (var j = 0; j < a.length; j++) {
-                  typeList.push(a[j]);
-                }
-              } else {
+            var a = data[i].type.split(",");
+            if (a.length > 1) {
+              for (var j = 0; j < a.length; j++) {
                 typeList.push(a[j]);
                 typeList.push(a[j]);
               }
               }
             } else {
             } else {
-              if (ridList.indexOf(data[i].rid) == -1) {
-                ridList += "," + data[i].rid;
-                var a = data[i].type.split(",");
-                if (a.length > 1) {
-                  for (var j = 0; j < a.length; j++) {
-                    typeList.push(a[j]);
-                  }
-                } else {
-                  typeList.push(a[j]);
-                }
-              }
+              typeList.push(a[j]);
             }
             }
           }
           }
-          var ftype = [];
-          for (var i = 0; i < type.length; i++) {
+          var typeList1 = []; //记录子分类id(id,名字,pid)
+          for (var i = 0; i < allsType.length; i++) {
             for (var j = 0; j < typeList.length; j++) {
             for (var j = 0; j < typeList.length; j++) {
-              if (typeList[j] == type[i].id) {
-                ftype.push(type[i].pid);
+              if (typeList[j] == allsType[i].id) {
+                typeList1.push(allsType[i]);
+              }
+            }
+          }
+          var ftypeList1 = [];
+          for (var i = 0; i < allfType.length; i++) {
+            var count = 0;
+            for (var j = 0; j < typeList1.length; j++) {
+              if (allfType[i].id == typeList1[j].pid) {
+                count++;
               }
               }
             }
             }
+            ftypeList1.push({
+              id: allfType[i].id,
+              name: allfType[i].name,
+              count: count,
+            });
           }
           }
-          var type1 = type.filter(item => item.pid === '0');;
-          var ftypeList = type1.map((item) => {
-            return {
-              id: item.id,
-              name: item.name,
-              value: ftype.filter((id) => id === item.id).length,
-            };
-          });
-          this.typeList = ftypeList;
-          // this.count1 = res.data[1][0].count; //健康学习记录
-          // this.count2 = res.data[2][0].count; //语言学习记录
-          // this.count3 = res.data[3][0].count; //社会学习记录
-          // this.count4 = res.data[4][0].count; //科学学习记录
-          // this.count5 = res.data[5][0].count; //艺术学习记录
+          this.typeList = ftypeList1;
         })
         })
         .catch((err) => {
         .catch((err) => {
           console.error(err);
           console.error(err);

+ 530 - 0
src/components/pages/kindStudentEva/test/component/popbox.vue

@@ -0,0 +1,530 @@
+<template>
+  <div class="popbox">
+    <div class="tit">
+      <h2>{{ judgeNum ? "修改" : "查看" }}</h2>
+    </div>
+    <div class="cellBlock">
+      <div class="username">姓名</div>
+      <div class="cellInp">
+        <el-input
+          v-model="recordData.studentName"
+          disabled
+          placeholder="请输入内容"
+        ></el-input>
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">班级</div>
+      <div>
+        <el-input
+          v-model="recordData.className"
+          disabled
+          placeholder="请输入内容"
+        ></el-input>
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">关联</div>
+      <div>
+        <el-select
+          multiple
+          collapse-tags
+          v-model="recordData.contact"
+          placeholder="请选择关联同学"
+          style="width: 200px"
+        >
+          <el-option
+            v-for="(item, index) in studentList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">学期</div>
+      <div>
+        <el-select
+          v-model="recordData.term"
+          style="width: 200px"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="item in termList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+        <!-- <el-input
+          v-model="recordData.semName"
+          placeholder="请输入内容"
+        ></el-input> -->
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">纬度</div>
+      <div>
+        <el-select
+          multiple
+          collapse-tags
+          v-model="recordData.type"
+          placeholder="请选择教研室"
+          style="width: 200px"
+        >
+          <el-option
+            v-for="(item, index) in weiList"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
+        </el-select>
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">时间</div>
+      <div>
+        <el-date-picker
+          v-model="recordData.recordDate"
+          type="datetime"
+          value-format="yyyy-MM-dd HH:mm"
+          placeholder="选择日期时间"
+          style="width: 200px"
+        >
+        </el-date-picker>
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">地点</div>
+      <div>
+        <el-input
+          v-model="recordData.place"
+          placeholder="请输入内容"
+        ></el-input>
+      </div>
+    </div>
+    <div class="cellBlock">
+      <div class="username">观察内容</div>
+      <div>
+        <el-input
+          v-model="recordData.recordTit"
+          placeholder="请输入内容"
+        ></el-input>
+      </div>
+    </div>
+    <div style="margin: 15px 0;">
+      观察记录
+    </div>
+    <div>
+      <el-input
+        type="textarea"
+        placeholder="请输入内容"
+        resize="none"
+        rows="6"
+        v-model="recordData.recordContent"
+      >
+      </el-input>
+    </div>
+
+    <div style="margin: 15px 0;">
+      图片
+    </div>
+    <div class="imgBlock">
+      <div class="imgCell" v-if="judgeNum" @click.stop="addImg($event)">
+        +
+        <input
+          type="file"
+          accept="image/*"
+          style="display: none"
+          @change="beforeUpload($event)"
+        />
+      </div>
+      <div
+        class="imgCell"
+        v-for="(i, index) in recordData.recordImg"
+        :key="index"
+      >
+        <img class="imgCellCon" :src="i" alt="" />
+        <div v-if="judgeNum" class="imgDelBtn" @click="delImg(i)">
+          ×
+        </div>
+      </div>
+    </div>
+
+    <div class="updateCordSty">
+      <el-button v-if="judgeNum" style="color: #fff;" type="text" @click="open"
+        >修改</el-button
+      >
+    </div>
+    <!-- <div v-if="isShadow" @click="isShadowShow" class="shadow"></div> -->
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    judgeNum: {
+      type: Number,
+      default: 0
+    },
+    recordDataCopy: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    termList: {
+      type: Array,
+      default: () => {
+        return [];
+      }
+    },
+    weiList: {
+      type: Array,
+      default: () => {
+        return [];
+      }
+    },
+    studentList: {
+      type: Array,
+      default: () => {
+        return [];
+      }
+    }
+  },
+  data() {
+    return {
+      popType: this.recordDataCopy.type,
+      popTact: this.recordDataCopy.contact,
+      // ico: false,
+      // gIco: false,
+      recordData: {},
+      // isShadow: false,
+      imgList: []
+    };
+  },
+  methods: {
+    // 确认修改记录提示?
+    open() {
+      // console.log(this.recordData);
+
+      if (!this.recordData.type.length) {
+        this.$message({
+          type: "success",
+          message: "请选择纬度",
+          type: "warning"
+        });
+        return;
+      }
+      // return
+      this.$confirm("是否修改?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消"
+      })
+        .then(() => {
+          this.updateCord();
+          this.$message({
+            type: "success",
+            message: "已修改"
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消修改"
+          });
+        });
+    },
+    // 修改记录
+    updateCord() {
+      let params = [
+        {
+          rid: this.recordData.rid,
+          tid: this.$route.query.userid,
+          contact: this.recordData.contact.join(","),
+          type: this.recordData.type.join(","),
+          timing: this.recordData.recordDate,
+          place: this.recordData.place,
+          observeCon: this.recordData.recordTit,
+          recordCon: this.recordData.recordContent,
+          imgList: this.recordData.recordImg.join(","),
+          term: this.recordData.term
+        }
+      ];
+
+      // return console.log("修改记录", params);
+
+      this.ajax
+        .post(this.$store.state.api + "updateRecordData", params)
+        .then(res => {
+          console.log(res);
+          this.$emit("closePop");
+          this.$emit("selectData");
+        });
+      // updateRecordData
+    },
+    // tactChange() {
+    //   console.log("tactChange", this.popTact);
+    // },
+    // isShadowShow() {
+    //   this.ico = false;
+    //   this.gIco = false;
+    //   this.isShadow = false;
+    // },
+    // weiShow() {
+    //   this.ico = true;
+    //   this.isShadow = true;
+    // },
+    // tactShow() {
+    //   this.gIco = true;
+    //   this.isShadow = true;
+    // },
+    // // 判断弹出选项列表
+    // icoIsShow() {
+    //   this.ico = !this.ico;
+    // },
+    // 判断学生是否被选中
+    // choose(e) {
+    //   console.log("判断学生是否被选中", e);
+    //   if (this.popType.includes(e)) return;
+    //   this.popType.push(e);
+
+    //   // console.log(this.choosePer)
+    // },
+    // 删除图片
+    delImg(e) {
+      console.log("删除图片", e);
+      const iii = this.recordData.recordImg.indexOf(e);
+      this.recordData.recordImg.splice(iii, 1);
+      // this.recordData.recordImg = this.recordData.recordImg.
+    },
+    addImg(e) {
+      var el = e.currentTarget;
+      el.getElementsByTagName("input")[0].click();
+      e.target.value = "";
+    },
+    beforeUpload(event, type) {
+      // const loading = this.openLoading();
+      var file = event.target.files[0];
+      var credentials = {
+        accessKeyId: "AKIATLPEDU37QV5CHLMH",
+        secretAccessKey: "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"
+      }; //秘钥形式的登录上传
+      window.AWS.config.update(credentials);
+      window.AWS.config.region = "cn-northwest-1"; //设置区域
+
+      var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
+      var imgA = [
+        "png",
+        "jpg",
+        "jpeg",
+        "bmp",
+        "gif",
+        "webp",
+        "psd",
+        "svg",
+        "tiff"
+      ];
+      if (
+        imgA.indexOf(file.name.split(".")[file.name.split(".").length - 1]) ==
+        -1
+      ) {
+        this.$message.error("图片格式错误");
+        return;
+      }
+      this.imgLoading = true;
+      var _this = this;
+
+      if (file) {
+        var params = {
+          Key:
+            file.name.split(".")[0] +
+            new Date().getTime() +
+            "." +
+            file.name.split(".")[file.name.split(".").length - 1],
+          ContentType: file.type,
+          Body: file,
+          "Access-Control-Allow-Credentials": "*",
+          ACL: "public-read"
+        }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
+        var options = {
+          partSize: 2048 * 1024 * 1024,
+          queueSize: 2,
+          leavePartsOnError: true
+        };
+        bucket
+          .upload(params, options)
+          .on("httpUploadProgress", function(evt) {
+            //这里可以写进度条
+            // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
+          })
+          .send(function(err, data) {
+            _this.imgLoading = false;
+            // loading.close();
+            if (err) {
+              _this.$message.error("上传失败");
+            } else {
+              _this.recordData.recordImg.push(data.Location);
+              _this.$forceUpdate();
+
+              console.log(_this.checkJson);
+              console.log(data.Location);
+            }
+          });
+      }
+    }
+  },
+  mounted() {
+    this.recordData = JSON.parse(JSON.stringify(this.recordDataCopy));
+    // console.log("??????????????????????????????????", this.recordData);
+  }
+};
+</script>
+
+<style scoped>
+.popbox {
+  width: 500px;
+  background-color: #fff;
+  /* height: 500px; */
+  padding: 10px;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  z-index: 3;
+  border-radius: 10px;
+  box-shadow: 0 0 10px #ccc;
+}
+
+.tit {
+  width: 100%;
+  text-align: center;
+  margin-bottom: 10px;
+}
+.cellBlock {
+  width: 100%;
+  box-sizing: border-box;
+  padding: 10px 0;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.cellBlock > .username {
+  width: 70px;
+  flex-shrink: 0;
+  text-align: right;
+  margin-right: 10px;
+  display: flex;
+  justify-content: flex-end;
+  /* justify-content: space-between; */
+}
+.imgBlock {
+  width: 100%;
+  display: flex;
+  justify-content: flex-start;
+  flex-wrap: wrap;
+}
+.imgCell {
+  position: relative;
+  width: 100px;
+  height: 100px;
+  margin-right: 10px;
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  border: #ccc 1px solid;
+}
+.imgCell > .imgDelBtn {
+  position: absolute;
+  right: 5px;
+  top: 5px;
+  width: 15px;
+  height: 15px;
+  border-radius: 50%;
+  background-color: #fff;
+  cursor: pointer;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.imgCellCon {
+  width: 100%;
+  height: 100%;
+}
+.updateCordSty {
+  width: 120px;
+  float: right;
+  background-color: rgba(17, 61, 221, 0.5);
+  border-radius: 5px;
+  color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+/* .shadow {
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+} */
+/* ::v-deep .el-input__inner {
+  width: 200px;
+}
+::v-deep .el-input {
+  width: 200px;
+}
+::v-deep .el-select {
+  width: 200px !important;
+} */
+/* .conCant {
+  position: relative;
+  border: 1px solid #ccc;
+  width: 200px;
+  min-height: 40px;
+  display: flex;
+  align-items: center;
+  position: relative;
+  box-sizing: border-box;
+  padding: 0 10px;
+} */
+/* .conCantTxt {
+  display: flex;
+  justify-content: flex-start;
+  margin-right: 5px;
+  flex-wrap: wrap;
+  position: relative;
+} */
+/* .tactList {
+  position: absolute;
+  left: 0;
+  top: 110%;
+  width: 200px;
+  height: 200px;
+  overflow-y: scroll;
+  background-color: #fff;
+  border: 1px solid #ccc;
+  z-index: 10;
+  box-sizing: border-box;
+  padding: 10px;
+  display: flex;
+  flex-direction: column;
+} */
+/* .tactListCell {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  box-sizing: border-box;
+  padding: 2px 5px;
+  background-color: #ccc;
+} */
+/* .iSty {
+  position: absolute;
+  right: 10px;
+  top: 50%;
+  transform: translate(0, -50%);
+} */
+</style>

+ 638 - 5
src/components/pages/kindStudentEva/test/diary.vue

@@ -1,13 +1,646 @@
 <template>
 <template>
-  
+  <div class="diary">
+    <div
+      style="
+        background-color: #fff;
+        width: 100%;
+        height: 100%;
+        box-sizing: border-box;
+        padding: 15px;
+      "
+    >
+      <!-- 分类与导出 -->
+      <div class="top">
+        <div class="oneType">
+          <div class="all_choose" v-for="(item, index) in VeidooList" :key="index"
+            :style="{ margin: !VeidooJson[item.id].length && 0 }">
+            <!-- 大分类 -->
+            <span v-if="VeidooJson[item.id].length" @click="点击赋值ftypeId(item.id)" :class="ftypeId == item.id ? '被点击的样式' : '没被点击的样坏死' "><span>{{ item.name }}</span></span>
+            <!-- 子分类 -->
+            <div class="typeCss" v-if="VeidooJson[item.id].length">
+              <div v-for="(item1, index1) in VeidooJson[item.id]" :key="index + '-' + index1" :label="item1.id">
+                <div class="cName"  @click="点击赋值stypeId(item.id)" :class="stypeId == item.id ? '被点击的样式' : '没被点击的样坏死' ">
+                  {{ item1.name }}
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="wordBtn" @click="judgeExport">导出Excel</div>
+      </div>
+      <div class="selectSty">
+        <div style="margin-right: 10px">学期</div>
+        <el-select v-model="termId" placeholder="请选择" @change="getData">
+          <el-option
+            label="所有学期"
+            value=""
+          ></el-option>
+          <el-option
+            v-for="item in termList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </div>
+      <el-table
+        ref="multipleTable"
+        :data="tableData"
+        tooltip-effect="dark"
+        style="width: 100%"
+        border
+        header-align="center"
+        :header-cell-style="{
+          background: '#E0EAFB',
+          color: 'rgba(0, 0, 0, 0.90)',
+        }"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          align="center"
+          label="全选"
+          :show-overflow-tooltip="true"
+          width="55"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="create_at"
+          label="创建时间"
+          align="center"
+          width="120"
+        >
+          <!-- <template slot-scope="scope">{{ scope.row.date }}</template> -->
+        </el-table-column>
+        <el-table-column
+          prop="recordTit"
+          label="观察内容"
+          align="center"
+          width="120"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="place"
+          label="观察地点"
+          align="center"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="tname"
+          label="维度"
+          align="center"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="recordContent"
+          label="内容"
+          align="center"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          label="操作"
+          align="center"
+          width="175px"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            <div class="evaluate">
+              <div
+                class="TableBtn"
+                style="color: #3681fc"
+                @click="lookRecord(scope.row,0)"
+              >
+                查看
+              </div>
+              <div
+                class="TableBtn"
+                style="color: #3681fc"
+                @click="updateCred(scope.row,1)"
+              >
+                修改
+              </div>
+              <div
+                class="TableBtn"
+                style="color: #ee3e3e"
+                @click="delRecord(scope.row)"
+              >
+                删除
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 分页 -->
+      <el-pagination
+        @current-change="handleCurrentChange"
+        background
+        :page-size="8"
+        layout="prev, pager, next"
+        :total="total"
+        class="pagination"
+      >
+      </el-pagination>
+    </div>
+    <div v-if="isPop" @click="closePop" class="shade"></div>
+    <popbox
+      ref="refPop"
+      v-if="isPop"
+      :judgeNum="judgeNum"
+      :recordDataCopy="recordData"
+      :termList="termList"
+      :weiList="weiList"
+      :studentList="studentList"
+      @selectData="selectData"
+      @closePop="closePop"
+    ></popbox>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import popbox from "./component/popbox";
 export default {
 export default {
+  components: {
+    popbox,
+  },
+  props: {
+    userid: {
+      type: String,
+    },
+    oid: {
+      type: String,
+    },
+    org: {
+      type: String,
+    },
+    cid: {
+      type: String,
+    },
+  },
+  data() {
+    return {
+      // 筛选数据
+      VeidooList: [],
+      VeidooJson:{},
+      VeidooListChild: [],
+      // 默认选择项
+      // VeidooValue:{},
+      // 默认选择项
+      termValue: "",
+      // 学期数据
+      termList: [],
 
 
-}
-</script>
+      // 要提交的筛选数据项
+      Veidoo: "",
+      VeidooChild: "",
+      termId: "",
+      page: 1, //当前页数,默认为第一页
+
+      // 本页多少条数
+      total: 0,
+
+      tableData: [],
+      multipleSelection: [],
+
+      // 组件信息数据
+      isPop: false,
+      recordData: {},
+      recordDataCopy: {},
+      weiList: [],
+      studentList: [],
+      judgeNum: 0,
+      ftypeId: "",
+      stypeId: "",
+    };
+  },
+  methods: {
+    closePop() {
+      this.isPop = false;
+      // console.log('关了');
+      // this.$refs.refPop.fuClick(this.recordData);
+    },
+
+    // 切换页
+    handleCurrentChange(val) {
+      //当页数发生改变的时候调用获取列表数据请求
+      // console.log(`当前页: ${val}`);
+      this.Page = val;
+      this.selectData();
+    },
+    //获取分类
+    getVeidooType() {
+      let params = {
+        org: this.org,
+        oid: this.oid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectSTEType", params)
+        .then((res) => {
+          var ftype = res.data[0]; //公共父级分类
+          var stype = res.data[1]; //公共子级分类
+          var sctype = res.data[2]; //该学校子级分类
+          var fctype = res.data[3]; //该学校父级分类
+          var fotype = res.data[4]; //组织父级分类
+          var sotype = res.data[5]; //组织子级分类
+          var allfType = [];
+          var allsType = [];
+          if (fotype.length == 0 && sotype.length == 0) {
+            if (fctype.length == 0 && sctype.length == 0) {
+              for (var i = 0; i < ftype.length; i++) {
+                allfType.push(ftype[i]);
+              }
+              for (var i = 0; i < stype.length; i++) {
+                allsType.push(stype[[i]]);
+              }
+            } else {
+              for (var i = 0; i < fctype.length; i++) {
+                allfType.push(fctype[i]);
+              }
+              for (var i = 0; i < sctype.length; i++) {
+                allsType.push(sctype[[i]]);
+              }
+            }
+          } else {
+            for (var i = 0; i < fotype.length; i++) {
+              allfType.push(fotype[i]);
+            }
+            for (var i = 0; i < sotype.length; i++) {
+              allsType.push(sctysotypepe[[i]]);
+            }
+          }
+          var VeidooJson = {};
+          for (var i = 0; i < allfType.length; i++) {
+            this.ftypeId = allfType[0].id;
+            if (!VeidooJson[allfType[i].id]) {
+              VeidooJson[allfType[i].id] = [];
+            }
+            for (var j = 0; j < allsType.length; j++) {
+              if (allfType[i].id == allsType[j].pid) {
+                VeidooJson[allfType[i].id].push(allsType[j]); // 去除公共分类
+              }
+            }
+          }
+
+          this.VeidooList = allfType;
+          this.VeidooJson = VeidooJson;
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    // 获取数据
+    getData() {
+      // 获取筛选框数据
+      let params = {
+        uid: this.userid,
+        cid: this.cid,
+        cu: this.Veidoo,
+        cn: this.VeidooListChild,
+        cm: this.termId,
+        page: this.page,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectVeidooType", params)
+        .then((res) => {
+          this.isLoading = false;
+          this.tableData = res.data[0];
+          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+          console.log(" 获取筛选数据", res);
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    // 选择导出哪些记录
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      console.log(this.multipleSelection);
+    },
+    // 修改记录
+    updateCred(e,t) {
+      this.judgeNum = t;
+      if (!Array.isArray(e.type)) {
+        if (!e.type) {
+          e.type = [];
+        } else {
+          e.type = e.type.split(",");
+        }
+      }
+      if (!Array.isArray(e.contact)) {
+        if (!e.contact) {
+          e.contact = [];
+        } else {
+          e.contact = e.contact.split(",");
+        }
+      }
+      if (!Array.isArray(e.recordImg)) {
+        if (!e.recordImg) {
+          e.recordImg = [];
+        } else {
+          e.recordImg = e.recordImg.split(",");
+        }
+      }
+      this.recordData = e;
+      this.getClassStudent();
+    },
+    getClassStudent(){
+      // 获取班学生列表
+      const data2 = {
+        cid: this.cid,
+        uid: this.userid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectManyClassStudent", data2)
+        .then((res) => {
+          // console.log(res);
+          this.studentList = res.data[0];
+          console.log("this.studentList", res);
+          this.isPop = true;
+        });
+    },
+    // 判断导出数据
+    judgeExport() {
+      if (this.multipleSelection.length) {
+        this.exportExcel();
+      } else {
+        console.log(2);
+      }
+    },
+    // exportExcelTwo() {
+    //   let data = {
+    //     uid: this.$route.query.suid,
+    //     cid: this.$route.query.cid,
+    //     cu: this.Veidoo,
+    //     cn: this.VeidooChild,
+    //     cm: this.termId,
+    //     page: this.page,
+    //     lim: 8
+    //   };
+    //   // return console.log("selectData", data);
+    //   this.ajax
+    //     .get(this.$store.state.api + "selectVeidooType", data)
+    //     .then(res => {
+    //       this.isLoading = false;
+    //       this.tableData = res.data[0];
+    //       this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+    //       console.log(" 获取筛选数据", res);
+    //     });
+    // },
+    exportExcel() {
+      // var res = res.data[0];
+      var res = this.multipleSelection;
 
 
-<style>
+      //如果value的json字段的key值和想要的headers值不一致时,可做如下更改
+      //将和下面的Object.fromEntries结合,将json字段的key值改变为要求的excel的header值
+      var array = [];
+      for (var i = 0; i < res.length; i++) {
+        var _json = {};
+        _json["创建时间"] = res[i].create_at;
+        _json["班级"] = res[i].className;
+        _json["记录时间"] = res[i].recordDate;
+        // _json["用户名"] = res[i].studentName;
+        // _json["用户名"] = res[i].studentName;
+        _json["观察地点"] = res[i].place;
+        _json["观察内容"] = res[i].recordTit;
+        _json["内容"] = res[i].recordContent;
 
 
-</style>
+        array.push(_json);
+      }
+
+      var XLSX = require("xlsx");
+      const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
+      let ws = XLSX.utils.json_to_sheet(array); //将json对象数组转化成工作表
+      // ws["!cols"] = [
+      //   //设置每一列的宽度
+      //   { wch: 50 },
+      //   { wch: 50 },
+      //   { wch: 50 }
+      // ];
+      XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
+      XLSX.writeFile(workbook, "观察日记.xlsx");
+      // const wopts = { bookType: "xlsx", bookSST: false, type: "array" };//写入的样式bookType:输出的文件类型,type:输出的数据类型,bookSST: 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
+      // const wbout = XLSX.write(workbook, wopts);// 浏览器端和node共有的API,实际上node可以直接使用xlsx.writeFile来写入文件,但是浏览器没有该API
+      // FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), `${title} demo.xlsx`);//保存文件
+      this.$message({
+        message: "导出成功",
+        type: "success",
+      });
+    },
+    // 删除记录
+    delRecord(e) {
+      this.$confirm("是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+      })
+        .then(() => {
+          this.ajax
+            .post(this.$store.state.api + "updateRecord", [{ rid: e.rid }])
+            .then((res) => {
+              console.log(res);
+              this.selectData();
+
+              this.$message({
+                type: "success",
+                message: "已删除",
+              });
+              // this.isLoading = false; updateRecord
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+      // return console.log(e);
+    },
+    lookRecord(e) {
+      this.judgeNum = 0;
+      console.log("eeeeeeeeeeeeeeeeeee", e);
+      this.isPop = true;
+      if (!Array.isArray(e.type)) {
+        if (!e.type) {
+          e.type = [];
+        } else {
+          e.type = e.type.split(",");
+        }
+      }
+      if (!Array.isArray(e.contact)) {
+        if (!e.contact) {
+          e.contact = [];
+        } else {
+          e.contact = e.contact.split(",");
+        }
+      }
+      if (!Array.isArray(e.recordImg)) {
+        if (!e.recordImg) {
+          e.recordImg = [];
+        } else {
+          e.recordImg = e.recordImg.split(",");
+        }
+      }
+      this.recordData = e;
+    },
+  },
+  created() {
+    this.getVeidooType();
+    this.getData();
+  },
+  mounted() {
+    // this.$nextTick(() => {
+    //   this.selectData();
+    // });
+  },
+};
+</script>
+
+<style scoped>
+.shade {
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 3;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+}
+/* .el-pager li{
+  background-color: #fff !important;
+  border: 1px solid #DCDCDC !important;
+}
+.el-pager li:nth-child(1){
+  background-color: #fff !important;
+  border: none !important;
+} */
+.el-table__cell {
+  text-align: center !important;
+}
+.diary {
+  box-sizing: border-box;
+  padding: 15px;
+  height: 100%;
+}
+.top {
+  width: 100%;
+  display: flex;
+  position: relative;
+  justify-content: space-between;
+  align-items: flex-end;
+}
+.oneType {
+  display: flex;
+  justify-content: flex-start;
+  /* flex-direction: column; */
+}
+.onTypeTxt {
+  cursor: pointer;
+  display: flex;
+  font-size: 16px;
+  position: relative;
+  align-items: center;
+  justify-content: center;
+  padding: 16px;
+  color: rgba(54, 129, 252, 1);
+}
+.onTypeTxt2 {
+  cursor: pointer;
+  display: flex;
+  font-size: 16px;
+  position: relative;
+  align-items: center;
+  justify-content: center;
+  padding: 16px;
+  color: rgba(0, 0, 0, 0.9);
+}
+.line {
+  position: absolute;
+  left: 50%;
+  bottom: 0;
+  transform: translate(-50%, 0);
+  height: 3px;
+  background-color: #3681fc;
+  width: 50%;
+}
+.wordBtn {
+  cursor: pointer;
+  background-color: #3681fc;
+  color: #fff;
+  width: 100px;
+  height: 34px;
+  border-radius: 3px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.twoType {
+  position: absolute;
+  display: flex;
+  top: 120%;
+  left: 0;
+}
+.twoTypeTxt {
+  cursor: pointer;
+  box-sizing: border-box;
+  min-width: 76px;
+  padding: 0 10px;
+  height: 34px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  color: #fff;
+  background-color: #3681fc;
+  border-radius: 3px;
+  border: 1px solid #e7e7e7;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 15px;
+}
+.twoTypeTxt2 {
+  cursor: pointer;
+  box-sizing: border-box;
+  min-width: 76px;
+  padding: 0 10px;
+  height: 34px;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  color: #000;
+  border-radius: 3px;
+  border: 1px solid #e7e7e7;
+  border-radius: 3px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-right: 15px;
+}
+.selectSty {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  /* margin-top: 60px; */
+  margin: 80px 10px 40px 0;
+}
+.evaluate {
+  text-align: center;
+  font-family: "Microsoft YaHei";
+  font-size: 14px;
+  font-style: normal;
+  font-weight: 400;
+  line-height: 22px; /* 157.143% */
+  display: flex;
+  justify-content: space-around;
+}
+.TableBtn {
+  cursor: pointer;
+}
+.pagination {
+  margin-top: 20px;
+  float: right;
+}
+</style>

+ 10 - 4
src/components/pages/kindStudentEva/test/index.vue

@@ -24,14 +24,14 @@
           class="title_item"
           class="title_item"
         >
         >
           <div></div>
           <div></div>
-          <div>期末打分</div>
+          <div>学情报告</div>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
     <div class="i_body_contant">
     <div class="i_body_contant">
-      <Diary v-if="type == 1" :oid="oid" :userid="userid"></Diary>
-      <Score v-if="type == 2" :oid="oid" :userid="userid"></Score>
-      <Report v-if="type == 3" :oid="oid" :userid="userid"></Report>
+      <Diary v-if="type == 1" :oid="oid" :userid="userid" :org="org" :cid="cid"></Diary>
+      <Score v-if="type == 2" :oid="oid" :userid="userid" :org="org"></Score>
+      <Report v-if="type == 3" :oid="oid" :userid="userid" :org="org"></Report>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -48,6 +48,12 @@ export default {
     oid: {
     oid: {
       type: String,
       type: String,
     },
     },
+    org: {
+      type: String,
+    },
+    cid: {
+      type: String,
+    },
   },
   },
   components: {
   components: {
     Diary,
     Diary,

+ 117 - 6
src/components/pages/kindStudentEva/test/report.vue

@@ -1,13 +1,124 @@
 <template>
 <template>
-  
+  <div class="report">
+    <div
+      style="background-color: #fff;width: 100%;height: 100%;box-sizing: border-box; padding: 15px;"
+    >
+      <div class="top">
+        <div style="width: 348px;height: 40px;flex-shrink: 0;">
+          <el-select v-model="value" style="width: 100%;" placeholder="请选择">
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </div>
+
+        <div class="topBtnS">
+          <div class="btn">生成pdf</div>
+          <div class="btn">分享报告</div>
+        </div>
+      </div>
+      <div style="margin: 20px 10px;">
+        学期综合表现
+      </div>
+      <div class="content">
+        <div class="conTitle">
+          <div>综合评价:</div>
+          <div class="txt">表现优异,再接再厉!</div>
+        </div>
+        <div>
+          <!-- <radarmap></radarmap> -->
+        </div>
+      </div>
+      <div></div>
+    </div>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
+// import radarmap from "./component/radarmap";
 export default {
 export default {
-
-}
+  // components: {
+  //   radarmap
+  // },
+  data() {
+    return {
+      options: [
+        {
+          value: "选项1",
+          label: "黄金糕"
+        }
+      ],
+      value: ""
+    };
+  },
+  methods: {},
+  mounted() {
+    // this.eChartsData()
+  },
+  created() {}
+};
 </script>
 </script>
 
 
-<style>
-
-</style>
+<style scoped>
+.report {
+  box-sizing: border-box;
+  padding: 15px;
+  height: 100%;
+}
+.top {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: 40px;
+  margin-bottom: 10px;
+}
+.topBtnS {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  height: 40px;
+  margin-bottom: 10px;
+}
+.btn {
+  border-radius: 8px;
+  border: 1px solid #3681fc;
+  color: rgba(54, 129, 252, 1);
+  display: inline-flex;
+  padding: 5px 16px;
+  justify-content: center;
+  align-items: center;
+  margin-left: 10px;
+  gap: 10px;
+}
+.content {
+  width: 100%;
+  height: 553px;
+  flex-shrink: 0;
+  border-radius: 16px;
+  border: 1px solid var(--bg3, #e7e7e7);
+  background: #fff;
+}
+.conTitle {
+  width: 70%;
+  margin: 20px auto;
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+.txt {
+  flex: 1;
+  width: 712px;
+  height: 40px;
+  line-height: 40px;
+  flex-shrink: 0;
+  border-radius: 4px;
+  background: #f0f2f5;
+  margin-left: 5px;
+  box-sizing: border-box;
+  padding: 0 15px;
+}
+</style>

+ 91 - 0
src/components/pages/kindStudentEva/test/reportDialog/index.vue

@@ -0,0 +1,91 @@
+<template>
+  <el-dialog
+    title="已关联证据"
+    :visible.sync="dialogVisibleReport"
+    :append-to-body="true"
+    width="500px"
+    :before-close="handleClose"
+    class="dialog_diy"
+  >
+  
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  props: {
+    dialogVisibleReport: {
+      type: Boolean,
+      default: false,
+    },
+    userid: {
+      type: String,
+    },
+    fid: {
+      type: String,
+    },
+    tid: {
+      type: String,
+    },
+    oid: {
+      type: String,
+    },
+  },
+  watch: {
+    dialogVisibleReport(newVal) {
+      if (newVal) {
+        this.getData();
+      }
+    },
+  },
+  methods: {
+    handleClose(done) {
+      this.close();
+      done();
+    },
+    close() {
+      this.$emit("update:dialogVisibleReport", false);
+    },
+    getData() {},
+  },
+};
+</script>
+
+<style scoped>
+.dialog_diy >>> .el-dialog {
+  /* height: 100%; */
+  margin: 10vh auto !important;
+}
+
+.dialog_diy >>> .el-dialog__header {
+  background: #454545 !important;
+  padding: 15px 20px;
+}
+
+.dialog_diy >>> .el-dialog__body {
+  height: calc(100% - 124px);
+  box-sizing: border-box;
+  padding: 0px;
+}
+
+.dialog_diy >>> .el-dialog__title {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn {
+  top: 19px;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
+  color: #fff;
+}
+
+.dialog_diy >>> .el-dialog__body,
+.dialog_diy >>> .el-dialog__footer {
+  background: #fafafa;
+}
+</style>

+ 457 - 3
src/components/pages/kindStudentEva/test/score.vue

@@ -1,13 +1,467 @@
 <template>
 <template>
-  
+  <div class="scoreBox">
+    <div class="sBox_top">
+      <div class="sTop_select">
+        <el-select
+          v-model="year"
+          placeholder="请选择学期"
+          class="student_input"
+          @change="searchStudentScore"
+        >
+          <el-option label="所有学期" value=""></el-option>
+          <el-option
+            v-for="(y, yIndex) in yearJuri"
+            :key="yIndex"
+            :label="y.name"
+            :value="y.id"
+          ></el-option>
+        </el-select>
+      </div>
+      <div class="sTop_button">查看评分标准</div>
+    </div>
+    <div class="sBox_table">
+      <div class="table_title">
+        <div>学习领域</div>
+        <div>一级发展目标</div>
+        <div>学期开始评分</div>
+        <div>期中评分</div>
+        <div>期末评分</div>
+        <div>平均分</div>
+        <div>关联证据</div>
+      </div>
+
+      <div class="table_detail">
+        <div
+          class="table_ftype"
+          v-for="(item, index) in scoreType"
+          :key="index"
+        >
+          <div
+            v-if="scoreJson[item.id].length"
+            class="ftype_name"
+            :style="{
+              minHeight: scoreJson[item.id].length * 50 + 'px',
+              lineHeight: scoreJson[item.id].length * 50 + 'px',
+            }"
+          >
+            {{ item.name }}
+          </div>
+          <div class="table_stype">
+            <div
+              class="stype_name"
+              v-for="(item1, index1) in scoreJson[item.id]"
+              :key="index + '-' + index1"
+              :label="item1.id"
+            >
+              {{ item1.sname }}
+            </div>
+          </div>
+          <div class="table_score">
+            <div
+              class="stype_score"
+              v-for="(item2, index2) in scoreJson[item.id]"
+              :key="index + '-' + index2"
+              :label="item2.id"
+            >
+              <div
+                v-for="(item3, index3) in item2[item2.id]"
+                :key="index + '-' + index2 + '-' + index3"
+                :label="item3"
+              >
+                <div class="star_box">
+                  <div
+                    class="star"
+                    v-for="sIndex in 5"
+                    :key="'star' + sIndex"
+                    :class="{ starA: item3 >= sIndex }"
+                    @click="
+                      updateStar(item.id, item2.id, index2, index3, sIndex)
+                    "
+                  ></div>
+                </div>
+              </div>
+              <div>
+                {{ getStarSum(item.id, item2.id, index2) }}
+              </div>
+              <div @click="lookSRecordByType(item.id, item2.id)">
+                <span style="color: #3681fc; cursor: pointer">查看</span>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div @click="saveSRJson" class="saveBox">
+          <div>保存</div>
+        </div>
+      </div>
+    </div>
+    <reportDialog
+      :dialogVisibleReport.sync="dialogVisibleReport"
+      :userid="userid"
+      :fid="fid"
+      :tid="tid"
+      :oid="oid"
+    ></reportDialog>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import reportDialog from "./reportDialog/index.vue";
 export default {
 export default {
+  components: {
+    reportDialog,
+  },
+  props: {
+    userid: {
+      type: String,
+    },
+    oid: {
+      type: String,
+    },
+    org: {
+      type: String,
+    },
+  },
+  data() {
+    return {
+      isLoading: false,
+      year: "",
+      yearJuri: [],
+      scoreType: [],
+      scoreJson: {},
+      dialogVisibleReport: false,
+      fid: "",
+      tid: "",
+    };
+  },
+  computed: {
+    getStarSum() {
+      return function (id, iid, i) {
+        let sum = 0;
+        for (var k = 0; k < this.scoreJson[id][i][iid].length; k++) {
+          sum += this.scoreJson[id][i][iid][k];
+        }
 
 
-}
+        return (sum / this.scoreJson[id][i][iid].length).toFixed(1);
+      };
+    },
+  },
+  methods: {
+    searchStudentScore() {
+      this.isLoading = true;
+      let params = {
+        uid: this.userid,
+        oid: this.oid,
+        org: this.org,
+        cu: this.year,
+      };
+      this.ajax
+        .get(this.$store.state.api + "selectSETable", params)
+        .then((res) => {
+          var table = res.data[0]; //个人学期评分
+          var ftype = res.data[1]; //公共父级分类
+          var stype = res.data[2]; //公共子级分类
+          var sctype = res.data[3]; //该学校子级分类
+          var fctype = res.data[4]; //该学校父级分类
+          var fotype = res.data[5]; //组织父级分类
+          var sotype = res.data[6]; //组织子级分类
+          var allfType = [];
+          var allsType = [];
+          if (fotype.length == 0 && sotype.length == 0) {
+            if (fctype.length == 0 && sctype.length == 0) {
+              for (var i = 0; i < ftype.length; i++) {
+                allfType.push(ftype[i]);
+              }
+              for (var i = 0; i < stype.length; i++) {
+                allsType.push(stype[[i]]);
+              }
+            } else {
+              for (var i = 0; i < fctype.length; i++) {
+                allfType.push(fctype[i]);
+              }
+              for (var i = 0; i < sctype.length; i++) {
+                allsType.push(sctype[[i]]);
+              }
+            }
+          } else {
+            for (var i = 0; i < fotype.length; i++) {
+              allfType.push(fotype[i]);
+            }
+            for (var i = 0; i < sotype.length; i++) {
+              allsType.push(sctysotypepe[[i]]);
+            }
+          }
+
+          if (table.length > 0) {
+            this.scoreJson = JSON.parse(table[0].json);
+          } else {
+            var scoreJson = {};
+            allfType.forEach((itemA) => {
+              scoreJson[itemA.id] = [];
+              allsType.forEach((itemB) => {
+                if (itemB.pid === itemA.id) {
+                  scoreJson[itemA.id].push({
+                    [itemB.id]: [0, 0, 0],
+                    sname: itemB.name,
+                    id: itemB.id,
+                  });
+                }
+              });
+            });
+            this.scoreJson = scoreJson;
+          }
+          this.scoreType = allfType;
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    getYear() {
+      this.isLoading = true;
+      this.ajax
+        .get(this.$store.state.api + "selectTerm")
+        .then((res) => {
+          this.isLoading = false;
+          var yearJuri = res.data[0];
+          for (var i = 0; i < yearJuri.length; i++) {
+            if (yearJuri[i].defaultC == 1) {
+              this.year = yearJuri[i].id;
+            }
+          }
+          this.yearJuri = yearJuri;
+        })
+        .catch((err) => {
+          this.isLoading = false;
+          console.error(err);
+        });
+    },
+    updateStar(id, iid, i, j, v) {
+      this.scoreJson[id][i][iid][j] = v;
+      this.$forceUpdate();
+    },
+    lookSRecordByType(fid, tid) {
+      this.fid = fid;
+      this.tid = tid;
+      this.dialogVisibleReport = true;
+    },
+    saveSRJson() {
+      let params = {
+        uid: this.userid,
+        j: JSON.stringify(this.scoreJson),
+        t: this.year,
+      };
+      this.ajax
+        .get(this.$store.state.api + "addSRScore", params)
+        .then((res) => {
+          this.$message.success("保存成功!");
+          this.searchStudentScore();
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
+  },
+  mounted() {
+    this.getYear();
+    this.searchStudentScore();
+  },
+};
 </script>
 </script>
 
 
-<style>
+<style scoped>
+.scoreBox {
+  background: #fff;
+  border-radius: 10px;
+  width: 98%;
+  margin: 15px auto;
+}
+.sBox_top {
+  width: 98%;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  margin: 0 auto;
+  padding: 20px 0;
+  box-sizing: border-box;
+}
+.sTop_select >>> .el-input__inner {
+  height: 35px;
+  width: 150px;
+}
+.sTop_select >>> .el-input__suffix {
+  top: 3px !important;
+}
+.sTop_button {
+  background: #3681fc;
+  color: #fff;
+  border-radius: 5px;
+  width: 120px;
+  height: 35px;
+  line-height: 35px;
+  text-align: center;
+  cursor: pointer;
+  margin-left: 30px;
+}
+.sBox_table {
+  width: 98%;
+  margin: 0 auto;
+}
+.table_title {
+  width: 100%;
+  height: 50px;
+  background: #e0eafb;
+  border: 1px solid #d5d8df;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+
+.table_title > div {
+  width: calc(100% / 7);
+  text-align: center;
+  height: 100%;
+  line-height: 50px;
+  border-right: 1px solid #d5d8df;
+}
+
+.table_title > div:last-child {
+  border: none;
+}
+
+.table_detail {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+
+.table_detail > .table_ftype {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  width: 100%;
+  height: 100%;
+}
+
+.table_ftype > .ftype_name {
+  width: calc(100% / 7);
+  min-width: calc(100% / 7);
+  height: 100%;
+  min-height: 80px;
+  line-height: 80px;
+  text-align: center;
+  border-left: 1px solid #d5d8df;
+  border-bottom: 1px solid #d5d8df;
+  border-right: none;
+}
+
+.table_detail > .table_ftype:first-child {
+  border-top: none;
+}
+
+.table_stype {
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+  width: calc(100% / 7);
+  min-width: calc(100% / 7);
+  text-align: center;
+  height: 100%;
+  min-height: 80px;
+  border-left: 1px solid #d5d8df;
+  border-bottom: 1px solid #d5d8df;
+}
+
+.table_stype > .stype_name {
+  width: 100%;
+  height: calc(100% / 2);
+  min-height: 50px;
+  line-height: 50px;
+  border-right: 1px solid #d5d8df;
+  border-bottom: 1px solid #d5d8df;
+}
+
+.table_stype > .stype_name:last-child {
+  border-bottom: none;
+}
+
+.table_score {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  flex-wrap: nowrap;
+  align-items: center;
+}
+
+.stype_score {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  width: calc(100% + 4px);
+  height: 50px;
+  line-height: 50px;
+  text-align: center;
+}
+
+.stype_score > div {
+  width: calc(100% / 3);
+  height: 100%;
+  border-bottom: 1px solid #d5d8df;
+  border-right: 1px solid #d5d8df;
+}
+
+.stype_score > div >>> .el-rate {
+  height: 100%;
+  line-height: 60px;
+}
+.star_box {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap;
+  align-items: center;
+  width: 100%;
+  height: 100%;
+  text-align: center;
+  justify-content: center;
+}
+.star_box > .star {
+  width: 25px;
+  height: 25px;
+  display: block;
+  background-image: url("../../../../assets/icon/studentEva/star-no.png");
+  background-size: 100% 100%;
+  cursor: pointer;
+}
 
 
+.star_box > .star + .star {
+  margin-left: 5px;
+}
+
+.star_box > .starA {
+  background-image: url("../../../../assets/icon/studentEva/star.png");
+}
+.saveBox {
+  width: 100%;
+  cursor: pointer;
+  padding: 10px 0;
+  box-sizing: border-box;
+}
+
+.saveBox > div {
+  width: 70px;
+  height: 30px;
+  color: #fff;
+  background: #3681fc;
+  text-align: center;
+  line-height: 30px;
+  border-radius: 5px;
+  float: right;
+}
 </style>
 </style>

+ 61 - 8
src/components/pages/studentEva.vue

@@ -95,11 +95,7 @@
           </el-table-column>
           </el-table-column>
           <el-table-column prop="rcount" label="观察记录总数" align="center">
           <el-table-column prop="rcount" label="观察记录总数" align="center">
           </el-table-column>
           </el-table-column>
-          <el-table-column label="综合评分" align="center">
-            <template slot-scope="{ row }">
-              <!-- {{ getGrade(row.pid) }} -->
-              {{ row.json ? row.json : "0" }}
-            </template>
+          <el-table-column prop="sum" label="综合评分" align="center">
           </el-table-column>
           </el-table-column>
           <el-table-column label="操作" width="400px">
           <el-table-column label="操作" width="400px">
             <template slot-scope="scope">
             <template slot-scope="scope">
@@ -118,7 +114,7 @@
                         org +
                         org +
                         '&cid=' +
                         '&cid=' +
                         cid +
                         cid +
-                        '&suid=' + 
+                        '&suid=' +
                         scope.row.userid +
                         scope.row.userid +
                         '&role=' +
                         '&role=' +
                         role
                         role
@@ -208,6 +204,7 @@ export default {
             }
             }
           }
           }
           this.yearJuri = yearJuri;
           this.yearJuri = yearJuri;
+          this.searchStudent();
         })
         })
         .catch((err) => {
         .catch((err) => {
           this.isLoading = false;
           this.isLoading = false;
@@ -224,6 +221,8 @@ export default {
         cid: this.cid,
         cid: this.cid,
         cu: this.sName,
         cu: this.sName,
         cn: this.year,
         cn: this.year,
+        oid: this.oid,
+        org: this.org,
         page: this.page,
         page: this.page,
       };
       };
       this.ajax
       this.ajax
@@ -231,7 +230,62 @@ export default {
         .then((res) => {
         .then((res) => {
           this.isLoading = false;
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          this.tableData = res.data[0];
+          var tableData = res.data[0];
+          var ftype = res.data[1]; //公共父级分类
+          var stype = res.data[2]; //公共子级分类
+          var sctype = res.data[3]; //该学校子级分类
+          var fctype = res.data[4]; //该学校父级分类
+          var fotype = res.data[5]; //组织父级分类
+          var sotype = res.data[6]; //组织子级分类
+          var allfType = [];
+          var allsType = [];
+          if (fotype.length == 0 && sotype.length == 0) {
+            if (fctype.length == 0 && sctype.length == 0) {
+              for (var i = 0; i < ftype.length; i++) {
+                allfType.push(ftype[i]);
+              }
+              for (var i = 0; i < stype.length; i++) {
+                allsType.push(stype[[i]]);
+              }
+            } else {
+              for (var i = 0; i < fctype.length; i++) {
+                allfType.push(fctype[i]);
+              }
+              for (var i = 0; i < sctype.length; i++) {
+                allsType.push(sctype[[i]]);
+              }
+            }
+          } else {
+            for (var i = 0; i < fotype.length; i++) {
+              allfType.push(fotype[i]);
+            }
+            for (var i = 0; i < sotype.length; i++) {
+              allsType.push(sctysotypepe[[i]]);
+            }
+          }
+          for (var i = 0; i < tableData.length; i++) {
+            var json = JSON.parse(tableData[i].json);
+            if (json) {
+              var count = 0;
+              var sum = 0;
+              for (var k = 0; k < allfType.length; k++) {
+                for (var j = 0; j < json[allfType[k].id].length; j++) {
+                  for (
+                    var q = 0;
+                    q < json[allfType[k].id][j][json[allfType[k].id][j].id].length;
+                    q++
+                  ) {
+                    count += json[allfType[k].id][j][json[allfType[k].id][j].id][q];
+                  }
+                }
+              }
+              sum = parseFloat((count / (allsType.length * 3)).toFixed(1));
+              tableData[i].sum = sum;
+            }else{
+              tableData[i].sum = 0;
+            }
+          }
+          this.tableData = tableData;
         })
         })
         .catch((err) => {
         .catch((err) => {
           this.isLoading = false;
           this.isLoading = false;
@@ -243,7 +297,6 @@ export default {
     this.page = 1;
     this.page = 1;
     this.getClass();
     this.getClass();
     this.getYear();
     this.getYear();
-    this.searchStudent();
   },
   },
 };
 };
 </script>
 </script>