|
|
@@ -26,11 +26,13 @@
|
|
|
>
|
|
|
<template #header>
|
|
|
<template v-if="isDir">
|
|
|
- <i
|
|
|
- class="l-flex__none o-icon o-icon--hover el-icon-arrow-left u-bold u-pointer"
|
|
|
- @click="fileDir = null"
|
|
|
- />
|
|
|
- <div class="l-flex__fill u-ellipsis u-bold">{{ fileDir.name }}</div>
|
|
|
+ <div class="l-flex__fill l-flex--row u-height">
|
|
|
+ <i
|
|
|
+ class="l-flex__none o-icon o-icon--hover el-icon-arrow-left u-bold u-pointer"
|
|
|
+ @click="fileDir = null"
|
|
|
+ />
|
|
|
+ <div class="l-flex__fill u-ellipsis u-bold">{{ fileDir.name }}</div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</template>
|
|
|
<grid-table-item v-slot="item">
|
|
|
@@ -61,23 +63,25 @@
|
|
|
</grid-table-item>
|
|
|
<div
|
|
|
v-if="isDir"
|
|
|
- class="l-flex__self l-grid u-overflow-y--auto"
|
|
|
+ class="l-flex__auto c-sibling-item--v u-overflow-y--auto"
|
|
|
>
|
|
|
- <media-card
|
|
|
- v-for="file in fileDir.files"
|
|
|
- :key="file.keyName"
|
|
|
- :asset="asset"
|
|
|
- @click="onToggleAsset"
|
|
|
- >
|
|
|
- <el-checkbox
|
|
|
- v-model="file.selected"
|
|
|
- class="o-card__checkbox"
|
|
|
- />
|
|
|
- <i
|
|
|
- class="o-card__play el-icon-video-play has-active"
|
|
|
- @click.stop="onViewAsset(file)"
|
|
|
- />
|
|
|
- </media-card>
|
|
|
+ <div class="l-flex__none l-grid large">
|
|
|
+ <media-card
|
|
|
+ v-for="file in fileDir.files"
|
|
|
+ :key="file.keyName"
|
|
|
+ :asset="file"
|
|
|
+ @click="onToggleAsset"
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ v-model="file.selected"
|
|
|
+ class="o-card__checkbox"
|
|
|
+ />
|
|
|
+ <i
|
|
|
+ class="o-card__play el-icon-video-play has-active"
|
|
|
+ @click.stop="onViewAsset(file)"
|
|
|
+ />
|
|
|
+ </media-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</grid-table>
|
|
|
<div class="l-flex__none l-flex--row c-transfer-area">
|
|
|
@@ -103,6 +107,7 @@
|
|
|
<el-input-number
|
|
|
v-model="duration"
|
|
|
class="c-sibling-item u-width--xs"
|
|
|
+ size="small"
|
|
|
title="上播时长(s)"
|
|
|
controls-position="right"
|
|
|
:min="1"
|
|
|
@@ -110,7 +115,7 @@
|
|
|
step-strictly
|
|
|
/>
|
|
|
<div
|
|
|
- class="c-sibling-item near o-button"
|
|
|
+ class="c-sibling-item near o-button o-button--sm"
|
|
|
@click="onSetImageDuration"
|
|
|
>
|
|
|
设置
|
|
|
@@ -150,7 +155,10 @@ import {
|
|
|
AssetType,
|
|
|
AssetTypeInfo
|
|
|
} from '@/constant'
|
|
|
-import { getAssetDuration } from '@/utils'
|
|
|
+import {
|
|
|
+ parseDuration,
|
|
|
+ getAssetDuration
|
|
|
+} from '@/utils'
|
|
|
import { getAssetsByQuery } from '@/api/asset'
|
|
|
import Draggable from 'vuedraggable'
|
|
|
|
|
|
@@ -199,8 +207,8 @@ export default {
|
|
|
condition: {
|
|
|
pageSize: 18,
|
|
|
status: State.AVAILABLE,
|
|
|
- tag: AssetTag.AD,
|
|
|
- type: this.types[0]
|
|
|
+ tag: '',
|
|
|
+ type: this.types.length > 1 ? '' : this.types[0]
|
|
|
},
|
|
|
filters: [
|
|
|
{ key: 'tag', type: 'select', options: [
|
|
|
@@ -208,7 +216,7 @@ export default {
|
|
|
{ value: AssetTag.PUBLICITY, label: AssetTagInfo[AssetTag.PUBLICITY] },
|
|
|
{ value: AssetTag.LOCAL_PUBLICITY, label: AssetTagInfo[AssetTag.LOCAL_PUBLICITY] },
|
|
|
{ value: AssetTag.SHIM, label: AssetTagInfo[AssetTag.SHIM] }
|
|
|
- ] },
|
|
|
+ ], placeholder: '资源分类' },
|
|
|
this.types.length > 1
|
|
|
? {
|
|
|
key: 'type', type: 'select', options: this.types.map(type => {
|
|
|
@@ -216,7 +224,7 @@ export default {
|
|
|
value: type,
|
|
|
label: AssetTypeInfo[type]
|
|
|
}
|
|
|
- })
|
|
|
+ }), placeholder: '资源类型'
|
|
|
}
|
|
|
: null,
|
|
|
{ key: 'originalName', type: 'search', placeholder: '资源名称' }
|
|
|
@@ -234,7 +242,10 @@ export default {
|
|
|
},
|
|
|
statistics () {
|
|
|
const length = this.assets.length
|
|
|
- return `共${length}条,总时长${this.assets.reduce((total, { duration }) => total + duration, 0)}秒`
|
|
|
+ return `共${length}条,总时长 ${parseDuration(this.assets.reduce((total, { duration }) => total + duration, 0), false)}`
|
|
|
+ },
|
|
|
+ mediaTypes () {
|
|
|
+ return this.types.filter(type => type !== AssetType.STREAMING_MEDIA)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -270,9 +281,13 @@ export default {
|
|
|
this.$refs.table?.pageTo(1)
|
|
|
},
|
|
|
getAssetsByQuery (params) {
|
|
|
- if (params.type === AssetType.STREAMING_MEDIA) {
|
|
|
+ const { type, ...options } = params
|
|
|
+ if (type === AssetType.STREAMING_MEDIA) {
|
|
|
this.isStream = true
|
|
|
- return getAssetsByQuery(params)
|
|
|
+ return getAssetsByQuery({
|
|
|
+ ...options,
|
|
|
+ type
|
|
|
+ })
|
|
|
}
|
|
|
this.isStream = false
|
|
|
if (!this.directoryOption) {
|
|
|
@@ -280,10 +295,11 @@ export default {
|
|
|
}
|
|
|
const { root, id, group: { path } } = this.directoryOption
|
|
|
return getAssetsByQuery({
|
|
|
- ...params,
|
|
|
+ ...options,
|
|
|
...(root
|
|
|
? { org: path }
|
|
|
- : { treeId: id, queryRelation: '1' })
|
|
|
+ : { treeId: id, queryRelation: '1' }),
|
|
|
+ typeList: type ? [type] : [...this.mediaTypes]
|
|
|
})
|
|
|
},
|
|
|
transformAsset ({ tag, type, originalName, keyName, duration, size, md5, file, diff }) {
|