!26 后端员工通知公告查询Bug修复以及前端文件上传组件优化

Merge pull request !26 from 大熊/master
This commit is contained in:
1024创新实验室 2024-04-10 11:40:13 +00:00 committed by Gitee
commit 71521d1d41
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 57 additions and 25 deletions

View File

@ -108,7 +108,7 @@ public class LoginService implements StpInterface {
private ProtectLoginService protectLoginService; private ProtectLoginService protectLoginService;
@Resource @Resource
private ProtectPasswordService profectPasswordService; private ProtectPasswordService protectPasswordService;
/** /**
* 获取验证码 * 获取验证码
@ -148,7 +148,7 @@ public class LoginService implements StpInterface {
} }
// 解密前端加密的密码 // 解密前端加密的密码
String requestPassword = profectPasswordService.decryptPassword(loginForm.getPassword()); String requestPassword = protectPasswordService.decryptPassword(loginForm.getPassword());
// 验证密码 是否为万能密码 // 验证密码 是否为万能密码
String superPassword = configService.getConfigValue(ConfigKeyEnum.SUPER_PASSWORD); String superPassword = configService.getConfigValue(ConfigKeyEnum.SUPER_PASSWORD);

View File

@ -155,11 +155,12 @@
left join t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id left join t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
<where> <where>
<if test="!administratorFlag"> <if test="!administratorFlag">
(
t_notice.notice_id in t_notice.notice_id in
(select t_notice_visible_range.notice_id (select t_notice_visible_range.notice_id
from t_notice_visible_range from t_notice_visible_range
where where
(t_notice_visible_range.data_type = #{departmentDataType} ( t_notice_visible_range.data_type = #{departmentDataType}
<if test="requestEmployeeDepartmentIdList != null and requestEmployeeDepartmentIdList.size > 0"> <if test="requestEmployeeDepartmentIdList != null and requestEmployeeDepartmentIdList.size > 0">
and and
t_notice_visible_range.data_id t_notice_visible_range.data_id
@ -169,8 +170,9 @@
</foreach> </foreach>
</if> </if>
) )
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id = or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id = #{requestEmployeeId} )
#{requestEmployeeId} ) )
or t_notice.all_visible_flag = true
) )
</if> </if>
and t_notice.all_visible_flag = true and t_notice.all_visible_flag = true
@ -182,7 +184,7 @@
<if test="query.keywords != null and query.keywords !=''"> <if test="query.keywords != null and query.keywords !=''">
AND ( INSTR(t_notice.title,#{query.keywords}) AND ( INSTR(t_notice.title,#{query.keywords})
OR INSTR(t_notice.author,#{query.keywords}) OR INSTR(t_notice.author,#{query.keywords})
OR INSTR(t_notice.documentNumber,#{query.keywords}) OR INSTR(t_notice.document_number,#{query.keywords})
OR INSTR(t_notice.source,#{query.keywords}) OR INSTR(t_notice.source,#{query.keywords})
) )
</if> </if>

View File

@ -32,7 +32,7 @@ export const fileApi = {
/** /**
* 下载文件流根据fileKey @author 胡克 * 下载文件流根据fileKey @author 胡克
*/ */
downLoadFile: (fileName, fileKey) => { downLoadFile: (fileKey) => {
return getDownload('/support/file/downLoad', { fileKey }); return getDownload('/support/file/downLoad', { fileKey });
}, },
}; };

View File

@ -11,6 +11,7 @@
<template> <template>
<div class="clearfix"> <div class="clearfix">
<a-upload <a-upload
multiple
:accept="props.accept" :accept="props.accept"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:customRequest="customRequest" :customRequest="customRequest"
@ -43,12 +44,11 @@
</template> </template>
<script setup> <script setup>
import { computed, ref, watch } from 'vue'; import { computed, ref, watch } from 'vue';
import { message } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { fileApi } from '/src/api/support/file-api'; import { fileApi } from '/src/api/support/file-api';
import { useUserStore } from '/@/store/modules/system/user'; import { useUserStore } from '/@/store/modules/system/user';
import { SmartLoading } from '/@/components/framework/smart-loading'; import { SmartLoading } from '/@/components/framework/smart-loading';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const'; import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { getDownload } from '/@/lib/axios';
import { smartSentry } from '/@/lib/smart-sentry'; import { smartSentry } from '/@/lib/smart-sentry';
const props = defineProps({ const props = defineProps({
value: String, value: String,
@ -162,14 +162,44 @@
console.log(fileList.value); console.log(fileList.value);
} }
function beforeUpload(file) { function beforeUpload(file, files) {
if (fileList.value.length + files.length > props.maxUploadSize) {
showErrorMsgOnce(`最多支持上传 ${props.maxUploadSize} 个文件哦!`);
return false;
}
if (props.accept) {
const suffixIndex = file.name.lastIndexOf('.');
const fileSuffix = file.name.substring(suffixIndex <= -1 ? 0 : suffixIndex);
if (props.accept.indexOf(fileSuffix) === -1) {
showErrorMsgOnce(`只支持上传 ${props.accept.replaceAll(',', ' ')} 格式的文件`);
return false;
}
}
const isLimitSize = file.size / 1024 / 1024 < props.maxSize; const isLimitSize = file.size / 1024 / 1024 < props.maxSize;
if (!isLimitSize) { if (!isLimitSize) {
return message.error(`上传的文件必须小于${props.maxSize}Mb`); showErrorMsgOnce(`单个文件大小必须小于 ${props.maxSize} Mb`);
} }
return isLimitSize; return isLimitSize;
} }
const showErrorModalFlag = ref(true);
const showErrorMsgOnce = (content) => {
if (showErrorModalFlag.value) {
Modal.error({
title: '提示',
content: content,
okType: 'danger',
centered: true,
onOk() {
showErrorModalFlag.value = true;
},
});
showErrorModalFlag.value = false;
}
};
function handleCancel() { function handleCancel() {
previewVisible.value = false; previewVisible.value = false;
} }
@ -179,7 +209,7 @@
previewUrl.value = file.url || file.preview; previewUrl.value = file.url || file.preview;
previewVisible.value = true; previewVisible.value = true;
} else { } else {
getDownload(file.fileName, file.fileUrl); fileApi.downLoadFile(file.fileKey);
} }
}; };