Jelajahi Sumber

修复图片预览bug,修改首页数据更新频率

cfort 2 tahun lalu
induk
melakukan
ab2d1ba40e

+ 1 - 1
src/utils/fecha.js

@@ -505,7 +505,7 @@ const dateDealFmt = {
       if (has != null) {
         const val = parseInt(dateStr.substring(has.index, has.index + has[0].length), 10)
         if (p === 'y') { date.setYear(val) }
-        if (p === 'M') { date.setMonth(val - 1) }
+        if (p === 'M') { date.setMonth(val - 1, 1) }
         if (p === 'd') { date.setDate(val) }
         if (p === 'H') { date.setHours(val) }
         if (p === 'm') { date.setMinutes(val) }

+ 5 - 0
src/views/platform/file/attachment/detail.vue

@@ -59,6 +59,7 @@
     import { get } from '@/api/platform/file/attachment'
     import { downloadFile } from '@/business/platform/file/utils'
     import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
+    import { fileTypes } from '@/business/platform/file/constants/fileTypes'
 
     export default {
         props: {
@@ -157,6 +158,10 @@
             },
             filePreview () {
                 const { id, fileName, ext } = this.data
+                if (fileTypes.images.includes(ext)) {
+                    this.$message.warning('图片附件请直接在列表预览!')
+                    return
+                }
                 this.fileOption.user.id = this.$store.getters.userId
                 this.fileOption.user.name = this.$store.getters.name
                 this.fileOption.url = BASE_API() + SYSTEM_URL() + `/file/download?attachmentId=${id}`

+ 2 - 1
src/views/platform/file/attachment/list.vue

@@ -62,6 +62,7 @@
     import FixHeight from '@/mixins/height'
     import IbpsUploader from '@/business/platform/file/uploader'
     import FilePreview from '@/business/platform/file/file-preview'
+    import { fileTypes } from '@/business/platform/file/constants/fileTypes'
     import Detail from './detail'
     import ModifyName from './modify-name'
     import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
@@ -263,7 +264,7 @@
                         break
                     case 'preview': // 预览
                         console.log('ext:', data.ext)
-                        if (['png', 'jpeg', 'jpg'].includes(data.ext)) {
+                        if (fileTypes.images.includes(data.ext)) {
                             this.file = data
                             this.filePreviewVisible2 = false
                             this.filePreviewVisible = true

+ 1 - 1
src/views/system/dashboard/components/new-home.vue

@@ -358,7 +358,7 @@
             this.timer = setInterval(() => {
                 // this.getMessage()
                 this.getData(this.activeTab)
-            }, 180000)
+            }, 10 * 1000)
         },
         beforeDestroy() {
             clearInterval(this.timer)