diff --git a/build/cool/temp/eps.json b/build/cool/temp/eps.json index e6c9392..132537f 100644 --- a/build/cool/temp/eps.json +++ b/build/cool/temp/eps.json @@ -1 +1 @@ -[["/admin/base/comm",[["post","/personUpdate",""],["get","/uploadMode",""],["get","/permmenu",""],["get","/person",""],["post","/upload",""],["post","/logout",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/open",[["get","/refreshToken",""],["get","/captcha",""],["post","/login",""],["get","/html",""],["get","/eps",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/department",[["post","/delete",""],["post","/update",""],["post","/order",""],["post","/list",""],["post","/add",""],["","/page",""],["","/info",""]]],["/admin/base/sys/log",[["post","/setKeep",""],["get","/getKeep",""],["post","/clear",""],["post","/page",""],["","/list",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/menu",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/param",[["post","/delete",""],["post","/update",""],["get","/html",""],["get","/info",""],["post","/page",""],["post","/add",""],["","/list",""]]],["/admin/base/sys/role",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/user",[["post","/delete",""],["post","/update",""],["post","/move",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/demo/goods",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/page",""],["post","/list",""],["post","/add",""]]],["/admin/space/info",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/space/type",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/task/info",[["post","/delete",""],["post","/update",""],["post","/start",""],["post","/once",""],["post","/stop",""],["get","/info",""],["post","/page",""],["get","/log",""],["post","/add",""],["","/list",""]]],["/test",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]]] \ No newline at end of file +[["/admin/base/comm",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/personUpdate",""],["","/uploadMode",""],["","/permmenu",""],["","/logout",""]]],["/admin/base/open",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/refreshToken",""],["","/captcha",""],["","/login",""],["","/html",""],["","/eps",""]]],["/admin/base/sys/department",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/order",""]]],["/admin/base/sys/log",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/setKeep",""],["","/getKeep",""],["","/clear",""]]],["/admin/base/sys/menu",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/param",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/html",""]]],["/admin/base/sys/role",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/user",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/move",""]]],["/admin/demo/goods",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/fbMall/account",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/publishGoods",""],["","/refreshGoods",""],["","/republish",""],["","/addMore",""],["","/close",""],["","/open",""],["","/getAccountGoods",""]]],["/admin/fbMall/area",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/fbMall/areaItem",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/order",""]]],["/admin/fbMall/goods",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/fbMall/goodsItem",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/readAll",""]]],["/admin/fbMall/photo",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/fbMall/photoItem",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/order",""]]],["/admin/fbMall/promote",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/getLog",""]]],["/admin/fbMall/proxy",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/fbMall/server",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/fbMall/thesaurus",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/order",""]]],["/admin/fbMall/thesaurusItem",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/readAll",""]]],["/admin/multimedia/multimediaData",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/deleteAllPermission",""]]],["/admin/multimedia/multimediaItem",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/updateeAllPermission",""],["","/deleteAllPermission",""],["","/order",""]]],["/admin/shop/reply",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/space/info",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/space/type",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/area",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/channel",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/country",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/express",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/goods",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/goodsItem",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/order",""]]],["/admin/sys/label",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/shop",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/readAll",""]]],["/admin/sys/shop_warehouse",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/sys/sku",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/synchronize",""]]],["/admin/sys/stock",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/synchronize",""]]],["/admin/sys/warehouse",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/task/info",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""],["","/start",""],["","/once",""],["","/stop",""],["","/log",""]]],["/chat/message",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/chat/session",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/test",[["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]]] \ No newline at end of file diff --git a/build/cool/temp/service.d.ts b/build/cool/temp/service.d.ts index 3733eff..56f3a86 100644 --- a/build/cool/temp/service.d.ts +++ b/build/cool/temp/service.d.ts @@ -50,36 +50,6 @@ declare interface RequestOptions { } declare interface BaseComm { - /** - * 修改个人信息 - * @returns Promise - */ - personUpdate(data?: any): Promise; - /** - * 文件上传模式 - * @returns Promise - */ - uploadMode(data?: any): Promise; - /** - * 权限与菜单 - * @returns Promise - */ - permmenu(data?: any): Promise; - /** - * 个人信息 - * @returns Promise - */ - person(data?: any): Promise; - /** - * 文件上传 - * @returns Promise - */ - upload(data?: any): Promise; - /** - * 退出 - * @returns Promise - */ - logout(data?: any): Promise; /** * list * @returns Promise @@ -110,51 +80,44 @@ declare interface BaseComm { * @returns Promise */ add(data?: any): Promise; + /** + * personUpdate + * @returns Promise + */ + personUpdate(data?: any): Promise; + /** + * uploadMode + * @returns Promise + */ + uploadMode(data?: any): Promise; + /** + * permmenu + * @returns Promise + */ + permmenu(data?: any): Promise; + /** + * logout + * @returns Promise + */ + logout(data?: any): Promise; /** * 权限 */ permission: { - personUpdate: string; - uploadMode: string; - permmenu: string; - person: string; - upload: string; - logout: string; list: string; page: string; info: string; update: string; delete: string; add: string; + personUpdate: string; + uploadMode: string; + permmenu: string; + logout: string; }; } declare interface BaseOpen { - /** - * 刷新token - * @returns Promise - */ - refreshToken(data?: any): Promise; - /** - * 验证码 - * @returns Promise - */ - captcha(data?: any): Promise; - /** - * 登录 - * @returns Promise - */ - login(data?: any): Promise; - /** - * 获得网页内容的参数值 - * @returns Promise - */ - html(data?: any): Promise; - /** - * 实体信息与路径 - * @returns Promise - */ - eps(data?: any): Promise; /** * list * @returns Promise @@ -185,50 +148,55 @@ declare interface BaseOpen { * @returns Promise */ add(data?: any): Promise; + /** + * refreshToken + * @returns Promise + */ + refreshToken(data?: any): Promise; + /** + * captcha + * @returns Promise + */ + captcha(data?: any): Promise; + /** + * login + * @returns Promise + */ + login(data?: any): Promise; + /** + * html + * @returns Promise + */ + html(data?: any): Promise; + /** + * eps + * @returns Promise + */ + eps(data?: any): Promise; /** * 权限 */ permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; refreshToken: string; captcha: string; login: string; html: string; eps: string; - list: string; - page: string; - info: string; - update: string; - delete: string; - add: string; }; } declare interface BaseSysDepartment { /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 排序 - * @returns Promise - */ - order(data?: any): Promise; - /** - * 列表查询 + * list * @returns Promise */ list(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; /** * page * @returns Promise @@ -239,46 +207,113 @@ declare interface BaseSysDepartment { * @returns Promise */ info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * order + * @returns Promise + */ + order(data?: any): Promise; /** * 权限 */ permission: { - delete: string; - update: string; - order: string; list: string; - add: string; page: string; info: string; + update: string; + delete: string; + add: string; + order: string; }; } declare interface BaseSysLog { /** - * 日志保存时间 + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * setKeep * @returns Promise */ setKeep(data?: any): Promise; /** - * 获得日志保存时间 + * getKeep * @returns Promise */ getKeep(data?: any): Promise; /** - * 清理 + * clear * @returns Promise */ clear(data?: any): Promise; /** - * 分页查询 - * @returns Promise + * 权限 */ - page(data?: any): Promise; + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + setKeep: string; + getKeep: string; + clear: string; + }; +} + +declare interface BaseSysMenu { /** * list * @returns Promise */ list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; /** * info * @returns Promise @@ -303,11 +338,8 @@ declare interface BaseSysLog { * 权限 */ permission: { - setKeep: string; - getKeep: string; - clear: string; - page: string; list: string; + page: string; info: string; update: string; delete: string; @@ -315,128 +347,84 @@ declare interface BaseSysLog { }; } -declare interface BaseSysMenu { - /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 列表查询 - * @returns Promise - */ - list(data?: any): Promise; - /** - * 分页查询 - * @returns Promise - */ - page(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; - /** - * 权限 - */ - permission: { - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; -} - declare interface BaseSysParam { /** - * 删除 + * list * @returns Promise */ - delete(data?: any): Promise; + list(data?: any): Promise; /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 获得网页内容的参数值 - * @returns Promise - */ - html(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 分页查询 + * page * @returns Promise */ page(data?: any): Promise; /** - * 新增 + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add * @returns Promise */ add(data?: any): Promise; + /** + * html + * @returns Promise + */ + html(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + html: string; + }; +} + +declare interface BaseSysRole { /** * list * @returns Promise */ list(data?: any): Promise; /** - * 权限 - */ - permission: { - delete: string; - update: string; - html: string; - info: string; - page: string; - add: string; - list: string; - }; -} - -declare interface BaseSysRole { - /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 列表查询 - * @returns Promise - */ - list(data?: any): Promise; - /** - * 分页查询 + * page * @returns Promise */ page(data?: any): Promise; /** - * 新增 + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add * @returns Promise */ add(data?: any): Promise; @@ -444,262 +432,1664 @@ declare interface BaseSysRole { * 权限 */ permission: { - delete: string; - update: string; - info: string; list: string; page: string; + info: string; + update: string; + delete: string; add: string; }; } declare interface BaseSysUser { /** - * 删除 + * list * @returns Promise */ - delete(data?: any): Promise; + list(data?: any): Promise; /** - * 修改 + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update * @returns Promise */ update(data?: any): Promise; /** - * 移动部门 + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * move * @returns Promise */ move(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 列表查询 - * @returns Promise - */ - list(data?: any): Promise; - /** - * 分页查询 - * @returns Promise - */ - page(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; /** * 权限 */ permission: { - delete: string; - update: string; - move: string; - info: string; list: string; page: string; + info: string; + update: string; + delete: string; add: string; + move: string; }; } declare interface DemoGoods { - /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 分页查询 - * @returns Promise - */ - page(data?: any): Promise; - /** - * 列表查询 - * @returns Promise - */ - list(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; - /** - * 权限 - */ - permission: { - delete: string; - update: string; - info: string; - page: string; - list: string; - add: string; - }; -} - -declare interface SpaceInfo { - /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 列表查询 - * @returns Promise - */ - list(data?: any): Promise; - /** - * 分页查询 - * @returns Promise - */ - page(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; - /** - * 权限 - */ - permission: { - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; -} - -declare interface SpaceType { - /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 列表查询 - * @returns Promise - */ - list(data?: any): Promise; - /** - * 分页查询 - * @returns Promise - */ - page(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; - /** - * 权限 - */ - permission: { - delete: string; - update: string; - info: string; - list: string; - page: string; - add: string; - }; -} - -declare interface TaskInfo { - /** - * 删除 - * @returns Promise - */ - delete(data?: any): Promise; - /** - * 修改 - * @returns Promise - */ - update(data?: any): Promise; - /** - * 开始 - * @returns Promise - */ - start(data?: any): Promise; - /** - * 执行一次 - * @returns Promise - */ - once(data?: any): Promise; - /** - * 停止 - * @returns Promise - */ - stop(data?: any): Promise; - /** - * 单个信息 - * @returns Promise - */ - info(data?: any): Promise; - /** - * 分页查询 - * @returns Promise - */ - page(data?: any): Promise; - /** - * 日志 - * @returns Promise - */ - log(data?: any): Promise; - /** - * 新增 - * @returns Promise - */ - add(data?: any): Promise; /** * list * @returns Promise */ list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; /** * 权限 */ permission: { - delete: string; + list: string; + page: string; + info: string; update: string; + delete: string; + add: string; + }; +} + +declare interface FbMallAccount { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * publishGoods + * @returns Promise + */ + publishGoods(data?: any): Promise; + /** + * refreshGoods + * @returns Promise + */ + refreshGoods(data?: any): Promise; + /** + * republish + * @returns Promise + */ + republish(data?: any): Promise; + /** + * addMore + * @returns Promise + */ + addMore(data?: any): Promise; + /** + * close + * @returns Promise + */ + close(data?: any): Promise; + /** + * open + * @returns Promise + */ + open(data?: any): Promise; + /** + * getAccountGoods + * @returns Promise + */ + getAccountGoods(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + publishGoods: string; + refreshGoods: string; + republish: string; + addMore: string; + close: string; + open: string; + getAccountGoods: string; + }; +} + +declare interface FbMallArea { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface FbMallAreaItem { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * order + * @returns Promise + */ + order(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + order: string; + }; +} + +declare interface FbMallGoods { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface FbMallGoodsItem { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * readAll + * @returns Promise + */ + readAll(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + readAll: string; + }; +} + +declare interface FbMallPhoto { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface FbMallPhotoItem { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * order + * @returns Promise + */ + order(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + order: string; + }; +} + +declare interface FbMallPromote { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * getLog + * @returns Promise + */ + getLog(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + getLog: string; + }; +} + +declare interface FbMallProxy { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface FbMallServer { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface FbMallThesaurus { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * order + * @returns Promise + */ + order(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + order: string; + }; +} + +declare interface FbMallThesaurusItem { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * readAll + * @returns Promise + */ + readAll(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + readAll: string; + }; +} + +declare interface MultimediaMultimediaData { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * deleteAllPermission + * @returns Promise + */ + deleteAllPermission(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + deleteAllPermission: string; + }; +} + +declare interface MultimediaMultimediaItem { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * updateeAllPermission + * @returns Promise + */ + updateeAllPermission(data?: any): Promise; + /** + * deleteAllPermission + * @returns Promise + */ + deleteAllPermission(data?: any): Promise; + /** + * order + * @returns Promise + */ + order(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + updateeAllPermission: string; + deleteAllPermission: string; + order: string; + }; +} + +declare interface ShopReply { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SpaceInfo { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SpaceType { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysArea { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysChannel { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysCountry { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysExpress { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysGoods { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysGoodsItem { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * order + * @returns Promise + */ + order(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + order: string; + }; +} + +declare interface SysLabel { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysShop { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * readAll + * @returns Promise + */ + readAll(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + readAll: string; + }; +} + +declare interface SysShop_warehouse { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface SysSku { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * synchronize + * @returns Promise + */ + synchronize(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + synchronize: string; + }; +} + +declare interface SysStock { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * synchronize + * @returns Promise + */ + synchronize(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + synchronize: string; + }; +} + +declare interface SysWarehouse { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface TaskInfo { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * start + * @returns Promise + */ + start(data?: any): Promise; + /** + * once + * @returns Promise + */ + once(data?: any): Promise; + /** + * stop + * @returns Promise + */ + stop(data?: any): Promise; + /** + * log + * @returns Promise + */ + log(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; start: string; once: string; stop: string; - info: string; - page: string; log: string; - add: string; + }; +} + +declare interface ChatMessage { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface ChatSession { + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * page + * @returns Promise + */ + page(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + list: string; + page: string; + info: string; + update: string; + delete: string; + add: string; }; } @@ -762,7 +2152,41 @@ declare type Service = { }; }; demo: { goods: DemoGoods }; + fbMall: { + account: FbMallAccount; + area: FbMallArea; + areaItem: FbMallAreaItem; + goods: FbMallGoods; + goodsItem: FbMallGoodsItem; + photo: FbMallPhoto; + photoItem: FbMallPhotoItem; + promote: FbMallPromote; + proxy: FbMallProxy; + server: FbMallServer; + thesaurus: FbMallThesaurus; + thesaurusItem: FbMallThesaurusItem; + }; + multimedia: { + multimediaData: MultimediaMultimediaData; + multimediaItem: MultimediaMultimediaItem; + }; + shop: { reply: ShopReply }; space: { info: SpaceInfo; type: SpaceType }; + sys: { + area: SysArea; + channel: SysChannel; + country: SysCountry; + express: SysExpress; + goods: SysGoods; + goodsItem: SysGoodsItem; + label: SysLabel; + shop: SysShop; + shop_warehouse: SysShop_warehouse; + sku: SysSku; + stock: SysStock; + warehouse: SysWarehouse; + }; task: { info: TaskInfo }; + chat: { message: ChatMessage; session: ChatSession }; test: Test; }; diff --git a/package.json b/package.json index bdc6feb..d2c60e7 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,14 @@ "lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix" }, "dependencies": { - "@cool-vue/crud": "^5.0.10", + "@cool-vue/crud": "^5.0.13", "@element-plus/icons-vue": "^1.1.3", "@vueuse/core": "^8.2.5", "axios": "^0.27.2", "codemirror": "^5.62.0", "core-js": "^3.6.5", "echarts": "^5.0.2", - "element-plus": "^2.2.0", + "element-plus": "^2.2.5", "file-saver": "^2.0.5", "js-beautify": "^1.13.5", "lodash": "^4.17.21", @@ -25,6 +25,7 @@ "nprogress": "^0.2.0", "pinia": "^2.0.12", "quill": "^1.3.7", + "socket.io-client": "^4.5.1", "store": "^2.0.12", "unocss": "^0.31.0", "vue": "^3.2.32", diff --git a/src/cool/index.ts b/src/cool/index.ts index d415dad..ec53e1c 100644 --- a/src/cool/index.ts +++ b/src/cool/index.ts @@ -3,4 +3,4 @@ export * from "./bootstrap"; export * from "./hook"; export * from "./router"; export * from "./config"; -export { storage } from "./utils"; +export { storage, module } from "./utils"; diff --git a/src/cool/service/eps.ts b/src/cool/service/eps.ts index 0816282..f43d93e 100644 --- a/src/cool/service/eps.ts +++ b/src/cool/service/eps.ts @@ -86,6 +86,7 @@ export function useEps(service: Service) { }) .catch((err) => { console.error("[Eps] 获取失败!", err.message); + createDts([]); }); } } diff --git a/src/modules/base/pages/layout/components/topbar.vue b/src/modules/base/pages/layout/components/topbar.vue index 3941c83..2e41854 100644 --- a/src/modules/base/pages/layout/components/topbar.vue +++ b/src/modules/base/pages/layout/components/topbar.vue @@ -19,6 +19,10 @@
    +
  • + +
  • +
  • @@ -115,6 +119,7 @@ function onCommand(name: string) { width: 45px; border-radius: 3px; cursor: pointer; + margin-left: 10px; &:hover { background-color: rgba(0, 0, 0, 0.1); diff --git a/src/modules/chat/components/index.vue b/src/modules/chat/components/index.vue new file mode 100644 index 0000000..6083314 --- /dev/null +++ b/src/modules/chat/components/index.vue @@ -0,0 +1,265 @@ + + + + + + + diff --git a/src/modules/chat/components/message.vue b/src/modules/chat/components/message.vue new file mode 100644 index 0000000..75a6534 --- /dev/null +++ b/src/modules/chat/components/message.vue @@ -0,0 +1,342 @@ + + + + + diff --git a/src/modules/chat/components/session.vue b/src/modules/chat/components/session.vue new file mode 100644 index 0000000..dde9cdb --- /dev/null +++ b/src/modules/chat/components/session.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/modules/chat/config.ts b/src/modules/chat/config.ts new file mode 100644 index 0000000..3a1ec93 --- /dev/null +++ b/src/modules/chat/config.ts @@ -0,0 +1,4 @@ +export default { + // socket.io 连接地址 + path: "/chat" +}; diff --git a/src/modules/chat/hooks/index.ts b/src/modules/chat/hooks/index.ts new file mode 100644 index 0000000..c2c3012 --- /dev/null +++ b/src/modules/chat/hooks/index.ts @@ -0,0 +1,10 @@ +import { inject } from "vue"; +import { Chat } from "../types"; + +export function useChat() { + const chat = inject("chat"); + + return { + chat + }; +} diff --git a/src/modules/chat/service/message.ts b/src/modules/chat/service/message.ts new file mode 100644 index 0000000..ec1bd8b --- /dev/null +++ b/src/modules/chat/service/message.ts @@ -0,0 +1,56 @@ +import { BaseService, Service } from "/@/cool"; +import Mock from "mockjs"; + +@Service("chat/message") +class ChatMessage extends BaseService { + page() { + return new Promise((resolve) => { + const data = Mock.mock({ + "list|20": [ + { + id: "@id", + nickName: "@name", + createTime: "@datetime(HH:mm:ss)", + text: "@cparagraph(5)", + "contentType|0-1": 0, + "userId|1-2": 1, + avatar() { + return Mock.Random.image( + "40x40", + Mock.Random.color(), + "#FFF", + "png", + this.nickName[0] + ); + }, + content() { + return JSON.stringify({ + text: this.text, + imageUrl: Mock.Random.image( + "100x100", + Mock.Random.color(), + "#FFF", + "png", + this.nickName + ) + }); + } + } + ] + }); + + setTimeout(() => { + resolve({ + list: data.list, + pagination: { + total: 20, + page: 1, + size: 20 + } + }); + }, 1000); + }); + } +} + +export default ChatMessage; diff --git a/src/modules/chat/service/session.ts b/src/modules/chat/service/session.ts new file mode 100644 index 0000000..e35f81e --- /dev/null +++ b/src/modules/chat/service/session.ts @@ -0,0 +1,43 @@ +import { BaseService, Service } from "/@/cool"; +import Mock from "mockjs"; + +@Service("chat/session") +class ChatSession extends BaseService { + page() { + return new Promise((resolve) => { + const data = Mock.mock({ + "list|20": [ + { + id: "@id", + nickName: "@name", + createTime: "@datetime(HH:mm:ss)", + text: "@cparagraph(5)", + "num|0-99": 0, + avatar() { + return Mock.Random.image( + "40x40", + Mock.Random.color(), + "#FFF", + "png", + this.nickName[0] + ); + } + } + ] + }); + + setTimeout(() => { + resolve({ + list: data.list, + pagination: { + total: 20, + page: 1, + size: 20 + } + }); + }, 1000); + }); + } +} + +export default ChatSession; diff --git a/src/modules/chat/store/index.ts b/src/modules/chat/store/index.ts new file mode 100644 index 0000000..54f6d96 --- /dev/null +++ b/src/modules/chat/store/index.ts @@ -0,0 +1,12 @@ +import { useMessageStore } from "./message"; +import { useSessionStore } from "./session"; + +export function useStore() { + const session = useSessionStore(); + const message = useMessageStore(); + + return { + session, + message + }; +} diff --git a/src/modules/chat/store/message.ts b/src/modules/chat/store/message.ts new file mode 100644 index 0000000..173c03a --- /dev/null +++ b/src/modules/chat/store/message.ts @@ -0,0 +1,48 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import { useCool } from "/@/cool"; + +export const useMessageStore = defineStore("chat-message", () => { + const { service } = useCool(); + + // 加载状态 + const loading = ref(false); + + // 列表 + const list = ref([]); + + // 分页 + const pagination = ref({ + page: 1, + total: 0, + size: 20 + }); + + // 获取列表 + async function get(params?: any) { + loading.value = true; + + // 清空 + if (params?.page == 1) { + list.value = []; + } + + // 发送请求 + await service.chat.message.page(params).then((res) => { + list.value = res.list.map((e) => { + e.content = JSON.parse(e.content); + return e; + }); + pagination.value = res.pagination; + }); + + loading.value = false; + } + + return { + loading, + list, + pagination, + get + }; +}); diff --git a/src/modules/chat/store/session.ts b/src/modules/chat/store/session.ts new file mode 100644 index 0000000..b616039 --- /dev/null +++ b/src/modules/chat/store/session.ts @@ -0,0 +1,48 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import { useCool } from "/@/cool"; + +export const useSessionStore = defineStore("chat-session", () => { + const { service } = useCool(); + + // 加载状态 + const loading = ref(false); + + // 列表 + const list = ref([]); + + // 选中 + const value = ref(); + + // 获取列表 + async function get(params?: any) { + loading.value = true; + + // 发送请求 + await service.chat.session.page(params).then((res) => { + // 默认加载第一个会话的消息 + if (!value.value) { + set(res.list[0]); + } + + // 设置列表 + list.value = res.list; + }); + + loading.value = false; + } + + // 设置值 + function set(data: any) { + // 设置值 + value.value = data; + } + + return { + loading, + list, + value, + get, + set + }; +}); diff --git a/src/modules/chat/types/index.d.ts b/src/modules/chat/types/index.d.ts new file mode 100644 index 0000000..f9d4479 --- /dev/null +++ b/src/modules/chat/types/index.d.ts @@ -0,0 +1,35 @@ +import { Socket } from "socket.io-client"; + +export namespace Chat { + enum ContentType { + "text" = 0, + "image" = 1, + "video" = 2 + } + + interface Message { + fromId?: string; + toId?: string; + content: { + text?: string; + imageUrl?: string; + [key: string]: any; + }; + contentType: ContentType; + [key: string]: any; + } + + interface Session { + id: string; + avatar: string; + nickName: string; + [key: string]: any; + } + + interface Provide { + socket?: Socket; + send(data: Message, isAppend?: boolean): void; + append(data: Message): void; + scrollToBottom(): void; + } +} diff --git a/src/modules/upload/components/index.vue b/src/modules/upload/components/index.vue index 395cda4..1846089 100644 --- a/src/modules/upload/components/index.vue +++ b/src/modules/upload/components/index.vue @@ -1,6 +1,14 @@