diff --git a/package.json b/package.json
index 3e682fe..b4d64ef 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@kne-components/components-admin",
- "version": "1.1.36",
+ "version": "1.1.37",
"description": "用于实现一个后台管理系统的必要组件",
"scripts": {
"init": "husky",
diff --git "a/prompts/FormInfo\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/prompts/FormInfo\344\275\277\347\224\250\346\214\207\345\215\227.md"
deleted file mode 100644
index 6f109e2..0000000
--- "a/prompts/FormInfo\344\275\277\347\224\250\346\214\207\345\215\227.md"
+++ /dev/null
@@ -1,1110 +0,0 @@
-# FormInfo 组件完整使用指南
-
-## 目录
-
-1. [概述](#一概述)
-2. [导入方式](#二导入方式)
-3. [核心组件](#三核心组件)
-4. [字段类型](#四字段类型)
-5. [校验规则](#五校验规则)
-6. [列表组件](#六列表组件)
-7. [弹窗与抽屉](#七弹窗与抽屉)
-8. [分步表单](#八分步表单)
-9. [表单上下文与API](#九表单上下文与api)
-10. [多语言支持](#十多语言支持)
-11. [最佳实践](#十一最佳实践)
-
----
-
-## 一、概述
-
-FormInfo 是一个基于 React 和 Ant Design 的企业级表单组件库,提供了完整的表单状态管理、验证和提交解决方案。
-
-### 核心特性
-
-- **状态管理**: 使用 React 状态管理机制管理表单状态
-- **事件系统**: 使用事件发射器模式实现表单内部通信
-- **字段管理**: 动态添加、更新和移除表单字段
-- **验证系统**: 支持表单和字段级别的验证,内置丰富校验规则
-- **拦截器**: 提供表单操作的拦截和修改能力
-- **国际化**: 内置中英文语言支持
-
----
-
-## 二、导入方式
-
-### 1. 使用 createWithRemoteLoader(推荐)
-
-```jsx
-import { createWithRemoteLoader } from '@kne/remote-loader';
-
-const FormComponent = createWithRemoteLoader({
- modules: ['components-core:FormInfo']
-})(({ remoteModules }) => {
- const [FormInfo] = remoteModules;
- // 解构需要的组件
- const { Form, SubmitButton, fields } = FormInfo;
- const { Input, TextArea, Select } = fields;
-
- return (
-
- );
-});
-
-export default FormComponent;
-```
-
-### 2. 可用的 FormInfo 导出
-
-| 导出 | 说明 |
-|-----|-----|
-| `FormInfo` | 表单信息组件(布局) |
-| `Form` | 表单容器组件 |
-| `SubmitButton` | 提交按钮 |
-| `CancelButton` | 取消按钮 |
-| `fields` | 字段组件集合 |
-| `List` | 卡片式列表组件 |
-| `TableList` | 表格列表组件 |
-| `MultiField` | 多字段组件 |
-| `FormModal` | 模态框表单组件 |
-| `FormDrawer` | 抽屉表单组件 |
-| `FormSteps` | 步骤表单组件 |
-| `FormStepModal` | 模态框步骤表单 |
-| `useFormModal` | 表单弹窗 Hook |
-| `useFormDrawer` | 抽屉表单 Hook |
-| `useFormStepModal` | 步骤表单弹窗 Hook |
-| `useFormContext` | 表单上下文 Hook |
-| `FormApiButton` | 表单 API 操作按钮 |
-
----
-
-## 三、核心组件
-
-### 1. Form 组件
-
-表单容器组件,负责状态管理和上下文提供。
-
-```jsx
-
-```
-
-**API:**
-
-| 属性 | 说明 | 类型 | 默认值 |
-|-----|-----|-----|-----|
-| data | 初始数据 | object | {} |
-| onSubmit | 提交成功回调 | function(data, form) | - |
-| onError | 校验失败回调 | function(errors, form) | - |
-| onPrevSubmit | 提交前拦截回调 | function(data) | - |
-| rules | 自定义校验规则 | object | {} |
-| lang | 多语言配置 | array | - |
-| size | 表单尺寸 | string | - |
-| debug | 开启调试 | boolean | false |
-
-### 2. FormInfo 组件
-
-表单字段分组和布局组件。
-
-```jsx
-
- ]}
- bordered // 是否显示边框
- block // 占满整行
->
-```
-
-**API:**
-
-| 属性 | 说明 | 类型 | 默认值 |
-|-----|-----|-----|-----|
-| title | 分组标题 | string \| ReactNode | - |
-| subtitle | 副标题 | string \| ReactNode | - |
-| column | 列数 | number \| object | 2 |
-| gap | 字段间距 | number | 24 |
-| list | 字段列表 | ReactNode[] | [] |
-| bordered | 显示边框 | boolean | false |
-| block | 占满整行 | boolean | false |
-
----
-
-## 四、字段类型
-
-### 1. 基础输入类
-
-```jsx
-const { Input, InputNumber, TextArea, Password } = fields;
-
-// 普通输入框
-
-
-// 密码输入框
-
-
-// 数字输入框
-
-
-// 文本域
-
-
-// 大写输入框
-
-```
-
-### 2. 选择器类
-
-```jsx
-const { Select, RadioGroup, CheckboxGroup, Switch, Rate, Slider } = fields;
-
-// 下拉选择
-
-
-// 单选组
-
-
-// 复选框组
-
-
-// 开关
-
-
-// 评分
-
-
-// 滑动条
-
-```
-
-### 3. 高级选择器
-
-```jsx
-const { AdvancedSelect, SuperSelect, SuperSelectTableList, SuperSelectUser, SuperSelectTree } = fields;
-
-// 高级选择器(远程加载)
- ({
- pageData: [
- { id: 1, name: "张三" },
- { id: 2, name: "李四" }
- ]
- })
- }}
- nameKey="id"
- labelKey="name"
-/>
-
-// 超级选择器
-
-
-// 表格选择器
- ({ pageData: [...] }) }}
-/>
-
-// 用户选择器
-
-
-// 树形选择器
-
-```
-
-### 4. 日期时间类
-
-```jsx
-const { DatePicker, DateRangePicker, TimePicker, TimeRangePicker, DatePickerToday, MonthPicker, WeekPicker } = fields;
-
-// 日期选择
- current && current < dayjs().startOf('day')} // 禁止选择过去日期
-/>
-
-// 日期范围
-
-
-// 今日起止(包含"至今"选项)
-
-
-// 月份选择
-
-
-// 周选择
-
-
-// 时间选择
-
-
-// 时间范围
-
-```
-
-### 5. 业务专用类
-
-```jsx
-const { PhoneNumber, MoneyInput, SalaryInput, AddressSelect, AddressInput, FunctionSelect, IndustrySelect } = fields;
-
-// 手机号
-
-
-// 金额输入
-
-
-// 薪资输入
-
-
-// 地址选择
-
-
-// 地址输入
-
-
-// 职能选择
-
-
-// 行业选择
-
-```
-
-### 6. 上传类
-
-```jsx
-const { Upload, Avatar, Signature } = fields;
-
-// 文件上传
-
-
-// 头像上传
-
-
-// 签名
-
-```
-
-### 7. 其他
-
-```jsx
-const { Cascader, ColorPicker, TreeSelect, TypeDateRangePicker } = fields;
-
-// 级联选择
-
-
-// 颜色选择
-
-
-// 树形选择
-
-
-// 带类型的日期范围
-
-```
-
----
-
-## 五、校验规则
-
-### 1. 内置规则
-
-| 规则 | 说明 | 示例 |
-|-----|-----|-----|
-| `REQ` | 必填 | `rule="REQ"` |
-| `EMAIL` | 邮箱格式 | `rule="EMAIL"` |
-| `TEL` | 电话格式 | `rule="TEL"` |
-| `PHONE` | 手机号格式 | `rule="PHONE"` |
-| `NUM` | 数字 | `rule="NUM"` |
-| `INT` | 整数 | `rule="INT"` |
-| `ID_CARD` | 身份证号 | `rule="ID_CARD"` |
-| `LEN-最小-最大` | 长度限制 | `rule="LEN-3-10"` |
-| `LEN-0-最大` | 最大长度 | `rule="LEN-0-500"` |
-
-### 2. 组合使用
-
-```jsx
-
-
-
-```
-
-### 3. 自定义规则
-
-```jsx
-
-```
-
-### 4. 字段通用属性
-
-```jsx
- formData.type === 'vip'} // 条件显示
- onChange={(value, { formData }) => console.log(value)}
-/>
-```
-
----
-
-## 六、列表组件
-
-### 1. List(卡片式列表)
-
-```jsx
-import { List } from '@components/FormInfo';
-
- data?.companyName || `经历 ${index + 1}`}
- maxLength={5}
- minLength={1}
- important // 重要样式
- addText="添加经历"
- removeText="删除"
- list={[
- ,
- ,
- ,
-
- ]}
-/>
-```
-
-**API:**
-
-| 属性 | 说明 | 类型 | 默认值 |
-|-----|-----|-----|-----|
-| name | 字段名 | string | - |
-| title | 列表标题 | string \| ReactNode | - |
-| itemTitle | 项标题渲染 | function | - |
-| list | 字段列表 | ReactNode[] | - |
-| maxLength | 最大条数 | number | - |
-| minLength | 最小条数 | number | - |
-| important | 重要样式 | boolean | false |
-| addText | 添加按钮文本 | string | 添加 |
-| removeText | 删除按钮文本 | string | 删除 |
-
-### 2. TableList(表格列表)
-
-```jsx
-import { TableList } from '@components/FormInfo';
-
-,
- ,
-
- ]}
-/>
-```
-
-### 3. MultiField(多字段)
-
-```jsx
-import { MultiField } from '@components/FormInfo';
-
-
-```
-
-### 4. 嵌套列表
-
-```jsx
-
,
- ,
-
- ]}
- />
- ]}
-/>
-```
-
----
-
-## 七、弹窗与抽屉
-
-### 1. useFormModal(表单弹窗 Hook)
-
-```jsx
-import { createWithRemoteLoader } from '@kne/remote-loader';
-
-const Component = createWithRemoteLoader({
- modules: ['components-core:FormInfo@useFormModal']
-})(({ remoteModules }) => {
- const [useFormModal] = remoteModules;
- const formModal = useFormModal();
-
- return (
-
- );
-});
-```
-
-### 2. useFormDrawer(抽屉表单 Hook)
-
-```jsx
-import { createWithRemoteLoader } from '@kne/remote-loader';
-
-const Component = createWithRemoteLoader({
- modules: ['components-core:FormInfo@useFormDrawer']
-})(({ remoteModules }) => {
- const [useFormDrawer] = remoteModules;
- const formDrawer = useFormDrawer();
-
- return (
-
- );
-});
-```
-
-### 3. FormModal 组件
-
-```jsx
-import { FormModal, FormInfo, Input } from '@components/FormInfo';
-
- onOpenChange(false)}
- formProps={{
- data: initialData,
- onSubmit: handleSubmit
- }}
- autoClose={true}
- okText="保存"
- cancelText="取消"
- width={800}
->
- ,
-
- ]}
- />
-
-```
-
-### 4. FormDrawer 组件
-
-```jsx
-import { FormDrawer, FormInfo, Input } from '@components/FormInfo';
-
- onOpenChange(false)}
- width={600}
- formProps={{
- data: initialData,
- onSubmit: handleSubmit
- }}
->
-
- ]}
- />
-
-```
-
----
-
-## 八、分步表单
-
-### 1. FormSteps(步骤表单)
-
-```jsx
-import { FormSteps, FormInfo, Input, SubmitButton, CancelButton } from '@components/FormInfo';
-
-,
-
- ]}
- />
- )
- },
- {
- title: '详细信息',
- formProps: { data: formData },
- children: (
-
- ]}
- />
- )
- }
- ]}
- autoStep={true}
- onComplete={handleComplete}
- onChange={(current, data) => console.log(current, data)}
-/>
-```
-
-**API:**
-
-| 属性 | 说明 | 类型 | 默认值 |
-|-----|-----|-----|-----|
-| items | 步骤配置项 | array | [] |
-| autoStep | 自动切换下一步 | boolean | true |
-| orientation | 步骤条方向 | horizontal \| vertical | horizontal |
-| onChange | 步骤切换回调 | function | - |
-| onComplete | 完成回调 | function | - |
-
-### 2. FormStepsModal(模态框步骤表单)
-
-```jsx
-import { FormStepsModal, FormInfo, Input } from '@components/FormInfo';
-
- onOpenChange(false),
- width: 900
- }}
- items={[...]} // 同 FormSteps items
- autoStep={true}
- completeText="提交"
- nextText="下一步"
- onComplete={handleComplete}
-/>
-```
-
-### 3. useFormStepModal(Hook 方式)
-
-```jsx
-import { createWithRemoteLoader } from '@kne/remote-loader';
-
-const Component = createWithRemoteLoader({
- modules: ['components-core:FormInfo@useFormStepModal']
-})(({ remoteModules }) => {
- const [useFormStepModal] = remoteModules;
- const stepModal = useFormStepModal();
-
- return (
-
- );
-});
-```
-
----
-
-## 九、表单上下文与API
-
-### 1. useFormContext
-
-```jsx
-import { useFormContext } from '@components/FormInfo';
-
-const FormActions = () => {
- const { openApi, formData } = useFormContext();
-
- return (
- <>
-
-
-
-
-
-
-
- >
- );
-};
-```
-
-### 2. openApi 方法
-
-| 方法 | 说明 | 参数 |
-|-----|-----|-----|
-| getFormData() | 获取表单数据 | - |
-| getValue(name) | 获取字段值 | name |
-| setField({ name, value }) | 设置单个字段 | name, value |
-| setFields([...]) | 设置多个字段 | array |
-| setFormData(data) | 设置整个表单 | object |
-| validateAll() | 校验所有字段 | - |
-| validate(name) | 校验单个字段 | name |
-| reset() | 重置表单 | - |
-| getFieldError(name) | 获取错误信息 | name |
-
-### 3. FormApiButton
-
-```jsx
-import { FormApiButton } from '@components/FormInfo';
-
- {
- console.log("当前数据:", formData);
- openApi.setFields([
- { name: "name", value: "新值" }
- ]);
- }}
->
- 操作表单
-
-```
-
-### 4. 字段关联(associations)
-
-```jsx
-
-
- {
- const { firstName, familyName } = openApi.getFormData();
- openApi.setFieldValue(target, `${firstName} ${familyName}`);
- }
- }}
-/>
-```
-
----
-
-## 十、多语言支持
-
-### 1. Form 多语言配置
-
-```jsx
-
-```
-
-### 2. lang 配置项
-
-| 配置 | 说明 |
-|-----|-----|
-| name | 语言标识 |
-| label | 语言名称 |
-| options.labelTransform | label 转换函数 |
-| options.ignore | 忽略的字段 |
-| options.disabled | 禁用的字段 |
-| options.nameTransform | name 转换函数 |
-
----
-
-## 十一、最佳实践
-
-### ✅ 推荐做法
-
-1. **使用 createWithRemoteLoader 导入**: FormInfo 必须通过 `createWithRemoteLoader` 加载
-2. **禁止通过 props 传递 FormInfo**: 子组件需要使用 FormInfo 时,应自行加载
-3. **字段命名**: 使用有意义的 name,支持嵌套如 `data.name`
-4. **校验规则**: 组合使用内置规则,如 `"REQ LEN-3-10 EMAIL"`
-5. **布局**: 使用 `column` 控制列数,常用 `column={1}` 或 `column={2}`
-6. **条件渲染**: 使用 `display` 属性进行条件判断
-7. **日期限制**: 使用 `dayjs` 进行日期比较,禁止过去日期
-8. **列表字段**: 设置 `maxLength` 限制数量
-
-### ❌ 错误示例
-
-```jsx
-// 错误:通过 props 传递 FormInfo
-const Parent = createWithRemoteLoader({
- modules: ['components-core:FormInfo']
-})(({ remoteModules }) => {
- const [FormInfo] = remoteModules;
- return ;
-});
-
-const ChildForm = ({ FormInfo }) => {
- return (
-
- );
-};
-```
-
-### ✅ 正确示例
-
-```jsx
-// 正确:子组件自行加载 FormInfo
-const Parent = createWithRemoteLoader({
- modules: ['components-core:FormInfo']
-})(({ remoteModules }) => {
- return ;
-});
-
-const ChildForm = createWithRemoteLoader({
- modules: ['components-core:FormInfo']
-})(({ remoteModules }) => {
- const [FormInfo] = remoteModules;
- return (
-
- );
-});
-```
-
----
-
-## 附录
-
-### 完整示例:员工信息表单
-
-```jsx
-import { createWithRemoteLoader } from '@kne/remote-loader';
-
-const EmployeeForm = createWithRemoteLoader({
- modules: ['components-core:FormInfo']
-})(({ remoteModules }) => {
- const [FormInfo] = remoteModules;
- const { Form, SubmitButton, CancelButton, fields } = FormInfo;
- const { Input, TextArea, Select, DatePicker, PhoneNumber, List, TableList } = fields;
-
- return (
-
- );
-});
-
-export default EmployeeForm;
-```
diff --git a/prompts/README.md b/prompts/README.md
deleted file mode 100644
index 979f126..0000000
--- a/prompts/README.md
+++ /dev/null
@@ -1,173 +0,0 @@
-# Prompts 文档集合
-
-本项目包含多个 AI prompts 文档,用于指导生成前端组件库相关的代码模块、文档和示例。
-
----
-
-## 文档集合列表
-
-### 1. BizUnit 使用指南
-
-**功能**: 生成基于 BizUnit 架构模式的完整前端业务模块
-
-**适用场景**:
-- 需要生成包含完整 CRUD 功能的前端业务模块
-- 需要国际化支持和可复用组件结构
-- 生成符合规范的目录结构和文档示例
-
-**核心内容**:
-- 模块目录结构规范(List、Detail、FormInner、TabDetail、Actions 等组件)
-- 核心组件实现规范(根组件、列表页、表单组件、详情页、Tab 详情页)
-- 国际化文件规范(中英文语言包)
-- API 集成规范
-- 文档示例规范
-
-**所属集合**: `prompts-remote-components/`
-
----
-
-### 2. RemoteLoader 使用指南
-
-**功能**: 远程模块加载库的使用指南,基于 Webpack 5 Module Federation
-
-**适用场景**:
-- 构建微前端架构
-- 需要在运行时动态加载远程模块
-- 多团队独立开发部署模块的场景
-
-**核心内容**:
-- 四种使用方式:RemoteLoader 组件、withRemoteLoader HOC、useLoader Hook、createWithRemoteLoader
-- 模块标记格式详解
-- API 参考(preset、loadModule、safeLoadModule、parseToken 等)
-- 缓存机制
-- 错误处理和调试
-- 性能优化
-
-**所属集合**: `prompts-remote-components/`
-
----
-
-### 3. FormInfo 使用指南
-
-**功能**: 基于 React 和 Ant Design 的企业级表单组件库
-
-**适用场景**:
-- 构建复杂的表单页面
-- 需要表单验证、动态字段、弹窗/抽屉表单
-- 分步表单向导
-
-**核心内容**:
-- 核心组件:Form、FormInfo、SubmitButton、CancelButton
-- 字段类型:Input、TextArea、Select、DatePicker、Upload 等
-- 校验规则配置
-- 列表组件:List(卡片式)、TableList(表格)
-- 弹窗与抽屉:FormModal、FormDrawer
-- 分步表单:FormSteps、FormStepModal
-- 表单 Hook:useFormModal、useFormDrawer、useFormStepModal
-- 国际化支持
-
-**所属集合**: 根目录、`prompts-remote-components/`(内容相同)
-
----
-
-### 4. 国际化
-
-**功能**: 指导组件完成国际化改造
-
-**适用场景**:
-- 需要为组件添加多语言支持
-- 创建语言包和国际化上下文
-- 修改组件以支持国际化
-
-**核心内容**:
-- 国际化文件创建(withLocale.js、locale/zh-CN.js、locale/en-US.js)
-- 组件修改模式(主组件、FormInner、getColumns、Action)
-- useIntl Hook 和 withLocale HOC 使用方式
-- createWithRemoteLoader 组件的国际化包裹规范
-- 语言包 key 命名规范
-- 检查要点清单
-
-**所属集合**: `prompts-remote-components/`
-
----
-
-### 5. 生成文档
-
-**功能**: 根据代码实现自动生成项目文档(summary.md 和 api.md)
-
-**适用场景**:
-- 需要为组件生成规范化的项目概述文档
-- 需要生成 API 属性表格文档
-- 组件开发完成后需要补充文档
-
-**核心内容**:
-- 项目概述文档(doc/summary.md)格式规范
-- API 文档(doc/api.md)格式规范
-- 文档生成流程(分析代码结构、提取 API 信息)
-- 格式约束(标题级别、表格格式、无示例代码)
-
-**所属集合**: `prompts-remote-components/`
-
----
-
-### 6. 组件示例编写提示词
-
-**功能**: 指导编写规范的组件示例代码和配置
-
-**适用场景**:
-- 为组件编写可运行的示例代码
-- 配置 example.json 示例配置文件
-- 编写覆盖 API 的完整示例
-
-**核心内容**:
-- 文件结构规范(doc/ 目录、子组件示例规则)
-- example.json 配置结构
-- 示例代码规范(scope 依赖声明、导入方式)
-- 示例内容设计原则(API 覆盖率、真实业务场景、数据真实性)
-- FormInfo 组件示例特殊规则
-- Mock 数据规范和使用方式
-- 示例完整性检查清单
-
-**所属集合**: 根目录、`prompts-remote-components/`(内容略有差异)
-
----
-
-### 7. BizUnit 业务模块生成提示词
-
-**功能**: 快速生成业务模块 action 的代码模板
-
-**适用场景**:
-- 需要快速生成业务表单操作按钮
-- 创建新建、编辑类业务组件
-
-**核心内容**:
-- 组件命名规范(大写字母开头英文名称)
-- 代码模板结构
-- 成功提示语配置
-- 表单弹窗集成
-
-**所属集合**: 根目录
-
----
-
-## 快速选择指南
-
-| 需求 | 推荐文档 | 所属集合 |
-|------|---------|---------|
-| 生成完整的业务模块(列表+表单+详情) | BizUnit 使用指南 | prompts-remote-components/ |
-| 加载远程组件/微前端 | RemoteLoader 使用指南 | prompts-remote-components/ |
-| 构建表单页面(验证、动态字段、弹窗) | FormInfo 使用指南 | 两者都有 |
-| 为组件添加多语言支持 | 国际化 | prompts-remote-components/ |
-| 为组件生成项目概述和 API 文档 | 生成文档 | prompts-remote-components/ |
-| 编写组件示例代码和配置 | 组件示例编写提示词 | 两者都有 |
-| 快速生成业务 Action 组件 | BizUnit 业务模块生成提示词 | 根目录 |
-
----
-
-## 版本信息
-
-```json
-{
- "@kne/prompts-remote-components": "1.0.2"
-}
-```
diff --git a/prompts/bizunit-module-prompt.md b/prompts/bizunit-module-prompt.md
deleted file mode 100644
index 98edfd7..0000000
--- a/prompts/bizunit-module-prompt.md
+++ /dev/null
@@ -1,270 +0,0 @@
-# BizUnit前端业务模块生成提示词
-
-## 模块概述
-
-请根据以下规范生成一个完整的前端业务模块,该模块基于BizUnit架构模式,包含完整的CRUD功能、国际化支持、文档示例和可复用的组件结构。
-
-## 目录结构
-
-```
-src/components/[ModuleName]/
-├── index.js # 主入口文件,导出所有组件
-├── [ModuleName].js # 根组件,路由配置
-├── withLocale.js # 国际化HOC封装
-├── style.module.scss # 全局样式文件
-├── Actions/ # 操作按钮组件目录
-│ ├── index.js # Actions主组件
-│ ├── Create.js # 新建按钮
-│ ├── Save.js # 编辑/保存按钮
-│ ├── Remove.js # 删除按钮
-│ └── SetStatus.js # 设置状态按钮
-├── Detail/ # 详情页目录
-│ ├── index.js # 详情页主组件
-│ └── RightOptions.js # 右侧操作按钮
-├── FormInner/ # 表单内部组件目录
-│ └── index.js # 表单字段定义
-├── List/ # 列表页目录
-│ ├── index.js # 列表页主组件
-│ └── getColumns.js # 列配置
-├── TabDetail/ # Tab详情页目录
-│ ├── index.js # Tab详情页主组件
-│ └── [TabName]/ # 各个Tab内容
-├── locale/ # 国际化文件目录
-│ ├── zh-CN.js # 中文语言包
-│ └── en-US.js # 英文语言包
-├── doc/ # 文档和示例目录
-│ ├── api.md # API文档
-│ ├── list.js # 列表示例
-│ ├── detail.js # 详情示例
-│ ├── form-inner.js # 表单示例
-│ ├── tab-detail.js # Tab详情示例
-│ ├── example.json # 示例数据
-│ ├── summary.md # 摘要说明
-│ └── style.scss # 文档样式
-└── README.md # 模块说明文档
-```
-
-## 核心组件实现规范
-
-### 1. 主入口文件 (index.js)
-
-导出所有子组件,包括:
-- 默认导出:根组件
-- 命名导出:List, FormInner, Detail, TabDetail, Actions等
-
-### 2. 根组件 ([ModuleName].js)
-
-- 使用 `createWithRemoteLoader` 进行远程模块加载
-- 使用 `ChildrenRouter` 或 `AppChildrenRouter` 进行路由配置
-- 配置路由路径和懒加载
-- 支持自定义 navigation 和 list 配置
-
-示例结构:
-```javascript
-import ChildrenRouter from '@kne/app-children-router';
-import withLocale from './withLocale';
-
-const ModuleNameInner = ({ baseUrl, ...props }) => {
- return (
- import('./List') },
- { path: 'detail', loader: () => import('./Detail') },
- { path: 'tab-detail', loader: () => import('./TabDetail') }
- ]}
- />
- );
-};
-
-export default withLocale(ModuleNameInner);
-```
-
-### 3. 国际化封装 (withLocale.js)
-
-使用 `createWithIntlProvider` 创建国际化HOC:
-```javascript
-import { createWithIntlProvider } from '@kne/react-intl';
-import zhCN from './locale/zh-CN';
-import enUS from './locale/en-US';
-
-const withLocale = createWithIntlProvider({
- defaultLocale: 'zh-CN',
- messages: {
- 'zh-CN': zhCN,
- 'en-US': enUS
- },
- namespace: 'components-admin:ModuleName'
-});
-
-export default withLocale;
-```
-
-### 4. 列表页 (List/index.js)
-
-- 使用 `TablePage` 或 `Table` 组件
-- 集成 `Filter` 进行筛选
-- 使用 `StateBar` 进行状态切换
-- 定义 `getColumns` 配置表格列
-- 支持 `SearchInput` 关键字搜索
-- 支持分页、排序
-
-核心要素:
-- `usePreset()` 获取apis配置
-- `useIntl()` 获取formatMessage
-- `useRef()` 管理表格reload
-- `useState()` 管理筛选状态
-- `useNavigate()` 路由跳转
-
-### 5. 列配置 (List/getColumns.js)
-
-导出 `getColumns` 函数,接收 `{ navigate, formatMessage }` 参数
-列类型包括:
-- `serialNumber`: 序号
-- `mainInfo`: 主信息(可点击)
-- `tag`: 标签
-- `description`: 描述
-- `datetime`: 日期时间
-- `options`: 操作列
-
-### 6. 表单组件 (FormInner/index.js)
-
-- 使用 `FormInfo` 组件
-- 支持多种字段类型:
- - `Input`: 文本输入
- - `InputNumber`: 数字输入
- - `TextArea`: 文本域
- - `Select`: 下拉选择
- - `DatePicker`: 日期选择
- - `DateRangePicker`: 日期范围
- - `Switch`: 开关
- - `ColorPicker`: 颜色选择器
- - `Avatar`: 头像上传
-- 支持验证规则:`REQ`必填, `LEN-0-100`长度限制
-
-### 7. 详情页 (Detail/index.js)
-
-- 使用 `Fetch` 组件获取详情数据
-- 使用 `Page` 和 `InfoPage` 组件
-- 使用 `Descriptions` 展示详情信息
-- 支持 `RightOptions` 操作按钮
-
-### 8. Tab详情页 (TabDetail/index.js)
-
-- 使用 `StateBarPage` 组件
-- 支持多个Tab切换
-- 使用 `PageHeader` 显示标题和标签
-- 使用 `StateTag` 显示状态标签
-- 根据 `searchParams.get('tab')` 切换内容
-
-### 9. Actions组件 (Actions/index.js)
-
-- 使用 `ButtonGroup` 组件
-- 定义操作列表:
- - 编辑
- - 设置状态
- - 删除
-- 支持条件显示(hidden属性)
-- 支持确认弹窗(confirm属性)
-
-### 10. 各个Action按钮
-
-- **Create.js**: 新建按钮,使用 `useFormModal`
-- **Save.js**: 编辑按钮,使用 `useFormModal`,预填充数据
-- **Remove.js**: 删除按钮,需要confirm确认
-- **SetStatus.js**: 设置状态按钮
-
-## 国际化文件规范
-
-### zh-CN.js 和 en-US.js
-
-包含以下类型键值:
-- 列表列标题:ID, Name, Status, Description, CreatedAt等
-- 操作按钮:Add, Edit, Delete, Save等
-- 成功提示:AddSuccess, SaveSuccess, DeleteSuccess等
-- 确认提示:DeleteConfirm等
-- 表单标签:字段名称
-- 详情页标题
-
-## API集成规范
-
-通过 `usePreset()` 获取 `apis` 对象,包含:
-- `list`: 列表接口
-- `detail`: 详情接口
-- `create`: 新建接口
-- `save`: 编辑接口
-- `remove`: 删除接口
-- 其他业务接口
-
-## 文档示例规范
-
-### doc/list.js
-
-使用 `PureGlobal` 提供mock数据:
-```javascript
-const { default: List } = _ModuleName;
-const { createWithRemoteLoader } = remoteLoader;
-const BaseExample = createWithRemoteLoader({
- modules: ['components-core:Global@PureGlobal', 'components-core:Global@usePreset', 'components-core:Layout']
-})(({ remoteModules }) => {
- const [PureGlobal, usePreset, Layout] = remoteModules;
- const { ajax } = usePreset();
- return (
-
-
-
-
-
- );
-});
-render();
-```
-
-### README.md
-
-包含:
-- 概述(模块功能说明)
-- 示例代码(列表、表单、详情、Tab详情)
-- API文档(属性说明表格)
-
-## 样式规范
-
-- 使用 CSS Modules(`*.module.scss`)
-- 遵循 BEM 命名规范
-- 响应式设计支持
-
-## 技术栈
-
-- React 18+
-- React Router v6
-- Ant Design 5.x
-- @kne/remote-loader(远程模块加载)
-- @kne/react-intl(国际化)
-- @kne/react-fetch(数据请求)
-- @kne/app-children-router(路由组件)
-
-## 生成要求
-
-1. 完整实现上述目录结构
-2. 所有组件使用 `createWithRemoteLoader` 加载依赖
-3. 所有组件使用 `withLocale` HOC进行国际化封装
-4. 实现完整的CRUD功能
-5. 提供完整的国际化文件(中英文)
-6. 提供完整的文档示例
-7. 代码风格统一,使用ESLint
-8. 注释清晰,易于维护
-9. 支持响应式设计
-10. 提供类型定义(TypeScript项目)
-
-## 上下文信息
-
-生成模块时需要提供:
-- 模块名称(ModuleName)
-- 业务字段定义
-- API接口路径
-- 特殊业务逻辑说明
-- 列表列配置要求
-- 表单字段配置要求
-- 详情页展示要求
-- Tab页配置要求(如需要)
diff --git "a/prompts/prompts-remote-components/BizUnit\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/prompts/prompts-remote-components/BizUnit\344\275\277\347\224\250\346\214\207\345\215\227.md"
index 91efa59..9326677 100644
--- "a/prompts/prompts-remote-components/BizUnit\344\275\277\347\224\250\346\214\207\345\215\227.md"
+++ "b/prompts/prompts-remote-components/BizUnit\344\275\277\347\224\250\346\214\207\345\215\227.md"
@@ -164,20 +164,263 @@ export default withLocale;
### 9. Actions组件 (Actions/index.js)
-- 使用 `ButtonGroup` 组件
-- 定义操作列表:
- - 编辑
- - 设置状态
- - 删除
-- 支持条件显示(hidden属性)
-- 支持确认弹窗(confirm属性)
+Actions 是一个**条件组合器**,根据业务状态动态组装可用 Action 列表,通过 `ButtonGroup` 统一渲染。
+
+#### 核心架构
+
+```
+Actions (组合器)
+ ├── 根据 data 条件组装 list 数组
+ ├── list 每项: { buttonComponent, data, children, onSuccess, ...props }
+ └── 或 children({ list }) 自定义渲染
+ └── 遍历 list → React.createElement(item.buttonComponent, item)
+ ├── Detail →
+ ├── SendMessage →
+ ├── Remove →
+ └── ...
+```
+
+#### 实现规范
+
+```javascript
+import { createWithRemoteLoader } from '@kne/remote-loader';
+import withLocale from '../withLocale';
+import { useIntl } from '@kne/react-intl';
+import Detail from './Detail';
+import SendMessage from './SendMessage';
+
+const ActionsInner = createWithRemoteLoader({
+ modules: ['components-core:ButtonGroup']
+})(({ remoteModules, children, data, onSuccess, moreType = 'link', itemClassName, ...props }) => {
+ const [ButtonGroup] = remoteModules;
+ const { formatMessage } = useIntl();
+ const list = [];
+
+ // 始终显示详情按钮
+ list.push({
+ ...props,
+ buttonComponent: Detail,
+ data,
+ children: formatMessage({ id: 'Detail' }),
+ onSuccess
+ });
+
+ // 条件显示:状态为启用时才显示发送按钮
+ if (Number(data.status) === 0) {
+ list.push({
+ ...props,
+ buttonComponent: SendMessage,
+ data,
+ children: formatMessage({ id: 'SendMessage' }),
+ onSuccess
+ });
+ }
+
+ // 支持自定义渲染
+ if (typeof children === 'function') {
+ return children({ list });
+ }
+
+ // 默认渲染 ButtonGroup
+ return ;
+});
+
+const Actions = withLocale(ActionsInner);
+export { Detail, SendMessage };
+export default Actions;
+```
+
+#### 关键要点
+
+1. **`list` 项结构**:每项必须包含 `buttonComponent`(组件引用)+ `children`(按钮文字)+ `data` + `onSuccess` + `...props`
+2. **`...props` 透传机制**:让 `ButtonGroup` → 个体 Action 之间的属性传递自然流畅,按钮样式(`type="link"`)、`className` 等由上层注入
+3. **条件组合**:根据业务状态(如 `data.status`)动态决定显示哪些 Action
+4. **双渲染模式**:默认 `` 自动渲染按钮组(按钮过多时折叠为"更多"下拉);当 `children` 是函数时,`children({ list })` 让调用方完全掌控渲染
+5. **业务区分属性**:如需区分不同业务场景(模板/记录),使用 `detailType` 等语义化命名,**不要占用 `type` 属性**(`type` 专用于按钮样式,如 `type="link"`)
### 10. 各个Action按钮
-- **Create.js**: 新建按钮,使用 `useFormModal`
-- **Save.js**: 编辑按钮,使用 `useFormModal`,预填充数据
-- **Remove.js**: 删除按钮,需要confirm确认
-- **SetStatus.js**: 设置状态按钮
+**核心原则:每个 Action 组件自己渲染自己的 Button,自己管理自己的 Modal/请求逻辑,不依赖外部提供 UI 容器。**
+
+#### 两种 Action 模式
+
+**模式 A — 展示型 Action(详情、错误详情等)**
+
+使用 `Button` + `useModal`,点击按钮打开弹窗展示内容:
+
+```javascript
+import { createWithRemoteLoader } from '@kne/remote-loader';
+import { Button } from 'antd';
+import withLocale from '../withLocale';
+import { useIntl } from '@kne/react-intl';
+import DetailContent from '../DetailContent';
+
+const DetailInner = createWithRemoteLoader({
+ modules: ['components-core:Modal@useModal']
+})(({ remoteModules, data, ...props }) => {
+ const [useModal] = remoteModules;
+ const { formatMessage } = useIntl();
+ const modal = useModal();
+
+ return (
+