marterialDetail.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <style lang="scss" scoped>
  2. #office-iframe {
  3. height: 800px;
  4. }
  5. </style>
  6. <style>
  7. .info-detail .ant-descriptions-item-content {
  8. font-weight: bold;
  9. }
  10. .info-detail .ant-descriptions-item-label {
  11. color: darkgray;
  12. min-width: 80px;
  13. }
  14. .info-detail table tr td {
  15. border: 0;
  16. }
  17. .show-data span {
  18. display: inline-block;
  19. width: 85px;
  20. }
  21. </style>
  22. <template>
  23. <a-row :gutter="10">
  24. <a-spin :spinning="spinning">
  25. <a-col :sm="6" style="margin-bottom: 20px; z-index: 10">
  26. <a-card class="search-box" style="min-height: 500px">
  27. <video class="video" :src="materialInfo.url" controls="controls" style="width: 100%" v-if="materialInfo">
  28. 您的浏览器不支持 video 标签。
  29. </video>
  30. <img :src="noImg" alt="" v-else style="width: 100%" />
  31. </a-card>
  32. </a-col>
  33. <a-col :sm="18" style="margin-bottom: 20px; z-index: 10">
  34. <a-card class="search-box info-detail" style="min-height: 300px">
  35. <a-descriptions title="视频信息" v-if="materialInfo">
  36. <a-descriptions-item label="素材标题" :span="3"> {{ materialInfo.materialName }} </a-descriptions-item>
  37. <a-descriptions-item label="素材ID"> {{ materialInfo.materialId }} </a-descriptions-item>
  38. <a-descriptions-item label="上线时间">
  39. {{ materialInfo.createTime ? materialInfo.createTime.split(' ')[0] : '无' }}
  40. </a-descriptions-item>
  41. <a-descriptions-item label="素材类型">
  42. {{ materialInfo.materialType == '' ? '无' : materialInfo.materialType }}
  43. </a-descriptions-item>
  44. <a-descriptions-item label="视频时长"> {{ materialInfo.second }}s </a-descriptions-item>
  45. <a-descriptions-item label="视频大小">
  46. {{ materialInfo.size }}
  47. </a-descriptions-item>
  48. <a-descriptions-item label="视频尺寸">
  49. {{ materialInfo.width }}*{{ materialInfo.height }}
  50. </a-descriptions-item>
  51. <a-descriptions-item label="投放媒体">
  52. {{ materialInfo.madia }}
  53. </a-descriptions-item>
  54. <a-descriptions-item label="素材渠道">
  55. {{ materialInfo.channelType }}
  56. </a-descriptions-item>
  57. <a-descriptions-item label="供应商">
  58. {{ materialInfo.supplier }}
  59. </a-descriptions-item>
  60. <a-descriptions-item label="关联项目">
  61. {{ materialInfo.projectName }}
  62. </a-descriptions-item>
  63. <a-descriptions-item label="唯一编码" :span="2">
  64. {{ materialInfo.code }}
  65. </a-descriptions-item>
  66. <a-descriptions-item label="设计组长" :span="3" style="margin-top: 10px">
  67. {{ materialInfo.leaderName }}
  68. </a-descriptions-item>
  69. <a-descriptions-item label="编导">
  70. {{ materialInfo.planName == '' ? '无' : materialInfo.planName }}
  71. </a-descriptions-item>
  72. <a-descriptions-item label="拍摄">
  73. {{ materialInfo.shotName == '' ? '无' : materialInfo.shotName }}
  74. </a-descriptions-item>
  75. <a-descriptions-item label="剪辑">
  76. {{ materialInfo.clipName == '' ? '无' : materialInfo.clipName }}
  77. </a-descriptions-item>
  78. </a-descriptions>
  79. </a-card>
  80. <!-- <a-card
  81. class="search-box"
  82. style="min-height: 300px; margin: 20px 0"
  83. title="数据概览"
  84. v-if="dataView && $route.query.mediaId == 2"
  85. >
  86. <a-row :gutter="15">
  87. <a-col :xl="6" class="show-data">
  88. <h3>素材消耗</h3>
  89. <p
  90. :style="{ color: dataView.charge[0].charge > dataView.charge[2].charge ? '#F66C6D' : '#67C239' }"
  91. style="font-size: 18px; font-weight: 700"
  92. >
  93. {{ dataView.charge[0].charge | decimalsHandle }}
  94. </p>
  95. <p><span>项目top</span>{{ dataView.charge[1].charge | decimalsHandle }}</p>
  96. <p><span>数据库均值</span>{{ dataView.charge[2].charge | decimalsHandle }}</p>
  97. </a-col>
  98. <a-col :xl="6" class="show-data">
  99. <h3>封面曝光数</h3>
  100. <p
  101. :style="{
  102. color: dataView.photoShow[0].photoShow > dataView.photoShow[2].photoShow ? '#F66C6D' : '#67C239',
  103. }"
  104. style="font-size: 18px; font-weight: 700"
  105. >
  106. {{ dataView.photoShow[0].photoShow }}
  107. </p>
  108. <p><span>项目top</span>{{ dataView.photoShow[1].photoShow }}</p>
  109. <p><span>数据库均值</span>{{ dataView.photoShow[2].photoShow }}</p>
  110. </a-col>
  111. <a-col :xl="6" class="show-data">
  112. <h3>封面点击数</h3>
  113. <p
  114. :style="{
  115. color: dataView.photoClick[0].photoClick > dataView.photoClick[2].photoClick ? '#F66C6D' : '#67C239',
  116. }"
  117. style="font-size: 18px; font-weight: 700"
  118. >
  119. {{ dataView.photoClick[0].photoClick }}
  120. </p>
  121. <p><span>项目top</span>{{ dataView.photoClick[1].photoClick }}</p>
  122. <p><span>数据库均值</span>{{ dataView.photoClick[2].photoClick }}</p>
  123. </a-col>
  124. <a-col :xl="6" class="show-data">
  125. <h3>素材曝光数</h3>
  126. <p
  127. :style="{ color: dataView.aclick[0].aclick > dataView.aclick[2].aclick ? '#F66C6D' : '#67C239' }"
  128. style="font-size: 18px; font-weight: 700"
  129. >
  130. {{ dataView.aclick[0].aclick }}
  131. </p>
  132. <p><span>项目top</span>{{ dataView.aclick[1].aclick }}</p>
  133. <p><span>数据库均值</span>{{ dataView.aclick[2].aclick }}</p>
  134. </a-col>
  135. </a-row>
  136. <a-row :gutter="15" style="margin-top: 20px">
  137. <a-col :xl="6" class="show-data">
  138. <h3>行为数</h3>
  139. <p
  140. :style="{ color: dataView.bclick[0].bclick > dataView.bclick[2].bclick ? '#F66C6D' : '#67C239' }"
  141. style="font-size: 18px; font-weight: 700"
  142. >
  143. {{ dataView.bclick[0].bclick }}
  144. </p>
  145. <p><span>项目top</span>{{ dataView.bclick[1].bclick }}</p>
  146. <p><span>数据库均值</span>{{ dataView.bclick[2].bclick }}</p>
  147. </a-col>
  148. <a-col :xl="6" class="show-data">
  149. <h3>激活数</h3>
  150. <p
  151. :style="{
  152. color: dataView.activation[0].activation > dataView.activation[2].activation ? '#F66C6D' : '#67C239',
  153. }"
  154. style="font-size: 18px; font-weight: 700"
  155. >
  156. {{ dataView.activation[0].activation }}
  157. </p>
  158. <p><span>项目top</span>{{ dataView.activation[1].activation }}</p>
  159. <p><span>数据库均值</span>{{ dataView.activation[2].activation }}</p>
  160. </a-col>
  161. <a-col :xl="6" class="show-data">
  162. <h3>3s播放率</h3>
  163. <p
  164. :style="{
  165. color: dataView.play3sRate[0].play3sRate > dataView.play3sRate[2].play3sRate ? '#F66C6D' : '#67C239',
  166. }"
  167. style="font-size: 18px; font-weight: 700"
  168. >
  169. {{ (dataView.play3sRate[0].play3sRate * 100).toFixed(2) + '%' }}
  170. </p>
  171. <p><span>项目top</span>{{ (dataView.play3sRate[1].play3sRate * 100).toFixed(2) + '%' }}</p>
  172. <p><span>数据库均值</span>{{ (dataView.play3sRate[2].play3sRate * 100).toFixed(2) + '%' }}</p>
  173. </a-col>
  174. </a-row>
  175. </a-card>
  176. <a-card
  177. class="search-box"
  178. style="min-height: 300px; margin: 20px 0"
  179. title="数据概览"
  180. v-if="dataView && $route.query.mediaId == 1"
  181. >
  182. <a-row :gutter="15">
  183. <a-col :xl="6" class="show-data">
  184. <h3>素材消耗</h3>
  185. <p
  186. :style="{ color: dataView.cost[0].cost > dataView.cost[2].cost ? '#F66C6D' : '#67C239' }"
  187. style="font-size: 18px; font-weight: 700"
  188. >
  189. {{ dataView.cost[0].cost | decimalsHandle }}
  190. </p>
  191. <p><span>项目top</span>{{ dataView.cost[1].cost | decimalsHandle }}</p>
  192. <p><span>数据库均值</span>{{ dataView.cost[2].cost | decimalsHandle }}</p>
  193. </a-col>
  194. <a-col :xl="6" class="show-data">
  195. <h3>点击数</h3>
  196. <p
  197. :style="{
  198. color: dataView.click[0].click > dataView.click[2].click ? '#F66C6D' : '#67C239',
  199. }"
  200. style="font-size: 18px; font-weight: 700"
  201. >
  202. {{ dataView.click[0].click }}
  203. </p>
  204. <p><span>项目top</span>{{ dataView.click[1].click }}</p>
  205. <p><span>数据库均值</span>{{ dataView.click[2].click }}</p>
  206. </a-col>
  207. <a-col :xl="6" class="show-data">
  208. <h3>曝光数</h3>
  209. <p
  210. :style="{
  211. color:
  212. dataView.materialShow[0].materialShow > dataView.materialShow[2].materialShow
  213. ? '#F66C6D'
  214. : '#67C239',
  215. }"
  216. style="font-size: 18px; font-weight: 700"
  217. >
  218. {{ dataView.materialShow[0].materialShow }}
  219. </p>
  220. <p><span>项目top</span>{{ dataView.materialShow[1].materialShow }}</p>
  221. <p><span>数据库均值</span>{{ dataView.materialShow[2].materialShow }}</p>
  222. </a-col>
  223. <a-col :xl="6" class="show-data">
  224. <h3>完播率</h3>
  225. <p
  226. :style="{
  227. color:
  228. dataView.play100Rate[0].play100Rate > dataView.play100Rate[2].play100Rate ? '#F66C6D' : '#67C239',
  229. }"
  230. style="font-size: 18px; font-weight: 700"
  231. >
  232. {{ (dataView.play100Rate[0].play100Rate * 100).toFixed(2) + '%' }}
  233. </p>
  234. <p><span>项目top</span>{{ (dataView.play100Rate[1].play100Rate * 100).toFixed(2) + '%' }}</p>
  235. <p><span>数据库均值</span>{{ (dataView.play100Rate[2].play100Rate * 100).toFixed(2) + '%' }}</p>
  236. </a-col>
  237. </a-row>
  238. <a-row :gutter="15" style="margin-top: 20px">
  239. <a-col :xl="6" class="show-data">
  240. <h3>点赞数</h3>
  241. <p
  242. :style="{
  243. color:
  244. dataView.likeMaterial[0].likeMaterial > dataView.likeMaterial[2].likeMaterial
  245. ? '#F66C6D'
  246. : '#67C239',
  247. }"
  248. style="font-size: 18px; font-weight: 700"
  249. >
  250. {{ dataView.likeMaterial[0].likeMaterial }}
  251. </p>
  252. <p><span>项目top</span>{{ dataView.likeMaterial[1].likeMaterial }}</p>
  253. <p><span>数据库均值</span>{{ dataView.likeMaterial[2].likeMaterial }}</p>
  254. </a-col>
  255. <a-col :xl="6" class="show-data">
  256. <h3>评论数</h3>
  257. <p
  258. :style="{
  259. color:
  260. dataView.commentMaterial[0].commentMaterial > dataView.commentMaterial[2].commentMaterial
  261. ? '#F66C6D'
  262. : '#67C239',
  263. }"
  264. style="font-size: 18px; font-weight: 700"
  265. >
  266. {{ dataView.commentMaterial[0].commentMaterial }}
  267. </p>
  268. <p><span>项目top</span>{{ dataView.commentMaterial[1].commentMaterial }}</p>
  269. <p><span>数据库均值</span>{{ dataView.commentMaterial[2].commentMaterial }}</p>
  270. </a-col>
  271. <a-col :xl="6" class="show-data">
  272. <h3>转发数</h3>
  273. <p
  274. :style="{
  275. color:
  276. dataView.shareMaterial[0].shareMaterial > dataView.shareMaterial[2].shareMaterial
  277. ? '#F66C6D'
  278. : '#67C239',
  279. }"
  280. style="font-size: 18px; font-weight: 700"
  281. >
  282. {{ dataView.shareMaterial[0].shareMaterial }}
  283. </p>
  284. <p><span>项目top</span>{{ dataView.shareMaterial[1].shareMaterial }}</p>
  285. <p><span>数据库均值</span>{{ dataView.shareMaterial[2].shareMaterial }}</p>
  286. </a-col>
  287. <a-col :xl="6" class="show-data">
  288. <h3>关注数</h3>
  289. <p
  290. :style="{
  291. color: dataView.follow[0].follow > dataView.follow[2].follow ? '#F66C6D' : '#67C239',
  292. }"
  293. style="font-size: 18px; font-weight: 700"
  294. >
  295. {{ dataView.follow[0].follow }}
  296. </p>
  297. <p><span>项目top</span>{{ dataView.follow[1].follow }}</p>
  298. <p><span>数据库均值</span>{{ dataView.follow[2].follow }}</p>
  299. </a-col>
  300. </a-row>
  301. </a-card> -->
  302. <a-card class="search-box" style="min-height: 300px" title="数据消耗趋势">
  303. <div
  304. id="echartCircular"
  305. ref="echartCircular"
  306. style="height: 350px"
  307. :style="{ width: (clientWidth / 24) * 18 - 48 - 24 + 'px' }"
  308. ></div
  309. ></a-card>
  310. <!-- <a-card class="search-box" style="min-height: 300px; margin: 20px 0"> </a-card> -->
  311. </a-col>
  312. </a-spin>
  313. </a-row>
  314. </template>
  315. <script>
  316. import { getAction, postAction } from '@/api/manage'
  317. import moment from 'moment'
  318. import $ from 'jquery'
  319. import qs from 'qs'
  320. import UploadToAli from '@femessage/upload-to-ali'
  321. import uploadFile from '@/components/uploadFile.vue'
  322. import { mapActions, mapGetters, mapState } from 'vuex'
  323. var echarts = require('echarts')
  324. export default {
  325. name: 'online-training-list',
  326. data() {
  327. return {
  328. noImg: require('@/assets/noImg.png'),
  329. materialInfo: null,
  330. dataView: null,
  331. clientWidth: 1920,
  332. spinning: false,
  333. }
  334. },
  335. components: {
  336. UploadToAli,
  337. uploadFile,
  338. },
  339. methods: {
  340. handlerEchartOption(data) {
  341. var option = {
  342. noDataLoadingOption: {
  343. text: '暂无数据',
  344. effect: 'bubble',
  345. effectOption: {
  346. effect: {
  347. n: 0,
  348. },
  349. },
  350. },
  351. // title: {
  352. // text: '折线图堆叠'
  353. // },
  354. tooltip: {
  355. trigger: 'axis',
  356. },
  357. // legend: {
  358. // data: ['邮件营销', '联盟广告', ]
  359. // },
  360. grid: {
  361. left: '3%',
  362. right: '4%',
  363. bottom: '3%',
  364. containLabel: true,
  365. },
  366. legend: {
  367. icon: 'circle',
  368. top: '5%',
  369. right: '5%',
  370. itemWidth: 6,
  371. itemGap: 20,
  372. textStyle: {
  373. color: '#556677',
  374. },
  375. },
  376. toolbox: {
  377. // feature: {
  378. // saveAsImage: {}
  379. // }
  380. },
  381. xAxis: {
  382. type: 'category',
  383. data: data.map((item) => {
  384. return item.statDate
  385. }),
  386. boundaryGap: false,
  387. // 坐标轴线
  388. axisLine: {
  389. show: false,
  390. lineStyle: {
  391. color: '#999',
  392. },
  393. },
  394. // 分割线
  395. splitLine: {
  396. show: true,
  397. lineStyle: {
  398. type: 'dashed',
  399. color: '#e5e5e5',
  400. },
  401. },
  402. },
  403. yAxis: {
  404. type: 'value',
  405. axisLine: {
  406. show: false,
  407. lineStyle: {
  408. color: '#999',
  409. },
  410. },
  411. splitLine: {
  412. lineStyle: {
  413. type: 'dashed',
  414. color: '#e5e5e5',
  415. },
  416. },
  417. },
  418. series: [
  419. {
  420. name: '消耗',
  421. type: 'line',
  422. stack: '总量',
  423. data: data.map((item) => {
  424. return item.cost.toFixed(3)
  425. }),
  426. symbol: 'circle',
  427. symbolSize: 10,
  428. lineStyle: {
  429. normal: {
  430. width: 2,
  431. // color: '#0bcd74'
  432. },
  433. },
  434. itemStyle: {
  435. borderColor: '#ffffff',
  436. borderWidth: 0,
  437. },
  438. },
  439. ],
  440. }
  441. return option
  442. },
  443. initEchart(idName, optionName) {
  444. var that = this
  445. const chart = this.$refs[idName]
  446. // console.log(chart)
  447. if (chart) {
  448. const myChart = echarts.init(document.getElementById(idName))
  449. // myChart.showLoading({
  450. // text: "图表数据正在努力加载..."
  451. // });
  452. myChart.setOption(optionName)
  453. window.addEventListener('resize', function () {
  454. that.clientWidth = document.documentElement.clientWidth - 224
  455. myChart.resize()
  456. })
  457. }
  458. },
  459. getKuaishou() {
  460. var params = {
  461. mediaId: this.$route.query.mediaId,
  462. md5: this.$route.query.md5,
  463. }
  464. var that = this
  465. var getProjectIdByMd5 = new Promise(function (resolve, reject) {
  466. that.postDataAction('/overView/getProjectIdByMd5', params).then((res) => {
  467. if (res.success) {
  468. var materialDetailCharge = new Promise(function (resolve, reject) {
  469. that
  470. .postDataAction('/overView/materialDetailCharge', { md5: that.$route.query.md5, projectId: res.result })
  471. .then((res) => {
  472. if (res.success) {
  473. resolve(res.result)
  474. }
  475. })
  476. })
  477. var materialDetailPhotoShow = new Promise(function (resolve, reject) {
  478. that
  479. .postDataAction('/overView/materialDetailPhotoShow', {
  480. md5: that.$route.query.md5,
  481. projectId: res.result,
  482. })
  483. .then((res) => {
  484. if (res.success) {
  485. resolve(res.result)
  486. }
  487. })
  488. })
  489. var materialDetailPhotoClick = new Promise(function (resolve, reject) {
  490. that
  491. .postDataAction('/overView/materialDetailPhotoClick', {
  492. md5: that.$route.query.md5,
  493. projectId: res.result,
  494. })
  495. .then((res) => {
  496. if (res.success) {
  497. resolve(res.result)
  498. }
  499. })
  500. })
  501. var materialDetailAClick = new Promise(function (resolve, reject) {
  502. that
  503. .postDataAction('/overView/materialDetailAClick', { md5: that.$route.query.md5, projectId: res.result })
  504. .then((res) => {
  505. if (res.success) {
  506. resolve(res.result)
  507. }
  508. })
  509. })
  510. var materialDetailBClick = new Promise(function (resolve, reject) {
  511. that
  512. .postDataAction('/overView/materialDetailBClick', { md5: that.$route.query.md5, projectId: res.result })
  513. .then((res) => {
  514. if (res.success) {
  515. resolve(res.result)
  516. }
  517. })
  518. })
  519. var materialDetailActivation = new Promise(function (resolve, reject) {
  520. that
  521. .postDataAction('/overView/materialDetailActivation', {
  522. md5: that.$route.query.md5,
  523. projectId: res.result,
  524. })
  525. .then((res) => {
  526. if (res.success) {
  527. resolve(res.result)
  528. }
  529. })
  530. })
  531. var materialDetailPlay3sRate = new Promise(function (resolve, reject) {
  532. that
  533. .postDataAction('/overView/materialDetailPlay3sRate', {
  534. md5: that.$route.query.md5,
  535. projectId: res.result,
  536. })
  537. .then((res) => {
  538. if (res.success) {
  539. resolve(res.result)
  540. }
  541. })
  542. })
  543. Promise
  544. .all([
  545. materialDetailPlay3sRate,
  546. materialDetailCharge,
  547. materialDetailPhotoShow,
  548. materialDetailPhotoClick,
  549. materialDetailAClick,
  550. materialDetailBClick,
  551. materialDetailActivation,
  552. ])
  553. .then((item) => {
  554. // dataView
  555. console.log(item)
  556. })
  557. }
  558. })
  559. })
  560. },
  561. getMaterialInfo() {
  562. // this.spinning = true
  563. var params = {
  564. mediaId: this.$route.query.mediaId,
  565. md5: this.$route.query.md5,
  566. }
  567. var data = []
  568. this.postDataAction('/overView/materialDetailInfo', params).then((res) => {
  569. if (res.success) {
  570. if (res.result) {
  571. this.materialInfo = res.result
  572. } else {
  573. this.$error({
  574. title: '页面数据加载出错',
  575. content: '该视频未上传公司素材库,请重新上传之后,可展示视频信息',
  576. })
  577. }
  578. }
  579. })
  580. this.getKuaishou()
  581. this.postDataAction('/overView/materialDetailChat', params).then((res) => {
  582. if (res.success) {
  583. this.initEchart('echartCircular', this.handlerEchartOption(res.result))
  584. }
  585. })
  586. },
  587. },
  588. mounted() {
  589. this.$nextTick(() => {
  590. this.clientWidth = document.documentElement.clientWidth - 224
  591. // this.$route.query.mediaId
  592. // this.$route.query.md5
  593. this.getMaterialInfo()
  594. })
  595. },
  596. created() {},
  597. }
  598. </script>