wolyshaw 4 سال پیش
والد
کامیت
42c385b504
3فایلهای تغییر یافته به همراه19 افزوده شده و 15 حذف شده
  1. 8 4
      src/components/singe-file-upload/index.vue
  2. 9 10
      src/views/accompaniment/index.vue
  3. 2 1
      src/views/accompaniment/modals/form.vue

+ 8 - 4
src/components/singe-file-upload/index.vue

@@ -33,10 +33,14 @@ export default {
   },
   watch: {
     value() {
-      this.filelist = [{
-        name: this.value,
-        url: this.value,
-      }]
+      if (this.value) {
+        this.filelist = [{
+          name: this.value,
+          url: this.value,
+        }]
+      } else {
+        this.remove()
+      }
     }
   },
   data() {

+ 9 - 10
src/views/accompaniment/index.vue

@@ -20,11 +20,11 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item prop="subjectId">
+        <!-- <el-form-item prop="subjectId">
           <el-select v-model="searchForm.subjectId" clearable filterable placeholder="请选择声部">
             <el-option v-for="item in selects.subjects" :value="item.id" :label="item.name" :key="item.id"></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
         <el-button @click="submit" type="primary">搜索</el-button>
         <el-button @click="reset" type="danger">重置</el-button>
       </saveform>
@@ -36,7 +36,7 @@
         <el-table-column
           align="center"
           prop="id"
-          label="伴奏编号"
+          label="编号"
         >
                 <template slot-scope="scope">
               <div>
@@ -44,11 +44,10 @@
               </div>
             </template>
         </el-table-column>
-        </el-table-column>
         <el-table-column
           align="center"
           prop="name"
-          label="伴奏名称"
+          label="名称"
           width="180px"
         >
          <template slot-scope="scope">
@@ -66,7 +65,7 @@
             {{scope.row.type | songUseTypeFormat}}
           </template>
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           align="center"
           prop="subjectNames"
           label="声部"
@@ -82,7 +81,7 @@
           align="center"
           prop="speed"
           label="速度"
-        />
+        /> -->
         <el-table-column
           align="center"
           prop="createUserName"
@@ -126,16 +125,16 @@
         @pagination="FetchList"
       />
     </div>
-    <el-dialog width="400px" :visible.sync="audioVisible" title="播放伴奏">
-      <audio v-if="audioVisible" style="display: block; margin: auto" controls :src="activeUrl"/>
+    <el-dialog v-if="audioVisible" width="400px" :visible.sync="audioVisible" title="播放伴奏">
+      <audio style="display: block; margin: auto" controls :src="activeUrl"/>
     </el-dialog>
     <el-dialog
       :title="title"
       :visible.sync="visible"
       width="700px"
+      v-if="visible"
     >
       <submit-form
-        v-if="visible"
         :detail="detail"
         :type="type"
         @submited="FetchList"

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

@@ -74,7 +74,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-button class="file-remove" type="text" @click="removeSys" :disabled="form.sysExamSongAccompaniments.length == 1">删除</el-button>
+        <el-button class="file-remove" type="text" @click="removeSys(index)" :disabled="form.sysExamSongAccompaniments.length == 1">删除</el-button>
       </div>
       <el-button @click="createSys" type="info" style="width: 100%;margin-bottom: 20px;" plain>添加伴奏</el-button>
       <div class="btns">
@@ -145,6 +145,7 @@ export default {
         if (this.form.sysExamSongAccompaniments[index]) {
           this.form.delExamSongAccompanimentIds.push(this.form.sysExamSongAccompaniments[index].id)
         }
+
         this.form.sysExamSongAccompaniments.splice(index, 1)
       } catch (error) {}
     },