web打包修改

This commit is contained in:
2026-01-08 13:20:40 +08:00
parent 4784971d97
commit 5190a0cc9c
63 changed files with 463 additions and 600 deletions

View File

@@ -0,0 +1,14 @@
# ------------------------------
# 挂载目录配置
# ------------------------------
# 数据目录
DATA_ROOT=./volumes
# 配置文件目录
CONFIG_ROOT=./volumes
# 配置文件位置
CONFIG_FILE_ROOT=./volumes
# SSL证书目录
SSL_ROOT=

View File

@@ -17,11 +17,11 @@ services:
environment:
TZ: Asia/Shanghai
volumes:
- ./volumes/nginx/logs:/var/log/nginx
- ./volumes/nginx.conf:/etc/nginx/nginx.conf:ro
- ./volumes/conf.d:/etc/nginx/conf.d:ro
- ${LOG_ROOT:-./volumes/nginx/logs}:/var/log/nginx
- ${CONFIG_FILE_ROOT:-./volumes/nginx.conf}:/etc/nginx/nginx.conf:ro
- ${CONFIG_ROOT:-./volumes/conf.d}:/etc/nginx/conf.d:ro
# SSL 证书(可选)
- ./volumes/cert:/etc/nginx/ssl:ro
- ${SSL_ROOT:-./volumes/cert}:/etc/nginx/ssl:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s

View File

@@ -125,7 +125,7 @@ server {
# 后端 API 代理
location /urban-lifeline/ {
proxy_pass http://gateway/;
proxy_pass http://gateway;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -148,3 +148,4 @@ server {
root /usr/share/nginx/html;
}
}

View File

@@ -4,6 +4,31 @@
# ================================================
services:
# ====================== Redis 缓存 ======================
redis:
image: redis:7-alpine
container_name: urban-lifeline-redis
restart: unless-stopped
networks:
- urban-lifeline
expose:
- "6379"
environment:
TZ: Asia/Shanghai
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redis123}
volumes:
- ${REDIS_DATA:-./volumes/redis}:/data
deploy:
resources:
limits:
memory: ${REDIS_MEMORY_LIMIT:-512M}
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-redis123}", "ping"]
interval: 10s
timeout: 5s
retries: 3
# ====================== 后端服务 ======================
urban-lifeline-serv:
image: urban-lifeline-serv:${IMAGE_VERSION:-latest}
container_name: urban-lifeline-serv
@@ -12,13 +37,20 @@ services:
- .env
networks:
- urban-lifeline
ports:
- "${GATEWAY_PORT:-8080}:8080"
# 不对外暴露端口,仅通过 nginx 反向代理访问
expose:
- "8080"
environment:
TZ: Asia/Shanghai
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE:-prod}
NACOS_SERVER_ADDR: ${NACOS_SERVER_ADDR:-nacos:8848}
NACOS_NAMESPACE: ${NACOS_NAMESPACE:-}
REDIS_HOST: urban-lifeline-redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-redis123}
depends_on:
redis:
condition: service_healthy
volumes:
# 配置文件目录
- ${CONFIG_ROOT:-./volumes/config}:/app/config:ro

View File

@@ -12,12 +12,13 @@ services:
- .env
networks:
- urban-lifeline
ports:
- "${SHARED_PORT:-8000}:8000"
- "${PLATFORM_PORT:-8001}:8001"
- "${WORKCASE_PORT:-8002}:8002"
- "${BIDDING_PORT:-8003}:8003"
- "${WORKCASE_WECHAT_PORT:-8004}:8004"
# 不对外暴露端口,仅通过 nginx 反向代理访问
expose:
- "8000"
- "8001"
- "8002"
- "8003"
- "8004"
environment:
TZ: Asia/Shanghai
SHARED_PORT: ${SHARED_PORT:-8000}

View File

@@ -245,5 +245,5 @@ watch(
</script>
<style lang="scss" scoped>
@import url("./SidebarLayout.scss");
@import "./SidebarLayout.scss";
</style>

View File

@@ -3,6 +3,9 @@ import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入 shared 的全局样式Module Federation 远程模块样式)
import 'shared/styles'
import App from './App.vue'
import router from './router/'

View File

@@ -11,7 +11,7 @@
import type { RouteRecordRaw } from 'vue-router'
import router from './index'
import { SidebarLayout, BlankLayout, SubSidebarLayout } from '@/layouts'
import { SidebarLayout } from '@/layouts'
// 动态导入 shared 模块(避免顶层 import 阻塞)
async function loadSharedModules() {
@@ -25,10 +25,11 @@ async function loadSharedModules() {
// Bidding 布局组件映射
const biddingLayoutMap: Record<string, () => Promise<any>> = {
'SidebarLayout': () => Promise.resolve({ default: SidebarLayout }),
'BlankLayout': () => Promise.resolve({ default: BlankLayout }),
'NavigationLayout': () => Promise.resolve({ default: SidebarLayout }),
'BasicLayout': () => Promise.resolve({ default: SidebarLayout }),
'SubSidebarLayout': () => Promise.resolve({ default: SubSidebarLayout })
// 动态导入 shared 的布局组件,避免静态导入阻塞
'BlankLayout': () => import('shared/layouts').then(m => ({ default: m.BlankLayout })),
'SubSidebarLayout': () => import('shared/layouts').then(m => ({ default: m.SubSidebarLayout }))
}
// 视图组件加载器

View File

@@ -251,5 +251,5 @@ watch(
</script>
<style lang="scss" scoped>
@import url("./AdminSidebarLayout.scss");
@import "./AdminSidebarLayout.scss";
</style>

View File

@@ -269,5 +269,5 @@ watch(
</script>
<style lang="scss" scoped>
@import url("./SidebarLayout.scss");
@import "./SidebarLayout.scss";
</style>

View File

@@ -5,6 +5,9 @@ import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入 shared 的全局样式Module Federation 远程模块样式)
import 'shared/styles'
import App from './App.vue'
import router from './router/'
import { AES_SECRET_KEY } from './config'

View File

@@ -11,7 +11,7 @@
import type { RouteRecordRaw } from 'vue-router'
import router from './index'
import { SidebarLayout, BlankLayout, AdminSidebarLayout, SubSidebarLayout } from '@/layouts'
import { SidebarLayout, AdminSidebarLayout } from '@/layouts'
// 动态导入 shared 模块(避免顶层 import 阻塞)
async function loadSharedModules() {
@@ -25,11 +25,12 @@ async function loadSharedModules() {
// Platform 布局组件映射
const platformLayoutMap: Record<string, () => Promise<any>> = {
'SidebarLayout': () => Promise.resolve({ default: SidebarLayout }),
'BlankLayout': () => Promise.resolve({ default: BlankLayout }),
'NavigationLayout': () => Promise.resolve({ default: SidebarLayout }),
'BasicLayout': () => Promise.resolve({ default: SidebarLayout }),
'AdminSidebarLayout': () => Promise.resolve({ default: AdminSidebarLayout }),
'SubSidebarLayout': () => Promise.resolve({ default: SubSidebarLayout })
// 动态导入 shared 的布局组件,避免静态导入阻塞
'BlankLayout': () => import('shared/layouts').then(m => ({ default: m.BlankLayout })),
'SubSidebarLayout': () => import('shared/layouts').then(m => ({ default: m.SubSidebarLayout }))
}
// 视图组件加载器

View File

@@ -7,5 +7,5 @@
</script>
<style lang="scss" scoped>
@import url("./OverviewView.scss");
@import "./OverviewView.scss";
</style>

View File

@@ -7,5 +7,5 @@
</script>
<style lang="scss" scoped>
@import url("./UserManagementView.scss");
@import "./UserManagementView.scss";
</style>

View File

@@ -252,5 +252,5 @@ const handleSaveAgent = async (agentData: Partial<Agent>) => {
</script>
<style lang="scss" scoped>
@import url('./AgentPlatformView.scss');
@import './AgentPlatformView.scss';
</style>

View File

@@ -39,5 +39,5 @@ defineEmits<{
</script>
<style lang="scss" scoped>
@import url('./AgentCard.scss');
@import './AgentCard.scss';
</style>

View File

@@ -248,5 +248,5 @@ const handleSave = () => {
</script>
<style lang="scss" scoped>
@import url('./AgentEdit.scss');
@import './AgentEdit.scss';
</style>

View File

@@ -423,5 +423,5 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
@import url('./AIChatView.scss');
@import './AIChatView.scss';
</style>

View File

@@ -105,5 +105,5 @@ const handleSuggestionClick = (suggestion: string) => {
</script>
<style lang="scss" scoped>
@import url('./ChatDefault.scss');
@import './ChatDefault.scss';
</style>

View File

@@ -4,6 +4,9 @@
<script setup lang="ts">
</script>
<style scoped lang="scss">
@import url("./DocumentDetail.scss");
<style lang="scss">
// DocumentDetail 样式 - 去掉 scoped 以支持 Module Federation
.document-detail {
width: 100%;
}
</style>

View File

@@ -1,3 +1,4 @@
// 文档分段组件样式 - 去掉 scoped 以支持 Module Federation
.segment-dialog {
:deep(.el-dialog) {
border-radius: 14px;
@@ -10,7 +11,6 @@
font-size: 18px;
font-weight: 500;
color: #101828;
letter-spacing: -0.02em;
}
}
@@ -47,21 +47,12 @@
overflow-y: auto;
padding-right: 4px;
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
}
&::-webkit-scrollbar { width: 6px; }
&::-webkit-scrollbar-track { background: transparent; }
&::-webkit-scrollbar-thumb {
background: #D1D5DB;
border-radius: 3px;
&:hover {
background: #9CA3AF;
}
&:hover { background: #9CA3AF; }
}
.segment-item {
@@ -77,9 +68,7 @@
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.12);
}
&:last-child {
margin-bottom: 0;
}
&:last-child { margin-bottom: 0; }
}
.segment-header {
@@ -93,7 +82,6 @@
font-weight: 500;
color: #101828;
font-size: 14px;
letter-spacing: -0.01em;
white-space: nowrap;
}
@@ -101,7 +89,6 @@
flex: 1;
font-size: 12px;
color: #6A7282;
letter-spacing: -0.01em;
white-space: nowrap;
}
@@ -116,14 +103,6 @@
.segment-content {
margin-bottom: 12px;
.el-textarea {
textarea {
font-family: inherit;
font-size: 14px;
line-height: 1.6;
}
}
.segment-text {
padding: 12px;
background: #F9FAFB;
@@ -134,7 +113,6 @@
font-size: 14px;
white-space: pre-wrap;
word-break: break-word;
letter-spacing: -0.01em;
}
}
@@ -170,7 +148,6 @@
gap: 6px;
font-size: 13px;
color: #667085;
letter-spacing: -0.01em;
.el-icon {
font-size: 14px;
@@ -190,13 +167,6 @@
font-size: 14px;
color: #6A7282;
margin: 0;
letter-spacing: -0.01em;
}
}
}
.pagination-container {
margin-top: 16px;
display: flex;
justify-content: center;
}

View File

@@ -496,6 +496,6 @@ function formatTimestamp(timestamp: number): string {
}
</script>
<style lang="scss" scoped>
@import url("./DocumentSegment.scss");
<style lang="scss">
// 样式已分离到 styles/components.scss 统一管理
</style>

View File

@@ -576,6 +576,6 @@ defineExpose({
})
</script>
<style lang="scss" scoped>
@import url("./DynamicFormItem.scss");
<style lang="scss">
// 样式已分离到 styles/components.scss 统一管理
</style>

View File

@@ -150,6 +150,6 @@ const handleCustomAction = (key: string, row: KnowledgeFileVO) => {
}
</script>
<style lang="scss" scoped>
@import url('./FileHistory.scss');
<style lang="scss">
// 样式已分离到 styles/components.scss 统一管理
</style>

View File

@@ -574,6 +574,6 @@ defineExpose({
})
</script>
<style lang="scss" scoped>
@import url('./FileUpload.scss');
<style lang="scss">
// 样式已分离到 styles/components.scss 统一管理
</style>

View File

@@ -0,0 +1,75 @@
// IframeView 组件样式
.iframe-view {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
.iframe-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: var(--el-bg-color);
border-bottom: 1px solid var(--el-border-color-light);
flex-shrink: 0;
.iframe-title {
font-size: 16px;
font-weight: 500;
color: var(--el-text-color-primary);
}
}
.iframe-content {
width: 100%;
height: 100%;
border: none;
flex: 1;
&.with-header {
height: calc(100% - 49px);
}
}
.iframe-error {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--el-text-color-secondary);
.error-icon {
font-size: 48px;
margin-bottom: 16px;
color: var(--el-color-warning);
}
}
.iframe-loading {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: var(--el-bg-color);
gap: 12px;
.is-loading {
animation: iframe-rotating 1.5s linear infinite;
color: var(--el-color-primary);
}
}
}
@keyframes iframe-rotating {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

View File

@@ -140,83 +140,7 @@ onUnmounted(() => {
})
</script>
<style lang="scss" scoped>
.iframe-view {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
.iframe-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: var(--el-bg-color);
border-bottom: 1px solid var(--el-border-color-light);
flex-shrink: 0;
.iframe-title {
font-size: 16px;
font-weight: 500;
color: var(--el-text-color-primary);
}
}
.iframe-content {
width: 100%;
height: 100%;
border: none;
flex: 1;
&.with-header {
height: calc(100% - 49px);
}
}
.iframe-error {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--el-text-color-secondary);
.error-icon {
font-size: 48px;
margin-bottom: 16px;
color: var(--el-color-warning);
}
}
.iframe-loading {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: var(--el-bg-color);
gap: 12px;
.is-loading {
animation: rotating 1.5s linear infinite;
color: var(--el-color-primary);
}
}
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<style lang="scss">
// 样式已分离到 styles/components.scss 统一管理
// 这里保留空的 style 标签以便后续扩展
</style>

View File

@@ -353,6 +353,6 @@ watch(
)
</script>
<style lang="scss" scoped>
@import url("./SubSidebarLayout.scss");
<style lang="scss">
// 样式已分离到 styles/layouts.scss 统一管理
</style>

View File

@@ -9,10 +9,6 @@
// 适用于全屏页面,如聊天页面、独立功能页等
</script>
<style scoped lang="scss">
.blank-layout {
width: 100%;
height: 100vh;
overflow: hidden;
}
<style lang="scss">
// 样式已分离到 styles/layouts.scss 统一管理
</style>

View File

@@ -1,8 +1,11 @@
// ==================== 品牌色变量 ====================
// ==================== Shared Layouts 样式 ====================
// 所有样式都用根类名包裹,避免全局污染
$brand-color: #0055AA;
$brand-color-light: #EBF5FF;
$brand-color-hover: #004488;
// ==================== SubSidebarLayout ====================
.sidebar-layout {
display: flex;
width: 100%;
@@ -10,9 +13,7 @@ $brand-color-hover: #004488;
overflow: hidden;
background: #f8fafc;
font-family: 'Inter', 'Noto Sans SC', sans-serif;
}
// ==================== 2级侧边栏子导航样式====================
.sidebar {
width: 224px;
height: 100%;
@@ -32,48 +33,24 @@ $brand-color-hover: #004488;
.sidebar-header {
padding: 16px 0;
justify-content: center;
.logo {
display: none;
}
.collapse-btn {
display: flex;
}
.logo { display: none; }
.collapse-btn { display: flex; }
}
.nav-item {
justify-content: center;
padding: 10px;
margin: 2px 8px;
span {
display: none;
span { display: none; }
.expand-icon { display: none; }
&:hover .nav-tooltip { opacity: 1; visibility: visible; }
}
.expand-icon {
display: none;
}
// 折叠状态下显示 tooltip
&:hover .nav-tooltip {
opacity: 1;
visibility: visible;
.nav-child-item { display: none; }
.user-section { justify-content: center; padding: 16px 8px; }
}
}
.nav-child-item {
display: none;
}
.user-section {
justify-content: center;
padding: 16px 8px;
}
}
}
// 侧边栏头部
.sidebar-header {
height: 64px;
padding: 0 16px;
@@ -97,18 +74,10 @@ $brand-color-hover: #004488;
transition: all 0.2s;
flex-shrink: 0;
&:hover {
background: #f1f5f9;
color: #64748b;
&:hover { background: #f1f5f9; color: #64748b; }
svg { width: 20px; height: 20px; }
}
svg {
width: 20px;
height: 20px;
}
}
// 展开按钮(折叠状态显示在右侧)
.expand-toggle {
position: absolute;
right: -12px;
@@ -126,15 +95,7 @@ $brand-color-hover: #004488;
transition: all 0.2s;
z-index: 10;
&:hover {
background: #f8fafc;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.el-icon {
font-size: 14px;
color: #64748b;
}
&:hover { background: #f8fafc; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
}
.logo {
@@ -142,22 +103,6 @@ $brand-color-hover: #004488;
align-items: center;
gap: 8px;
.logo-icon {
width: 32px;
height: 32px;
background: #3b82f6;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
.el-icon {
font-size: 18px;
color: #fff;
}
}
.logo-img {
width: 100%;
height: 32px;
@@ -173,51 +118,21 @@ $brand-color-hover: #004488;
}
}
// 导航菜单
.nav-menu {
flex: 1;
// overflow-y: auto;
padding: 8px 0;
&::-webkit-scrollbar {
width: 4px;
&::-webkit-scrollbar { width: 4px; }
&::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); border-radius: 4px; }
&::-webkit-scrollbar-track { background: transparent; }
}
&::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.1);
border-radius: 4px;
}
.nav-section { padding: 0; }
.nav-group { margin-bottom: 4px; }
.nav-children { padding-left: 12px; }
.nav-child-wrapper { margin-bottom: 2px; }
.nav-sub-children { padding-left: 12px; }
&::-webkit-scrollbar-track {
background: transparent;
}
}
.nav-section {
padding: 0;
}
// 导航分组容器
.nav-group {
margin-bottom: 4px;
}
// 子菜单容器(二级)
.nav-children {
padding-left: 12px;
}
// 子菜单项包装器
.nav-child-wrapper {
margin-bottom: 2px;
}
// 三级菜单容器
.nav-sub-children {
padding-left: 12px;
}
// 1级导航项分组标题
.nav-item {
position: relative;
display: flex;
@@ -233,24 +148,9 @@ $brand-color-hover: #004488;
font-size: 14px;
font-weight: 500;
&:hover {
background: #f8fafc;
color: #475569;
}
&.active {
background: $brand-color-light;
color: $brand-color;
}
&.has-children {
cursor: pointer;
}
.el-icon {
font-size: 18px;
flex-shrink: 0;
}
&:hover { background: #f8fafc; color: #475569; }
&.active { background: $brand-color-light; color: $brand-color; }
&.has-children { cursor: pointer; }
span {
flex: 1;
@@ -265,7 +165,6 @@ $brand-color-hover: #004488;
transition: transform 0.2s;
}
// 折叠时的 Tooltip
.nav-tooltip {
position: absolute;
left: calc(100% + 16px);
@@ -295,7 +194,6 @@ $brand-color-hover: #004488;
}
}
// 2级导航项子菜单
.nav-child-item {
padding: 8px 16px 8px 40px;
margin: 1px 8px;
@@ -303,27 +201,14 @@ $brand-color-hover: #004488;
font-size: 13px;
font-weight: 400;
&:hover {
background: #f8fafc;
color: #475569;
}
&:hover { background: #f8fafc; color: #475569; }
&.active {
background: $brand-color;
color: #fff;
font-weight: 500;
.el-icon {
color: #fff;
}
}
.el-icon {
font-size: 16px;
}
}
// 3级导航项
.nav-sub-child-item {
padding: 6px 16px 6px 56px;
margin: 1px 8px;
@@ -332,49 +217,10 @@ $brand-color-hover: #004488;
font-weight: 400;
color: #64748b;
&:hover {
background: #f8fafc;
color: #475569;
&:hover { background: #f8fafc; color: #475569; }
&.active { background: $brand-color; color: #fff; }
}
&.active {
background: $brand-color;
color: #fff;
}
}
// 用户信息
.user-section {
padding: 16px;
border-top: 1px solid #f1f5f9;
cursor: pointer;
transition: background 0.2s;
&:hover {
background: #f8fafc;
}
.user-info-wrapper {
display: flex;
align-items: center;
gap: 12px;
}
.user-avatar {
flex-shrink: 0;
}
.user-name {
font-size: 14px;
font-weight: 500;
color: #374151;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
// ==================== 主内容区 ====================
.main-content {
flex: 1;
height: 100%;
@@ -383,59 +229,11 @@ $brand-color-hover: #004488;
position: relative;
}
// iframe 容器
.iframe-container {
&.no-sidebar .main-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
position: relative;
}
.iframe-header {
height: 56px;
padding: 0 24px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #e2e8f0;
background: #fff;
flex-shrink: 0;
}
.iframe-title {
font-size: 16px;
font-weight: 600;
color: #1e293b;
}
.content-iframe {
flex: 1;
width: 100%;
height: 100%;
border: none;
background: #fff;
}
.iframe-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
color: $brand-color;
font-size: 14px;
z-index: 10;
.el-icon {
font-size: 32px;
}
}
// ==================== 响应式 ====================
// 响应式
@media (max-width: 768px) {
.sidebar {
width: 64px;
@@ -449,12 +247,12 @@ $brand-color-hover: #004488;
box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
}
}
}
}
.iframe-header {
padding: 0 16px;
.iframe-title {
font-size: 14px;
}
}
// ==================== BlankLayout ====================
.blank-layout {
width: 100%;
height: 100vh;
overflow: hidden;
}

View File

@@ -497,6 +497,6 @@ watch(
)
</script>
<style lang="scss" scoped>
@import url("./SubSidebarLayout.scss");
<style lang="scss">
// 样式已分离到 styles/layouts.scss 统一管理
</style>

View File

@@ -0,0 +1,8 @@
// ==================== Shared Components 样式 ====================
// 导入各组件的 scss 文件
@use '../components/iframe/IframeView.scss';
@use '../components/file/fileupload/FileUpload.scss';
@use '../components/file/fileHistory/FileHistory.scss';
@use '../components/dynamicFormItem/DynamicFormItem.scss';
@use '../components/ai/knowledge/documentSegment/DocumentSegment.scss';

View File

@@ -0,0 +1,6 @@
// ==================== Shared 全局样式 ====================
// 这个文件需要在宿主应用的 main.ts 中导入
// import 'shared/styles'
@use './layouts.scss';
@use './components.scss';

View File

@@ -0,0 +1,9 @@
// ==================== Shared 全局样式入口 ====================
// 这个文件作为样式的 JS 入口,确保 CSS 被正确加载
// 在宿主应用中使用: import 'shared/styles'
// 导入所有样式Vite 会自动处理 CSS 注入)
import './index.scss'
// 导出空对象,让 Module Federation 能正确处理
export {}

View File

@@ -0,0 +1 @@
@use '../layouts/SubSidebarLayout/SubSidebarLayout.scss'

View File

@@ -70,7 +70,11 @@ export default defineConfig({
'./config': './src/config/index.ts',
// ========== Layouts 布局模块 ==========
'./layouts': './src/layouts/index.ts'
'./layouts': './src/layouts/index.ts',
// ========== Styles 样式模块 ==========
// 直接暴露 SCSS 文件,确保 CSS 在远程加载时被正确注入
'./styles': './src/styles/index.scss'
},
// 共享依赖(重要:避免重复加载)
shared: {
@@ -101,9 +105,18 @@ export default defineConfig({
minify: false,
cssCodeSplit: false,
sourcemap: true,
// 确保 CSS 被提取到单独的文件中
cssMinify: true,
rollupOptions: {
output: {
format: 'es'
format: 'es',
// 确保 CSS 文件名可预测
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') {
return 'assets/style.css'
}
return 'assets/[name]-[hash][extname]'
}
}
}
},

View File

@@ -214,5 +214,5 @@ watch(
</script>
<style lang="scss" scoped>
@import url("./SidebarLayout.scss");
@import "./SidebarLayout.scss";
</style>

View File

@@ -5,6 +5,9 @@ import 'element-plus/dist/index.css'
import './assets/css/common.scss'
// 导入 shared 的全局样式Module Federation 远程模块样式)
import 'shared/styles'
import App from './App.vue'
import router from './router/'
import { AES_SECRET_KEY } from './config/index'

View File

@@ -11,7 +11,7 @@
import type { RouteRecordRaw } from 'vue-router'
import router from './index'
import { SidebarLayout, BlankLayout, SubSidebarLayout } from '@/layouts'
import { SidebarLayout } from '@/layouts'
// 动态导入 shared 模块(避免顶层 import 阻塞)
async function loadSharedModules() {
@@ -25,10 +25,11 @@ async function loadSharedModules() {
// Workcase 布局组件映射
const workcaseLayoutMap: Record<string, () => Promise<any>> = {
'SidebarLayout': () => Promise.resolve({ default: SidebarLayout }),
'BlankLayout': () => Promise.resolve({ default: BlankLayout }),
'NavigationLayout': () => Promise.resolve({ default: SidebarLayout }),
'BasicLayout': () => Promise.resolve({ default: SidebarLayout }),
'SubSidebarLayout': () => Promise.resolve({ default: SubSidebarLayout })
// 动态导入 shared 的布局组件,避免静态导入阻塞
'BlankLayout': () => import('shared/layouts').then(m => ({ default: m.BlankLayout })),
'SubSidebarLayout': () => import('shared/layouts').then(m => ({ default: m.SubSidebarLayout }))
}
// 视图组件加载器

View File

@@ -163,7 +163,7 @@ const testAgent = () => {
</script>
<style lang="scss" scoped>
@import url("./AgentView.scss");
@import "./AgentView.scss";
.agent-container {
display: flex;

View File

@@ -184,7 +184,7 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
@import url("./CustomerChatView.scss");
@import "./CustomerChatView.scss";
.chat-container {
display: flex;

View File

@@ -417,5 +417,5 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
@import url("./KnowLedgeView.scss");
@import "./KnowLedgeView.scss";
</style>

View File

@@ -267,7 +267,7 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
@import url("./KnowledgeLogView.scss");
@import "./KnowledgeLogView.scss";
.log-container {
display: flex;

View File

@@ -155,7 +155,7 @@ const exportLogs = () => {
</script>
<style lang="scss" scoped>
@import url("./SystemLogView.scss");
@import "./SystemLogView.scss";
.log-container {
display: flex;

View File

@@ -216,7 +216,7 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
@import url("./WorkcaseLogView.scss");
@import "./WorkcaseLogView.scss";
.log-container {
display: flex;

View File

@@ -346,7 +346,7 @@ const goToAgent = () => {
</script>
<style lang="scss" scoped>
@import url("./OverviewView.scss");
@import "./OverviewView.scss";
.overview-container {
display: flex;

View File

@@ -846,5 +846,5 @@ onMounted(async () => {
</script>
<style scoped lang="scss">
@import url("./AIChatView.scss");
@import "./AIChatView.scss";
</style>

View File

@@ -48,5 +48,5 @@ const handleLoadChat = (chatId: number) => {
</script>
<style scoped lang="scss">
@import url("./ChatHistory.scss");
@import "./ChatHistory.scss";
</style>

View File

@@ -351,7 +351,7 @@ watch(activeTab, async (newVal) => {
})
</script>
<style scoped lang="scss">
@import url("./ChatMessage.scss");
@import "./ChatMessage.scss";
.loading-more,
.no-more {

View File

@@ -730,5 +730,5 @@ onUnmounted(() => {
})
</script>
<style scoped lang="scss">
@import url("./ChatRoomView.scss");
@import "./ChatRoomView.scss";
</style>

View File

@@ -270,5 +270,5 @@ async function handleJoinMeeting() {
}
</script>
<style scoped lang="scss">
@import url('./MeetingCard.scss');
@import './MeetingCard.scss';
</style>

View File

@@ -459,5 +459,5 @@ defineExpose({
</script>
<style scoped lang="scss">
@import url("./ChatRoom.scss");
@import "./ChatRoom.scss";
</style>

View File

@@ -130,5 +130,5 @@ const handleSubmit = async () => {
</script>
<style scoped lang="scss">
@import url('./CommentMessageCard.scss');
@import './CommentMessageCard.scss';
</style>

View File

@@ -316,5 +316,5 @@ onUnmounted(() => {
</script>
<style scoped lang="scss">
@import url('./JitsiMeetingView.scss')
@import './JitsiMeetingView.scss'
</style>

View File

@@ -747,5 +747,5 @@ const submitProcessRecord = async () => {
</script>
<style scoped lang="scss">
@import url("./WorkcaseDetail.scss");
@import "./WorkcaseDetail.scss";
</style>

View File

@@ -339,5 +339,5 @@ function openInBrowser() {
</script>
<style lang="scss" scoped>
@import url("./Meeting.scss")
@import "./Meeting.scss"
</style>