diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java index 463db3038..d9ba7c4be 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java @@ -94,6 +94,19 @@ public class LambdaQueryWrapperX extends LambdaQueryWrapper { return this; } + public LambdaQueryWrapperX betweenIfPresent(SFunction column, Object[] values) { + if (values!= null && values.length >0 && values[0] != null && values[1] != null) { + return (LambdaQueryWrapperX) super.between(column, values[0], values[1]); + } + if (values != null && values[0] != null) { + return (LambdaQueryWrapperX) ge(column, values[0]); + } + if (values != null && values[1] != null) { + return (LambdaQueryWrapperX) le(column, values[2]); + } + return this; + } + // ========== 重写父类方法,方便链式调用 ========== @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java index 00f20eb4d..ee539189e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java @@ -37,6 +37,10 @@ public class UserPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Date endTime; + @ApiModelProperty(value = "开始时间", example = "2020-10-24") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] createTime; + @ApiModelProperty(value = "部门编号", example = "1024", notes = "同时筛选子部门") private Long deptId; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index b7d5e3daa..353cffab5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -33,7 +33,8 @@ public interface AdminUserMapper extends BaseMapperX { .likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername()) .likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile()) .eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(),reqVO.getEndTime()) + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime()) .inIfPresent(AdminUserDO::getDeptId, deptIds) .orderByDesc(AdminUserDO::getId)); diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 2ae3cdf3c..8402db3bd 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi-vue-pro-vue3", - "version": "1.0.160", + "version": "1.6.2.1601", "description": "基于vue3、element-plus、typesScript、vite3", "author": "xingyu", "private": false, @@ -56,7 +56,7 @@ "devDependencies": { "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", - "@iconify/json": "^2.1.79", + "@iconify/json": "^2.1.80", "@intlify/vite-plugin-vue-i18n": "^5.0.0", "@purge-icons/generated": "^0.8.1", "@types/intro.js": "^5.1.0", diff --git a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts index 08f0016b6..e9265bd78 100644 --- a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts +++ b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts @@ -23,3 +23,21 @@ export const getKeyListApi = (keyTemplate: string) => { } }) } +// 获取缓存内容 +export const getKeyValue = (key: string) => { + return request.get({ url: '/infra/redis/get-key-value?key=' + key }) +} + +// 根据键名删除缓存 +export const deleteKey = (key: string) => { + return request.delete({ url: '/infra/redis/delete-key?key=' + key }) +} + +export const deleteKeys = (keyTemplate: string) => { + return request.delete({ + url: '/infra/redis/delete-keys?', + params: { + keyTemplate + } + }) +} diff --git a/yudao-ui-admin-vue3/src/components/Form/src/helper.ts b/yudao-ui-admin-vue3/src/components/Form/src/helper.ts index 2f75322b0..b81409c7e 100644 --- a/yudao-ui-admin-vue3/src/components/Form/src/helper.ts +++ b/yudao-ui-admin-vue3/src/components/Form/src/helper.ts @@ -1,10 +1,8 @@ -// import { useI18n } from '@/hooks/web/useI18n' +import { useI18n } from '@/hooks/web/useI18n' import type { Slots } from 'vue' import { getSlot } from '@/utils/tsxHelper' import { PlaceholderMoel } from './types' -// const { t } = useI18n() - /** * * @param schema 对应组件数据 @@ -12,12 +10,12 @@ import { PlaceholderMoel } from './types' * @description 用于自动设置placeholder */ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { + const { t } = useI18n() const textMap = ['Input', 'Autocomplete', 'InputNumber', 'InputPassword'] const selectMap = ['Select', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect'] if (textMap.includes(schema?.component as string)) { return { - // placeholder: t('common.inputText') - placeholder: '请输入' + placeholder: t('common.inputText') } } if (selectMap.includes(schema?.component as string)) { @@ -29,16 +27,13 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { ) ) { return { - // startPlaceholder: t('common.startTimeText'), - // endPlaceholder: t('common.endTimeText'), - startPlaceholder: '开始时间', - endPlaceholder: '结束时间', + startPlaceholder: t('common.startTimeText'), + endPlaceholder: t('common.endTimeText'), rangeSeparator: '-' } } else { return { - // placeholder: t('common.selectText') - placeholder: '请选择' + placeholder: t('common.selectText') } } } diff --git a/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue b/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue index f7dffe27b..c446184e1 100644 --- a/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue +++ b/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue @@ -59,7 +59,7 @@ watch( :class="[ prefixCls, layout !== 'classic' ? `${prefixCls}__Top` : '', - 'flex !h-[var(--logo-height)] items-center cursor-pointer pl-8px relative', + 'flex !h-[var(--logo-height)] items-center cursor-pointer justify-center relative', 'dark:bg-[var(--el-bg-color)]' ]" to="/" diff --git a/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue b/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue index 1801e7078..47c48213d 100644 --- a/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue +++ b/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue @@ -43,7 +43,7 @@ const loginOut = () => { .catch(() => {}) } const toProfile = async () => { - push('/user/profile') + push('/userinfo/profile') } const toDocument = () => { window.open('https://doc.iocoder.cn/') diff --git a/yudao-ui-admin-vue3/src/config/axios/index.ts b/yudao-ui-admin-vue3/src/config/axios/index.ts index e7d1cebce..fe4b2a95a 100644 --- a/yudao-ui-admin-vue3/src/config/axios/index.ts +++ b/yudao-ui-admin-vue3/src/config/axios/index.ts @@ -5,7 +5,6 @@ import { config } from '@/config/axios/config' import { getAccessToken, getRefreshToken, getTenantId } from '@/utils/auth' import errorCode from './errorCode' import { useI18n } from '@/hooks/web/useI18n' -const { t } = useI18n() const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE const BASE_URL = import.meta.env.VITE_BASE_URL @@ -46,25 +45,27 @@ service.interceptors.request.use( const tenantId = getTenantId() if (tenantId) (config as Recordable).headers.common['tenant-id'] = tenantId } + const params = config.params || {} + const data = config.data || false if ( - config.method === 'post' && + config.method?.toUpperCase() === 'POST' && config!.headers!['Content-Type'] === 'application/x-www-form-urlencoded' ) { - config.data = qs.stringify(config.data) + config.data = qs.stringify(data) } // get参数编码 - if (config.method === 'get' && config.params) { + if (config.method?.toUpperCase() === 'GET' && config.params) { let url = config.url as string - url += '?' - const keys = Object.keys(config.params) - for (const key of keys) { - if (config.params[key] !== void 0 && config.params[key] !== null) { - url += `${key}=${encodeURIComponent(config.params[key])}&` - } - } // 给 get 请求加上时间戳参数,避免从缓存中拿数据 // const now = new Date().getTime() - // url = url.substring(0, url.length - 1) + `?_t=${now}` + // params = params.substring(0, url.length - 1) + `?_t=${now}` + url += '?' + const keys = Object.keys(params) + for (const key of keys) { + if (params[key] !== void 0 && params[key] !== null) { + url += `${key}=${encodeURIComponent(params[key])}&` + } + } config.params = {} config.url = url } @@ -85,6 +86,7 @@ service.interceptors.response.use( // 返回“[HTTP]请求没有返回值”; throw new Error() } + const { t } = useI18n() // 未设置状态码则默认成功状态 const code = data.code || result_code // 获取错误信息 @@ -134,6 +136,7 @@ service.interceptors.response.use( (error: AxiosError) => { console.log('err' + error) // for debug let { message } = error + const { t } = useI18n() if (message === 'Network Error') { message = t('sys.api.errorMessage') } else if (message.includes('timeout')) { @@ -146,6 +149,7 @@ service.interceptors.response.use( } ) function handleAuthorized() { + const { t } = useI18n() if (!isRelogin.show) { isRelogin.show = true ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { diff --git a/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts b/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts new file mode 100644 index 000000000..b5e3960aa --- /dev/null +++ b/yudao-ui-admin-vue3/src/hooks/web/useMessage.ts @@ -0,0 +1,71 @@ +import { ElMessage, ElMessageBox, ElNotification } from 'element-plus' +import { useI18n } from './useI18n' +export const useMessage = () => { + const { t } = useI18n() + return { + // 消息提示 + info(content: string) { + ElMessage.info(content) + }, + // 错误消息 + error(content: string) { + ElMessage.error(content) + }, + // 成功消息 + success(content: string) { + ElMessage.success(content) + }, + // 警告消息 + warning(content: string) { + ElMessage.warning(content) + }, + // 弹出提示 + alert(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle')) + }, + // 错误提示 + alertError(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'error' }) + }, + // 成功提示 + alertSuccess(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'success' }) + }, + // 警告提示 + alertWarning(content: string) { + ElMessageBox.alert(content, t('common.confirmTitle'), { type: 'warning' }) + }, + // 通知提示 + notify(content: string) { + ElNotification.info(content) + }, + // 错误通知 + notifyError(content: string) { + ElNotification.error(content) + }, + // 成功通知 + notifySuccess(content: string) { + ElNotification.success(content) + }, + // 警告通知 + notifyWarning(content: string) { + ElNotification.warning(content) + }, + // 确认窗体 + confirm(content: string, tip: string) { + return ElMessageBox.confirm(content, tip, { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + }) + }, + // 提交内容 + prompt(content: string, tip: string) { + return ElMessageBox.prompt(content, tip, { + confirmButtonText: t('common.ok'), + cancelButtonText: t('common.cancel'), + type: 'warning' + }) + } + } +} diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 56536fcf3..92f3a367e 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -41,7 +41,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ ] }, { - path: '/user', + path: '/userinfo', component: Layout, name: 'UserInfo', meta: { diff --git a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue index 0ef921d3d..bf7dbaedf 100644 --- a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue @@ -8,7 +8,8 @@ import type { ApiErrorLogVO } from '@/api/infra/apiErrorLog/types' import { allSchemas } from './apiErrorLog.data' import * as ApiErrorLogApi from '@/api/infra/apiErrorLog' import { InfraApiErrorLogProcessStatusEnum } from '@/utils/constants' -import { ElMessage, ElMessageBox } from 'element-plus' +import { useMessage } from '@/hooks/web/useMessage' +const message = useMessage() const { t } = useI18n() // 国际化 // ========== 列表相关 ========== @@ -36,14 +37,11 @@ const handleDetail = (row: ApiErrorLogVO) => { } // 异常处理操作 const handleProcessClick = (row: ApiErrorLogVO, processSttatus: number, type: string) => { - ElMessageBox.confirm('确认标记为' + type + '?', t('common.reminder'), { - confirmButtonText: t('common.ok'), - cancelButtonText: t('common.cancel'), - type: 'warning' - }) + message + .confirm('确认标记为' + type + '?', t('common.reminder')) .then(async () => { ApiErrorLogApi.updateApiErrorLogPageApi(row.id, processSttatus).then(() => { - ElMessage.success(t('common.updateSuccess')) + message.success(t('common.updateSuccess')) getList() }) }) diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/index.vue b/yudao-ui-admin-vue3/src/views/infra/codegen/index.vue index 827b232fd..215f79e9b 100644 --- a/yudao-ui-admin-vue3/src/views/infra/codegen/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/codegen/index.vue @@ -10,7 +10,8 @@ import ImportTable from './components/ImportTable.vue' import Preview from './components/Preview.vue' import download from '@/utils/download' import { useRouter } from 'vue-router' -import { ElMessage, ElMessageBox } from 'element-plus' +import { useMessage } from '@/hooks/web/useMessage' +const message = useMessage() const { t } = useI18n() // 国际化 const { push } = useRouter() // ========== 列表相关 ========== @@ -37,14 +38,12 @@ const handleEditTable = (row: CodegenTableVO) => { const handleSynchDb = (row: CodegenTableVO) => { // 基于 DB 同步 const tableName = row.tableName - ElMessageBox.confirm('确认要强制同步' + tableName + '表结构吗?', t('common.reminder'), { - confirmButtonText: t('common.ok'), - cancelButtonText: t('common.cancel'), - type: 'warning' - }).then(async () => { - await CodegenApi.syncCodegenFromDBApi(row.id) - ElMessage.success('同步成功') - }) + message + .confirm('确认要强制同步' + tableName + '表结构吗?', t('common.reminder')) + .then(async () => { + await CodegenApi.syncCodegenFromDBApi(row.id) + message.success('同步成功') + }) } // 生成代码操作 const handleGenTable = (row: CodegenTableVO) => { diff --git a/yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue b/yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue index 86313f902..1c49c173c 100644 --- a/yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue @@ -1,7 +1,6 @@