瀏覽代碼

课程资源作业

bzkf30 2 年之前
父節點
當前提交
3db15e9a58

+ 17 - 5
src/pages/personal/components/Homework/index.vue

@@ -4,7 +4,7 @@
     <div class="myCourse">
 
       <el-row :gutter="20">
-        <el-col :span="8" v-for="item in courseData" :key="item.name" @click="goToPage(item.url)">
+        <el-col :span="8" v-for="item in courseData" :key="item.name" @click="goToPage(item.url, item.workType)">
           <div class="item" :style="{background: item.bgColor}">
             <img :src="item.img" alt="" />
             <div>
@@ -37,8 +37,17 @@ export default {
           bgColor: "rgba(253, 180, 4, 0.1)",
           pro: "网络视频直播的核心思想是利用既有的 局域网、城域网甚至是万维网……",
           img: "/images/personal/course2.png",
-          url: "personal_homework_wlzb"
+          url: "personal_homework_wlzb",
+          workType: 1
         },
+        {
+          name: "课程资源",
+          bgColor: "rgba(61, 115, 247, 0.1)",
+          pro: "就是一切能够运用到教学活动中的各 种条件和材料",
+          img: "/images/personal/course6.png",
+          url: "personal_homework_wlzb",
+          workType: 2
+        }
       ]
     }
   },
@@ -46,9 +55,12 @@ export default {
     // initSwitch(index) {
     //   this.activeSwitch = index;
     // },
-    goToPage(url) {
-      console.log(url)
-      this.$router.push({ name: url });
+    goToPage(url, workType) {
+      if (!workType) {
+        this.$router.push({ name: url });
+      } else {
+        this.$router.push({ name: url, params: { workType } });
+      }
     }
   }
 }

+ 77 - 27
src/pages/personal/components/Homework/live/components/CreateWork.vue

@@ -2,15 +2,19 @@
   <div class="createWork" v-loading="loading">
     <div class="recordDiv" v-for="(item, index) in resultData" :key="index">
       <div class="record-list">
-        <div class="left">{{item.yzz_name}} </div>
+        <div class="left">{{item.yzz_name || item.yzk_name}} </div>
         <div class="right">
-          <el-button size="mini" type="primary" plain @click="lookDetail(item.yzz_id, true)">查看</el-button>
-          <el-button size="mini" type="primary" plain @click="handleDelete(item.yzz_id)">删除</el-button>
-          <el-button size="mini" type="primary" plain @click="lookDetail(item.yzz_id)">编辑</el-button>
+          <el-button size="mini" type="primary" plain @click="lookDetail(item.yzz_id || item.yzk_id, true)">查看</el-button>
+          <el-button size="mini" type="primary" plain @click="handleDelete(item.yzz_id || item.yzk_id)">删除</el-button>
+          <el-button size="mini" type="primary" plain @click="lookDetail(item.yzz_id || item.yzk_id)">编辑</el-button>
         </div>
       </div>
       <el-divider border-style="dashed" />
     </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>
 </template>
 
@@ -19,42 +23,82 @@ export default {
   data() {
     return {
       loading: false,
-      resultData: []
+      resultData: [],
+      pageSize: 10,
+      currentPage: 1,
+      total: 0,
     }
   },
+  props: ["workType"],
   methods: {
     initData(keyword) {
       this.loading = true;
-      request({
-        url: '/yzy/zy_zbkc/index',
-        data: {
-          keyword: keyword
-        }
-      }).then(res => {
-        if (res.code == 1) {
-          this.resultData = res.data.page_data;
-          this.loading = false;
-        }
-      })
+      if (this.workType == 1) {
+        request({
+          url: '/yzy/zy_zbkc/index',
+          data: {
+            keyword: keyword,
+            limit: this.pageSize,
+            page: this.currentPage,
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            this.resultData = res.data.page_data;
+            this.total = Number(res.data.total_rows);
+            this.loading = false;
+          }
+        })
+      } else if (this.workType == 2) {
+        request({
+          url: '/yzy/zy_kczy/index',
+          data: {
+            keyword: keyword,
+            limit: this.pageSize,
+            page: this.currentPage,
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            this.resultData = res.data.page_data;
+            this.total = Number(res.data.total_rows);
+            this.loading = false;
+          }
+        })
+      }
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.initData();
     },
     lookDetail(id, isLook) {
-      this.$router.push({ name: "personal_homework_wlzb_work", query: { id, isLook } });
+      this.$router.push({ name: "personal_homework_wlzb_work", params: { workType: this.workType }, query: { id, isLook } });
     },
-    handleDelete(yzz_id) {
+    handleDelete(id) {
       ElMessageBox.confirm('是否确定删除当前作业?', '提示', {
         distinguishCancelAndClose: true,
         confirmButtonText: '确定',
         cancelButtonText: '取消',
       }).then(() => {
-        request({
-          url: '/yzy/zy_zbkc/delete',
-          data: { yzz_id }
-        }).then(res => {
-          if (res.code == 1) {
-            this.$message.success("删除成功!");
-            this.initData();
-          }
-        })
+        if (this.workType == 1) {
+          request({
+            url: '/yzy/zy_zbkc/delete',
+            data: { yzz_id: id }
+          }).then(res => {
+            if (res.code == 1) {
+              this.$message.success("删除成功!");
+              this.initData();
+            }
+          })
+        } else if (this.workType == 2) {
+          request({
+            url: '/yzy/zy_kczy/delete',
+            data: { yzk_id: id }
+          }).then(res => {
+            if (res.code == 1) {
+              this.$message.success("删除成功!");
+              this.initData();
+            }
+          })
+        }
       }).catch(() => {
 
       })
@@ -91,5 +135,11 @@ export default {
       margin: 15px 0;
     }
   }
+  .paginationDiv {
+    position: absolute;
+    right: 30px;
+    bottom: 15px;
+    padding: 3px;
+  }
 }
 </style>

+ 253 - 0
src/pages/personal/components/Homework/live/components/KczyStudentWork.vue

@@ -0,0 +1,253 @@
+<template>
+  <!-- 课程资源 -->
+  <div class="kczyStudentWork" v-loading="loading">
+    <div class="searchBtn">
+      <div class="search-list">
+        <div class="label">年级</div>
+        <div class="valueDiv">
+          <div class="item pointer" :class="activeGrade==item.grade_id?'active':''" @click="initGrade(item)" v-for="item in gradeData" :key="item.grade_id">{{item.grade_name}}</div>
+        </div>
+      </div>
+      <div class="search-list">
+        <div class="label">科目</div>
+        <div class="valueDiv">
+          <div class="item pointer" :class="activeSubject==item.subject_id?'active':''" @click="initSubject(item)" v-for="item in subjectData" :key="item.subject_id">{{item.subject_name}}</div>
+        </div>
+      </div>
+      <div class="search-list">
+        <div class="label">分类</div>
+        <div class="valueDiv">
+          <div class="item pointer" :class="activeCate==item.kc_id?'active':''" @click="initCate(item)" v-for="item in cateData" :key="item.kc_id">{{item.kc_name}}</div>
+        </div>
+      </div>
+    </div>
+    <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" @click="lookDetail(item.kk_id)">
+          <el-card class="resultCard pointer">
+            <div class="collect">
+              <div class="icon-item" style="margin-right: 18px;">
+                <img src="/images/home/icon-prove.png" alt="">
+                <span>{{item.kk_like_num}}</span>
+              </div>
+              <div class="icon-item">
+                <img src="/images/home/icon-favor.png" alt="">
+                <span>{{item.kk_fav_num}}</span>
+              </div>
+            </div>
+            <img style="height: 157px;width: 100%;" :src="getFullUrl(item.kk_img)" alt="" />
+            <div style="padding: 8px 8px 0;">
+              <div style="font-size: 16px;">{{item.kk_name}}</div>
+              <div class="operate">
+                <el-rate size="large" disabled v-model="item.kk_star_num" allow-half />
+              </div>
+            </div>
+          </el-card>
+        </el-col>
+      </el-row>
+    </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>
+</template>
+
+<script>
+import { grade_list, subject_list, cate_list, kc_list } from "../../../MyCourse/api";
+import { getFullUrl } from '@/utils/helper';
+export default {
+  data() {
+    return {
+      loading: false,
+      gradeData: ["幼儿园", "一年级", "二年级", "三年级", "四年级", "五年级", "六年级", "初一", "初二", "初三", "高一", "高二", "高三", "其他"],
+      subjectData: ["美术", "音乐", "舞蹈"],
+      cateData: [],
+      activeGrade: "",
+      activeSubject: "",
+      activeCate: "",
+      wholeData: [],
+      resultData: [],
+      pageSize: 10,
+      currentPage: 1,
+      total: 0,
+    }
+  },
+  props: ["workType"],
+  methods: {
+    //年级
+    initGradeData() {
+      this.gradeData = [
+        {
+          grade_id: "",
+          grade_name: "全部",
+        }
+      ];
+      grade_list().then((res) => {
+        if (res.code == 1) {
+          this.gradeData = this.gradeData.concat(res.data.page_data);
+        }
+      });
+    },
+    initGrade(value) {
+      this.activeGrade = value.grade_id;
+
+      this.initData();
+    },
+    // 科目
+    initSubjectData() {
+      this.subjectData = [
+        {
+          subject_id: "",
+          subject_name: "全部",
+        }
+      ];
+      subject_list().then((res) => {
+        if (res.code == 1) {
+          this.subjectData = this.subjectData.concat(res.data.page_data);
+        }
+      });
+    },
+    initSubject(value) {
+      this.activeSubject = value.subject_id;
+
+      this.initData();
+    },
+    // 分类
+    initCateData() {
+      this.cateData = [
+        {
+          kc_id: "",
+          kc_name: "全部",
+        }
+      ];
+      cate_list({ kc_level: 1 }).then((res) => {
+        if (res.code == 1) {
+          this.cateData = this.cateData.concat(res.data.page_data);
+        }
+      });
+    },
+    initCate(value) {
+      this.activeCate = value.kc_id;
+
+      this.initData();
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.initData();
+    },
+    initData(keyword) {
+      let data = {
+        keyword: keyword,
+        grade_id: this.activeGrade,
+        subject_id: this.activeSubject,
+        kc_cate_level_1: this.activeCate,
+      };
+
+      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;
+        }
+      });
+    },
+    lookDetail(id) {
+      this.$router.push({ name: "personal_homework_wlzb_worklist", params: { workType: this.workType, id } });
+    },
+  },
+  created() {
+    this.initGradeData();
+    this.initSubjectData();
+    this.initCateData();
+    this.initData();
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.kczyStudentWork {
+  .pointer {
+    cursor: pointer;
+  }
+  .searchBtn {
+    padding-top: 10px;
+    .search-list {
+      display: flex;
+      align-items: baseline;
+      font-size: 14px;
+      margin: 20px 0;
+      .label {
+        color: #000;
+        margin-right: 25px;
+      }
+      .valueDiv {
+        flex: 1;
+        display: flex;
+        color: #949494;
+        border-bottom: 1px dashed #e4e6e8;
+        padding-bottom: 15px;
+        font-weight: 400;
+        .item + .item {
+          margin-left: 20px;
+        }
+        .item {
+          padding: 3px 5px;
+          &.active {
+            color: #00a3ff;
+            border-radius: 6px;
+            background: rgba($color: #00a3ff, $alpha: 0.1);
+          }
+        }
+      }
+    }
+  }
+  .resultDiv {
+    .el-col-5 {
+      flex: 0 0 20%;
+    }
+    .resultCard::v-deep {
+      margin-bottom: 15px;
+      border-radius: 12px;
+      .el-card__body {
+        padding: 0;
+      }
+    }
+    .resultCard {
+      position: relative;
+      .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;
+      }
+    }
+  }
+  .paginationDiv {
+    position: absolute;
+    right: 30px;
+    bottom: 15px;
+    padding: 3px;
+  }
+}
+</style>

+ 2 - 1
src/pages/personal/components/Homework/live/components/StudentWork.vue

@@ -65,6 +65,7 @@ export default {
       total: 0,
     }
   },
+  props: ["workType"],
   methods: {
     //年级
     initGradeData() {
@@ -129,7 +130,7 @@ export default {
       })
     },
     lookDetail(id) {
-      this.$router.push({ name: "personal_homework_wlzb_worklist", params: { id } });
+      this.$router.push({ name: "personal_homework_wlzb_worklist", params: { workType: this.workType, id } });
     }
   },
   created() {

+ 23 - 6
src/pages/personal/components/Homework/live/index.vue

@@ -4,11 +4,11 @@
     <el-card>
       <div style="padding: 0 75px;">
         <span class="title">创建作业</span>
-        <span class="subTitle">作业 - 网络直播 - <span style="color: #000;">创建作业</span></span>
+        <span class="subTitle">作业 - {{workTypeName}} - <span style="color: #000;">创建作业</span></span>
       </div>
     </el-card>
 
-    <el-card>
+    <el-card class="contentCard">
       <div class="searchDiv">
         <div class="switch">
           <div class="switchDiv">
@@ -27,8 +27,9 @@
       </div>
 
       <div style="min-height: 350px;">
-        <create-work ref="createWork" v-if="activeSwitch==0"></create-work>
-        <student-work ref="studentWork" v-if="activeSwitch==1"></student-work>
+        <create-work ref="createWork" :workType="workType" v-if="activeSwitch==0"></create-work>
+        <student-work ref="studentWork" :workType="workType" v-if="activeSwitch==1 && workType==1"></student-work>
+        <kczy-student-work ref="studentWork" :workType="workType" v-if="activeSwitch==1 && workType==2"></kczy-student-work>
       </div>
     </el-card>
   </div>
@@ -37,15 +38,18 @@
 <script>
 import CreateWork from "./components/CreateWork.vue";
 import StudentWork from "./components/StudentWork.vue";
+import KczyStudentWork from "./components/KczyStudentWork.vue";
 export default {
   data() {
     return {
+      workType: "",
+      workTypeName: "",
       switchData: ["创建作业", "学生作业"],
       activeSwitch: 0,
       searchKey: "",
     }
   },
-  components: { CreateWork, StudentWork },
+  components: { CreateWork, StudentWork, KczyStudentWork },
   methods: {
     initSwitch(index) {
       this.activeSwitch = index;
@@ -59,7 +63,15 @@ export default {
       }
     },
     handleCreate() {
-      this.$router.push({ name: "personal_homework_wlzb_work" });
+      this.$router.push({ name: "personal_homework_wlzb_work", params: { workType: this.workType } });
+    }
+  },
+  created() {
+    this.workType = this.$route.params.workType || "";
+    if (this.workType == 1) {
+      this.workTypeName = "网络直播";
+    } else if (this.workType == 2) {
+      this.workTypeName = "课程资源";
     }
   }
 }
@@ -71,6 +83,11 @@ export default {
     margin-bottom: 15px;
     background: #fff;
   }
+  .contentCard::v-deep {
+    .el-card__body {
+      padding-bottom: 50px;
+    }
+  }
   .pointer {
     cursor: pointer;
   }

+ 95 - 42
src/pages/personal/components/Homework/live/work.vue

@@ -89,6 +89,7 @@ export default {
   data() {
     return {
       loading: false,
+      workType: "1",
       operateId: "",
       isLook: "",
       problemTypeData: ["单选题", "多选题", "判断题"],
@@ -109,19 +110,35 @@ export default {
   methods: {
     initDetailInfo() {
       this.loading = true;
-      request({
-        url: '/yzy/zy_zbkc/detail',
-        data: {
-          yzz_id: this.operateId
-        }
-      }).then(res => {
-        if (res.code == 1) {
-          let data = res.data.one_info;
-          this.problemName = data.yzz_name;
-          this.problemData = JSON.parse(data.yzz_content_json);
-          this.loading = false;
-        }
-      })
+      if (this.workType == 1) {
+        request({
+          url: '/yzy/zy_zbkc/detail',
+          data: {
+            yzz_id: this.operateId
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            let data = res.data.one_info;
+            this.problemName = data.yzz_name;
+            this.problemData = JSON.parse(data.yzz_content_json);
+            this.loading = false;
+          }
+        })
+      } else if (this.workType == 2) {
+        request({
+          url: '/yzy/zy_kczy/detail',
+          data: {
+            yzk_id: this.operateId
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            let data = res.data.one_info;
+            this.problemName = data.yzk_name;
+            this.problemData = JSON.parse(data.yzk_content_json);
+            this.loading = false;
+          }
+        })
+      }
     },
     handleAdd(type) {
       this.problemType = type;
@@ -174,41 +191,77 @@ export default {
         }
       })
       this.commitLoading = true;
-      if (this.operateId == "") {
-        request({
-          url: '/yzy/zy_zbkc/add',
-          data: {
-            yzy_zy_zbkc: {
-              yzz_name: this.problemName,
-              yzz_content_json: JSON.stringify(this.problemData)
+      if (this.workType == 1) {
+        if (this.operateId == "") {
+          request({
+            url: '/yzy/zy_zbkc/add',
+            data: {
+              yzy_zy_zbkc: {
+                yzz_name: this.problemName,
+                yzz_content_json: JSON.stringify(this.problemData)
+              }
             }
-          }
-        }).then(res => {
-          if (res.code == 1) {
-            this.$message.success("保存成功!");
-            this.$router.go(-1);
-          }
-        })
-      } else {
-        request({
-          url: '/yzy/zy_zbkc/edit',
-          data: {
-            yzz_id: this.operateId,
-            yzy_zy_zbkc: {
-              yzz_name: this.problemName,
-              yzz_content_json: JSON.stringify(this.problemData)
+          }).then(res => {
+            if (res.code == 1) {
+              this.$message.success("保存成功!");
+              this.$router.go(-1);
             }
-          }
-        }).then(res => {
-          if (res.code == 1) {
-            this.$message.success("保存成功!");
-            this.$router.go(-1);
-          }
-        })
+          })
+        } else {
+          request({
+            url: '/yzy/zy_zbkc/edit',
+            data: {
+              yzz_id: this.operateId,
+              yzy_zy_zbkc: {
+                yzz_name: this.problemName,
+                yzz_content_json: JSON.stringify(this.problemData)
+              }
+            }
+          }).then(res => {
+            if (res.code == 1) {
+              this.$message.success("保存成功!");
+              this.$router.go(-1);
+            }
+          })
+        }
+      } else if (this.workType == 2) {
+        if (this.operateId == "") {
+          request({
+            url: '/yzy/zy_kczy/add',
+            data: {
+              yzy_zy_kczy: {
+                yzk_name: this.problemName,
+                yzk_content_json: JSON.stringify(this.problemData)
+              }
+            }
+          }).then(res => {
+            if (res.code == 1) {
+              this.$message.success("保存成功!");
+              this.$router.go(-1);
+            }
+          })
+        } else {
+          request({
+            url: '/yzy/zy_kczy/edit',
+            data: {
+              yzk_id: this.operateId,
+              yzy_zy_kczy: {
+                yzk_name: this.problemName,
+                yzk_content_json: JSON.stringify(this.problemData)
+              }
+            }
+          }).then(res => {
+            if (res.code == 1) {
+              this.$message.success("保存成功!");
+              this.$router.go(-1);
+            }
+          })
+        }
       }
     }
   },
   created() {
+    this.workType = this.$route.params.workType;
     this.isLook = this.$route.query.isLook;
     this.operateId = this.$route.query.id || "";
     if (this.operateId != "") {

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

@@ -37,6 +37,7 @@ export default {
   data() {
     return {
       loading: false,
+      workType: "",
       operateId: "",
       userName: "",
       problemName: "",
@@ -46,29 +47,34 @@ export default {
   },
   methods: {
     initData() {
-      this.loading = true;
-      request({
-        url: '/yzy/zy_zbkc_xfjl/detail',
-        data: {
-          yzzx_id: this.operateId
-        }
-      }).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) {
-            this.problemData = JSON.parse(data.yzzx_content_json);
-          } else {
-            this.problemData = [];
+      if (this.workType == 1) {
+        this.loading = true;
+        request({
+          url: '/yzy/zy_zbkc_xfjl/detail',
+          data: {
+            yzzx_id: this.operateId
           }
-          this.loading = false;
-        }
-      })
+        }).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) {
+              this.problemData = JSON.parse(data.yzzx_content_json);
+            } else {
+              this.problemData = [];
+            }
+            this.loading = false;
+          }
+        })
+      } else if (this.workType == 2) {
+
+      }
     }
   },
   created() {
+    this.workType = this.$route.params.workType;
     this.operateId = this.$route.params.id || "";
     if (this.operateId != "") {
       this.initData();

+ 21 - 15
src/pages/personal/components/Homework/live/worklist.vue

@@ -35,6 +35,7 @@ export default {
   data() {
     return {
       loading: false,
+      workType: "",
       searchKey: "",
       resultData: [
         {
@@ -52,26 +53,31 @@ export default {
   },
   methods: {
     initData() {
-      this.loading = true;
-      request({
-        url: '/yzy/zy_zbkc_xfjl/index',
-        data: {
-          keyword: this.searchKey,
-          kz_id: this.operateId,
-          yzzx_status: 1,
-        }
-      }).then(res => {
-        if (res.code == 1) {
-          this.resultData = res.data.page_data;
-          this.loading = false;
-        }
-      })
+      if (this.workType == 1) {
+        this.loading = true;
+        request({
+          url: '/yzy/zy_zbkc_xfjl/index',
+          data: {
+            keyword: this.searchKey,
+            kz_id: this.operateId,
+            yzzx_status: 1,
+          }
+        }).then(res => {
+          if (res.code == 1) {
+            this.resultData = res.data.page_data;
+            this.loading = false;
+          }
+        })
+      } else if (this.workType == 2) {
+
+      }
     },
     lookDetail(id) {
-      this.$router.push({ name: "personal_homework_wlzb_workdetail", params: { id } });
+      this.$router.push({ name: "personal_homework_wlzb_workdetail", params: { workType: this.workType, id } });
     },
   },
   created() {
+    this.workType = this.$route.params.workType;
     this.operateId = this.$route.params.id || "";
     if (this.operateId != "") {
       this.initData();

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

@@ -55,6 +55,11 @@
           <el-form-item label="资源名称" prop="kf_name">
             <el-input v-model="formline.kf_name" />
           </el-form-item>
+          <el-form-item label="关联的作业">
+            <el-select v-model="linkWork" multiple placeholder=" " size="large">
+              <el-option v-for="item in workData" :key="item.yzk_id" :label="item.yzk_name" :value="item.yzk_id" />
+            </el-select>
+          </el-form-item>
           <el-form-item v-if="editId==''">
             <el-checkbox class="read" v-model="isRead" label="已阅读并同意《课程上传协议》" size="large" />
           </el-form-item>
@@ -84,10 +89,13 @@ export default {
         kf_img: "",
         kf_path: "",
         kf_name: "",
+        yzk_id: "",
       },
       rules: {
         kf_name: [{ required: true, message: '请输入资源名称', trigger: 'blur' }],
       },
+      workData: [],
+      linkWork: [],
       imageData: [],
       fileList: [],
       mainFileData: ["png", "jpg", "jpeg"],
@@ -129,6 +137,9 @@ export default {
               url: getFullUrl(this.formline.kf_path)
             }]
           }
+          if (this.formline.yzk_id != "") {
+            this.linkWork = this.formline.yzk_id.split(",");
+          }
           this.loading = false;
         }
       });
@@ -210,9 +221,20 @@ export default {
         url: getFullUrl(this.formline.kf_img)
       }]
     },
+    initWorkData() {
+      request({
+        url: '/yzy/zy_kczy/index',
+        data: {}
+      }).then(res => {
+        if (res.code == 1) {
+          this.workData = res.data.page_data;
+        }
+      })
+    },
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid && this.formline.kf_img != "" && this.formline.kf_path != "" && !this.attachLoading) {
+          this.formline.yzk_id = this.linkWork.join(",");
           this.formline.kk_id = this.parentId;
           let data = {
             kczy_files: this.formline
@@ -254,6 +276,8 @@ export default {
     }
   },
   created() {
+    this.initWorkData();
+
     this.parentId = this.$route.query.parentId;
     this.editId = this.$route.query.id || "";
     if (this.editId != "") {

+ 103 - 103
src/router/index.js

@@ -101,47 +101,47 @@ export default createRouter({
       component: () => import('~/pages/ysgc/zpDetail/index.vue')
     },
 
-		{
-			path: '/ysgc',
-			name: 'ysgc',
-			component: () => import("~/pages/ysgc/index.vue"),
-		},
-		// {
-		// 	path: '/ysgc_detail',
-		// 	name: 'ysgc_detail',
-		// 	component: () => import('~/pages/ysgc/ysgc_detail/index.vue')
-		// },
-		{
-			path: '/szmsg',
-			children: [
-				{
-					path: '',
-					name: 'szmsg',
-					component: () => import("~/pages/szmsg/index.vue"),
-				},
-				{
-					path: 'tzkc',
-					children: [
-						{
-							path: '',
-							name: 'szmsg_tzkc',
-							component: () => import('~/pages/szmsg/tzkc/index.vue'),
-						},
-						{
-							path: 'detail/:id',
-							name: 'szmsg_tzkc_detail',
-							component: () => import('~/pages/szmsg/tzkc/detail/index.vue'),
-							props: true
-						}
-					],
-				},
-				{
-					path: '/yslm',
-					name: 'szmsg_yslm',
-					component: () => import('~/pages/szmsg/yslm/index.vue')
-				},
-			],
-		},
+    {
+      path: '/ysgc',
+      name: 'ysgc',
+      component: () => import("~/pages/ysgc/index.vue"),
+    },
+    // {
+    // 	path: '/ysgc_detail',
+    // 	name: 'ysgc_detail',
+    // 	component: () => import('~/pages/ysgc/ysgc_detail/index.vue')
+    // },
+    {
+      path: '/szmsg',
+      children: [
+        {
+          path: '',
+          name: 'szmsg',
+          component: () => import("~/pages/szmsg/index.vue"),
+        },
+        {
+          path: 'tzkc',
+          children: [
+            {
+              path: '',
+              name: 'szmsg_tzkc',
+              component: () => import('~/pages/szmsg/tzkc/index.vue'),
+            },
+            {
+              path: 'detail/:id',
+              name: 'szmsg_tzkc_detail',
+              component: () => import('~/pages/szmsg/tzkc/detail/index.vue'),
+              props: true
+            }
+          ],
+        },
+        {
+          path: '/yslm',
+          name: 'szmsg_yslm',
+          component: () => import('~/pages/szmsg/yslm/index.vue')
+        },
+      ],
+    },
 
     {
       path: '/resource',
@@ -436,22 +436,22 @@ export default createRouter({
               path: 'wlzb',
               children: [
                 {
-                  path: '',
+                  path: 'wlzb_workTab/:workType',
                   name: 'personal_homework_wlzb',
                   component: () => import("~/pages/personal/components/Homework/live/index.vue"),
                 },
                 {
-                  path: 'wlzb_work',
+                  path: 'wlzb_work/:workType',
                   name: 'personal_homework_wlzb_work',
                   component: () => import("~/pages/personal/components/Homework/live/work.vue"),
                 },
                 {
-                  path: 'wlzb_worklist/:id',
+                  path: 'wlzb_worklist/:workType/:id',
                   name: 'personal_homework_wlzb_worklist',
                   component: () => import("~/pages/personal/components/Homework/live/worklist.vue"),
                 },
                 {
-                  path: 'wlzb_workdetail/:id',
+                  path: 'wlzb_workdetail/:workType/:id',
                   name: 'personal_homework_wlzb_workdetail',
                   component: () => import("~/pages/personal/components/Homework/live/workdetail.vue"),
                 }
@@ -467,61 +467,61 @@ export default createRouter({
         },
         {
 
-					path: 'wlzb',
-					children: [
-						{
-							path: '',
-							name: 'personal_create_wlzb',
-							component: () => import("~/pages/personal/components/MyCourse/wlzb/index.vue"),
-						},
-						{
-							path: 'add',
-							name: 'personal_create_wlzb_add',
-							component: () => import("~/pages/personal/components/MyCourse/wlzb/edit.vue"),
-						},
-						{
-							path: 'edit/:id',
-							name: 'personal_create_wlzb_edit',
-							props: true,
-							component: () => import("~/pages/personal/components/MyCourse/wlzb/edit.vue"),
-						},
-						{
-							path: 'kcdg/:id',
-							children: [
-								{
-									path: '',
-									name: 'personal_create_wlzb_kcdg',
-									props: true,
-									component: () => import("~/pages/personal/components/MyCourse/wlzb/kcdg.vue"),
-								},
-								{
-									path: 'add',
-									name: 'personal_create_wlzb_kcdg_add',
-									props: true,
-									component: () => import("~/pages/personal/components/MyCourse/wlzb/kcdg_edit.vue"),
-								},
-								{
-									path: 'edit/:bid',
-									name: 'personal_create_wlzb_kcdg_edit',
-									props: true,
-									component: () => import("~/pages/personal/components/MyCourse/wlzb/kcdg_edit.vue"),
-								},
-							]
+          path: 'wlzb',
+          children: [
+            {
+              path: '',
+              name: 'personal_create_wlzb',
+              component: () => import("~/pages/personal/components/MyCourse/wlzb/index.vue"),
+            },
+            {
+              path: 'add',
+              name: 'personal_create_wlzb_add',
+              component: () => import("~/pages/personal/components/MyCourse/wlzb/edit.vue"),
+            },
+            {
+              path: 'edit/:id',
+              name: 'personal_create_wlzb_edit',
+              props: true,
+              component: () => import("~/pages/personal/components/MyCourse/wlzb/edit.vue"),
+            },
+            {
+              path: 'kcdg/:id',
+              children: [
+                {
+                  path: '',
+                  name: 'personal_create_wlzb_kcdg',
+                  props: true,
+                  component: () => import("~/pages/personal/components/MyCourse/wlzb/kcdg.vue"),
+                },
+                {
+                  path: 'add',
+                  name: 'personal_create_wlzb_kcdg_add',
+                  props: true,
+                  component: () => import("~/pages/personal/components/MyCourse/wlzb/kcdg_edit.vue"),
+                },
+                {
+                  path: 'edit/:bid',
+                  name: 'personal_create_wlzb_kcdg_edit',
+                  props: true,
+                  component: () => import("~/pages/personal/components/MyCourse/wlzb/kcdg_edit.vue"),
+                },
+              ]
 
-						},
-					]
-				},
-				{
-					path: 'credits',
-					name: 'credits',
-					title: '我的积分',
-					component: () => import("~/pages/personal/components/Credits/index.vue"),
-				},
-				{
-					path: 'masterTeacher',
-					name: 'masterTeacher',
-					title: '申请成为名师',
-					component: () => import("~/pages/personal/components/MasterTeacher/index.vue"),
+            },
+          ]
+        },
+        {
+          path: 'credits',
+          name: 'credits',
+          title: '我的积分',
+          component: () => import("~/pages/personal/components/Credits/index.vue"),
+        },
+        {
+          path: 'masterTeacher',
+          name: 'masterTeacher',
+          title: '申请成为名师',
+          component: () => import("~/pages/personal/components/MasterTeacher/index.vue"),
 
         },
         {
@@ -637,11 +637,11 @@ export default createRouter({
           title: '作业详情',
           component: () => import("~/pages/personalStudent/components/xs-homework/kczy/zyxq.vue"),
 
-				},
-			]
-		},
+        },
+      ]
+    },
 
-	]
+  ]
 
 
 })