perf: style
This commit is contained in:
parent
ff48a75830
commit
aa43967c08
@ -1,14 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
<div class="flex-between mb-16">
|
<div class="flex-between mb-16">
|
||||||
<div class="flex align-center"
|
<div
|
||||||
v-if="hasPermission([EditionConst.IS_EE,EditionConst.IS_PE], 'OR')">
|
class="flex align-center"
|
||||||
|
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
|
||||||
|
>
|
||||||
<!-- 企业版: 选优先级-->
|
<!-- 企业版: 选优先级-->
|
||||||
<span class="lighter mr-16">{{ $t('views.system.resourceAuthorization.priority.label') }}</span>
|
<span class="lighter mr-16">{{
|
||||||
|
$t('views.system.resourceAuthorization.priority.label')
|
||||||
|
}}</span>
|
||||||
<el-radio-group v-model="radioRole">
|
<el-radio-group v-model="radioRole">
|
||||||
<el-radio :value="true" size="large">{{
|
<el-radio :value="true" size="large"
|
||||||
$t('views.system.resourceAuthorization.priority.role')
|
>{{ $t('views.system.resourceAuthorization.priority.role') }}
|
||||||
}}
|
|
||||||
</el-radio>
|
</el-radio>
|
||||||
<el-radio :value="false" size="large">{{ $t('common.custom') }}</el-radio>
|
<el-radio :value="false" size="large">{{ $t('common.custom') }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@ -27,7 +30,7 @@
|
|||||||
row-key="id"
|
row-key="id"
|
||||||
:data="filterData"
|
:data="filterData"
|
||||||
:max-height="tableHeight"
|
:max-height="tableHeight"
|
||||||
:expand-row-keys="['default']"
|
:expand-row-keys="defaultExpandKeys"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-table-column class-name="folder-flex" prop="name" :label="$t('common.name')">
|
<el-table-column class-name="folder-flex" prop="name" :label="$t('common.name')">
|
||||||
@ -183,7 +186,7 @@ import useStore from '@/stores'
|
|||||||
const { model } = useStore()
|
const { model } = useStore()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array<any>,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
id: String,
|
id: String,
|
||||||
@ -203,6 +206,7 @@ const isKnowledge = computed(() => props.type === AuthorizationEnum.KNOWLEDGE)
|
|||||||
const isApplication = computed(() => props.type === AuthorizationEnum.APPLICATION)
|
const isApplication = computed(() => props.type === AuthorizationEnum.APPLICATION)
|
||||||
const isTool = computed(() => props.type === AuthorizationEnum.TOOL)
|
const isTool = computed(() => props.type === AuthorizationEnum.TOOL)
|
||||||
const isModel = computed(() => props.type === AuthorizationEnum.MODEL)
|
const isModel = computed(() => props.type === AuthorizationEnum.MODEL)
|
||||||
|
const defaultExpandKeys = computed(() => (props.data?.length > 0 ? [props.data[0]?.id] : []))
|
||||||
const dfsPermission = (arr: any = [], Name: string | number, e: boolean, idArr: any[]) => {
|
const dfsPermission = (arr: any = [], Name: string | number, e: boolean, idArr: any[]) => {
|
||||||
arr.map((item: any) => {
|
arr.map((item: any) => {
|
||||||
if (idArr.includes(item.id)) {
|
if (idArr.includes(item.id)) {
|
||||||
@ -230,7 +234,7 @@ const filterText = ref('')
|
|||||||
const filterData = computed(() => {
|
const filterData = computed(() => {
|
||||||
function filterTree(data: any[]): any[] {
|
function filterTree(data: any[]): any[] {
|
||||||
return data
|
return data
|
||||||
.map(item => {
|
.map((item) => {
|
||||||
// 递归过滤 children
|
// 递归过滤 children
|
||||||
const children = item.children ? filterTree(item.children) : []
|
const children = item.children ? filterTree(item.children) : []
|
||||||
// 判断当前节点或其子节点是否匹配
|
// 判断当前节点或其子节点是否匹配
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user