feat: add settings page with navigation and access control updates
This commit is contained in:
@@ -3,7 +3,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { icons } from '../data/icons.js'
|
||||
|
||||
export const appViews = ['overview', 'workbench', 'requests', 'approval', 'chat', 'policies', 'audit', 'employees']
|
||||
export const appViews = ['overview', 'workbench', 'requests', 'approval', 'chat', 'policies', 'audit', 'employees', 'settings']
|
||||
|
||||
export const navItems = [
|
||||
{
|
||||
@@ -69,6 +69,14 @@ export const navItems = [
|
||||
icon: icons.users,
|
||||
title: '员工与组织管理',
|
||||
desc: '维护员工账号、组织结构与角色权限。'
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
label: '系统设置',
|
||||
navHint: '维护企业品牌、管理员安全与系统配置',
|
||||
icon: icons.settings,
|
||||
title: '系统设置中心',
|
||||
desc: '集中配置公司名称、管理员账号安全、模型接入、日志策略与邮箱通知。'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -80,7 +88,8 @@ const viewRouteNames = {
|
||||
chat: 'app-chat',
|
||||
policies: 'app-policies',
|
||||
audit: 'app-audit',
|
||||
employees: 'app-employees'
|
||||
employees: 'app-employees',
|
||||
settings: 'app-settings'
|
||||
}
|
||||
|
||||
export function useNavigation() {
|
||||
|
||||
@@ -319,6 +319,20 @@ const companyProfile = computed(() => ({
|
||||
adminEmail: bootstrapState.value.company?.admin_email || ''
|
||||
}))
|
||||
|
||||
function updateCompanyProfilePreview(payload = {}) {
|
||||
const currentCompany = bootstrapState.value.company || {}
|
||||
|
||||
bootstrapState.value = {
|
||||
...bootstrapState.value,
|
||||
company: {
|
||||
...currentCompany,
|
||||
...(payload.name !== undefined ? { name: payload.name } : {}),
|
||||
...(payload.code !== undefined ? { code: payload.code } : {}),
|
||||
...(payload.adminEmail !== undefined ? { admin_email: payload.adminEmail } : {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const isInitialized = computed(() => Boolean(bootstrapState.value.initialized))
|
||||
|
||||
function applyBootstrapState(state) {
|
||||
@@ -527,6 +541,7 @@ export function useSystemState() {
|
||||
runtimeTesting,
|
||||
setupError,
|
||||
setupSubmitting,
|
||||
syncAuthSession
|
||||
syncAuthSession,
|
||||
updateCompanyProfilePreview
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user