From 897f811fff2a0e8cd90bb848ff03e1645fb67ad7 Mon Sep 17 00:00:00 2001 From: weizong song Date: Tue, 27 Jan 2026 00:54:52 +0800 Subject: [PATCH] up --- API接口整理.md | 370 ++++++++++++++++++++++ TECH_STACK.md | 369 +++++++++++++++++++++ src/api/budget/budgetBase.js | 5 + src/api/budget/budgetCollectionPackage.js | 23 +- src/api/budget/budgetCollectionYear.js | 15 +- src/api/budget/budgetReview.js | 13 +- src/api/budget/departmentSubmission.js | 19 +- src/api/budget/leadDepartment.js | 17 +- vue.config.js | 2 +- 9 files changed, 791 insertions(+), 42 deletions(-) create mode 100644 API接口整理.md create mode 100644 TECH_STACK.md create mode 100644 src/api/budget/budgetBase.js diff --git a/API接口整理.md b/API接口整理.md new file mode 100644 index 0000000..80cd334 --- /dev/null +++ b/API接口整理.md @@ -0,0 +1,370 @@ +# cz-hjjc-ht 接口调用清单(自动提取) + +- 生成时间:2025-12-25T17:08:11 +- 扫描目录:`cz-hjjc-ht/src/api/` +- 请求封装:`cz-hjjc-ht/src/utils/request.js`(axios,baseURL=VUE_APP_BASE_API,可用 requestBase 覆盖) +- 提取规则:匹配 `export function xxx(...) { return request({ url, method, ... }) }`(尽力解析) + +## `src/api/achievements/evaluate.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/plan_evaluate/destroy` | `destroy` | +| GET | `/api/ht/plan_evaluate/index` | `index` | +| POST | `/api/ht/plan_evaluate/save` | `save` | +| GET | `/api/ht/plan_evaluate/show` | `show` | +## `src/api/achievements/points.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/target/destroy` | `destroy` | +| GET | `/api/ht/target/index` | `index` | +| POST | `/api/ht/target/save` | `save` | +| GET | `/api/ht/target/show` | `show` | +## `src/api/achievements/types.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/target_type/destroy` | `destroy` | +| GET | `/api/ht/target_type/index` | `index` | +| POST | `/api/ht/target_type/save` | `save` | +| GET | `/api/ht/target_type/show` | `show` | +## `src/api/away/index.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/ht/away-plan/save` | `planSave` | +| GET | `/api/ht/away/destroy` | `destroy` | +| GET | `/api/ht/away/index` | `index` | +| POST | `/api/ht/away/save` | `save` | +| GET | `/api/ht/away/show` | `show` | +| GET | `/api/oa/flow/get-away-details` | `getAwayDetails` | +| GET | `/api/oa/flow/get-away-list` | `awayIndex` | +| POST | `/api/oa/flow/update-away-details` | `updateAwayDetails` | +## `src/api/borrow/borrow.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/borrow-repayment/destroy` | `delRepayment` | +| GET | `/api/ht/borrow-repayment/index` | `getRepayment` | +| POST | `/api/ht/borrow-repayment/save` | `addRepayment` | +| GET | `/api/ht/borrow-repayment/show` | `detailRepayment` | +| GET | `/api/ht/borrow/destroy` | `delBorrow` | +| GET | `/api/ht/borrow/index` | `getBorrow` | +| POST | `/api/ht/borrow/save` | `addBorrow` | +| GET | `/api/ht/borrow/show` | `detailBorrow` | +## `src/api/budget/actual.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/ht/contract-plan-act-temp/carry` | `carryActual` | +| GET | `/api/ht/contract-plan-act-temp/destroy` | `delActual` | +| GET | `/api/ht/contract-plan-act-temp/index` | `getActual` | +| POST | `/api/ht/contract-plan-act-temp/save` | `editorActual` | +| GET | `/api/ht/contract-plan-act-temp/show` | `detailActual` | +## `src/api/budget/budget.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/plan/destroy` | `delBudget` | +| GET | `/api/ht/plan/index` | `getBudget` | +| GET | `/api/ht/plan/progress` | `getProgress` | +| POST | `/api/ht/plan/save` | `editorBudget` | +| GET | `/api/ht/plan/show` | `detailBudget` | +| POST | `/api/ht/plan/store` | `addBudget` | +## `src/api/budget/budgetCollectionPackage.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/ht/budget-collection-package` | `createBudgetCollectionPackage` | +| GET | `/api/ht/budget-collection-package` | `getBigPackages` | +| GET | `/api/ht/budget-collection-package` | `getBudgetCollectionPackageList` | +| GET | `/api/ht/budget-collection-package` | `getDepartmentPackages` | +| GET | `/api/ht/budget-collection-package-options` | `getBudgetCollectionPackageOptions` | +| GET | `/api/ht/budget-collection-package-summary` | `getBudgetCollectionPackageSummary` | +| DELETE | `/api/ht/budget-collection-package/${id}` | `deleteBudgetCollectionPackage` | +| GET | `/api/ht/budget-collection-package/${id}` | `getBudgetCollectionPackageDetail` | +| PUT | `/api/ht/budget-collection-package/${id}` | `updateBudgetCollectionPackage` | +| POST | `/api/ht/budget-collection-package/batch-destroy` | `batchDeleteBudgetCollectionPackage` | +| POST | `/api/ht/budget-collection-package/create-department-package` | `createDepartmentPackage` | +| POST | `/api/ht/budget-collection-package/create-project` | `createProject` | +| GET | `/api/ht/budget-collection-package/projects` | `getProjects` | +| GET | `/api/ht/economic-categories` | `getEconomicClassifications` | +| GET | `/api/ht/economic-categories` | `getPackageStatusOptions` | +| GET | `/api/ht/economic-categories` | `getProjectTypeOptions` | +## `src/api/budget/budgetCollectionYear.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/ht/budget-collection-year` | `createBudgetCollectionYear` | +| GET | `/api/ht/budget-collection-year` | `getBudgetCollectionYearList` | +| GET | `/api/ht/budget-collection-year-options` | `getBudgetCollectionYearOptions` | +| DELETE | `/api/ht/budget-collection-year/${id}` | `deleteBudgetCollectionYear` | +| GET | `/api/ht/budget-collection-year/${id}` | `getBudgetCollectionYearDetail` | +| PUT | `/api/ht/budget-collection-year/${id}` | `updateBudgetCollectionYear` | +| POST | `/api/ht/budget-collection-year/batch-destroy` | `batchDeleteBudgetCollectionYear` | +## `src/api/budget/budgetReview.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/budget-reviews` | `getBudgetReviews` | +| GET | `/api/ht/budget-reviews-statistics` | `getBudgetReviewStatistics` | +| GET | `/api/ht/budget-reviews/${id}` | `getBudgetReviewDetail` | +| GET | `/api/ht/budget-reviews/${id}/history` | `getBudgetReviewHistory` | +| POST | `/api/ht/budget-reviews/${id}/review` | `reviewBudgetSubmission` | +| POST | `/api/ht/budget-reviews/batch-review` | `batchReviewBudgetSubmissions` | +## `src/api/budget/collection.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/budget/collection/create` | `createBudget` | +| DELETE | `/budget/collection/delete/${id}` | `deleteBudget` | +| GET | `/budget/collection/detail/${id}` | `getBudgetDetail` | +| POST | `/budget/collection/draft` | `saveBudgetDraft` | +| GET | `/budget/collection/list` | `getBudgetList` | +| POST | `/budget/collection/submit` | `submitBudget` | +| GET | `/budget/collection/templates` | `getBudgetTemplates` | +| PUT | `/budget/collection/update/${id}` | `updateBudget` | +| GET | `/system/departments` | `getDepartments` | +| GET | `/system/project-types` | `getProjectTypes` | +| POST | `/upload/file` | `uploadFile` | +## `src/api/budget/departmentSubmission.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/budget-collection-packages/${packageId}/project-names` | `getPackageProjectNames` | +| GET | `/api/ht/budget-collection-packages/department-packages` | `getDepartmentPackages` | +| POST | `/api/ht/budget-decompositions` | `submitBudgetDecomposition` | +| PUT | `/api/ht/budget-decompositions/${id}` | `updateBudgetDecomposition` | +| GET | `/api/ht/budget-decompositions/${packageId}` | `getMultiPackageDecomposition` | +| GET | `/api/ht/budget-decompositions/${packageId}` | `getPackageDecomposition` | +| POST | `/api/ht/budget-decompositions/multi-package` | `submitMultiPackageBudgetDecomposition` | +| POST | `/api/ht/budget-decompositions/multi-package` | `submitMultiPackageDecomposition` | +| GET | `/api/ht/economic-categories` | `getEconomicCategories` | +| GET | `/api/ht/performance-indicator-templates` | `getPerformanceIndicatorTemplates` | +| GET | `/api/performance-indicators/children` | `getChildrenPerformanceIndicators` | +| GET | `/api/performance-indicators/level1` | `getLevel1PerformanceIndicators` | +| GET | `/api/performance-indicators/required` | `getRequiredPerformanceIndicators` | +| GET | `/api/performance-indicators/tree` | `getPerformanceIndicatorTree` | +## `src/api/budget/leadDepartment.js` + +| 方法 | URL | 函数 | +|---|---|---| +| PUT | `/api/ht/budget-collection-packages/${id}/update-with-children` | `editSecondLevelPackage` | +| GET | `/api/ht/budget-collection-packages/${packageId}/department-submissions-summary` | `getDepartmentSubmissionsSummary` | +| POST | `/api/ht/budget-package/split` | `splitBudgetPackage` | +| POST | `/api/ht/budget-package/submit-summary` | `submitSummary` | +| GET | `/api/ht/lead-department-packages` | `getLeadDepartmentPackages` | +| POST | `/api/ht/lead-department-summary` | `submitLeadDepartmentSummary` | +| PUT | `/api/ht/lead-department-summary/${id}` | `updateLeadDepartmentSummary` | +| GET | `/api/ht/lead-department-summary/${packageId}` | `getLeadDepartmentSummary` | +## `src/api/budget/paidPlan.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/paid-plan/destroy` | `paidDestroy` | +| GET | `/api/ht/paid-plan/index` | `paidIndex` | +| POST | `/api/ht/paid-plan/save` | `paidSave` | +| GET | `/api/ht/paid-plan/show` | `paidShow` | +| POST | `/api/ht/paid-plan/store` | `paidStore` | +## `src/api/budget/planTarget.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/plan_target/destroy` | `destroy` | +| GET | `/api/ht/plan_target/index` | `index` | +| POST | `/api/ht/plan_target/save` | `save` | +| GET | `/api/ht/plan_target/show` | `show` | +## `src/api/budget/prePlan.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/pre_plan/destroy` | `destroy` | +| GET | `/api/ht/pre_plan/index` | `index` | +| POST | `/api/ht/pre_plan/save` | `save` | +| GET | `/api/ht/pre_plan/show` | `show` | +## `src/api/common.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/download-file` | `downLoadFile` | +| GET | `/api/ht/other/admin-department-list` | `listCommondepartment` | +| GET | `/api/ht/other/admin-user-list` | `listCommonuser` | +| GET | `/api/ht/other/config` | `flowStatusConfig` | +## `src/api/contract/contract.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/admin/oa/update-contract` | `updateStatus` | +| GET | `/api/ht/contract/check-name` | `checkContractName` | +| GET | `/api/ht/contract/destroy` | `delContract` | +| GET | `/api/ht/contract/index` | `getContract` | +| POST | `/api/ht/contract/save` | `editorContract` | +| GET | `/api/ht/contract/show` | `detailContract` | +| POST | `/api/ht/contract/store` | `addContrant` | +| GET | `/api/oa/flow/no-link-list` | `oaSelect` | +| POST | `/api/oa/flow/save-foreign` | `oaSave` | +## `src/api/contractSign/contractSign.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/sign_plan/destroy` | `delContractSign` | +| GET | `/api/ht/sign_plan/index` | `getContractSign` | +| POST | `/api/ht/sign_plan/save` | `editorContractSign` | +| GET | `/api/ht/sign_plan/show` | `detailContractSign` | +| POST | `/api/ht/sign_plan/store` | `addContractSign` | +## `src/api/dashboard/notice.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/notice/carry` | `carry` | +| GET | `/api/ht/notice/has-read` | `readNotice` | +| GET | `/api/ht/notice/index-v2` | `getNotice2` | +| GET | `/api/ht/notice/statistic-department` | `statisticDepartment` | +| GET | `/api/ht/notice/statistic-progress` | `statisticProgress` | +| GET | `/api/ht/notice/statistic-type` | `statisticType` | +| GET | `/api/ht/notice/type-carry` | `typeCarry` | +| GET | `/api/notification/todo` | `getNotice` | +## `src/api/departmentProgress/index.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/contract/end-index` | `endIndex` | +| GET | `/api/ht/contract/part-index` | `partIndex` | +| GET | `/api/ht/notice/statistic-department-v2` | `statisticDepartment` | +## `src/api/income/index.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/income/destroy` | `destroy` | +| GET | `/api/ht/income/index` | `index` | +| POST | `/api/ht/income/save` | `save` | +| GET | `/api/ht/income/show` | `show` | +## `src/api/me.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/auth/login` | `login` | +| POST | `/api/auth/logout` | `logout` | +| POST | `/api/auth/me` | `getInfo` | +| GET | `/api/auth/module-permissions/${window.MODULE_NAME || window.location.pathname.replaceAll(/\//g, '') || process.env.VUE_APP_MODULE_NAME}` | `permissions` | +| POST | `/api/ht/auth/oss-login` | `loginOss` | +| POST | `/api/ht/auth/oss-login-v2` | `loginOssV2` | +## `src/api/oatoken/index.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/oa/get-oa-token` | `getOatoken` | +| GET | `/api/oa/flow/list/all` | `getShList` | +| GET | `/api/oa/flow/view/${id}` | `getOaView` | +## `src/api/out/index.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/contract/fundlog-flow` | `fundlogFlow` | +| GET | `/api/ht/contract/update-flow` | `updateFlow` | +| GET | `/api/ht/oa/get-oa-token` | `getOaToken` | +| POST | `/api/ht/other/http-curl` | `httpCurl` | +| GET | `/index.php` | `getOutDetail` | +## `src/api/paymentRegistration/fundLog.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/fund_log/destroy` | `delFundLog` | +| GET | `/api/ht/fund_log/index` | `getFundLog` | +| POST | `/api/ht/fund_log/save` | `editorFundLog` | +| GET | `/api/ht/fund_log/show` | `detailFundLog` | +| POST | `/api/ht/fund_log/store` | `addFundLog` | +| GET | `/api/ht/plan/plan-act-links` | `getPlanActLinks` | +## `src/api/sysManage/article.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/regulation/article-destroy` | `destroy` | +| GET | `/api/ht/regulation/article-index` | `index` | +| POST | `/api/ht/regulation/article-save` | `save` | +| GET | `/api/ht/regulation/article-show` | `show` | +| POST | `/api/ht/regulation/article-store` | `store` | +## `src/api/sysManage/menu.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/regulation/destroy` | `destroy` | +| GET | `/api/ht/regulation/index` | `index` | +| POST | `/api/ht/regulation/save` | `save` | +| GET | `/api/ht/regulation/show` | `show` | +| POST | `/api/ht/regulation/store` | `store` | +## `src/api/system/department.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/department` | `listdept` | +| POST | `/api/ht/department/delete` | `del` | +| POST | `/api/ht/department/save` | `save` | +| GET | `/api/ht/other/admin-department-list` | `adminDepartmentList` | +| GET | `/api/ht/other/admin-department-list` | `listdeptNoAuth` | +## `src/api/system/dictionary.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/parameter/delete` | `del` | +| GET | `/api/ht/parameter/detail-delete` | `delDetail` | +| GET | `/api/ht/parameter/index` | `listparameter` | +| POST | `/api/ht/parameter/save` | `save` | +| GET | `/api/ht/parameter/show` | `getparameter` | +| GET | `/api/ht/parameter/show-child` | `getparameterTree` | +| POST | `/api/ht/parameter/store` | `store` | +## `src/api/system/diyMenu.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/diy_menu/destroy` | `destroy` | +| GET | `/api/ht/diy_menu/index` | `index` | +| POST | `/api/ht/diy_menu/save` | `save` | +| GET | `/api/ht/diy_menu/show` | `show` | +## `src/api/system/expand.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/admin_expand/destroy` | `destroy` | +| GET | `/api/ht/admin_expand/index` | `index` | +| POST | `/api/ht/admin_expand/save` | `save` | +| GET | `/api/ht/admin_expand/show` | `show` | +## `src/api/system/log.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/ht/operate-log/index` | `index` | +## `src/api/system/menu.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/ht/menu` | `listmenu` | +| POST | `/api/ht/menu/delete` | `del` | +| POST | `/api/ht/menu/save` | `save` | +## `src/api/system/ossLogin.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/ht/auth/oss-login` | `ossLogin` | +## `src/api/system/permission.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/admin/role/set-permissions` | `setPermissions` | +## `src/api/system/role.js` + +| 方法 | URL | 函数 | +|---|---|---| +| POST | `/api/admin/admin/set-roles-many` | `set` | +| GET | `/api/admin/role` | `list` | +| POST | `/api/admin/role/delete` | `del` | +| POST | `/api/admin/role/save` | `save` | +## `src/api/system/user.js` + +| 方法 | URL | 函数 | +|---|---|---| +| GET | `/api/admin/admin` | `listuser` | +| POST | `/api/admin/admin/delete` | `del` | +| POST | `/api/admin/admin/save` | `save` | +| POST | `/api/admin/admin/set-roles` | `setRoles` | diff --git a/TECH_STACK.md b/TECH_STACK.md new file mode 100644 index 0000000..506c61c --- /dev/null +++ b/TECH_STACK.md @@ -0,0 +1,369 @@ +# 技术栈文档 + +## 项目概述 + +**项目名称**:内控管理系统(cz-hjjc-ht) +**项目版本**:4.4.0 +**基础模板**:vue-admin-template +**开发端口**:9530 + +## 核心技术栈 + +### 前端框架 +- **Vue.js**: `2.6.10` + - 渐进式 JavaScript 框架 + - 使用 Options API + - 支持 Composition API(通过 @vue/composition-api) + +### UI 组件库 +- **Element UI**: `2.13.2` + - 基于 Vue 2.0 的桌面端组件库 + - 主要 UI 组件来源 + - 提供完整的组件生态 + +- **View Design (iView)**: `4.7.0` + - 企业级 UI 组件库 + - 作为 Element UI 的补充组件 + +### 状态管理 +- **Vuex**: `3.1.0` + - 集中式状态管理 + - 支持模块化 store 结构 + - 主要模块:app、permission、settings、user + +- **vuex-persistedstate**: `^4.1.0` + - Vuex 状态持久化插件 + - 将状态保存到 localStorage + +### 路由管理 +- **Vue Router**: `3.0.6` + - 官方路由管理器 + - 支持动态路由、权限控制 + - 路由懒加载优化 + +### HTTP 客户端 +- **Axios**: `0.18.1` + - 基于 Promise 的 HTTP 库 + - 支持请求/响应拦截器 + - 统一错误处理和加载状态管理 + - Bearer Token 认证 + +### 构建工具 +- **Vue CLI**: `4.4.4` + - 官方脚手架工具 + - 基于 Webpack 的构建配置 + - 开发服务器、热更新支持 + +### CSS 预处理器 +- **Less**: `^3.13.1` + - CSS 预处理器 + - less-loader `^5.0.0` + +- **Sass/SCSS**: `1.26.8` + - CSS 预处理器 + - sass-loader `8.0.2` + +### 图表与可视化 +- **ECharts**: `^5.0.0` + - 数据可视化图表库 + - 用于仪表盘和报表展示 + - 支持多种图表类型 + +### 文档处理 +- **@vue-office/docx**: `^1.6.2` + - Word 文档预览组件 + +- **@vue-office/excel**: `^1.7.11` + - Excel 文档预览组件 + +- **@vue-office/pdf**: `^2.0.2` + - PDF 文档预览组件 + +- **docx-preview**: `^0.3.2` + - Word 文档预览库 + +### 富文本编辑器 +- **wangeditor**: `^4.7.12` + - 轻量级富文本编辑器 + - 支持 Markdown + +### 工具库 +- **moment**: `^2.29.4` + - 日期时间处理库 + - 通过 `Vue.prototype.$moment` 全局使用 + +- **js-cookie**: `2.2.0` + - Cookie 操作工具 + - 用于 Token 存储 + +- **path-to-regexp**: `2.4.0` + - 路径匹配工具 + - 路由匹配支持 + +- **nprogress**: `0.2.0` + - 页面加载进度条 + - 提升用户体验 + +- **normalize.css**: `7.0.0` + - CSS 重置样式 + - 统一浏览器默认样式 + +### 其他功能库 +- **vue-grid-layout**: `^2.4.0` + - 网格布局组件 + - 支持拖拽和调整大小 + - 用于仪表盘布局 + +- **html2canvas**: `^1.4.1` + - HTML 转 Canvas 工具 + - 用于截图功能 + +- **print-js**: `^1.6.0` + - 打印功能库 + - 支持 HTML、PDF、图片打印 + +- **element-resize-detector**: `^1.2.4` + - 元素尺寸监听工具 + - 用于响应式布局 + +- **@vue/composition-api**: `^1.7.2` + - Composition API 支持(Vue 2) + - 为 Vue 3 迁移做准备 + +- **vue-demi**: `^0.14.6` + - 兼容 Vue 2/3 的工具库 + +### 微前端支持 +- **Wujie(无界)** + - 支持微前端架构 + - 可在 iframe 中运行 + - 支持生命周期管理(MOUNT/UNMOUNT) + - 支持独立运行模式和嵌入模式 + +### 核心依赖 +- **core-js**: `3.6.5` + - JavaScript 标准库 polyfill + - 提供 ES6+ 特性支持 + +## 开发工具 + +### 代码规范 +- **ESLint**: `6.7.2` + - 代码质量检查工具 + - 支持 Vue 文件检查(eslint-plugin-vue 6.2.2) + - 使用 babel-eslint `^8.2.2` 作为解析器 + +### 测试框架 +- **Jest**: 通过 `@vue/cli-plugin-unit-jest` + - 单元测试框架 + - 使用 @vue/test-utils `1.0.0-beta.29` + - babel-jest `23.6.0` 用于转译 + +### 编译工具 +- **Babel** + - @vue/cli-plugin-babel `4.4.4` + - babel-plugin-dynamic-import-node `2.3.3` + - 开发环境动态导入优化 + +### 构建优化 +- **SVG 处理** + - svg-sprite-loader `4.1.3` - SVG 图标精灵图 + - svgo `1.2.2` - SVG 优化工具 + +- **代码分割** + - chunk-libs: 第三方库分离 + - chunk-elementUI: Element UI 单独打包 + - chunk-commons: 公共组件分离(最小引用 3 次) + - runtime chunk: 运行时代码分离 + +- **构建优化插件** + - script-ext-html-webpack-plugin `2.1.3` - 内联运行时脚本 + +### Mock 数据 +- **mockjs**: `1.0.1-beta3` + - 生成随机数据 + - 拦截 Ajax 请求 + - 用于开发环境数据模拟 + +### 其他开发工具 +- **chalk**: `2.4.2` - 终端颜色输出 +- **runjs**: `4.3.2` - 脚本运行工具 +- **connect**: `3.6.6` - HTTP 服务器 +- **serve-static**: `1.13.2` - 静态文件服务 + +## 项目配置 + +### 开发服务器 +- **端口**:9530(默认) +- **自动打开浏览器**:是 +- **热更新**:支持 +- **代理配置**:支持多个 API 代理 + - `/old` -> 旧版系统 + - `/oa` -> OA 系统 + - 主 API -> `VUE_APP_BASE_API` + +### 环境变量 +- `VUE_APP_MODULE_NAME`: 模块名称(用于路由和构建路径) +- `VUE_APP_BASE_API`: API 基础路径 +- `VUE_APP_OUT_URL`: 外部系统 URL +- `VUE_APP_OUT_OLD`: 旧版外部系统 URL + +### 路径别名 +- `@`: 指向 `src` 目录 + +### 浏览器兼容性 +- 支持所有市场份额 > 1% 的浏览器 +- 最后两个版本 +- 现代浏览器和 IE 10+ + +## 项目结构特点 + +### 权限控制 +- **基于角色的权限管理(RBAC)** +- **路由级别权限控制** +- **动态路由生成** +- **按钮级别权限控制** + +### 多模式支持 +- **独立运行模式**:直接访问应用 +- **iframe 嵌入模式**:嵌入到其他系统中 +- **微前端(Wujie)模式**:作为微前端子应用 + +### 错误处理 +- **全局错误捕获**:Vue.config.errorHandler +- **iframe 环境错误上报**:向父窗口上报错误 +- **Axios 请求错误统一处理**:统一错误提示和处理 + +### 自定义组件 +- **LxHeader**: 自定义头部组件 +- **XyTable**: 自定义表格组件 +- **XyDialog**: 自定义对话框组件 +- **XySelectors**: 自定义选择器组件 +- **PlanPicker**: 计划选择器组件 +- **Breadcrumb**: 面包屑导航 +- **Pagination**: 分页组件 + +## 主要功能模块 + +根据项目结构,主要包含以下业务模块: + +1. **预算管理** (budget) + - 预算编制、审核、执行 + - 预算汇总、上报 + - 预算目标管理 + +2. **合同管理** (contract) + - 合同列表、详情 + - 合同签订 + - 合同集成 + +3. **绩效管理** (achievements) + - 评价管理 + - 积分管理 + - 类型管理 + +4. **部门进度** (departmentProgress) + - 部门工作进度跟踪 + +5. **财务管理** (finance) + - 收支管理 + - 资金登记 + +6. **系统管理** (system/sysManage) + - 用户管理 + - 角色管理 + - 权限管理 + - 菜单管理 + - 字典管理 + - 日志管理 + +7. **仪表盘** (dashboard) + - 数据可视化 + - 通知公告 + +8. **其他功能** + - 请假管理 (away) + - 借阅管理 (borrow) + - 安装部署 (install) + - 预览功能 (preview) + - 统计报表 (statisticalReport) + +## 运行环境要求 + +- **Node.js**: >= 8.9 +- **npm**: >= 3.0.0 + +## 常用命令 + +```bash +# 开发环境 +npm run dev + +# 生产环境构建 +npm run build:prod + +# 预发布环境构建 +npm run build:stage + +# 预览构建结果 +npm run preview + +# 代码检查 +npm run lint + +# 单元测试 +npm run test:unit + +# 代码检查和测试 +npm run test:ci + +# SVG 优化 +npm run svgo +``` + +## 技术栈版本总结 + +| 分类 | 技术 | 版本 | +|------|------|------| +| 前端框架 | Vue | 2.6.10 | +| UI 库 | Element UI | 2.13.2 | +| UI 库 | View Design | 4.7.0 | +| 状态管理 | Vuex | 3.1.0 | +| 路由 | Vue Router | 3.0.6 | +| HTTP | Axios | 0.18.1 | +| 构建工具 | Vue CLI | 4.4.4 | +| CSS 预处理器 | Less | ^3.13.1 | +| CSS 预处理器 | Sass | 1.26.8 | +| 图表库 | ECharts | ^5.0.0 | +| 日期处理 | moment | ^2.29.4 | +| 富文本编辑器 | wangeditor | ^4.7.12 | +| 测试框架 | Jest | - | +| 代码规范 | ESLint | 6.7.2 | +| 微前端 | Wujie | - | + +## 技术栈特点 + +### 优势 +1. **成熟稳定**:基于 Vue 2 + Element UI 的成熟方案 +2. **功能完整**:包含完整的后台管理系统功能 +3. **多模式支持**:支持独立运行、iframe、微前端多种部署方式 +4. **权限完善**:完整的权限控制系统 +5. **文档支持**:支持 Office 文档预览 + +### 注意事项 +1. **Axios 版本较旧**:当前使用 0.18.1,建议升级到最新版本以获得更好的安全性和功能支持 +2. **Vue 2 项目**:项目基于 Vue 2.6,如需升级到 Vue 3,需要大量重构工作 +3. **微前端兼容**:项目支持多种运行模式,在修改入口文件时需要确保兼容性 +4. **生产环境构建**:构建产物输出到 `../cz_hjjc/public/${VUE_APP_MODULE_NAME}`,需要配置相应的环境变量 +5. **依赖更新**:部分依赖版本较旧,建议定期更新以获取安全补丁 + +## 项目构建输出 + +- **输出目录**:`../cz_hjjc/public/${VUE_APP_MODULE_NAME}` +- **静态资源目录**:`static` +- **源码映射**:生产环境关闭(productionSourceMap: false) + +--- + +*文档生成时间:基于 package.json 和项目结构分析* +*项目路径:/Users/weizongsong/www/cz-hjjc-ht* diff --git a/src/api/budget/budgetBase.js b/src/api/budget/budgetBase.js new file mode 100644 index 0000000..9da0b78 --- /dev/null +++ b/src/api/budget/budgetBase.js @@ -0,0 +1,5 @@ +/** + * 预算模块 API 统一前缀配置 + * 用于将预算相关接口从 Ht 模块迁移到 Budget 模块 + */ +export const BUDGET_API_PREFIX = '/api/budget' diff --git a/src/api/budget/budgetCollectionPackage.js b/src/api/budget/budgetCollectionPackage.js index 115dfe9..8978097 100644 --- a/src/api/budget/budgetCollectionPackage.js +++ b/src/api/budget/budgetCollectionPackage.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { BUDGET_API_PREFIX } from './budgetBase' /** * 预算采集年度大包管理 API @@ -7,7 +8,7 @@ import request from '@/utils/request' // 获取预算采集年度大包列表 export function getBudgetCollectionPackageList(params) { return request({ - url: '/api/ht/budget-collection-package', + url: `${BUDGET_API_PREFIX}/budget-collection-package`, method: 'get', params }) @@ -16,7 +17,7 @@ export function getBudgetCollectionPackageList(params) { // 获取预算采集年度大包详情 export function getBudgetCollectionPackageDetail(id) { return request({ - url: `/api/ht/budget-collection-package/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-package/${id}`, method: 'get' }) } @@ -24,7 +25,7 @@ export function getBudgetCollectionPackageDetail(id) { // 创建预算采集年度大包 export function createBudgetCollectionPackage(data) { return request({ - url: '/api/ht/budget-collection-package', + url: `${BUDGET_API_PREFIX}/budget-collection-package`, method: 'post', data }) @@ -33,7 +34,7 @@ export function createBudgetCollectionPackage(data) { // 更新预算采集年度大包 export function updateBudgetCollectionPackage(id, data) { return request({ - url: `/api/ht/budget-collection-package/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-package/${id}`, method: 'put', data }) @@ -42,7 +43,7 @@ export function updateBudgetCollectionPackage(id, data) { // 删除预算采集年度大包 export function deleteBudgetCollectionPackage(id) { return request({ - url: `/api/ht/budget-collection-package/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-package/${id}`, method: 'delete' }) } @@ -50,7 +51,7 @@ export function deleteBudgetCollectionPackage(id) { // 批量删除预算采集年度大包 export function batchDeleteBudgetCollectionPackage(ids) { return request({ - url: '/api/ht/budget-collection-package/batch-destroy', + url: `${BUDGET_API_PREFIX}/budget-collection-package/batch-destroy`, method: 'post', data: { ids } }) @@ -59,7 +60,7 @@ export function batchDeleteBudgetCollectionPackage(ids) { // 获取预算包选择列表(用于下拉框) export function getBudgetCollectionPackageOptions(params) { return request({ - url: '/api/ht/budget-collection-package-options', + url: `${BUDGET_API_PREFIX}/budget-collection-package-options`, method: 'get', params }) @@ -68,7 +69,7 @@ export function getBudgetCollectionPackageOptions(params) { // 获取预算包汇总数据 export function getBudgetCollectionPackageSummary(params) { return request({ - url: '/api/ht/budget-collection-package-summary', + url: `${BUDGET_API_PREFIX}/budget-collection-package-summary`, method: 'get', params }) @@ -106,7 +107,7 @@ export function getProjects(params) { // 获取大包列表(第1层) export function getBigPackages(params) { return request({ - url: '/api/ht/budget-collection-package', + url: `${BUDGET_API_PREFIX}/budget-collection-package`, method: 'get', params: { ...params, @@ -118,7 +119,7 @@ export function getBigPackages(params) { // 获取执行科室包列表(第3层) export function getDepartmentPackages(params) { return request({ - url: '/api/ht/budget-collection-package', + url: `${BUDGET_API_PREFIX}/budget-collection-package`, method: 'get', params: { ...params, @@ -152,7 +153,7 @@ export function getPackageStatusOptions() { // 获取经济分类列表 export function getEconomicClassifications(params) { return request({ - url: '/api/ht/economic-categories', + url: `${BUDGET_API_PREFIX}/economic-categories`, method: 'get', params }) diff --git a/src/api/budget/budgetCollectionYear.js b/src/api/budget/budgetCollectionYear.js index 12a9dcc..68601f7 100644 --- a/src/api/budget/budgetCollectionYear.js +++ b/src/api/budget/budgetCollectionYear.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { BUDGET_API_PREFIX } from './budgetBase' /** * 预算采集年份管理 API @@ -7,7 +8,7 @@ import request from '@/utils/request' // 获取预算采集年份列表 export function getBudgetCollectionYearList(params) { return request({ - url: '/api/ht/budget-collection-year', + url: `${BUDGET_API_PREFIX}/budget-collection-year`, method: 'get', params }) @@ -16,7 +17,7 @@ export function getBudgetCollectionYearList(params) { // 获取预算采集年份详情 export function getBudgetCollectionYearDetail(id) { return request({ - url: `/api/ht/budget-collection-year/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-year/${id}`, method: 'get' }) } @@ -24,7 +25,7 @@ export function getBudgetCollectionYearDetail(id) { // 创建预算采集年份 export function createBudgetCollectionYear(data) { return request({ - url: '/api/ht/budget-collection-year', + url: `${BUDGET_API_PREFIX}/budget-collection-year`, method: 'post', data }) @@ -33,7 +34,7 @@ export function createBudgetCollectionYear(data) { // 更新预算采集年份 export function updateBudgetCollectionYear(id, data) { return request({ - url: `/api/ht/budget-collection-year/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-year/${id}`, method: 'put', data }) @@ -42,7 +43,7 @@ export function updateBudgetCollectionYear(id, data) { // 删除预算采集年份 export function deleteBudgetCollectionYear(id) { return request({ - url: `/api/ht/budget-collection-year/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-year/${id}`, method: 'delete' }) } @@ -50,7 +51,7 @@ export function deleteBudgetCollectionYear(id) { // 批量删除预算采集年份 export function batchDeleteBudgetCollectionYear(ids) { return request({ - url: '/api/ht/budget-collection-year/batch-destroy', + url: `${BUDGET_API_PREFIX}/budget-collection-year/batch-destroy`, method: 'post', data: { ids } }) @@ -59,7 +60,7 @@ export function batchDeleteBudgetCollectionYear(ids) { // 获取年度选择列表(用于下拉框) export function getBudgetCollectionYearOptions() { return request({ - url: '/api/ht/budget-collection-year-options', + url: `${BUDGET_API_PREFIX}/budget-collection-year-options`, method: 'get' }) } diff --git a/src/api/budget/budgetReview.js b/src/api/budget/budgetReview.js index 0baaaa8..bba83f6 100644 --- a/src/api/budget/budgetReview.js +++ b/src/api/budget/budgetReview.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { BUDGET_API_PREFIX } from './budgetBase' /** * 获取待审核的汇总填报列表 @@ -6,7 +7,7 @@ import request from '@/utils/request' */ export function getBudgetReviews(params = {}) { return request({ - url: '/api/ht/budget-reviews', + url: `${BUDGET_API_PREFIX}/budget-reviews`, method: 'get', params }) @@ -18,7 +19,7 @@ export function getBudgetReviews(params = {}) { */ export function getBudgetReviewDetail(id) { return request({ - url: `/api/ht/budget-reviews/${id}`, + url: `${BUDGET_API_PREFIX}/budget-reviews/${id}`, method: 'get' }) } @@ -30,7 +31,7 @@ export function getBudgetReviewDetail(id) { */ export function reviewBudgetSubmission(id, data) { return request({ - url: `/api/ht/budget-reviews/${id}/review`, + url: `${BUDGET_API_PREFIX}/budget-reviews/${id}/review`, method: 'post', data }) @@ -42,7 +43,7 @@ export function reviewBudgetSubmission(id, data) { */ export function batchReviewBudgetSubmissions(data) { return request({ - url: '/api/ht/budget-reviews/batch-review', + url: `${BUDGET_API_PREFIX}/budget-reviews/batch-review`, method: 'post', data }) @@ -54,7 +55,7 @@ export function batchReviewBudgetSubmissions(data) { */ export function getBudgetReviewStatistics(params = {}) { return request({ - url: '/api/ht/budget-reviews-statistics', + url: `${BUDGET_API_PREFIX}/budget-reviews-statistics`, method: 'get', params }) @@ -66,7 +67,7 @@ export function getBudgetReviewStatistics(params = {}) { */ export function getBudgetReviewHistory(id) { return request({ - url: `/api/ht/budget-reviews/${id}/history`, + url: `${BUDGET_API_PREFIX}/budget-reviews/${id}/history`, method: 'get' }) } diff --git a/src/api/budget/departmentSubmission.js b/src/api/budget/departmentSubmission.js index 241cefd..5d42fd0 100644 --- a/src/api/budget/departmentSubmission.js +++ b/src/api/budget/departmentSubmission.js @@ -1,9 +1,10 @@ import request from '@/utils/request' +import { BUDGET_API_PREFIX } from './budgetBase' // 获取分配给当前科室的预算包列表 export function getDepartmentPackages(query) { return request({ - url: '/api/ht/budget-collection-packages/department-packages', + url: `${BUDGET_API_PREFIX}/budget-collection-packages/department-packages`, method: 'get', params: query }) @@ -12,7 +13,7 @@ export function getDepartmentPackages(query) { // 获取预算包的分解表详情 export function getPackageDecomposition(packageId) { return request({ - url: `/api/ht/budget-decompositions/${packageId}`, + url: `${BUDGET_API_PREFIX}/budget-decompositions/${packageId}`, method: 'get' }) } @@ -20,7 +21,7 @@ export function getPackageDecomposition(packageId) { // 提交预算分解表 export function submitBudgetDecomposition(data) { return request({ - url: '/api/ht/budget-decompositions', + url: `${BUDGET_API_PREFIX}/budget-decompositions`, method: 'post', data }) @@ -29,7 +30,7 @@ export function submitBudgetDecomposition(data) { // 提交多包汇总分解表 export function submitMultiPackageBudgetDecomposition(data) { return request({ - url: '/api/ht/budget-decompositions/multi-package', + url: `${BUDGET_API_PREFIX}/budget-decompositions/multi-package`, method: 'post', data }) @@ -38,7 +39,7 @@ export function submitMultiPackageBudgetDecomposition(data) { // 更新预算分解表 export function updateBudgetDecomposition(id, data) { return request({ - url: `/api/ht/budget-decompositions/${id}`, + url: `${BUDGET_API_PREFIX}/budget-decompositions/${id}`, method: 'put', data }) @@ -47,7 +48,7 @@ export function updateBudgetDecomposition(id, data) { // 获取经济分类列表 export function getEconomicCategories() { return request({ - url: '/api/ht/economic-categories', + url: `${BUDGET_API_PREFIX}/economic-categories`, method: 'get' }) } @@ -55,7 +56,7 @@ export function getEconomicCategories() { // 获取预算包的项目名称信息 export function getPackageProjectNames(packageId) { return request({ - url: `/api/ht/budget-collection-packages/${packageId}/project-names`, + url: `${BUDGET_API_PREFIX}/budget-collection-packages/${packageId}/project-names`, method: 'get' }) } @@ -104,7 +105,7 @@ export function getChildrenPerformanceIndicators(parentId) { // 获取多包汇总提交数据 export function getMultiPackageDecomposition(packageId) { return request({ - url: `/api/ht/budget-decompositions/${packageId}`, + url: `${BUDGET_API_PREFIX}/budget-decompositions/${packageId}`, method: 'get' }) } @@ -112,7 +113,7 @@ export function getMultiPackageDecomposition(packageId) { // 提交多包汇总分解表(原多包汇总提交) export function submitMultiPackageDecomposition(data) { return request({ - url: '/api/ht/budget-decompositions/multi-package', + url: `${BUDGET_API_PREFIX}/budget-decompositions/multi-package`, method: 'post', data }) diff --git a/src/api/budget/leadDepartment.js b/src/api/budget/leadDepartment.js index cd35ddc..7d179ae 100644 --- a/src/api/budget/leadDepartment.js +++ b/src/api/budget/leadDepartment.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { BUDGET_API_PREFIX } from './budgetBase' /** * 获取当前科室的预算包列表 @@ -6,7 +7,7 @@ import request from '@/utils/request' */ export function getLeadDepartmentPackages(params = {}) { return request({ - url: '/api/ht/lead-department-packages', + url: `${BUDGET_API_PREFIX}/lead-department-packages`, method: 'get', params }) @@ -18,7 +19,7 @@ export function getLeadDepartmentPackages(params = {}) { */ export function splitBudgetPackage(data) { return request({ - url: '/api/ht/budget-package/split', + url: `${BUDGET_API_PREFIX}/budget-package/split`, method: 'post', data }) @@ -32,7 +33,7 @@ export function splitBudgetPackage(data) { export function editSecondLevelPackage(id, data) { // 先尝试专用的编辑接口 return request({ - url: `/api/ht/budget-collection-packages/${id}/update-with-children`, + url: `${BUDGET_API_PREFIX}/budget-collection-packages/${id}/update-with-children`, method: 'put', data }).catch(error => { @@ -40,7 +41,7 @@ export function editSecondLevelPackage(id, data) { if (error.response && error.response.status === 404) { console.warn('专用接口未找到,尝试使用通用接口') return request({ - url: `/api/ht/budget-collection-packages/${id}`, + url: `${BUDGET_API_PREFIX}/budget-collection-packages/${id}`, method: 'put', data }) @@ -66,7 +67,7 @@ export function editSecondLevelPackage(id, data) { */ export function getDepartmentSubmissionsSummary(packageId) { return request({ - url: `/api/ht/budget-collection-packages/${packageId}/department-submissions-summary`, + url: `${BUDGET_API_PREFIX}/budget-collection-packages/${packageId}/department-submissions-summary`, method: 'get' }) } @@ -91,7 +92,7 @@ export function getDepartmentSubmissionsSummary(packageId) { */ export function getLeadDepartmentSummary(packageId) { return request({ - url: `/api/ht/lead-department-summary/${packageId}`, + url: `${BUDGET_API_PREFIX}/lead-department-summary/${packageId}`, method: 'get' }) } @@ -114,7 +115,7 @@ export function getLeadDepartmentSummary(packageId) { */ export function submitLeadDepartmentSummary(data) { return request({ - url: '/api/ht/lead-department-summary', + url: `${BUDGET_API_PREFIX}/lead-department-summary`, method: 'post', data }) @@ -130,7 +131,7 @@ export function submitLeadDepartmentSummary(data) { */ export function updateLeadDepartmentSummary(id, data) { return request({ - url: `/api/ht/lead-department-summary/${id}`, + url: `${BUDGET_API_PREFIX}/lead-department-summary/${id}`, method: 'put', data }) diff --git a/vue.config.js b/vue.config.js index 831ffca..1679de4 100644 --- a/vue.config.js +++ b/vue.config.js @@ -26,7 +26,7 @@ module.exports = { * Detail: https://cli.vuejs.org/config/#publicpath */ publicPath: `/${process.env.VUE_APP_MODULE_NAME}`, - outputDir: `../cz_hjjc/public/${process.env.VUE_APP_MODULE_NAME}`, + outputDir: `../backend/public/${process.env.VUE_APP_MODULE_NAME}`, assetsDir: 'static', lintOnSave: false, productionSourceMap: false,