Explorar el Código

学历修改, 增加id, 教育经历传 文字

xinfeng hace 6 años
padre
commit
6fdd2e2bf4
Se han modificado 1 ficheros con 18 adiciones y 12 borrados
  1. 18 12
      components/sign/education.vue

+ 18 - 12
components/sign/education.vue

@@ -59,7 +59,7 @@
                   v-for="educationBackground in educationBackgrounds"
                   :key="educationBackground.value"
                   :label="educationBackground.label"
-                  :value="educationBackground.value"
+                  :value="educationBackground.label"
                 ></el-option>
               </el-select>
               <span class="opts">
@@ -147,16 +147,22 @@ export default {
       if (this.education.length > 10) {
         this.$message.error("最多可添加10项工作经历!");
       }
-      const data = this.education.map(it => ({
-        diploma_photo: it.diploma_photo,
-        diploma_url: it.diploma_url,
-        start_time: it.date[0],
-        end_time: it.date[1],
-        university: it.university,
-        major: it.major,
-        education_background: it.education_background,
-        description: it.description
-      }));
+      const data = this.education.map(it => {
+        let item1 = {
+          diploma_photo: it.diploma_photo,
+          diploma_url: it.diploma_url,
+          start_time: it.date[0],
+          end_time: it.date[1],
+          university: it.university,
+          major: it.major,
+          education_background: it.education_background,
+          description: it.description
+        }
+        if (it.id) {
+          item1.id = it.id
+        }
+        return item1
+      });
       const res = await this.$axios.$post("/api/user_education/save_all", {
         data: JSON.stringify(data)
       });
@@ -187,7 +193,7 @@ export default {
         ...it,
         date: [it.start_time || "", it.end_time || ""]
       }));
-      console.log(education);
+      console.log('education', education);
       this.education = education;
     },
     async getEducationBackground() {