1.3.
image.png image.png
import { GetSysRoleListByPage , SaveSysRole , UpdateSysRole , DeleteSysRoleById } from '@/api/sysRole';
import { ElMessage, ElMessageBox } from 'element-plus'
// 删除数据
const deleteById = (row) => {
ElMessageBox.confirm('此操作将永久删除该记录, 是否继续?', 'Warning', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const {code } = await DeleteSysRoleById(row.id)
if(code === 200) {
ElMessage.success('删除成功')
pageParams.value.page = 1
fetchData()
}
})
}
//////////////////////
<el-button type="danger" size="small" @click="deleteById(scope.row)">
//////////////////////
//角色删除
export const DeleteSysRoleById = (roleId) =>{
return request({
// ``模板字符串
url: ${base_api}/deleteById/${roleId}
, //路径
method: 'get' //提交方式
})
}
网友评论