|
@@ -341,6 +341,7 @@ import {
|
|
|
saveApprovalRecord,
|
|
saveApprovalRecord,
|
|
|
getActivityAttachments
|
|
getActivityAttachments
|
|
|
} from '@/api/order/marketing-activity'
|
|
} from '@/api/order/marketing-activity'
|
|
|
|
|
+import { formatFileSize } from '@/util/util'
|
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -846,20 +847,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 格式化文件大小
|
|
|
|
|
- * @param {number} bytes - 文件大小(字节)
|
|
|
|
|
- * @returns {string} 格式化后的文件大小
|
|
|
|
|
- */
|
|
|
|
|
- formatFileSize(bytes) {
|
|
|
|
|
- if (!bytes || bytes === 0) return '0 B'
|
|
|
|
|
-
|
|
|
|
|
- const k = 1024
|
|
|
|
|
- const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
|
|
|
|
|
- const i = Math.floor(Math.log(bytes) / Math.log(k))
|
|
|
|
|
-
|
|
|
|
|
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ formatFileSize,
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取文件类型图标
|
|
* 获取文件类型图标
|