add SwitchBtn 组件
This commit is contained in:
@@ -197,6 +197,23 @@ export default {
|
||||
this.openDialog(data, true);
|
||||
break;
|
||||
}
|
||||
case "status": {
|
||||
// TODO: 类似于这种字符串,可以统一集中到一个文件里
|
||||
const { id, code, enabled } = data;
|
||||
// 更改状态,更改状态需要 id 和 code 然后是 状态 enabled
|
||||
this.$http
|
||||
.put(this.urls.base, {
|
||||
id,
|
||||
code,
|
||||
enabled,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user