vSummary.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  1. <template>
  2. <div class="vsummary">
  3. <div class="xiangmuxuanze">
  4. <span>项目选择:</span>
  5. <Treeselect :appId.sync="appId" request="1,3" style="display: inline-block;position: relative;top: 10px;"/>
  6. </div>
  7. <div class="timeDiv">
  8. <div>
  9. <span>时间范围:</span>
  10. <a-range-picker
  11. :disabled-date="disabledDate"
  12. format="YYYY-MM-DD"
  13. style="width: 250px;"
  14. @change="dateChange"
  15. v-model="dateRange"
  16. />
  17. <span v-show="daysFlag">共{{totalSelect}}天</span>
  18. </div>
  19. <div>
  20. <span>消耗:</span>
  21. <a-input-number id="inputNumber" v-model="consumeValue" :min="0" @change="consumeOnChange" />
  22. <span>视频ID:</span>
  23. <a-input class="myinput" v-model="videoID" style="width:250px" />
  24. </div>
  25. <a-button type="primary" @click="searchRes">查询</a-button>
  26. </div>
  27. <div style="display:flex;margin-bottom:15px" class="btndiv">
  28. <a-button type="primary" @click="customColumns">自定义列</a-button>
  29. <a-button type="default" @click="exportExcel" id="mybtn" v-show="exportExcelIsOk">导出报表</a-button>
  30. </div>
  31. <a-modal v-model="visible" title="自定义列" on-ok="handleOk" width="65%">
  32. <template slot="footer">
  33. <a-button key="back" @click="handleCancel">取消</a-button>
  34. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">应用</a-button>
  35. </template>
  36. <!-- <a-input-search placeholder="输入要添加的列的名称" style="width: 40%" enter-button @search="onSearch" /> -->
  37. <div class="zhuti">
  38. <div class="addlist">
  39. <p>可添加的列</p>
  40. <div class="selectionList">
  41. <!-- v-for="(item,index) in addColumns" :key="index" -->
  42. <selectComponent
  43. :showCol="listNum"
  44. @getshowlist="getshowlist"
  45. :fixedCol="columnsFixd"
  46. />
  47. </div>
  48. </div>
  49. <div class="listNum">
  50. <p>已选{{listNum.length}}列</p>
  51. <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
  52. <ul class="selectlist">
  53. <li v-for="(item,index) in listNum" :key="index">
  54. <span v-if=" index <4">
  55. <a-icon type="lock" />
  56. <span class="listText">{{item.title}}</span>
  57. </span>
  58. <span v-else-if=" index >=4">
  59. <a-icon type="menu" style="color:#ccc" />
  60. <span class="listText">{{item.title}}</span>
  61. <a-icon
  62. type="close"
  63. @click="deleteCol(item,index)"
  64. id="closeStyle"
  65. style="fontSize:12px;"
  66. />
  67. </span>
  68. </li>
  69. </ul>
  70. </div>
  71. </div>
  72. </a-modal>
  73. <a-table
  74. size="middle"
  75. :columns="columns"
  76. :dataSource="data"
  77. bordered
  78. id="outTable"
  79. :pagination="ipagination"
  80. :scroll="{ x: scrollX }"
  81. :loading="loading"
  82. ref="vSummaryTable"
  83. :width="tableWidth"
  84. @customHeaderCell="customHeaderCell(columns)"
  85. @change="sort"
  86. style="word-break: break-all;"
  87. >
  88. <div slot="videoU" slot-scope="test,records">
  89. <img
  90. :src="records.coverUrl"
  91. alt
  92. style="width:140px"
  93. @click="openVideo(records.url)"
  94. @load="loadShow"
  95. />
  96. </div>
  97. <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
  98. <span
  99. slot="play25FeedBreakRate"
  100. slot-scope="play25FeedBreakRate"
  101. >{{ play25FeedBreakRate | toPercentage }}</span>
  102. <span slot="playOverRate" slot-scope="playOverRate">{{ playOverRate | toPercentage }}</span>
  103. <!-- 新加数据 -->
  104. <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
  105. <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
  106. <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
  107. <span slot="cpc" slot-scope="cpc">{{ cpc | tofixed }}</span>
  108. <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
  109. <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
  110. <span
  111. slot="installFinishRate"
  112. slot-scope="installFinishRate"
  113. >{{ installFinishRate | toPercentage }}</span>
  114. <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | tofixed }}</span>
  115. <span slot="activePayCost" slot-scope="activePayCost">{{ activePayCost | tofixed }}</span>
  116. <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | tofixed }}</span>
  117. <span slot="validPlayCost" slot-scope="validPlayCost">{{ validPlayCost | tofixed }}</span>
  118. <span slot="activeCost" slot-scope="activeCost">{{ activeCost | tofixed }}</span>
  119. <span
  120. slot="gameAddictionCost"
  121. slot-scope="gameAddictionCost"
  122. >{{ gameAddictionCost | tofixed }}</span>
  123. <span
  124. slot="downloadFinishCost"
  125. slot-scope="downloadFinishCost"
  126. >{{ downloadFinishCost | tofixed }}</span>
  127. <span
  128. slot="downloadStartCost"
  129. slot-scope="downloadStartCost"
  130. >{{ downloadStartCost | tofixed }}</span>
  131. <span
  132. slot="installFinishCost"
  133. slot-scope="installFinishCost"
  134. >{{ installFinishCost | tofixed }}</span>
  135. <span slot="convertCost" slot-scope="convertCost">{{ convertCost | tofixed }}</span>
  136. <!-- -->
  137. <span
  138. slot="downloadStartRate"
  139. slot-scope="downloadStartRate"
  140. >{{ downloadStartRate | toPercentage }}</span>
  141. <span
  142. slot="downloadFinishRate"
  143. slot-scope="downloadFinishRate"
  144. >{{ downloadFinishRate | toPercentage }}</span>
  145. <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
  146. <span
  147. slot="activeRegisterRate"
  148. slot-scope="activeRegisterRate"
  149. >{{ activeRegisterRate | toPercentage }}</span>
  150. <span
  151. slot="gameAddictionRate"
  152. slot-scope="gameAddictionRate"
  153. >{{ gameAddictionRate | toPercentage }}</span>
  154. <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
  155. <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
  156. <span slot="statDatetime" slot-scope>{{ timedata[0]+'~'+timedata[1]}}</span>
  157. <span slot="operation" slot-scope="text,record">
  158. <a href="javascript:;" @click.stop="showRelevantPeople(record)">查看相关人员</a>
  159. </span>
  160. </a-table>
  161. <a-modal v-model="relevantPeopleVisible" title="相关人员" :footer="null" :centered='true'>
  162. <p>编导:{{relevantPeopleData.planName || '暂无数据'}}</p>
  163. <p>剪辑:{{relevantPeopleData.clipName || '暂无数据'}}</p>
  164. <p>拍摄:{{relevantPeopleData.shotName || '暂无数据'}}</p>
  165. </a-modal>
  166. <a-modal v-model="Videovisible" title="视频详情" @ok="videoOk" :footer="null" width="50%">
  167. <video
  168. @click.stop
  169. class="video"
  170. :src="videoUrl"
  171. controls="controls"
  172. style="height:600px;width:100%"
  173. >您的浏览器不支持 video 标签。</video>
  174. </a-modal>
  175. </div>
  176. </template>
  177. <script>
  178. import moment from 'moment'
  179. import { JeecgListMixin } from '@/mixins/ipagination'
  180. import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
  181. import selectComponent from './selectComponent'
  182. import Treeselect from '../components/Treeselect'
  183. const columnsFixd = [
  184. {
  185. title: '视频',
  186. dataIndex: 'videoU',
  187. align: 'center',
  188. width: 150,
  189. fixed: 'left',
  190. key: 'videoU',
  191. scopedSlots: { customRender: 'videoU' }
  192. },
  193. {
  194. title: '视频ID',
  195. dataIndex: 'signature',
  196. align: 'center',
  197. width: 100,
  198. fixed: 'left'
  199. },
  200. {
  201. title: '项目名称',
  202. dataIndex: 'projectName',
  203. align: 'center',
  204. width: 100,
  205. fixed: 'left'
  206. },
  207. {
  208. title:'相关人员',
  209. dataIndex:'operation',
  210. key:'operation',
  211. scopedSlots: { customRender: 'operation' },
  212. align: 'center',
  213. width:100,
  214. fixed: 'left'
  215. }
  216. ]
  217. let variableCol = [
  218. {
  219. title: '上传时间',
  220. dataIndex: 'materialUploadTime',
  221. scopedSlots: { customRender: 'materialUploadTime' },
  222. align: 'center',
  223. sorter: () => {}
  224. },
  225. {
  226. title: '消耗',
  227. dataIndex: 'cost',
  228. scopedSlots: { customRender: 'cost' },
  229. align: 'center',
  230. sorter: () => {}
  231. },
  232. {
  233. title: '点击数',
  234. dataIndex: 'clickMaterial',
  235. align: 'center',
  236. scopedSlots: { customRender: 'clickMaterial' },
  237. sorter: () => {}
  238. // (a, b) => a.clickMaterial - b.clickMaterial
  239. },
  240. {
  241. title: '点击率',
  242. dataIndex: 'ctr',
  243. align: 'center',
  244. scopedSlots: { customRender: 'ctr' },
  245. sorter: () => {}
  246. },
  247. {
  248. title: '展示数',
  249. dataIndex: 'showMaterial',
  250. align: 'center',
  251. scopedSlots: { customRender: 'showMaterial' },
  252. sorter: () => {}
  253. },
  254. {
  255. title: '25%进度播放率',
  256. dataIndex: 'play25FeedBreakRate',
  257. align: 'center',
  258. scopedSlots: { customRender: 'play25FeedBreakRate' },
  259. sorter:() => {}
  260. },
  261. {
  262. title: '播完率',
  263. dataIndex: 'playOverRate',
  264. align: 'center',
  265. tip: '表示广告在投放期内的预估花费金额。当天数据可能会有波动,次日稳定',
  266. scopedSlots: { customRender: 'playOverRate' },
  267. sorter: () => {}
  268. },
  269. {
  270. title: '转化数',
  271. dataIndex: 'convertMaterial',
  272. align: 'center',
  273. scopedSlots: { customRender: 'convertMaterial' },
  274. sorter: () => {}
  275. },
  276. {
  277. title: '转化率',
  278. dataIndex: 'convertRate',
  279. align: 'center',
  280. scopedSlots: { customRender: 'convertRate' },
  281. sorter: () => {}
  282. }
  283. ]
  284. let show = 0
  285. export default {
  286. data() {
  287. return {
  288. relevantPeopleVisible:false,
  289. relevantPeopleData:{},
  290. roleCode: localStorage.getItem('roleCode'),
  291. //下拉选择框的数据
  292. projectArr:[],
  293. selectValue:'',
  294. appId:[],
  295. //设置表格的列宽
  296. tableWidth: '',
  297. //gudinglie
  298. columnsFixd: columnsFixd,
  299. //是否打开视频
  300. Videovisible: false,
  301. videoUrl: '',
  302. //是否显示导出按钮
  303. exportExcelIsOk: true,
  304. consumeValue: 0,
  305. columns: [...columnsFixd, ...variableCol],
  306. addColumns: [],
  307. data: [],
  308. totalSelect: 0,
  309. daysFlag: false,
  310. dateRange: [],
  311. dataElse: [],
  312. loading: false,
  313. visible: false,
  314. //自定义列的搜索框
  315. searchInput: '',
  316. //弹出框中现实的选中列数
  317. scrollX: 0,
  318. listNum: [],
  319. //
  320. form: [],
  321. videoID: '',
  322. timedata: []
  323. }
  324. },
  325. mixins: [JeecgListMixin],
  326. components: {
  327. selectComponent,
  328. Treeselect
  329. },
  330. methods: {
  331. // 查看相关人员
  332. showRelevantPeople(record){
  333. this.relevantPeopleVisible=true;
  334. console.log(record)
  335. getAction('/ctop/materialAscription/getDetail',{
  336. code:record.signature
  337. }).then(res=>{
  338. console.log(res);
  339. if(res.result&&res.success){
  340. this.relevantPeopleData=res.result
  341. }
  342. })
  343. },
  344. sort(pagination, filters, sorter, { currentDataSource }){
  345. console.log(pagination, filters, sorter)
  346. if(sorter.order == 'ascend'){
  347. this.HttpPost(sorter.columnKey+'+')
  348. }else if(sorter.order == 'descend'){
  349. this.HttpPost(sorter.columnKey+'-')
  350. }
  351. },
  352. moment,
  353. //select切换---项目
  354. selectChange(key){
  355. this.selectValue=key;
  356. },
  357. //打开视频
  358. openVideo(val) {
  359. this.Videovisible = true
  360. this.videoUrl = val
  361. },
  362. videoOk() {
  363. this.Videovisible = false
  364. },
  365. disabledDate(current) {
  366. // console.log(current)
  367. return current && current > moment().subtract(1, 'day')
  368. },
  369. consumeOnChange() {},
  370. //查询按钮
  371. searchRes() {
  372. this.date = []
  373. this.HttpPost()
  374. },
  375. //网络请求table数据函数
  376. HttpPost(sort){
  377. this.loading=true;
  378. show = 0
  379. postAction('/toutiao/videoReportDaily/videoInfoListTotal', {
  380. startDate: this.timedata[0],
  381. endDate: this.timedata[1],
  382. cost: this.consumeValue,
  383. signature: this.videoID,
  384. pageNo:this.ipagination.current,
  385. pageSize:this.ipagination.pageSize,
  386. accountIds:this.appId,
  387. sort:sort?sort:''
  388. }).then(res => {
  389. let resArr = []
  390. if (res.success) {
  391. // let result = res.result
  392. // this.data.push({ ...result, key: 1 })
  393. // result.map((item, index) => {
  394. // item.key = index
  395. // })
  396. this.data = res.result.list.map((item,index)=>{
  397. return {
  398. ...item,
  399. key:index
  400. }
  401. })
  402. this.ipagination.total = res.result.total
  403. this.loading = false
  404. }else{
  405. this.loading = false
  406. }
  407. })
  408. },
  409. //导出报表
  410. exportExcel() {
  411. // var params = {}
  412. // params.projectId = this.projectId
  413. // params.disCount = this.discount
  414. // params.statDate = this.statDate.format('YYYY-MM-DD')
  415. // var name = this.dataElse.filter(item => {
  416. // return item.projectId == this.projectId
  417. // })[0].projectName
  418. // downFilePost('/ctop/yiche/report/exportDailyReport', params).then(res => {
  419. // let blob = new Blob([res], {
  420. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  421. let column = this.columns.map((item, index) => {
  422. return item.dataIndex
  423. })
  424. let columns=['url',...column]
  425. downFilePost('/toutiao/videoReportDaily/bytedanceVideoInfoListTotalExportExcel', {
  426. columns,
  427. signature: this.videoID,
  428. startDate: this.timedata[0],
  429. endDate: this.timedata[1],
  430. cost: this.consumeValue,
  431. accountIds:this.appId,
  432. }).then(res => {
  433. let blob = new Blob([res], {
  434. type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  435. })
  436. let downloadElement = document.createElement('a')
  437. let href = window.URL.createObjectURL(blob) //创建下载的链接
  438. downloadElement.href = href
  439. downloadElement.download = this.statDate.format('YYYY-MM-DD') + '视频汇总.xlsx' //下载后文件名
  440. document.body.appendChild(downloadElement)
  441. downloadElement.click() //点击下载
  442. document.body.removeChild(downloadElement) //下载完成移除元素
  443. window.URL.revokeObjectURL(href) //释放掉blob对象
  444. })
  445. },
  446. //日期选择回调
  447. dateChange(data, dataString) {
  448. if (data.length) {
  449. this.timedata = dataString
  450. this.dateRange[0] = data[0]
  451. this.totalSelect = (data[1]._d - data[0]._d) / (24 * 60 * 60 * 1000) + 1
  452. this.daysFlag = true
  453. if (this.totalSelect > 92) {
  454. this.$message.error('时间跨度太长啦,选小一点好嘛?')
  455. this.daysFlag = false
  456. this.dateRange = []
  457. }
  458. } else {
  459. this.daysFlag = false
  460. this.dateRange = []
  461. }
  462. },
  463. //弹出框打开,自定义列
  464. customColumns() {
  465. this.visible = true
  466. this.listNum = [...this.columns]
  467. },
  468. //设置头部单元格属性
  469. customHeaderCell(columns) {
  470. // console.log(columns)
  471. },
  472. tableHandle() {
  473. // this.listNum = [...this.columns]
  474. // console.log(this.listNum.length, this.columns)
  475. if (this.listNum.length >= 9 || this.columns.length >= 9) {
  476. this.tableWidth = 120
  477. this.scrollX = this.columns.length * 120
  478. // console.log(this.scrollX)
  479. } else {
  480. this.scrollX = 0
  481. }
  482. },
  483. //弹出框确定
  484. handleOk(e) {
  485. this.loading = false
  486. this.visible = false
  487. if (this.listNum.length >= 10) {
  488. let newlist = this.listNum.slice(columnsFixd.length)
  489. console.log(newlist)
  490. this.columns = [...columnsFixd, ...newlist]
  491. } else {
  492. this.columns = [...this.listNum]
  493. }
  494. if (this.listNum.length == 4) {
  495. // console.log(this.listNum.length)
  496. this.scrollX = 0
  497. this.columns.map((item, index) => {
  498. item.width = 500
  499. })
  500. // console.log(1)
  501. } else {
  502. this.columns.map((item, index) => {
  503. if (index == 2 || index == 0) {
  504. item.width = 150
  505. } else if (index == 1 || index == 2) {
  506. item.width = 100
  507. }
  508. })
  509. // console.log(2)
  510. }
  511. this.tableHandle()
  512. },
  513. //弹出框取消按钮
  514. handleCancel(e) {
  515. this.visible = false
  516. },
  517. loadShow(){
  518. show++
  519. if(this.data.length>0){
  520. if(show == (this.data.length*2)){
  521. this.data = [...this.data]
  522. }
  523. }
  524. },
  525. //弹出框里的搜索框
  526. onSearch(value) {
  527. console.log(value)
  528. },
  529. //清空全部按钮的事件
  530. clearAllList() {
  531. this.listNum = [...columnsFixd]
  532. console.log(this.$refs.vSummaryTable)
  533. },
  534. //li展示里的关闭按钮 删除当前被选中的这一个列
  535. deleteCol(item, index) {
  536. this.listNum = this.listNum.filter((item1, num) => {
  537. return num != index
  538. })
  539. },
  540. //从自定义列拿选择的项
  541. getshowlist(val) {
  542. var arr = []
  543. // console.log(val)
  544. if (val.length) {
  545. if (val.flag) {
  546. let newArr = val.arr
  547. newVal.map((item, index) => {
  548. // if(JSON.stringify(this.listNum).indexOf(JSON.stringify(item))==-1){
  549. // this.listNum.push(item); // 进行动态的操作
  550. // }
  551. var result = this.listNum.some(items => {
  552. if (items.dataIndex == item.dataIndex) {
  553. return true
  554. }
  555. })
  556. // console.log(result)
  557. if (result) {
  558. newArr.splice(index, 1)
  559. }
  560. })
  561. this.listNum = [...this.listNum, ...newArr]
  562. } else {
  563. //取消全选 清楚listNum中的val里的值
  564. val.arr.map((item, index) => {
  565. var result = this.listNum.some(items => {
  566. if (items.dataIndex == item.dataIndex) {
  567. return true
  568. }
  569. })
  570. // console.log(result)
  571. if (result) {
  572. this.listNum.splice(index, 1)
  573. }
  574. })
  575. }
  576. } else {
  577. arr = this.listNum.filter((item, index) => {
  578. return item.dataIndex == val.dataIndex
  579. })
  580. }
  581. if (arr.length) {
  582. var index
  583. this.listNum.map((item, ind) => {
  584. if (item.dataIndex == val.dataIndex) {
  585. index = ind
  586. }
  587. })
  588. console.log(index)
  589. this.listNum.splice(index, 1)
  590. } else {
  591. this.listNum.push(val)
  592. }
  593. }
  594. },
  595. watch:{
  596. 'ipagination.current':function(n,o){
  597. console.log(n,o)
  598. this.HttpPost()
  599. }
  600. },
  601. activated() {
  602. console.log('activated')
  603. // this.getParticipateList()
  604. this.statDate = moment().subtract(1, 'day')
  605. moment().format('YYYY-MM-DD_HH:mm')
  606. postAction('/toutiao/videoReportDaily/getColumnJson', {
  607. columnType: 1
  608. }).then(res => {
  609. // console.log(res)
  610. if (res.success) {
  611. // console.log(JSON.parse(res.result))
  612. if(res.result){
  613. let columns = JSON.parse(res.result)
  614. if (columns.length) {
  615. if (columns.length >= columnsFixd.length) {
  616. columns.map((item, index) => {
  617. if (index > columnsFixd.length - 1) {
  618. item.sorter = function(a, b) {
  619. return a[item.dataIndex] - b[item.dataIndex]
  620. }
  621. }
  622. })
  623. columns = columns.slice(columnsFixd.length)
  624. this.columns = [...columnsFixd, ...columns]
  625. this.tableHandle()
  626. }
  627. // console.log(this.columns)
  628. }
  629. }
  630. }
  631. })
  632. this.tableHandle();
  633. },
  634. deactivated() {
  635. let arr = JSON.stringify(this.columns)
  636. // console.log(arr)
  637. postAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
  638. json: arr,
  639. columnType: 1
  640. }).then(res => {
  641. // console.log(res)
  642. })
  643. },
  644. filters: {
  645. toPercentage(val) {
  646. return (val * 100).toFixed(2) + '%'
  647. // return val
  648. },
  649. toshowTime(val) {
  650. // console.log(val, this.timedata)
  651. // return this.timedata[0] + '~' + this.timedata[1]
  652. return val
  653. },
  654. tofixed(val) {
  655. return Number(val).toFixed(2)
  656. }
  657. },
  658. mounted() {
  659. this.columns = [...columnsFixd, ...variableCol]
  660. // console.log('mounted')
  661. //请求自定义列的数据
  662. postAction('/toutiao/videoReportDaily/videoInfoListTotalExportExcelPermission').then(res => {
  663. console.log(res)
  664. if (res.success) {
  665. if (res.result) {
  666. this.exportExcelIsOk = true
  667. } else {
  668. this.exportExcelIsOk = false
  669. }
  670. }
  671. })
  672. //进入页面默认展示昨天到今天的数据
  673. this.dateRange=[moment().subtract(7,'days'),moment()]
  674. this.timedata=[moment().subtract(7,'days').format('YYYY-MM-DD'),moment().format('YYYY-MM-DD')]
  675. // this.loading=true;
  676. this.HttpPost()
  677. }
  678. }
  679. </script>
  680. <style lang="less">
  681. // .ant-table .ant-table-fixed-left .ant-table-thead {
  682. // height: 108px !important ;
  683. // }
  684. .vsummary{
  685. .ant-table .ant-table-thead .ant-table-header-column .ant-table-column-title {
  686. // display:block;
  687. white-space: normal;
  688. word-break: break-all;
  689. }
  690. }
  691. </style>
  692. <style lang="scss" scoped>
  693. .vsummary {
  694. width: 100%;
  695. height: 100%;
  696. }
  697. .xiangmuxuanze{
  698. margin-bottom: 20px;;
  699. }
  700. .timeDiv {
  701. display: flex;
  702. justify-content: space-between;
  703. }
  704. span {
  705. margin-left: 5px;
  706. }
  707. .myinput {
  708. width: 40%;
  709. }
  710. .addlist {
  711. float: left;
  712. width: 70%;
  713. border: 1px solid #eee;
  714. .selectionList {
  715. padding: 10px 15px;
  716. height: 450px;
  717. overflow: auto;
  718. .leibie {
  719. .leiName {
  720. font-size: 26px;
  721. text-align: left;
  722. }
  723. }
  724. .jutixiang {
  725. display: inline-block;
  726. width: 32%;
  727. box-sizing: border-box;
  728. padding: 10px 3px;
  729. }
  730. }
  731. }
  732. .listNum {
  733. float: right;
  734. width: 28%;
  735. border: 1px solid #eee;
  736. position: relative;
  737. }
  738. .zhuti {
  739. margin-top: 15px;
  740. overflow: hidden;
  741. p {
  742. height: 40px;
  743. line-height: 20px;
  744. padding: 10px 15px;
  745. background: rgb(249, 250, 253);
  746. border-bottom: 1px solid #eee;
  747. }
  748. #btn {
  749. position: absolute;
  750. right: 0;
  751. top: 5px;
  752. }
  753. .selectlist {
  754. width: 100%;
  755. list-style: none;
  756. margin: 0;
  757. height: 450px;
  758. padding: 0 15px 10px;
  759. overflow: auto;
  760. li {
  761. width: 100%;
  762. padding: 5px 8px;
  763. margin: 6px 0;
  764. border-radius: 10px;
  765. background: rgb(248, 248, 248);
  766. height: 32px;
  767. position: relative;
  768. span {
  769. width: 80%;
  770. height: 100%;
  771. display: inline-block;
  772. margin: 0 10px;
  773. // overflow:hidden;
  774. // text-overflow:ellipsis;
  775. // white-space: nowrap;
  776. }
  777. .listText {
  778. position: absolute;
  779. top: 2;
  780. left: 10;
  781. width: 40%;
  782. overflow: hidden;
  783. white-space: nowrap;
  784. text-overflow: ellipsis;
  785. }
  786. #closeStyle {
  787. position: absolute;
  788. top: 9px;
  789. right: 7px;
  790. }
  791. }
  792. }
  793. }
  794. </style>