|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<c-dialog
|
|
|
ref="dialog"
|
|
|
- size="medium"
|
|
|
+ size="medium fixed"
|
|
|
:title="title"
|
|
|
>
|
|
|
<template #default>
|
|
|
@@ -21,7 +21,6 @@
|
|
|
ref="table"
|
|
|
:schema="assetSchema"
|
|
|
/>
|
|
|
- <preview-dialog ref="previewDialog" />
|
|
|
<radio-table-dialog
|
|
|
ref="datasetDialog"
|
|
|
title="填充素材包"
|
|
|
@@ -30,6 +29,13 @@
|
|
|
append-to-body
|
|
|
@confirm="onBindDataset"
|
|
|
/>
|
|
|
+ <table-dialog
|
|
|
+ ref="contentDialog"
|
|
|
+ :title="contentDialogTitle"
|
|
|
+ :schema="contentSchema"
|
|
|
+ append-to-body
|
|
|
+ />
|
|
|
+ <preview-dialog ref="previewDialog" />
|
|
|
</template>
|
|
|
</c-dialog>
|
|
|
</template>
|
|
|
@@ -47,7 +53,8 @@ import {
|
|
|
getDatasetByDevice,
|
|
|
bindDatasetToDevice,
|
|
|
getDatasets,
|
|
|
- unbindDatasetByDevice
|
|
|
+ unbindDatasetByDevice,
|
|
|
+ getDataset
|
|
|
} from '../api'
|
|
|
|
|
|
export default {
|
|
|
@@ -57,18 +64,19 @@ export default {
|
|
|
isUnbound: false,
|
|
|
title: '绑定填充素材包',
|
|
|
assetSchema: {
|
|
|
+ singlePage: true,
|
|
|
+ list: this.getAssetsByDataset,
|
|
|
+ transform: this.transformDatasetAsset,
|
|
|
buttons: [
|
|
|
{ label: '重新绑定', on: this.onBind },
|
|
|
{ label: '解绑', on: this.onUnbind }
|
|
|
],
|
|
|
- list: this.getAssetsByDataset,
|
|
|
- transform: this.transformDatasetAsset,
|
|
|
cols: [
|
|
|
{ prop: 'tagInfo', label: '类型', align: 'center', width: 80 },
|
|
|
{ prop: 'typeName', label: '文件', align: 'center', width: 80 },
|
|
|
{ prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
|
|
|
{ prop: 'name', label: '' },
|
|
|
- { prop: 'duration', label: '上播时长', 'align': 'center' },
|
|
|
+ { prop: 'duration', label: '上播时长', width: 100, 'align': 'center' },
|
|
|
{ type: 'invoke', render: [
|
|
|
{ label: '查看', on: this.onViewAsset }
|
|
|
] }
|
|
|
@@ -77,9 +85,33 @@ export default {
|
|
|
schema: {
|
|
|
list: this.getDatasets,
|
|
|
cols: [
|
|
|
- { prop: 'name', label: '名称', 'align': 'center' }
|
|
|
+ { prop: 'name', label: '名称', 'align': 'center' },
|
|
|
+ { type: 'invoke', render: [
|
|
|
+ { label: '查看', on: this.onViewDataset }
|
|
|
+ ] }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ contentSchema: {
|
|
|
+ singlePage: true,
|
|
|
+ list: this.getAssets,
|
|
|
+ transform: this.transformDatasetAsset,
|
|
|
+ cols: [
|
|
|
+ { prop: 'tagInfo', label: '类型', align: 'center', width: 80 },
|
|
|
+ { prop: 'typeName', label: '文件', align: 'center', width: 80 },
|
|
|
+ { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
|
|
|
+ { prop: 'name', label: '' },
|
|
|
+ { prop: 'duration', label: '上播时长', 'align': 'center', width: 100 },
|
|
|
+ { type: 'invoke', render: [
|
|
|
+ { label: '查看', on: this.onViewAsset }
|
|
|
+ ] }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ datasetName: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ contentDialogTitle () {
|
|
|
+ return `${this.datasetName}的上播内容`
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -157,6 +189,23 @@ export default {
|
|
|
unbindDatasetByDevice({ id: this.$deviceId }).then(() => {
|
|
|
this.setDataset(null)
|
|
|
})
|
|
|
+ },
|
|
|
+ onViewDataset ({ id, name }) {
|
|
|
+ this.datasetName = name
|
|
|
+ this.$datasetId = id
|
|
|
+ this.$datasetAssets = null
|
|
|
+ this.$refs.contentDialog.show()
|
|
|
+ },
|
|
|
+ getAssets () {
|
|
|
+ if (this.$datasetAssets) {
|
|
|
+ return Promise.resolve({ data: this.$datasetAssets })
|
|
|
+ }
|
|
|
+ return getDataset(this.$datasetId).then(({ data: { mediaList } }) => {
|
|
|
+ this.$datasetAssets = mediaList
|
|
|
+ return {
|
|
|
+ data: mediaList
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|