Commit 0eb4ad01 authored by 邓春圆's avatar 邓春圆

渠道列表添加状态

parent cabbc1d8
...@@ -42,7 +42,13 @@ export function getChannelPage(query) { ...@@ -42,7 +42,13 @@ export function getChannelPage(query) {
params: query params: query
}) })
} }
//启用-禁用渠道
export function channelSwitch(id){
return request({
url:`/ecw/channel/switch/${id}`,
method:'put'
})
}
// 获得渠道列表 TODO // 获得渠道列表 TODO
export function getChannelList(query) { export function getChannelList(query) {
return request({ return request({
......
...@@ -119,6 +119,12 @@ ...@@ -119,6 +119,12 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('更新人')" prop="updaterName"> <el-table-column :label="$t('更新人')" prop="updaterName">
</el-table-column> </el-table-column>
<el-table-column :label="$t('状态')" prop="updaterName">
<template v-slot="{row}">
<el-switch @change="(e)=>{changeSwitch(e,row)}" :validate-event="false" :active-value="true"
v-model="row.status"></el-switch>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width"> <el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
...@@ -144,7 +150,7 @@ import { ...@@ -144,7 +150,7 @@ import {
deleteChannel, deleteChannel,
getChannel, getChannel,
getChannelPage, getChannelPage,
exportChannelExcel exportChannelExcel, channelSwitch
} from "@/api/ecw/channel"; } from "@/api/ecw/channel";
import {getCountryListAll} from "@/api/ecw/country"; import {getCountryListAll} from "@/api/ecw/country";
import {getTradeCountryList} from "@/api/ecw/region"; import {getTradeCountryList} from "@/api/ecw/region";
...@@ -192,7 +198,22 @@ export default { ...@@ -192,7 +198,22 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
changeSwitch(val, row) {
let title = '是否要' + (val ? '打开' : '关闭') + "" + this.$l(row, 'name') + ''
this.$confirm(title, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
channelSwitch(row.channelId).then(r => {
this.$message.success('修改成功')
console.log(r)
})
}).catch(() => {
row.status = !val
});
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment