Commit f54c3668 authored by 孙浩然's avatar 孙浩然

主题编辑删除功能

parent 53e9703e
...@@ -16,6 +16,16 @@ ...@@ -16,6 +16,16 @@
</el-button> </el-button>
</div> </div>
</template> </template>
<!-- 操作列 -->
<template #action="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button
type="text"
style="color: #ff1616"
@click="handleDelete(row)"
>删除</el-button
>
</template>
</vxe-grid> </vxe-grid>
</div> </div>
<div class="wrapper-right"> <div class="wrapper-right">
...@@ -108,6 +118,13 @@ ...@@ -108,6 +118,13 @@
{ {
field: 'roleNames', field: 'roleNames',
title: '关联角色' title: '关联角色'
},
{
field: 'action',
title: '操作',
fixed: 'right',
width: 100,
slots: { default: 'action' }
} }
], ],
toolbarConfig: { toolbarConfig: {
...@@ -206,6 +223,31 @@ ...@@ -206,6 +223,31 @@
} }
}; };
// 编辑主题
const handleEdit = async (row) => {
AddThemeRef.value.open('edit', row); // 传递菜单信息
}
// 删除主题
const handleDelete = async (row) => {
ElMessageBox.confirm(`确定要删除此主题吗?`, '提示', {
type: 'warning'
}).then(async (res) => {
let params = {
themeId: row.themeId
};
const [err, ret] = await tryit(themeApi.delTheme)(params);
if (err) {
console.error(err);
return;
}
if (ret?.code === 200) {
EleMessage.success('删除成功');
fetchTheme(); // 重新获取菜单列表
}
});
};
// 移动端保存配置 // 移动端保存配置
const handleSaveByMobile = async () => { const handleSaveByMobile = async () => {
console.log(mobileTreeRef.value.getCheckedKeys(true)); console.log(mobileTreeRef.value.getCheckedKeys(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