fix(wiki-ui): use the shared employee picker and 'employee' wording in pageType permissions

This commit is contained in:
matevip 2026-05-31 08:00:13 +08:00
parent 4cde845e27
commit 3fe1f65bef
3 changed files with 18 additions and 14 deletions

View File

@ -2143,13 +2143,13 @@ export default {
}, },
perm: { perm: {
tab: 'Permissions', tab: 'Permissions',
title: 'Agent Page Type Permissions', title: 'Employee Page Type Permissions',
desc: 'Configure per-pageType read/create/update/delete access for an agent in this KB; writes can require approval. No rules = allow all; once any rule exists, uncovered types are fail-safe denied.', desc: 'Configure per-pageType read/create/update/delete access for an employee in this KB; writes can require approval. No rules = allow all; once any rule exists, uncovered types are fail-safe denied.',
agent: 'Agent', agent: 'Employee',
selectAgent: 'Select an agent…', selectAgent: 'Select an employee…',
pageType: 'Page Type', pageType: 'Page Type',
policy: 'Write policy', policy: 'Write policy',
noRows: 'This agent has no permission rules (allow all).', noRows: 'This employee has no permission rules (allow all).',
pageTypeHint: 'page type, * for default', pageTypeHint: 'page type, * for default',
addRule: 'Add rule', addRule: 'Add rule',
deleteConfirm: 'Delete the permission rule for "{type}"?', deleteConfirm: 'Delete the permission rule for "{type}"?',

View File

@ -2155,13 +2155,13 @@ export default {
}, },
perm: { perm: {
tab: '权限 & 审批', tab: '权限 & 审批',
title: 'Agent 页面类型权限', title: '员工页面类型权限',
desc: '为指定 Agent 配置在本知识库下按 pageType 的读/创建/更新/删除权限;写操作可设为需审批。无规则时默认放行,一旦存在规则则未覆盖的类型按失败安全(拒绝)处理。', desc: '为指定员工配置在本知识库下按 pageType 的读/创建/更新/删除权限;写操作可设为需审批。无规则时默认放行,一旦存在规则则未覆盖的类型按失败安全(拒绝)处理。',
agent: 'Agent', agent: '员工',
selectAgent: '选择一个 Agent…', selectAgent: '选择一位员工…',
pageType: '页面类型', pageType: '页面类型',
policy: '写策略', policy: '写策略',
noRows: '该 Agent 暂无权限规则(默认放行)。', noRows: '该员工暂无权限规则(默认放行)。',
pageTypeHint: '页面类型,* 表示默认', pageTypeHint: '页面类型,* 表示默认',
addRule: '新增规则', addRule: '新增规则',
deleteConfirm: '删除 "{type}" 的权限规则?', deleteConfirm: '删除 "{type}" 的权限规则?',

View File

@ -79,10 +79,13 @@
</header> </header>
<div class="perm-agent-row"> <div class="perm-agent-row">
<label>{{ t('wiki.adv.perm.agent') }}</label> <label>{{ t('wiki.adv.perm.agent') }}</label>
<select v-model="perm.agentId" class="form-input compact" @change="loadPermissions"> <AgentPickerDialog
<option value="">{{ t('wiki.adv.perm.selectAgent') }}</option> v-model="perm.agentId"
<option v-for="a in agents" :key="a.id" :value="String(a.id)">{{ a.name }}</option> :agents="agents"
</select> :placeholder="t('wiki.adv.perm.selectAgent')"
clearable
@change="loadPermissions"
/>
</div> </div>
<template v-if="perm.agentId"> <template v-if="perm.agentId">
<table class="adv-table"> <table class="adv-table">
@ -225,6 +228,7 @@ import { useAgentStore } from '@/stores/useAgentStore'
import { wikiApi } from '@/api/index' import { wikiApi } from '@/api/index'
import { mcToast } from '@/composables/useMcToast' import { mcToast } from '@/composables/useMcToast'
import { mcConfirm } from '@/components/common/useConfirm' import { mcConfirm } from '@/components/common/useConfirm'
import AgentPickerDialog from '@/components/common/AgentPickerDialog.vue'
const { t } = useI18n() const { t } = useI18n()
const store = useWikiStore() const store = useWikiStore()