KSvideoStatics.vue 43 KB

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