stat_capital.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="page-box-bg-fff m-t20 r-30 p-30">
  3. <!-- 标题插槽 -->
  4. <StatisticsTitle :genre="genre" :leftText="leftText" :is_right="false" > </StatisticsTitle>
  5. <view class="row-justify-sb center p-lr20">
  6. <view class="capital_item">
  7. <view class="row-c flex">
  8. <view class="wh-14 r-100 m-r10" :style="{background:bgColor[leftColor]}"></view>
  9. <text class="size-24 text-color-576">{{tabulateData.list[0].name}}{{tabulateData.consume_num}}笔</text>
  10. </view>
  11. <view class="sys-weight-600 m-l20 m-tb10">
  12. <text class="size-32 text-color-081">{{tabulateData.consume_money}}</text>
  13. <text class="size-28 text-color-081">万</text>
  14. </view>
  15. <text class="size-28 text-color-00B sys-weight-600 m-l20"
  16. :style="{color:bgColor[leftColor]}">{{tabulateData.consume_ratio}}%</text>
  17. </view>
  18. <view class="chart_item column-c m-lr20">
  19. <CircleChart :bgColor="'#2B7DFA'" ref="tabulateObj"></CircleChart>
  20. </view>
  21. <view class="capital_item">
  22. <view class="row-c flex">
  23. <view class="wh-14 r-100 m-r10" :style="{background:bgColor[rightColor]}"></view>
  24. <text class="size-24 text-color-576">{{tabulateData.list[1].name}}{{tabulateData.pledge_num}}笔</text>
  25. </view>
  26. <view class="sys-weight-600 m-l20 m-tb10">
  27. <text class="size-32 text-color-081">{{tabulateData.pledge_money}}</text>
  28. <text class="size-28 text-color-081">万</text>
  29. </view>
  30. <text class="size-28 text-color-00B sys-weight-600 m-l20"
  31. :style="{color:bgColor[rightColor]}">{{tabulateData.pledge_ratio}}%</text>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import CircleChart from "@/common/chart/circle_chart.vue";
  38. import StatisticsTitle from "./statistics_title.vue";
  39. export default {
  40. name: 'capital_chart',
  41. components: {
  42. CircleChart,
  43. StatisticsTitle
  44. },
  45. props: {
  46. genre: {
  47. type: Number,
  48. default: 0
  49. },
  50. leftText: {
  51. type: String,
  52. default: ''
  53. },
  54. rightText: {
  55. type: String,
  56. default: '同比环比'
  57. },
  58. leftColor: {
  59. type: Number,
  60. default: 0
  61. },
  62. rightColor: {
  63. type: Number,
  64. default: 0
  65. },
  66. tabulateData:{
  67. default: ()=>{
  68. return {
  69. consume_money: 0,
  70. consume_num: "0",
  71. consume_ratio: 0,
  72. pledge_money: 0,
  73. pledge_num: "0",
  74. pledge_ratio: 0,
  75. list:[{name: "", ratio: 0, value: 0, labelText: ""},{name: "", ratio: 0, value: 0, labelText: ""}]
  76. }
  77. }
  78. }
  79. },
  80. data() {
  81. return {
  82. bgColor: ['#00BF8A', '#2B7DFA', '#ED9A2C']
  83. };
  84. },
  85. watch:{
  86. 'tabulateData':function () {
  87. this.initData()
  88. }
  89. },
  90. methods: {
  91. initData(){
  92. if((this.tabulateData.consume_ratio*1+this.tabulateData.pledge_ratio*1)>0){
  93. this.$refs.tabulateObj.setServerData(this.tabulateData.consume_ratio)
  94. }
  95. },
  96. },
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .capital_item {
  101. width: 200rpx;
  102. text-align: left;
  103. }
  104. </style>