浏览代码

feat: 音乐专辑批量添加自行上传的音频

Damon 8 月之前
父节点
当前提交
f80e4ff957
共有 1 个文件被更改,包括 27 次插入5 次删除
  1. 27 5
      src/views/music/album/detail.vue

+ 27 - 5
src/views/music/album/detail.vue

@@ -185,7 +185,20 @@
           <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
         </el-form-item>
       </el-form>
-      <el-table :data="tableData" v-loading="loading">
+      <el-table
+        :data="tableData"
+        ref="multipleTable"
+        :row-key="tableKey"
+        v-loading="loading"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column
+          type="selection"
+          align="center"
+          key="selection"
+          reserve-selection
+        />
+
         <el-table-column label="ID" prop="id" align="center" />
         <el-table-column
           label="歌曲名称"
@@ -232,10 +245,10 @@ import { list } from "@/api/music/list";
 import { detail, submit } from "@/api/music/menu";
 import Audio from "@/components/Audio/index.vue";
 import {
-albumTypeMixin,
-onOrOffMixin,
-payTypeMixin,
-platformMixin,
+  albumTypeMixin,
+  onOrOffMixin,
+  payTypeMixin,
+  platformMixin,
 } from "@/mixin/index";
 export default {
   mixins: [platformMixin, onOrOffMixin, payTypeMixin, albumTypeMixin],
@@ -375,6 +388,15 @@ export default {
     }
   },
   methods: {
+    tableKey(row) {
+      return row.id;
+    },
+
+    handleSelectionChange(val) {
+      this.form.programList = JSON.parse(JSON.stringify(val));
+      this.$message.success("操作成功!");
+    },
+
     //是否展示排序
     // isShowSort() {
     //   if (this.form) {