v2.6.6版本发布 (#1784)
* 前端支持顶部菜单栏模式 * 自动化代码单条获取方法不再需要取data.xxx直接取用data * 自动化代码支持选择索引 * 自动化代码回滚支持自行选择是否删除菜单、API、表 * 日志增加定期清理功能 * 权限配置API部分,支持根据API真实path进行筛选 * 修复了一些已知bug * 修复了一个sql注入漏洞 --------- Co-authored-by: xuedinge <781408517@qq.com> Co-authored-by: Qing Liang <106448173+xue-ding-e@users.noreply.github.com> Co-authored-by: wall-js <wall_js@foxmail.com> Co-authored-by: Wall <307606056@qq.com> Co-authored-by: leooza <leooza@163.com> Co-authored-by: piexlMax(奇淼 <qimiaojiangjizhao@gmail.com> Co-authored-by: hxl <52553624@qq.com> Co-authored-by: zsc1003 <11476303+zsc1003@user.noreply.gitee.com>
This commit is contained in:
co-authored by
xuedinge
Qing Liang
wall-js
Wall
leooza
piexlMax(奇淼
hxl
zsc1003
parent
b336529d42
commit
03e5bc515f
@@ -1,10 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="sticky top-0.5 z-10">
|
||||
<div class="sticky top-0.5 z-10 flex space-x-2">
|
||||
<el-input
|
||||
v-model="filterText"
|
||||
class="w-3/5"
|
||||
placeholder="筛选"
|
||||
v-model="filterTextName"
|
||||
class="flex-1"
|
||||
placeholder="筛选名字"
|
||||
/>
|
||||
<el-input
|
||||
v-model="filterTextPath"
|
||||
class="flex-1"
|
||||
placeholder="筛选路径"
|
||||
/>
|
||||
<el-button
|
||||
class="float-right"
|
||||
@@ -15,17 +20,28 @@
|
||||
<div class="tree-content">
|
||||
<el-scrollbar>
|
||||
<el-tree
|
||||
ref="apiTree"
|
||||
:data="apiTreeData"
|
||||
:default-checked-keys="apiTreeIds"
|
||||
:props="apiDefaultProps"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
node-key="onlyId"
|
||||
show-checkbox
|
||||
:filter-node-method="filterNode"
|
||||
@check="nodeChange"
|
||||
/>
|
||||
ref="apiTree"
|
||||
:data="apiTreeData"
|
||||
:default-checked-keys="apiTreeIds"
|
||||
:props="apiDefaultProps"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
node-key="onlyId"
|
||||
show-checkbox
|
||||
:filter-node-method="filterNode"
|
||||
@check="nodeChange"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="flex items-center justify-between w-full pr-1">
|
||||
<span>{{ data.description }} </span>
|
||||
<el-tooltip
|
||||
:content="data.path"
|
||||
>
|
||||
<span class="max-w-[240px] break-all overflow-ellipsis overflow-hidden">{{data.path}}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,7 +70,8 @@ const apiDefaultProps = ref({
|
||||
children: 'children',
|
||||
label: 'description'
|
||||
})
|
||||
const filterText = ref('')
|
||||
const filterTextName = ref('')
|
||||
const filterTextPath = ref('')
|
||||
const apiTreeData = ref([])
|
||||
const apiTreeIds = ref([])
|
||||
const activeUserId = ref('')
|
||||
@@ -135,12 +152,22 @@ defineExpose({
|
||||
})
|
||||
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true
|
||||
return data.description.indexOf(value) !== -1
|
||||
if (!filterTextName.value && !filterTextPath.value) return true
|
||||
let matchesName,matchesPath;
|
||||
if (!filterTextName.value){
|
||||
matchesName = true
|
||||
}else {
|
||||
matchesName = data.description && data.description.includes(filterTextName.value)
|
||||
}
|
||||
if (!filterTextPath.value){
|
||||
matchesPath = true
|
||||
}else {
|
||||
matchesPath = data.path && data.path.includes(filterTextPath.value)
|
||||
}
|
||||
return matchesName && matchesPath
|
||||
}
|
||||
watch(filterText, (val) => {
|
||||
apiTree.value.filter(val)
|
||||
watch([filterTextName, filterTextPath], () => {
|
||||
apiTree.value.filter('')
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user