wolyshaw 4 年之前
父节点
当前提交
d47625a0a2
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 4 1
      src/views/accompaniment/index.vue
  2. 2 2
      src/views/accompaniment/modals/form.vue

+ 4 - 1
src/views/accompaniment/index.vue

@@ -173,7 +173,10 @@ export default {
     },
     title() {
       const t1 = this.detail ? '修改' : '添加'
-      const t2 = this.type === 'COMMON' ? '公用' : '个人'
+      let t2 = this.type === 'COMMON' ? '公用' : '个人'
+      if (this.detail) {
+        t2 = this.detail.type === 'COMMON' ? '公用' : '个人'
+      }
       return t1 + t2 + '伴奏'
     },
   },

+ 2 - 2
src/views/accompaniment/modals/form.vue

@@ -113,14 +113,14 @@ export default {
             await Add({
               ...this.form,
               subjectIds: this.form.subjectIds.join(','),
-              type: this.type,
+              type: 'COMMON',
             })
             this.$message.success('提交成功')
           } else {
             await Update({
               ...this.form,
               subjectIds: this.form.subjectIds.join(','),
-              type: this.type,
+              type: this.detail.type,
               id: this.detail.id
             })
             this.$message.success('修改成功')