focus.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. <template>
  2. <br />
  3. <el-card style="margin: 0 1em;">
  4. <div class="title_card">重点客户</div>
  5. <br />
  6. <el-button-group style="margin-left: 1.5em">
  7. <el-button
  8. size="small"
  9. type="primary"
  10. v-for="(item, i) in hard_important_list"
  11. :key="'hard_important' + i"
  12. :plain="hard_important_act !== i"
  13. @click="() => hard_important_change(i)"
  14. >
  15. {{ item.text }}
  16. </el-button>
  17. </el-button-group>
  18. <br />
  19. <el-row>
  20. <el-col :span="12">
  21. <com-table
  22. title="硬广-广告主投放top10"
  23. :child="true"
  24. :tableList="hardMarster"
  25. >
  26. <template #cols>
  27. <el-table-column
  28. align="center"
  29. type="index"
  30. label="序号"
  31. width="50"
  32. />
  33. <el-table-column
  34. show-overflow-tooltip
  35. align="center"
  36. property="name"
  37. label="栏目主名称"
  38. />
  39. <el-table-column align="center" property="pinci">
  40. <template #header>
  41. <span
  42. :style="
  43. hard_important_list[hard_important_act].type === 1
  44. ? 'color: red'
  45. : ''
  46. "
  47. >
  48. 频次(次)
  49. </span>
  50. </template>
  51. <template #default="scope">
  52. {{ numFor(scope.row.pinci) }}
  53. </template>
  54. </el-table-column>
  55. <el-table-column align="center" property="timeSize">
  56. <template #header>
  57. <span
  58. :style="
  59. hard_important_list[hard_important_act].type === 2
  60. ? 'color: red'
  61. : ''
  62. "
  63. >
  64. 时长(秒)
  65. </span>
  66. </template>
  67. <template #default="scope">
  68. {{ numFor(scope.row.timeSize) }}
  69. </template>
  70. </el-table-column>
  71. <el-table-column align="center" property="fee" label="">
  72. <template #header>
  73. <span
  74. :style="
  75. hard_important_list[hard_important_act].type === 3
  76. ? 'color: red'
  77. : ''
  78. "
  79. >
  80. 费用
  81. </span>
  82. </template>
  83. <template #default="scope">
  84. {{ numFor(scope.row.fee) }}
  85. </template>
  86. </el-table-column>
  87. <el-table-column align="center" property="fee" label="环比">
  88. <template #default="scope">
  89. <svg
  90. t="1646702687390"
  91. class="icon"
  92. viewBox="0 0 1024 1024"
  93. version="1.1"
  94. xmlns="http://www.w3.org/2000/svg"
  95. p-id="2028"
  96. width="20"
  97. v-if="scope.row[
  98. hard_important_list[hard_important_act].proportionType
  99. ] -
  100. scope.row.compare[
  101. hard_important_list[hard_important_act].proportionType
  102. ] <
  103. 0"
  104. height="20"
  105. xmlns:xlink="http://www.w3.org/1999/xlink"
  106. >
  107. <path
  108. d="M558.933333 853.333333V128h-42.666666v733.866667l-145.066667-145.066667-29.866667 29.866667 192 192 192-192-29.866666-29.866667-136.533334 136.533333z"
  109. fill="#50b1e6"
  110. p-id="2029"
  111. ></path>
  112. </svg>
  113. <svg
  114. t="1646702847605"
  115. class="icon"
  116. viewBox="0 0 1024 1024"
  117. version="1.1"
  118. xmlns="http://www.w3.org/2000/svg"
  119. p-id="2299"
  120. width="20"
  121. v-if="scope.row[
  122. hard_important_list[hard_important_act].proportionType
  123. ] -
  124. scope.row.compare[
  125. hard_important_list[hard_important_act].proportionType
  126. ] >
  127. 0"
  128. height="20"
  129. >
  130. <path
  131. d="M507.733333 213.333333v725.333334h42.666667V204.8l145.066667 145.066667 29.866666-29.866667L533.333333 128 341.333333 320l29.866667 29.866667L507.733333 213.333333z"
  132. fill="#ff5757"
  133. p-id="2300"
  134. ></path>
  135. </svg>
  136. </template>
  137. </el-table-column>
  138. </template>
  139. </com-table>
  140. </el-col>
  141. <el-col :span="12">
  142. <com-table
  143. title="硬广-品牌投放top10"
  144. :tableList="hardBrand"
  145. :child="true"
  146. >
  147. <template #cols>
  148. <el-table-column
  149. align="center"
  150. type="index"
  151. label="序号"
  152. width="50"
  153. />
  154. <el-table-column
  155. show-overflow-tooltip
  156. align="center"
  157. property="name"
  158. label="品牌名称"
  159. />
  160. <el-table-column align="center" property="pinci">
  161. <template #header>
  162. <span
  163. :style="
  164. hard_important_list[hard_important_act].type === 1
  165. ? 'color: red'
  166. : ''
  167. "
  168. >
  169. 频次(次)
  170. </span>
  171. </template>
  172. <template #default="scope">
  173. {{ numFor(scope.row.pinci) }}
  174. </template>
  175. </el-table-column>
  176. <el-table-column align="center" property="timeSize">
  177. <template #header>
  178. <span
  179. :style="
  180. hard_important_list[hard_important_act].type === 2
  181. ? 'color: red'
  182. : ''
  183. "
  184. >
  185. 时长(秒)
  186. </span>
  187. </template>
  188. <template #default="scope">
  189. {{ numFor(scope.row.timeSize) }}
  190. </template>
  191. </el-table-column>
  192. <el-table-column align="center" property="fee" label="">
  193. <template #header>
  194. <span
  195. :style="
  196. hard_important_list[hard_important_act].type === 3
  197. ? 'color: red'
  198. : ''
  199. "
  200. >
  201. 费用
  202. </span>
  203. </template>
  204. <template #default="scope">
  205. {{ numFor(scope.row.fee) }}
  206. </template>
  207. </el-table-column>
  208. <el-table-column align="center" property="fee" label="环比">
  209. <template #default="scope">
  210. <svg
  211. t="1646702687390"
  212. class="icon"
  213. viewBox="0 0 1024 1024"
  214. version="1.1"
  215. xmlns="http://www.w3.org/2000/svg"
  216. p-id="2028"
  217. width="20"
  218. v-if="scope.row[
  219. hard_important_list[hard_important_act].proportionType
  220. ] -
  221. scope.row.compare[
  222. hard_important_list[hard_important_act].proportionType
  223. ] <
  224. 0"
  225. height="20"
  226. xmlns:xlink="http://www.w3.org/1999/xlink"
  227. >
  228. <path
  229. d="M558.933333 853.333333V128h-42.666666v733.866667l-145.066667-145.066667-29.866667 29.866667 192 192 192-192-29.866666-29.866667-136.533334 136.533333z"
  230. fill="#50b1e6"
  231. p-id="2029"
  232. ></path>
  233. </svg>
  234. <svg
  235. t="1646702847605"
  236. class="icon"
  237. viewBox="0 0 1024 1024"
  238. version="1.1"
  239. xmlns="http://www.w3.org/2000/svg"
  240. p-id="2299"
  241. width="20"
  242. v-if="scope.row[
  243. hard_important_list[hard_important_act].proportionType
  244. ] -
  245. scope.row.compare[
  246. hard_important_list[hard_important_act].proportionType
  247. ] >
  248. 0"
  249. height="20"
  250. >
  251. <path
  252. d="M507.733333 213.333333v725.333334h42.666667V204.8l145.066667 145.066667 29.866666-29.866667L533.333333 128 341.333333 320l29.866667 29.866667L507.733333 213.333333z"
  253. fill="#ff5757"
  254. p-id="2300"
  255. ></path>
  256. </svg>
  257. </template>
  258. </el-table-column>
  259. </template>
  260. </com-table>
  261. </el-col>
  262. </el-row>
  263. <br />
  264. <div style="border-top: 1px dashed #eee"></div>
  265. <br />
  266. <el-button-group style="margin-left: 1.5em">
  267. <el-button
  268. size="small"
  269. type="primary"
  270. v-for="(item, i) in soft_important_list"
  271. :key="'soft_important' + i"
  272. :plain="soft_important_act !== i"
  273. @click="() => soft_important_change(i)"
  274. >
  275. {{ item.text }}
  276. </el-button>
  277. </el-button-group>
  278. <br />
  279. <el-row>
  280. <el-col :span="12">
  281. <com-table
  282. title="软广-广告主投放top10"
  283. :tableList="softMarster"
  284. :child="true"
  285. >
  286. <template #cols>
  287. <el-table-column
  288. align="center"
  289. type="index"
  290. label="序号"
  291. width="50"
  292. />
  293. <el-table-column
  294. show-overflow-tooltip
  295. align="center"
  296. property="name"
  297. label="栏目主名称"
  298. />
  299. <el-table-column align="center" property="pinci">
  300. <template #header>
  301. <span
  302. :style="
  303. hard_important_list[hard_important_act].type === 1
  304. ? 'color: red'
  305. : ''
  306. "
  307. >
  308. 频次(次)
  309. </span>
  310. </template>
  311. <template #default="scope">
  312. {{ numFor(scope.row.pinci) }}
  313. </template>
  314. </el-table-column>
  315. <el-table-column align="center" property="timeSize">
  316. <template #header>
  317. <span
  318. :style="
  319. hard_important_list[hard_important_act].type === 2
  320. ? 'color: red'
  321. : ''
  322. "
  323. >
  324. 时长(秒)
  325. </span>
  326. </template>
  327. <template #default="scope">
  328. {{ numFor(scope.row.timeSize) }}
  329. </template>
  330. </el-table-column>
  331. <el-table-column align="center" property="fee" label="环比">
  332. <template #default="scope">
  333. <svg
  334. t="1646702687390"
  335. class="icon"
  336. viewBox="0 0 1024 1024"
  337. version="1.1"
  338. xmlns="http://www.w3.org/2000/svg"
  339. p-id="2028"
  340. width="20"
  341. v-if="scope.row[
  342. soft_important_list[this.soft_important_act].proportionType
  343. ] -
  344. scope.row.compare[
  345. soft_important_list[this.soft_important_act].proportionType
  346. ] <
  347. 0"
  348. height="20"
  349. xmlns:xlink="http://www.w3.org/1999/xlink"
  350. >
  351. <path
  352. d="M558.933333 853.333333V128h-42.666666v733.866667l-145.066667-145.066667-29.866667 29.866667 192 192 192-192-29.866666-29.866667-136.533334 136.533333z"
  353. fill="#50b1e6"
  354. p-id="2029"
  355. ></path>
  356. </svg>
  357. <svg
  358. t="1646702847605"
  359. class="icon"
  360. viewBox="0 0 1024 1024"
  361. version="1.1"
  362. xmlns="http://www.w3.org/2000/svg"
  363. p-id="2299"
  364. width="20"
  365. v-if="scope.row[
  366. soft_important_list[this.soft_important_act].proportionType
  367. ] -
  368. scope.row.compare[
  369. soft_important_list[this.soft_important_act].proportionType
  370. ] >
  371. 0"
  372. height="20"
  373. >
  374. <path
  375. d="M507.733333 213.333333v725.333334h42.666667V204.8l145.066667 145.066667 29.866666-29.866667L533.333333 128 341.333333 320l29.866667 29.866667L507.733333 213.333333z"
  376. fill="#ff5757"
  377. p-id="2300"
  378. ></path>
  379. </svg>
  380. </template>
  381. </el-table-column>
  382. </template>
  383. </com-table>
  384. </el-col>
  385. <el-col :span="12">
  386. <com-table
  387. title="软广-品牌投放top10"
  388. :tableList="softBrand"
  389. :child="true"
  390. >
  391. <template #cols>
  392. <el-table-column
  393. align="center"
  394. type="index"
  395. label="序号"
  396. width="50"
  397. />
  398. <el-table-column
  399. show-overflow-tooltip
  400. align="center"
  401. property="name"
  402. label="品牌名称"
  403. />
  404. <el-table-column align="center" property="pinci">
  405. <template #header>
  406. <span
  407. :style="
  408. hard_important_list[hard_important_act].type === 1
  409. ? 'color: red'
  410. : ''
  411. "
  412. >
  413. 频次(次)
  414. </span>
  415. </template>
  416. <template #default="scope">
  417. {{ numFor(scope.row.pinci) }}
  418. </template>
  419. </el-table-column>
  420. <el-table-column align="center" property="timeSize">
  421. <template #header>
  422. <span
  423. :style="
  424. hard_important_list[hard_important_act].type === 2
  425. ? 'color: red'
  426. : ''
  427. "
  428. >
  429. 时长(秒)
  430. </span>
  431. </template>
  432. <template #default="scope">
  433. {{ numFor(scope.row.timeSize) }}
  434. </template>
  435. </el-table-column>
  436. <el-table-column align="center" label="环比">
  437. <template #default="scope">
  438. <svg
  439. t="1646702687390"
  440. class="icon"
  441. viewBox="0 0 1024 1024"
  442. version="1.1"
  443. xmlns="http://www.w3.org/2000/svg"
  444. p-id="2028"
  445. width="20"
  446. v-if="scope.row[
  447. soft_important_list[this.soft_important_act].proportionType
  448. ] -
  449. scope.row.compare[
  450. soft_important_list[this.soft_important_act].proportionType
  451. ] <
  452. 0"
  453. height="20"
  454. xmlns:xlink="http://www.w3.org/1999/xlink"
  455. >
  456. <path
  457. d="M558.933333 853.333333V128h-42.666666v733.866667l-145.066667-145.066667-29.866667 29.866667 192 192 192-192-29.866666-29.866667-136.533334 136.533333z"
  458. fill="#50b1e6"
  459. p-id="2029"
  460. ></path>
  461. </svg>
  462. <svg
  463. t="1646702847605"
  464. class="icon"
  465. viewBox="0 0 1024 1024"
  466. version="1.1"
  467. xmlns="http://www.w3.org/2000/svg"
  468. p-id="2299"
  469. width="20"
  470. v-if="scope.row[
  471. soft_important_list[this.soft_important_act].proportionType
  472. ] -
  473. scope.row.compare[
  474. soft_important_list[this.soft_important_act].proportionType
  475. ] >
  476. 0"
  477. height="20"
  478. >
  479. <path
  480. d="M507.733333 213.333333v725.333334h42.666667V204.8l145.066667 145.066667 29.866666-29.866667L533.333333 128 341.333333 320l29.866667 29.866667L507.733333 213.333333z"
  481. fill="#ff5757"
  482. p-id="2300"
  483. ></path>
  484. </svg>
  485. </template>
  486. </el-table-column>
  487. </template>
  488. </com-table>
  489. </el-col>
  490. </el-row>
  491. </el-card>
  492. </template>
  493. <script>
  494. // @ is an alias to /src
  495. // import config from "@/config/index";
  496. import comTable from "./table.vue";
  497. import { industryList } from "@/api/index.js";
  498. export default {
  499. name: "AdvertisingEye",
  500. data() {
  501. return {
  502. soft_important_act: 0,
  503. hard_important_act: 0,
  504. hard_important_list: [
  505. {
  506. text: "时长",
  507. proportionType: "timeSize",
  508. type: 2,
  509. },
  510. {
  511. text: "频次",
  512. proportionType: "pinci",
  513. type: 1,
  514. },
  515. {
  516. text: "费用",
  517. proportionType: "fee",
  518. type: 3,
  519. },
  520. ],
  521. soft_important_list: [
  522. {
  523. text: "时长",
  524. proportionType: "timeSize",
  525. type: 2,
  526. },
  527. {
  528. text: "频次",
  529. proportionType: "pinci",
  530. type: 1,
  531. },
  532. ],
  533. hardMarster: [],
  534. hardBrand: [],
  535. softMarster: [],
  536. softBrand: [],
  537. };
  538. },
  539. mounted() {
  540. this.init();
  541. },
  542. computed: {},
  543. props: {
  544. title: String,
  545. industry: Number,
  546. industryRang: Number,
  547. },
  548. watch: {
  549. industryRang() {
  550. this.init();
  551. },
  552. industry() {
  553. this.init();
  554. },
  555. },
  556. filter: {},
  557. methods: {
  558. numFor(num) {
  559. if (!num) return 0;
  560. if (isNaN(num)) return 0;
  561. if (num >= 100000000) return (num / 100000000).toFixed(2) + "亿";
  562. if (num >= 10000) return (num / 10000).toFixed(2) + "万";
  563. return num;
  564. },
  565. init() {
  566. this.getHard();
  567. this.getSoft();
  568. },
  569. getHard() {
  570. Promise.all([
  571. industryList({
  572. tableType: 8,
  573. dataType: this.hard_important_list[this.hard_important_act].type,
  574. indexTime: this.industryRang + 1,
  575. }),
  576. industryList({
  577. tableType: 9,
  578. dataType: this.hard_important_list[this.hard_important_act].type,
  579. indexTime: this.industryRang + 1,
  580. }),
  581. ]).then(([marster, brand]) => {
  582. let realBrand = brand.filter(v => v.linkType === "2");
  583. for (let i = 0; i < brand.length; i++) {
  584. const v = brand[i];
  585. if (v.linkType === "2") continue;
  586. realBrand.map((item, o) => {
  587. if (item.name === v.name) realBrand[o].compare = v;
  588. });
  589. }
  590. let realMarster = marster.filter(v => v.linkType === "2");
  591. for (let i = 0; i < marster.length; i++) {
  592. const v = marster[i];
  593. if (v.linkType === "2") continue;
  594. realMarster.map((item, o) => {
  595. if (item.name === v.name) realMarster[o].compare = v;
  596. });
  597. }
  598. this.hardMarster = realMarster || [];
  599. this.hardBrand = realBrand || [];
  600. });
  601. },
  602. getSoft() {
  603. Promise.all([
  604. industryList({
  605. tableType: 10,
  606. dataType: this.soft_important_list[this.soft_important_act].type,
  607. indexTime: this.industryRang + 1,
  608. }),
  609. industryList({
  610. tableType: 11,
  611. dataType: this.soft_important_list[this.soft_important_act].type,
  612. indexTime: this.industryRang + 1,
  613. }),
  614. ]).then(([marster, brand]) => {
  615. let realBrand = brand.filter(v => v.linkType === "2");
  616. for (let i = 0; i < brand.length; i++) {
  617. const v = brand[i];
  618. if (v.linkType === "2") continue;
  619. realBrand.map((item, o) => {
  620. if (item.name === v.name) realBrand[o].compare = v;
  621. });
  622. }
  623. let realMarster = marster.filter(v => v.linkType === "2");
  624. for (let i = 0; i < marster.length; i++) {
  625. const v = marster[i];
  626. if (v.linkType === "2") continue;
  627. realMarster.map((item, o) => {
  628. if (item.name === v.name) realMarster[o].compare = v;
  629. });
  630. }
  631. this.softMarster = realMarster || [];
  632. this.softBrand = realBrand || [];
  633. });
  634. },
  635. hard_important_change(i) {
  636. this.hard_important_act = i;
  637. this.getHard();
  638. },
  639. soft_important_change(i) {
  640. this.soft_important_act = i;
  641. this.getSoft();
  642. },
  643. },
  644. beforeUnmount: function() {},
  645. components: {
  646. comTable,
  647. },
  648. };
  649. </script>
  650. <style></style>