add SwitchBtn 组件

This commit is contained in:
lb
2023-01-31 10:35:26 +08:00
parent 7c8f844ace
commit e6fe05ae17
5 changed files with 78 additions and 8 deletions

View File

@@ -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;
}
}
},