|
|
@@ -20,7 +20,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { SCREEN_TIME_KEY } from '@/constant'
|
|
|
+import {
|
|
|
+ SCREEN_TIME_KEY,
|
|
|
+ AppletOrderType,
|
|
|
+ AppletOrderKeyMap,
|
|
|
+ AppletOrderAssetKeyMap
|
|
|
+} from '@/constant'
|
|
|
import { transformOrderAssetToAsset } from '@/utils'
|
|
|
import { getOrders } from '../api'
|
|
|
|
|
|
@@ -42,6 +47,7 @@ export default {
|
|
|
],
|
|
|
cols: [
|
|
|
{ prop: 'statusTag', type: 'tag', 'align': 'center' },
|
|
|
+ { label: '类型', render: ({ type }) => ['', '套餐', '即刻', '插入'][type], width: 80, align: 'center' },
|
|
|
{ prop: 'startDate', label: '上刊日期', width: 100 },
|
|
|
{ prop: 'range', label: '时段', width: 140 },
|
|
|
{ prop: 'deviceName', label: '设备' },
|
|
|
@@ -61,8 +67,8 @@ export default {
|
|
|
cols: [
|
|
|
{ prop: 'typeInfo', label: '资源', width: 100, align: 'center' },
|
|
|
{ prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
|
|
|
- { prop: 'ratio', label: '分辨率' },
|
|
|
{ prop: 'adDuration', label: '上播时长', align: 'center' },
|
|
|
+ { prop: 'ratio', label: '分辨率', align: 'right' },
|
|
|
{ prop: 'statusTag', type: 'tag' },
|
|
|
{ type: 'invoke', render: [
|
|
|
{ label: '查看', allow: ({ file }) => !!file, on: this.onViewAsset }
|
|
|
@@ -72,10 +78,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- transformOrder ({ id, price, status, expand, orders, assets, phoneNumber, createTime, auditTime }) {
|
|
|
+ getInfo (type, orders, assets) {
|
|
|
+ const { startDate, startTime, endTime, day, duration, count } = orders[0]
|
|
|
+ switch (type) {
|
|
|
+ case AppletOrderType.PACKAGE:
|
|
|
+ return {
|
|
|
+ startDate,
|
|
|
+ range: startTime === SCREEN_TIME_KEY && endTime === SCREEN_TIME_KEY ? '开机期间' : `${startTime}-${endTime}`,
|
|
|
+ freq: `${day}天 x ${duration}秒 x ${count}次`
|
|
|
+ }
|
|
|
+ case AppletOrderType.SOON:
|
|
|
+ return {
|
|
|
+ freq: `${assets.reduce((total, { adDuration }) => total + adDuration, 0)}秒`
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ return null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ transformOrder (order) {
|
|
|
+ const { id, type, price, status, expand, phoneNumber, createTime, auditTime } = order
|
|
|
+ const orders = order[AppletOrderKeyMap[type]]
|
|
|
+ const assets = order[AppletOrderAssetKeyMap[type]]
|
|
|
if (!orders.length) {
|
|
|
return {
|
|
|
id,
|
|
|
+ type,
|
|
|
statusTag: this.getOrderTag(status, expand),
|
|
|
startDate: '异常数据',
|
|
|
price: (price / 100).toFixed(2),
|
|
|
@@ -85,14 +112,11 @@ export default {
|
|
|
assets
|
|
|
}
|
|
|
}
|
|
|
- const { name, startDate, startTime, endTime, day, duration, count } = orders[0]
|
|
|
return {
|
|
|
+ ...this.getInfo(type, orders, assets),
|
|
|
id,
|
|
|
- deviceName: name,
|
|
|
+ type,
|
|
|
statusTag: this.getOrderTag(status, expand),
|
|
|
- startDate,
|
|
|
- range: startTime === SCREEN_TIME_KEY && endTime === SCREEN_TIME_KEY ? '开机期间' : `${startTime}-${endTime}`,
|
|
|
- freq: `${day}天 x ${duration}秒 x ${count}次`,
|
|
|
price: (price / 100).toFixed(2),
|
|
|
phoneNumber,
|
|
|
createTime,
|