123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <template>
- <HcCard ui="hc-count-card-ui" body-ui="hc-count-card">
- <div id="hc-count-tree" class="hc-count-tree">
- <el-scrollbar>
- <HcTreeData :is-menu="false" @nodeTap="treeNodeTap" />
- </el-scrollbar>
- </div>
- <div id="hc-count-body" class="hc-count-body">
- <el-scrollbar>
- <div class="hc-count-echarts-1">
- <el-row :gutter="14">
- <el-col :span="10">
- <HcCardItem title="面积进度柱状图统计" style="height: 440px">
- <BarLabelEcharts :lables="planLables" :color="planColors" :datas="planDatas" />
- </HcCardItem>
- </el-col>
- <el-col :span="14">
- <HcCardItem title="面积进度" style="height: 160px">
- <el-row :gutter="20" class="h-full">
- <el-col :span="6">
- <div class="hc-count-area-progress">
- <div class="num">
- {{ progress[0] || 0 }}
- </div>
- <div class="text">
- 已签协议面积(亩)
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="hc-count-area-progress">
- <div class="num">
- {{ progress[1] || 0 }}
- </div>
- <div class="text">
- 已签协议比例
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="hc-count-area-progress">
- <div class="num">
- {{ progress[2] || 0 }}
- </div>
- <div class="text">
- 已结算面积(亩)
- </div>
- </div>
- </el-col>
- <el-col :span="6">
- <div class="hc-count-area-progress">
- <div class="num">
- {{ progress[3] || 0 }}
- </div>
- <div class="text">
- 已结算比例
- </div>
- </div>
- </el-col>
- </el-row>
- </HcCardItem>
- <HcCardItem title="金额进度" style="height: 266px; margin-top: 14px">
- <BarLabelEcharts :lables="planLables1" :color="planColors1" :datas="planDatas1" />
- </HcCardItem>
- </el-col>
- </el-row>
- </div>
- <HcCardItem title="结算统计图(单位:元)" style="height: 440px; margin-top: 14px">
- <stackEcharts />
- </HcCardItem>
- </el-scrollbar>
- </div>
- </HcCard>
- </template>
- <script setup>
- import { onMounted, onUnmounted, ref } from 'vue'
- import BarLabelEcharts from '~com/echarts/BarLabel.vue'
- import stackEcharts from '~com/echarts/stackEcharts.vue'
- import split from 'split.js'
- import countApi from '~api/count/index.js'
- import { getArrValue } from 'js-fast-way'
- import { useAppStore } from '~src/store'
- const useAppState = useAppStore()
- const projectId = ref(useAppState.getProjectId)
- //树节点被点击
- const treeNodeTap = ({ node, data }) => {
- areaId.value = data.id
- getAreProgress()
- getPlanDatas()
- getPlanDatas1()
- }
- //渲染完成
- onMounted(() => {
- setSplitDom()
- })
- //获取面积进度
- const areaId = ref('')
- const progress = ref([])
- const getAreProgress = async () => {
- const { error, code, data } = await countApi.getStatArea({
- projectId: projectId.value,
- areaId:areaId.value,
- })
- if (!error && code === 200) {
- progress.value = getArrValue(data)
-
- } else {
- progress.value = []
-
- }
- }
- // 初始化设置拖动分割线
- const splitvar = ref(null)
- const setSplitDom = () => {
- try {
- //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
- splitvar.value = split([
- '#hc-count-tree',
- '#hc-count-body',
- ], {
- sizes: [20, 80],
- minSize: [200, 900],
- })
- } catch (e) {
- setTimeout(() => {
- setSplitDom()
- }, 500)
- }
- }
- //面积进度柱状图统计
- const planColors = ['#D97558', '#E4C476']
- const planLables = ref(['农用地', '建设用地', '未利用地'])
- const planDatas = ref([
- // {
- // name: '已签面积',
- // value: [1200, 132, 501],
- // },
- // {
- // name: '设计面积',
- // value: [120, 432, 1001],
- // },
- ])
- //获取面积柱状图统计
- const getPlanDatas = async () => {
- const { error, code, data } = await countApi.getstatAreaPicture({
- projectId: projectId.value,
- areaId:areaId.value,
- })
- if (!error && code === 200) {
- planDatas.value = getArrValue(data)
- } else {
- planDatas.value = []
-
- }
- }
- //金额进度
- const planColors1 = ['#7F83F6', '#81B336', '#E99D43']
- const planLables1 = ref(['征地补偿', '专项设施', '青苗', '坟地补偿', '地上附着物'])
- const planDatas1 = ref([
- // {
- // name: '实际补助总金额',
- // value: [1200, 132, 501, 323, 654],
- // },
- // {
- // name: '设计补助总金额',
- // value: [120, 432, 1001, 111, 987],
- // },
- // {
- // name: '已结算总金额',
- // value: [120, 432, 1001, 323, 654],
- // },
- ])
- //获取金额进度
- const getPlanDatas1 = async () => {
- const { error, code, data } = await countApi.getStatMoney({
- projectId: projectId.value,
- areaId:areaId.value,
- })
- if (!error && code === 200) {
- planDatas1.value = getArrValue(data)
-
- } else {
- planDatas1.value = []
-
- }
- }
- //销毁
- onUnmounted(() => {
- if (splitvar.value) {
- splitvar.value.destroy()
- }
- })
- </script>
- <style lang="scss" scoped>
- .hc-count-body .hc-count-echarts-1 {
- position: relative;
- overflow: hidden;
- }
- </style>
- <style lang="scss">
- .hc-count-card-ui {
- background: white;
- .el-card__body {
- padding: 10px;
- }
- }
- .hc-count-card {
- display: flex;
- .hc-count-tree {
- position: relative;
- margin-right: 5px;
- height: 100%;
- }
- .hc-count-body {
- position: relative;
- margin-left: 5px;
- height: 100%;
- .hc-card-item-box {
- background: #f5f5f5;
- .hc-card-item-header {
- color: #101010;
- }
- }
- }
- .hc-count-area-progress {
- position: relative;
- height: 100%;
- background: #ffffff;
- border-radius: 5px;
- display: flex;
- align-items: center;
- justify-content: center;
- .num {
- margin-bottom: 18px;
- font-size: 20px;
- }
- .text {
- position: absolute;
- bottom: 10px;
- font-size: 14px;
- }
- }
- }
- </style>
|