3.7 KiB
3.7 KiB
FMS 项目长期约定(主文件)
明细已拆分到
memory/topics/,需要时再读,避免主文件被截断:topics/workflow.md(工作流设置器 + dagre 布局)、topics/frontend-ui.md(主题/UI 库/i18n/导出)、topics/env-and-baseline.md(本机环境坑 + 测试基线)。每日日志见同目录YYYY-MM-DD.md。
目录 / 库 / 端口
- 后端
fms-api(Spring Boot 4.1 + JDK21,JDBC+Druid 无 ORM);前端fms-vue(Vue3.5 + Vite8 + Pinia,纯 JS,pnpm)。fms-vue-old1/old2仅历史参考,不要改。 - 根目录文档:
FMS新系统核心表结构设计.md(权威表结构)、FMS业务表设计.md、开发规范.md(AI 规范)、Fms旧系统表结构.md(旧库,只有表无视图)、FMS删除规则引擎设计.md;建库脚本在sql/。 - SQL Server
118.89.70.199:1433:旧库G3HY2025,新库 FMS(生产库,写前先确认)。 机构→库映射fms-api/config/dbconfigs/{ORG_ID}.properties(gitignore):G3HD→FMS、G3HY2025→旧库; 没有 FMS.properties。 - 后端 8088(context-path
/api),前端 dev 5082(/api→127.0.0.1:8088)。直连接口需先/auth/login。
元数据表真实列名(已连库核对,别猜)
s_module:PKb_id(无b_module_code;b_route属s_menu);树用b_parent_id/b_depth/b_path; 另有b_module_type(module/data/virtual)、b_view_table、b_save_table、b_key_field、b_order_sql、b_query_sql、b_config_json、b_canuse、b_xh、b_bz、b_name、b_i18n。查询来源b_query_sql>b_view_table。s_field:PK(b_module_id, b_field),无b_id;b_type实测 input/number/checkbox/datetime/date。s_module_schema:PK(b_module_id, b_schema_type∈view|edit|query),内容在b_schema_json。s_menu:b_id/b_parent_id/b_depth/b_path/b_menu_type(directory|page)/b_route/b_icon;s_menu_module绑菜单与模块。- 权限靠
b_id:permissionStore.moduleCodes 即s_module.b_id,页面MODULE_CODE必须等于它; 还需在s_menu_module绑菜单,否则非超管看不到授权入口。列表模块编码统一v_+表名(v_b_othercompany)。 - schema JSON:
view{columns:[{field,width}|{type:group,title,children}]}、edit{children:[{field,span,required,readonly,defaultValue}|group]}、query{groups:[{conditions}],quick}。 - 路由守卫只看
meta.moduleId/meta.adminOnly;views/module/**是 adminOnly(仅 g3soft),不进s_menu。
树结构规范(模块/菜单/部门/分类通用)
b_parent_id 权威,b_depth(根=0)/b_path(/cn/east/) 是派生字段,移动节点同事务更新全部后代;
不一致以 b_parent_id 为准。工具 src/utils/tree.js(buildSortedTree/computeTreeMove/collectDescendantIds/
applyTreePosition/filterTreeByText/findTreeNode),展示 components/fms-tree/FmsTree.vue(自管虚拟根)。
后端通用接口(业务数据只走这几个)
POST /auth/login:字段小写orgid/userid/password;orgid=G3HD。/data/loaddata:view_name/search_condition/可选order_by/search_columns(真 JSON 数组)。/data/page:order_by必填;分页参数名page_no/page_size。/data/saveobjt:body 是数组,每项{table, key_field, deletes, updates, inserts},key_field必填 (复合主键逗号分隔),顺序 delete→update→insert。- 模块元数据不由接口下发,前端读本地 schema JSON,改元数据无需重启后端。
DbUtils是 SQL 唯一出口:标识符加[],validateReadOnlySql()只允许查询。