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