diff --git a/build/cool/eps.d.ts b/build/cool/eps.d.ts index 9d71bff..6a91aa8 100644 --- a/build/cool/eps.d.ts +++ b/build/cool/eps.d.ts @@ -1,18 +1,4 @@ declare namespace Eps { - interface AiAppEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface AiDataInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - interface BaseSysDepartmentEntity { /** * ID @@ -295,6 +281,49 @@ declare namespace Eps { [key: string]: any; } + interface DemoGoodsEntity { + /** + * ID + */ + id?: number; + /** + * 标题 + */ + title?: string; + /** + * 价格 + */ + price?: number; + /** + * 描述 + */ + description?: string; + /** + * 主图 + */ + mainImage?: string; + /** + * 示例图 + */ + exampleImages?: json; + /** + * 库存 + */ + stock?: number; + /** + * 创建时间 + */ + createTime?: Date; + /** + * 更新时间 + */ + updateTime?: Date; + /** + * 任意键值 + */ + [key: string]: any; + } + interface DictInfoEntity { /** * ID @@ -365,262 +394,6 @@ declare namespace Eps { [key: string]: any; } - interface FlowConfigEntity { - /** - * ID - */ - id?: number; - /** - * 名称 - */ - name?: string; - /** - * 描述 - */ - description?: string; - /** - * 类型 - */ - type?: string; - /** - * 节点 - */ - node?: string; - /** - * 配置 - */ - options?: json; - /** - * 创建时间 - */ - createTime?: Date; - /** - * 更新时间 - */ - updateTime?: Date; - /** - * 任意键值 - */ - [key: string]: any; - } - - interface FlowInfoEntity { - /** - * ID - */ - id?: number; - /** - * 名称 - */ - name?: string; - /** - * 标签(可以根据标签调用) - */ - label?: string; - /** - * 描述 - */ - description?: string; - /** - * 状态 0-禁用 1-禁用 - */ - status?: number; - /** - * 版本 - */ - version?: number; - /** - * 草稿 - */ - draft?: json; - /** - * 数据 - */ - data?: json; - /** - * 发布时间 - */ - releaseTime?: Date; - /** - * 创建时间 - */ - createTime?: Date; - /** - * 更新时间 - */ - updateTime?: Date; - /** - * 任意键值 - */ - [key: string]: any; - } - - interface RecycleDataEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface KnowConfigEntity { - /** - * ID - */ - id?: number; - /** - * 名称 - */ - name?: string; - /** - * 描述 - */ - description?: string; - /** - * 类型 - */ - type?: string; - /** - * 功能 - */ - func?: string; - /** - * 配置 - */ - options?: json; - /** - * 创建时间 - */ - createTime?: Date; - /** - * 更新时间 - */ - updateTime?: Date; - /** - * 任意键值 - */ - [key: string]: any; - } - - interface KnowDataInfoEntity { - /** - * ID - */ - id?: number; - /** - * 类型ID - */ - typeId?: number; - /** - * 标题 - */ - title?: string; - /** - * 内容 - */ - content?: json; - /** - * 来源 0-自定义 1-文件 2-链接 - */ - from?: number; - /** - * 元数据 - */ - metadata?: json; - /** - * 状态 0-准备中 1-已就绪 - */ - status?: number; - /** - * 启用 0-禁用 1-启用 - */ - enable?: number; - /** - * 创建时间 - */ - createTime?: Date; - /** - * 更新时间 - */ - updateTime?: Date; - /** - * 任意键值 - */ - [key: string]: any; - } - - interface KnowDataTypeEntity { - /** - * ID - */ - id?: number; - /** - * 名称 - */ - name?: string; - /** - * 图标 - */ - icon?: string; - /** - * 描述 - */ - description?: string; - /** - * embedding配置ID - */ - embedConfigId?: number; - /** - * embedding配置 - */ - embedOptions?: json; - /** - * 是否开启rerank 0-否 1-是 - */ - enableRerank?: number; - /** - * rerank配置ID - */ - rerankConfigId?: number; - /** - * rerank配置 - */ - rerankOptions?: json; - /** - * 链接更新频率(天) - */ - updateFrequency?: number; - /** - * 状态 0-禁用 1-启用 - */ - enable?: number; - /** - * 创建时间 - */ - createTime?: Date; - /** - * 更新时间 - */ - updateTime?: Date; - /** - * 任意键值 - */ - [key: string]: any; - } - - interface UserAddressEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface UserInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - interface PluginInfoEntity { /** * ID @@ -943,6 +716,45 @@ declare namespace Eps { [key: string]: any; } + interface UserCouponEntity { + /** + * ID + */ + id?: number; + /** + * 标题 + */ + title?: string; + /** + * 折扣 + */ + discount?: number; + /** + * 有效期 + */ + validity?: Date; + /** + * 状态 0-无效 1-有效 + */ + status?: number; + /** + * 类型 0-普通 1-特殊 + */ + type?: number; + /** + * 创建时间 + */ + createTime?: Date; + /** + * 更新时间 + */ + updateTime?: Date; + /** + * 任意键值 + */ + [key: string]: any; + } + interface UserInfoEntity { /** * ID @@ -1001,83 +813,6 @@ declare namespace Eps { [key: string]: any; } - interface MsgLearnEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface OrderDrawEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface OrderInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface PluginInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface PluginReplyEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface RecycleDataEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface SpaceInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface SpaceTypeEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface TaskInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface UserInfoEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface ChatMessageEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - interface ChatSessionEntity { /** * 任意键值 @@ -1179,18 +914,6 @@ declare namespace Eps { * 实体信息与路径 */ eps(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: AiDataInfoEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ @@ -1200,8 +923,6 @@ declare namespace Eps { login: string; html: string; eps: string; - page: string; - add: string; }; /** * 权限状态 @@ -1212,8 +933,6 @@ declare namespace Eps { login: boolean; html: boolean; eps: boolean; - page: boolean; - add: boolean; }; /** * 请求 @@ -1242,30 +961,10 @@ declare namespace Eps { * 新增 */ add(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: BaseSysDepartmentEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ - permission: { - delete: string; - update: string; - order: string; - list: string; - add: string; - page: string; - add: string; - }; + permission: { delete: string; update: string; order: string; list: string; add: string }; /** * 权限状态 */ @@ -1275,8 +974,6 @@ declare namespace Eps { order: boolean; list: boolean; add: boolean; - page: boolean; - add: boolean; }; /** * 请求 @@ -1305,52 +1002,14 @@ declare namespace Eps { list: BaseSysLogEntity[]; [key: string]: any; }>; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: BaseSysLogEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ - permission: { - setKeep: string; - getKeep: string; - clear: string; - page: string; - info: string; - list: string; - page: string; - add: string; - }; + permission: { setKeep: string; getKeep: string; clear: string; page: string }; /** * 权限状态 */ - _permission: { - setKeep: boolean; - getKeep: boolean; - clear: boolean; - page: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; + _permission: { setKeep: boolean; getKeep: boolean; clear: boolean; page: boolean }; /** * 请求 */ @@ -1615,6 +1274,63 @@ declare namespace Eps { request: Service["request"]; } + interface DemoGoods { + /** + * 删除 + */ + delete(data?: any): Promise; + /** + * 修改 + */ + update(data?: any): Promise; + /** + * 单个信息 + */ + info(data?: any): Promise; + /** + * 列表查询 + */ + list(data?: any): Promise; + /** + * 分页查询 + */ + page(data?: any): Promise<{ + pagination: { size: number; page: number; total: number; [key: string]: any }; + list: DemoGoodsEntity[]; + [key: string]: any; + }>; + /** + * 新增 + */ + add(data?: any): Promise; + /** + * 权限标识 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; + /** + * 权限状态 + */ + _permission: { + delete: boolean; + update: boolean; + info: boolean; + list: boolean; + page: boolean; + add: boolean; + }; + /** + * 请求 + */ + request: Service["request"]; + } + interface DemoUserFollow { /** * page @@ -1780,22 +1496,6 @@ declare namespace Eps { * 新增 */ add(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: DictInfoEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ @@ -1807,9 +1507,6 @@ declare namespace Eps { list: string; page: string; add: string; - list: string; - page: string; - add: string; }; /** * 权限状态 @@ -1822,9 +1519,6 @@ declare namespace Eps { list: boolean; page: boolean; add: boolean; - list: boolean; - page: boolean; - add: boolean; }; /** * 请求 @@ -1861,10 +1555,6 @@ declare namespace Eps { * 新增 */ add(data?: any): Promise; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ @@ -1875,7 +1565,6 @@ declare namespace Eps { list: string; page: string; add: string; - add: string; }; /** * 权限状态 @@ -1887,7 +1576,6 @@ declare namespace Eps { list: boolean; page: boolean; add: boolean; - add: boolean; }; /** * 请求 @@ -1958,63 +1646,6 @@ declare namespace Eps { request: Service["request"]; } - interface PluginReply { - /** - * delete - */ - delete(data?: any): Promise; - /** - * update - */ - update(data?: any): Promise; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: PluginReplyEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - interface RecycleData { /** * 恢复数据 @@ -2032,44 +1663,14 @@ declare namespace Eps { list: RecycleDataEntity[]; [key: string]: any; }>; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: RecycleDataEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ - permission: { - restore: string; - info: string; - page: string; - list: string; - page: string; - add: string; - }; + permission: { restore: string; info: string; page: string }; /** * 权限状态 */ - _permission: { - restore: boolean; - info: boolean; - page: boolean; - list: boolean; - page: boolean; - add: boolean; - }; + _permission: { restore: boolean; info: boolean; page: boolean }; /** * 请求 */ @@ -2162,22 +1763,6 @@ declare namespace Eps { * 新增 */ add(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: SpaceTypeEntity[]; - [key: string]: any; - }>; - /** - * all - */ - all(data?: any): Promise; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ @@ -2188,9 +1773,6 @@ declare namespace Eps { list: string; page: string; add: string; - page: string; - all: string; - add: string; }; /** * 权限状态 @@ -2202,9 +1784,6 @@ declare namespace Eps { list: boolean; page: boolean; add: boolean; - page: boolean; - all: boolean; - add: boolean; }; /** * 请求 @@ -2316,10 +1895,6 @@ declare namespace Eps { * 新增 */ add(data?: any): Promise; - /** - * add - */ - add(data?: any): Promise; /** * 权限标识 */ @@ -2330,7 +1905,6 @@ declare namespace Eps { list: string; page: string; add: string; - add: string; }; /** * 权限状态 @@ -2342,7 +1916,6 @@ declare namespace Eps { list: boolean; page: boolean; add: boolean; - add: boolean; }; /** * 请求 @@ -2407,82 +1980,7 @@ declare namespace Eps { request: Service["request"]; } - interface FlowRun { - /** - * 调用流程 - */ - invoke(data?: any): Promise; - /** - * 调试 - */ - debug(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: RecycleDataEntity[]; - [key: string]: any; - }>; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: RecycleDataEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - invoke: string; - debug: string; - page: string; - info: string; - list: string; - page: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - invoke: boolean; - debug: boolean; - page: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface FlowConfig { - /** - * 通过名称获取配置 - */ - getByNode(data?: any): Promise; - /** - * 获取节点配置 - */ - config(data?: any): Promise; + interface UserCoupon { /** * 删除 */ @@ -2494,222 +1992,17 @@ declare namespace Eps { /** * 单个信息 */ - info(data?: any): Promise; + info(data?: any): Promise; /** * 列表查询 */ - list(data?: any): Promise; + list(data?: any): Promise; /** * 分页查询 */ page(data?: any): Promise<{ pagination: { size: number; page: number; total: number; [key: string]: any }; - list: FlowConfigEntity[]; - [key: string]: any; - }>; - /** - * 获取所有配置 - */ - all(data?: any): Promise; - /** - * 新增 - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - getByNode: string; - config: string; - delete: string; - update: string; - info: string; - list: string; - page: string; - all: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - getByNode: boolean; - config: boolean; - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - all: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface FlowInfo { - /** - * 发布流程 - */ - release(data?: any): Promise; - /** - * 删除 - */ - delete(data?: any): Promise; - /** - * 修改 - */ - update(data?: any): Promise; - /** - * 单个信息 - */ - info(data?: any): Promise; - /** - * 列表查询 - */ - list(data?: any): Promise; - /** - * 分页查询 - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: FlowInfoEntity[]; - [key: string]: any; - }>; - /** - * 新增 - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - release: string; - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - release: boolean; - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface KnowConfig { - /** - * 通过功能获取配置 - */ - getByFunc(data?: any): Promise; - /** - * 获取配置 - */ - config(data?: any): Promise; - /** - * 删除 - */ - delete(data?: any): Promise; - /** - * 修改 - */ - update(data?: any): Promise; - /** - * 单个信息 - */ - info(data?: any): Promise; - /** - * 列表查询 - */ - list(data?: any): Promise; - /** - * 分页查询 - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: KnowConfigEntity[]; - [key: string]: any; - }>; - /** - * 获取所有配置 - */ - all(data?: any): Promise; - /** - * 新增 - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - getByFunc: string; - config: string; - delete: string; - update: string; - info: string; - list: string; - page: string; - all: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - getByFunc: boolean; - config: boolean; - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - all: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface KnowDataInfo { - /** - * 删除 - */ - delete(data?: any): Promise; - /** - * 修改 - */ - update(data?: any): Promise; - /** - * 单个信息 - */ - info(data?: any): Promise; - /** - * 列表查询 - */ - list(data?: any): Promise; - /** - * 分页查询 - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: KnowDataInfoEntity[]; + list: UserCouponEntity[]; [key: string]: any; }>; /** @@ -2744,394 +2037,6 @@ declare namespace Eps { request: Service["request"]; } - interface KnowDataType { - /** - * 重建 - */ - rebuild(data?: any): Promise; - /** - * 删除 - */ - delete(data?: any): Promise; - /** - * 修改 - */ - update(data?: any): Promise; - /** - * 单个信息 - */ - info(data?: any): Promise; - /** - * 列表查询 - */ - list(data?: any): Promise; - /** - * 分页查询 - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: KnowDataTypeEntity[]; - [key: string]: any; - }>; - /** - * 新增 - */ - add(data?: any): Promise; - /** - * log - */ - log(data?: any): Promise; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - rebuild: string; - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - log: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - rebuild: boolean; - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - log: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface KnowLoader { - /** - * 加载文件,支持多个文件 - */ - file(data?: any): Promise; - /** - * 加载链接 - */ - link(data?: any): Promise; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: UserAddressEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: UserAddressEntity[]; - [key: string]: any; - }>; - /** - * all - */ - all(data?: any): Promise; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - file: string; - link: string; - info: string; - list: string; - page: string; - add: string; - page: string; - all: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - file: boolean; - link: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - page: boolean; - all: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface KnowRetriever { - /** - * 调用 - */ - invoke(data?: any): Promise; - /** - * update - */ - update(data?: any): Promise; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: UserInfoEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - invoke: string; - update: string; - info: string; - list: string; - page: string; - add: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - invoke: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface MsgLearn { - /** - * delete - */ - delete(data?: any): Promise; - /** - * update - */ - update(data?: any): Promise; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: MsgLearnEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface OrderDraw { - /** - * delete - */ - delete(data?: any): Promise; - /** - * update - */ - update(data?: any): Promise; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: OrderDrawEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - delete: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - - interface OrderInfo { - /** - * refund - */ - refund(data?: any): Promise; - /** - * update - */ - update(data?: any): Promise; - /** - * info - */ - info(data?: any): Promise; - /** - * list - */ - list(data?: any): Promise; - /** - * page - */ - page(data?: any): Promise<{ - pagination: { size: number; page: number; total: number; [key: string]: any }; - list: OrderInfoEntity[]; - [key: string]: any; - }>; - /** - * add - */ - add(data?: any): Promise; - /** - * 权限标识 - */ - permission: { - refund: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; - /** - * 权限状态 - */ - _permission: { - refund: boolean; - update: boolean; - info: boolean; - list: boolean; - page: boolean; - add: boolean; - }; - /** - * 请求 - */ - request: Service["request"]; - } - interface ChatMessage { /** * page @@ -3330,23 +2235,18 @@ declare namespace Eps { user: BaseSysUser; }; }; - demo: { user: { follow: DemoUserFollow; info: DemoUserInfo } }; + demo: { goods: DemoGoods; user: { follow: DemoUserFollow; info: DemoUserInfo } }; dict: { info: DictInfo; type: DictType }; - plugin: { info: PluginInfo; reply: PluginReply }; + plugin: { info: PluginInfo }; recycle: { data: RecycleData }; space: { info: SpaceInfo; type: SpaceType }; task: { info: TaskInfo }; - user: { address: UserAddress; info: UserInfo }; - flow: { run: FlowRun; config: FlowConfig; info: FlowInfo }; + user: { address: UserAddress; info: UserInfo; coupon: UserCoupon }; + flow: {}; help: {}; - know: { - config: KnowConfig; - data: { info: KnowDataInfo; type: KnowDataType }; - loader: KnowLoader; - retriever: KnowRetriever; - }; - msg: { learn: MsgLearn }; - order: { draw: OrderDraw; info: OrderInfo }; + know: { data: {} }; + msg: {}; + order: {}; chat: { message: ChatMessage; session: ChatSession }; test: Test; }; diff --git a/build/cool/eps.json b/build/cool/eps.json index 7d0b511..6aaf506 100644 --- a/build/cool/eps.json +++ b/build/cool/eps.json @@ -1 +1 @@ -[{"prefix":"/admin/base/comm","name":"AiAppEntity","api":[{"method":"post","path":"/personUpdate"},{"method":"get","path":"/uploadMode"},{"method":"get","path":"/permmenu"},{"method":"get","path":"/person"},{"method":"post","path":"/upload"},{"method":"post","path":"/logout"}]},{"prefix":"/admin/base/open","name":"AiDataInfoEntity","api":[{"method":"get","path":"/refreshToken"},{"method":"get","path":"/captcha"},{"method":"post","path":"/login"},{"method":"get","path":"/html"},{"method":"get","path":"/eps"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/department","name":"BaseSysDepartmentEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/order"},{"method":"post","path":"/list"},{"method":"post","path":"/add"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/log","name":"BaseSysLogEntity","api":[{"method":"post","path":"/setKeep"},{"method":"get","path":"/getKeep"},{"method":"post","path":"/clear"},{"method":"post","path":"/page"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/menu","name":"BaseSysMenuEntity","api":[{"method":"post","path":"/create"},{"method":"post","path":"/export"},{"method":"post","path":"/import"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/parse"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/param","name":"BaseSysParamEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/html"},{"method":"get","path":"/info"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/role","name":"BaseSysRoleEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/user","name":"BaseSysUserEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/move"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/dict/info","name":"DictInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/data"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/dict/type","name":"DictTypeEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"post","path":"/add"}]},{"prefix":"/admin/flow/config","name":"FlowConfigEntity","api":[{"method":"get","path":"/getByNode"},{"method":"post","path":"/config"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"get","path":"/all"},{"method":"post","path":"/add"}]},{"prefix":"/admin/flow/info","name":"FlowInfoEntity","api":[{"method":"post","path":"/release"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/flow/run","name":"RecycleDataEntity","api":[{"method":"post","path":"/invoke"},{"method":"post","path":"/debug"},{"method":"post","path":"/page"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/know/config","name":"KnowConfigEntity","api":[{"method":"get","path":"/getByFunc"},{"method":"post","path":"/config"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"get","path":"/all"},{"method":"post","path":"/add"}]},{"prefix":"/admin/know/data/info","name":"KnowDataInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/know/data/type","name":"KnowDataTypeEntity","api":[{"method":"post","path":"/rebuild"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"get","path":"/log"},{"method":"post","path":"/add"}]},{"prefix":"/admin/know/loader","name":"UserAddressEntity","api":[{"method":"post","path":"/file"},{"method":"post","path":"/link"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"post","path":"/page"},{"method":"get","path":"/all"},{"method":"post","path":"/add"}]},{"prefix":"/admin/know/retriever","name":"UserInfoEntity","api":[{"method":"post","path":"/invoke"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"post","path":"/add"}]},{"prefix":"/admin/plugin/info","name":"PluginInfoEntity","api":[{"method":"post","path":"/install"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/recycle/data","name":"RecycleDataEntity","api":[{"method":"post","path":"/restore"},{"method":"get","path":"/info"},{"method":"post","path":"/page"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/space/info","name":"SpaceInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/space/type","name":"SpaceTypeEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"post","path":"/page"},{"method":"get","path":"/all"},{"method":"post","path":"/add"}]},{"prefix":"/admin/task/info","name":"TaskInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/start"},{"method":"post","path":"/once"},{"method":"post","path":"/stop"},{"method":"get","path":"/info"},{"method":"post","path":"/page"},{"method":"get","path":"/log"},{"method":"post","path":"/add"}]},{"prefix":"/admin/user/address","name":"UserAddressEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"method":"post","path":"/add"}]},{"prefix":"/admin/user/info","name":"UserInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/know/retriever","name":"ChatMessageEntity","api":[{"method":"post","path":"/invoke"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/msg/learn","name":"MsgLearnEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/order/draw","name":"OrderDrawEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/order/info","name":"OrderInfoEntity","api":[{"method":"post","path":"/refund"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"path":"/add"}]},{"prefix":"/admin/plugin/info","name":"PluginInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/plugin/reply","name":"PluginReplyEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/recycle/data","name":"RecycleDataEntity","api":[{"method":"post","path":"/restore"},{"method":"get","path":"/info"},{"method":"post","path":"/page"}]},{"prefix":"/admin/space/info","name":"SpaceInfoEntity","api":[{"method":"get","path":"/getConfig"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/space/type","name":"SpaceTypeEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/task/info","name":"TaskInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/start"},{"method":"post","path":"/once"},{"method":"post","path":"/stop"},{"method":"get","path":"/info"},{"method":"post","path":"/page"},{"method":"get","path":"/log"},{"method":"post","path":"/add"}]},{"prefix":"/admin/user/info","name":"UserInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/chat/message","name":"ChatMessageEntity","api":[{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/chat/session","name":"ChatSessionEntity","api":[{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/test","name":"TestEntity","api":[{"path":"/page"},{"path":"/update"},{"path":"/add"},{"path":"/info"},{"path":"/delete"},{"path":"/list"}]},{"prefix":"/admin/demo/user/follow","name":"DemoUserFollowEntity","api":[{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/demo/user/info","name":"DemoUserInfoEntity","api":[{"path":"/t1"},{"path":"/t2"},{"path":"/t3"},{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]}] \ No newline at end of file +[{"prefix":"/admin/base/comm","name":"","api":[{"method":"post","path":"/personUpdate"},{"method":"get","path":"/uploadMode"},{"method":"get","path":"/permmenu"},{"method":"get","path":"/person"},{"method":"post","path":"/upload"},{"method":"post","path":"/logout"}]},{"prefix":"/admin/base/open","name":"","api":[{"method":"get","path":"/refreshToken"},{"method":"get","path":"/captcha"},{"method":"post","path":"/login"},{"method":"get","path":"/html"},{"method":"get","path":"/eps"}]},{"prefix":"/admin/base/sys/department","name":"BaseSysDepartmentEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/order"},{"method":"post","path":"/list"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/log","name":"BaseSysLogEntity","api":[{"method":"post","path":"/setKeep"},{"method":"get","path":"/getKeep"},{"method":"post","path":"/clear"},{"method":"post","path":"/page"}]},{"prefix":"/admin/base/sys/menu","name":"BaseSysMenuEntity","api":[{"method":"post","path":"/create"},{"method":"post","path":"/export"},{"method":"post","path":"/import"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/parse"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/param","name":"BaseSysParamEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/html"},{"method":"get","path":"/info"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/role","name":"BaseSysRoleEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/base/sys/user","name":"BaseSysUserEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/move"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/demo/goods","name":"DemoGoodsEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/dict/info","name":"DictInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/data"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/dict/type","name":"DictTypeEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/plugin/info","name":"PluginInfoEntity","api":[{"method":"post","path":"/install"},{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/recycle/data","name":"RecycleDataEntity","api":[{"method":"post","path":"/restore"},{"method":"get","path":"/info"},{"method":"post","path":"/page"}]},{"prefix":"/admin/space/info","name":"SpaceInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/space/type","name":"SpaceTypeEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/task/info","name":"TaskInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"post","path":"/start"},{"method":"post","path":"/once"},{"method":"post","path":"/stop"},{"method":"get","path":"/info"},{"method":"post","path":"/page"},{"method":"get","path":"/log"},{"method":"post","path":"/add"}]},{"prefix":"/admin/user/address","name":"UserAddressEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/user/coupon","name":"UserCouponEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/user/info","name":"UserInfoEntity","api":[{"method":"post","path":"/delete"},{"method":"post","path":"/update"},{"method":"get","path":"/info"},{"method":"post","path":"/list"},{"method":"post","path":"/page"},{"method":"post","path":"/add"}]},{"prefix":"/admin/chat/message","name":"ChatMessageEntity","api":[{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/chat/session","name":"ChatSessionEntity","api":[{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/test","name":"TestEntity","api":[{"path":"/page"},{"path":"/update"},{"path":"/add"},{"path":"/info"},{"path":"/delete"},{"path":"/list"}]},{"prefix":"/admin/demo/user/follow","name":"DemoUserFollowEntity","api":[{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]},{"prefix":"/admin/demo/user/info","name":"DemoUserInfoEntity","api":[{"path":"/t1"},{"path":"/t2"},{"path":"/t3"},{"path":"/page"},{"path":"/list"},{"path":"/info"},{"path":"/delete"},{"path":"/update"},{"path":"/add"}]}] \ No newline at end of file diff --git a/src/config/proxy.ts b/src/config/proxy.ts index 56d2127..49746b8 100644 --- a/src/config/proxy.ts +++ b/src/config/proxy.ts @@ -1,7 +1,7 @@ export const proxy = { "/dev/": { - target: "http://127.0.0.1:8001", - // target: "http://192.168.0.112:8001", + // target: "http://127.0.0.1:8001", + target: "http://192.168.0.119:8001", // target: "https://dev-admin.cool-js.cloud", changeOrigin: true, rewrite: (path: string) => path.replace(/^\/dev/, "") diff --git a/src/modules/helper/components/auto-menu/quick.vue b/src/modules/helper/components/auto-menu/quick.vue index 3e93f51..d0a1169 100644 --- a/src/modules/helper/components/auto-menu/quick.vue +++ b/src/modules/helper/components/auto-menu/quick.vue @@ -21,7 +21,7 @@ import { useForm } from "@cool-vue/crud"; import { deepPaths } from "/@/cool/utils"; import { computed, onMounted } from "vue"; import { useMenu, useAi } from "../../hooks"; -import type { EpsData } from "../../types"; +import type { EpsColumn, EpsData } from "../../types"; const { service, mitt } = useCool(); const menu = useMenu(); @@ -193,7 +193,15 @@ function open() { // 是否需要ai分析 if (data.isAi) { - await ai.matchType({ columns, name: data.name }); + await ai + .invokeFlow("comm-parse-column", { + entity: JSON.stringify(columns) + }) + .then((res) => { + columns.forEach((e: EpsColumn) => { + e.component = res.columns[e.propertyName] || "input"; + }); + }); } menu.create({ diff --git a/src/modules/helper/hooks/ai.ts b/src/modules/helper/hooks/ai.ts index 7fb38d8..c83831e 100644 --- a/src/modules/helper/hooks/ai.ts +++ b/src/modules/helper/hooks/ai.ts @@ -1,5 +1,3 @@ -import { request } from "../utils"; -import type { EpsColumn } from "../types"; import { module } from "/@/cool"; import { useBase } from "/$/base"; @@ -98,42 +96,7 @@ export function useAi() { }); } - // 匹配组件类型 - async function matchType({ columns, name }: { columns: EpsColumn[]; name: string }) { - return new Promise((resolve, reject) => { - const fields = columns.filter((e) => { - return !["id", "crateTime", "updateTime"].includes(e.propertyName); - }); - - request({ - url: "/open/code/eps/matchType", - method: "POST", - data: { - fields: fields.map((e) => { - return { - type: e.type, - field: e.propertyName, - description: e.comment - }; - }), - func: name - } - }) - .then((res) => { - const names = res.split(","); - - fields.forEach((e, i) => { - e.component = names[i]; - }); - - resolve(fields); - }) - .catch(reject); - }); - } - return { - matchType, invokeFlow }; } diff --git a/src/modules/helper/views/ai-code.vue b/src/modules/helper/views/ai-code.vue index c682d36..6a5809b 100644 --- a/src/modules/helper/views/ai-code.vue +++ b/src/modules/helper/views/ai-code.vue @@ -323,7 +323,7 @@ const form = reactive({ // 执行步骤 const step = reactive({ loading: false, - value: "coding", + value: "start", list: ["start", "enter", "form", "coding"], async next() { @@ -505,6 +505,8 @@ const code = reactive({ code.data.prefix = entityData.path; code.data.fileName = entityData.fileName; + code.parseColumn(); + code.tips("Service 代码生成中"); // service 代码 @@ -544,7 +546,7 @@ const code = reactive({ code.data.fieldEq = controllerData.fieldEq; code.data.keyWordLikeFields = controllerData.keyWordLikeFields; - await code.createVue(); + await code.createVue(false); code.tips("编码完成"); @@ -563,8 +565,48 @@ const code = reactive({ } }, + // 解析字段 + async parseColumn() { + const a = ai.invokeFlow("comm-parse-entity-column", { + entity: code.getContent("node-entity") + }); + + const b = ai.invokeFlow("comm-parse-column", { + entity: code.getContent("node-entity") + }); + + await Promise.all([a, b]).then((res) => { + if (res[0]?.columns) { + code.data.columns = res[0].columns.map((e: EpsColumn) => { + if (res[1]?.columns) { + e.component = res[1].columns[e.propertyName] || "input"; + } + return e; + }); + + code.data.columns.push({ + comment: "更新时间", + length: 0, + component: "datetime", + nullable: false, + propertyName: "updateTime", + type: "datetime" + }); + + code.data.columns.push({ + comment: "创建时间", + length: 0, + component: "datetime", + nullable: false, + propertyName: "createTime", + type: "datetime" + }); + } + }); + }, + // 创建vue - async createVue() { + async createVue(isParse: boolean = true) { const item = code.add("Vue 页面", "vue"); item.content = ""; @@ -573,25 +615,10 @@ const code = reactive({ code.tips("Vue 代码开始生成"); - code.tips("AI 分析中"); - - await ai - .invokeFlow("comm-parse-entity-column", { - entity: code.getContent("node-entity") - }) - .then((res) => { - code.data.columns = res.columns || []; - }); - - await ai - .invokeFlow("comm-parse-column", { - entity: code.getContent("node-entity") - }) - .then((res) => { - code.data.columns.forEach((e) => { - e.component = res[e.propertyName]; - }); - }); + if (isParse) { + code.tips("AI 分析中"); + await code.parseColumn(); + } // 生成内容 item.content = menu.createVue({ @@ -692,7 +719,11 @@ const code = reactive({ copy() { copy(code.getContent(code.active)!); ElMessage.success("复制成功"); - code.save(); + + // 存本地,方便调试 + storage.set("ai-code.list", code.list); + storage.set("ai-code.data", code.data); + storage.set("ai-code.form", form); }, // 重新生成 @@ -700,14 +731,6 @@ const code = reactive({ code.loading = true; await code.createVue(); code.loading = false; - }, - - // 保存 - save() { - console.log(code); - storage.set("ai-code.list", code.list); - storage.set("ai-code.data", code.data); - storage.set("ai-code.form", form); } }); @@ -932,6 +955,7 @@ function toBack() { onMounted(() => { desc.init(); + // 测试 if (step.value == "coding") { code.list = storage.get("ai-code.list") || []; diff --git a/src/plugins/editor-monaco/utils/format.ts b/src/plugins/editor-monaco/utils/format.ts index a82cd1e..352c8fa 100644 --- a/src/plugins/editor-monaco/utils/format.ts +++ b/src/plugins/editor-monaco/utils/format.ts @@ -31,14 +31,16 @@ export function useFormat() { async provideDocumentFormattingEdits(model) { let text = model.getValue(); + const parser = options[i].parser; + try { text = await prettier.format(text, { - parser: options[i].parser, + parser, plugins: options[i].plugins, semi: true, printWidth: 100, - tabWidth: 4, - useTabs: true, + tabWidth: parser == "html" ? 4 : 2, + useTabs: parser == "html", singleQuote: true, trailingComma: "none" });