|
|
@@ -52,27 +52,29 @@ export default {
|
|
|
schema () {
|
|
|
return {
|
|
|
props: {
|
|
|
- 'row-class-name': 'u-pointer'
|
|
|
+ 'row-class-name': 'u-pointer',
|
|
|
+ size: 'small'
|
|
|
},
|
|
|
listeners: {
|
|
|
'row-click': this.onToggleSelection,
|
|
|
'selection-change': this.onSelectionChange
|
|
|
},
|
|
|
+ autoRefreshEachPage: true,
|
|
|
+ refreshInterval: 30000,
|
|
|
list: this.getAssetsByQuery,
|
|
|
transform: this.transformAsset,
|
|
|
- condition: { type: AssetType.IMAGE },
|
|
|
buttons: [
|
|
|
{ type: 'add', label: '上传', on: this.onUpload },
|
|
|
{ type: 'del', on: this.onBatchDel }
|
|
|
],
|
|
|
filters: [
|
|
|
- { key: 'tag', type: 'select', placeholder: '类型', options: [
|
|
|
+ { key: 'tag', type: 'select', placeholder: '资源分类', options: [
|
|
|
{ value: AssetTag.AD, label: AssetTagInfo[AssetTag.AD] },
|
|
|
{ value: AssetTag.PUBLICITY, label: AssetTagInfo[AssetTag.PUBLICITY] },
|
|
|
{ value: AssetTag.LOCAL_PUBLICITY, label: AssetTagInfo[AssetTag.LOCAL_PUBLICITY] },
|
|
|
{ value: AssetTag.SHIM, label: AssetTagInfo[AssetTag.SHIM] }
|
|
|
] },
|
|
|
- { key: 'type', type: 'select', options: [
|
|
|
+ { key: 'type', type: 'select', placeholder: '资源类型', options: [
|
|
|
{ value: AssetType.IMAGE, label: AssetTypeInfo[AssetType.IMAGE] },
|
|
|
{ value: AssetType.VIDEO, label: AssetTypeInfo[AssetType.VIDEO] },
|
|
|
{ value: AssetType.AUDIO, label: AssetTypeInfo[AssetType.AUDIO] },
|
|
|
@@ -80,27 +82,30 @@ export default {
|
|
|
{ value: AssetType.PDF, label: AssetTypeInfo[AssetType.PDF] },
|
|
|
{ value: AssetType.DOC, label: AssetTypeInfo[AssetType.DOC] }
|
|
|
] },
|
|
|
- { key: 'originalName', type: 'search', placeholder: '资源名称' }
|
|
|
+ { key: 'originalName', type: 'search', placeholder: '资源名称' },
|
|
|
+ { type: 'refresh' }
|
|
|
],
|
|
|
cols: [
|
|
|
- { type: 'selection', selectable: this.canDel },
|
|
|
- { prop: 'tagInfo', type: 'refresh', width: 80 },
|
|
|
- { prop: 'file', label: '资源', type: 'asset', on: this.onView },
|
|
|
+ { type: 'selection', selectable: this.canDel, fixed: true },
|
|
|
+ { prop: 'tagInfo', label: '分类', width: 72, 'align': 'center', fixed: true },
|
|
|
+ { prop: 'typeInfo', label: '资源', width: 72, 'align': 'center', fixed: true },
|
|
|
+ { prop: 'file', label: '', type: 'asset', on: this.onView, fixed: true },
|
|
|
{ render: (data, h) => h('edit-input', {
|
|
|
props: {
|
|
|
value: `${data.originalName}`
|
|
|
},
|
|
|
on: { edit: val => this.onEdit(data, val) }
|
|
|
- }), 'class-name': 'c-edit-column', 'min-width': 120 },
|
|
|
+ }), 'class-name': 'c-edit-column', 'min-width': 120, fixed: true },
|
|
|
{ prop: 'ai', label: 'AI审核', type: 'tag' },
|
|
|
// { prop: 'statusTag', type: 'tag' },
|
|
|
{ prop: 'size', label: '资源大小', 'align': 'right' },
|
|
|
{ prop: 'diff', label: '其他', 'align': 'right' },
|
|
|
{ prop: 'userName', label: '上传人', 'align': 'right' },
|
|
|
+ { prop: 'createTime', label: '上传时间', width: 140, 'align': 'right' },
|
|
|
{ type: 'invoke', render: [
|
|
|
{ label: '查看', allow: ({ file }) => !!file, on: this.onView },
|
|
|
{ label: '删除', allow: this.canDel, on: this.onDel }
|
|
|
- ], width: 100 }
|
|
|
+ ], width: 100, fixed: 'right' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
@@ -138,6 +143,7 @@ export default {
|
|
|
},
|
|
|
transformAsset (asset) {
|
|
|
asset.tagInfo = AssetTagInfo[asset.tag]
|
|
|
+ asset.typeInfo = AssetTypeInfo[asset.type]
|
|
|
asset.size = parseByte(asset.size)
|
|
|
asset.ai = getAIState(asset)
|
|
|
// asset.statusTag = this.getStatusTag(asset)
|