Bladeren bron

课程资源作业

bzkf30 2 jaren geleden
bovenliggende
commit
4c26b43353

+ 3 - 1
src/pages/personal/components/Homework/live/components/KczyStudentWork.vue

@@ -143,6 +143,8 @@ export default {
         grade_id: this.activeGrade,
         subject_id: this.activeSubject,
         kc_cate_level_1: this.activeCate,
+        limit: this.pageSize,
+        page: this.currentPage
       };
 
       this.loading = true;
@@ -155,7 +157,7 @@ export default {
       });
     },
     lookDetail(id) {
-      this.$router.push({ name: "personal_homework_wlzb_worklist", params: { workType: this.workType, id } });
+      this.$router.push({ name: "personal_homework_kczy_worklist", params: { workType: this.workType, id } });
     },
   },
   created() {

+ 19 - 3
src/pages/personal/components/Homework/live/workdetail.vue

@@ -47,8 +47,8 @@ export default {
   },
   methods: {
     initData() {
+      this.loading = true;
       if (this.workType == 1) {
-        this.loading = true;
         request({
           url: '/yzy/zy_zbkc_xfjl/detail',
           data: {
@@ -57,7 +57,6 @@ export default {
         }).then(res => {
           if (res.code == 1) {
             let data = res.data.one_info;
-            console.log(data)
             this.userName = data.yzzx_student_realname;
             this.problemName = data.yzz_name;
             if (data.yzzx_content_json != null) {
@@ -69,7 +68,24 @@ export default {
           }
         })
       } else if (this.workType == 2) {
-
+        request({
+          url: '/yzy/zy_kczy_dtjl/detail',
+          data: {
+            yzkd_id: this.operateId
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            let data = res.data.one_info;
+            this.userName = data.yzzx_student_realname;
+            this.problemName = data.yzk_name;
+            if (data.yzk_content_json != null) {
+              this.problemData = JSON.parse(data.yzk_content_json);
+            } else {
+              this.problemData = [];
+            }
+            this.loading = false;
+          }
+        })
       }
     }
   },

+ 19 - 3
src/pages/personal/components/Homework/live/worklist.vue

@@ -10,6 +10,7 @@
         </div>
       </div>
       <div class="resultDiv">
+        <el-empty v-if="resultData.length==0" image-size="100" description="无数据" style="padding: 10px 0;" />
         <div class="recordDiv" v-for="(item, index) in resultData" :key="index">
           <div class="record-list">
             <div class="left">
@@ -20,7 +21,7 @@
               <div style="margin: 10px 0 0 15px;">{{item.yzz_name}}</div>
             </div>
             <div class="right">
-              <el-button size="mini" type="primary" plain @click="lookDetail(item.yzzx_id)">查看</el-button>
+              <el-button size="mini" type="primary" plain @click="lookDetail(item.yzzx_id || item.yzkd_id)">查看</el-button>
             </div>
           </div>
           <el-divider border-style="dashed" />
@@ -36,6 +37,8 @@ export default {
     return {
       loading: false,
       workType: "",
+      operateId: "",
+      parentId: "",
       searchKey: "",
       resultData: [
         {
@@ -53,8 +56,8 @@ export default {
   },
   methods: {
     initData() {
+      this.loading = true;
       if (this.workType == 1) {
-        this.loading = true;
         request({
           url: '/yzy/zy_zbkc_xfjl/index',
           data: {
@@ -69,7 +72,19 @@ export default {
           }
         })
       } else if (this.workType == 2) {
-
+        request({
+          url: '/yzy/zy_kczy_dtjl/index',
+          data: {
+            keyword: this.searchKey,
+            kf_id: this.operateId,
+            kk_id: this.parentId,
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            this.resultData = res.data.page_data;
+            this.loading = false;
+          }
+        })
       }
     },
     lookDetail(id) {
@@ -79,6 +94,7 @@ export default {
   created() {
     this.workType = this.$route.params.workType;
     this.operateId = this.$route.params.id || "";
+    this.parentId = this.$route.query.kkID;
     if (this.operateId != "") {
       this.initData();
     }

+ 239 - 0
src/pages/personal/components/Homework/live/zyWorkList.vue

@@ -0,0 +1,239 @@
+<template>
+  <!-- 课程资源资源 -->
+  <div class="kczyContent-zy" v-loading="loading">
+    <el-card>
+      <div style="padding: 0 75px;">
+        <span class="title">课程资源</span>
+        <span class="subTitle">作业 - 创建 - <span class="pointer" @click="goBack">课程</span> - <span style="color: #000;">资源</span></span>
+      </div>
+    </el-card>
+    <el-card class="bgCard">
+      <div class="bgDetail">
+        <div style="font-size: 28px;font-weight: 600;">{{detailInfo.kk_name}}</div>
+        <div class="flex" style="font-size: 16px;margin: 20px 0 30px;">
+          <div>
+            <span>责任教师:</span>
+            <span>{{detailInfo.kk_zrjs}}</span>
+          </div>
+          <div style="margin-left: 80px;">
+            <span>机构名称:</span>
+            <span>{{detailInfo.kk_jgmc}}</span>
+          </div>
+        </div>
+        <div style="font-size: 14px;line-height: 20px;">
+          简介:
+          <p>{{detailInfo.kc_jj}}</p>
+        </div>
+      </div>
+
+      <div class="searchDiv">
+        <div class="searchValue">
+          <input type="text" placeholder="搜索关键字" v-model="searchKey">
+          <div class="searchBtn" @click="initData">
+            <img src="/kczy/searchIcon.png" alt="">
+          </div>
+        </div>
+      </div>
+
+      <div class="zyContent">
+        <el-empty v-if="resultData.length==0" image-size="100" description="无数据" style="padding: 10px 0;" />
+        <div class="resultDiv">
+          <el-row :gutter="20">
+            <el-col :span="5" v-for="item in resultData" :key="item.name">
+              <el-card class="resultCard pointer" @click="lookDetail(item.kf_id)">
+                <div class="collect">
+                  <div class="icon-item" style="margin-right: 18px;">
+                    <img src="/images/home/icon-prove.png" alt="">
+                    <span>{{item.kf_like_num}}</span>
+                  </div>
+                  <div class="icon-item">
+                    <img src="/images/home/icon-favor.png" alt="">
+                    <span>{{item.kf_fav_num}}</span>
+                  </div>
+                </div>
+                <img style="height: 157px;width: 100%;" :src="getFullUrl(item.kf_img)" alt="" />
+                <div style="padding: 8px 8px 0;">
+                  <div style="font-size: 16px;">{{item.kf_name}}</div>
+                  <div class="operate">
+                    <el-rate size="large" disabled v-model="item.kf_star_num" allow-half />
+                  </div>
+                </div>
+              </el-card>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+import { kc_detail, files_list } from "../../MyCourse/api";
+export default {
+  data() {
+    return {
+      loading: false,
+      workType: "",
+      parentId: "",
+      searchKey: "",
+      detailInfo: {},
+      resultData: [],
+    }
+  },
+  methods: {
+    goBack() {
+      this.$router.go(-1);
+    },
+    initDetailData() {
+      kc_detail({ kk_id: this.parentId }).then((res) => {
+        if (res.code == 1) {
+          this.detailInfo = res.data.one_info;
+        }
+      });
+    },
+    initData() {
+      this.loading = true;
+      let data = {
+        keyword: this.searchKey,
+        kk_id: this.parentId,
+        yzk_id: 1,
+      }
+      files_list(data).then((res) => {
+        if (res.code == 1) {
+          this.resultData = res.data.page_data;
+
+          this.loading = false;
+        }
+      });
+    },
+    lookDetail(id) {
+      this.$router.push({ name: "personal_homework_wlzb_worklist", params: { workType: this.workType, id }, query: { kkID: this.parentId } });
+    }
+  },
+  created() {
+    this.workType = this.$route.params.workType;
+    this.parentId = this.$route.params.id;
+    this.initDetailData();
+    this.initData();
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.kczyContent-zy::v-deep {
+  .bgCard {
+    .el-card__body {
+      padding-bottom: 0;
+    }
+  }
+  .el-card {
+    margin-bottom: 15px;
+    background: #fff;
+    &.resultCard {
+      .el-card__body {
+        padding: 0;
+      }
+    }
+  }
+  .pointer {
+    cursor: pointer;
+  }
+  .title {
+    font-size: 18px;
+    color: #050026;
+  }
+  .subTitle {
+    font-size: 14px;
+    color: #949494;
+    margin-left: 45px;
+  }
+  .flex {
+    display: flex;
+  }
+  .bgDetail {
+    background: url("/kczy/chapterBG.png") no-repeat top left;
+    background-size: 100%;
+    color: #fff;
+    padding: 50px 60px;
+    border-radius: 12px;
+  }
+  .searchDiv {
+    display: flex;
+    justify-content: flex-end;
+    margin: 30px 0;
+    .searchValue {
+      width: 350px;
+      height: 50px;
+      // margin: 0 auto;
+      background: #ffffff;
+      border-radius: 8px;
+      overflow: hidden;
+      position: relative;
+      input {
+        width: 100%;
+        height: 100%;
+        outline: 0;
+        box-sizing: border-box;
+        padding-left: 10px;
+        background: #f6f8fa;
+      }
+      .searchBtn {
+        width: 26px;
+        height: 26px;
+        background: #00a3ff;
+        border-radius: 6px;
+        position: absolute;
+        right: 5px;
+        top: 50%;
+        transform: translate(-50%, -50%);
+        text-align: center;
+        vertical-align: middle;
+        cursor: pointer;
+        img {
+          display: block;
+          text-align: center;
+          margin: 6px auto 0;
+        }
+      }
+    }
+  }
+  .zyContent {
+    display: flex;
+    // margin-top: 40px;
+    .resultDiv {
+      width: 100%;
+      .el-col-5 {
+        flex: 0 0 20%;
+      }
+      .resultCard {
+        position: relative;
+        border-radius: 12px;
+        .collect {
+          position: absolute;
+          right: 0;
+          background: rgba($color: #000000, $alpha: 0.59);
+          border-radius: 0px 12px 0px 12px;
+          color: #fff;
+          font-size: 14px;
+          display: flex;
+          padding: 0 18px;
+          line-height: 32px;
+          .icon-item {
+            display: flex;
+            align-items: center;
+            img {
+              width: 17px;
+              margin-right: 5px;
+            }
+          }
+        }
+        .operate {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+        }
+      }
+    }
+  }
+}
+</style>

+ 25 - 3
src/pages/personal/components/MyCourse/kczy-zy.vue

@@ -65,6 +65,9 @@
               </el-row>
             </div>
           </div>
+          <!-- <div class="paginationDiv">
+            <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :page-size="pageSize" :currentPage="currentPage"></el-pagination>
+          </div> -->
         </div>
         <div class="rightCon">
           <div style="font-size: 16px;font-weight: 600;color: #171721;">课程安排</div>
@@ -88,6 +91,9 @@ export default {
       parentId: "",
       detailInfo: {},
       resultData: [],
+      pageSize: 12,
+      currentPage: 1,
+      total: 0,
     }
   },
   components: { Delete, EditPen, ElMessageBox },
@@ -102,12 +108,21 @@ export default {
         }
       });
     },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.initData();
+    },
     initData() {
       this.loading = true;
-      files_list({ kk_id: this.parentId }).then((res) => {
+      let data = {
+        kk_id: this.parentId,
+        // page: this.currentPage,
+        // limit: this.pageSize
+      }
+      files_list(data).then((res) => {
         if (res.code == 1) {
           this.resultData = res.data.page_data;
-
+          // this.total = Number(res.data.total_rows);
           this.loading = false;
         }
       });
@@ -196,7 +211,8 @@ export default {
     .leftCon {
       flex: 1;
       margin-right: 50px;
-      padding-bottom: 20px;
+      padding-bottom: 50px;
+      position: relative;
       .el-button {
         width: 100px;
         height: 40px;
@@ -233,6 +249,12 @@ export default {
           }
         }
       }
+      .paginationDiv {
+        position: absolute;
+        right: 0;
+        bottom: 15px;
+        padding: 3px;
+      }
     }
     .rightCon {
       width: 500px;

+ 20 - 0
src/pages/personal/components/MyCourse/kczy.vue

@@ -78,6 +78,10 @@
           </el-row>
         </div>
       </div>
+
+      <div class="paginationDiv">
+        <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :page-size="pageSize" :currentPage="currentPage"></el-pagination>
+      </div>
     </el-card>
   </div>
 </template>
@@ -99,6 +103,9 @@ export default {
       activeCate: "",
       wholeData: [],
       resultData: [],
+      pageSize: 10,
+      currentPage: 1,
+      total: 0,
     }
   },
   components: { Delete, EditPen, ElMessageBox },
@@ -160,18 +167,25 @@ export default {
 
       this.initData();
     },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.initData();
+    },
     initData() {
       let data = {
         keyword: this.searchKey,
         grade_id: this.activeGrade,
         subject_id: this.activeSubject,
         kc_cate_level_1: this.activeCate,
+        page: this.currentPage,
+        limit: this.pageSize
       };
 
       this.loading = true;
       kc_list(data).then((res) => {
         if (res.code == 1) {
           this.resultData = res.data.page_data;
+          this.total = Number(res.data.total_rows);
           this.loading = false;
         }
       });
@@ -355,6 +369,12 @@ export default {
       }
     }
   }
+  .paginationDiv {
+    position: absolute;
+    right: 30px;
+    bottom: 15px;
+    padding: 3px;
+  }
 }
 </style>
 

+ 22 - 2
src/pages/personal/components/MyCourse/ssys.vue

@@ -87,6 +87,10 @@
           </el-row>
         </div>
       </div>
+
+      <div class="paginationDiv">
+        <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :page-size="pageSize" :currentPage="currentPage"></el-pagination>
+      </div>
     </el-card>
   </div>
 </template>
@@ -133,7 +137,10 @@ export default {
         // { id: 1, img: img_lczs1, title: '走进生肖文化——寅虎卯兔', bfl: 100, desc: '领略生肖传奇,品味传统文化!', nj: '四年级', xk: '美术', ls: '尚老师', tx: img_tx, zt: '1' },
         // { id: 2, img: img_lczs2, title: '走进生肖文化——寅虎卯兔', bfl: 100, desc: '领略生肖传奇,品味传统文化!', nj: '四年级', xk: '美术', ls: '尚老师', tx: img_tx, zt: '' },
         // { id: 3, img: img_lczs3, title: '走进生肖文化——寅虎卯兔', bfl: 100, desc: '领略生肖传奇,品味传统文化!', nj: '四年级', xk: '美术', ls: '尚老师', tx: img_tx, zt: '' }
-      ]
+      ],
+      pageSize: 10,
+      currentPage: 1,
+      total: 0,
     }
   },
   components: { Delete, EditPen, Histogram, View, ElMessageBox },
@@ -181,12 +188,18 @@ export default {
 
       this.initData();
     },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.initData();
+    },
     initData() {
       let data = {
         keyword: this.searchKey,
         grade_id: this.activeGrade,
         team_id: this.activeFascicule,
-        ks_status: this.activeName
+        ks_status: this.activeName,
+        page: this.currentPage,
+        limit: this.pageSize
       };
 
       this.loading = true;
@@ -201,6 +214,7 @@ export default {
               }
             })
           })
+          this.total = Number(res.data.total_rows);
           this.loading = false;
         }
       });
@@ -409,6 +423,12 @@ export default {
       }
     }
   }
+  .paginationDiv {
+    position: absolute;
+    right: 30px;
+    bottom: 15px;
+    padding: 3px;
+  }
 }
 </style>
 

+ 5 - 0
src/router/index.js

@@ -454,6 +454,11 @@ export default createRouter({
                   path: 'wlzb_workdetail/:workType/:id',
                   name: 'personal_homework_wlzb_workdetail',
                   component: () => import("~/pages/personal/components/Homework/live/workdetail.vue"),
+                },
+                {
+                  path: 'kczy_worklist/:workType/:id',
+                  name: 'personal_homework_kczy_worklist',
+                  component: () => import("~/pages/personal/components/Homework/live/zyWorkList.vue"),
                 }
               ]
             }

File diff suppressed because it is too large
+ 73 - 0
vite.config.js.timestamp-1664115170926.mjs