PieCharts.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="cartsList">
  3. <view class="cartsList-all">
  4. <view class="cartsList-name">
  5. 科室消耗数据排名
  6. </view>
  7. <view class="cartsList-seleven">
  8. <uni-data-select v-model="value" :localdata="range" @change="change" :clear="false"></uni-data-select>
  9. </view>
  10. </view>
  11. <view class="cartsList-table">
  12. <uni-table style="height: 100%;">
  13. <uni-tr v-for="(item, index) in dataList" :key="index">
  14. <uni-td align="center">
  15. <span v-if="index === 0" style="color: #c13124; font-weight: 800; font-family: sans-serif">
  16. {{ index + 1 }}
  17. </span>
  18. <span v-else-if="index === 1" style="color: #e99d7f; font-weight: 800; font-family: sans-serif">
  19. {{ index + 1 }}
  20. </span>
  21. <span v-else-if="index === 2" style="color: #75f9fd; font-weight: 800; font-family: sans-serif">
  22. {{ index + 1 }}
  23. </span>
  24. <span v-else>{{ index + 1 }}</span>
  25. </uni-td>
  26. <uni-td align="left">
  27. <view>{{ item.dept }}</view>
  28. </uni-td>
  29. <uni-td align="left">
  30. <view>
  31. {{ item.deptAmt }}
  32. </view>
  33. </uni-td>
  34. </uni-tr>
  35. </uni-table>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. supData
  42. } from '../Pie.js';
  43. export default {
  44. data() {
  45. return {
  46. value: '1',
  47. range: supData,
  48. dataList: []
  49. }
  50. },
  51. methods: {
  52. listData() {
  53. this.$http('homePage.deptCosm', {
  54. monthType: this.value
  55. }, '加载中').then((res) => {
  56. this.dataList = res.data
  57. })
  58. },
  59. change(e) {
  60. this.value = e;
  61. this.listData({
  62. monthType: this.value
  63. })
  64. },
  65. },
  66. created() {
  67. this.listData()
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. .cartsList {
  73. padding: 30rpx;
  74. .cartsList-all {
  75. width: 100%;
  76. height: 100rpx;
  77. display: flex;
  78. justify-content: space-between;
  79. background-color: #ffffff;
  80. padding: 20rpx;
  81. box-sizing: border-box;
  82. border-top-left-radius: 20rpx;
  83. border-top-right-radius: 20rpx;
  84. border-width: 4rpx 4rpx 4rpx 4rpx;
  85. border-style: solid;
  86. border-color: #90ffe4;
  87. .cartsList-name {
  88. font-size: 35rpx;
  89. font-weight: bold;
  90. }
  91. }
  92. .cartsList-table {
  93. border-bottom-right-radius: 20rpx;
  94. border-bottom-left-radius: 20rpx;
  95. border-style: solid;
  96. border-color: #90ffe4;
  97. border-width: 0 4rpx 4rpx 4rpx;
  98. }
  99. }
  100. .uni-select {
  101. width: 130% !important;
  102. }
  103. </style>