getpageinfo.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. let UserId = getlocation('userId')
  2. // 看板数据请求函数
  3. async function resfn() {
  4. let UserId = getlocation('userId')
  5. let res = await getRequest('api/v1/LargeDataScreen/AllMakerData?t='+Math.random(6),JSON.stringify({}));
  6. handle1(res)
  7. };
  8. async function res1fn() {
  9. let res_1 = await getRequest('api/v1/LargeDataScreen/ExhibitionData?t=' + Math.random(6), JSON.stringify({}));
  10. handle3(res_1)
  11. };
  12. async function res2fn() {
  13. let times = 0;
  14. let res_2 = await getRequest('api/v1/LargeDataScreen/MakerListCount?t=' + Math.random(6), JSON.stringify({
  15. PageSize: 30,
  16. PageNum: times++
  17. }));
  18. if (res_2.data.length < 30) {
  19. res_2 = await getRequest('api/v1/LargeDataScreen/MakerListCount?t=' + Math.random(6), JSON.stringify({
  20. PageSize: 30,
  21. PageNum: times
  22. }));
  23. }
  24. handle2(res_2)
  25. };
  26. async function res3fn() {
  27. let UserId = getlocation('userId')
  28. let res_3 = await getRequest('api/v1/LargeDataScreen/MakerSort?t=' + Math.random(6), JSON.stringify({UserId}));
  29. let res_4 = await getRequest('api/v1/LargeDataScreen/MakerFlowingWaterSort?t=' + Math.random(6), JSON.stringify({UserId}));
  30. let res_5 = await getRequest('api/v1/LargeDataScreen/MakerIncomeSort?t=' + Math.random(6), JSON.stringify({}));
  31. handle4(res_3,res_4,res_5)
  32. };
  33. async function res6fn() {
  34. let UserId = getlocation('userId')
  35. let res_6 = await getRequest('api/v1/LargeDataScreen/TeamPerformanceYear?t=' + Math.random(6), JSON.stringify({
  36. UserId
  37. }));
  38. let res_7 = await getRequest('api/v1/LargeDataScreen/TradeTwoWeeks?t=' + Math.random(6), JSON.stringify({
  39. UserId
  40. }));
  41. handle6(res_6,res_7)
  42. };
  43. async function res10fn() {
  44. let UserId = getlocation('userId')
  45. let res_10 = await getRequest('api/v1/LargeDataScreen/MonthTradePercentage?t=' + Math.random(6), JSON.stringify({
  46. UserId
  47. }));
  48. let res_11 = await getRequest('api/v1/LargeDataScreen/MonthMakerAddPercentages?t=' + Math.random(6), JSON.stringify({
  49. UserId
  50. }));
  51. handle5(res_10,res_11);
  52. handle7(res_10)
  53. handle8(res_11)
  54. };
  55. async function res12fn() {
  56. let UserId = getlocation('userId')
  57. let res_12 = await getRequest('api/v1/LargeDataScreen/ModelTypeCount?t=' + Math.random(6), JSON.stringify({
  58. UserId
  59. }));
  60. handle9(res_12)
  61. };
  62. async function res13fn() {
  63. let UserId = getlocation('userId')
  64. let res_13 = await getRequest('api/v1/LargeDataScreen/ModelTypeTradeCount?t=' + Math.random(6), JSON.stringify({
  65. UserId
  66. }));
  67. handle10(res_13)
  68. };
  69. function init() {
  70. // 创客总数,今日新增
  71. resfn()
  72. // 全国展业数据
  73. res1fn()
  74. // 列表数据
  75. res2fn()
  76. //排行榜数据
  77. res3fn()
  78. // 折线图
  79. res6fn()
  80. // 月度交易额环比
  81. res10fn()
  82. //机具统计
  83. res12fn()
  84. res13fn()
  85. };
  86. gettoken();
  87. showmap();
  88. init();
  89. // 固定周期进行数据请求
  90. // setInterval(init,1000);
  91. $("#nowtime").text('创业帮数据看板欢迎您!');
  92. setInterval(async () => {
  93. init();
  94. }, 20000);
  95. setInterval(async () => {
  96. const time = `${new Date().getFullYear()}年${fillZero(new Date().getMonth()+1)}月${fillZero(new Date().getDate())}日 ${fillZero(new Date().getHours())}:${fillZero(new Date().getMinutes())}:${fillZero(new Date().getSeconds())}`
  97. $("#nowtime").text(time);
  98. }, 1000);
  99. // 2022年10月20日 12:20:15
  100. fillZero = function (val) {
  101. if (val < 10) {
  102. return '0' + val
  103. } else {
  104. return val
  105. }
  106. }