feat: 显示视频的格式码率等信息
This commit is contained in:
parent
eb8f647c5e
commit
64620c7072
@ -551,7 +551,7 @@
|
||||
'\r\n' +
|
||||
'路径:' +
|
||||
item.path +
|
||||
'\r\n' + formatExif(item.exif)
|
||||
extendedInfo(item)
|
||||
"
|
||||
:style="{paddingTop: 100/gridColumnNum + '%'}"
|
||||
>
|
||||
@ -815,7 +815,7 @@ import { mapGetters, mapState } from 'vuex'
|
||||
import { formatSize, formatTime } from '@/utils/number'
|
||||
import { getElementToPageLeft } from '@/utils/dom'
|
||||
import { suffix } from '@/utils/file-type'
|
||||
import { formatExif } from '@/utils/image'
|
||||
import { formatExif,formatVideo } from '@/utils/media'
|
||||
import api from '@/api/file-api'
|
||||
import BreadcrumbFilePath from '@/components/Breadcrumb/BreadcrumbFilePath'
|
||||
import IconFile from '@/components/Icon/IconFile'
|
||||
@ -2204,8 +2204,11 @@ export default {
|
||||
formatSize(size) {
|
||||
return formatSize(size)
|
||||
},
|
||||
formatExif(exifInfo) {
|
||||
return formatExif(exifInfo)
|
||||
extendedInfo(file) {
|
||||
if (!file.exif && !file.video) {
|
||||
return
|
||||
}
|
||||
return "\r\n" + formatExif(file.exif) + formatVideo(file.video)
|
||||
},
|
||||
upload() {
|
||||
// 打开文件选择框
|
||||
|
||||
@ -56,9 +56,12 @@
|
||||
<el-form-item label="修改时间:">
|
||||
<span>{{ rowContextData.updateDate }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="rowContextData.exif" label="Exif:">
|
||||
<el-form-item v-if="rowContextData.exif" label="">
|
||||
<span style="white-space: break-spaces;">{{ formatExif(rowContextData.exif) }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="rowContextData.video" label="">
|
||||
<span style="white-space: break-spaces;">{{ formatVideo(rowContextData.video) }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-drawer>
|
||||
</div>
|
||||
@ -68,7 +71,7 @@
|
||||
import { formatSize } from '@/utils/number'
|
||||
import IconFile from '@/components/Icon/IconFile'
|
||||
import {mapState} from "vuex";
|
||||
import {formatExif} from "@/utils/image";
|
||||
import {formatExif,formatVideo} from "@/utils/media";
|
||||
import settingApi from "@/api/setting-api";
|
||||
|
||||
export default {
|
||||
@ -127,6 +130,9 @@ export default {
|
||||
formatExif(exifInfo) {
|
||||
return formatExif(exifInfo)
|
||||
},
|
||||
formatVideo(videoInfo) {
|
||||
return formatVideo(videoInfo)
|
||||
},
|
||||
getIsSync() {
|
||||
settingApi.isSync({username: this.$store.state.user.name}).then((res) => {
|
||||
this.updateSyncStatus(res.data)
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
export function formatExif(exifInfo) {
|
||||
if (!exifInfo) {
|
||||
return ''
|
||||
}
|
||||
let exifStr = ''
|
||||
if (exifInfo['dateTimeOriginal']) {
|
||||
exifStr += `\r\n内容创作时间: ${exifInfo['dateTimeOriginal']}\r\n`
|
||||
}
|
||||
if (exifInfo['resolution']) {
|
||||
exifStr += `分辨率: ${exifInfo['resolution']}\r\n`
|
||||
}
|
||||
if (exifInfo['make']) {
|
||||
exifStr += `设备制造商: ${exifInfo['make']}\r\n`
|
||||
}
|
||||
if (exifInfo['model']) {
|
||||
exifStr += `设备型号: ${exifInfo['model']}\r\n`
|
||||
}
|
||||
if (exifInfo['aperture']) {
|
||||
exifStr += `光圈值: ${exifInfo['aperture']}\r\n`
|
||||
}
|
||||
if (exifInfo['exposureTime']) {
|
||||
exifStr += `曝光时间: ${exifInfo['exposureTime']}\r\n`
|
||||
}
|
||||
if (exifInfo['focalLength']) {
|
||||
exifStr += `焦距: ${exifInfo['focalLength']} 毫米\r\n`
|
||||
}
|
||||
if (exifInfo['isoEquivalent']) {
|
||||
exifStr += `ISO感光度: ${exifInfo['isoEquivalent']}\r\n`
|
||||
}
|
||||
if (exifInfo['flash']) {
|
||||
exifStr += `闪光灯: ${exifInfo['flash']}\r\n`
|
||||
}
|
||||
if (exifInfo['fNumber']) {
|
||||
exifStr += `光圈数: ${exifInfo['fNumber']}\r\n`
|
||||
}
|
||||
if (exifInfo['exposureProgram']) {
|
||||
exifStr += `曝光程序: ${exifInfo['exposureProgram']}\r\n`
|
||||
}
|
||||
if (exifInfo['meteringMode']) {
|
||||
exifStr += `测光模式: ${exifInfo['meteringMode']}\r\n`
|
||||
}
|
||||
if (exifInfo['whiteBalanceMode']) {
|
||||
exifStr += `白平衡: ${exifInfo['whiteBalanceMode']}\r\n`
|
||||
}
|
||||
if (exifInfo['software']) {
|
||||
exifStr += `内容创作者: ${exifInfo['software']}\r\n`
|
||||
}
|
||||
if (exifInfo['longitude']) {
|
||||
exifStr += `经度: ${exifInfo['longitude']}\r\n`
|
||||
}
|
||||
if (exifInfo['latitude']) {
|
||||
exifStr += `纬度: ${exifInfo['latitude']}\r\n`
|
||||
}
|
||||
return exifStr
|
||||
}
|
||||
75
src/utils/media.js
Normal file
75
src/utils/media.js
Normal file
@ -0,0 +1,75 @@
|
||||
export function formatExif(exifInfo) {
|
||||
if (!exifInfo) {
|
||||
return ''
|
||||
}
|
||||
let exifStr = ''
|
||||
if (exifInfo['dateTimeOriginal']) {
|
||||
exifStr += `内容创作时间: ${exifInfo['dateTimeOriginal']}`
|
||||
}
|
||||
if (exifInfo['resolution']) {
|
||||
exifStr += `\r\n分辨率: ${exifInfo['resolution']}`
|
||||
}
|
||||
if (exifInfo['make']) {
|
||||
exifStr += `\r\n设备制造商: ${exifInfo['make']}`
|
||||
}
|
||||
if (exifInfo['model']) {
|
||||
exifStr += `\r\n设备型号: ${exifInfo['model']}`
|
||||
}
|
||||
if (exifInfo['aperture']) {
|
||||
exifStr += `\r\n光圈值: ${exifInfo['aperture']}`
|
||||
}
|
||||
if (exifInfo['exposureTime']) {
|
||||
exifStr += `\r\n曝光时间: ${exifInfo['exposureTime']}`
|
||||
}
|
||||
if (exifInfo['focalLength']) {
|
||||
exifStr += `\r\n焦距: ${exifInfo['focalLength']} 毫米`
|
||||
}
|
||||
if (exifInfo['isoEquivalent']) {
|
||||
exifStr += `\r\nISO感光度: ${exifInfo['isoEquivalent']}`
|
||||
}
|
||||
if (exifInfo['flash']) {
|
||||
exifStr += `\r\n闪光灯: ${exifInfo['flash']}`
|
||||
}
|
||||
if (exifInfo['fNumber']) {
|
||||
exifStr += `\r\n光圈数: ${exifInfo['fNumber']}`
|
||||
}
|
||||
if (exifInfo['exposureProgram']) {
|
||||
exifStr += `\r\n曝光程序: ${exifInfo['exposureProgram']}`
|
||||
}
|
||||
if (exifInfo['meteringMode']) {
|
||||
exifStr += `\r\n测光模式: ${exifInfo['meteringMode']}`
|
||||
}
|
||||
if (exifInfo['whiteBalanceMode']) {
|
||||
exifStr += `\r\n白平衡: ${exifInfo['whiteBalanceMode']}`
|
||||
}
|
||||
if (exifInfo['software']) {
|
||||
exifStr += `内容创作者: ${exifInfo['software']}`
|
||||
}
|
||||
if (exifInfo['longitude']) {
|
||||
exifStr += `\r\n经度: ${exifInfo['longitude']}`
|
||||
}
|
||||
if (exifInfo['latitude']) {
|
||||
exifStr += `\r\n纬度: ${exifInfo['latitude']}`
|
||||
}
|
||||
return exifStr
|
||||
}
|
||||
|
||||
export function formatVideo(videoInfo) {
|
||||
if (!videoInfo) {
|
||||
return ''
|
||||
}
|
||||
let videoStr = ''
|
||||
if (videoInfo['height'] && videoInfo['width']) {
|
||||
videoStr += `尺寸: ${videoInfo['width']} x ${videoInfo['height']}`
|
||||
}
|
||||
if (videoInfo['bitrate']) {
|
||||
videoStr += `\r\n码率: ${videoInfo['bitrate']}`
|
||||
}
|
||||
if (videoInfo['format']) {
|
||||
videoStr += `\r\n格式: ${videoInfo['format']}`
|
||||
}
|
||||
if (videoInfo['duration']) {
|
||||
videoStr += `\r\n时长: ${videoInfo['duration']}`
|
||||
}
|
||||
return videoStr
|
||||
}
|
||||
@ -224,7 +224,6 @@ export default {
|
||||
}
|
||||
getTaskProgress().then(res => {
|
||||
this.taskProgressDataList = res.data
|
||||
this.taskProgressChange(this.taskProgressDataList.length)
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user