!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;
@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);

View File

@ -155,6 +155,7 @@
left join t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
<where>
<if test="!administratorFlag">
(
t_notice.notice_id in
(select t_notice_visible_range.notice_id
from t_notice_visible_range
@ -169,8 +170,9 @@
</foreach>
</if>
)
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id =
#{requestEmployeeId} )
or ( t_notice_visible_range.data_type = #{employeeDataType} and t_notice_visible_range.data_id = #{requestEmployeeId} )
)
or t_notice.all_visible_flag = true
)
</if>
and t_notice.all_visible_flag = true
@ -182,7 +184,7 @@
<if test="query.keywords != null and query.keywords !=''">
AND ( INSTR(t_notice.title,#{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})
)
</if>

View File

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

View File

@ -11,6 +11,7 @@
<template>
<div class="clearfix">
<a-upload
multiple
:accept="props.accept"
:before-upload="beforeUpload"
:customRequest="customRequest"
@ -43,12 +44,11 @@
</template>
<script setup>
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 { useUserStore } from '/@/store/modules/system/user';
import { SmartLoading } from '/@/components/framework/smart-loading';
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
import { getDownload } from '/@/lib/axios';
import { smartSentry } from '/@/lib/smart-sentry';
const props = defineProps({
value: String,
@ -162,14 +162,44 @@
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;
if (!isLimitSize) {
return message.error(`上传的文件必须小于${props.maxSize}Mb`);
showErrorMsgOnce(`单个文件大小必须小于 ${props.maxSize} Mb`);
}
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() {
previewVisible.value = false;
}
@ -179,7 +209,7 @@
previewUrl.value = file.url || file.preview;
previewVisible.value = true;
} else {
getDownload(file.fileName, file.fileUrl);
fileApi.downLoadFile(file.fileKey);
}
};