type等
This commit is contained in:
35
urbanLifelineWeb/packages/bidding/index.html
Normal file
35
urbanLifelineWeb/packages/bidding/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/bidding/package.json
Normal file
27
urbanLifelineWeb/packages/bidding/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@urbanlifeline/bidding",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --port 5002 --host",
|
||||
"build": "vue-tsc && vite build",
|
||||
"preview": "vite preview --port 5002"
|
||||
},
|
||||
"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/bidding/pnpm-lock.yaml
generated
Normal file
1677
urbanLifelineWeb/packages/bidding/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
59
urbanLifelineWeb/packages/bidding/public/app-config.js
Normal file
59
urbanLifelineWeb/packages/bidding/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/bidding/tsconfig.json
Normal file
32
urbanLifelineWeb/packages/bidding/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/bidding/vite.config.ts
Normal file
49
urbanLifelineWeb/packages/bidding/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: 5002,
|
||||
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']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -6,6 +6,9 @@
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<title>泰豪电源 AI 数智化平台</title>
|
||||
|
||||
<!-- 加载运行时配置(必须在其他脚本之前加载) -->
|
||||
<script src="/app-config.js"></script>
|
||||
|
||||
<!-- Import Maps 配置 - 只配置共享模块 -->
|
||||
<script type="importmap">
|
||||
{
|
||||
|
||||
27
urbanLifelineWeb/packages/platform/package.json
Normal file
27
urbanLifelineWeb/packages/platform/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@urbanlifeline/platform",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --port 5001 --host",
|
||||
"build": "vue-tsc && vite build",
|
||||
"preview": "vite preview --port 5001"
|
||||
},
|
||||
"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/platform/pnpm-lock.yaml
generated
Normal file
1677
urbanLifelineWeb/packages/platform/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
59
urbanLifelineWeb/packages/platform/public/app-config.js
Normal file
59
urbanLifelineWeb/packages/platform/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/platform/tsconfig.json
Normal file
32
urbanLifelineWeb/packages/platform/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/platform/vite.config.ts
Normal file
49
urbanLifelineWeb/packages/platform/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: 5001,
|
||||
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']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
4398
urbanLifelineWeb/packages/shared/package-lock.json
generated
Normal file
4398
urbanLifelineWeb/packages/shared/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,25 +4,27 @@
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite --port 5000 --host",
|
||||
"dev": "vite",
|
||||
"build": "run-p build:*",
|
||||
"build:esm": "vite build --mode esm",
|
||||
"build:federation": "vite build --mode federation",
|
||||
"preview": "vite preview --port 5000"
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0",
|
||||
"pinia": "^2.2.8",
|
||||
"element-plus": "^2.9.1",
|
||||
"@vueuse/core": "^11.3.0"
|
||||
"ofetch": "^1.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.10.0",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.3",
|
||||
"@originjs/vite-plugin-federation": "^1.3.6",
|
||||
"npm-run-all": "^4.1.5"
|
||||
"npm-run-all": "^4.1.5",
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.5.13",
|
||||
"typescript": ">=5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
2312
urbanLifelineWeb/packages/shared/pnpm-lock.yaml
generated
Normal file
2312
urbanLifelineWeb/packages/shared/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
298
urbanLifelineWeb/packages/shared/src/api/index.ts
Normal file
298
urbanLifelineWeb/packages/shared/src/api/index.ts
Normal file
@@ -0,0 +1,298 @@
|
||||
import axios, { AxiosResponse, AxiosError, InternalAxiosRequestConfig } from "axios";
|
||||
import { ElLoading, ElMessage } from "element-plus";
|
||||
import type { ResultDomain } from "@/types";
|
||||
import { API_BASE_URL } from "@/config";
|
||||
|
||||
/**
|
||||
* 扩展AxiosRequestConfig以支持自定义配置
|
||||
*/
|
||||
interface CustomAxiosRequestConfig extends Partial<InternalAxiosRequestConfig> {
|
||||
/** 是否显示加载动画 */
|
||||
showLoading?: boolean;
|
||||
/** 是否显示错误提示 */
|
||||
showError?: boolean;
|
||||
/** 是否需要token */
|
||||
requiresAuth?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Token管理
|
||||
*/
|
||||
export const TokenManager = {
|
||||
/** 获取token(从localStorage获取并检查过期) */
|
||||
getToken(): string | null {
|
||||
const itemStr = localStorage.getItem('token');
|
||||
if (!itemStr) return null;
|
||||
|
||||
try {
|
||||
const item = JSON.parse(itemStr);
|
||||
const now = Date.now();
|
||||
|
||||
// 检查是否过期
|
||||
if (item.timestamp && item.expiresIn) {
|
||||
if (now - item.timestamp > item.expiresIn) {
|
||||
// 已过期,删除
|
||||
localStorage.removeItem('token');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return item.value || itemStr; // 兼容旧数据
|
||||
} catch {
|
||||
// 如果不是JSON格式,直接返回(兼容旧数据)
|
||||
return itemStr;
|
||||
}
|
||||
},
|
||||
|
||||
/** 设置token(始终使用localStorage,根据rememberMe设置过期时间) */
|
||||
setToken(token: string, rememberMe = false): void {
|
||||
const data = {
|
||||
value: token,
|
||||
timestamp: Date.now(),
|
||||
// 如果不勾选"记住我",设置1天过期时间;勾选则7天
|
||||
expiresIn: rememberMe ? 7 * 24 * 60 * 60 * 1000 : 1 * 24 * 60 * 60 * 1000
|
||||
};
|
||||
localStorage.setItem('token', JSON.stringify(data));
|
||||
},
|
||||
|
||||
/** 移除token */
|
||||
removeToken(): void {
|
||||
localStorage.removeItem('token');
|
||||
},
|
||||
|
||||
/** 检查是否有token */
|
||||
hasToken(): boolean {
|
||||
return !!this.getToken();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 创建axios实例
|
||||
*
|
||||
* 说明:
|
||||
* - 统一使用配置模块提供的 API_BASE_URL 作为基础路径
|
||||
* - API_BASE_URL 在开发环境来自 devConfig,在生产环境来自 window.APP_RUNTIME_CONFIG
|
||||
*/
|
||||
const request = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
timeout: 30000,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
}
|
||||
});
|
||||
|
||||
let loadingInstance: ReturnType<typeof ElLoading.service> | null = null;
|
||||
|
||||
/**
|
||||
* 请求拦截器
|
||||
*/
|
||||
request.interceptors.request.use(
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
const customConfig = config as CustomAxiosRequestConfig;
|
||||
|
||||
// 默认不显示加载动画,只有 showLoading 为 true 时才展示
|
||||
if (customConfig.showLoading === true) {
|
||||
loadingInstance = ElLoading.service({
|
||||
lock: true,
|
||||
text: "加载中...",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
}
|
||||
|
||||
// 添加token
|
||||
const token = TokenManager.getToken();
|
||||
if (token && config.headers) {
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
// 自动处理 FormData:删除 Content-Type,让浏览器自动设置(包含 boundary)
|
||||
if (config.data instanceof FormData && config.headers) {
|
||||
delete config.headers['Content-Type'];
|
||||
}
|
||||
|
||||
return config;
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
if (loadingInstance) {
|
||||
loadingInstance.close();
|
||||
loadingInstance = null;
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 响应拦截器
|
||||
*/
|
||||
request.interceptors.response.use(
|
||||
(response: AxiosResponse<ResultDomain<any>>) => {
|
||||
// 关闭加载动画
|
||||
if (loadingInstance) {
|
||||
loadingInstance.close();
|
||||
loadingInstance = null;
|
||||
}
|
||||
|
||||
const result = response.data;
|
||||
|
||||
// 检查是否为ResultDomain格式
|
||||
if (result && typeof result === 'object' && 'code' in result) {
|
||||
// 检查登录状态
|
||||
if (result.login === false) {
|
||||
ElMessage.error(result.message || '请先登录');
|
||||
TokenManager.removeToken();
|
||||
// 跳转到登录页
|
||||
window.location.href = '/login';
|
||||
return Promise.reject(new Error('未登录'));
|
||||
}
|
||||
|
||||
// 检查权限
|
||||
if (result.auth === false) {
|
||||
ElMessage.error(result.message || '没有权限访问');
|
||||
return Promise.reject(new Error('无权限'));
|
||||
}
|
||||
|
||||
// // 检查业务逻辑是否成功 业务逻辑不应该提前判断
|
||||
// if (!result.success) {
|
||||
// const config = response.config as CustomAxiosRequestConfig;
|
||||
// if (config.showError !== false) {
|
||||
// ElMessage.error(result.message || '操作失败');
|
||||
// }
|
||||
// return Promise.reject(new Error(result.message || '操作失败'));
|
||||
// }
|
||||
|
||||
// 返回成功的数据
|
||||
return response;
|
||||
}
|
||||
|
||||
// 非ResultDomain格式,直接返回
|
||||
return response;
|
||||
},
|
||||
(error: AxiosError<ResultDomain<any>>) => {
|
||||
// 关闭加载动画
|
||||
if (loadingInstance) {
|
||||
loadingInstance.close();
|
||||
loadingInstance = null;
|
||||
}
|
||||
|
||||
const config = error.config as CustomAxiosRequestConfig;
|
||||
|
||||
// 处理HTTP错误
|
||||
if (error.response) {
|
||||
const { status, data } = error.response;
|
||||
|
||||
switch (status) {
|
||||
case 401:
|
||||
ElMessage.error('认证失败,请重新登录');
|
||||
TokenManager.removeToken();
|
||||
window.location.href = '/login';
|
||||
break;
|
||||
case 403:
|
||||
ElMessage.error('没有权限访问该资源');
|
||||
break;
|
||||
case 404:
|
||||
ElMessage.error('请求的资源不存在');
|
||||
break;
|
||||
case 500:
|
||||
ElMessage.error(data?.message || '服务器内部错误');
|
||||
break;
|
||||
default:
|
||||
if (config?.showError !== false) {
|
||||
ElMessage.error(data?.message || '请求失败');
|
||||
}
|
||||
}
|
||||
} else if (error.request) {
|
||||
// 请求已发送但没有收到响应
|
||||
ElMessage.error('网络错误,请检查网络连接');
|
||||
} else {
|
||||
// 其他错误
|
||||
if (config?.showError !== false) {
|
||||
ElMessage.error(error.message || '请求失败');
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* API封装
|
||||
*/
|
||||
export const api = {
|
||||
/**
|
||||
* GET请求 - data参数会作为URL查询参数追加
|
||||
*/
|
||||
get<T = any>(url: string, data?: any, config?: CustomAxiosRequestConfig): Promise<AxiosResponse<ResultDomain<T>>> {
|
||||
// 如果有data参数,将其转换为URL查询参数
|
||||
if (data) {
|
||||
const params = new URLSearchParams();
|
||||
Object.keys(data).forEach(key => {
|
||||
if (data[key] !== undefined && data[key] !== null) {
|
||||
params.append(key, String(data[key]));
|
||||
}
|
||||
});
|
||||
const queryString = params.toString();
|
||||
url += (url.includes('?') ? '&' : '?') + queryString;
|
||||
}
|
||||
return request.get<ResultDomain<T>>(url, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* POST请求 - data参数放到请求体
|
||||
*/
|
||||
post<T = any>(url: string, data?: any, config?: CustomAxiosRequestConfig): Promise<AxiosResponse<ResultDomain<T>>> {
|
||||
return request.post<ResultDomain<T>>(url, data, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* PUT请求 - data参数放到请求体
|
||||
*/
|
||||
put<T = any>(url: string, data?: any, config?: CustomAxiosRequestConfig): Promise<AxiosResponse<ResultDomain<T>>> {
|
||||
return request.put<ResultDomain<T>>(url, data, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* DELETE请求 - data参数放到请求体
|
||||
*/
|
||||
delete<T = any>(url: string, data?: any, config?: CustomAxiosRequestConfig): Promise<AxiosResponse<ResultDomain<T>>> {
|
||||
return request.delete<ResultDomain<T>>(url, { ...config, data });
|
||||
},
|
||||
|
||||
/**
|
||||
* PATCH请求 - data参数放到请求体
|
||||
*/
|
||||
patch<T = any>(url: string, data?: any, config?: CustomAxiosRequestConfig): Promise<AxiosResponse<ResultDomain<T>>> {
|
||||
return request.patch<ResultDomain<T>>(url, data, config);
|
||||
},
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*/
|
||||
upload<T = any>(url: string, formData: FormData, config?: CustomAxiosRequestConfig): Promise<AxiosResponse<ResultDomain<T>>> {
|
||||
return request.post<ResultDomain<T>>(url, formData, {
|
||||
...config,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
...(config?.headers as Record<string, string>)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 文件下载
|
||||
*/
|
||||
download(url: string, filename?: string, config?: CustomAxiosRequestConfig): Promise<void> {
|
||||
return request.get(url, {
|
||||
...config,
|
||||
responseType: 'blob'
|
||||
}).then((response) => {
|
||||
const blob = new Blob([response.data]);
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = filename || 'download';
|
||||
link.click();
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default request;
|
||||
226
urbanLifelineWeb/packages/shared/src/config/index.ts
Normal file
226
urbanLifelineWeb/packages/shared/src/config/index.ts
Normal file
@@ -0,0 +1,226 @@
|
||||
/**
|
||||
* @description 应用运行时配置
|
||||
* @author yslg
|
||||
* @since 2025-12-06
|
||||
*
|
||||
* 配置加载策略:
|
||||
* 1. 开发环境:使用下面定义的开发配置
|
||||
* 2. 生产环境:从 window.APP_RUNTIME_CONFIG 读取(来自 app-config.js)
|
||||
* 3. Docker部署:替换 app-config.js 文件实现配置外挂
|
||||
*
|
||||
* 配置结构说明:
|
||||
* 此文件的配置结构与 app-config.js 完全对应
|
||||
* 修改 app-config.js 后,这里的配置会自动应用
|
||||
*/
|
||||
|
||||
// ============================================
|
||||
// 类型定义
|
||||
// ============================================
|
||||
export interface AppRuntimeConfig {
|
||||
env?: string;
|
||||
api: {
|
||||
baseUrl: string;
|
||||
timeout: number;
|
||||
};
|
||||
baseUrl: string;
|
||||
file: {
|
||||
downloadUrl: string;
|
||||
uploadUrl: string;
|
||||
maxSize: {
|
||||
image: number;
|
||||
video: number;
|
||||
document: number;
|
||||
};
|
||||
acceptTypes: {
|
||||
image: string;
|
||||
video: string;
|
||||
document: string;
|
||||
};
|
||||
};
|
||||
token: {
|
||||
key: string;
|
||||
refreshThreshold: number;
|
||||
};
|
||||
publicImgPath: string;
|
||||
publicWebPath: string;
|
||||
features?: {
|
||||
enableDebug?: boolean;
|
||||
enableMockData?: boolean;
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 配置定义(与 app-config.js 结构一致)
|
||||
// ============================================
|
||||
const isDev = (import.meta as any).env?.DEV ?? false;
|
||||
|
||||
// 开发环境配置
|
||||
const devConfig: AppRuntimeConfig = {
|
||||
env: 'development',
|
||||
|
||||
api: {
|
||||
// 开发环境通过 Vite 代理转发到后端,避免浏览器直接跨域
|
||||
// 实际请求路径示例:/api/... → 由代理转发到实际后端
|
||||
baseUrl: '/api',
|
||||
timeout: 30000
|
||||
},
|
||||
|
||||
baseUrl: '/',
|
||||
|
||||
file: {
|
||||
// 同样走代理,保持与 api.baseUrl 一致
|
||||
downloadUrl: '/api/file/download/',
|
||||
uploadUrl: '/api/file/upload',
|
||||
maxSize: {
|
||||
image: 5,
|
||||
video: 100,
|
||||
document: 10
|
||||
},
|
||||
acceptTypes: {
|
||||
image: 'image/*',
|
||||
video: 'video/*',
|
||||
document: '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx'
|
||||
}
|
||||
},
|
||||
|
||||
token: {
|
||||
key: 'token',
|
||||
refreshThreshold: 300000
|
||||
},
|
||||
|
||||
publicImgPath: 'http://localhost:5173/img',
|
||||
publicWebPath: 'http://localhost:5173',
|
||||
|
||||
features: {
|
||||
enableDebug: true,
|
||||
enableMockData: false
|
||||
}
|
||||
};
|
||||
|
||||
// 生产环境默认配置(兜底)
|
||||
const prodDefaultConfig: AppRuntimeConfig = {
|
||||
env: 'production',
|
||||
|
||||
api: {
|
||||
baseUrl: '/api',
|
||||
timeout: 30000
|
||||
},
|
||||
|
||||
baseUrl: '/',
|
||||
|
||||
file: {
|
||||
downloadUrl: '/api/file/download/',
|
||||
uploadUrl: '/api/file/upload',
|
||||
maxSize: {
|
||||
image: 5,
|
||||
video: 100,
|
||||
document: 10
|
||||
},
|
||||
acceptTypes: {
|
||||
image: 'image/*',
|
||||
video: 'video/*',
|
||||
document: '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx'
|
||||
}
|
||||
},
|
||||
|
||||
token: {
|
||||
key: 'token',
|
||||
refreshThreshold: 300000
|
||||
},
|
||||
|
||||
publicImgPath: '/img',
|
||||
publicWebPath: '/',
|
||||
|
||||
features: {
|
||||
enableDebug: false,
|
||||
enableMockData: false
|
||||
}
|
||||
};
|
||||
|
||||
// ============================================
|
||||
// 配置加载
|
||||
// ============================================
|
||||
|
||||
/**
|
||||
* 获取运行时配置
|
||||
* 生产环境优先从 window.APP_RUNTIME_CONFIG 读取(app-config.js 注入)
|
||||
*/
|
||||
const getRuntimeConfig = (): AppRuntimeConfig => {
|
||||
if (isDev) {
|
||||
console.log('[配置] 开发环境,使用内置配置');
|
||||
return devConfig;
|
||||
}
|
||||
|
||||
// 生产环境:尝试读取外部配置
|
||||
try {
|
||||
const runtimeConfig = (window as any).APP_RUNTIME_CONFIG;
|
||||
if (runtimeConfig && typeof runtimeConfig === 'object') {
|
||||
console.log('[配置] 加载外部配置 app-config.js');
|
||||
console.log('[配置] API地址:', runtimeConfig.api?.baseUrl);
|
||||
console.log('[配置] 环境:', runtimeConfig.env || 'production');
|
||||
return runtimeConfig as AppRuntimeConfig;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[配置] 无法读取外部配置,使用默认配置', e);
|
||||
}
|
||||
|
||||
console.log('[配置] 使用默认生产配置');
|
||||
return prodDefaultConfig;
|
||||
};
|
||||
|
||||
// 当前应用配置
|
||||
const config = getRuntimeConfig();
|
||||
console.log('[配置] 当前配置', config);
|
||||
|
||||
// ============================================
|
||||
// 导出配置(向后兼容)
|
||||
// ============================================
|
||||
|
||||
// 单独导出常用配置项
|
||||
export const API_BASE_URL = config.api.baseUrl;
|
||||
export const FILE_DOWNLOAD_URL = config.file.downloadUrl;
|
||||
export const PUBLIC_IMG_PATH = config.publicImgPath;
|
||||
export const PUBLIC_WEB_PATH = config.publicWebPath;
|
||||
|
||||
// 导出完整配置对象
|
||||
export const APP_CONFIG = {
|
||||
// 应用标题
|
||||
title: '泰豪电源 AI 数智化平台',
|
||||
|
||||
// 环境标识
|
||||
env: config.env || 'production',
|
||||
|
||||
// 应用基础路径
|
||||
baseUrl: config.baseUrl,
|
||||
|
||||
// API 配置
|
||||
api: {
|
||||
baseUrl: config.api.baseUrl,
|
||||
timeout: config.api.timeout
|
||||
},
|
||||
|
||||
// 文件配置
|
||||
file: {
|
||||
downloadUrl: config.file.downloadUrl,
|
||||
uploadUrl: config.file.uploadUrl,
|
||||
maxSize: config.file.maxSize,
|
||||
acceptTypes: config.file.acceptTypes
|
||||
},
|
||||
|
||||
// Token 配置
|
||||
token: {
|
||||
key: config.token.key,
|
||||
refreshThreshold: config.token.refreshThreshold
|
||||
},
|
||||
|
||||
// 公共路径
|
||||
publicImgPath: config.publicImgPath,
|
||||
publicWebPath: config.publicWebPath,
|
||||
|
||||
// 功能开关
|
||||
features: config.features || {}
|
||||
};
|
||||
|
||||
// 默认导出
|
||||
export default APP_CONFIG;
|
||||
139
urbanLifelineWeb/packages/shared/src/types/agent/agent.ts
Normal file
139
urbanLifelineWeb/packages/shared/src/types/agent/agent.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
/**
|
||||
* Agent服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
import { BaseVO, BaseDTO } from "@/types/base"
|
||||
|
||||
// KnowledgeBaseVO - 知识库
|
||||
export interface KnowledgeBaseVO extends BaseVO {
|
||||
/** 知识库ID */
|
||||
knowledgeId?: string
|
||||
/** 智能体ID */
|
||||
agentId?: string
|
||||
/** 智能体名称 */
|
||||
agentName?: string
|
||||
/** 知识库名称 */
|
||||
name?: string
|
||||
/** 知识库类型 */
|
||||
kbType?: string
|
||||
/** 知识库类型名称 */
|
||||
kbTypeName?: string
|
||||
/** 访问级别 */
|
||||
accessLevel?: string
|
||||
/** 访问级别名称 */
|
||||
accessLevelName?: string
|
||||
/** 知识库描述 */
|
||||
description?: string
|
||||
/** 存储路径 */
|
||||
storagePath?: string
|
||||
/** 当前版本号 */
|
||||
version?: string
|
||||
/** 知识库配置 */
|
||||
config?: Record<string, any>
|
||||
/** 服务类型 */
|
||||
serviceType?: string
|
||||
/** 部门名称 */
|
||||
deptName?: string
|
||||
}
|
||||
|
||||
// KnowledgeDocumentVO - 知识文档
|
||||
export interface KnowledgeDocumentVO extends BaseVO {
|
||||
/** 文档ID */
|
||||
documentId?: string
|
||||
/** 知识库ID */
|
||||
knowledgeId?: string
|
||||
/** 文档名称 */
|
||||
name?: string
|
||||
/** 文档类型 */
|
||||
docType?: string
|
||||
/** 文档内容 */
|
||||
content?: string
|
||||
/** 文档描述 */
|
||||
description?: string
|
||||
/** 文档状态 */
|
||||
status?: string
|
||||
/** 文件路径 */
|
||||
filePath?: string
|
||||
/** 文件大小 */
|
||||
fileSize?: number
|
||||
}
|
||||
|
||||
// KnowledgeChunkVO - 知识块(分块存储)
|
||||
export interface KnowledgeChunkVO extends BaseVO {
|
||||
/** 块ID */
|
||||
chunkId?: string
|
||||
/** 文档ID */
|
||||
documentId?: string
|
||||
/** 知识库ID */
|
||||
knowledgeId?: string
|
||||
/** 块内容 */
|
||||
content?: string
|
||||
/** 块索引 */
|
||||
chunkIndex?: number
|
||||
/** 向量嵌入 */
|
||||
embedding?: number[]
|
||||
/** 相似度 */
|
||||
similarity?: number
|
||||
}
|
||||
|
||||
// KnowledgeBaseDTO - 知识库DTO(创建和更新)
|
||||
export interface KnowledgeBaseDTO extends BaseDTO {
|
||||
/** 知识库ID */
|
||||
knowledgeId?: string
|
||||
/** 智能体ID */
|
||||
agentId?: string
|
||||
/** 知识库名称 */
|
||||
name?: string
|
||||
/** 知识库类型 */
|
||||
kbType?: string
|
||||
/** 访问级别 */
|
||||
accessLevel?: string
|
||||
/** 知识库描述 */
|
||||
description?: string
|
||||
/** 存储路径 */
|
||||
storagePath?: string
|
||||
/** 当前版本号 */
|
||||
version?: string
|
||||
/** 知识库配置 */
|
||||
config?: Record<string, any>
|
||||
/** 服务类型 */
|
||||
serviceType?: string
|
||||
}
|
||||
|
||||
// KnowledgeDocumentDTO - 知识文档DTO(创建和更新)
|
||||
export interface KnowledgeDocumentDTO extends BaseDTO {
|
||||
/** 文档ID */
|
||||
documentId?: string
|
||||
/** 知识库ID */
|
||||
knowledgeId?: string
|
||||
/** 文档名称 */
|
||||
name?: string
|
||||
/** 文档类型 */
|
||||
docType?: string
|
||||
/** 文档内容 */
|
||||
content?: string
|
||||
/** 文档描述 */
|
||||
description?: string
|
||||
/** 文档状态 */
|
||||
status?: string
|
||||
/** 文件路径 */
|
||||
filePath?: string
|
||||
/** 文件大小 */
|
||||
fileSize?: number
|
||||
}
|
||||
|
||||
// KnowledgeChunkDTO - 知识块DTO(创建和更新)
|
||||
export interface KnowledgeChunkDTO extends BaseDTO {
|
||||
/** 块ID */
|
||||
chunkId?: string
|
||||
/** 文档ID */
|
||||
documentId?: string
|
||||
/** 知识库ID */
|
||||
knowledgeId?: string
|
||||
/** 块内容 */
|
||||
content?: string
|
||||
/** 块索引 */
|
||||
chunkIndex?: number
|
||||
/** 向量嵌入 */
|
||||
embedding?: number[]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./agent"
|
||||
41
urbanLifelineWeb/packages/shared/src/types/auth/auth.ts
Normal file
41
urbanLifelineWeb/packages/shared/src/types/auth/auth.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 认证服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
// LoginParam - 登录参数
|
||||
export interface LoginParam {
|
||||
/** 登录用户名或邮箱或手机 */
|
||||
username?: string
|
||||
/** 登录密码 */
|
||||
password?: string
|
||||
/** 验证码 */
|
||||
captcha?: string
|
||||
/** 验证码ID */
|
||||
captchaId?: string
|
||||
/** 登录方式:password/captcha/oauth */
|
||||
loginType?: string
|
||||
}
|
||||
|
||||
// LoginDomain - 登录信息
|
||||
export interface LoginDomain {
|
||||
/** 用户ID */
|
||||
userId?: string
|
||||
/** 用户名 */
|
||||
username?: string
|
||||
/** 邮箱 */
|
||||
email?: string
|
||||
/** 手机 */
|
||||
phone?: string
|
||||
/** 访问令牌 */
|
||||
accessToken?: string
|
||||
/** 刷新令牌 */
|
||||
refreshToken?: string
|
||||
/** 令牌类型 */
|
||||
tokenType?: string
|
||||
/** 过期时间(秒) */
|
||||
expiresIn?: number
|
||||
/** 用户权限列表 */
|
||||
permissions?: string[]
|
||||
/** 用户角色列表 */
|
||||
roles?: string[]
|
||||
}
|
||||
1
urbanLifelineWeb/packages/shared/src/types/auth/index.ts
Normal file
1
urbanLifelineWeb/packages/shared/src/types/auth/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./auth"
|
||||
38
urbanLifelineWeb/packages/shared/src/types/base/index.ts
Normal file
38
urbanLifelineWeb/packages/shared/src/types/base/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* 基础DTO - 包含所有数据传输对象的公共字段
|
||||
*/
|
||||
export interface BaseDTO {
|
||||
/** 操作流水号 */
|
||||
optsn?: string
|
||||
/** 创建人 */
|
||||
creator?: string
|
||||
/** 更新人 */
|
||||
updater?: string
|
||||
/** 部门路径 */
|
||||
deptPath?: string
|
||||
/** 备注 */
|
||||
remark?: string
|
||||
/** 创建时间 */
|
||||
createTime?: string
|
||||
/** 更新时间 */
|
||||
updateTime?: string
|
||||
/** 删除时间 */
|
||||
deleteTime?: string
|
||||
/** 是否已删除 */
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础VO - 包含所有实体的公共字段
|
||||
*/
|
||||
export interface BaseVO extends BaseDTO {
|
||||
/** 主键ID */
|
||||
id?: string
|
||||
|
||||
orderTypes?: OrderType[]
|
||||
}
|
||||
|
||||
export interface OrderType {
|
||||
field: string
|
||||
order: 'ASC' | 'DESC'
|
||||
}
|
||||
117
urbanLifelineWeb/packages/shared/src/types/bidding/bidding.ts
Normal file
117
urbanLifelineWeb/packages/shared/src/types/bidding/bidding.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* 竞价服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
import { BaseVO, BaseDTO } from "@/types/base"
|
||||
|
||||
// BiddingProjectVO - 招标项目详情
|
||||
export interface BiddingProjectVO extends BaseVO {
|
||||
/** 项目ID */
|
||||
projectId?: string
|
||||
/** 项目编号 */
|
||||
projectNo?: string
|
||||
/** 项目名称 */
|
||||
projectName?: string
|
||||
/** 项目类型 */
|
||||
projectType?: string
|
||||
/** 项目类型名称(中文) */
|
||||
projectTypeName?: string
|
||||
/** 所属行业 */
|
||||
industry?: string
|
||||
/** 来源平台 */
|
||||
sourcePlatform?: string
|
||||
/** 来源URL */
|
||||
sourceUrl?: string
|
||||
/** 发布日期 */
|
||||
publishDate?: string
|
||||
/** 投标截止日期 */
|
||||
deadline?: string
|
||||
/** 开标日期 */
|
||||
openingDate?: string
|
||||
/** 距离截止日期剩余天数 */
|
||||
daysUntilDeadline?: number
|
||||
/** 预算金额 */
|
||||
budgetAmount?: number
|
||||
/** 货币单位 */
|
||||
currency?: string
|
||||
/** 预算金额格式化显示 */
|
||||
budgetAmountFormatted?: string
|
||||
/** 项目状态 */
|
||||
projectStatus?: string
|
||||
/** 项目状态名称(中文) */
|
||||
projectStatusName?: string
|
||||
/** 中标状态 */
|
||||
winningStatus?: string
|
||||
/** 中标状态名称(中文) */
|
||||
winningStatusName?: string
|
||||
/** 中标金额 */
|
||||
winningAmount?: number
|
||||
/** 中标金额格式化显示 */
|
||||
winningAmountFormatted?: string
|
||||
/** 客户名称 */
|
||||
clientName?: string
|
||||
/** 客户联系方式 */
|
||||
clientContact?: string
|
||||
/** 联系人 */
|
||||
contactPerson?: string
|
||||
/** 项目地点 */
|
||||
projectLocation?: string
|
||||
/** 项目描述 */
|
||||
description?: string
|
||||
/** 关键词 */
|
||||
keywords?: string[]
|
||||
/** 负责人 */
|
||||
responsibleUser?: string
|
||||
/** 团队成员 */
|
||||
teamMembers?: string[]
|
||||
}
|
||||
|
||||
// BiddingProjectDTO - 招标项目DTO(创建和更新)
|
||||
export interface BiddingProjectDTO extends BaseDTO {
|
||||
/** 项目ID(更新时需要) */
|
||||
projectId?: string
|
||||
/** 项目编号 */
|
||||
projectNo?: string
|
||||
/** 项目名称 */
|
||||
projectName?: string
|
||||
/** 项目类型 */
|
||||
projectType?: string
|
||||
/** 所属行业 */
|
||||
industry?: string
|
||||
/** 来源平台 */
|
||||
sourcePlatform?: string
|
||||
/** 来源URL */
|
||||
sourceUrl?: string
|
||||
/** 发布日期 */
|
||||
publishDate?: string
|
||||
/** 投标截止日期 */
|
||||
deadline?: string
|
||||
/** 开标日期 */
|
||||
openingDate?: string
|
||||
/** 预算金额 */
|
||||
budgetAmount?: number
|
||||
/** 货币单位 */
|
||||
currency?: string
|
||||
/** 项目状态 */
|
||||
projectStatus?: string
|
||||
/** 中标状态 */
|
||||
winningStatus?: string
|
||||
/** 中标金额 */
|
||||
winningAmount?: number
|
||||
/** 客户名称 */
|
||||
clientName?: string
|
||||
/** 客户联系方式 */
|
||||
clientContact?: string
|
||||
/** 联系人 */
|
||||
contactPerson?: string
|
||||
/** 项目地点 */
|
||||
projectLocation?: string
|
||||
/** 项目描述 */
|
||||
description?: string
|
||||
/** 关键词 */
|
||||
keywords?: string[]
|
||||
/** 负责人 */
|
||||
responsibleUser?: string
|
||||
/** 团队成员 */
|
||||
teamMembers?: string[]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./bidding"
|
||||
121
urbanLifelineWeb/packages/shared/src/types/crontab/crontab.ts
Normal file
121
urbanLifelineWeb/packages/shared/src/types/crontab/crontab.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
/**
|
||||
* 定时任务服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
import { BaseVO, BaseDTO } from "@/types/base"
|
||||
|
||||
// CrontabTaskVO - 定时任务详情
|
||||
export interface CrontabTaskVO extends BaseVO {
|
||||
/** 任务ID */
|
||||
taskId?: string
|
||||
/** 任务名称 */
|
||||
taskName?: string
|
||||
/** 任务分组 */
|
||||
taskGroup?: string
|
||||
/** 任务元数据ID */
|
||||
metaId?: string
|
||||
/** 元数据名称 */
|
||||
metaName?: string
|
||||
/** 是否使用默认接收人 */
|
||||
defaultRecipient?: boolean
|
||||
/** Bean名称 */
|
||||
beanName?: string
|
||||
/** 方法名称 */
|
||||
methodName?: string
|
||||
/** 方法参数 */
|
||||
methodParams?: string
|
||||
/** Cron表达式 */
|
||||
cronExpression?: string
|
||||
/** Cron表达式描述(中文) */
|
||||
cronDescription?: string
|
||||
/** 任务状态 */
|
||||
status?: number
|
||||
/** 任务状态名称 */
|
||||
statusName?: string
|
||||
/** 任务描述 */
|
||||
description?: string
|
||||
/** 是否允许并发执行 */
|
||||
concurrent?: boolean
|
||||
/** 错过执行策略 */
|
||||
misfirePolicy?: number
|
||||
/** 错过执行策略名称 */
|
||||
misfirePolicyName?: string
|
||||
/** 下次执行时间 */
|
||||
nextExecuteTime?: string
|
||||
/** 最后执行时间 */
|
||||
lastExecuteTime?: string
|
||||
/** 最后执行状态:0-失败/1-成功 */
|
||||
lastExecuteStatus?: number
|
||||
}
|
||||
|
||||
// TbCrontabTaskDTO - 定时任务DTO(创建和更新)
|
||||
export interface TbCrontabTaskDTO extends BaseDTO {
|
||||
/** 任务ID(更新时需要) */
|
||||
taskId?: string
|
||||
/** 任务名称 */
|
||||
taskName?: string
|
||||
/** 任务分组 */
|
||||
taskGroup?: string
|
||||
/** 任务元数据ID */
|
||||
metaId?: string
|
||||
/** 是否使用默认接收人 */
|
||||
defaultRecipient?: boolean
|
||||
/** Bean名称 */
|
||||
beanName?: string
|
||||
/** 方法名称 */
|
||||
methodName?: string
|
||||
/** 方法参数 */
|
||||
methodParams?: string
|
||||
/** Cron表达式 */
|
||||
cronExpression?: string
|
||||
/** 任务状态 */
|
||||
status?: number
|
||||
/** 任务描述 */
|
||||
description?: string
|
||||
/** 是否允许并发执行 */
|
||||
concurrent?: boolean
|
||||
/** 错过执行策略 */
|
||||
misfirePolicy?: number
|
||||
}
|
||||
|
||||
// CrontabLogVO - 定时任务执行日志
|
||||
export interface CrontabLogVO extends BaseVO {
|
||||
/** 日志ID */
|
||||
logId?: string
|
||||
/** 任务ID */
|
||||
taskId?: string
|
||||
/** 任务名称 */
|
||||
taskName?: string
|
||||
/** 执行状态 */
|
||||
status?: number
|
||||
/** 执行状态名称 */
|
||||
statusName?: string
|
||||
/** 执行开始时间 */
|
||||
startTime?: string
|
||||
/** 执行结束时间 */
|
||||
endTime?: string
|
||||
/** 执行耗时(毫秒) */
|
||||
duration?: number
|
||||
/** 执行结果 */
|
||||
result?: string
|
||||
/** 错误信息 */
|
||||
errorMessage?: string
|
||||
}
|
||||
|
||||
// TbCrontabLogDTO - 定时任务日志DTO
|
||||
export interface TbCrontabLogDTO extends BaseDTO {
|
||||
/** 日志ID */
|
||||
logId?: string
|
||||
/** 任务ID */
|
||||
taskId?: string
|
||||
/** 执行状态 */
|
||||
status?: number
|
||||
/** 执行开始时间 */
|
||||
startTime?: string
|
||||
/** 执行结束时间 */
|
||||
endTime?: string
|
||||
/** 执行结果 */
|
||||
result?: string
|
||||
/** 错误信息 */
|
||||
errorMessage?: string
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./crontab"
|
||||
27
urbanLifelineWeb/packages/shared/src/types/file/file.ts
Normal file
27
urbanLifelineWeb/packages/shared/src/types/file/file.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 文件服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
import { BaseDTO } from "@/types/base"
|
||||
|
||||
// TbSysFileDTO - 系统文件DTO
|
||||
export interface TbSysFileDTO extends BaseDTO {
|
||||
/** 文件ID (主键) */
|
||||
fileId?: string
|
||||
/** 文件名 */
|
||||
name?: string
|
||||
/** 文件路径 */
|
||||
path?: string
|
||||
/** 文件大小(字节) */
|
||||
size?: number
|
||||
/** 文件类型 */
|
||||
type?: string
|
||||
/** 存储类型 */
|
||||
storageType?: string
|
||||
/** MIME 类型 */
|
||||
mimeType?: string
|
||||
/** 文件访问 URL */
|
||||
url?: string
|
||||
/** 文件状态 */
|
||||
status?: string
|
||||
}
|
||||
1
urbanLifelineWeb/packages/shared/src/types/file/index.ts
Normal file
1
urbanLifelineWeb/packages/shared/src/types/file/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./file"
|
||||
13
urbanLifelineWeb/packages/shared/src/types/index.ts
Normal file
13
urbanLifelineWeb/packages/shared/src/types/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export * from "./response"
|
||||
export * from "./page"
|
||||
export * from "./base"
|
||||
export * from "./sys"
|
||||
|
||||
// 服务 types
|
||||
export * from "./auth"
|
||||
export * from "./file"
|
||||
export * from "./message"
|
||||
export * from "./agent"
|
||||
export * from "./crontab"
|
||||
export * from "./bidding"
|
||||
export * from "./workcase"
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./message"
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* 消息服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
import { BaseVO, BaseDTO } from "@/types/base"
|
||||
|
||||
// MessageVO - 消息(包含消息详情和发送范围)
|
||||
export interface MessageVO extends BaseVO {
|
||||
/** 消息ID */
|
||||
messageId?: string
|
||||
/** 消息标题 */
|
||||
title?: string
|
||||
/** 消息内容 */
|
||||
content?: string
|
||||
/** 消息类型 */
|
||||
type?: string
|
||||
/** 消息状态 */
|
||||
status?: string
|
||||
/** 消息发送范围列表 */
|
||||
messageRanges?: MessageRangeChannelVO[]
|
||||
/** 消息接收记录列表(管理员查看时使用) */
|
||||
messageReceivers?: TbMessageReceiverDTO[]
|
||||
}
|
||||
|
||||
// MessageRangeChannelVO - 消息发送范围
|
||||
export interface MessageRangeChannelVO extends BaseVO {
|
||||
/** 发送范围ID */
|
||||
rangeId?: string
|
||||
/** 消息ID */
|
||||
messageId?: string
|
||||
/** 渠道类型 */
|
||||
channelType?: string
|
||||
/** 渠道名称 */
|
||||
channelName?: string
|
||||
/** 接收人范围 */
|
||||
recipientRange?: string
|
||||
/** 接收人范围名称 */
|
||||
recipientRangeName?: string
|
||||
}
|
||||
|
||||
// TbMessageReceiverDTO - 消息接收记录
|
||||
export interface TbMessageReceiverDTO extends BaseDTO {
|
||||
/** 接收记录ID */
|
||||
receiverId?: string
|
||||
/** 消息ID */
|
||||
messageId?: string
|
||||
/** 接收人ID */
|
||||
userId?: string
|
||||
/** 接收人名称 */
|
||||
userName?: string
|
||||
/** 接收状态 */
|
||||
status?: string
|
||||
/** 接收时间 */
|
||||
receiveTime?: string
|
||||
/** 读取时间 */
|
||||
readTime?: string
|
||||
}
|
||||
|
||||
// TbMessageDTO - 消息DTO(创建和更新)
|
||||
export interface TbMessageDTO extends BaseDTO {
|
||||
/** 消息ID */
|
||||
messageId?: string
|
||||
/** 消息标题 */
|
||||
title?: string
|
||||
/** 消息内容 */
|
||||
content?: string
|
||||
/** 消息类型 */
|
||||
type?: string
|
||||
/** 消息状态 */
|
||||
status?: string
|
||||
}
|
||||
28
urbanLifelineWeb/packages/shared/src/types/page/index.ts
Normal file
28
urbanLifelineWeb/packages/shared/src/types/page/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 分页参数
|
||||
*/
|
||||
export interface PageParam {
|
||||
/** 当前页码 */
|
||||
pageNumber: number;
|
||||
/** 每页条数 */
|
||||
pageSize: number;
|
||||
|
||||
/** 总页数 */
|
||||
totalPages?: number;
|
||||
/** 总记录数 */
|
||||
totalElements?: number;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页结果
|
||||
*/
|
||||
export interface PageDomain<T> {
|
||||
pageParam: PageParam;
|
||||
/** 数据列表 */
|
||||
dataList?: T[];
|
||||
}
|
||||
export interface PageRequest<T> {
|
||||
pageParam: PageParam;
|
||||
filter: T;
|
||||
}
|
||||
21
urbanLifelineWeb/packages/shared/src/types/response/index.ts
Normal file
21
urbanLifelineWeb/packages/shared/src/types/response/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { PageParam, PageDomain } from "@/types/page";
|
||||
export interface ResultDomain<T>{
|
||||
/** 状态码 */
|
||||
code: number;
|
||||
/** 返回消息 */
|
||||
message: string;
|
||||
/** 操作是否成功 */
|
||||
success: boolean;
|
||||
/** 是否登录 */
|
||||
login: boolean;
|
||||
/** 是否有权限 */
|
||||
auth: boolean;
|
||||
/** 返回数据 */
|
||||
data?: T;
|
||||
/** 返回数据列表 */
|
||||
dataList?: T[];
|
||||
/** 分页参数 */
|
||||
pageParam?: PageParam;
|
||||
/** 分页信息 */
|
||||
pageDomain?: PageDomain<T>;
|
||||
}
|
||||
60
urbanLifelineWeb/packages/shared/src/types/sys/config.ts
Normal file
60
urbanLifelineWeb/packages/shared/src/types/sys/config.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { BaseVO, BaseDTO } from "@/types/base";
|
||||
|
||||
export interface SysConfigVO extends BaseVO {
|
||||
/** 配置ID */
|
||||
configId?: string;
|
||||
/** 配置键 */
|
||||
key?: string;
|
||||
/** 配置名称 */
|
||||
name?: string;
|
||||
/** 配置值 */
|
||||
value?: string;
|
||||
/** 数据类型(String, Integer, Boolean, Float, Double) */
|
||||
configType?: string;
|
||||
/** 配置渲染类型(select, input, textarea, checkbox, radio, switch) */
|
||||
renderType?: string;
|
||||
/** 配置描述 */
|
||||
description?: string;
|
||||
/** 正则表达式校验规则(JSON) */
|
||||
re?: Record<string, any>;
|
||||
/** 可选项(JSON),render_type为select、checkbox、radio时使用 */
|
||||
options?: Record<string, any>;
|
||||
/** 配置组 */
|
||||
group?: string;
|
||||
/** 模块ID */
|
||||
moduleId?: string;
|
||||
/** 配置顺序 */
|
||||
orderNum?: number;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
}
|
||||
|
||||
// TbSysConfigDTO - 系统配置DTO(创建和更新)
|
||||
export interface TbSysConfigDTO extends BaseDTO {
|
||||
/** 配置ID */
|
||||
configId?: string;
|
||||
/** 配置键 */
|
||||
key?: string;
|
||||
/** 配置名称 */
|
||||
name?: string;
|
||||
/** 配置值 */
|
||||
value?: string;
|
||||
/** 数据类型(String, Integer, Boolean, Float, Double) */
|
||||
configType?: string;
|
||||
/** 配置渲染类型(select, input, textarea, checkbox, radio, switch) */
|
||||
renderType?: string;
|
||||
/** 配置描述 */
|
||||
description?: string;
|
||||
/** 正则表达式校验规则(JSON) */
|
||||
re?: Record<string, any>;
|
||||
/** 可选项(JSON),render_type为select、checkbox、radio时使用 */
|
||||
options?: Record<string, any>;
|
||||
/** 配置组 */
|
||||
group?: string;
|
||||
/** 模块ID */
|
||||
moduleId?: string;
|
||||
/** 配置顺序 */
|
||||
orderNum?: number;
|
||||
/** 配置状态 0:启用 1:禁用 */
|
||||
status?: number;
|
||||
}
|
||||
3
urbanLifelineWeb/packages/shared/src/types/sys/index.ts
Normal file
3
urbanLifelineWeb/packages/shared/src/types/sys/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./config"
|
||||
export * from "./permission"
|
||||
export * from "./user"
|
||||
239
urbanLifelineWeb/packages/shared/src/types/sys/permission.ts
Normal file
239
urbanLifelineWeb/packages/shared/src/types/sys/permission.ts
Normal file
@@ -0,0 +1,239 @@
|
||||
import { BaseVO, BaseDTO } from "@/types/base";
|
||||
|
||||
export interface PermissionVO extends BaseVO {
|
||||
/** 部门ID */
|
||||
deptId?: string;
|
||||
/** 部门名称 */
|
||||
deptName?: string;
|
||||
/** 父级部门ID */
|
||||
deptParentId?: string;
|
||||
/** 部门描述 */
|
||||
deptDescription?: string;
|
||||
/** 角色ID */
|
||||
roleId?: string;
|
||||
/** 角色名称 */
|
||||
roleName?: string;
|
||||
/** 角色描述 */
|
||||
roleDescription?: string;
|
||||
/** 角色作用域 */
|
||||
roleScope?: string;
|
||||
/** 所属部门ID */
|
||||
roleOwnerDeptId?: string;
|
||||
/** 角色状态 */
|
||||
roleStatus?: boolean;
|
||||
/** 模块ID */
|
||||
moduleId?: string;
|
||||
/** 模块名称 */
|
||||
moduleName?: string;
|
||||
/** 模块描述 */
|
||||
moduleDescription?: string;
|
||||
/** 权限ID */
|
||||
permissionId?: string;
|
||||
/** 权限名称 */
|
||||
permissionName?: string;
|
||||
/** 权限代码 */
|
||||
permissionCode?: string;
|
||||
/** 权限描述 */
|
||||
permissionDescription?: string;
|
||||
/** 权限状态 */
|
||||
permissionStatus?: string;
|
||||
/** 视图ID */
|
||||
viewId?: string;
|
||||
/** 视图名称 */
|
||||
viewName?: string;
|
||||
/** 父视图ID */
|
||||
viewParentId?: string;
|
||||
/** URL */
|
||||
viewUrl?: string;
|
||||
/** 组件 */
|
||||
viewComponent?: string;
|
||||
/** 图标 */
|
||||
viewIcon?: string;
|
||||
/** 类型 */
|
||||
viewType?: number;
|
||||
/** 布局 */
|
||||
viewLayout?: string;
|
||||
/** 排序 */
|
||||
viewOrderNum?: number;
|
||||
/** 视图描述 */
|
||||
viewDescription?: string;
|
||||
/** 用户视图权限列表 */
|
||||
permissionIdList?: string[];
|
||||
}
|
||||
|
||||
|
||||
// TbSysDeptDTO - 系统部门DTO
|
||||
export interface TbSysDeptDTO extends BaseDTO {
|
||||
/** 部门ID */
|
||||
deptId?: string;
|
||||
/** 部门名称 */
|
||||
name?: string;
|
||||
/** 父级部门ID */
|
||||
parentId?: string;
|
||||
/** 部门描述 */
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// TbSysDeptRoleDTO - 系统部门角色关系DTO
|
||||
export interface TbSysDeptRoleDTO extends BaseDTO {
|
||||
/** 部门ID */
|
||||
deptId?: string;
|
||||
/** 角色ID */
|
||||
roleId?: string;
|
||||
}
|
||||
|
||||
// TbSysRoleDTO - 系统角色DTO
|
||||
export interface TbSysRoleDTO extends BaseDTO {
|
||||
/** 角色ID */
|
||||
roleId?: string;
|
||||
/** 角色名称 */
|
||||
name?: string;
|
||||
/** 角色描述 */
|
||||
description?: string;
|
||||
/** 角色作用域 global 全局角色, dept 部门角色 */
|
||||
scope?: string;
|
||||
/** 所属部门ID */
|
||||
ownerDeptId?: string;
|
||||
/** 角色状态 true 有效, false 无效 */
|
||||
status?: boolean;
|
||||
}
|
||||
|
||||
// TbSysModuleDTO - 系统模块DTO
|
||||
export interface TbSysModuleDTO extends BaseDTO {
|
||||
/** 模块ID */
|
||||
moduleId?: string;
|
||||
/** 模块名称 */
|
||||
name?: string;
|
||||
/** 模块描述 */
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// TbSysViewDTO - 系统视图DTO
|
||||
export interface TbSysViewDTO extends BaseDTO {
|
||||
/** 视图ID */
|
||||
viewId?: string;
|
||||
/** 视图名称 */
|
||||
name?: string;
|
||||
/** 父视图ID */
|
||||
parentId?: string;
|
||||
/** URL */
|
||||
url?: string;
|
||||
/** 组件 */
|
||||
component?: string;
|
||||
/** 图标 */
|
||||
icon?: string;
|
||||
/** 类型 */
|
||||
type?: number;
|
||||
/** 布局 */
|
||||
layout?: string;
|
||||
/** 排序 */
|
||||
orderNum?: number;
|
||||
/** 描述 */
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// TbSysPermissionDTO - 系统权限DTO
|
||||
export interface TbSysPermissionDTO extends BaseDTO {
|
||||
/** 权限ID */
|
||||
permissionId?: string;
|
||||
/** 权限名称 */
|
||||
name?: string;
|
||||
/** 权限代码 */
|
||||
code?: string;
|
||||
/** 权限描述 */
|
||||
description?: string;
|
||||
/** 模块ID */
|
||||
moduleId?: string;
|
||||
/** 状态 */
|
||||
status?: string;
|
||||
}
|
||||
|
||||
// TbSysRolePermissionDTO - 系统角色权限关系DTO
|
||||
export interface TbSysRolePermissionDTO extends BaseDTO {
|
||||
/** 角色ID */
|
||||
roleId?: string;
|
||||
/** 权限ID */
|
||||
permissionId?: string;
|
||||
}
|
||||
|
||||
// TbSysViewPermissionDTO - 系统视图权限关系DTO
|
||||
export interface TbSysViewPermissionDTO extends BaseDTO {
|
||||
/** 视图ID */
|
||||
viewId?: string;
|
||||
/** 权限ID */
|
||||
permissionId?: string;
|
||||
}
|
||||
|
||||
// =============== 数据权限 ===============
|
||||
export interface AclVO extends BaseVO {
|
||||
/** 权限ID */
|
||||
aclId?: string;
|
||||
/** 对象类型:article/file/course/... */
|
||||
objectType?: string;
|
||||
/** 对象ID */
|
||||
objectId?: string;
|
||||
/** 主体类型:user/dept/role */
|
||||
principalType?: string;
|
||||
/** 主体ID */
|
||||
principalId?: string;
|
||||
/** 当主体为role且限定到某部门时的部门ID(支持某部门的某角色) */
|
||||
principalDeptId?: string;
|
||||
/** 权限位:1读 2写 4执行 */
|
||||
permission?: number;
|
||||
/** 允许或显式拒绝 */
|
||||
allow?: boolean;
|
||||
/** 是否包含子级(对dept/role生效) */
|
||||
includeDescendants?: boolean;
|
||||
/** 策略ID */
|
||||
policyId?: string;
|
||||
/** 策略名称 */
|
||||
policyName?: string;
|
||||
/** 对象类型:article/file/course/.. */
|
||||
policyObjectType?: string;
|
||||
/** 编辑层级规则:parent_only/parent_or_same_admin/owner_only/none */
|
||||
editHierarchyRule?: string;
|
||||
/** 可见层级规则 children_all/children_specified/none */
|
||||
viewHierarchyRule?: string;
|
||||
}
|
||||
|
||||
// TbSysAclDTO - 系统访问控制列表DTO(创建和更新)
|
||||
export interface TbSysAclDTO extends BaseDTO {
|
||||
/** 权限ID */
|
||||
aclId?: string;
|
||||
/** 对象类型:article/file/course/... */
|
||||
objectType?: string;
|
||||
/** 对象ID */
|
||||
objectId?: string;
|
||||
/** 主体类型:user/dept/role */
|
||||
principalType?: string;
|
||||
/** 主体ID */
|
||||
principalId?: string;
|
||||
/** 当主体为role且限定到某部门时的部门ID(支持某部门的某角色) */
|
||||
principalDeptId?: string;
|
||||
/** 权限位:1读 2写 4执行 */
|
||||
permission?: number;
|
||||
/** 允许或显式拒绝 */
|
||||
allow?: boolean;
|
||||
/** 是否包含子级(对dept/role生效) */
|
||||
includeDescendants?: boolean;
|
||||
}
|
||||
|
||||
// TbSysAclPolicyDTO - 系统访问控制策略DTO
|
||||
export interface TbSysAclPolicyDTO extends BaseDTO {
|
||||
/** 策略ID */
|
||||
policyId?: string;
|
||||
/** 策略名称 */
|
||||
name?: string;
|
||||
/** 对象类型:article/file/course/.. */
|
||||
objectType?: string;
|
||||
/** 编辑层级规则:parent_only/parent_or_same_admin/owner_only/none */
|
||||
editHierarchyRule?: string;
|
||||
/** 可见层级规则 children_all/children_specified/none */
|
||||
viewHierarchyRule?: string;
|
||||
/** 默认权限(无显式ACL时应用) */
|
||||
defaultPermission?: number;
|
||||
/** 默认是否允许 */
|
||||
defaultAllow?: boolean;
|
||||
/** 是否默认应用到子级 */
|
||||
applyToChildren?: boolean;
|
||||
}
|
||||
138
urbanLifelineWeb/packages/shared/src/types/sys/user.ts
Normal file
138
urbanLifelineWeb/packages/shared/src/types/sys/user.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
import { BaseVO, BaseDTO } from "@/types/base";
|
||||
import { PermissionVO } from "@/types/sys/permission";
|
||||
|
||||
export interface SysUserVO extends BaseVO {
|
||||
/** 用户ID */
|
||||
userId?: string;
|
||||
/** 用户编码 */
|
||||
usercode?: string;
|
||||
/** 密码(敏感信息,仅用于创建/修改) */
|
||||
password?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** 手机 */
|
||||
phone?: string;
|
||||
/** 微信ID */
|
||||
wechatId?: string;
|
||||
/** 用户状态 */
|
||||
status?: string;
|
||||
/** 用户类型 */
|
||||
userType?: string;
|
||||
/** 用户名 */
|
||||
username?: string;
|
||||
/** 头像 */
|
||||
avatar?: string;
|
||||
/** 性别 */
|
||||
gender?: number;
|
||||
/** 等级 */
|
||||
level?: number;
|
||||
/** 身份证号 */
|
||||
idCard?: string;
|
||||
/** 地址 */
|
||||
address?: string;
|
||||
/** 用户部门角色列表 */
|
||||
deptRoles?: UserDeptRoleVO[];
|
||||
/** 用户角色权限列表 */
|
||||
rolePermissions?: PermissionVO[];
|
||||
/** 用户视图权限列表 */
|
||||
viewPermissions?: PermissionVO[];
|
||||
}
|
||||
|
||||
export interface UserDeptRoleVO extends BaseVO {
|
||||
/** 用户ID */
|
||||
userId?: string;
|
||||
/** 密码 */
|
||||
password?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** 手机 */
|
||||
phone?: string;
|
||||
/** 微信ID */
|
||||
wechatId?: string;
|
||||
/** 用户状态 */
|
||||
status?: string;
|
||||
/** 用户类型 */
|
||||
userType?: string;
|
||||
/** 头像 */
|
||||
avatar?: string;
|
||||
/** 用户名 */
|
||||
username?: string;
|
||||
/** 性别 */
|
||||
gender?: number;
|
||||
/** 等级 */
|
||||
level?: number;
|
||||
/** 身份证号 */
|
||||
idCard?: string;
|
||||
/** 地址 */
|
||||
address?: string;
|
||||
/** 部门ID */
|
||||
deptId?: string;
|
||||
/** 部门名称 */
|
||||
deptName?: string;
|
||||
/** 父级部门ID */
|
||||
parentId?: string;
|
||||
/** 部门描述 */
|
||||
deptDescription?: string;
|
||||
/** 角色ID */
|
||||
roleId?: string;
|
||||
/** 角色名称 */
|
||||
roleName?: string;
|
||||
/** 角色描述 */
|
||||
roleDescription?: string;
|
||||
/** 角色作用域 */
|
||||
scope?: string;
|
||||
/** 所属部门ID */
|
||||
ownerDeptId?: string;
|
||||
/** 角色状态 */
|
||||
roleStatus?: boolean;
|
||||
}
|
||||
|
||||
// DTO 类型
|
||||
|
||||
// TbSysUserDTO - 系统用户DTO(创建和更新)
|
||||
export interface TbSysUserDTO extends BaseDTO {
|
||||
/** 用户ID */
|
||||
userId?: string;
|
||||
/** 用户编码 */
|
||||
usercode?: string;
|
||||
/** 密码 */
|
||||
password?: string;
|
||||
/** 邮箱 */
|
||||
email?: string;
|
||||
/** 手机(加密) */
|
||||
phone?: string;
|
||||
/** 手机号哈希 */
|
||||
phone_hash?: string;
|
||||
/** 微信ID */
|
||||
wechatId?: string;
|
||||
/** 用户状态 */
|
||||
status?: string;
|
||||
/** 用户类型 */
|
||||
userType?: string;
|
||||
}
|
||||
|
||||
// TbSysUserInfoDTO - 系统用户信息DTO
|
||||
export interface TbSysUserInfoDTO extends BaseDTO {
|
||||
/** 用户ID */
|
||||
userId?: string;
|
||||
/** 头像 */
|
||||
avatar?: string;
|
||||
/** 性别 */
|
||||
gender?: number;
|
||||
/** 用户名称 */
|
||||
username?: string;
|
||||
/** 等级 */
|
||||
level?: number;
|
||||
/** 身份证号 */
|
||||
idCard?: string;
|
||||
/** 地址 */
|
||||
address?: string;
|
||||
}
|
||||
|
||||
// TbSysUserRoleDTO - 系统用户角色关系DTO
|
||||
export interface TbSysUserRoleDTO extends BaseDTO {
|
||||
/** 用户ID */
|
||||
userId?: string;
|
||||
/** 角色ID */
|
||||
roleId?: string;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./workcase"
|
||||
279
urbanLifelineWeb/packages/shared/src/types/workcase/workcase.ts
Normal file
279
urbanLifelineWeb/packages/shared/src/types/workcase/workcase.ts
Normal file
@@ -0,0 +1,279 @@
|
||||
/**
|
||||
* 工单服务相关 types - 根据后端 VO 和 DTO 转换
|
||||
*/
|
||||
|
||||
import { BaseVO, BaseDTO } from "@/types/base"
|
||||
|
||||
// TicketVO - 工单详情
|
||||
export interface TicketVO extends BaseVO {
|
||||
/** 工单ID */
|
||||
ticketId?: string
|
||||
/** 工单编号 */
|
||||
ticketNo?: string
|
||||
/** 客户ID */
|
||||
customerId?: string
|
||||
/** 客户姓名 */
|
||||
customerName?: string
|
||||
/** 客户电话 */
|
||||
customerPhone?: string
|
||||
/** 关联会话ID */
|
||||
conversationId?: string
|
||||
/** 工单类型 */
|
||||
ticketType?: string
|
||||
/** 工单类型名称 */
|
||||
ticketTypeName?: string
|
||||
/** 工单分类 */
|
||||
ticketCategory?: string
|
||||
/** 优先级 */
|
||||
priority?: string
|
||||
/** 优先级名称 */
|
||||
priorityName?: string
|
||||
/** 优先级颜色 */
|
||||
priorityColor?: string
|
||||
/** 工单标题 */
|
||||
title?: string
|
||||
/** 问题描述 */
|
||||
description?: string
|
||||
/** 附件ID数组 */
|
||||
attachments?: string[]
|
||||
/** 附件数量 */
|
||||
attachmentCount?: number
|
||||
/** 工单来源 */
|
||||
ticketSource?: string
|
||||
/** 工单来源名称 */
|
||||
ticketSourceName?: string
|
||||
/** 分配给(处理人ID) */
|
||||
assignedTo?: string
|
||||
/** 处理人姓名 */
|
||||
assignedToName?: string
|
||||
/** 分配部门 */
|
||||
assignedDept?: string
|
||||
/** 分配部门名称 */
|
||||
assignedDeptName?: string
|
||||
/** 工单状态 */
|
||||
ticketStatus?: string
|
||||
/** 工单状态名称 */
|
||||
ticketStatusName?: string
|
||||
/** 工单状态颜色 */
|
||||
statusColor?: string
|
||||
/** 解决方案 */
|
||||
resolution?: string
|
||||
/** 解决时间 */
|
||||
resolutionTime?: string
|
||||
/** 关闭时间 */
|
||||
closeTime?: string
|
||||
/** 首次响应时间 */
|
||||
responseTime?: string
|
||||
/** SLA截止时间 */
|
||||
slaDeadline?: string
|
||||
/** 是否逾期 */
|
||||
isOverdue?: boolean
|
||||
/** 距离SLA截止的剩余时间(分钟) */
|
||||
slaRemainingMinutes?: number
|
||||
/** 客户评分(1-5星) */
|
||||
customerRating?: number
|
||||
/** 客户反馈 */
|
||||
customerFeedback?: string
|
||||
/** CRM系统工单ID */
|
||||
crmTicketId?: string
|
||||
/** 同步状态 */
|
||||
syncStatus?: string
|
||||
/** 同步状态名称 */
|
||||
syncStatusName?: string
|
||||
/** 工单标签 */
|
||||
tags?: string[]
|
||||
/** 工单元数据 */
|
||||
metadata?: Record<string, any>
|
||||
/** 处理记录数量 */
|
||||
logCount?: number
|
||||
/** 创建者姓名 */
|
||||
creatorName?: string
|
||||
/** 更新者姓名 */
|
||||
updaterName?: string
|
||||
}
|
||||
|
||||
// TicketListVO - 工单列表(简化版)
|
||||
export interface TicketListVO extends BaseVO {
|
||||
/** 工单ID */
|
||||
ticketId?: string
|
||||
/** 工单编号 */
|
||||
ticketNo?: string
|
||||
/** 客户姓名 */
|
||||
customerName?: string
|
||||
/** 工单标题 */
|
||||
title?: string
|
||||
/** 工单类型名称 */
|
||||
ticketTypeName?: string
|
||||
/** 优先级 */
|
||||
priority?: string
|
||||
/** 优先级名称 */
|
||||
priorityName?: string
|
||||
/** 工单状态 */
|
||||
ticketStatus?: string
|
||||
/** 工单状态名称 */
|
||||
ticketStatusName?: string
|
||||
/** 处理人姓名 */
|
||||
assignedToName?: string
|
||||
/** SLA截止时间 */
|
||||
slaDeadline?: string
|
||||
/** 是否逾期 */
|
||||
isOverdue?: boolean
|
||||
/** 创建者姓名 */
|
||||
creatorName?: string
|
||||
}
|
||||
|
||||
// TbTicketDTO - 工单DTO(创建和更新)
|
||||
export interface TbTicketDTO extends BaseDTO {
|
||||
/** 工单ID(更新时需要) */
|
||||
ticketId?: string
|
||||
/** 工单编号 */
|
||||
ticketNo?: string
|
||||
/** 客户ID */
|
||||
customerId?: string
|
||||
/** 关联会话ID */
|
||||
conversationId?: string
|
||||
/** 工单类型 */
|
||||
ticketType?: string
|
||||
/** 工单分类 */
|
||||
ticketCategory?: string
|
||||
/** 优先级 */
|
||||
priority?: string
|
||||
/** 工单标题 */
|
||||
title?: string
|
||||
/** 问题描述 */
|
||||
description?: string
|
||||
/** 附件ID数组 */
|
||||
attachments?: string[]
|
||||
/** 工单来源 */
|
||||
ticketSource?: string
|
||||
/** 分配给(处理人) */
|
||||
assignedTo?: string
|
||||
/** 分配部门 */
|
||||
assignedDept?: string
|
||||
/** 工单状态 */
|
||||
ticketStatus?: string
|
||||
/** 解决方案 */
|
||||
resolution?: string
|
||||
/** 解决时间 */
|
||||
resolutionTime?: string
|
||||
/** 关闭时间 */
|
||||
closeTime?: string
|
||||
/** 首次响应时间 */
|
||||
responseTime?: string
|
||||
/** SLA截止时间 */
|
||||
slaDeadline?: string
|
||||
/** 是否逾期 */
|
||||
isOverdue?: boolean
|
||||
/** 客户评分(1-5星) */
|
||||
customerRating?: number
|
||||
/** 客户反馈 */
|
||||
customerFeedback?: string
|
||||
/** CRM系统工单ID */
|
||||
crmTicketId?: string
|
||||
/** 同步状态 */
|
||||
syncStatus?: string
|
||||
/** 工单标签 */
|
||||
tags?: string[]
|
||||
/** 工单元数据 */
|
||||
metadata?: Record<string, any>
|
||||
}
|
||||
|
||||
// CustomerVO - 客户信息
|
||||
export interface CustomerVO extends BaseVO {
|
||||
/** 客户ID */
|
||||
customerId?: string
|
||||
/** 客户编号 */
|
||||
customerNo?: string
|
||||
/** 客户姓名 */
|
||||
customerName?: string
|
||||
/** 客户类型 */
|
||||
customerType?: string
|
||||
/** 公司名称 */
|
||||
companyName?: string
|
||||
/** 电话 */
|
||||
phone?: string
|
||||
/** 邮箱 */
|
||||
email?: string
|
||||
/** 微信OpenID */
|
||||
wechatOpenid?: string
|
||||
/** 微信UnionID */
|
||||
wechatUnionid?: string
|
||||
/** 头像URL */
|
||||
avatar?: string
|
||||
/** 性别 */
|
||||
gender?: number
|
||||
/** 地址 */
|
||||
address?: string
|
||||
/** 客户等级 */
|
||||
customerLevel?: string
|
||||
/** 客户来源 */
|
||||
customerSource?: string
|
||||
/** 客户标签数组 */
|
||||
tags?: string[]
|
||||
/** 备注 */
|
||||
notes?: string
|
||||
/** CRM系统客户ID */
|
||||
crmCustomerId?: string
|
||||
/** 最后联系时间 */
|
||||
lastContactTime?: string
|
||||
/** 咨询总次数 */
|
||||
totalConsultations?: number
|
||||
/** 订单总数 */
|
||||
totalOrders?: number
|
||||
/** 总消费金额 */
|
||||
totalAmount?: number
|
||||
/** 满意度评分(1-5) */
|
||||
satisfactionScore?: number
|
||||
/** 状态 */
|
||||
status?: string
|
||||
}
|
||||
|
||||
// TbCustomerDTO - 客户DTO(创建和更新)
|
||||
export interface TbCustomerDTO extends BaseDTO {
|
||||
/** 客户ID(更新时需要) */
|
||||
customerId?: string
|
||||
/** 客户编号 */
|
||||
customerNo?: string
|
||||
/** 客户姓名 */
|
||||
customerName?: string
|
||||
/** 客户类型 */
|
||||
customerType?: string
|
||||
/** 公司名称 */
|
||||
companyName?: string
|
||||
/** 电话 */
|
||||
phone?: string
|
||||
/** 邮箱 */
|
||||
email?: string
|
||||
/** 微信OpenID */
|
||||
wechatOpenid?: string
|
||||
/** 微信UnionID */
|
||||
wechatUnionid?: string
|
||||
/** 头像URL */
|
||||
avatar?: string
|
||||
/** 性别 */
|
||||
gender?: number
|
||||
/** 地址 */
|
||||
address?: string
|
||||
/** 客户等级 */
|
||||
customerLevel?: string
|
||||
/** 客户来源 */
|
||||
customerSource?: string
|
||||
/** 客户标签数组 */
|
||||
tags?: string[]
|
||||
/** 备注 */
|
||||
notes?: string
|
||||
/** CRM系统客户ID */
|
||||
crmCustomerId?: string
|
||||
/** 最后联系时间 */
|
||||
lastContactTime?: string
|
||||
/** 咨询总次数 */
|
||||
totalConsultations?: number
|
||||
/** 订单总数 */
|
||||
totalOrders?: number
|
||||
/** 总消费金额 */
|
||||
totalAmount?: number
|
||||
/** 满意度评分(1-5) */
|
||||
satisfactionScore?: number
|
||||
/** 状态 */
|
||||
status?: string
|
||||
}
|
||||
30
urbanLifelineWeb/packages/shared/tsconfig.json
Normal file
30
urbanLifelineWeb/packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"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/*"]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"vite.config.*.ts"
|
||||
, "vite.config.ts" ],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||
import { resolve } from 'path'
|
||||
import { resolve, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
// ES 模块中获取 __dirname
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = dirname(__filename)
|
||||
|
||||
/**
|
||||
* ES Module 构建配置
|
||||
@@ -13,6 +18,13 @@ import { resolve } from 'path'
|
||||
export default defineConfig({
|
||||
plugins: [vue(), vueJsx()],
|
||||
|
||||
resolve: {
|
||||
alias: [
|
||||
{ find: '@', replacement: resolve(__dirname, 'src') }
|
||||
],
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
},
|
||||
|
||||
build: {
|
||||
lib: {
|
||||
entry: {
|
||||
@@ -78,7 +90,6 @@ export default defineConfig({
|
||||
// 启用代码分割
|
||||
cssCodeSplit: true
|
||||
},
|
||||
|
||||
// 开发服务器配置
|
||||
server: {
|
||||
port: 5000,
|
||||
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