type等
This commit is contained in:
35
urbanLifelineWeb/packages/workcase/index.html
Normal file
35
urbanLifelineWeb/packages/workcase/index.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<title>案例管理系统</title>
|
||||
|
||||
<!-- 加载运行时配置(必须在其他脚本之前加载) -->
|
||||
<script src="/app-config.js"></script>
|
||||
|
||||
<!-- Import Maps 配置 - 引用共享模块 -->
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"@shared/components": "http://localhost:5000/shared/components.js",
|
||||
"@shared/utils": "http://localhost:5000/shared/utils.js",
|
||||
"@shared/api": "http://localhost:5000/shared/api.js",
|
||||
"@shared/composables": "http://localhost:5000/shared/composables.js",
|
||||
"@shared/types": "http://localhost:5000/shared/types.js"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 预加载关键模块 -->
|
||||
<link rel="modulepreload" href="http://localhost:5000/shared/components.js">
|
||||
<link rel="modulepreload" href="http://localhost:5000/shared/utils.js">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<!-- ES Module 入口 -->
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
27
urbanLifelineWeb/packages/workcase/package.json
Normal file
27
urbanLifelineWeb/packages/workcase/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@urbanlifeline/workcase",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --port 5003 --host",
|
||||
"build": "vue-tsc && vite build",
|
||||
"preview": "vite preview --port 5003"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0",
|
||||
"pinia": "^2.2.8",
|
||||
"element-plus": "^2.9.1",
|
||||
"@vueuse/core": "^11.3.0",
|
||||
"axios": "^1.7.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.0.0",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.3",
|
||||
"vue-tsc": "^2.2.0"
|
||||
}
|
||||
}
|
||||
1677
urbanLifelineWeb/packages/workcase/pnpm-lock.yaml
generated
Normal file
1677
urbanLifelineWeb/packages/workcase/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
59
urbanLifelineWeb/packages/workcase/public/app-config.js
Normal file
59
urbanLifelineWeb/packages/workcase/public/app-config.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @description 应用运行时配置文件
|
||||
* @author yslg
|
||||
* @since 2025-12-06
|
||||
*
|
||||
* 说明:
|
||||
* 1. 此文件在生产环境中被加载,用于覆盖内置配置
|
||||
* 2. Docker 部署时,可通过挂载此文件来修改配置,无需重新构建
|
||||
* 3. 配置结构必须与 packages/shared/src/config/index.ts 中的 AppRuntimeConfig 保持一致
|
||||
*
|
||||
* 使用示例(Docker):
|
||||
* docker run -v /path/to/app-config.js:/app/public/app-config.js my-app:latest
|
||||
*/
|
||||
|
||||
window.APP_RUNTIME_CONFIG = {
|
||||
// 环境标识
|
||||
env: 'production',
|
||||
|
||||
// API 配置
|
||||
api: {
|
||||
baseUrl: '/api',
|
||||
timeout: 30000
|
||||
},
|
||||
|
||||
// 应用基础路径
|
||||
baseUrl: '/',
|
||||
|
||||
// 文件配置
|
||||
file: {
|
||||
downloadUrl: '/api/file/download/',
|
||||
uploadUrl: '/api/file/upload',
|
||||
maxSize: {
|
||||
image: 5, // MB
|
||||
video: 100, // MB
|
||||
document: 10 // MB
|
||||
},
|
||||
acceptTypes: {
|
||||
image: 'image/*',
|
||||
video: 'video/*',
|
||||
document: '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx'
|
||||
}
|
||||
},
|
||||
|
||||
// Token 配置
|
||||
token: {
|
||||
key: 'token',
|
||||
refreshThreshold: 300000 // 5分钟
|
||||
},
|
||||
|
||||
// 公共资源路径
|
||||
publicImgPath: '/img',
|
||||
publicWebPath: '/',
|
||||
|
||||
// 功能开关
|
||||
features: {
|
||||
enableDebug: false,
|
||||
enableMockData: false
|
||||
}
|
||||
};
|
||||
32
urbanLifelineWeb/packages/workcase/tsconfig.json
Normal file
32
urbanLifelineWeb/packages/workcase/tsconfig.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"types": ["node"],
|
||||
"jsx": "preserve",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"],
|
||||
"@shared/*": ["../shared/src/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"*.ts",
|
||||
"*.vue"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
||||
49
urbanLifelineWeb/packages/workcase/vite.config.ts
Normal file
49
urbanLifelineWeb/packages/workcase/vite.config.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import { resolve, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = dirname(__filename)
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue(), vueJsx()],
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, 'src')
|
||||
}
|
||||
},
|
||||
|
||||
server: {
|
||||
port: 5003,
|
||||
host: true,
|
||||
cors: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
rewrite: (path: string) => path.replace(/^\/api/, '')
|
||||
},
|
||||
// 代理共享模块请求到 shared 服务
|
||||
'/shared': {
|
||||
target: 'http://localhost:5000',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
||||
'element-plus': ['element-plus']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user