|
@@ -2,7 +2,7 @@
|
|
|
<div class="vsummary">
|
|
|
<div class="xiangmuxuanze">
|
|
|
<span>项目选择:</span>
|
|
|
- <Treeselect :appId.sync="appId" style="display: inline-block;position: relative;top: 10px;"/>
|
|
|
+ <Treeselect :appId.sync="appId" request="1,3" reqUrl="/ctop/projectMember/bytedanceProjectParticipateInList" style="display: inline-block;position: relative;top: 10px;"/>
|
|
|
</div>
|
|
|
<div class="timeDiv">
|
|
|
<div>
|
|
@@ -88,6 +88,7 @@
|
|
|
ref="vSummaryTable"
|
|
|
:width="tableWidth"
|
|
|
@customHeaderCell="customHeaderCell(columns)"
|
|
|
+ @change="sort"
|
|
|
style="word-break: break-all;"
|
|
|
>
|
|
|
<div slot="videoU" slot-scope="test,records">
|
|
@@ -179,7 +180,7 @@ import moment from 'moment'
|
|
|
import { JeecgListMixin } from '@/mixins/ipagination'
|
|
|
import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
|
|
|
import selectComponent from './selectComponent'
|
|
|
-import Treeselect from './Treeselect.vue'
|
|
|
+import Treeselect from '../components/Treeselect'
|
|
|
const columnsFixd = [
|
|
|
{
|
|
|
title: '视频',
|
|
@@ -221,6 +222,7 @@ let variableCol = [
|
|
|
|
|
|
scopedSlots: { customRender: 'clickMaterial' },
|
|
|
sorter: (a, b) => a.clickMaterial - b.clickMaterial
|
|
|
+ // (a, b) => a.clickMaterial - b.clickMaterial
|
|
|
},
|
|
|
{
|
|
|
title: '点击率',
|
|
@@ -322,6 +324,15 @@ export default {
|
|
|
Treeselect
|
|
|
},
|
|
|
methods: {
|
|
|
+ sort(pagination, filters, sorter, { currentDataSource }){
|
|
|
+ console.log(pagination, filters, sorter)
|
|
|
+ if(sorter.order == 'ascend'){
|
|
|
+ this.HttpPost(sorter.columnKey+'+')
|
|
|
+ }else if(sorter.order == 'descend'){
|
|
|
+ this.HttpPost(sorter.columnKey+'-')
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
moment,
|
|
|
//select切换---项目
|
|
|
selectChange(key){
|
|
@@ -346,15 +357,12 @@ export default {
|
|
|
//查询按钮
|
|
|
searchRes() {
|
|
|
this.date = []
|
|
|
- if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
|
|
|
- this.HttpPost();
|
|
|
- }else{
|
|
|
- this.$message.error('请选择项目')
|
|
|
- }
|
|
|
+
|
|
|
+ this.HttpPost()
|
|
|
|
|
|
},
|
|
|
//网络请求table数据函数
|
|
|
- HttpPost(){
|
|
|
+ HttpPost(sort){
|
|
|
this.loading=true;
|
|
|
show = 0
|
|
|
postAction('/toutiao/videoReportDaily/videoInfoListTotal', {
|
|
@@ -364,7 +372,8 @@ export default {
|
|
|
signature: this.videoID,
|
|
|
pageNo:this.ipagination.current,
|
|
|
pageSize:this.ipagination.pageSize,
|
|
|
- projectIds:this.appId
|
|
|
+ accountIds:this.appId,
|
|
|
+ sort:sort?sort:''
|
|
|
}).then(res => {
|
|
|
let resArr = []
|
|
|
|
|
@@ -400,16 +409,18 @@ export default {
|
|
|
// downFilePost('/ctop/yiche/report/exportDailyReport', params).then(res => {
|
|
|
// let blob = new Blob([res], {
|
|
|
// type: 'application/vnd.ms-excel'
|
|
|
- let columns = this.columns.map((item, index) => {
|
|
|
+ let column = this.columns.map((item, index) => {
|
|
|
return item.dataIndex
|
|
|
})
|
|
|
-
|
|
|
+ let columns=['url',...column]
|
|
|
+
|
|
|
downFilePost('/toutiao/videoReportDaily/bytedanceVideoInfoListTotalExportExcel', {
|
|
|
columns,
|
|
|
signature: this.videoID,
|
|
|
startDate: this.timedata[0],
|
|
|
endDate: this.timedata[1],
|
|
|
- cost: this.consumeValue
|
|
|
+ cost: this.consumeValue,
|
|
|
+ accountIds:this.appId,
|
|
|
}).then(res => {
|
|
|
let blob = new Blob([res], {
|
|
|
type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
@@ -451,20 +462,19 @@ export default {
|
|
|
|
|
|
//设置头部单元格属性
|
|
|
customHeaderCell(columns) {
|
|
|
- console.log(columns)
|
|
|
+ // console.log(columns)
|
|
|
},
|
|
|
|
|
|
tableHandle() {
|
|
|
// this.listNum = [...this.columns]
|
|
|
- console.log(this.listNum.length, this.columns)
|
|
|
+ // console.log(this.listNum.length, this.columns)
|
|
|
|
|
|
if (this.listNum.length >= 9 || this.columns.length >= 9) {
|
|
|
this.tableWidth = 120
|
|
|
this.scrollX = this.columns.length * 120
|
|
|
- console.log(this.scrollX)
|
|
|
+ // console.log(this.scrollX)
|
|
|
} else {
|
|
|
this.scrollX = 0
|
|
|
- console.log('scroll==0')
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -593,10 +603,7 @@ export default {
|
|
|
watch:{
|
|
|
'ipagination.current':function(n,o){
|
|
|
console.log(n,o)
|
|
|
- if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
|
|
|
- this.HttpPost()
|
|
|
- }
|
|
|
-
|
|
|
+ this.HttpPost()
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
@@ -612,23 +619,26 @@ export default {
|
|
|
// console.log(res)
|
|
|
if (res.success) {
|
|
|
// console.log(JSON.parse(res.result))
|
|
|
- let columns = JSON.parse(res.result)
|
|
|
- if (columns.length) {
|
|
|
- if (columns.length >= columnsFixd.length) {
|
|
|
- columns.map((item, index) => {
|
|
|
- if (index > columnsFixd.length - 1) {
|
|
|
- item.sorter = function(a, b) {
|
|
|
- return a[item.dataIndex] - b[item.dataIndex]
|
|
|
+ if(res.result){
|
|
|
+ let columns = JSON.parse(res.result)
|
|
|
+ if (columns.length) {
|
|
|
+ if (columns.length >= columnsFixd.length) {
|
|
|
+ columns.map((item, index) => {
|
|
|
+ if (index > columnsFixd.length - 1) {
|
|
|
+ item.sorter = function(a, b) {
|
|
|
+ return a[item.dataIndex] - b[item.dataIndex]
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- columns = columns.slice(columnsFixd.length)
|
|
|
- this.columns = [...columnsFixd, ...columns]
|
|
|
- this.tableHandle()
|
|
|
- }
|
|
|
+ })
|
|
|
+ columns = columns.slice(columnsFixd.length)
|
|
|
+ this.columns = [...columnsFixd, ...columns]
|
|
|
+ this.tableHandle()
|
|
|
+ }
|
|
|
|
|
|
- // console.log(this.columns)
|
|
|
+ // console.log(this.columns)
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -677,11 +687,8 @@ export default {
|
|
|
this.dateRange=[moment().subtract(1,'days'),moment()]
|
|
|
this.timedata=[moment().subtract(1,'days').format('YYYY-MM-DD'),moment().format('YYYY-MM-DD')]
|
|
|
// this.loading=true;
|
|
|
- if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
|
|
|
- this.HttpPost();
|
|
|
- }else{
|
|
|
- this.$message.error('请选择项目')
|
|
|
- }
|
|
|
+
|
|
|
+ this.HttpPost()
|
|
|
|
|
|
}
|
|
|
}
|