123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _getList = require("@/api/getList");
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
- var _default = {
- data: function data() {
- return {
- timeout: undefined
- };
- },
- methods: {
- select: function select() {
- var _this = this;
- var title = this.$route.query.title;
- (0, _getList.getBase)(this.pageDate).then(function (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
- };
- });
- (0, _getList.getAllPlatform)(this.pageDate).then(function (x) {
- var list = [];
- _this.platformList.map(function (className) {
- var keyValue = "total_forward";
- className === "浏览" && (keyValue = "total_pv");
- className === "点赞" && (keyValue = "total_digg");
- className === "评论" && (keyValue = "total_comment");
- if (className === "浏览") {
- (x || []).map(function (v) {
- list.push({
- name: className,
- nickname: v.platform,
- value: v[keyValue]
- });
- });
- }
- });
- _this.platformSort = list;
- });
- (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
- platform: "ALL"
- })).then(function (x) {
- _this.userSortAll = x || [];
- _this.clickBtn(_this.selectIndex);
- });
- (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
- platform: "douyin"
- })).then(function (x) {
- _this.douAllList = (x || []).map(function (v) {
- // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
- // v.nickname = v.nickname.replace(/^\n/g, "");
- var li = v.nickname.split("");
- v.nickname = li.map(function (nameString, i) {
- i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
- return nameString;
- }).join("");
- return v;
- });
- });
- (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
- platform: "kuaishou"
- })).then(function (x) {
- _this.kuaiAllList = (x || []).map(function (v) {
- // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
- // v.nickname = v.nickname.replace(/^\n/g, "");
- var li = v.nickname.split("");
- v.nickname = li.map(function (nameString, i) {
- i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
- return nameString;
- }).join("");
- return v;
- });
- });
- (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
- platform: "yangshi"
- })).then(function (x) {
- _this.yangAllList = (x || []).map(function (v) {
- // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
- // v.nickname = v.nickname.replace(/^\n/g, "");
- var li = v.nickname.split("");
- v.nickname = li.map(function (nameString, i) {
- i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
- return nameString;
- }).join("");
- return v;
- });
- });
- var Filename = this.$utils.getUrl("id");
- (0, _getList.getCould)({}, this.$store.state.p[Filename]).then(function (res) {
- var ori = res || [];
- var listOri = [];
- ori.map(function (v) {
- listOri.push({
- x: v.name,
- value: v.value
- });
- });
- _this.listOri = listOri;
- });
- this.getAllWeibo();
- },
- selectRead: function selectRead(dateT) {
- var _this2 = this;
- (0, _getList.getList)(_objectSpread({}, this.pageDate, {
- time: dateT.type
- })).then(function (res) {
- _this2.read = (res.read || []).map(function (v) {
- return {
- date: v.time,
- type: "微博-阅读量趋势",
- value: v.value
- };
- });
- _this2.readType = dateT.type;
- });
- },
- selectMe: function selectMe(dateT) {
- var _this3 = this;
- (0, _getList.getList)(_objectSpread({}, this.pageDate, {
- time: dateT.type
- })).then(function (res) {
- _this3.me = (res.me || []).map(function (v) {
- return {
- date: v.time,
- type: "微博-讨论趋势",
- value: v.value
- };
- });
- _this3.meType = dateT.type;
- });
- },
- selectOri: function selectOri(dateT) {
- var _this4 = this;
- (0, _getList.getList)(_objectSpread({}, this.pageDate, {
- time: dateT.type
- })).then(function (res) {
- _this4.ori = (res.ori || []).map(function (v) {
- return {
- date: v.time,
- type: "微博-原创趋势",
- value: v.value
- };
- });
- _this4.oriType = dateT.type;
- });
- },
- getAllWeibo: function getAllWeibo() {
- var _this5 = this;
- (0, _getList.getList)(_objectSpread({}, this.pageDate, {
- time: "30d"
- })).then(function (res) {
- _this5.read = (res.read || []).map(function (v) {
- return {
- date: v.time,
- type: "微博-阅读量趋势",
- value: v.value
- };
- });
- _this5.ori = (res.ori || []).map(function (v) {
- return {
- date: v.time,
- type: "微博-原创趋势",
- value: v.value
- };
- });
- _this5.me = (res.me || []).map(function (v) {
- return {
- date: v.time,
- type: "微博-讨论趋势",
- value: v.value
- };
- });
- })["catch"](function () {// window.clearInterval(this.timeout)
- });
- }
- },
- created: function created() {},
- mounted: function mounted() {}
- };
- exports["default"] = _default;
|