hrp-ui-base 1.4.6 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.cjs +5 -5
- package/dist/components.es.js +2477 -2477
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/packages/approval-process/package.json +1 -1
- package/src/components/annex-upload/index.vue +6 -4
- package/src/components/layout/stores/useLayoutNoticeStore.ts +1 -1
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<div class="el-upload__tip">
|
|
40
40
|
附件上限数量{{ props.limited }}个,单次最多选择{{
|
|
41
41
|
props.limited
|
|
42
|
-
}}个,单文件大小不超过
|
|
42
|
+
}}个,单文件大小不超过{{ MAX_FILE_SIZE_MB }}MB
|
|
43
43
|
且附件上传格式仅限docx、doc、wps、xls、xlsx、jpg、pdf、png、bmp、ppt、pptx、jpeg、raw、heif、tiff、gif、mp3、mp4、rar、zip、7z。
|
|
44
44
|
</div>
|
|
45
45
|
</template>
|
|
@@ -269,6 +269,8 @@ const emits = defineEmits(["getUploadIds", "getUploadInfo", "changeLoading"]);
|
|
|
269
269
|
const token = localStorage.getItem("TOKEN");
|
|
270
270
|
const uploadUrl =
|
|
271
271
|
window.location.origin + window.location.pathname + "api/bms/file/upload";
|
|
272
|
+
const MAX_FILE_SIZE_MB = 50;
|
|
273
|
+
const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
272
274
|
const minioHeader = ref({ "Authorization-Token": token });
|
|
273
275
|
const ossHeader = ref({
|
|
274
276
|
// 指定该Object被下载时的网页缓存行为。
|
|
@@ -299,10 +301,10 @@ const fileList = ref<UploadUserFile[]>([]);
|
|
|
299
301
|
const fileName = ref<string>("");
|
|
300
302
|
const beforeUploadOSS = async (e: any) => {
|
|
301
303
|
changeLoadingStatus(true);
|
|
302
|
-
const
|
|
303
|
-
if (!
|
|
304
|
+
const isFileSizeValid = e.size <= MAX_FILE_SIZE_BYTES;
|
|
305
|
+
if (!isFileSizeValid) {
|
|
304
306
|
changeLoadingStatus(false);
|
|
305
|
-
ElMessage.error(
|
|
307
|
+
ElMessage.error(`上传文件大小不能超过 ${MAX_FILE_SIZE_MB}MB!`);
|
|
306
308
|
return false;
|
|
307
309
|
}
|
|
308
310
|
fileName.value = e.name;
|
|
@@ -45,7 +45,7 @@ export const useLayoutNoticeStore = defineStore("layout-notice", () => {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/** 开始轮询 */
|
|
48
|
-
const startPolling = (onNewNotice?: (notices: NoticeVO[]) => void, interval: number =
|
|
48
|
+
const startPolling = (onNewNotice?: (notices: NoticeVO[]) => void, interval: number = 15000) => {
|
|
49
49
|
// 立即执行一次
|
|
50
50
|
const doFetch = async () => {
|
|
51
51
|
const notices = await fetchNoticeInfo();
|