diff --git a/.env.example b/.env.example index b234075..dd4fdc9 100644 --- a/.env.example +++ b/.env.example @@ -24,3 +24,8 @@ VITE_ENABLE_DEBUG=true # 预发布环境示例: dist-staging # 生产环境示例: dist-prod VITE_BUILD_OUT_DIR=dist + +# Vite 开发代理配置(仅开发环境需要) +# 开发环境代理目标,用于解决 CORS 问题 +# 示例: http://czemc.localhost 或 http://localhost:8000 +VITE_API_PROXY_TARGET=http://czemc.localhost diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6f3a291 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/docs/canvas-settings.html b/docs/canvas-settings.html new file mode 100644 index 0000000..aec776d --- /dev/null +++ b/docs/canvas-settings.html @@ -0,0 +1,952 @@ + + + + + + 画布设置 - 事前流程模板 + + + + + +
+ +
+
+ 分支配置管理 +
+
+ +
+
+ 事前流程分类 +
+ +
+ + + + + + +
+
+ + +
+
+ A4文档预览 + 全部可见 +
+
+
+ +
+
+ a. 基本信息 + 基本信息 +
+
+ +
+
+ + +
+
+ b. 资金申请上会 + 上会流程 +
+
+ +
+
+ + +
+
+ c. 事前流程 + 附件流程 +
+
+ +
+
+ + +
+
+ d. 支付流程 + 多轮次支付 +
+
+ +
+
+
+
+
+ + +
+
+ +
+
+
+
+
+
区域配置JSON
+ + +
+
+
+
+
点击画布区域进行配置
+
+
+
+
+
+
+ + +
+ + + + +
+ + + + + diff --git a/src/App.vue b/src/App.vue index 431c38d..a4c3809 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,5 +20,27 @@ body { width: 100%; height: 100vh; } + +/* 修复Element Plus按钮hover状态 - 确保hover时背景色更深 */ +.el-button--primary { + background-color: #409eff; + border-color: #409eff; +} + +.el-button--primary:hover { + background-color: #337ecc !important; + border-color: #337ecc !important; +} + +.el-button--primary:active, +.el-button--primary.is-active { + background-color: #2b6cb0 !important; + border-color: #2b6cb0 !important; +} + +.el-button--primary:focus { + background-color: #337ecc !important; + border-color: #337ecc !important; +} diff --git a/src/config/index.js b/src/config/index.js index 4005feb..2a5c2da 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -17,7 +17,11 @@ const config = { // API 配置 api: { - baseURL: env.VITE_API_BASE_URL || 'http://localhost:8080/api', + // 开发环境使用相对路径,通过Vite代理转发,避免CORS问题 + // 生产环境使用完整URL + baseURL: env.MODE === 'development' + ? '/api' // 开发环境:使用相对路径,由Vite代理处理 + : (env.VITE_API_BASE_URL || 'http://localhost:8080/api'), // 生产环境:使用完整URL timeout: Number(env.VITE_API_TIMEOUT) || 30000 }, diff --git a/src/layout/MainLayout.vue b/src/layout/MainLayout.vue index 808c1f4..d5a884a 100644 --- a/src/layout/MainLayout.vue +++ b/src/layout/MainLayout.vue @@ -89,6 +89,21 @@ + + + + + + + + + + + + @@ -68,7 +68,7 @@ import { Tools, Monitor, Van, - Circle, + CircleCheck, ArrowDown, ArrowUp } from '@element-plus/icons-vue' diff --git a/src/views/settings/BranchConditionSettings.vue b/src/views/settings/BranchConditionSettings.vue new file mode 100644 index 0000000..c7751af --- /dev/null +++ b/src/views/settings/BranchConditionSettings.vue @@ -0,0 +1,377 @@ + + + + + diff --git a/src/views/settings/CanvasSettings.vue b/src/views/settings/CanvasSettings.vue new file mode 100644 index 0000000..a49b90c --- /dev/null +++ b/src/views/settings/CanvasSettings.vue @@ -0,0 +1,978 @@ + + + + + + diff --git a/vite.config.js b/vite.config.js index 9a6c331..58372b8 100644 --- a/vite.config.js +++ b/vite.config.js @@ -6,6 +6,22 @@ export default defineConfig(({ mode }) => { // 加载环境变量 const env = loadEnv(mode, process.cwd(), '') + // 开发环境必须配置代理目标 + if (mode === 'development') { + if (!env.VITE_API_PROXY_TARGET) { + throw new Error( + '❌ 错误: 开发环境必须配置 VITE_API_PROXY_TARGET 环境变量\n' + + '请在 .env.development 文件中添加:\n' + + 'VITE_API_PROXY_TARGET=http://czemc.localhost\n' + + '\n' + + '示例:\n' + + 'VITE_API_PROXY_TARGET=http://czemc.localhost\n' + + '或\n' + + 'VITE_API_PROXY_TARGET=http://localhost:8000' + ) + } + } + return { plugins: [vue()], resolve: { @@ -15,7 +31,17 @@ export default defineConfig(({ mode }) => { }, server: { port: 3000, - open: true + open: true, + proxy: mode === 'development' ? { + // 代理所有 /api 请求到后端服务器 + '/api': { + target: env.VITE_API_PROXY_TARGET, + changeOrigin: true, + secure: false, + // 如果需要重写路径,可以取消下面的注释 + // rewrite: (path) => path.replace(/^\/api/, '') + } + } : undefined }, // 定义全局常量替换 define: {