KSvideoStatics.vue 40 KB

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