|
|
@@ -11,7 +11,7 @@
|
|
|
/>
|
|
|
<c-dialog
|
|
|
ref="assetDialog"
|
|
|
- title="Broadcast content"
|
|
|
+ title="上播内容"
|
|
|
size="xl fixed"
|
|
|
@closed="onClosed"
|
|
|
>
|
|
|
@@ -29,13 +29,15 @@
|
|
|
@change="onAssetDirectoryChanged"
|
|
|
/>
|
|
|
</template>
|
|
|
- <div class="l-flex__none l-flex--row right c-sibling-item--v">
|
|
|
+ <div
|
|
|
+ class="l-flex__none l-flex--row right c-sibling-item--v"
|
|
|
+ >
|
|
|
<div class="l-flex__fill c-sibling-item">
|
|
|
<div
|
|
|
class="o-button"
|
|
|
@click="onDelAssets"
|
|
|
>
|
|
|
- Remove
|
|
|
+ 移除
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="l-flex__none l-flex--row right c-sibling-item--v near u-font-size--sm u-color-black u-bold">
|
|
|
@@ -79,15 +81,15 @@
|
|
|
</c-dialog>
|
|
|
<table-dialog
|
|
|
ref="deviceDialog"
|
|
|
- title="Associated Devices"
|
|
|
+ title="关联的设备"
|
|
|
:schema="deviceSchema"
|
|
|
@row-click="onRowClick"
|
|
|
@selection-change="onSelectionChange"
|
|
|
/>
|
|
|
<radio-table-dialog
|
|
|
ref="devicesDialog"
|
|
|
- title="Bind device"
|
|
|
- message="Please select device"
|
|
|
+ title="绑定设备"
|
|
|
+ message="请选择设备"
|
|
|
:schema="devicesSchema"
|
|
|
append-to-body
|
|
|
@confirm="onChoosenDevice"
|
|
|
@@ -139,31 +141,25 @@ export default {
|
|
|
{ type: 'add', on: this.onAdd }
|
|
|
],
|
|
|
filters: [
|
|
|
- {
|
|
|
- key: 'name', type: 'search', placeholder: 'Name'
|
|
|
- },
|
|
|
+ { key: 'name', type: 'search', placeholder: '名称' },
|
|
|
{ type: 'refresh' }
|
|
|
],
|
|
|
cols: [
|
|
|
{ type: 'refresh' },
|
|
|
- {
|
|
|
- prop: 'name', label: 'Name', render: (data, h) => h('edit-input', {
|
|
|
- props: {
|
|
|
- value: `${data.name}`
|
|
|
- },
|
|
|
- on: { edit: val => this.onEditName(data, val) }
|
|
|
- }), 'class-name': 'c-edit-column'
|
|
|
- },
|
|
|
- { prop: 'createTime', label: 'Create time', width: 200 },
|
|
|
- { prop: 'updateTime', label: 'Update Time', width: 200 },
|
|
|
- {
|
|
|
- type: 'invoke', render: [
|
|
|
- { label: 'Broadcast content', on: this.onEdit },
|
|
|
- { label: 'Associated Devices', on: this.onViewDevices },
|
|
|
- { label: 'Copy', on: this.onCopy },
|
|
|
- { label: 'Delete', on: this.onDel }
|
|
|
- ], width: 240
|
|
|
- }
|
|
|
+ { prop: 'name', label: '名称', render: (data, h) => h('edit-input', {
|
|
|
+ props: {
|
|
|
+ value: `${data.name}`
|
|
|
+ },
|
|
|
+ on: { edit: val => this.onEditName(data, val) }
|
|
|
+ }), 'class-name': 'c-edit-column' },
|
|
|
+ { prop: 'createTime', label: '创建时间', width: 200 },
|
|
|
+ { prop: 'updateTime', label: '更新时间', width: 200 },
|
|
|
+ { type: 'invoke', render: [
|
|
|
+ { label: '上播内容', on: this.onEdit },
|
|
|
+ { label: '关联设备', on: this.onViewDevices },
|
|
|
+ { label: '复制', on: this.onCopy },
|
|
|
+ { label: '删除', on: this.onDel }
|
|
|
+ ], width: 240 }
|
|
|
]
|
|
|
},
|
|
|
assetSchema: {
|
|
|
@@ -176,52 +172,48 @@ export default {
|
|
|
transform: transformDatasetAssetToAsset,
|
|
|
cols: [
|
|
|
{ type: 'selection' },
|
|
|
- { prop: 'tagInfo', label: 'Category', width: 72, align: 'center' },
|
|
|
- { prop: 'typeInfo', label: 'Resources', width: 72, align: 'center' },
|
|
|
+ { prop: 'tagInfo', label: '分类', width: 72, align: 'center' },
|
|
|
+ { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
|
|
|
{ prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
|
|
|
{ prop: 'name', label: '' },
|
|
|
- {
|
|
|
- label: 'Broadcast Duration(s)', render: (data, h) => data.minioData && data.type === AssetType.IMAGE
|
|
|
- ? h('edit-input', {
|
|
|
- staticClass: 'border',
|
|
|
- props: {
|
|
|
- value: `${data.adDuration}`,
|
|
|
- align: 'center',
|
|
|
- size: 'sm'
|
|
|
- },
|
|
|
- on: {
|
|
|
- edit: val => this.onEditAssetDuration(data, val)
|
|
|
- }
|
|
|
- })
|
|
|
- : parseDuration(data.adDuration), width: 100, align: 'center'
|
|
|
- }
|
|
|
+ { label: '上播时长(s)', render: (data, h) => data.minioData && data.type === AssetType.IMAGE
|
|
|
+ ? h('edit-input', {
|
|
|
+ staticClass: 'border',
|
|
|
+ props: {
|
|
|
+ value: `${data.adDuration}`,
|
|
|
+ align: 'center',
|
|
|
+ size: 'sm'
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ edit: val => this.onEditAssetDuration(data, val)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ : parseDuration(data.adDuration), width: 100, align: 'center' }
|
|
|
]
|
|
|
},
|
|
|
deviceSchema: {
|
|
|
list: getDevicesByDataset,
|
|
|
buttons: [
|
|
|
- { type: 'add', label: 'Bind device', on: this.onBindDevice },
|
|
|
- { icon: 'el-icon-scissors', label: 'Unbind', on: this.onUnbindDevices }
|
|
|
+ { type: 'add', label: '绑定设备', on: this.onBindDevice },
|
|
|
+ { icon: 'el-icon-scissors', label: '解绑', on: this.onUnbindDevices }
|
|
|
],
|
|
|
cols: [
|
|
|
{ type: 'selection' },
|
|
|
- { prop: 'name', label: 'Device Name' },
|
|
|
- { prop: 'address', label: 'Address' },
|
|
|
- {
|
|
|
- type: 'invoke', render: [
|
|
|
- { label: 'Unbind', on: this.onUnbind }
|
|
|
- ]
|
|
|
- }
|
|
|
+ { prop: 'name', label: '设备名称' },
|
|
|
+ { prop: 'address', label: '地址' },
|
|
|
+ { type: 'invoke', render: [
|
|
|
+ { label: '解绑', on: this.onUnbind }
|
|
|
+ ] }
|
|
|
]
|
|
|
},
|
|
|
devicesSchema: {
|
|
|
list: getDevices,
|
|
|
filters: [
|
|
|
- { key: 'name', type: 'search', placeholder: 'Device Name' }
|
|
|
+ { key: 'name', type: 'search', placeholder: '设备名称' }
|
|
|
],
|
|
|
cols: [
|
|
|
- { prop: 'name', label: 'Device Name' },
|
|
|
- { prop: 'address', label: 'Address' }
|
|
|
+ { prop: 'name', label: '设备名称' },
|
|
|
+ { prop: 'address', label: '地址' }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
@@ -229,15 +221,15 @@ export default {
|
|
|
computed: {
|
|
|
statistics () {
|
|
|
const length = this.assets.length
|
|
|
- return `total ${length},total duration ${parseDuration(this.assets.reduce((total, asset) => total + asset.adDuration, 0), false)}`
|
|
|
+ return `共${length}条,总时长 ${parseDuration(this.assets.reduce((total, asset) => total + asset.adDuration, 0), false)}`
|
|
|
},
|
|
|
resourceSize () {
|
|
|
const totalSizeMB = this.assets.reduce((total, item) => total + parseInt(item.minioData.size), 0) / (1024 * 1024)
|
|
|
if (totalSizeMB >= 1024) {
|
|
|
const totalSizeGB = totalSizeMB / 1024
|
|
|
- return `Resource Pack Size: ${totalSizeGB.toFixed(2)} GB`
|
|
|
+ return `资源包大小: ${totalSizeGB.toFixed(2)} GB`
|
|
|
}
|
|
|
- return `Resource Pack Size: ${totalSizeMB.toFixed(2)} MB`
|
|
|
+ return `资源包大小: ${totalSizeMB.toFixed(2)} MB`
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -256,21 +248,21 @@ export default {
|
|
|
},
|
|
|
onAdd () {
|
|
|
this.$prompt(
|
|
|
- '<p class="u-color--black u-font-size--sm u-bold">Pack Name</p>',
|
|
|
- 'Add Pack',
|
|
|
+ '<p class="u-color--black u-font-size--sm u-bold">素材包名称</p>',
|
|
|
+ '新增填充素材包',
|
|
|
{
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
closeOnClickModal: false,
|
|
|
inputValue: '',
|
|
|
- inputPlaceholder: 'Maximum 30 characters',
|
|
|
+ inputPlaceholder: '最多30个字符',
|
|
|
inputPattern: /^.{0,30}$/,
|
|
|
inputValidator: val => {
|
|
|
const name = val ? val.replace(/^\s+|\s+$/g, '') : val
|
|
|
- return name ? true : 'Please fill in the name'
|
|
|
+ return name ? true : '请填写名称'
|
|
|
},
|
|
|
- inputErrorMessage: 'Maximum 30 characters',
|
|
|
- confirmButtonText: 'Add',
|
|
|
- cancelButtonText: 'Cancel',
|
|
|
+ inputErrorMessage: '最多30个字符',
|
|
|
+ confirmButtonText: '新增',
|
|
|
+ cancelButtonText: '取消',
|
|
|
beforeClose: (action, instance, done) => {
|
|
|
if (action === 'confirm') {
|
|
|
this.onSave(instance.inputValue.replace(/^\s+|\s+$/g, ''), done)
|
|
|
@@ -298,7 +290,7 @@ export default {
|
|
|
if (!newVal) {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
- message: 'Please fill in the package name'
|
|
|
+ message: '请填写素材包名称'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
@@ -385,15 +377,15 @@ export default {
|
|
|
onDelAssets () {
|
|
|
if (this.$selectionItems?.length) {
|
|
|
this.$confirm(
|
|
|
- 'Remove the selected resource?',
|
|
|
- 'Confirm operation',
|
|
|
+ '移除所选资源?',
|
|
|
+ '操作确认',
|
|
|
{ type: 'warning' }
|
|
|
).then(() => unbindAssetsFromDataset(this.$datasetId, this.$selectionItems.map(({ keyName }) => keyName)))
|
|
|
.then(this.onAssetChanged)
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
- message: 'Please select the resources to be removed'
|
|
|
+ message: '请选择需移除的资源'
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -424,7 +416,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
- message: 'Please select the device to be unbundled first'
|
|
|
+ message: '请先选择需要解绑的设备'
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -448,25 +440,25 @@ export default {
|
|
|
},
|
|
|
onCopy ({ id, name }) {
|
|
|
this.$prompt(
|
|
|
- '<p class="u-color--black u-font-size--sm u-bold">Pack Name</p>',
|
|
|
- 'Copy Pack',
|
|
|
+ '<p class="u-color--black u-font-size--sm u-bold">素材包名称</p>',
|
|
|
+ '复制素材包',
|
|
|
{
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
closeOnClickModal: false,
|
|
|
- inputValue: name.length <= 28 ? `${name}Copy` : name,
|
|
|
- inputPlaceholder: 'Maximum 30 characters',
|
|
|
+ inputValue: name.length <= 28 ? `${name}副本` : name,
|
|
|
+ inputPlaceholder: '最多30个字符',
|
|
|
inputPattern: /^.{0,30}$/,
|
|
|
inputValidator: val => {
|
|
|
const inputName = val ? val.replace(/^\s+|\s+$/g, '') : val
|
|
|
return inputName
|
|
|
? inputName === name
|
|
|
- ? 'The name cannot be the same as the source pack'
|
|
|
+ ? '名称不能与源素材包一样'
|
|
|
: true
|
|
|
- : 'Please fill in the name'
|
|
|
+ : '请填写名称'
|
|
|
},
|
|
|
- inputErrorMessage: 'Maximum 30 characters',
|
|
|
- confirmButtonText: 'Copy',
|
|
|
- cancelButtonText: 'Cancel',
|
|
|
+ inputErrorMessage: '最多30个字符',
|
|
|
+ confirmButtonText: '复制',
|
|
|
+ cancelButtonText: '取消',
|
|
|
beforeClose: (action, instance, done) => {
|
|
|
if (action === 'confirm') {
|
|
|
this.onConfirmCopy(id, instance.inputValue.replace(/^\s+|\s+$/g, ''), done)
|