home.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="container">
  3. <view class="">首页</view>
  4. <view class="charts">
  5. <qiun-data-charts type="bar" :opts="opts" :chartData="chartData" />
  6. </view>
  7. <view class="table">
  8. <uni-table border stripe emptyText="暂无更多数据">
  9. <!-- 表头行 -->
  10. <uni-tr>
  11. <uni-th width="50" align="center">姓名</uni-th>
  12. <uni-th width="50" align="center">工种</uni-th>
  13. <uni-th width="80" align="center">状态</uni-th>
  14. <uni-th width="80" align="center">是否值班</uni-th>
  15. </uni-tr>
  16. <!-- 表格数据行 -->
  17. <uni-tr v-for="(item, index) in tableData" :key="index">
  18. <uni-td>{{ item.name }}</uni-td>
  19. <uni-td>{{ item.type }}</uni-td>
  20. <uni-td>{{ item.status }}</uni-td>
  21. <uni-td>{{ item.work }}</uni-td>
  22. </uni-tr>
  23. </uni-table>
  24. </view>
  25. <view class="more"></view>
  26. <!-- 悬浮按钮区域 -->
  27. <FloatButton />
  28. </view>
  29. </template>
  30. <script>
  31. import FloatButton from '../components/floatButton.vue'
  32. export default {
  33. components: {
  34. FloatButton
  35. },
  36. data() {
  37. return {
  38. chartData: {
  39. categories: ['张三', '李四', '王五', '老六', '刘八', '钱七'],
  40. series: [
  41. {
  42. name: '好评数',
  43. data: [35, 36, 31, 33, 13, 34]
  44. },
  45. {
  46. name: '完成数',
  47. data: [18, 27, 21, 24, 6, 28]
  48. }
  49. ]
  50. },
  51. opts: {
  52. color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
  53. padding: [15, 30, 0, 5],
  54. enableScroll: false,
  55. legend: {},
  56. xAxis: {
  57. boundaryGap: 'justify',
  58. disableGrid: false,
  59. min: 0,
  60. axisLine: false,
  61. max: 40
  62. },
  63. yAxis: {},
  64. extra: {
  65. bar: {
  66. type: 'group',
  67. width: 30,
  68. meterBorde: 1,
  69. meterFillColor: '#FFFFFF',
  70. activeBgColor: '#000000',
  71. activeBgOpacity: 0.08,
  72. linearType: 'custom',
  73. barBorderCircle: true,
  74. seriesGap: 2,
  75. categoryGap: 2
  76. }
  77. }
  78. },
  79. tableData: [
  80. {
  81. name: '张三',
  82. type: '电工',
  83. status: 0,
  84. work: 0
  85. },
  86. {
  87. name: '张三三',
  88. type: '泥工',
  89. status: 0,
  90. work: 0
  91. }
  92. ]
  93. }
  94. },
  95. mounted() {},
  96. methods: {}
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .container {
  101. width: 100vw;
  102. height: calc(100vh - 102rpx);
  103. background-color: salmon;
  104. .charts {
  105. width: 100%;
  106. height: 600rpx;
  107. }
  108. .table {
  109. margin: auto;
  110. width: 90%;
  111. color: #000;
  112. }
  113. .more {
  114. height: 600rpx;
  115. background-color: skyblue;
  116. }
  117. }
  118. </style>