KSvideoStatics.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  1. <template>
  2. <div class="vsummary">
  3. <div class="xiangmuxuanze" >
  4. <span >项目选择:</span>
  5. <Treeselect :appId.sync="appId" request="2,4" style="display: inline-block;position: relative;margin-left: 0px;"/>
  6. </div>
  7. <div class="timeDiv">
  8. <div style='display:flex;align-items: center;'>
  9. <span>时间范围:</span>
  10. <span @click="opendate">
  11. <DatePicker :openOptions='openOptions' :parentDate='dateValue' left='-100px'></DatePicker>
  12. </span>
  13. <span style="margin-left:15px">设计负责人:</span>
  14. <span >
  15. <!-- <a-input placeholder="请输入剪辑的名字" v-model="clip" style="width:140px" /> -->
  16. <a-select v-model="leaderId" style="width: 140px" allowClear show-search :filter-option="filterOption">
  17. <a-select-option v-for="item in designList" :key="item.userId" :value='item.userId'>
  18. {{item.companyName +'_'+item.userName }}
  19. </a-select-option>
  20. </a-select>
  21. </span>
  22. <span style="margin-left:15px">剪辑:</span>
  23. <span >
  24. <!-- <a-input placeholder="请输入剪辑的名字" v-model="clip" style="width:140px" /> -->
  25. <a-select v-model="clip" style="width: 140px" allowClear show-search :filter-option="filterOption">
  26. <a-select-option v-for="item in designList" :key="item.userId" :value='item.userId'>
  27. {{item.companyName +'_'+item.userName }}
  28. </a-select-option>
  29. </a-select>
  30. </span>
  31. <span style="margin-left:15px">拍摄:</span>
  32. <span >
  33. <!-- <a-input placeholder="请输入拍摄的名字" v-model="shot" style="width:140px" /> -->
  34. <a-select v-model="shot" style="width: 140px" allowClear show-search :filter-option="filterOption">
  35. <a-select-option v-for="item in designList" :key="item.userId" :value='item.userId'>
  36. {{item.companyName +'_'+item.userName }}
  37. </a-select-option>
  38. </a-select>
  39. </span>
  40. <span style="margin-left:15px">编导:</span>
  41. <span >
  42. <!-- <a-input placeholder="请输入编导的名字" v-model="plan" style="width:140px" /> -->
  43. <a-select v-model="plan" style="width: 140px" allowClear show-search :filter-option="filterOption">
  44. <a-select-option v-for="item in designList" :key="item.userId" :value='item.userId'>
  45. {{item.companyName +'_'+item.userName }}
  46. </a-select-option>
  47. </a-select>
  48. </span>
  49. </div>
  50. <a-button type="primary" @click="searchRes" :loading='searchLoading'>查询</a-button>
  51. </div>
  52. <!-- <div style="margin:15px 0" class="btndiv">
  53. <a-button type="primary" @click="customColumns">自定义列</a-button>
  54. <a-button type="default" style="float:right" @click="exportExcel" id="mybtn" v-show="exportExcelIsOk">导出报表</a-button>
  55. </div> -->
  56. <!-- <a-modal v-model="visible" title="自定义列" on-ok="handleOk" width="65%">
  57. <template slot="footer">
  58. <a-button key="back" @click="handleCancel">取消</a-button>
  59. <a-button key="submit" type="primary" :loading="loading" @click="handleOk">应用</a-button>
  60. </template>
  61. <a-input-search placeholder="输入要添加的列的名称" style="width: 40%" enter-button @search="onSearch" />
  62. <div class="zhuti">
  63. <div class="addlist">
  64. <p>可添加的列</p>
  65. <div class="selectionList">
  66. <selectComponent
  67. :showCol="listNum"
  68. @getshowlist="getshowlist"
  69. :fixedCol="columnsFixd"
  70. />
  71. </div>
  72. </div>
  73. <div class="listNum">
  74. <p>已选{{listNum.length}}列</p>
  75. <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
  76. <ul class="selectlist">
  77. <li v-for="(item,index) in listNum" :key="index">
  78. <span v-if=" index <4">
  79. <a-icon type="lock" />
  80. <span class="listText">{{item.title}}</span>
  81. </span>
  82. <span v-else-if=" index >=4">
  83. <a-icon type="menu" style="color:#ccc" />
  84. <span class="listText">{{item.title}}</span>
  85. <a-icon
  86. type="close"
  87. @click="deleteCol(item,index)"
  88. id="closeStyle"
  89. style="fontSize:12px;"
  90. />
  91. </span>
  92. </li>
  93. </ul>
  94. </div>
  95. </div>
  96. </a-modal> -->
  97. <a-modal v-model="relevantPeopleVisible" title="相关人员" :footer="null" :centered='true'>
  98. <p>编导:{{relevantPeopleData.planName || '暂无数据'}}</p>
  99. <p>剪辑:{{relevantPeopleData.clipName || '暂无数据'}}</p>
  100. <p>拍摄:{{relevantPeopleData.shotName || '暂无数据'}}</p>
  101. </a-modal>
  102. <a-modal v-model="Videovisible" title="视频详情" @ok="videoOk" :footer="null" width="50%">
  103. <video
  104. @click.stop
  105. class="video"
  106. :src="videoUrl"
  107. controls="controls"
  108. style="height:600px;width:100%"
  109. >您的浏览器不支持 video 标签。</video>
  110. </a-modal>
  111. <!-- 报表区域 -->
  112. <div class="tableBox">
  113. <div class="tableTop">
  114. <a-button type="primary" @click="customColumns">自定义列</a-button>
  115. <a-button type="default" style="float:right" @click="exportExcel('exportTable')" id="mybtn" :loading='exportLoading'>导出报表</a-button>
  116. </div>
  117. <a-table
  118. size="middle"
  119. :columns="columns"
  120. :dataSource="data"
  121. bordered
  122. id="outTable"
  123. :pagination="ipagination"
  124. :scroll="{ x: scrollX }"
  125. :loading="loading"
  126. ref="accountTable"
  127. :width="tableWidth"
  128. @change="sort"
  129. style="word-break: break-all;font-size:16px;font-weight:600"
  130. @customHeaderCell="customHeaderCell(columns)"
  131. >
  132. <div slot="coverUrl" slot-scope="test,records">
  133. <!-- {{test}} -->
  134. <img
  135. :src="test"
  136. alt
  137. style="width:80px"
  138. @click="openVideo(records.url)"
  139. />
  140. </div>
  141. <span slot="operation" slot-scope="text, record">
  142. <a href="javascript:;" @click="opendetail(text, record)" style="margin-right:5px">查看明细</a>
  143. </span>
  144. <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
  145. <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
  146. <span slot="clickMaterial" slot-scope="clickMaterial">{{ clickMaterial | formatCurrency }}</span>
  147. <span slot="showMaterial" slot-scope="showMaterial">{{ showMaterial | formatCurrency }}</span>
  148. <span slot="convertMaterial" slot-scope="convertMaterial">{{ convertMaterial | formatCurrency }}</span>
  149. <span slot="play25FeedBreak" slot-scope="play25FeedBreak">{{ play25FeedBreak | formatCurrency }}</span>
  150. <span slot="play50FeedBreak" slot-scope="play50FeedBreak">{{ play50FeedBreak | formatCurrency }}</span>
  151. <span slot="play75FeedBreak" slot-scope="play75FeedBreak">{{ play75FeedBreak | formatCurrency }}</span>
  152. <span slot="play100FeedBreak" slot-scope="play100FeedBreak">{{ play100FeedBreak | formatCurrency }}</span>
  153. <span slot="nextDayOpen" slot-scope="nextDayOpen">{{ nextDayOpen | formatCurrency }}</span>
  154. <span slot="downloadFinish" slot-scope="downloadFinish">{{ downloadFinish | formatCurrency }}</span>
  155. <span slot="downloadStart" slot-scope="downloadStart">{{ downloadStart | formatCurrency }}</span>
  156. <span slot="likeMaterial" slot-scope="likeMaterial">{{ likeMaterial | formatCurrency }}</span>
  157. <span slot="shareMaterial" slot-scope="shareMaterial">{{ shareMaterial | formatCurrency }}</span>
  158. <span slot="register" slot-scope="register">{{ register | formatCurrency }}</span>
  159. <span slot="follow" slot-scope="follow">{{ follow | formatCurrency }}</span>
  160. <span slot="formCount" slot-scope="formCount">{{ formCount | formatCurrency }}</span>
  161. <span slot="formCountCost" slot-scope="formCountCost">{{ formCountCost | decimalsHandle }}</span>
  162. <span slot="aClick" slot-scope="aClick">{{ aClick | formatCurrency }}</span>
  163. <span slot="photoShow" slot-scope="photoShow">{{ photoShow | formatCurrency }}</span>
  164. <span slot="photoClick" slot-scope="photoClick">{{ photoClick | formatCurrency }}</span>
  165. <span slot="bClick" slot-scope="bClick">{{ bClick | formatCurrency }}</span>
  166. <span slot="active" slot-scope="active">{{ active | formatCurrency }}</span>
  167. <span slot="submit" slot-scope="submit">{{ submit | formatCurrency }}</span>
  168. <span slot="eventCreditGrantLandingPage" slot-scope="eventCreditGrantLandingPage">{{ eventCreditGrantLandingPage | formatCurrency }}</span>
  169. <span slot="submitCost" slot-scope="submitCost">{{ submitCost | decimalsHandle }}</span>
  170. <span slot="eventCreditGrantLandingPageCost" slot-scope="eventCreditGrantLandingPageCost">{{ eventCreditGrantLandingPageCost | decimalsHandle }}</span>
  171. <span slot="submitRate" slot-scope="submitRate">{{ submitRate | toPercentage }}</span>
  172. <span slot="eventCreditGrantLandingPageRate" slot-scope="eventCreditGrantLandingPageRate">{{ eventCreditGrantLandingPageRate | toPercentage }}</span>
  173. <span
  174. slot="play25FeedBreakRate"
  175. slot-scope="play25FeedBreakRate"
  176. >{{ play25FeedBreakRate | toPercentage }}</span>
  177. <span slot="playOverRate" slot-scope="playOverRate">{{ playOverRate | toPercentage }}</span>
  178. <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
  179. <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
  180. <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
  181. <span slot="cpc" slot-scope="cpc">{{ cpc | decimalsHandle }}</span>
  182. <span slot="cpm" slot-scope="cpm">{{ cpm | decimalsHandle }}</span>
  183. <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
  184. <span
  185. slot="installFinishRate"
  186. slot-scope="installFinishRate"
  187. >{{ installFinishRate | toPercentage }}</span>
  188. <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | toPercentage }}</span>
  189. <span slot="activePayCost" slot-scope="activePayCost">{{ activePayCost | decimalsHandle }}</span>
  190. <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | decimalsHandle }}</span>
  191. <span slot="validPlayCost" slot-scope="validPlayCost">{{ validPlayCost | decimalsHandle }}</span>
  192. <span slot="activeCost" slot-scope="activeCost">{{ activeCost | decimalsHandle }}</span>
  193. <span
  194. slot="gameAddictionCost"
  195. slot-scope="gameAddictionCost"
  196. >{{ gameAddictionCost | decimalsHandle }}</span>
  197. <span
  198. slot="downloadFinishCost"
  199. slot-scope="downloadFinishCost"
  200. >{{ downloadFinishCost | decimalsHandle }}</span>
  201. <span
  202. slot="downloadStartCost"
  203. slot-scope="downloadStartCost"
  204. >{{ downloadStartCost | decimalsHandle }}</span>
  205. <span
  206. slot="installFinishCost"
  207. slot-scope="installFinishCost"
  208. >{{ installFinishCost | decimalsHandle }}</span>
  209. <span slot="convertCost" slot-scope="convertCost">{{ convertCost | decimalsHandle }}</span>
  210. <span
  211. slot="activeRegisterCost"
  212. slot-scope="activeRegisterCost"
  213. >{{ activeRegisterCost | decimalsHandle }}</span>
  214. <span
  215. slot="downloadStartRate"
  216. slot-scope="downloadStartRate"
  217. >{{ downloadStartRate | toPercentage }}</span>
  218. <!-- <span
  219. slot="downloadFinishRate"
  220. slot-scope="downloadFinishRate"
  221. >{{ downloadFinishRate | toPercentage }}</span>
  222. <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
  223. <span
  224. slot="activeRegisterRate"
  225. slot-scope="activeRegisterRate"
  226. >{{ activeRegisterRate | toPercentage }}</span> -->
  227. <span
  228. slot="gameAddictionRate"
  229. slot-scope="gameAddictionRate"
  230. >{{ gameAddictionRate | toPercentage }}</span>
  231. <!-- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span> -->
  232. <span slot="relativePeople" slot-scope="text,record">
  233. <!-- <a href="javascript:;" @click.stop="showRelevantPeople(record)">查看相关人员</a> -->
  234. <p>负责人:{{record.designLeader || '无'}}</p>
  235. <p>剪辑:{{record.clip || '无'}}</p>
  236. <p>拍摄:{{record.shot || '无'}}</p>
  237. <p>编导:{{record.plan || '无'}}</p>
  238. </span>
  239. </a-table>
  240. </div>
  241. <customColumn :visible='visible' :listNum='listNum' :fiexColumn='columnsFixd' :mediaType='2' @closeCustomColumn='closeCustomColumn' @changeColumn='changeColumn' />
  242. <!-- 明细表 -->
  243. <a-modal v-model="visibleDetail" title="详细信息" width="50%" :footer="null" >
  244. <a-button type="default" @click="exportExcel('exportDetail')" id="mybtn" >导出报表</a-button>
  245. <a-table
  246. :columns="detailColumn"
  247. :data-source="detailData"
  248. bordered
  249. tableLayout="auto"
  250. :pagination="false"
  251. :loading='detailLoading'
  252. style="word-break: break-all;"
  253. >
  254. <!-- <span slot="huanbi" slot-scope="huanbi">{{ huanbi | toPercentage }}</span> -->
  255. <span slot="advertiserName" slot-scope="text">{{ text || '暂未填写该数据' }}</span>
  256. <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
  257. </a-table>
  258. </a-modal>
  259. </div>
  260. </template>
  261. <script>
  262. import moment from 'moment'
  263. import { JeecgListMixin } from '@/mixins/ipagination'
  264. import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
  265. import selectComponent from './selectComponent'
  266. import Treeselect from '../components/Treeselect'
  267. import DatePicker from '@/components/DatePicker'
  268. import customColumn from '../components/customColumn.vue'
  269. const columnsFixd = [
  270. {
  271. title: '视频',
  272. dataIndex: 'coverUrl',
  273. align: 'center',
  274. width: 100,
  275. fixed: 'left',
  276. key: 'coverUrl',
  277. scopedSlots: { customRender: 'coverUrl' }
  278. },
  279. {
  280. title: '视频名称',
  281. dataIndex: 'materialName',
  282. align: 'center',
  283. width: 130,
  284. fixed: 'left'
  285. },
  286. {
  287. title: '视频ID',
  288. dataIndex: 'signature',
  289. align: 'center',
  290. width: 150,
  291. fixed: 'left'
  292. },
  293. {
  294. title: '项目名称',
  295. dataIndex: 'projectName',
  296. align: 'center',
  297. width: 150,
  298. fixed: 'left'
  299. },
  300. {
  301. title: '渠道',
  302. dataIndex: 'channel',
  303. align: 'center',
  304. width: 150,
  305. fixed: 'left'
  306. },
  307. {
  308. title:'相关人员',
  309. dataIndex:'relativePeople',
  310. key:'relativePeople',
  311. scopedSlots: { customRender: 'relativePeople' },
  312. align: 'center',
  313. width:150,
  314. fixed: 'left'
  315. },
  316. // {
  317. // title:'操作',
  318. // dataIndex:'operation',
  319. // key:'operation',
  320. // scopedSlots: { customRender: 'operation' },
  321. // align: 'center',
  322. // width:90,
  323. // fixed: 'left'
  324. // },
  325. {
  326. title: '创建时间',
  327. dataIndex: 'createTime',
  328. scopedSlots: { customRender: 'createTime' },
  329. align: 'center',
  330. sorter: () => {}
  331. },
  332. ]
  333. let show = 0
  334. const initVariableColimns=[
  335. {
  336. title: '消耗(元)',
  337. dataIndex: 'cost',
  338. tip: '广告在投放期间的花费总额',
  339. align: 'center',
  340. scopedSlots: { customRender: 'cost' },
  341. sorter: () => {}
  342. },
  343. // {
  344. // title: '折后消耗(元)',
  345. // dataIndex: 'discountCost',
  346. // width:150,
  347. // tip: '广告在投放期间的花费总额',
  348. // align: 'center',
  349. // scopedSlots: { customRender: 'discountCost' },
  350. // sorter: () => {}
  351. // },
  352. {
  353. title: '封面曝光数',
  354. dataIndex: 'photoShow',
  355. tip: '广告在瀑布流被观看次数',
  356. align: 'center',
  357. scopedSlots: { customRender: 'photoShow' },
  358. sorter:() => {}
  359. },
  360. {
  361. title: '封面点击数',
  362. dataIndex: 'photoClick',
  363. tip: '用户点击封面进入视频播放页的次数(数据会进行反作弊去重)',
  364. align: 'center',
  365. scopedSlots: { customRender: 'photoClick' },
  366. sorter: () => {}
  367. },
  368. {
  369. title: '封面点击率',
  370. dataIndex: 'clickRate',
  371. tip: '封面点击数占封面展示数百分比',
  372. align: 'center',
  373. scopedSlots: { customRender: 'clickRate' },
  374. sorter:() => {}
  375. },
  376. {
  377. title: '素材曝光数',
  378. dataIndex: 'aClick',
  379. tip: '用户进入视频播放页观看的次数(数据会进行反作弊去重)',
  380. align: 'center',
  381. scopedSlots: { customRender: 'aClick' },
  382. sorter:() => {}
  383. },
  384. {
  385. title: '行为数',
  386. dataIndex: 'bClick',
  387. tip: '用户在视频播放页单击转化按钮的次数/展示数*100%',
  388. align: 'center',
  389. scopedSlots: { customRender: 'bClick' },
  390. sorter:() => {}
  391. },
  392. {
  393. title: '行为率',
  394. dataIndex: 'bClickRate',
  395. tip: '行为数占素材曝光数百分比',
  396. align: 'center',
  397. scopedSlots: { customRender: 'bClickRate' },
  398. sorter:() => {}
  399. },
  400. {
  401. title: '平均千次封面曝光花费(元)',
  402. dataIndex: 'cpm',
  403. tip: '花费/封面曝光数*1000',
  404. align: 'center',
  405. scopedSlots: { customRender: 'cpm' },
  406. sorter:() => {}
  407. },
  408. {
  409. title: '平均封面点击单价(元)',
  410. dataIndex: 'cpc',
  411. tip: '花费/封面点击数',
  412. align: 'center',
  413. scopedSlots: { customRender: 'cpc' },
  414. sorter:() => {}
  415. },
  416. {
  417. title: '平均行为单价(元)',
  418. dataIndex: 'cpb',
  419. tip: '总花费/行为数',
  420. align: 'center',
  421. scopedSlots: { customRender: 'cpb' },
  422. sorter:() => {}
  423. },
  424. {
  425. title: '3s播放数',
  426. dataIndex: 'play3sCount',
  427. tip: '总花费/行为数',
  428. align: 'center',
  429. scopedSlots: { customRender: 'play3sCount' },
  430. sorter:() => {}
  431. },
  432. {
  433. title: '3s播放率',
  434. dataIndex: 'play3sRate',
  435. tip: '总花费/行为数',
  436. align: 'center',
  437. scopedSlots: { customRender: 'play3sRate' },
  438. sorter:() => {}
  439. },
  440. ]
  441. let detailColumn=[
  442. {
  443. title: '客户',
  444. dataIndex: 'advertiserName',
  445. align: 'center',
  446. scopedSlots: { customRender: 'advertiserName' },
  447. },
  448. {
  449. title: '项目名称',
  450. dataIndex: 'projectName',
  451. align: 'center',
  452. width: 150,
  453. },
  454. {
  455. title: '时间',
  456. dataIndex: 'statDate',
  457. align: 'center',
  458. width: 120
  459. },
  460. {
  461. title: '消耗',
  462. dataIndex: 'cost',
  463. scopedSlots: { customRender: 'cost' },
  464. align: 'center',
  465. },
  466. ]
  467. export default {
  468. data() {
  469. return {
  470. searchLoading:false,
  471. designList:[],
  472. detailLoading:false,
  473. clip:undefined,
  474. shot:undefined,
  475. plan:undefined,
  476. leaderId:undefined,
  477. //明细数据
  478. visibleDetail:false,
  479. detailColumn,
  480. detailData: [],
  481. exportLoading:false,
  482. target:'cost',
  483. order:'desc',
  484. type:0,
  485. dateValue:[moment().subtract(1,'days'),moment().subtract(1,'days')],
  486. openOptions:false,
  487. relevantPeopleVisible:false,
  488. relevantPeopleData:{},
  489. roleCode: localStorage.getItem('roleCode'),
  490. //下拉选择框的数据
  491. projectArr:[],
  492. selectValue:'',
  493. appId:[],
  494. //设置表格的列宽
  495. tableWidth: '',
  496. //gudinglie
  497. columnsFixd: columnsFixd,
  498. //是否打开视频
  499. Videovisible: false,
  500. videoUrl: '',
  501. //是否显示导出按钮
  502. exportExcelIsOk: true,
  503. consumeValue: 0,
  504. columns:[...columnsFixd,...initVariableColimns] ,//table的表头
  505. addColumns: [],
  506. data: [],
  507. totalSelect: 0,
  508. daysFlag: false,
  509. dateRange: [],
  510. dataElse: [],
  511. loading: false,
  512. visible: false,
  513. //自定义列的搜索框
  514. searchInput: '',
  515. //弹出框中现实的选中列数
  516. scrollX: 0,
  517. listNum: [],
  518. //
  519. form: [],
  520. videoID: '',
  521. timedata: [],
  522. ipagination: {
  523. current: 1,
  524. pageSize: 10,
  525. showTotal: (total, range) => {
  526. return range[0] + "-" + range[1] + " 共" + total + "条"
  527. },
  528. showQuickJumper: true,
  529. showSizeChanger:true,
  530. pageSizeOptions: ['10', '30', '50'],
  531. total: 0,
  532. onChange: (current, pageSize) => {
  533. // 切换分页时的回调,
  534. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  535. this.ipagination.current = current;
  536. this.ipagination.pageSize= pageSize;
  537. }
  538. },
  539. }
  540. },
  541. mixins: [JeecgListMixin],
  542. components: {
  543. selectComponent,
  544. Treeselect,
  545. DatePicker,
  546. customColumn,
  547. },
  548. watch:{
  549. },
  550. methods: {
  551. filterOption(input, option) {
  552. return (
  553. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  554. );
  555. },
  556. //点击查看明细按钮的事件
  557. opendetail(text, record) {
  558. console.log(text, record)
  559. this.visibleDetail = true
  560. this.detailData = []
  561. this.detailLoading=true;
  562. this.signature=record.signature
  563. // console.log(this.signature)
  564. postAction('/ctop/kuaishou/videoReport/detail', {
  565. startDate: this.dateValue[0].format('YYYY-MM-DD'),
  566. endDate: this.dateValue[1].format('YYYY-MM-DD'),
  567. signature: record.signature,
  568. accountIds:this.appId
  569. }).then(res => {
  570. console.log(res)
  571. this.detailLoading=false;
  572. if (res.success) {
  573. let result = res.result
  574. // this.detailData.push({ ...result, key: 1 })
  575. result.map((item, index) => {
  576. item.key = index
  577. })
  578. this.detailData = result
  579. }
  580. })
  581. },
  582. closeCustomColumn(){
  583. this.visible=false;
  584. },
  585. //自定义之后修改父元素表头
  586. changeColumn(val){
  587. console.log(val)
  588. this.columns=[...val];
  589. if(this.columns.length> this.columnsFixd.length&&this.columns.length<9){
  590. this.scrollX=0;
  591. this.columns.forEach((element,index) => {
  592. if(index<this.columnsFixd.length){
  593. element.width='auto'
  594. element.fixed=false
  595. }
  596. });
  597. // this.scrollX=2000+200*(this.columns.length-this.columnsFixd.length)
  598. }else if(this.columns.length>=9){
  599. this.columns.forEach((element,index) => {
  600. if(index<this.columnsFixd.length-1){
  601. element.width=120
  602. element.fixed='left'
  603. }
  604. });
  605. this.scrollX=1000+200*(this.columns.length-this.columnsFixd.length)
  606. } else{
  607. this.scrollX=0;
  608. this.columns.forEach(element => {
  609. element.width='auto'
  610. element.fixed=false
  611. });
  612. }
  613. },
  614. // 日期的开关
  615. //打开日期框
  616. opendate(){
  617. this.openOptions=!this.openOptions;
  618. // console.log(this.openOptions)
  619. },
  620. opendateClose(){
  621. this.openOptions=false;
  622. // console.log(this.openOptions)
  623. },
  624. // 查看相关人员
  625. showRelevantPeople(record){
  626. this.relevantPeopleVisible=true;
  627. console.log(record)
  628. getAction('/ctop/materialAscription/getDetail',{
  629. code:record.signature
  630. }).then(res=>{
  631. console.log(res);
  632. this.relevantPeopleData=[];
  633. if(res.result&&res.success){
  634. this.relevantPeopleData=res.result
  635. }
  636. })
  637. },
  638. sort(pagination, filters, sorter, { currentDataSource }){
  639. console.log(pagination, filters, sorter)
  640. this.ipagination.current=pagination.current;
  641. this.ipagination.pageSize=pagination.pageSize
  642. if(sorter.order == 'ascend'){
  643. this.order='asc'
  644. this.target=sorter.columnKey;
  645. }else if(sorter.order == 'descend'){
  646. this.order='desc'
  647. this.target=sorter.columnKey;
  648. }else{
  649. this.target='cost',
  650. this.order='desc'
  651. }
  652. this.HttpPost();
  653. },
  654. moment,
  655. //select切换---项目
  656. selectChange(key){
  657. this.selectValue=key;
  658. },
  659. //打开视频
  660. openVideo(val) {
  661. this.Videovisible = true
  662. this.videoUrl = val
  663. },
  664. videoOk() {
  665. this.Videovisible = false
  666. },
  667. disabledDate(current) {
  668. // console.log(current)
  669. return current && current > moment().subtract(1, 'day')
  670. },
  671. consumeOnChange() {},
  672. //查询按钮
  673. searchRes() {
  674. this.date = []
  675. this.ipagination.current=1
  676. this.HttpPost()
  677. },
  678. //网络请求table数据函数
  679. HttpPost(){
  680. this.loading=true;
  681. this.searchLoading=true
  682. show = 0
  683. postAction('/ctop/kuaishou/videoReport/list', {
  684. startDate: this.dateValue[0].format('YYYY-MM-DD'),
  685. endDate: this.dateValue[1].format('YYYY-MM-DD'),
  686. pageNo:this.ipagination.current,
  687. pageSize:this.ipagination.pageSize,
  688. accountIds:this.appId,
  689. target:this.target,
  690. order:this.order,
  691. clipId:this.clip?this.clip:'',
  692. shotId:this.shot?this.shot:'',
  693. planId:this.plan?this.plan:'',
  694. leaderId:this.leaderId?this.leaderId:''
  695. }).then(res => {
  696. let resArr = []
  697. this.data=[];
  698. this.loading = false;
  699. this.searchLoading=false;
  700. if (res.success) {
  701. // let result = res.result
  702. // this.data.push({ ...result, key: 1 })
  703. // result.map((item, index) => {
  704. // item.key = index
  705. // })
  706. this.data = res.result.list.map((item,index)=>{
  707. return {
  708. ...item,
  709. key:index
  710. }
  711. })
  712. this.ipagination.total = res.result.total
  713. this.loading = false
  714. }else{
  715. this.loading = false
  716. }
  717. })
  718. },
  719. //导出报表
  720. exportExcel(exportType) {
  721. this.exportLoading=true;
  722. let columns=[]
  723. if(exportType=='exportTable'){
  724. let column = this.columns.map((item, index) => {
  725. return item.dataIndex
  726. })
  727. columns=column.splice(this.columnsFixd.length)
  728. }
  729. downFilePost('/ctop/kuaishou/videoReport/excelV2', {
  730. columns,
  731. target:this.target,
  732. order:this.order,
  733. startDate: this.dateValue[0].format('YYYY-MM-DD'),
  734. endDate: this.dateValue[1].format('YYYY-MM-DD'),
  735. accountIds:this.appId,
  736. exportType,
  737. signature: this.signature,
  738. clipId:this.clip?this.clip:'',
  739. shotId:this.shot?this.shot:'',
  740. planId:this.plan?this.plan:'',
  741. leaderId:this.leaderId?this.leaderId:''
  742. }).then(res => {
  743. this.exportLoading=false;
  744. let blob = new Blob([res], {
  745. type:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  746. })
  747. let downloadElement = document.createElement('a')
  748. let href = window.URL.createObjectURL(blob) //创建下载的链接
  749. downloadElement.href = href
  750. downloadElement.download = `${this.dateValue[0].format('YYYY-MM-DD')}~${this.dateValue[1].format('YYYY-MM-DD')}视频汇总.xlsx` //下载后文件名
  751. document.body.appendChild(downloadElement)
  752. downloadElement.click() //点击下载
  753. document.body.removeChild(downloadElement) //下载完成移除元素
  754. window.URL.revokeObjectURL(href) //释放掉blob对象
  755. })
  756. },
  757. //日期选择回调
  758. dateChange(data, dataString) {
  759. if (data.length) {
  760. this.timedata = dataString
  761. this.dateRange[0] = data[0]
  762. this.totalSelect = (data[1]._d - data[0]._d) / (24 * 60 * 60 * 1000) + 1
  763. this.daysFlag = true
  764. if (this.totalSelect > 92) {
  765. this.$message.error('时间跨度太长啦,选小一点好嘛?')
  766. this.daysFlag = false
  767. this.dateRange = []
  768. }
  769. } else {
  770. this.daysFlag = false
  771. this.dateRange = []
  772. }
  773. },
  774. //弹出框打开,自定义列
  775. customColumns() {
  776. this.visible = true
  777. this.listNum = [...this.columns]
  778. },
  779. tableHandle() {
  780. // this.listNum = [...this.columns]
  781. // console.log(this.listNum.length, this.columns)
  782. // if (this.listNum.length >= 9 || this.columns.length >= 9) {
  783. // this.tableWidth = 160
  784. // this.scrollX = this.columns.length * 160
  785. // // console.log(this.scrollX)
  786. // } else {
  787. // this.scrollX = 2000
  788. // }
  789. },
  790. //弹出框确定
  791. handleOk(e) {
  792. this.loading = false
  793. this.visible = false
  794. if (this.listNum.length >= 10) {
  795. let newlist = this.listNum.slice(columnsFixd.length)
  796. console.log(newlist)
  797. this.columns = [...columnsFixd, ...newlist]
  798. } else {
  799. this.columns = [...this.listNum]
  800. }
  801. if (this.listNum.length == 4) {
  802. // console.log(this.listNum.length)
  803. this.scrollX = 0
  804. this.columns.map((item, index) => {
  805. item.width = 500
  806. })
  807. // console.log(1)
  808. } else {
  809. this.columns.map((item, index) => {
  810. if (index == 2 || index == 0) {
  811. item.width = 150
  812. } else if (index == 1 || index == 2) {
  813. item.width = 100
  814. }
  815. })
  816. // console.log(2)
  817. }
  818. this.tableHandle()
  819. },
  820. //弹出框取消按钮
  821. handleCancel(e) {
  822. this.visible = false
  823. },
  824. loadShow(){
  825. show++
  826. if(this.data.length>0){
  827. if(show == (this.data.length*2)){
  828. this.data = [...this.data]
  829. }
  830. }
  831. },
  832. // 获取设计人员
  833. getDesignList(){
  834. postAction('/ctop/kuaishou/videoReport/getDesignList').then(res=>{
  835. console.log(res);
  836. if(res.success){
  837. this.designList=res.result
  838. }
  839. })
  840. }
  841. },
  842. activated() {
  843. console.log('activated')
  844. // this.getParticipateList()
  845. this.statDate = moment().subtract(1, 'day')
  846. moment().format('YYYY-MM-DD_HH:mm')
  847. postAction('/toutiao/videoReportDaily/getColumnJson', {
  848. columnType: 4
  849. }).then(res => {
  850. // console.log(res)
  851. if (res.success) {
  852. // console.log(JSON.parse(res.result))
  853. if(res.result){
  854. let columns = JSON.parse(res.result)
  855. if (columns.length) {
  856. if (columns.length >= columnsFixd.length) {
  857. columns.map((item, index) => {
  858. if (index > columnsFixd.length - 1) {
  859. item.sorter = function(a, b) {
  860. }
  861. }
  862. })
  863. columns = columns.slice(columnsFixd.length)
  864. this.columns = [...columnsFixd, ...columns]
  865. // this.tableHandle()
  866. }
  867. // console.log(this.columns)
  868. }
  869. }
  870. this.changeColumn(this.columns)
  871. }
  872. })
  873. },
  874. // deactivated() {
  875. // let arr = JSON.stringify(this.columns)
  876. // console.log(arr)
  877. // postAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
  878. // json: arr,
  879. // columnType: 4
  880. // }).then(res => {
  881. // // console.log(res)
  882. // })
  883. // },
  884. beforeDestroy() {
  885. let arr = JSON.stringify(this.columns)
  886. console.log(arr)
  887. postAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
  888. json: arr,
  889. columnType: 4
  890. }).then(res => {
  891. // console.log(res)
  892. })
  893. },
  894. filters: {
  895. toshowTime(val) {
  896. // console.log(val, this.timedata)
  897. // return this.timedata[0] + '~' + this.timedata[1]
  898. return val
  899. },
  900. toPercentage(val) {
  901. if(val){
  902. if(typeof val != 'string'){
  903. return (val * 100).toFixed(2) + '%'
  904. }else{
  905. return val
  906. }
  907. }else if(typeof val =='string'){
  908. return val
  909. }
  910. else{
  911. return 0
  912. }
  913. },
  914. //保留两位小数并且变成货币格式
  915. decimalsHandle(val){
  916. // console.log(val)
  917. if(val && typeof val !='string'){
  918. if(val>=0){
  919. val=parseFloat(val).toFixed(2);
  920. let numberStr = val.toString()
  921. let str = numberStr.split('.')
  922. let str0=str[0].split('').reverse();
  923. for (let i = 0; i < str0.length; i++) {
  924. if ((i + 1) % 4 === 0) {
  925. str0.splice(i, 0, ',')
  926. }
  927. }
  928. str0.reverse()
  929. let handleResult = ''
  930. for (let j = 0; j < str0.length; j++) {
  931. handleResult += str0[j]
  932. }
  933. return handleResult+'.'+str[1]
  934. }else{
  935. val=parseFloat(val).toFixed(2);
  936. let numberStr = val.toString()
  937. let str = numberStr.split('.')
  938. let str0=str[0].substr(1).split('').reverse();
  939. for (let i = 0; i < str0.length; i++) {
  940. if ((i + 1) % 4 === 0) {
  941. str0.splice(i, 0, ',')
  942. }
  943. }
  944. str0.reverse()
  945. let handleResult = ''
  946. for (let j = 0; j < str0.length; j++) {
  947. handleResult += str0[j]
  948. }
  949. return '-'+handleResult+'.'+str[1]
  950. }
  951. }else if(typeof val =='string'){
  952. return val
  953. }
  954. else{
  955. return 0
  956. }
  957. },
  958. //变成货币格式
  959. formatCurrency(val){
  960. if((val||val==0)&& typeof val !='string'){
  961. let numberStr = val.toString()
  962. let str = numberStr.split('').reverse()
  963. for (let i = 0; i < str.length; i++) {
  964. if ((i + 1) % 4 === 0) {
  965. str.splice(i, 0, ',')
  966. }
  967. }
  968. str.reverse()
  969. let handleResult = ''
  970. for (let j = 0; j < str.length; j++) {
  971. handleResult += str[j]
  972. }
  973. return handleResult
  974. }else if(typeof val =='string'){
  975. return val
  976. }
  977. else{
  978. return '-'
  979. }
  980. }
  981. },
  982. mounted() {
  983. this.getDesignList()
  984. //请求自定义列的数据
  985. postAction('/toutiao/videoReportDaily/videoInfoListTotalExportExcelPermission').then(res => {
  986. console.log(res)
  987. if (res.success) {
  988. if (res.result) {
  989. this.exportExcelIsOk = true
  990. } else {
  991. this.exportExcelIsOk = false
  992. }
  993. }
  994. })
  995. //进入页面默认展示昨天到今天的数据
  996. this.dateRange=[moment().subtract(7,'days'),moment()]
  997. this.timedata=[moment().subtract(7,'days').format('YYYY-MM-DD'),moment().format('YYYY-MM-DD')]
  998. // this.loading=true;
  999. this.HttpPost()
  1000. postAction('/toutiao/videoReportDaily/getColumnJson', {
  1001. columnType: 4
  1002. }).then(res => {
  1003. // console.log(res)
  1004. if (res.success) {
  1005. // console.log(JSON.parse(res.result))
  1006. if(res.result){
  1007. let columns = JSON.parse(res.result)
  1008. if (columns.length) {
  1009. if (columns.length >= columnsFixd.length) {
  1010. columns.map((item, index) => {
  1011. if (index > columnsFixd.length - 1) {
  1012. item.sorter = function(a, b) {
  1013. }
  1014. }
  1015. })
  1016. columns = columns.slice(columnsFixd.length)
  1017. this.columns = [...columnsFixd, ...columns]
  1018. // this.tableHandle()
  1019. }
  1020. // console.log(this.columns)
  1021. }
  1022. }
  1023. this.changeColumn(this.columns)
  1024. }
  1025. })
  1026. }
  1027. }
  1028. </script>
  1029. <style lang="less">
  1030. // .ant-table .ant-table-fixed-left .ant-table-thead {
  1031. // height: 108px !important ;
  1032. // }
  1033. .vsummary{
  1034. .ant-table .ant-table-thead .ant-table-header-column .ant-table-column-title {
  1035. // display:block;
  1036. white-space: normal;
  1037. word-break: break-all;
  1038. }
  1039. }
  1040. </style>
  1041. <style lang="scss" scoped>
  1042. .vsummary {
  1043. width: 100%;
  1044. height: 100%;
  1045. background: white;
  1046. padding: 15px 30px;
  1047. .tableBox{
  1048. background-color: #fff;
  1049. margin: 15px 0px;
  1050. padding: 15px 0px;
  1051. .tableTop{
  1052. position: relative;
  1053. padding-bottom: 15px;
  1054. border-bottom: 1px solid #e0e0e0;
  1055. .selectTime{
  1056. margin-right: 20px;
  1057. }
  1058. .add{
  1059. position: absolute;
  1060. top: 0;
  1061. right: 0;
  1062. }
  1063. }
  1064. }
  1065. }
  1066. .xiangmuxuanze{
  1067. margin-bottom: 20px;
  1068. display: flex;
  1069. align-items: center;
  1070. }
  1071. .timeDiv {
  1072. display: flex;
  1073. justify-content: space-between;
  1074. }
  1075. span {
  1076. margin-left: 5px;
  1077. }
  1078. .myinput {
  1079. width: 40%;
  1080. }
  1081. .addlist {
  1082. float: left;
  1083. width: 70%;
  1084. border: 1px solid #eee;
  1085. .selectionList {
  1086. padding: 10px 15px;
  1087. height: 450px;
  1088. overflow: auto;
  1089. .leibie {
  1090. .leiName {
  1091. font-size: 26px;
  1092. text-align: left;
  1093. }
  1094. }
  1095. .jutixiang {
  1096. display: inline-block;
  1097. width: 32%;
  1098. box-sizing: border-box;
  1099. padding: 10px 3px;
  1100. }
  1101. }
  1102. }
  1103. .listNum {
  1104. float: right;
  1105. width: 28%;
  1106. border: 1px solid #eee;
  1107. position: relative;
  1108. }
  1109. .zhuti {
  1110. margin-top: 15px;
  1111. overflow: hidden;
  1112. p {
  1113. height: 40px;
  1114. line-height: 20px;
  1115. padding: 10px 15px;
  1116. background: rgb(249, 250, 253);
  1117. border-bottom: 1px solid #eee;
  1118. }
  1119. #btn {
  1120. position: absolute;
  1121. right: 0;
  1122. top: 5px;
  1123. }
  1124. .selectlist {
  1125. width: 100%;
  1126. list-style: none;
  1127. margin: 0;
  1128. height: 450px;
  1129. padding: 0 15px 10px;
  1130. overflow: auto;
  1131. li {
  1132. width: 100%;
  1133. padding: 5px 8px;
  1134. margin: 6px 0;
  1135. border-radius: 10px;
  1136. background: rgb(248, 248, 248);
  1137. height: 32px;
  1138. position: relative;
  1139. span {
  1140. width: 80%;
  1141. height: 100%;
  1142. display: inline-block;
  1143. margin: 0 10px;
  1144. // overflow:hidden;
  1145. // text-overflow:ellipsis;
  1146. // white-space: nowrap;
  1147. }
  1148. .listText {
  1149. position: absolute;
  1150. top: 2;
  1151. left: 10;
  1152. width: 40%;
  1153. overflow: hidden;
  1154. white-space: nowrap;
  1155. text-overflow: ellipsis;
  1156. }
  1157. #closeStyle {
  1158. position: absolute;
  1159. top: 9px;
  1160. right: 7px;
  1161. }
  1162. }
  1163. }
  1164. }
  1165. #mybtn {
  1166. margin: 0 10px 15px 0;
  1167. }
  1168. </style>