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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hrp-ui-base",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "HRP 前端公共组件、工具方法和基础样式包",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -11,7 +11,7 @@
11
11
  "devDependencies": {},
12
12
  "module": "index.ts",
13
13
  "peerDependencies": {
14
- "hrp-ui-base": "1.4.6",
14
+ "hrp-ui-base": "latest",
15
15
  "vue": "^3.0.0"
16
16
  }
17
17
  }
@@ -39,7 +39,7 @@
39
39
  <div class="el-upload__tip">
40
40
  附件上限数量{{ props.limited }}个,单次最多选择{{
41
41
  props.limited
42
- }}个,单文件大小不超过20MB
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 is20M = e.size / 1024 / 1024 < 20;
303
- if (!is20M) {
304
+ const isFileSizeValid = e.size <= MAX_FILE_SIZE_BYTES;
305
+ if (!isFileSizeValid) {
304
306
  changeLoadingStatus(false);
305
- ElMessage.error("上传文件大小不能超过 20MB!");
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 = 3000) => {
48
+ const startPolling = (onNewNotice?: (notices: NoticeVO[]) => void, interval: number = 15000) => {
49
49
  // 立即执行一次
50
50
  const doFetch = async () => {
51
51
  const notices = await fetchNoticeInfo();