|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="vsummary">
|
|
|
<div class="xiangmuxuanze" >
|
|
|
- <span>项目选择:</span>
|
|
|
- <Treeselect :appId.sync="appId" request="2,4" style="display: inline-block;position: relative;top: 10px;"/>
|
|
|
+ <span style="margin-top:">项目选择:</span>
|
|
|
+ <Treeselect :appId.sync="appId" request="2,4" style="display: inline-block;position: relative;"/>
|
|
|
</div>
|
|
|
<div class="timeDiv">
|
|
|
<div style='display:flex;align-items: center;'>
|
|
@@ -95,20 +95,31 @@
|
|
|
<!-- <a-button type='primary' class="export" @click="exportExcel">导出报表</a-button>
|
|
|
<a-button type='primary' class="add" @click="customColumns" >自定义列</a-button> -->
|
|
|
</div>
|
|
|
- <!-- <a-table
|
|
|
+ <a-table
|
|
|
size="middle"
|
|
|
:columns="columns"
|
|
|
- :dataSource="tableData"
|
|
|
+ :dataSource="data"
|
|
|
bordered
|
|
|
id="outTable"
|
|
|
- :pagination="false"
|
|
|
+ :pagination="ipagination"
|
|
|
:scroll="{ x: scrollX }"
|
|
|
:loading="loading"
|
|
|
ref="accountTable"
|
|
|
:width="tableWidth"
|
|
|
@change="sort"
|
|
|
style="word-break: break-all;font-size:16px;font-weight:600"
|
|
|
+ @customHeaderCell="customHeaderCell(columns)"
|
|
|
>
|
|
|
+
|
|
|
+ <div slot="videoU" slot-scope="test,records">
|
|
|
+ <img
|
|
|
+ :src="records.coverUrl"
|
|
|
+ alt
|
|
|
+ style="width:80px"
|
|
|
+ @click="openVideo(records.url)"
|
|
|
+ @load="loadShow"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
|
|
|
<span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
|
|
|
<span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
|
|
@@ -177,13 +188,18 @@
|
|
|
slot-scope="installFinishCost"
|
|
|
>{{ installFinishCost | decimalsHandle }}</span>
|
|
|
<span slot="convertCost" slot-scope="convertCost">{{ convertCost | decimalsHandle }}</span>
|
|
|
+ <span
|
|
|
+ slot="activeRegisterCost"
|
|
|
+ slot-scope="activeRegisterCost"
|
|
|
+ >{{ activeRegisterCost | decimalsHandle }}</span>
|
|
|
+
|
|
|
|
|
|
|
|
|
<span
|
|
|
slot="downloadStartRate"
|
|
|
slot-scope="downloadStartRate"
|
|
|
>{{ downloadStartRate | toPercentage }}</span>
|
|
|
- <span
|
|
|
+ <!-- <span
|
|
|
slot="downloadFinishRate"
|
|
|
slot-scope="downloadFinishRate"
|
|
|
>{{ downloadFinishRate | toPercentage }}</span>
|
|
@@ -191,106 +207,19 @@
|
|
|
<span
|
|
|
slot="activeRegisterRate"
|
|
|
slot-scope="activeRegisterRate"
|
|
|
- >{{ activeRegisterRate | toPercentage }}</span>
|
|
|
+ >{{ activeRegisterRate | toPercentage }}</span> -->
|
|
|
<span
|
|
|
slot="gameAddictionRate"
|
|
|
slot-scope="gameAddictionRate"
|
|
|
>{{ gameAddictionRate | toPercentage }}</span>
|
|
|
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
|
|
|
-
|
|
|
-
|
|
|
- </a-table> -->
|
|
|
-
|
|
|
- <a-table
|
|
|
- size="middle"
|
|
|
- :columns="columns"
|
|
|
- :dataSource="data"
|
|
|
- bordered
|
|
|
- id="outTable"
|
|
|
- :pagination="ipagination"
|
|
|
- :scroll="{ x: scrollX }"
|
|
|
- :loading="loading"
|
|
|
- ref="vSummaryTable"
|
|
|
- :width="tableWidth"
|
|
|
- @customHeaderCell="customHeaderCell(columns)"
|
|
|
- @change="sort"
|
|
|
- style="word-break: break-all;"
|
|
|
- >
|
|
|
- <div slot="videoU" slot-scope="test,records">
|
|
|
- <img
|
|
|
- :src="records.coverUrl"
|
|
|
- alt
|
|
|
- style="width:80px"
|
|
|
- @click="openVideo(records.url)"
|
|
|
- @load="loadShow"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
|
|
|
- <span
|
|
|
- slot="play25FeedBreakRate"
|
|
|
- slot-scope="play25FeedBreakRate"
|
|
|
- >{{ play25FeedBreakRate | toPercentage }}</span>
|
|
|
- <span slot="playOverRate" slot-scope="playOverRate">{{ playOverRate | toPercentage }}</span>
|
|
|
- <!-- 新加数据 -->
|
|
|
- <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
|
|
|
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
|
|
|
- <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
|
|
|
- <span slot="cpc" slot-scope="cpc">{{ cpc | tofixed }}</span>
|
|
|
- <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
|
|
|
- <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
|
|
|
- <span
|
|
|
- slot="installFinishRate"
|
|
|
- slot-scope="installFinishRate"
|
|
|
- >{{ installFinishRate | toPercentage }}</span>
|
|
|
- <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | tofixed }}</span>
|
|
|
- <span slot="activePayCost" slot-scope="activePayCost">{{ activePayCost | tofixed }}</span>
|
|
|
- <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | tofixed }}</span>
|
|
|
- <span slot="validPlayCost" slot-scope="validPlayCost">{{ validPlayCost | tofixed }}</span>
|
|
|
- <span slot="activeCost" slot-scope="activeCost">{{ activeCost | tofixed }}</span>
|
|
|
- <span
|
|
|
- slot="gameAddictionCost"
|
|
|
- slot-scope="gameAddictionCost"
|
|
|
- >{{ gameAddictionCost | tofixed }}</span>
|
|
|
- <span
|
|
|
- slot="downloadFinishCost"
|
|
|
- slot-scope="downloadFinishCost"
|
|
|
- >{{ downloadFinishCost | tofixed }}</span>
|
|
|
- <span
|
|
|
- slot="downloadStartCost"
|
|
|
- slot-scope="downloadStartCost"
|
|
|
- >{{ downloadStartCost | tofixed }}</span>
|
|
|
- <span
|
|
|
- slot="installFinishCost"
|
|
|
- slot-scope="installFinishCost"
|
|
|
- >{{ installFinishCost | tofixed }}</span>
|
|
|
- <span slot="convertCost" slot-scope="convertCost">{{ convertCost | tofixed }}</span>
|
|
|
-
|
|
|
- <!-- -->
|
|
|
- <span
|
|
|
- slot="downloadStartRate"
|
|
|
- slot-scope="downloadStartRate"
|
|
|
- >{{ downloadStartRate | toPercentage }}</span>
|
|
|
- <span
|
|
|
- slot="downloadFinishRate"
|
|
|
- slot-scope="downloadFinishRate"
|
|
|
- >{{ downloadFinishRate | toPercentage }}</span>
|
|
|
- <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
|
|
|
- <span
|
|
|
- slot="activeRegisterRate"
|
|
|
- slot-scope="activeRegisterRate"
|
|
|
- >{{ activeRegisterRate | toPercentage }}</span>
|
|
|
- <span
|
|
|
- slot="gameAddictionRate"
|
|
|
- slot-scope="gameAddictionRate"
|
|
|
- >{{ gameAddictionRate | toPercentage }}</span>
|
|
|
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
|
|
|
- <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
|
|
|
- <span slot="statDatetime" slot-scope>{{ timedata[0]+'~'+timedata[1]}}</span>
|
|
|
+ <!-- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span> -->
|
|
|
<span slot="operation" slot-scope="text,record">
|
|
|
<a href="javascript:;" @click.stop="showRelevantPeople(record)">查看相关人员</a>
|
|
|
</span>
|
|
|
|
|
|
+
|
|
|
</a-table>
|
|
|
+
|
|
|
</div>
|
|
|
<customColumn :visible='visible' :listNum='listNum' :fiexColumn='columnsFixd' :mediaType='2' @closeCustomColumn='closeCustomColumn' @changeColumn='changeColumn' />
|
|
|
</div>
|
|
@@ -315,8 +244,8 @@ const columnsFixd = [
|
|
|
scopedSlots: { customRender: 'videoU' }
|
|
|
},
|
|
|
{
|
|
|
- title: '视频ID',
|
|
|
- dataIndex: 'signature',
|
|
|
+ title: '视频名称',
|
|
|
+ dataIndex: 'materialName',
|
|
|
align: 'center',
|
|
|
width: 120,
|
|
|
fixed: 'left'
|
|
@@ -339,85 +268,114 @@ const columnsFixd = [
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- title: '上传时间',
|
|
|
- dataIndex: 'materialUploadTime',
|
|
|
- scopedSlots: { customRender: 'materialUploadTime' },
|
|
|
- align: 'center',
|
|
|
- sorter: () => {}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '消耗',
|
|
|
- dataIndex: 'cost',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'cost' },
|
|
|
- align: 'center',
|
|
|
- sorter: () => {}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '点击数',
|
|
|
- dataIndex: 'clickMaterial',
|
|
|
- align: 'center',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'clickMaterial' },
|
|
|
- sorter: () => {}
|
|
|
- // (a, b) => a.clickMaterial - b.clickMaterial
|
|
|
- },
|
|
|
- {
|
|
|
- title: '点击率',
|
|
|
- dataIndex: 'ctr',
|
|
|
+ title: '创建时间',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ scopedSlots: { customRender: 'createTime' },
|
|
|
align: 'center',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'ctr' },
|
|
|
sorter: () => {}
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
- title: '展示数',
|
|
|
- dataIndex: 'showMaterial',
|
|
|
- align: 'center',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'showMaterial' },
|
|
|
- sorter: () => {}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '25%进度播放率',
|
|
|
- dataIndex: 'play25FeedBreakRate',
|
|
|
- align: 'center',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'play25FeedBreakRate' },
|
|
|
- sorter:() => {}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '播完率',
|
|
|
- dataIndex: 'playOverRate',
|
|
|
- align: 'center',
|
|
|
-
|
|
|
- tip: '表示广告在投放期内的预估花费金额。当天数据可能会有波动,次日稳定',
|
|
|
- scopedSlots: { customRender: 'playOverRate' },
|
|
|
- sorter: () => {}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '转化数',
|
|
|
- dataIndex: 'convertMaterial',
|
|
|
- align: 'center',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'convertMaterial' },
|
|
|
- sorter: () => {}
|
|
|
- },
|
|
|
- {
|
|
|
- title: '转化率',
|
|
|
- dataIndex: 'convertRate',
|
|
|
- align: 'center',
|
|
|
-
|
|
|
- scopedSlots: { customRender: 'convertRate' },
|
|
|
- sorter: () => {}
|
|
|
- }
|
|
|
+ title: '消耗(元)',
|
|
|
+ dataIndex: 'cost',
|
|
|
+ width:150,
|
|
|
+ tip: '广告在投放期间的花费总额',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'cost' },
|
|
|
+ sorter: () => {}
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '折后消耗(元)',
|
|
|
+ // dataIndex: 'discountCost',
|
|
|
+ // width:150,
|
|
|
+ // tip: '广告在投放期间的花费总额',
|
|
|
+ // align: 'center',
|
|
|
+ // scopedSlots: { customRender: 'discountCost' },
|
|
|
+ // sorter: () => {}
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ title: '封面曝光数',
|
|
|
+ dataIndex: 'photoShow',
|
|
|
+ tip: '广告在瀑布流被观看次数',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'photoShow' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '封面点击数',
|
|
|
+ dataIndex: 'photoClick',
|
|
|
+ tip: '用户点击封面进入视频播放页的次数(数据会进行反作弊去重)',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ scopedSlots: { customRender: 'photoClick' },
|
|
|
+ sorter: () => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '封面点击率',
|
|
|
+ dataIndex: 'clickRate',
|
|
|
+ tip: '封面点击数占封面展示数百分比',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'clickRate' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '素材曝光数',
|
|
|
+ dataIndex: 'aClick',
|
|
|
+ tip: '用户进入视频播放页观看的次数(数据会进行反作弊去重)',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ scopedSlots: { customRender: 'aClick' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '行为数',
|
|
|
+ dataIndex: 'bClick',
|
|
|
+ tip: '用户在视频播放页单击转化按钮的次数/展示数*100%',
|
|
|
+ align: 'center',
|
|
|
+
|
|
|
+ scopedSlots: { customRender: 'bClick' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ title: '行为率',
|
|
|
+ dataIndex: 'bClickRate',
|
|
|
+ tip: '行为数占素材曝光数百分比',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'bClickRate' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '平均千次封面曝光花费(元)',
|
|
|
+ dataIndex: 'cpm',
|
|
|
+ tip: '花费/封面曝光数*1000',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'cpm' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '平均封面点击单价(元)',
|
|
|
+ dataIndex: 'cpc',
|
|
|
+ tip: '花费/封面点击数',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'cpc' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '平均行为单价(元)',
|
|
|
+ dataIndex: 'cpb',
|
|
|
+ tip: '总花费/行为数',
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: { customRender: 'cpb' },
|
|
|
+ sorter:() => {}
|
|
|
+ },
|
|
|
]
|
|
|
let show = 0
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ target:'cost',
|
|
|
+ order:'desc',
|
|
|
type:0,
|
|
|
dateValue:[moment(),moment()],
|
|
|
openOptions:false,
|
|
@@ -454,12 +412,30 @@ export default {
|
|
|
//自定义列的搜索框
|
|
|
searchInput: '',
|
|
|
//弹出框中现实的选中列数
|
|
|
- scrollX: 0,
|
|
|
+ scrollX: 2000,
|
|
|
listNum: [],
|
|
|
//
|
|
|
form: [],
|
|
|
videoID: '',
|
|
|
- timedata: []
|
|
|
+ timedata: [],
|
|
|
+ ipagination: {
|
|
|
+ current: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ // pageSizeOptions: ['10', '20', '30'],
|
|
|
+ showTotal: (total, range) => {
|
|
|
+ return range[0] + "-" + range[1] + " 共" + total + "条"
|
|
|
+ },
|
|
|
+ showQuickJumper: true,
|
|
|
+ showSizeChanger:true,
|
|
|
+ pageSizeOptions: ['10', '30', '50'],
|
|
|
+ total: 0,
|
|
|
+ onChange: (current, pageSize) => {
|
|
|
+ // 切换分页时的回调,
|
|
|
+ // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
|
|
|
+ this.ipagination.current = current;
|
|
|
+ this.ipagination.pageSize= pageSize;
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
mixins: [JeecgListMixin],
|
|
@@ -469,6 +445,9 @@ export default {
|
|
|
DatePicker,
|
|
|
customColumn,
|
|
|
},
|
|
|
+ watch:{
|
|
|
+
|
|
|
+ },
|
|
|
methods: {
|
|
|
closeCustomColumn(){
|
|
|
this.visible=false;
|
|
@@ -510,13 +489,20 @@ export default {
|
|
|
},
|
|
|
sort(pagination, filters, sorter, { currentDataSource }){
|
|
|
console.log(pagination, filters, sorter)
|
|
|
- if(sorter.order == 'ascend'){
|
|
|
- this.HttpPost(sorter.columnKey+'+')
|
|
|
+ this.ipagination.current=pagination.current;
|
|
|
+ this.ipagination.pageSize=pagination.pageSize
|
|
|
+ if(sorter.order == 'ascend'){
|
|
|
+ this.order='asc'
|
|
|
+ this.target=sorter.columnKey;
|
|
|
}else if(sorter.order == 'descend'){
|
|
|
- this.HttpPost(sorter.columnKey+'-')
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
+ this.order='desc'
|
|
|
+ this.target=sorter.columnKey;
|
|
|
+ }else{
|
|
|
+ this.target='cost',
|
|
|
+ this.order='desc'
|
|
|
+ }
|
|
|
+ this.HttpPost();
|
|
|
+ },
|
|
|
moment,
|
|
|
//select切换---项目
|
|
|
selectChange(key){
|
|
@@ -545,19 +531,21 @@ export default {
|
|
|
|
|
|
},
|
|
|
//网络请求table数据函数
|
|
|
- HttpPost(sort){
|
|
|
+ HttpPost(){
|
|
|
this.loading=true;
|
|
|
show = 0
|
|
|
- postAction('/toutiao/videoReportDaily/videoInfoListTotal', {
|
|
|
+ postAction('/ctop/kuaishou/videoReport/list', {
|
|
|
startDate: this.dateValue[0].format('YYYY-MM-DD'),
|
|
|
endDate: this.dateValue[1].format('YYYY-MM-DD'),
|
|
|
pageNo:this.ipagination.current,
|
|
|
pageSize:this.ipagination.pageSize,
|
|
|
accountIds:this.appId,
|
|
|
- sort:sort?sort:''
|
|
|
+ target:this.target,
|
|
|
+ order:this.order,
|
|
|
}).then(res => {
|
|
|
let resArr = []
|
|
|
-
|
|
|
+ this.data=[];
|
|
|
+ this.loading = false
|
|
|
if (res.success) {
|
|
|
// let result = res.result
|
|
|
// this.data.push({ ...result, key: 1 })
|
|
@@ -580,27 +568,18 @@ export default {
|
|
|
},
|
|
|
//导出报表
|
|
|
exportExcel() {
|
|
|
- // var params = {}
|
|
|
- // params.projectId = this.projectId
|
|
|
- // params.disCount = this.discount
|
|
|
- // params.statDate = this.statDate.format('YYYY-MM-DD')
|
|
|
- // var name = this.dataElse.filter(item => {
|
|
|
- // return item.projectId == this.projectId
|
|
|
- // })[0].projectName
|
|
|
- // downFilePost('/ctop/yiche/report/exportDailyReport', params).then(res => {
|
|
|
- // let blob = new Blob([res], {
|
|
|
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
- let column = this.columns.map((item, index) => {
|
|
|
+ let column = this.columns.map((item, index) => {
|
|
|
return item.dataIndex
|
|
|
})
|
|
|
- let columns=['url',...column]
|
|
|
+
|
|
|
+ let columns=column.splice(5)
|
|
|
|
|
|
- downFilePost('/toutiao/videoReportDaily/bytedanceVideoInfoListTotalExportExcel', {
|
|
|
+ downFilePost('/ctop/kuaishou/videoReport/report/excel', {
|
|
|
columns,
|
|
|
- signature: this.videoID,
|
|
|
- startDate: this.timedata[0],
|
|
|
- endDate: this.timedata[1],
|
|
|
- cost: this.consumeValue,
|
|
|
+ target:this.target,
|
|
|
+ order:this.order,
|
|
|
+ startDate: this.dateValue[0].format('YYYY-MM-DD'),
|
|
|
+ endDate: this.dateValue[1].format('YYYY-MM-DD'),
|
|
|
accountIds:this.appId,
|
|
|
}).then(res => {
|
|
|
let blob = new Blob([res], {
|
|
@@ -609,7 +588,7 @@ export default {
|
|
|
let downloadElement = document.createElement('a')
|
|
|
let href = window.URL.createObjectURL(blob) //创建下载的链接
|
|
|
downloadElement.href = href
|
|
|
- downloadElement.download = this.statDate.format('YYYY-MM-DD') + '视频汇总.xlsx' //下载后文件名
|
|
|
+ downloadElement.download = '视频汇总.xlsx' //下载后文件名
|
|
|
document.body.appendChild(downloadElement)
|
|
|
downloadElement.click() //点击下载
|
|
|
document.body.removeChild(downloadElement) //下载完成移除元素
|
|
@@ -782,12 +761,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- 'ipagination.current':function(n,o){
|
|
|
- console.log(n,o)
|
|
|
- this.HttpPost()
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
activated() {
|
|
|
console.log('activated')
|
|
|
// this.getParticipateList()
|
|
@@ -796,7 +770,7 @@ export default {
|
|
|
moment().format('YYYY-MM-DD_HH:mm')
|
|
|
|
|
|
postAction('/toutiao/videoReportDaily/getColumnJson', {
|
|
|
- columnType: 1
|
|
|
+ columnType: 6
|
|
|
}).then(res => {
|
|
|
// console.log(res)
|
|
|
if (res.success) {
|
|
@@ -830,25 +804,108 @@ export default {
|
|
|
// console.log(arr)
|
|
|
postAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
|
|
|
json: arr,
|
|
|
- columnType: 1
|
|
|
+ columnType: 6
|
|
|
}).then(res => {
|
|
|
// console.log(res)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- filters: {
|
|
|
- toPercentage(val) {
|
|
|
- return (val * 100).toFixed(2) + '%'
|
|
|
- // return val
|
|
|
- },
|
|
|
+filters: {
|
|
|
+
|
|
|
toshowTime(val) {
|
|
|
// console.log(val, this.timedata)
|
|
|
// return this.timedata[0] + '~' + this.timedata[1]
|
|
|
return val
|
|
|
},
|
|
|
- tofixed(val) {
|
|
|
- return Number(val).toFixed(2)
|
|
|
- }
|
|
|
+ toPercentage(val) {
|
|
|
+ if(val){
|
|
|
+ if(typeof val != 'string'){
|
|
|
+ return (val * 100).toFixed(2) + '%'
|
|
|
+ }else{
|
|
|
+ return val
|
|
|
+ }
|
|
|
+ }else if(typeof val =='string'){
|
|
|
+ return val
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保留两位小数并且变成货币格式
|
|
|
+ decimalsHandle(val){
|
|
|
+ // console.log(val)
|
|
|
+ if(val && typeof val !='string'){
|
|
|
+ if(val>=0){
|
|
|
+ val=parseFloat(val).toFixed(2);
|
|
|
+ let numberStr = val.toString()
|
|
|
+ let str = numberStr.split('.')
|
|
|
+
|
|
|
+ let str0=str[0].split('').reverse();
|
|
|
+ for (let i = 0; i < str0.length; i++) {
|
|
|
+ if ((i + 1) % 4 === 0) {
|
|
|
+ str0.splice(i, 0, ',')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ str0.reverse()
|
|
|
+ let handleResult = ''
|
|
|
+ for (let j = 0; j < str0.length; j++) {
|
|
|
+ handleResult += str0[j]
|
|
|
+ }
|
|
|
+
|
|
|
+ return handleResult+'.'+str[1]
|
|
|
+ }else{
|
|
|
+ val=parseFloat(val).toFixed(2);
|
|
|
+ let numberStr = val.toString()
|
|
|
+ let str = numberStr.split('.')
|
|
|
+
|
|
|
+ let str0=str[0].substr(1).split('').reverse();
|
|
|
+ for (let i = 0; i < str0.length; i++) {
|
|
|
+ if ((i + 1) % 4 === 0) {
|
|
|
+ str0.splice(i, 0, ',')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ str0.reverse()
|
|
|
+ let handleResult = ''
|
|
|
+ for (let j = 0; j < str0.length; j++) {
|
|
|
+ handleResult += str0[j]
|
|
|
+ }
|
|
|
+
|
|
|
+ return '-'+handleResult+'.'+str[1]
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(typeof val =='string'){
|
|
|
+ return val
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //变成货币格式
|
|
|
+ formatCurrency(val){
|
|
|
+ if((val||val==0)&& typeof val !='string'){
|
|
|
+ let numberStr = val.toString()
|
|
|
+ let str = numberStr.split('').reverse()
|
|
|
+ for (let i = 0; i < str.length; i++) {
|
|
|
+ if ((i + 1) % 4 === 0) {
|
|
|
+ str.splice(i, 0, ',')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ str.reverse()
|
|
|
+ let handleResult = ''
|
|
|
+ for (let j = 0; j < str.length; j++) {
|
|
|
+ handleResult += str[j]
|
|
|
+ }
|
|
|
+ return handleResult
|
|
|
+ }else if(typeof val =='string'){
|
|
|
+ return val
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return '-'
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
mounted() {
|