123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- import {
- getBase,
- getPlatform,
- getList,
- getAllPlatform,
- // getCould,
- } from "@/api/getList";
- export default {
- data() {
- return {
- timeout: undefined,
- isdou: false,
- iskuai: false,
- could: "",
- };
- },
- methods: {
- select() {
- let season = sessionStorage.getItem("season");
- let title = this.$route.query.title;
- getBase({
- topic_name: title,
- season,
- }).then(x => {
- x = x || {};
- this.allList = {
- read: x.total_pv || 0,
- talk: x.total_comment || 0,
- keyWord: title,
- totalLikes: x.total_digg || 0,
- totalForward: x.total_forward || 0,
- totalOri: x.total_ori || 0,
- live_comment: x.live_comment,
- live_digg: x.live_digg,
- live_uv: x.live_uv,
- };
- this.isdou = x.has_live_douyin_data;
- this.iskuai = x.has_live_kuaishou_data;
- this.could = x.word_cloud_url || ""
- });
- getAllPlatform({
- topic_name: title,
- season
- }).then(x => {
- const list = [];
- this.platformList.map(className => {
- let keyValue = "total_forward";
- className === "浏览" && (keyValue = "total_pv");
- className === "点赞" && (keyValue = "total_digg");
- className === "评论" && (keyValue = "total_comment");
- if (className === "浏览") {
- (x || []).map(v => {
- list.push({
- name: className,
- nickname: v.platform,
- value: v[keyValue],
- });
- });
- }
- });
- this.platformSort = list;
- });
- getPlatform({
- topic_name: title,
- platform: "ALL",
- season,
- }).then(x => {
- this.userSortAll = x || [];
- this.clickBtn(this.selectIndex);
- });
- getPlatform({
- topic_name: title,
- platform: "douyin",
- season,
- }).then(x => {
- this.douAllList = (x || []).map(v => {
- // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
- // v.nickname = v.nickname.replace(/^\n/g, "");
- const li = v.nickname.split("");
- v.nickname = li
- .map((nameString, i) => {
- i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
- return nameString;
- })
- .join("");
- return v;
- });
- });
- getPlatform({
- topic_name: title,
- platform: "kuaishou",
- season
- }).then(x => {
- this.kuaiAllList = (x || []).map(v => {
- // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
- // v.nickname = v.nickname.replace(/^\n/g, "");
- const li = v.nickname.split("");
- v.nickname = li
- .map((nameString, i) => {
- i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
- return nameString;
- })
- .join("");
- return v;
- });
- });
- getPlatform({
- topic_name: title,
- platform: "yangshi",
- season
- }).then(x => {
- this.yangAllList = (x || []).map(v => {
- // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
- // v.nickname = v.nickname.replace(/^\n/g, "");
- const li = v.nickname.split("");
- v.nickname = li
- .map((nameString, i) => {
- i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
- return nameString;
- })
- .join("");
- return v;
- });
- });
- // let Filename = this.$utils.getUrl("id");
- // getCould({}, this.$store.state.p[Filename]).then(res => {
- // let ori = res || [];
- // let listOri = [];
- // ori.map(v => {
- // listOri.push({
- // x: v.name,
- // value: v.value - 0,
- // });
- // });
- // this.listOri = listOri;
- // });
- this.getAllWeibo();
- },
- selectRead(dateT) {
- let season = sessionStorage.getItem("season");
- getList({
- topic_name: this.$route.query.title,
- time: dateT.type,
- season
- }).then(res => {
- this.read = (res.read || []).map(v => {
- return {
- date: v.time,
- type: "微博-阅读量趋势",
- value: v.value,
- };
- });
- this.readType = dateT.type;
- });
- },
- selectMe(dateT) {
- let season = sessionStorage.getItem("season");
- getList({
- topic_name: this.$route.query.title,
- time: dateT.type,
- season
- }).then(res => {
- this.me = (res.me || []).map(v => {
- return {
- date: v.time,
- type: "微博-讨论趋势",
- value: v.value,
- };
- });
- this.meType = dateT.type;
- });
- },
- selectOri(dateT) {
- let season = sessionStorage.getItem("season");
- getList({
- topic_name: this.$route.query.title,
- time: dateT.type,
- season
- }).then(res => {
- this.ori = (res.ori || []).map(v => {
- return {
- date: v.time,
- type: "微博-原创趋势",
- value: v.value,
- };
- });
- this.oriType = dateT.type;
- });
- },
- getAllWeibo() {
- let season = sessionStorage.getItem("season");
- getList({
- topic_name: this.$route.query.title,
- time: "30d",
- season
- })
- .then(res => {
- this.read = (res.read || []).map(v => {
- return {
- date: v.time,
- type: "微博-阅读量趋势",
- value: v.value,
- };
- });
- this.ori = (res.ori || []).map(v => {
- return {
- date: v.time,
- type: "微博-原创趋势",
- value: v.value,
- };
- });
- this.me = (res.me || []).map(v => {
- return {
- date: v.time,
- type: "微博-讨论趋势",
- value: v.value,
- };
- });
- })
- .catch(() => {
- // window.clearInterval(this.timeout)
- });
- },
- },
- created() {},
- mounted() {},
- };
|