# psi_opencode **Repository Path**: toalson/psi_opencode ## Basic Information - **Project Name**: psi_opencode - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-26 - **Last Updated**: 2026-07-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PSI 进销存(opencode 维护版) PSI — **P**artner(商业合作伙伴), **S**olution(企业管理解决方案), **I**nfrastructure(进销存软件基础设施) 基于 ThinkPHP 8.0 的全开源进销存 + 财务会计总账系统。PHP 8.0+ / MySQL,纯 SQL 数据层,无 ORM。 本仓库在原 PSI 基础上完成了框架大版本升级、安全审计、库存计算重构等深度改造。 ## 功能模块 | 模块 | 路由前缀 | 涵盖范围 | |------|----------|----------| | 基础管理 | Home | 用户/权限/组织/业务配置/门户 | | 表单构建器 & 代码表 | SLN0000 | 动态表单、代码表、系统字典 | | 核心进销存 | SLN0001 | 商品/仓库/采购/销售/库存/WMS | | 总账财务 | SLN0002 | 凭证/科目/总账报表 | | 自动凭证 | SLN0005 | 业务单据自动生成会计凭证 | ## 技术架构 ``` Controller → Service → DAO → MySQL (via PSIDB) ``` - **PHP 8.0+**, **ThinkPHP 8.0** 框架, **MySQL** 数据库 - **PSIDB**: 自定义 DAO 层,`sprintf` 风格占位符,PDO 参数绑定 + vsprintf 混合模式 - **视图**: ThinkPHP 原生模板引擎,分隔符 `{` / `}`,视图文件 camelCase 命名 - **权限**: `app/common/FIdConst.php` 定义权限常量,按 action 粒度校验 - **库存事件溯源**: `app/service/sln0001/inventory/` 下以命令模式 + 成本计算器策略实现(FIFO / 移动平均) - **数据迁移**: `php think migrate:inventory-events` 将旧库存明细迁移至事件存储 ## 前端架构 ``` PCL (ExtJS 4.2.1) → 5 个 layout.html → 237 个 JS 组件文件 ``` - **框架**: ExtJS 4.2.1(通过 PCL 别名层封装,实际为完整 ExtJS 4.2.1.883) - **JS 组件**: 237 个文件位于 `public/Public/Scripts/PSI/`,使用 Classic Toolkit(`Ext.grid.Panel`, `Ext.window.Window`, `Ext.form.field` 等) - **懒加载**: 自研 `__PSI.need/ready/load` 系统替代 ExtJS 动态加载器,避免同步 XHR 警告 - **样式**: 自定义主题位于 `public/Public/Content/Site.css` + `icons.css`,覆盖 ExtJS 默认主题 ### 浏览器兼容性 ExtJS 4.2.1 已停止维护 10+ 年,现代 Chrome/Firefox 存在已知渲染差异。通过 `public/Public/Content/ext-chrome-fixes.css` 提供 12 组 CSS 修補: | 修補 | 瀏覽器 | 問題 | |------|--------|------| | `box-sizing: border-box` | Chrome | Grid 表頭/內容不對齊 | | `display: inline` | Chrome | Form 輸入框顯示異常 | | `line-height: normal` | Chrome | Textarea emptyText 高度跳動 | | `width: 200px` | Chrome | DatePicker 寬度爆炸 | | `word-break` + `overflow-wrap` | Chrome | Tooltip 內容被截斷 | | `position: absolute` | Chrome | Modal mask 不顯示 | | `table-layout: fixed` | Chrome | Grid 滾動條右側空白 | | `translateZ(0)` | Chrome | 佈局抖動 | | `overflow: visible` | Firefox | Form 在 Window 內多餘滾動條 | | `width: 100%` | Firefox | Box 內部 div 寬度 20000px | | `white-space: nowrap` | Firefox | Paging toolbar 變形 | | `outline: none` | Firefox | Focus outline 不一致 | ### 已知未解決問題 - **Chrome 131+ `STATUS_ACCESS_VIOLATION`** — 瀏覽器 accessibility 功能導致 grid 崩潰,需 ExtJS 6.5+ 才能修復 - **同步 XHR 廢棄** — Chrome 已廢棄主執行緒同步請求,需 JS 打包(Sencha Cmd 或自訂合併)才能消除 - **無安全修補** — ExtJS 4.2.1 不再有官方更新 > 开发指引见 [AGENTS.md](AGENTS.md) ## 快速启动 ```bash cp .example.env .env # 配置数据库连接 composer install php think run # 启动开发服务器 → http://localhost:8000 ``` ## 许可 GPL v3 — 可免费用于商业用途。无需支付授权费用。 ## 相关资源 - [原上游 PSI 项目](https://gitee.com/crm8000/PSI) — 本 fork 的原始来源 - [PCL — PSI 前端 ExtJS 4.2 维护版](https://gitee.com/crm8000/PCL) - [Wiki](https://gitee.com/crm8000/PSI/wikis) — 安装部署与使用文档