SystemCenBottom.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <div class="system-box">
  3. <div class="basic-box">
  4. <div class="list-title">今日登录统计</div>
  5. <div class="list-content">
  6. <basicBorder title="最近登录">
  7. <div class="basic-box1">
  8. <div class="box-item" v-for="(item, index) in data" :key="index">
  9. <span style="margin-right: 10px;">{{ `${item.userName} : ` }}</span>
  10. <span>{{ item.lastLoginTime }}</span>
  11. </div>
  12. </div>
  13. </basicBorder>
  14. </div>
  15. </div>
  16. <div class="basic-box">
  17. <CustomChart :chart-config="dayLoginConfig" :chart-data="dayChartData"></CustomChart>
  18. </div>
  19. </div>
  20. </template>
  21. <script setup lang="ts">
  22. import { reactive, ref,watch} from 'vue'
  23. import basicBorder from './basicBorder.vue'
  24. import CustomChart from './CustomChart.vue';
  25. import { dayLoginConfig, } from '../hsqHome.data';
  26. const props = defineProps<{ data: Array<{
  27. [x: string]:
  28. any; userName: string; value: string
  29. }> }>()
  30. let dayChartData = ref<any[]>([])
  31. watch(()=>props.data,(newV,oldV)=>{
  32. if(newV){
  33. dayChartData.value=newV.map(el=>{
  34. return {
  35. x:el.userName,
  36. y:parseFloat(el.loginCount),
  37. }
  38. })
  39. }
  40. },{immediate:true})
  41. </script>
  42. <style lang="less" scoped>
  43. .system-box {
  44. --image-box-bg: url('@/assets/images/home-container/configurable/hsq/2-5.png');
  45. position: relative;
  46. display: flex;
  47. justify-content: space-between;
  48. width: 100%;
  49. height: 100%;
  50. .basic-box {
  51. width: 50%;
  52. height: 100%;
  53. padding: 15px;
  54. box-sizing: border-box;
  55. }
  56. .list-title {
  57. width: 177px;
  58. height: 30px;
  59. line-height: 22px;
  60. padding-left: 16px;
  61. color: #01fefc;
  62. font-weight: bolder;
  63. background: var(--image-box-bg) no-repeat;
  64. background-size: 100% 100%;
  65. margin-bottom: 5px;
  66. }
  67. .list-content {
  68. width: 100%;
  69. height: calc(100% - 35px);
  70. }
  71. .basic-box1 {
  72. height: 100%;
  73. overflow-y: auto;
  74. }
  75. .box-item {
  76. display: flex;
  77. // justify-content: space-between;
  78. align-items: center;
  79. height: 26px;
  80. margin-bottom: 6px;
  81. padding: 0px 10px;
  82. box-sizing: border-box;
  83. background: linear-gradient(to right, #134c77, transparent);
  84. }
  85. ::-webkit-scrollbar {
  86. display: none;
  87. }
  88. }
  89. </style>