zengyicheng 3 years ago
parent
commit
a35201ca7a

+ 1 - 1
dist/index.html

@@ -25,4 +25,4 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.21046ee9c8277f4c78d78ffbe8c37642.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3b33e268f4f77bae1f08.js></script><script type=text/javascript src=./static/js/vendor.57c88615aac160d2c474.js></script><script type=text/javascript src=./static/js/app.2db0123c2faf07eb576c.js></script></body></html>
+    }</style><link href=./static/css/app.1cb7b00d8e4d81f6a3caed6931d51b9b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3b33e268f4f77bae1f08.js></script><script type=text/javascript src=./static/js/vendor.57c88615aac160d2c474.js></script><script type=text/javascript src=./static/js/app.fb6b97c3613e2df10773.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.1cb7b00d8e4d81f6a3caed6931d51b9b.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.1cb7b00d8e4d81f6a3caed6931d51b9b.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.21046ee9c8277f4c78d78ffbe8c37642.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.2db0123c2faf07eb576c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.2db0123c2faf07eb576c.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.fb6b97c3613e2df10773.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.fb6b97c3613e2df10773.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3b33e268f4f77bae1f08.js.map


+ 57 - 8
src/components/pages/addCourse.vue

@@ -358,7 +358,7 @@
                       @click="deleteUnit(unitIndex)"
                     ></div>
                   </div>
-                  <div style="margin: 30px 0 20px 0px; font-size: 18px">
+                  <div style="margin: 30px 0 10px; font-size: 18px">
                     阶段描述
                   </div>
                   <div>
@@ -926,6 +926,7 @@ export default {
       checkedCities: [],
       isIndeterminate: true,
       steps: 1,
+	  nbOrder:0,
       courseName: "",
       isTeacherSee: false,
       courseText: "",
@@ -1040,8 +1041,9 @@ export default {
     },
     lastSteps() {
       if (this.steps == 4) {
-        window.location.href =
-          "./course.vue?userid=" + this.userid + "&oid=" + this.oid;
+        // window.location.href =
+        //   "./course.vue?userid=" + this.userid + "&oid=" + this.oid;
+		  this.goTo('/course?userid=' + this.userid + '&oid=' + this.oid);
       } else {
         this.steps--;
       }
@@ -1092,8 +1094,13 @@ export default {
         this.dialogVisible2 = false;
         this.steps++;
       } else if (this.steps == 3) {
-        this.addWork();
-        this.steps++;
+        if (this.cid == "" || this.cid == undefined) {
+          this.addWork();
+          this.steps++;
+        }else{
+			this.updateWork();
+			this.steps++;
+		}
       }
     },
     unitSet(i) {
@@ -1463,6 +1470,36 @@ export default {
           console.error(err);
         });
     },
+	updateWork(){
+		let params = [
+        {
+          cid: this.cid,
+          title: this.courseName,
+          brief: this.courseText.replace(/%/g, "%25"),
+          cover: this.cover.length > 0 ? JSON.stringify(this.cover) : "",
+          astudent:
+            this.checkboxList.length > 0
+              ? JSON.stringify(this.checkboxList)
+              : "",
+          see: this.isTeacherSee == true ? 0 : 1,
+          chapters: JSON.stringify(this.unitJson),
+          template: this.myWord,
+        },
+      ];
+      this.ajax
+        .post(this.$store.state.api + "updateWork", params)
+        .then((res) => {
+          this.$message({
+            message: "修改成功",
+            type: "success",
+          });
+          this.number = this.nbOrder;
+        })
+        .catch((err) => {
+          this.$message.error("修改失败");
+          console.error(err);
+        });
+	},
     guid() {
       var _num,
         i,
@@ -1560,6 +1597,7 @@ export default {
           this.unitJson[this.unitIndex].chapterInfo[0].toolChoose.push(i);
         }
       }
+      this.$forceUpdate();
     },
     selectCourseDetail() {
       if (this.cid == "" || this.cid == undefined) {
@@ -1571,7 +1609,17 @@ export default {
         this.ajax
           .get(this.$store.state.api + "select_course_detail", params)
           .then((res) => {
-            this.unitJson = res.data[0][0];
+            this.unitJson = JSON.parse(res.data[0][0].chapters);
+            // this.unitJson[0].chapterInfo = JSON.parse(res.data[0][0].chapters);
+            for (var j in this.unitJson) {
+              for (var i in this.unitJson[j].chapterInfo) {
+                this.unitJson[j].chapterInfo[i].toolChoose = this.unitJson[j]
+                  .chapterInfo[i].toolChoose
+                  ? this.unitJson[j].chapterInfo[i].toolChoose
+                  : [];
+              }
+            }
+            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);
@@ -1581,6 +1629,7 @@ export default {
               res.data[0][0].is_teacher_look == 0 ? true : false;
             this.myWord = res.data[0][0].template;
             this.templateC.id = "123";
+			this.nbOrder = res.data[0][0].ordernumber;
           })
           .catch((err) => {
             console.error(err);
@@ -2529,9 +2578,9 @@ ol {
   justify-content: flex-start;
 }
 
-.upCss >>> .el-upload {
+/* .upCss >>> .el-upload {
   margin-right: 30px;
-}
+} */
 
 .upCss >>> .el-icon-plus {
   position: none !important;

+ 2 - 2
src/config/config.js

@@ -6,9 +6,9 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
     state: {
         isLogin: false,
-        luyou:1,
+        luyou: 1,
         userInfo: {},
-        nCount:0,
+        nCount: 0,
         api: 'https://pbl.cocorobo.cn/api/pbl/',
         // api: 'http://localhost:7003/api/pbl/',
     },

Some files were not shown because too many files changed in this diff