data.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import { ref } from 'vue';
  2. import { dayjs, cloneDeep, getRandomIntBetween } from "./utils";
  3. import GroupLine from "~icons/ri/group-line";
  4. import Question from "~icons/ri/question-answer-line";
  5. import CheckLine from "~icons/ri/chat-check-line";
  6. import Smile from "~icons/ri/star-smile-line";
  7. const days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
  8. /** 项目数量、人员数量、基站数量、标签数量 */
  9. const chartData = ref([
  10. {
  11. icon: Question,
  12. bgColor: "#effaff",
  13. color: "#41b6ff",
  14. duration: 2200,
  15. name: "项目总数",
  16. value: 36000,
  17. percent: "+88%",
  18. data: [2101, 5288, 4239, 4962, 6752, 5208, 7450] // 平滑折线图数据
  19. },
  20. {
  21. icon: CheckLine,
  22. bgColor: "#fff5f4",
  23. color: "#e85f33",
  24. duration: 1600,
  25. name: "运行项目",
  26. value: 16580,
  27. percent: "+70%",
  28. data: [2216, 1148, 1255, 788, 4821, 1973, 4379]
  29. },
  30. {
  31. icon: GroupLine,
  32. bgColor: "#eff8f4",
  33. color: "#26ce83",
  34. duration: 1500,
  35. name: "人员数量",
  36. value: 16499,
  37. percent: "+99%",
  38. data: [861, 1002, 3195, 1715, 3666, 2415, 3645]
  39. },
  40. {
  41. icon: CheckLine,
  42. bgColor: "#eff8f4",
  43. color: "#26ce83",
  44. duration: 1500,
  45. name: "基站数量",
  46. value: 16499,
  47. percent: "+99%",
  48. data: [861, 1002, 3195, 1715, 3666, 2415, 3645]
  49. },
  50. {
  51. icon: Smile,
  52. bgColor: "#f6f4fe",
  53. color: "#7846e5",
  54. duration: 100,
  55. name: "在线基站",
  56. value: 100,
  57. percent: "+100%",
  58. data: [100]
  59. },
  60. {
  61. icon: Smile,
  62. bgColor: "#f6f4fe",
  63. color: "#7846e5",
  64. duration: 100,
  65. name: "标签数量",
  66. value: 100,
  67. percent: "+100%",
  68. data: [100]
  69. }
  70. ]);
  71. /** 一周概览 */
  72. const barChartData = ref([
  73. {
  74. attendPerson: [2101, 5288, 4239, 4962, 6752, 5208, 7450],
  75. arrivePerson: [2216, 1148, 1255, 1788, 4821, 1973, 4379],
  76. onlinePerson: [2116, 3148, 3255, 3788, 4821, 4970, 5390]
  77. },
  78. {
  79. attendPerson: [2101, 3280, 4400, 4962, 5752, 6889, 7600],
  80. arrivePerson: [2116, 3148, 3255, 3788, 4821, 4970, 5390],
  81. onlinePerson: [2216, 1148, 1255, 1788, 4821, 1973, 4379]
  82. }
  83. ]);
  84. /** 基站在线分布 */
  85. const progressData = ref([
  86. {
  87. projName: "项目1",
  88. percentage: 85,
  89. duration: 5,
  90. color: "#41b6ff",
  91. ancNum: 0
  92. }
  93. ]);
  94. /** 数据统计 */
  95. const tableData_old = Array.from({ length: 30 }).map((_, index) => {
  96. return {
  97. id: index + 1,
  98. requiredNumber: getRandomIntBetween(13500, 19999),
  99. questionNumber: getRandomIntBetween(12600, 16999),
  100. resolveNumber: getRandomIntBetween(13500, 17999),
  101. satisfaction: getRandomIntBetween(95, 100),
  102. date: dayjs().subtract(index, "day").format("YYYY-MM-DD")
  103. };
  104. });
  105. const tableData = ref([
  106. {
  107. tm: new Date().getTime(),
  108. projName: '',
  109. locName: '',
  110. ancAddr: 0,
  111. attendPerson: 0,
  112. arrivePerson: 0,
  113. onlinePerson: 0,
  114. items: []
  115. }
  116. ]);
  117. export { chartData, barChartData, progressData, tableData };