zengyicheng 1 gadu atpakaļ
vecāks
revīzija
eef8d326de

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>
   <div class="tp_body">
     <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>
     </div>
     <div class="tp_right">
-      <testA :userid="suid" :oid="oid"></testA>
+      <testA :userid="suid" :oid="oid" :org="org"></testA>
     </div>
   </div>
 </template>

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

@@ -11,11 +11,11 @@
         <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_detail">
         <div>
-          <span>{{ item.value }}</span
+          <span>{{ item.count }}</span
           ><span>个</span>
         </div>
         <div>{{ item.name }}记录</div>
@@ -95,68 +95,79 @@ export default {
       let params = {
         uid: this.userid,
         oid: this.oid,
+        org: this.org,
       };
       this.ajax
         .get(this.$store.state.api + "selectSRecordY", params)
         .then((res) => {
           this.count = res.data[0].length; //总学习记录数量
           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++) {
-            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]);
               }
             } 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++) {
-              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) => {
           console.error(err);

+ 6 - 3
src/components/pages/kindStudentEva/test/index.vue

@@ -29,9 +29,9 @@
       </div>
     </div>
     <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"></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>
 </template>
@@ -48,6 +48,9 @@ export default {
     oid: {
       type: String,
     },
+    org: {
+      type: String,
+    },
   },
   components: {
     Diary,

+ 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>
-  
+  <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>
 
 <script>
+import reportDialog from "./reportDialog/index.vue";
 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>
 
-<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>

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

@@ -95,11 +95,7 @@
           </el-table-column>
           <el-table-column prop="rcount" label="观察记录总数" align="center">
           </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 label="操作" width="400px">
             <template slot-scope="scope">
@@ -118,7 +114,7 @@
                         org +
                         '&cid=' +
                         cid +
-                        '&suid=' + 
+                        '&suid=' +
                         scope.row.userid +
                         '&role=' +
                         role
@@ -208,6 +204,7 @@ export default {
             }
           }
           this.yearJuri = yearJuri;
+          this.searchStudent();
         })
         .catch((err) => {
           this.isLoading = false;
@@ -224,6 +221,8 @@ export default {
         cid: this.cid,
         cu: this.sName,
         cn: this.year,
+        oid: this.oid,
+        org: this.org,
         page: this.page,
       };
       this.ajax
@@ -231,7 +230,62 @@ export default {
         .then((res) => {
           this.isLoading = false;
           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) => {
           this.isLoading = false;
@@ -243,7 +297,6 @@ export default {
     this.page = 1;
     this.getClass();
     this.getYear();
-    this.searchStudent();
   },
 };
 </script>