getListSecond.dev.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = void 0;
  6. var _getList = require("@/api/getList");
  7. 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; }
  8. 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; }
  9. 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; }
  10. var _default = {
  11. data: function data() {
  12. return {
  13. timeout: undefined
  14. };
  15. },
  16. methods: {
  17. select: function select() {
  18. var _this = this;
  19. var title = this.$route.query.title;
  20. (0, _getList.getBase)(this.pageDate).then(function (x) {
  21. _this.allList = {
  22. read: x.total_pv || 0,
  23. talk: x.total_comment || 0,
  24. keyWord: title,
  25. totalLikes: x.total_digg || 0,
  26. totalForward: x.total_forward || 0,
  27. totalOri: x.total_ori || 0
  28. };
  29. });
  30. (0, _getList.getAllPlatform)(this.pageDate).then(function (x) {
  31. var list = [];
  32. _this.platformList.map(function (className) {
  33. var keyValue = "total_forward";
  34. className === "浏览" && (keyValue = "total_pv");
  35. className === "点赞" && (keyValue = "total_digg");
  36. className === "评论" && (keyValue = "total_comment");
  37. if (className === "浏览") {
  38. (x || []).map(function (v) {
  39. list.push({
  40. name: className,
  41. nickname: v.platform,
  42. value: v[keyValue]
  43. });
  44. });
  45. }
  46. });
  47. _this.platformSort = list;
  48. });
  49. (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
  50. platform: "ALL"
  51. })).then(function (x) {
  52. _this.userSortAll = x || [];
  53. _this.clickBtn(_this.selectIndex);
  54. });
  55. (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
  56. platform: "douyin"
  57. })).then(function (x) {
  58. _this.douAllList = (x || []).map(function (v) {
  59. // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
  60. // v.nickname = v.nickname.replace(/^\n/g, "");
  61. var li = v.nickname.split("");
  62. v.nickname = li.map(function (nameString, i) {
  63. i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
  64. return nameString;
  65. }).join("");
  66. return v;
  67. });
  68. });
  69. (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
  70. platform: "kuaishou"
  71. })).then(function (x) {
  72. _this.kuaiAllList = (x || []).map(function (v) {
  73. // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
  74. // v.nickname = v.nickname.replace(/^\n/g, "");
  75. var li = v.nickname.split("");
  76. v.nickname = li.map(function (nameString, i) {
  77. i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
  78. return nameString;
  79. }).join("");
  80. return v;
  81. });
  82. });
  83. (0, _getList.getPlatform)(_objectSpread({}, this.pageDate, {
  84. platform: "yangshi"
  85. })).then(function (x) {
  86. _this.yangAllList = (x || []).map(function (v) {
  87. // v.nickname = v.nickname.replace(/(?=(\B)(\S{2})+$)/g, "\n");
  88. // v.nickname = v.nickname.replace(/^\n/g, "");
  89. var li = v.nickname.split("");
  90. v.nickname = li.map(function (nameString, i) {
  91. i !== 0 && (i + 1) % 2 === 0 && (nameString = nameString + "\n");
  92. return nameString;
  93. }).join("");
  94. return v;
  95. });
  96. });
  97. var Filename = this.$utils.getUrl("id");
  98. (0, _getList.getCould)({}, this.$store.state.p[Filename]).then(function (res) {
  99. var ori = res || [];
  100. var listOri = [];
  101. ori.map(function (v) {
  102. listOri.push({
  103. x: v.name,
  104. value: v.value
  105. });
  106. });
  107. _this.listOri = listOri;
  108. });
  109. this.getAllWeibo();
  110. },
  111. selectRead: function selectRead(dateT) {
  112. var _this2 = this;
  113. (0, _getList.getList)(_objectSpread({}, this.pageDate, {
  114. time: dateT.type
  115. })).then(function (res) {
  116. _this2.read = (res.read || []).map(function (v) {
  117. return {
  118. date: v.time,
  119. type: "微博-阅读量趋势",
  120. value: v.value
  121. };
  122. });
  123. _this2.readType = dateT.type;
  124. });
  125. },
  126. selectMe: function selectMe(dateT) {
  127. var _this3 = this;
  128. (0, _getList.getList)(_objectSpread({}, this.pageDate, {
  129. time: dateT.type
  130. })).then(function (res) {
  131. _this3.me = (res.me || []).map(function (v) {
  132. return {
  133. date: v.time,
  134. type: "微博-讨论趋势",
  135. value: v.value
  136. };
  137. });
  138. _this3.meType = dateT.type;
  139. });
  140. },
  141. selectOri: function selectOri(dateT) {
  142. var _this4 = this;
  143. (0, _getList.getList)(_objectSpread({}, this.pageDate, {
  144. time: dateT.type
  145. })).then(function (res) {
  146. _this4.ori = (res.ori || []).map(function (v) {
  147. return {
  148. date: v.time,
  149. type: "微博-原创趋势",
  150. value: v.value
  151. };
  152. });
  153. _this4.oriType = dateT.type;
  154. });
  155. },
  156. getAllWeibo: function getAllWeibo() {
  157. var _this5 = this;
  158. (0, _getList.getList)(_objectSpread({}, this.pageDate, {
  159. time: "30d"
  160. })).then(function (res) {
  161. _this5.read = (res.read || []).map(function (v) {
  162. return {
  163. date: v.time,
  164. type: "微博-阅读量趋势",
  165. value: v.value
  166. };
  167. });
  168. _this5.ori = (res.ori || []).map(function (v) {
  169. return {
  170. date: v.time,
  171. type: "微博-原创趋势",
  172. value: v.value
  173. };
  174. });
  175. _this5.me = (res.me || []).map(function (v) {
  176. return {
  177. date: v.time,
  178. type: "微博-讨论趋势",
  179. value: v.value
  180. };
  181. });
  182. })["catch"](function () {// window.clearInterval(this.timeout)
  183. });
  184. }
  185. },
  186. created: function created() {},
  187. mounted: function mounted() {}
  188. };
  189. exports["default"] = _default;