mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-11 06:57:10 +08:00
merge dev into dev
fix: 修复字典项权限标识不一致的问题 feat(菜单管理): 增加路由地址和权限标识搜索功能 Created-by: onekr-billy Commit-by: Billy Merged-by: Charles_7c Description: <!-- 非常感谢您的 PR!在提交之前,请务必确保您 PR 的代码经过了完整测试,并且通过了代码规范检查。 --> <!-- 在 [] 中输入 x 来勾选) --> ## PR 类型 <!-- 您的 PR 引入了哪种类型的变更? --> <!-- 只支持选择一种类型,如果有多种类型,可以在更新日志中增加 “类型” 列。 --> - [ ] 新 feature - [x] Bug 修复 - [x] 功能增强 - [ ] 文档变更 - [ ] 代码样式变更 - [ ] 重构 - [ ] 性能改进 - [ ] 单元测试 - [ ] CI/CD - [ ] 其他 ## PR 目的 <!-- 描述一下您的 PR 解决了什么问题。如果可以,请链接到相关 issues。 --> ## 解决方案 <!-- 详细描述您是如何解决的问题 --> ## PR 测试 <!-- 如果可以,请为您的 PR 添加或更新单元测试。 --> <!-- 请描述一下您是如何测试 PR 的。例如:创建/更新单元测试或添加相关的截图。 --> 遗留问题: 后端自动识别权限编码不符合数据库里的权限编码规范,需要同步调整  ## Changelog | 模块 | Changelog | Related issues | |-----|-----------| -------------- | | | | | <!-- 如果有多种类型的变更,可以在变更日志表中增加 “类型” 列,该列的值与上方 “PR 类型” 相同。 --> <!-- Related issues 格式为 Closes #<issue号>,或者 Fixes #<issue号>,或者 Resolves #<issue号>。 --> ## 其他信息 <!-- 请描述一下还有哪些注意事项。例如:如果引入了一个不向下兼容的变更,请描述其影响。 --> ## 提交前确认 - [x] PR 代码经过了完整测试,并且通过了代码规范检查 - [ ] 已经完整填写 Changelog,并链接到了相关 issues - [x] PR 代码将要提交到 dev 分支 See merge request: continew/continew-admin-ui!5
This commit is contained in:
@@ -24,11 +24,11 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:dict:item:create']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:dictItem:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button v-permission="['system:dict:item:clearCache']" type="outline" status="warning" @click="onClearCache">
|
<a-button v-permission="['system:dictItem:clearCache']" type="outline" status="warning" @click="onClearCache">
|
||||||
<template #icon><icon-delete /></template>
|
<template #icon><icon-delete /></template>
|
||||||
<template #default>清除缓存</template>
|
<template #default>清除缓存</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -46,9 +46,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['system:dict:item:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['system:dictItem:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link
|
<a-link
|
||||||
v-permission="['system:dict:item:delete']"
|
v-permission="['system:dictItem:delete']"
|
||||||
status="danger"
|
status="danger"
|
||||||
title="删除"
|
title="删除"
|
||||||
@click="onDelete(record)"
|
@click="onDelete(record)"
|
||||||
@@ -119,7 +119,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
width: 130,
|
width: 130,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['system:dict:item:update', 'system:dict:item:delete']),
|
show: has.hasPermOr(['system:dictItem:update', 'system:dictItem:delete']),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -19,6 +19,10 @@
|
|||||||
<a-input v-model="title" placeholder="搜索菜单标题" allow-clear>
|
<a-input v-model="title" placeholder="搜索菜单标题" allow-clear>
|
||||||
<template #prefix><icon-search /></template>
|
<template #prefix><icon-search /></template>
|
||||||
</a-input>
|
</a-input>
|
||||||
|
<a-input v-model="path" placeholder="搜索路由地址" allow-clear>
|
||||||
|
</a-input>
|
||||||
|
<a-input v-model="permission" placeholder="搜索权限标识" allow-clear>
|
||||||
|
</a-input>
|
||||||
<a-button @click="reset">
|
<a-button @click="reset">
|
||||||
<template #icon><icon-refresh /></template>
|
<template #icon><icon-refresh /></template>
|
||||||
<template #default>重置</template>
|
<template #default>重置</template>
|
||||||
@@ -110,11 +114,15 @@ const {
|
|||||||
} = useTable(() => listMenu(queryForm), { immediate: true })
|
} = useTable(() => listMenu(queryForm), { immediate: true })
|
||||||
|
|
||||||
// 过滤树
|
// 过滤树
|
||||||
const searchData = (title: string) => {
|
const searchData = (title: string, path: string, permission: string) => {
|
||||||
const loop = (data: MenuResp[]) => {
|
const loop = (data: MenuResp[]) => {
|
||||||
const result = [] as MenuResp[]
|
const result = [] as MenuResp[]
|
||||||
data.forEach((item: MenuResp) => {
|
data.forEach((item: MenuResp) => {
|
||||||
if (item.title?.toLowerCase().includes(title.toLowerCase())) {
|
if (
|
||||||
|
(!title || item.title?.toLowerCase().includes(title.toLowerCase()))
|
||||||
|
&& (!path || item.path?.toLowerCase().includes(path.toLowerCase()))
|
||||||
|
&& (!permission || item.permission?.toLowerCase().includes(permission.toLowerCase()))
|
||||||
|
) {
|
||||||
result.push({ ...item })
|
result.push({ ...item })
|
||||||
} else if (item.children) {
|
} else if (item.children) {
|
||||||
const filterData = loop(item.children)
|
const filterData = loop(item.children)
|
||||||
@@ -132,9 +140,11 @@ const searchData = (title: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
const path = ref('')
|
||||||
|
const permission = ref('')
|
||||||
const dataList = computed(() => {
|
const dataList = computed(() => {
|
||||||
if (!title.value) return tableData.value
|
if (!title.value && !path.value && !permission.value) return tableData.value
|
||||||
return searchData(title.value)
|
return searchData(title.value, path.value, permission.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns: TableInstance['columns'] = [
|
const columns: TableInstance['columns'] = [
|
||||||
|
Reference in New Issue
Block a user