diff --git a/build/cool/temp/eps.d.ts b/build/cool/temp/eps.d.ts index c94898e..1e3f75e 100644 --- a/build/cool/temp/eps.d.ts +++ b/build/cool/temp/eps.d.ts @@ -1,25 +1,4 @@ declare namespace Eps { - interface AiLimitEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface AiOrderEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - - interface AiVipEntity { - /** - * 任意键值 - */ - [key: string]: any; - } - interface BaseSysDepartmentEntity { /** * 任意键值 @@ -90,6 +69,13 @@ declare namespace Eps { [key: string]: any; } + interface DemoUserEntity { + /** + * 任意键值 + */ + [key: string]: any; + } + interface DictInfoEntity { /** * 任意键值 @@ -146,6 +132,13 @@ declare namespace Eps { [key: string]: any; } + interface UserAddressEntity { + /** + * 任意键值 + */ + [key: string]: any; + } + interface UserInfoEntity { /** * 任意键值 @@ -323,177 +316,6 @@ declare namespace Eps { request: Service["request"]; } - interface AiLimit { - /** - * 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 }; - list: AiLimitEntity[]; - [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 AiOrder { - /** - * 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 }; - list: AiOrderEntity[]; - [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 AiVip { - /** - * 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 }; - list: AiVipEntity[]; - [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 BaseComm { /** * personUpdate @@ -1310,6 +1132,63 @@ declare namespace Eps { request: Service["request"]; } + interface DemoUser { + /** + * 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 }; + list: DemoUserEntity[]; + [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 DictInfo { /** * delete @@ -1877,6 +1756,63 @@ declare namespace Eps { request: Service["request"]; } + interface UserAddress { + /** + * 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 }; + list: UserAddressEntity[]; + [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 UserInfo { /** * delete @@ -1945,7 +1881,6 @@ declare namespace Eps { }): Promise; chat: { message: ChatMessage; session: ChatSession }; test: Test; - ai: { limit: AiLimit; order: AiOrder; vip: AiVip }; base: { comm: BaseComm; open: BaseOpen; @@ -1959,12 +1894,12 @@ declare namespace Eps { }; }; cloud: { db: CloudDb; func: { info: CloudFuncInfo; log: CloudFuncLog } }; - demo: { goods: DemoGoods }; + demo: { goods: DemoGoods; user: DemoUser }; dict: { info: DictInfo; type: DictType }; iot: { device: IotDevice; message: IotMessage; mqtt: IotMqtt }; recycle: { data: RecycleData }; space: { info: SpaceInfo; type: SpaceType }; task: { info: TaskInfo }; - user: { info: UserInfo }; + user: { address: UserAddress; info: UserInfo }; }; } diff --git a/build/cool/temp/eps.json b/build/cool/temp/eps.json index 5687ed0..4635fcd 100644 --- a/build/cool/temp/eps.json +++ b/build/cool/temp/eps.json @@ -1 +1 @@ -[["/admin/ai/limit","AiLimitEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/ai/order","AiOrderEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/ai/vip","AiVipEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/base/comm","",[["/personUpdate","post"],["/uploadMode","get"],["/permmenu","get"],["/person","get"],["/upload","post"],["/logout","post"],["/list"],["/page"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/base/open","",[["/refreshToken","get"],["/captcha","get"],["/login","post"],["/html","get"],["/eps","get"],["/list"],["/page"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/base/sys/department","BaseSysDepartmentEntity",[["/delete","post"],["/update","post"],["/order","post"],["/list","post"],["/add","post"],["/page"],["/info"]]],["/admin/base/sys/log","BaseSysLogEntity",[["/setKeep","post"],["/getKeep","get"],["/clear","post"],["/page","post"],["/list"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/base/sys/menu","BaseSysMenuEntity",[["/create","post"],["/delete","post"],["/update","post"],["/parse","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/base/sys/param","BaseSysParamEntity",[["/delete","post"],["/update","post"],["/html","get"],["/info","get"],["/page","post"],["/add","post"],["/list"]]],["/admin/base/sys/role","BaseSysRoleEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/base/sys/user","BaseSysUserEntity",[["/delete","post"],["/update","post"],["/move","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/cloud/db","CloudDBEntity",[["/initEntity","post"],["/delete","post"],["/update","post"],["/data","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/cloud/func/info","CloudFuncInfoEntity",[["/invoke","post"],["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/cloud/func/log","CloudFuncLogEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/demo/goods","DemoGoodsEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/dict/info","DictInfoEntity",[["/delete","post"],["/update","post"],["/data","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/dict/type","DictTypeEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/iot/device","IotDeviceEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/iot/message","IotMessageEntity",[["/page","post"],["/list"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/iot/mqtt","",[["/publish","post"],["/config","get"],["/list"],["/page"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/recycle/data","RecycleDataEntity",[["/restore","post"],["/info","get"],["/page","post"],["/list"],["/update"],["/delete"],["/add"]]],["/admin/space/info","SpaceInfoEntity",[["/getConfig","get"],["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/space/type","SpaceTypeEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/task/info","TaskInfoEntity",[["/delete","post"],["/update","post"],["/start","post"],["/once","post"],["/stop","post"],["/info","get"],["/page","post"],["/log","get"],["/add","post"],["/list"]]],["/admin/user/info","UserInfoEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/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 +[["/admin/base/comm","",[["/personUpdate","post"],["/uploadMode","get"],["/permmenu","get"],["/person","get"],["/upload","post"],["/logout","post"],["/list"],["/page"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/base/open","",[["/refreshToken","get"],["/captcha","get"],["/login","post"],["/html","get"],["/eps","get"],["/list"],["/page"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/base/sys/department","BaseSysDepartmentEntity",[["/delete","post"],["/update","post"],["/order","post"],["/list","post"],["/add","post"],["/page"],["/info"]]],["/admin/base/sys/log","BaseSysLogEntity",[["/setKeep","post"],["/getKeep","get"],["/clear","post"],["/page","post"],["/list"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/base/sys/menu","BaseSysMenuEntity",[["/create","post"],["/delete","post"],["/update","post"],["/parse","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/base/sys/param","BaseSysParamEntity",[["/delete","post"],["/update","post"],["/html","get"],["/info","get"],["/page","post"],["/add","post"],["/list"]]],["/admin/base/sys/role","BaseSysRoleEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/base/sys/user","BaseSysUserEntity",[["/delete","post"],["/update","post"],["/move","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/cloud/db","CloudDBEntity",[["/initEntity","post"],["/delete","post"],["/update","post"],["/data","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/cloud/func/info","CloudFuncInfoEntity",[["/invoke","post"],["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/cloud/func/log","CloudFuncLogEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/demo/goods","DemoGoodsEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/demo/user","DemoUserEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/dict/info","DictInfoEntity",[["/delete","post"],["/update","post"],["/data","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/dict/type","DictTypeEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/iot/device","IotDeviceEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/iot/message","IotMessageEntity",[["/page","post"],["/list"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/iot/mqtt","",[["/publish","post"],["/config","get"],["/list"],["/page"],["/info"],["/update"],["/delete"],["/add"]]],["/admin/recycle/data","RecycleDataEntity",[["/restore","post"],["/info","get"],["/page","post"],["/list"],["/update"],["/delete"],["/add"]]],["/admin/space/info","SpaceInfoEntity",[["/getConfig","get"],["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/space/type","SpaceTypeEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/task/info","TaskInfoEntity",[["/delete","post"],["/update","post"],["/start","post"],["/once","post"],["/stop","post"],["/info","get"],["/page","post"],["/log","get"],["/add","post"],["/list"]]],["/admin/user/address","UserAddressEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/admin/user/info","UserInfoEntity",[["/delete","post"],["/update","post"],["/info","get"],["/list","post"],["/page","post"],["/add","post"]]],["/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/packages/crud/package.json b/packages/crud/package.json index f1cb83d..88d36a9 100644 --- a/packages/crud/package.json +++ b/packages/crud/package.json @@ -1,6 +1,6 @@ { "name": "@cool-vue/crud", - "version": "6.2.0", + "version": "6.2.1", "private": false, "main": "./dist/index.umd.min.js", "typings": "types/index.d.ts", diff --git a/packages/crud/src/components/filter/group.tsx b/packages/crud/src/components/filter/group.tsx index 3785d80..8c7b1c7 100644 --- a/packages/crud/src/components/filter/group.tsx +++ b/packages/crud/src/components/filter/group.tsx @@ -30,7 +30,7 @@ export default defineComponent({ onSearch: Function }, - setup(props, { slots, expose }) { + setup(props, { slots, expose, emit }) { const { crud } = useCore(); const { style } = useTools(); @@ -66,6 +66,7 @@ export default defineComponent({ // 重置 function reset() { Form.value?.reset(); + emit("reset"); } expose({ diff --git a/src/modules/excel/components/export-btn.tsx b/src/modules/excel/components/export-btn.tsx index 7b49cd8..2c29ecb 100644 --- a/src/modules/excel/components/export-btn.tsx +++ b/src/modules/excel/components/export-btn.tsx @@ -26,7 +26,7 @@ export default defineComponent({ maxExportLimit: Number // 最大导出条数,不传或者小于等于0为不限制 }, - setup(props) { + setup(props, { slots }) { // 加载状态 const loading = ref(false); @@ -40,18 +40,20 @@ export default defineComponent({ // 获取表格数据 function getData() { + const params = { + ...Crud.value?.paramsReplace(Crud.value.params), + maxExportLimit: props.maxExportLimit, + isExport: true + }; + if (typeof props.data === "function") { - return props.data(); + return props.data(params); } else { if (props.data) { return props.data; } else { return Crud.value?.service - .page({ - ...Crud.value?.paramsReplace(Crud.value.params), - maxExportLimit: props.maxExportLimit, - isExport: true - }) + .page(params) .then((res) => { return res.list.map((e) => { for (const i in e) { @@ -106,7 +108,7 @@ export default defineComponent({ // 表格列 const columns = props.columns.filter( - (e: any) => + (e) => !( e.hidden === true || ["selection", "expand", "index"].includes(e.type) || @@ -116,7 +118,7 @@ export default defineComponent({ ); // 字段 - const fields = columns.map((e: any) => e.prop).filter(Boolean); + const fields = columns.map((e) => e.prop).filter(Boolean); // 表头 const header = await getHeader(columns, fields); @@ -150,7 +152,7 @@ export default defineComponent({ return () => { return ( - 导出 + {slots.default ? slots.default() : "导出"} ); }; diff --git a/src/modules/upload/components/items/viewer.vue b/src/modules/upload/components/items/viewer.vue index 4de1b4f..71ebae6 100644 --- a/src/modules/upload/components/items/viewer.vue +++ b/src/modules/upload/components/items/viewer.vue @@ -50,3 +50,9 @@ defineExpose({ open }); + + diff --git a/src/modules/upload/components/upload.vue b/src/modules/upload/components/upload.vue index d81b108..06e6177 100644 --- a/src/modules/upload/components/upload.vue +++ b/src/modules/upload/components/upload.vue @@ -269,7 +269,9 @@ const accept = computed(() => { // 能否添加 const isAdd = computed(() => { - return props.multiple ? limit - list.value.length > 0 : list.value.length == 0; + return props.multiple + ? !disabled.value && limit - list.value.length > 0 + : list.value.length == 0; }); // 获取类型