zengyicheng 2 лет назад
Родитель
Сommit
5bab1a8c3b

+ 1 - 1
dist/index.html

@@ -25,4 +25,4 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.8b551a1a722d1c4514a8cbeb984500f0.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.fed1de90e0941b3846db.js></script><script type=text/javascript src=./static/js/vendor.fab7effc7bf6d4290017.js></script><script type=text/javascript src=./static/js/app.074db39c08ace06176e3.js></script></body></html>
+    }</style><link href=./static/css/app.7025d703645a9df023746a3580b19fd8.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.fed1de90e0941b3846db.js></script><script type=text/javascript src=./static/js/vendor.fab7effc7bf6d4290017.js></script><script type=text/javascript src=./static/js/app.877187f63f08c5e8f9aa.js></script></body></html>

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/app.7025d703645a9df023746a3580b19fd8.css


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/app.7025d703645a9df023746a3580b19fd8.css.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/css/app.8b551a1a722d1c4514a8cbeb984500f0.css.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/app.074db39c08ace06176e3.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/app.074db39c08ace06176e3.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/app.877187f63f08c5e8f9aa.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/app.877187f63f08c5e8f9aa.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/static/js/manifest.fed1de90e0941b3846db.js.map


+ 117 - 9
src/components/pages/addCourse.vue

@@ -128,7 +128,29 @@
                       />
                     </div>
                   </div>
-                  <div style="margin-top: 30px">
+                  <div class="choose">
+                    <div
+                      class="all_choose"
+                      v-for="(item, index) in CourseType[0]"
+                      :key="index"
+                    >
+                      <span>{{ item.name }}</span>
+                      <el-select
+                        v-model="courseTypeId[item.id]"
+                        placeholder="请选择"
+                        @change="getTypeName"
+                      >
+                        <el-option
+                          v-for="item1 in CourseTypeJson[item.id]"
+                          :key="item1.id"
+                          :label="item1.name"
+                          :value="item1.id"
+                        >
+                        </el-option>
+                      </el-select>
+                    </div>
+                  </div>
+                  <div>
                     <div class="bInfo_title">
                       <span style="color: red">*</span>简要描述
                     </div>
@@ -144,12 +166,12 @@
                   <el-switch
                     v-model="isTeacherSee"
                     active-text="允许给其他老师查看"
-                    style="margin: 40px 0 0 25px"
+                    style="margin: 40px 0 0 25px; padding-bottom: 30px"
                   >
                   </el-switch>
                 </div>
                 <div class="right_first">
-                  <div>
+                  <div style="margin-top: 25px">
                     <div style="flex: 0.5 1 0%; margin: 0 20px 0 0">
                       <div class="bInfo_title">
                         <span style="color: red">*</span>课程封面
@@ -1069,6 +1091,10 @@ export default {
       tdetail: "",
       templateC: {},
       cTemplate: "",
+      CourseType: [],
+      CourseTypeJson: {},
+      courseTypeId: {},
+      courseTypeSon: [],
     };
   },
   computed: {
@@ -1150,6 +1176,16 @@ export default {
           this.cover.length != 0 &&
           this.checkboxList.length != 0
         ) {
+          for (var i = 0; i < this.CourseType[0].length; i++) {
+            if (this.courseTypeId[this.CourseType[0][i].id] != "") {
+              this.courseTypeSon.push(
+                this.courseTypeId[this.CourseType[0][i].id]
+              );
+            } else {
+              this.$message.error("请选择分类");
+              return;
+            }
+          }
           this.steps = 2;
         } else {
           this.$message.error("请将信息填写完整");
@@ -1174,6 +1210,16 @@ export default {
           this.cover.length != 0 &&
           this.checkboxList.length != 0
         ) {
+          for (var i = 0; i < this.CourseType[0].length; i++) {
+            if (this.courseTypeId[this.CourseType[0][i].id] != "") {
+              this.courseTypeSon.push(
+                this.courseTypeId[this.CourseType[0][i].id]
+              );
+            } else {
+              this.$message.error("请选择分类");
+              return;
+            }
+          }
           this.steps++;
         } else {
           this.$message.error("请将信息填写完整");
@@ -1550,16 +1596,18 @@ export default {
           see: this.isTeacherSee == true ? 0 : 1,
           chapters: JSON.stringify(this.unitJson),
           template: this.cTemplate,
+          courseType: JSON.stringify(this.courseTypeSon),
         },
       ];
       this.ajax
-        .post(this.$store.state.api + "addWork", params)
+        // .post(this.$store.state.api + "addWork", params)
+        .post(this.$store.state.api + "addWorkNew", params)
         .then((res) => {
           this.$message({
             message: "新增成功",
             type: "success",
           });
-          this.number = res.data[0][0].ordernumber;
+          this.number = res.data.ordernumber;
           this.islogin = true;
         })
         .catch((err) => {
@@ -1581,10 +1629,12 @@ export default {
           see: this.isTeacherSee == true ? 0 : 1,
           chapters: JSON.stringify(this.unitJson),
           template: this.myWord,
+          uid: this.userid,
+          courseType: JSON.stringify(this.courseTypeSon),
         },
       ];
       this.ajax
-        .post(this.$store.state.api + "updateWork", params)
+        .post(this.$store.state.api + "updateWorkNew", params)
         .then((res) => {
           this.$message({
             message: "修改成功",
@@ -1848,7 +1898,7 @@ export default {
                   : [];
               }
             }
-            this.unitJson[0].dyText = "";
+            // this.unitJson[0].dyText = "";
             this.courseName = res.data[0][0].title;
             this.courseText = res.data[0][0].brief;
             this.checkboxList = JSON.parse(res.data[0][0].course_student);
@@ -1859,17 +1909,52 @@ export default {
             this.myWord = res.data[0][0].template;
             this.templateC.id = "123";
             this.nbOrder = res.data[0][0].ordernumber;
+            this.CourseType[0] = res.data[1];
+            // this.selectType();
+            for(var i =0;i<this.CourseType[0].length;i++){
+              this.courseTypeId[this.CourseType[0][i].typePid] = this.CourseType[0][i].typeid;
+            }
+            console.log(this.courseTypeId);
+            this.$forceUpdate();
           })
           .catch((err) => {
             console.error(err);
           });
       }
     },
+    getTypeName() {
+      console.log(this.courseTypeId);
+      this.$forceUpdate();
+    },
+    selectType() {
+      this.ajax
+        .get(this.$store.state.api + "selectType")
+        .then((res) => {
+          this.CourseType = res.data;
+          for (var i = 0; i < res.data[0].length; i++) {
+            if(!this.cid){
+              this.courseTypeId[res.data[0][i].id] = "";
+            }
+            for (var j = 0; j < res.data[1].length; j++) {
+              if (res.data[0][i].id == res.data[1][j].pid) {
+                if (!this.CourseTypeJson[res.data[0][i].id]) {
+                  this.CourseTypeJson[res.data[0][i].id] = [];
+                }
+                this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
+              }
+            }
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
   },
   created() {
     this.selectCourseDetail();
     this.getStudent();
     this.getTemplate();
+    this.selectType();
   },
 };
 </script>
@@ -1891,7 +1976,8 @@ export default {
 .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
   color: #fff;
 }
-.dialog_diy >>> .el-dialog__body,.dialog_diy >>> .el-dialog__footer {
+.dialog_diy >>> .el-dialog__body,
+.dialog_diy >>> .el-dialog__footer {
   background: #fafafa;
 }
 .left {
@@ -1958,7 +2044,6 @@ export default {
 .right {
   height: 100%;
   width: 100%;
-  overflow: auto;
 }
 
 .basic_box {
@@ -2960,4 +3045,27 @@ ol {
   justify-content: center;
   flex-direction: column;
 }
+.all_choose {
+  margin: 15px 0;
+  height: 20%;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+.all_choose > span {
+  width: 50px;
+  display: block;
+}
+.all_choose >>> .el-select {
+  margin: 0 0 0 20px;
+}
+.choose {
+  display: flex;
+  flex-direction: column;
+  flex-wrap: wrap;
+  align-content: space-between;
+  height: 100%;
+  justify-content: flex-start;
+  align-items: center;
+}
 </style>

+ 173 - 39
src/components/pages/course.vue

@@ -13,22 +13,49 @@
     </div>
     <div class="pb_content_body">
       <div class="student_head">
-        <div class="student_search">
-          <span>课程筛选</span>
-          <el-select v-model="groupA" @change="search">
-            <el-option value="0" label="我的课程"></el-option>
-            <el-option value="1" label="他人课程"></el-option>
-          </el-select>
-        </div>
-        <div class="head_left">
-          <el-input
-            v-model="courseName"
-            class="student_input"
-            placeholder="请输入课程名称"
-          ></el-input>
-          <el-button class="course_button" @click="searchCourse"
-            >查询</el-button
+        <div class="choose">
+          <div class="student_search">
+            <span>课程筛选</span>
+            <el-select v-model="groupA" @change="search">
+              <el-option value="0" label="我的课程"></el-option>
+              <el-option value="1" label="他人课程"></el-option>
+            </el-select>
+          </div>
+          <div
+            class="all_choose"
+            v-for="(item, index) in CourseType[0]"
+            :key="index"
           >
+            <span>{{ item.name }}</span>
+            <el-select
+              v-model="courseTypeId[item.id]"
+              placeholder="请选择"
+              @change="getTypeName"
+            >
+              <el-option label="全部" value="1">全部</el-option>
+              <el-option
+                v-for="item1 in CourseTypeJson[item.id]"
+                :key="item1.id"
+                :label="item1.name"
+                :value="item1.id"
+              >
+              </el-option>
+            </el-select>
+          </div>
+          <div @click="clear" class="clear">重置</div>
+        </div>
+        
+        <div class="student_right">
+          <div class="head_left">
+            <el-input
+              v-model="courseName"
+              class="student_input"
+              placeholder="请输入课程名称"
+            ></el-input>
+            <el-button class="course_button" @click="searchCourse"
+              >查询</el-button
+            >
+          </div>
         </div>
       </div>
       <div class="student_table">
@@ -142,8 +169,13 @@ export default {
       groupA: "0",
       classX: "",
       course: [],
-      courseName:"",
+      courseName: "",
       mr: require("../../assets/icon/kc1.png"),
+      CourseType: [],
+      CourseTypeJson: {},
+      courseTypeId: {},
+      courseTypeSon: [],
+      isChoose: 0,
     };
   },
   methods: {
@@ -242,53 +274,93 @@ export default {
         }
       }
     },
-    searchCourse(){
+    searchCourse() {
       this.page = 1;
-      this.searchCourse();
+      this.getCourse();
+    },
+    clear() {
+      for (var i = 0; i < this.CourseType[0].length; i++) {
+        this.courseTypeId[this.CourseType[0][i].id] = "";
+      }
+      this.getCourse();
     },
     getCourse() {
       const loading = this.openLoading(
         document.querySelector(".student_table")
       );
+      var typeE = [];
+      var typea, typeb, typec, typed;
+      if (this.isChoose == 1) {
+        for (var i = 0; i < this.CourseType[0].length; i++) {
+          if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
+            typeE.push(this.CourseType[0][i].id);
+          } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
+            if (this.CourseType[0][i].name == "年级") {
+              typea = this.courseTypeId[this.CourseType[0][i].id];
+            } else if (this.CourseType[0][i].name == "专栏") {
+              typeb = this.courseTypeId[this.CourseType[0][i].id];
+            } else if (this.CourseType[0][i].name == "新技能") {
+              typec = this.courseTypeId[this.CourseType[0][i].id];
+            } else if (this.CourseType[0][i].name == "学科") {
+              typed = this.courseTypeId[this.CourseType[0][i].id];
+            }
+            this.courseTypeSon.push(
+              this.courseTypeId[this.CourseType[0][i].id]
+            );
+          }
+        }
+      }
       this.isLoading = true;
       let params = {
         type: this.groupA,
         uid: this.userid,
         oid: this.oid,
-        page: this.page,
-      };
-      this.ajax
-        .get(this.$store.state.api + "selectCourse", params)
-        .then((res) => {
-          loading.close();
-          this.isLoading = false;
-          this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
-          this.course = res.data[0];
-          console.log(res.data);
-        })
-        .catch((err) => {
-          console.error(err);
-        });
-    },
-    searchCourse(){
-      this.isLoading = true;
-      let params = {
+        typea: typea != undefined ? typea : "",
+        typeb: typeb != undefined ? typeb : "",
+        typec: typec != undefined ? typec : "",
+        typed: typed != undefined ? typed : "",
+        typeE: typeE.join(","),
         cu: "",
         cn: this.courseName,
         page: this.page,
       };
       this.ajax
-        .get(this.$store.state.api + "searchCourse", params)
+        .get(this.$store.state.api + "selectCourseNew", params)
         .then((res) => {
+          loading.close();
           this.isLoading = false;
           this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
           this.course = res.data[0];
         })
         .catch((err) => {
-          this.isLoading = false;
           console.error(err);
         });
     },
+    getTypeName() {
+      this.$forceUpdate();
+      this.page = 1;
+      this.isChoose = 1;
+      this.getCourse();
+    },
+    // searchCourse() {
+    //   this.isLoading = true;
+    //   let params = {
+    //     cu: "",
+    //     cn: this.courseName,
+    //     page: this.page,
+    //   };
+    //   this.ajax
+    //     .get(this.$store.state.api + "searchCourse", params)
+    //     .then((res) => {
+    //       this.isLoading = false;
+    //       this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
+    //       this.course = res.data[0];
+    //     })
+    //     .catch((err) => {
+    //       this.isLoading = false;
+    //       console.error(err);
+    //     });
+    // },
     deleteCourse(cid) {
       const loading = this.openLoading(
         document.querySelector(".student_table")
@@ -309,6 +381,29 @@ export default {
           console.error(err);
         });
     },
+    selectType() {
+      this.ajax
+        .get(this.$store.state.api + "selectType")
+        .then((res) => {
+          this.CourseType = res.data;
+          for (var i = 0; i < res.data[0].length; i++) {
+            if (!this.cid) {
+              this.courseTypeId[res.data[0][i].id] = "";
+            }
+            for (var j = 0; j < res.data[1].length; j++) {
+              if (res.data[0][i].id == res.data[1][j].pid) {
+                if (!this.CourseTypeJson[res.data[0][i].id]) {
+                  this.CourseTypeJson[res.data[0][i].id] = [];
+                }
+                this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
+              }
+            }
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     search() {
       this.page = 1;
       this.getCourse();
@@ -316,6 +411,7 @@ export default {
   },
   created() {
     this.page = 1;
+    this.selectType();
     this.getCourse();
   },
 };
@@ -351,6 +447,9 @@ export default {
 .student_head {
   display: flex;
   justify-content: space-between;
+  align-items: baseline;
+  flex-direction: row;
+  flex-wrap: nowrap;
 }
 
 .top {
@@ -365,7 +464,7 @@ export default {
 .student_search {
   display: flex;
   align-items: center;
-  width: 300px;
+  width: calc(100% / 3);
 }
 .student_search span {
   margin: 0 10px 0 0;
@@ -592,4 +691,39 @@ export default {
   font-size: 12px;
   line-height: 40px;
 }
+.all_choose {
+  margin: 15px 0 10px;
+  height: 20%;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  width: calc(100% / 3);
+}
+.all_choose > span {
+  width: 73px;
+  display: block;
+}
+/* .all_choose >>> .el-select {
+  margin: 0 0 0 20px;
+} */
+.choose {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  align-content: space-between;
+  height: 100%;
+  justify-content: flex-start;
+  width: 55%;
+  align-items: center;
+}
+.clear {
+  width: 70px;
+  height: 35px;
+  background: #2268bc;
+  color: #fff;
+  text-align: center;
+  border-radius: 5px;
+  line-height: 35px;
+  cursor: pointer;
+}
 </style>

+ 16 - 8
src/components/pages/note.vue

@@ -22,10 +22,12 @@
       </div>
       <div class="noteList">
         <div class="noteBg" v-for="(item, index) in noteList" :key="index">
+          <!-- @change="saveNote(item.nid, item.content,type = 1)"  边写边保存 @blur点击旁边保存-->
           <el-input
             type="textarea"
             autosize
             v-model="item.content"
+            @blur="saveNote(item.nid, item.content, (type = 1))"
             resize="none"
           >
           </el-input>
@@ -69,6 +71,7 @@ export default {
       noteContent: "",
       noteList: [],
       isNone: 0,
+      type: 0,
     };
   },
   methods: {
@@ -83,14 +86,17 @@ export default {
         .get(this.$store.state.api + "selectNote", params)
         .then((res) => {
           this.noteList = res.data[0];
+          if (this.noteList.length == 0) {
+            this.addNote();
+          }
         })
         .catch((err) => {
           this.isLoading = false;
           console.error(err);
         });
     },
-    selectContent(){
-        let params = {
+    selectContent() {
+      let params = {
         cn: this.noteC,
       };
       this.ajax
@@ -122,7 +128,7 @@ export default {
           console.error(err);
         });
     },
-    saveNote(nid, c) {
+    saveNote(nid, c, type) {
       let params = {
         nid: nid,
         c: c,
@@ -130,10 +136,12 @@ export default {
       this.ajax
         .get(this.$store.state.api + "updateNote", params)
         .then((res) => {
-          this.$message({
-            message: "修改成功",
-            type: "success",
-          });
+          if (type == 0) {
+            this.$message({
+              message: "修改成功",
+              type: "success",
+            });
+          }
           this.getNote();
         })
         .catch((err) => {
@@ -259,7 +267,6 @@ export default {
   width: 1.5rem;
 }
 .noneDiv {
-  width: 500px;
   height: 100%;
   background: transparent;
   position: absolute;
@@ -267,6 +274,7 @@ export default {
   left: 50%;
   transform: translate(-50%, 0);
   z-index: 9;
+  width: 100%;
 }
 .first > div:nth-child(2) {
   margin-left: 5px;

Некоторые файлы не были показаны из-за большого количества измененных файлов