소스 검색

音频管理 节目 添加批量上下架功能

DESKTOP-O04BTUJ\muzen 2 년 전
부모
커밋
dbbe89f5ac
1개의 변경된 파일16개의 추가작업 그리고 4개의 파일을 삭제
  1. 16 4
      src/views/music/program/index.vue

+ 16 - 4
src/views/music/program/index.vue

@@ -26,12 +26,12 @@
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
         <el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
         <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
         <el-button type="primary" plain icon="el-icon-plus" @click="getDetail()">新增</el-button>
-        <el-button type="primary">批量上架</el-button>
-        <el-button type="primary">批量下架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 1)">批量上架</el-button>
+        <el-button type="primary" :disabled="obj.id === ''" @click="getChange(obj, 2)">批量下架</el-button>
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
     <!-- 列表 -->
     <!-- 列表 -->
-    <el-table :data="tableData" v-loading='loading'>
+    <el-table :data="tableData" v-loading="loading" @selection-change="handleSelect">
       <el-table-column type="selection" align="center" />
       <el-table-column type="selection" align="center" />
       <el-table-column label="ID" prop="id" align="center" show-overflow-tooltip />
       <el-table-column label="ID" prop="id" align="center" show-overflow-tooltip />
       <el-table-column label="节目名称" prop="name" align="center" show-overflow-tooltip />
       <el-table-column label="节目名称" prop="name" align="center" show-overflow-tooltip />
@@ -80,7 +80,12 @@ export default {
       // 总数据
       // 总数据
       total: 0,
       total: 0,
       // 列表
       // 列表
-      tableData: []
+      tableData: [],
+      // 批量上下架
+      obj: {
+        id: '',
+        name: '已选数据'
+      }
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -156,6 +161,13 @@ export default {
       }).catch(() => { })
       }).catch(() => { })
     },
     },
 
 
+
+    // 多选
+    handleSelect(e) {
+      this.obj.id = ''
+      e.map((item, index) => this.obj.id += item.id + ((index + 1) < e.length ? ',' : ''))
+    },
+
     // 字典翻译
     // 字典翻译
     freeFormatter(row) {
     freeFormatter(row) {
       return this.selectDictLabel(this.freeOptions, row.isFree)
       return this.selectDictLabel(this.freeOptions, row.isFree)