完成菜单管理内容的添加子菜单和添加跟菜单以及删除菜单的修改

This commit is contained in:
moon 2025-07-29 15:32:28 +08:00
parent 36c070df1d
commit 4a5c6b8631
2 changed files with 18 additions and 6 deletions

View File

@ -143,11 +143,12 @@
} else {
//
menuForm.definedFrom = { ...row }
const { data } = await queryById(row.id)
const data = await queryById(row.id)
console.log("definedFrom",menuForm.definedFrom)
//
if (data) {
menuForm.apendixForm = data
menuForm.apendixForm = {...data}
console.log("menuForm.apendixForm",menuForm.apendixForm)
if (menuForm.apendixForm.iscustomsvg == '1') {
menuForm.apendixForm.iscustomsvg = true
} else {

View File

@ -16,7 +16,7 @@
<span>添加根菜单</span>
</el-button>
<el-badge :value="state.menuIconImgs.length > 99 ? '99+' : state.menuIconImgs.length" style="margin-right: 30px; margin-top: -2px" type="danger">
<el-button type="warning" size="mini">
<el-button type="warning" size="mini" @click="handleMenuIconImgView()">
<vab-icon icon="image-line" />
<span>菜单图片资源库</span>
</el-button>
@ -121,6 +121,8 @@
<edit ref="editRef" @refresh="getMenuTree" />
<access ref="accessRef" />
<verb ref="verbRef" />
<!-- <iconimage ref="menuIconImgsRef" />-->
</div>
</template>
<script setup>
@ -128,6 +130,7 @@
import edit from './components/edit.vue'
import access from './components/access.vue'
import verb from './components/verb.vue'
defineOptions({
name: 'MenuManage',
})
@ -175,14 +178,22 @@
editRef.value.showEdit('add', '添加根菜单')
}
}
const menuIconImgsRef = ref(null)
// const handleMenuIconImgView = () => {
// //TODO:
// menuIconImgsRef.value.showMenuIconImgs()
// }
const handleEditView = (data) => {
//TODO:
editRef.value.showEdit('edit', '编辑菜单', data)
}
const handleRemove = (data) => {
$baseConfirm('你确定要删除当前菜单吗', '菜单删除', async () => {
await removeMenu({ menuId: data.id })
getMenuTree()
await removeMenu({ menuId: data.id }).then(()=>{
getMenuTree()
}).catch(() => {
getMenuTree()
})
})
}
const handleNodeClick = (data) => {