Browse Source

幼儿园样式

yuanyiming 1 năm trước cách đây
mục cha
commit
ec6ad6939f

+ 12 - 35
src/components/pages/kindStudentEva/test/component/popbox.vue

@@ -16,11 +16,14 @@
     <div class="cellBlock">
       <div class="username">班级</div>
       <div>
-        <el-input
-          v-model="recordData.className"
-          disabled
-          placeholder="请输入内容"
-        ></el-input>
+        <el-tooltip placement="top">
+          <div slot="content">{{ recordData.className }}</div>
+          <el-input
+            v-model="recordData.className"
+            disabled
+            placeholder="请输入内容"
+          ></el-input>
+        </el-tooltip>
       </div>
     </div>
     <div class="cellBlock">
@@ -196,8 +199,8 @@ export default {
   },
   data() {
     return {
-      popType: this.recordDataCopy.type,
-      popTact: this.recordDataCopy.contact,
+      // popType: this.recordDataCopy.type,
+      // popTact: this.recordDataCopy.contact,
       // ico: false,
       // gIco: false,
       recordData: {},
@@ -261,38 +264,11 @@ export default {
         .then(res => {
           console.log(res);
           this.$emit("closePop");
-          this.$emit("selectData");
+          // 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);
@@ -453,6 +429,7 @@ export default {
 .imgCellCon {
   width: 100%;
   height: 100%;
+  display: block;
 }
 .updateCordSty {
   width: 120px;

+ 137 - 104
src/components/pages/kindStudentEva/test/diary.vue

@@ -12,14 +12,35 @@
       <!-- 分类与导出 -->
       <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 }">
+          <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
+              v-if="VeidooJson[item.id].length"
+              @click="clickFtypeId(item.id)"
+              :class="ftypeId == item.id ? 'onTypeTxt' : 'onTypeTxt2'"
+              style="position: relative;"
+            >
+              <span>{{ item.name }}</span>
+              <div class="line" :style="{display: ftypeId == item.id ? 'block' : 'none'}"></div>
+            </div>
             <!-- 子分类 -->
             <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 ? '被点击的样式' : '没被点击的样坏死' ">
+              <div
+                v-for="(item1, index1) in VeidooJson[item.id]"
+                v-if="item1.pid == ftypeId"
+                :key="index + '-' + index1"
+                :label="item1.id"
+              >
+                <div
+                  class="cName"
+                  @click="clickStypeId(item1.id)"
+                  :class="stypeId == item1.id ? 'twoTypeTxt' : 'twoTypeTxt2'"
+                >
                   {{ item1.name }}
                 </div>
               </div>
@@ -31,10 +52,7 @@
       <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 label="所有学期" value=""></el-option>
           <el-option
             v-for="item in termList"
             :key="item.id"
@@ -53,7 +71,7 @@
         header-align="center"
         :header-cell-style="{
           background: '#E0EAFB',
-          color: 'rgba(0, 0, 0, 0.90)',
+          color: 'rgba(0, 0, 0, 0.90)'
         }"
         @selection-change="handleSelectionChange"
       >
@@ -61,7 +79,6 @@
           type="selection"
           align="center"
           label="全选"
-          :show-overflow-tooltip="true"
           width="55"
         >
         </el-table-column>
@@ -105,21 +122,20 @@
           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)"
+                @click="updateCred(scope.row, 0)"
               >
                 查看
               </div>
               <div
                 class="TableBtn"
                 style="color: #3681fc"
-                @click="updateCred(scope.row,1)"
+                @click="updateCred(scope.row, 1)"
               >
                 修改
               </div>
@@ -154,7 +170,6 @@
       :termList="termList"
       :weiList="weiList"
       :studentList="studentList"
-      @selectData="selectData"
       @closePop="closePop"
     ></popbox>
   </div>
@@ -164,27 +179,27 @@
 import popbox from "./component/popbox";
 export default {
   components: {
-    popbox,
+    popbox
   },
   props: {
     userid: {
-      type: String,
+      type: String
     },
     oid: {
-      type: String,
+      type: String
     },
     org: {
-      type: String,
+      type: String
     },
     cid: {
-      type: String,
-    },
+      type: String
+    }
   },
   data() {
     return {
       // 筛选数据
       VeidooList: [],
-      VeidooJson:{},
+      VeidooJson: {},
       VeidooListChild: [],
       // 默认选择项
       // VeidooValue:{},
@@ -213,10 +228,24 @@ export default {
       studentList: [],
       judgeNum: 0,
       ftypeId: "",
-      stypeId: "",
+      stypeId: ""
     };
   },
   methods: {
+    // 大分类点击
+    clickFtypeId(e) {
+      this.ftypeId = e;
+      this.getData();
+    },
+    clickStypeId(e) {
+      console.log("点击小分类", e);
+      if (this.stypeId === e) {
+        this.stypeId = "";
+      } else {
+        this.stypeId = e;
+      }
+      this.getData();
+    },
     closePop() {
       this.isPop = false;
       // console.log('关了');
@@ -228,17 +257,17 @@ export default {
       //当页数发生改变的时候调用获取列表数据请求
       // console.log(`当前页: ${val}`);
       this.Page = val;
-      this.selectData();
+      this.getData();
     },
     //获取分类
     getVeidooType() {
       let params = {
         org: this.org,
-        oid: this.oid,
+        oid: this.oid
       };
       this.ajax
         .get(this.$store.state.api + "selectSTEType", params)
-        .then((res) => {
+        .then(res => {
           var ftype = res.data[0]; //公共父级分类
           var stype = res.data[1]; //公共子级分类
           var sctype = res.data[2]; //该学校子级分类
@@ -286,8 +315,12 @@ export default {
 
           this.VeidooList = allfType;
           this.VeidooJson = VeidooJson;
+          this.$forceUpdate();
+          this.getData();
+
+          // console.log("小分类", this.VeidooJson, "大分类", this.VeidooList);
         })
-        .catch((err) => {
+        .catch(err => {
           this.isLoading = false;
           console.error(err);
         });
@@ -298,20 +331,21 @@ export default {
       let params = {
         uid: this.userid,
         cid: this.cid,
-        cu: this.Veidoo,
-        cn: this.VeidooListChild,
+        cu: this.ftypeId,
+        cn: this.stypeId,
         cm: this.termId,
-        page: this.page,
+        page: this.page
       };
+      console.log(params);
       this.ajax
         .get(this.$store.state.api + "selectVeidooType", params)
-        .then((res) => {
+        .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);
+          // console.log(" 获取筛选数据", res);
         })
-        .catch((err) => {
+        .catch(err => {
           this.isLoading = false;
           console.error(err);
         });
@@ -322,7 +356,7 @@ export default {
       console.log(this.multipleSelection);
     },
     // 修改记录
-    updateCred(e,t) {
+    updateCred(e, t) {
       this.judgeNum = t;
       if (!Array.isArray(e.type)) {
         if (!e.type) {
@@ -346,21 +380,53 @@ export default {
         }
       }
       this.recordData = e;
-      this.getClassStudent();
+      this.isPop = true;
+    },
+    // 获取纬度列表
+    getWeiList() {
+      // 获取纬度筛选框
+      const data = {
+        oid: this.org,
+        cla: 0
+      };
+
+      this.ajax.get(this.$store.state.api + "selectVeiDoo", data).then(res => {
+        // console.log(res);
+        this.weiList = res.data[0];
+        // console.log("this.weiList", res);
+      });
     },
-    getClassStudent(){
-      // 获取班学生列表
+    // 获取班学生列表
+    getClassStudent() {
       const data2 = {
         cid: this.cid,
-        uid: this.userid,
+        uid: this.userid
       };
       this.ajax
         .get(this.$store.state.api + "selectManyClassStudent", data2)
-        .then((res) => {
+        .then(res => {
           // console.log(res);
           this.studentList = res.data[0];
-          console.log("this.studentList", res);
-          this.isPop = true;
+          // console.log("this.studentList", res);
+        });
+    },
+    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.termList = yearJuri;
+        })
+        .catch(err => {
+          this.isLoading = false;
+          console.error(err);
         });
     },
     // 判断导出数据
@@ -368,29 +434,11 @@ export default {
       if (this.multipleSelection.length) {
         this.exportExcel();
       } else {
-        console.log(2);
+        this.$message({ message: "请先选择要导出的数据", type: "warning" });
+        return
       }
     },
-    // 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;
@@ -415,12 +463,15 @@ export default {
       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 }
-      // ];
+      ws["!cols"] = [
+        //设置每一列的宽度
+        { wch: 20 },
+        { wch: 30 },
+        { wch: 30 },
+        { wch: 30 },
+        { wch: 30 },
+        { wch: 30 }
+      ];
       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设备上有更好的兼容性
@@ -428,25 +479,25 @@ export default {
       // FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), `${title} demo.xlsx`);//保存文件
       this.$message({
         message: "导出成功",
-        type: "success",
+        type: "success"
       });
     },
     // 删除记录
     delRecord(e) {
       this.$confirm("是否删除?", "提示", {
         confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonText: "取消"
       })
         .then(() => {
           this.ajax
             .post(this.$store.state.api + "updateRecord", [{ rid: e.rid }])
-            .then((res) => {
+            .then(res => {
               console.log(res);
-              this.selectData();
+              // this.selectData();
 
               this.$message({
                 type: "success",
-                message: "已删除",
+                message: "已删除"
               });
               // this.isLoading = false; updateRecord
             });
@@ -454,48 +505,23 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "已取消删除",
+            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.getWeiList()
+    this.getClassStudent();
+    this.getYear();
     this.getVeidooType();
-    this.getData();
   },
   mounted() {
     // this.$nextTick(() => {
     //   this.selectData();
     // });
-  },
+  }
 };
 </script>
 
@@ -533,10 +559,17 @@ export default {
   align-items: flex-end;
 }
 .oneType {
+  position: relative;
   display: flex;
   justify-content: flex-start;
   /* flex-direction: column; */
 }
+.typeCss {
+  position: absolute;
+  top: 120%;
+  left: 0;
+  display: flex;
+}
 .onTypeTxt {
   cursor: pointer;
   display: flex;

+ 1 - 1
src/components/pages/kindStudentEva/test/index.vue

@@ -30,7 +30,7 @@
     </div>
     <div class="i_body_contant">
       <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>
+      <Score v-if="type == 2" :oid="oid" :userid="userid" :org="org" :cid="cid"></Score>
       <Report v-if="type == 3" :oid="oid" :userid="userid" :org="org"></Report>
     </div>
   </div>

+ 157 - 11
src/components/pages/kindStudentEva/test/reportDialog/index.vue

@@ -3,11 +3,98 @@
     title="已关联证据"
     :visible.sync="dialogVisibleReport"
     :append-to-body="true"
-    width="500px"
+    width="1000px"
     :before-close="handleClose"
     class="dialog_diy"
   >
-  
+    <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)'
+      }"
+    >
+      <!-- <el-table-column type="selection" align="center" label="全选" 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">
+        <template slot-scope="scope">
+          <div class="evaluate">
+            <div
+              class="TableBtn"
+              style="color: #3681fc"
+              @click="updateCred(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>
   </el-dialog>
 </template>
 
@@ -16,27 +103,43 @@ export default {
   props: {
     dialogVisibleReport: {
       type: Boolean,
-      default: false,
+      default: false
     },
     userid: {
-      type: String,
+      type: String
     },
     fid: {
-      type: String,
+      type: String
     },
     tid: {
-      type: String,
+      type: String
     },
     oid: {
-      type: String,
+      type: String
     },
+    year: {
+      type: String
+    },
+    cid: {
+      type: String
+    }
+  },
+  data() {
+    return {
+      // 表格数据
+      tableData: [],
+      // 总条数
+      total: 0,
+      // 当前页
+      page: 1
+    };
   },
   watch: {
     dialogVisibleReport(newVal) {
       if (newVal) {
         this.getData();
       }
-    },
+    }
   },
   methods: {
     handleClose(done) {
@@ -46,12 +149,50 @@ export default {
     close() {
       this.$emit("update:dialogVisibleReport", false);
     },
-    getData() {},
+    // 获取数据
+    getData() {
+      // 获取筛选框数据
+      let params = {
+        uid: this.userid,
+        cid: this.cid,
+        cu: this.fid,
+        cn: this.tid,
+        cm: this.year,
+        page: this.page
+      };
+      console.log(params);
+      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);
+        });
+    },
+    // 切换页
+    handleCurrentChange(val) {
+      //当页数发生改变的时候调用获取列表数据请求
+      // console.log(`当前页: ${val}`);
+      this.Page = val;
+      this.getData();
+    }
   },
+  mounted() {
+    // this.getData();
+  }
 };
 </script>
 
 <style scoped>
+.dialog_diy {
+  box-sizing: border-box;
+  /* padding: 0 10px 10px 10px; */
+}
 .dialog_diy >>> .el-dialog {
   /* height: 100%; */
   margin: 10vh auto !important;
@@ -65,7 +206,7 @@ export default {
 .dialog_diy >>> .el-dialog__body {
   height: calc(100% - 124px);
   box-sizing: border-box;
-  padding: 0px;
+  /* padding: 0px; */
 }
 
 .dialog_diy >>> .el-dialog__title {
@@ -88,4 +229,9 @@ export default {
 .dialog_diy >>> .el-dialog__footer {
   background: #fafafa;
 }
-</style>
+.pagination {
+  display: flex;
+  justify-content: flex-end;
+  padding: 20px;
+}
+</style>

+ 5 - 0
src/components/pages/kindStudentEva/test/score.vue

@@ -99,7 +99,9 @@
       :userid="userid"
       :fid="fid"
       :tid="tid"
+      :cid="cid"
       :oid="oid"
+      :year="year"
     ></reportDialog>
   </div>
 </template>
@@ -120,6 +122,9 @@ export default {
     org: {
       type: String,
     },
+    cid: {
+      type: String,
+    },
   },
   data() {
     return {