focus.vue 22 KB

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