budget-chart.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <HcCard scrollbar>
  3. <template #header>
  4. <div class="w-36">
  5. <el-select v-model="annual" block clearable placeholder="选择年度" size="large">
  6. <el-option v-for="item in annuals" :label="item.name" :value="item.key"/>
  7. </el-select>
  8. </div>
  9. </template>
  10. <template #extra>
  11. <el-button size="large" type="info" hc-btn @click="goBackClick">
  12. <HcIcon name="arrow-go-back"/>
  13. <span>返回列表</span>
  14. </el-button>
  15. </template>
  16. <div class="hc-main-row">
  17. <el-row :gutter="14">
  18. <el-col :span="8">
  19. <HcCardItem body-ui="h-96-i">
  20. <BarLabelChart :datas="contractDatas"/>
  21. </HcCardItem>
  22. </el-col>
  23. <el-col :span="8">
  24. <HcCardItem body-ui="h-96-i">
  25. <BarLabelChart :datas="manageDatas"/>
  26. </HcCardItem>
  27. </el-col>
  28. <el-col :span="8">
  29. <HcCardItem body-ui="h-96-i">
  30. <BarLabelChart :datas="profitDatas"/>
  31. </HcCardItem>
  32. </el-col>
  33. </el-row>
  34. <el-row :gutter="14" class="mt-4">
  35. <el-col :span="12">
  36. <HcCardItem body-ui="h-96-i">
  37. <PieSimple :datas="pieSimpleDatas"/>
  38. </HcCardItem>
  39. </el-col>
  40. <el-col :span="12">
  41. <HcCardItem body-ui="h-96-i">
  42. <AreaStack :datas="areaStackDatas"/>
  43. </HcCardItem>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. </HcCard>
  48. </template>
  49. <script setup>
  50. import {onActivated, ref} from "vue";
  51. import {useRouter} from 'vue-router'
  52. import BarLabelChart from "~com/echarts/BarLabelChart.vue";
  53. import PieSimple from "~com/echarts/PieSimple.vue";
  54. import AreaStack from "~com/echarts/AreaStack.vue";
  55. const router = useRouter()
  56. const annual = ref('2023')
  57. const annuals = ref([
  58. {name: '2023年', key: '2023'},
  59. {name: '2022年', key: '2022'},
  60. {name: '2021年', key: '2021'}
  61. ])
  62. //缓存页面被激活时
  63. onActivated(() => {
  64. })
  65. //合同指标、实际合同额
  66. const contractDatas = ref([
  67. {name: '合同指标', value: 190000},
  68. {name: '实际合同额', value: 8000}
  69. ])
  70. //经营预算
  71. const manageDatas = ref([
  72. {name: '经营预算', value: 120000},
  73. {name: '实际支出', value: 80000}
  74. ])
  75. //利润指标
  76. const profitDatas = ref([
  77. {name: '利润指标', value: 90010},
  78. {name: '实际利润', value: 38230}
  79. ])
  80. //管理费用项目分摊
  81. const pieSimpleDatas = ref([
  82. { value: 1048, name: '已分摊' },
  83. { value: 735, name: '未分摊' },
  84. ])
  85. //管理费用支出
  86. const areaStackDatas = ref([
  87. {
  88. name: '剩余预算',
  89. value: [120, 132, 101, 134, 90, 230, 210, 210, 210, 210, 132, 101]
  90. },
  91. {
  92. name: '已支出预警',
  93. value: [220, 182, 191, 234, 290, 330, 310, 310, 310, 310, 182, 191]
  94. }
  95. ])
  96. //返回列表
  97. const goBackClick = () => {
  98. router.back()
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. </style>
  103. <style lang="scss">
  104. .hc-main-row {
  105. .h-96-i {
  106. height: 24rem !important;
  107. }
  108. }
  109. </style>