Browse Source

key 及上传文件类型

秦鹏 3 years ago
parent
commit
6a42a7c61f

+ 1 - 1
src/components/teacher-dev/ToolBook.vue

@@ -45,7 +45,7 @@ export default {
       this.$router.push({
         path: "/Viewmore",
         query: {
-          classify: "TEXTBOOK",
+          classify: "TOOLBOOK",
         },
       });
     },

+ 8 - 2
src/views/teacher-dev/Viewmore.vue

@@ -240,6 +240,9 @@ export default {
         "Key570",
         "Key571",
         "Key572",
+        "Key214",
+        "Key554",
+        "Key555",
       ],
     });
     this.isData = true;
@@ -262,10 +265,13 @@ export default {
     ];
     if (this.$route.query.classify) {
       if (this.$route.query.classify == "TEXTBOOK") {
-        this.text = this.$t("Key44"); //"教材";
+        this.text = this.$t("Key214"); //"教材";
       }
       if (this.$route.query.classify == "TEACHING") {
-        this.text = this.$t("Key45"); //"教学";
+        this.text = this.$t("Key554"); //"教学";
+      }
+      if(this.$route.query.classify == "TOOLBOOK"){
+        this.text = this.$t("Key555"); //"教学";
       }
       this.tag.push(this.$route.query.classify);
     }

+ 16 - 1
src/views/teacher-devEntering/creadDocument.vue

@@ -215,7 +215,22 @@ export default {
       this.authorList = newauthorList;
     },
     changeFillId(file, fileList) {
-      let fileList1 = JSON.parse(JSON.stringify(fileList));
+      let fileList1 = [];
+      fileList.forEach((item) => {
+        let obj = null;
+        let type = "";
+        let index = item.name.lastIndexOf(".");
+        if (index != -1) {
+          type = item.name.slice(index + 1);
+        }
+        obj = {
+          name: item.name,
+          fileId: item.response?.file_info_list[0]?.file_id,
+          fileType: type,
+        };
+        fileList1.push(obj);
+      });
+      // let fileList1 = JSON.parse(JSON.stringify(fileList));
       this.form.fileList = fileList1;
     },
     // 完成

+ 4 - 1
src/views/teacher-devEntering/index.vue

@@ -249,7 +249,10 @@ export default {
         this.$message.warning(this.$t("Key590"));
         return;
       }
-      if (!item.price || !item.teacher[0]) {
+      if (
+        Object.prototype.toString.call(item.price).indexOf("Number") == -1 ||
+        !item.teacher[0]
+      ) {
         // "请先去完善信息再上架"
         this.$message.warning("请先去完善信息再上架");
         return;