|
|
@@ -43,7 +43,7 @@
|
|
|
</confirm-dialog>
|
|
|
<table-dialog
|
|
|
ref="adDialog"
|
|
|
- title="广告内容"
|
|
|
+ title="上播内容"
|
|
|
:schema="adSchema"
|
|
|
/>
|
|
|
<preview-dialog ref="previewDialog" />
|
|
|
@@ -56,10 +56,7 @@ import {
|
|
|
AssetType,
|
|
|
AssetTypeInfo
|
|
|
} from '@/constant'
|
|
|
-import {
|
|
|
- parseByte,
|
|
|
- parseDuration
|
|
|
-} from '@/utils'
|
|
|
+import { parseDuration } from '@/utils'
|
|
|
import {
|
|
|
getOrders,
|
|
|
resolveOrder,
|
|
|
@@ -82,8 +79,8 @@ export default {
|
|
|
{ prop: 'freq', label: '频率', align: 'right', 'min-width': 140 },
|
|
|
{ prop: 'price', label: '总价(元)', 'min-width': 100, align: 'right' },
|
|
|
{ prop: 'createTime', label: '提交时间', 'min-width': 140, align: 'right' },
|
|
|
- { type: 'invoke', width: 160, render: [
|
|
|
- { label: '内容', on: this.onView },
|
|
|
+ { type: 'invoke', width: 180, render: [
|
|
|
+ { label: '上播内容', on: this.onView },
|
|
|
{ label: '通过', on: this.onResolve },
|
|
|
{ label: '拒绝', on: this.onReject }
|
|
|
] }
|
|
|
@@ -99,17 +96,15 @@ export default {
|
|
|
reason: ''
|
|
|
},
|
|
|
adSchema: {
|
|
|
- list: this.getSources,
|
|
|
+ list: this.getOrderAssets,
|
|
|
cols: [
|
|
|
- { prop: 'file', label: '缩略图', type: 'asset', on: this.onViewAsset },
|
|
|
- { prop: 'fileType', label: '文件类型', align: 'center' },
|
|
|
- { prop: 'adDuration', label: '播放时长', align: 'right' },
|
|
|
- { prop: 'size', label: '文件大小', align: 'right' },
|
|
|
+ { prop: 'fileType', label: '文件', width: 100, align: 'center' },
|
|
|
+ { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
|
|
|
+ { prop: 'adDuration', label: '上播时长', align: 'center' },
|
|
|
{ prop: 'ratio', label: '分辨率', align: 'right' },
|
|
|
- { prop: 'remark', label: '其他', align: 'right' },
|
|
|
- { prop: 'statusTag', type: 'tag', align: 'center', width: 120 },
|
|
|
- { type: 'invoke', width: 80, render: [
|
|
|
- { label: '查看', render ({ file }) { return !!file }, on: this.onViewSource }
|
|
|
+ { prop: 'statusTag', type: 'tag', width: 120, align: 'center' },
|
|
|
+ { type: 'invoke', render: [
|
|
|
+ { label: '查看', render ({ file }) { return !!file }, on: this.onViewAssetItem }
|
|
|
] }
|
|
|
]
|
|
|
}
|
|
|
@@ -161,28 +156,26 @@ export default {
|
|
|
this.$refs.table.decrease(1)
|
|
|
})
|
|
|
},
|
|
|
- getSources () {
|
|
|
- const sources = this.$order.assets
|
|
|
+ getOrderAssets () {
|
|
|
+ const assets = this.$order.assets
|
|
|
return Promise.resolve({
|
|
|
- data: sources.map(this.transformSource),
|
|
|
- totalCount: sources.length
|
|
|
+ data: assets.map(this.transformOrderAsset),
|
|
|
+ totalCount: assets.length
|
|
|
})
|
|
|
},
|
|
|
- transformSource ({ keyName, type, adDuration, duration, size, width, height, thumb, status, reason }) {
|
|
|
+ transformOrderAsset ({ keyName, type, adDuration, width, height, thumb, status, reason }) {
|
|
|
const isImage = type === AssetType.IMAGE
|
|
|
return type
|
|
|
? {
|
|
|
+ fileType: AssetTypeInfo[type],
|
|
|
file: {
|
|
|
type,
|
|
|
url: keyName,
|
|
|
thumbnail: isImage ? keyName : thumb || null,
|
|
|
origin: !isImage
|
|
|
},
|
|
|
- fileType: AssetTypeInfo[type],
|
|
|
- adDuration: parseDuration(adDuration || duration),
|
|
|
+ adDuration: parseDuration(adDuration),
|
|
|
ratio: width && height ? `${width}x${height}` : '-',
|
|
|
- size: parseByte(size),
|
|
|
- remark: duration ? parseDuration(duration) : '-',
|
|
|
status,
|
|
|
statusTag: {
|
|
|
type: ['', 'primay', 'success', 'danger'][status],
|
|
|
@@ -191,15 +184,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
: {
|
|
|
- fileType: '-',
|
|
|
- adDuration: parseDuration(adDuration || duration),
|
|
|
- ratio: '-',
|
|
|
- size: '-',
|
|
|
- remark: '素材已删除',
|
|
|
- status
|
|
|
+ fileType: '素材已删除',
|
|
|
+ adDuration: parseDuration(adDuration)
|
|
|
}
|
|
|
},
|
|
|
- onViewSource ({ file }) {
|
|
|
+ onViewAssetItem ({ file }) {
|
|
|
this.onViewAsset(file)
|
|
|
},
|
|
|
onViewAsset (asset) {
|