PieCharts.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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. <UniTable style="height: 100%;">
  13. <UniTr v-for="(item, index) in dataList" :key="index">
  14. <UniTd 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. </UniTd>
  26. <UniTd align="left">
  27. <view>{{ item.dept }}</view>
  28. </UniTd>
  29. <UniTd align="left">
  30. <view>
  31. {{ item.deptAmt }}
  32. </view>
  33. </UniTd>
  34. </UniTr>
  35. </UniTable>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. supData
  42. } from '../Pie.js';
  43. import UniTable from '@/subpkg/uni_modules/uni-table/components/uni-table/uni-table.vue';
  44. import UniTr from '@/subpkg/uni_modules/uni-table/components/uni-tr/uni-tr.vue';
  45. import UniTh from '@/subpkg/uni_modules/uni-table/components/uni-th/uni-th.vue';
  46. import UniTd from '@/subpkg/uni_modules/uni-table/components/uni-td/uni-td.vue';
  47. export default {
  48. components:{
  49. UniTable,
  50. UniTr,
  51. UniTh,
  52. UniTd
  53. },
  54. data() {
  55. return {
  56. value: '1',
  57. range: supData,
  58. dataList: []
  59. }
  60. },
  61. methods: {
  62. listData() {
  63. this.$http('homePage.deptCosm', {
  64. monthType: this.value
  65. }, '加载中').then((res) => {
  66. this.dataList = res.data
  67. })
  68. },
  69. change(e) {
  70. this.value = e;
  71. this.listData({
  72. monthType: this.value
  73. })
  74. },
  75. },
  76. created() {
  77. this.listData()
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. .cartsList {
  83. padding: 30rpx;
  84. .cartsList-all {
  85. width: 100%;
  86. height: 100rpx;
  87. display: flex;
  88. justify-content: space-between;
  89. background-color: #ffffff;
  90. padding: 20rpx;
  91. box-sizing: border-box;
  92. border-top-left-radius: 20rpx;
  93. border-top-right-radius: 20rpx;
  94. border-width: 4rpx 4rpx 4rpx 4rpx;
  95. border-style: solid;
  96. border-color: #90ffe4;
  97. .cartsList-name {
  98. font-size: 35rpx;
  99. font-weight: bold;
  100. }
  101. }
  102. .cartsList-table {
  103. border-bottom-right-radius: 20rpx;
  104. border-bottom-left-radius: 20rpx;
  105. border-style: solid;
  106. border-color: #90ffe4;
  107. border-width: 0 4rpx 4rpx 4rpx;
  108. }
  109. }
  110. .uni-select {
  111. width: 130% !important;
  112. }
  113. </style>