feat: 增加工作流和知识库三级权限
- 抽取统一资源访问骨架与部门可见范围判断 - 接入工作流和知识库的 READ/MANAGE 权限校验 - 增加可见范围配置与只读态前端交互
This commit is contained in:
@@ -46,6 +46,9 @@ export interface CardListProps {
|
||||
titleField?: string;
|
||||
descField?: string;
|
||||
actions?: ActionButton[];
|
||||
cornerTagField?: string;
|
||||
cornerTagMap?: Record<string, string>;
|
||||
cornerTagTypeMap?: Record<string, string>;
|
||||
defaultIcon: any;
|
||||
data: any[];
|
||||
primaryAction?: CardPrimaryAction;
|
||||
@@ -58,6 +61,9 @@ const props = withDefaults(defineProps<CardListProps>(), {
|
||||
titleField: 'title',
|
||||
descField: 'description',
|
||||
actions: () => [],
|
||||
cornerTagField: '',
|
||||
cornerTagMap: () => ({}),
|
||||
cornerTagTypeMap: () => ({}),
|
||||
primaryAction: undefined,
|
||||
tagField: '',
|
||||
tagMap: () => ({}),
|
||||
@@ -154,6 +160,23 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
{{ item[descField] }}
|
||||
</ElText>
|
||||
</div>
|
||||
<div
|
||||
v-if="$slots.corner || (cornerTagField && item[cornerTagField])"
|
||||
class="card-corner-tag"
|
||||
>
|
||||
<slot name="corner" :item="item">
|
||||
<ElTag
|
||||
size="small"
|
||||
effect="plain"
|
||||
:type="cornerTagTypeMap[item[cornerTagField]] || 'info'"
|
||||
round
|
||||
>
|
||||
{{
|
||||
cornerTagMap[item[cornerTagField]] || item[cornerTagField]
|
||||
}}
|
||||
</ElTag>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -343,6 +366,26 @@ function handleActionClick(event: Event, action: ActionButton, item: any) {
|
||||
color: hsl(var(--text-muted));
|
||||
}
|
||||
|
||||
.card-corner-tag {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-end;
|
||||
min-height: 28px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.card-corner-tag :deep(.el-tag) {
|
||||
--el-tag-border-radius: 999px;
|
||||
--el-tag-font-size: 12px;
|
||||
--el-tag-border-color: transparent;
|
||||
|
||||
padding: 0 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.01em;
|
||||
backdrop-filter: blur(6px);
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
Reference in New Issue
Block a user