Browse Source

完成统计页面柱状图

apply^2
Min5203 4 years ago
parent
commit
081f0729f4
  1. 57
      components/BarEcharts.vue
  2. 2
      components/BonusCollection.vue
  3. 2
      components/HistoricalApplication.vue
  4. 5
      components/RingEcharts.vue
  5. 2
      pages/Initiate-application.vue
  6. 7
      pages/index.vue

57
components/BarEcharts.vue

@ -1,5 +1,5 @@
<template> <template>
<div id="barEcharts" style="width:370px;height:300px"></div> <div id="barEcharts" style="width:380px;height:350px"></div>
</template> </template>
<script setup> <script setup>
import{onMounted} from 'vue'; import{onMounted} from 'vue';
@ -10,27 +10,28 @@ onMounted(()=>{
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
// Use axis to trigger tooltip type: 'shadow',
type: 'shadow', // 'shadow' as default; can also be 'line' or 'shadow'
}, },
}, },
legend: { legend: {
top:10,
right:0,
icon: 'circle', icon: 'circle',
orient: 'horizontal', orient: 'horizontal',
itemGap: 40, itemGap: 10,
itemWidth: 14, itemWidth: 10,
itemHeight: 14, itemHeight: 14,
textStyle: { textStyle: {
fontSize: 14, fontSize: 14,
color: '#858585', color: '#858585',
fontWeight: 400, fontWeight: 400,
padding: [4, 0, 0, 0],
}, },
data: ['A', 'B', 'P', 'E'],
}, },
data: ['任务一', '任务二', '任务三', '任务四'],
color: ['#7E84A3', '#FF914C', '#5189F8', '#3FC7BB'], color: ['#7E84A3', '#FF914C', '#5189F8', '#3FC7BB'],
grid: { grid: {
left: '3%', left: '10%',
right: '0', right: '0',
bottom: '5%', bottom: '5%',
containLabel: false, containLabel: false,
@ -58,67 +59,49 @@ onMounted(()=>{
}, },
series: [ series: [
{ {
name: 'E', name: '任务四',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
label: { label: {
show: true, show: false,
color: '#FFFFFF', color: '#FFFFFF',
formatter: function (e) {
return e.value ? e.seriesName : '';
}
}, },
itemStyle: { itemStyle: {
borderRadius: [0, 0, 4, 4], borderRadius: [0, 0, 0, 0],
},
barWidth: 20,
emphasis: {
focus: 'series',
}, },
barWidth: 12,
data: [320, 80, 301, 334, 390, 330, 320, 390, 330, 320, 390, 390], data: [320, 80, 301, 334, 390, 330, 320, 390, 330, 320, 390, 390],
}, },
{ {
name: 'P', name: '任务三',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
label: { label: {
show: true, show: false,
color: '#FFFFFF', color: '#FFFFFF',
formatter: '{a}',
},
emphasis: {
focus: 'series',
}, },
data: [120, 132, 101, 134, 90, 230, 210, 302, 301, 334, 390, 330], data: [120, 132, 101, 134, 90, 230, 210, 302, 301, 334, 390, 330],
}, },
{ {
name: 'B', name: '任务二',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
label: { label: {
show: true, show: false,
color: '#FFFFFF', color: '#FFFFFF',
formatter: '{a}',
},
emphasis: {
focus: 'series',
}, },
data: [18, 66, 191, 234, 290, 330, 310, 182, 191, 234, 290, 330], data: [18, 66, 191, 234, 290, 330, 310, 182, 191, 234, 290, 330],
}, },
{ {
name: 'A', name: '任务一',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
label: { label: {
show: true, show: false,
color: '#FFFFFF', color: '#FFFFFF',
formatter: '{a}',
}, },
itemStyle: { itemStyle: {
borderRadius: [4, 4, 0, 0], borderRadius: [0, 0, 0, 0],
},
emphasis: {
focus: 'series',
}, },
data: [150, 212, 201, 154, 190, 330, 410, 182, 191, 234, 290, 330], data: [150, 212, 201, 154, 190, 330, 410, 182, 191, 234, 290, 330],
}, },

2
components/BonusCollection.vue

@ -17,7 +17,7 @@
{{ (+item.money / 100).toFixed(2) }} {{ (+item.money / 100).toFixed(2) }}
</td> </td>
<td> <td>
{{ dayjs(item.submitTime - 0).format('YYYY/MM/DD HH:mm') }} {{ dayjs(item.submitTime - 0).format('YYYY/MM/DD') }}
</td> </td>
<td> <td>
{{ item.remark }} {{ item.remark }}

2
components/HistoricalApplication.vue

@ -26,7 +26,7 @@
/> --> /> -->
</td> </td>
<td> <td>
{{ dayjs(item.submitTime - 0).format('YYYY/MM/DD HH:mm') }} {{ dayjs(item.submitTime - 0).format('YYYY/MM/DD') }}
</td> </td>
<td> <td>
<!-- <div v-if="!item.showBonusEdit" @click="item.showBonusEdit = true"> --> <!-- <div v-if="!item.showBonusEdit" @click="item.showBonusEdit = true"> -->

5
components/RingEcharts.vue

@ -18,27 +18,22 @@ onMounted(()=>{
{ {
name: '办公费', name: '办公费',
value: 36, value: 36,
rate: 12
}, },
{ {
name: '车辆费用', name: '车辆费用',
value: 20, value: 20,
rate: 20
}, },
{ {
name: '差旅费', name: '差旅费',
value: 15, value: 15,
rate: -40
}, },
{ {
name: '租赁费', name: '租赁费',
value: 10, value: 10,
rate: -15
}, },
{ {
name: '其他', name: '其他',
value: 9, value: 9,
rate: 12
}, },
]; ];
const option = { const option = {

2
pages/Initiate-application.vue

@ -1,7 +1,5 @@
<template> <template>
<div> <div>
<!-- 导航返回上一页 -->
<van-nav-bar title="发起申请" left-arrow @click-left="onClickLeft" />
<!-- 申请发票需要输入的数据 --> <!-- 申请发票需要输入的数据 -->
<div class="bg-white pb-3"> <div class="bg-white pb-3">
<div class="text-gray-500 px-4 py-3 font-semibold">发票信息</div> <div class="text-gray-500 px-4 py-3 font-semibold">发票信息</div>

7
pages/index.vue

@ -85,12 +85,15 @@
<RingEcharts class="w-full h-full" id="memberEcharts"/> <RingEcharts class="w-full h-full" id="memberEcharts"/>
</div> </div>
<!-- 时间财务图 --> <!-- 时间财务图 -->
<div class="h-72 overflow-hidden"> <div class="overflow-hidden">
<div> <div>
<span class="inline-block w-2 h-2 border-2 border-blue-400 rounded-full mr-3"></span> <span class="inline-block w-2 h-2 border-2 border-blue-400 rounded-full mr-3"></span>
<span>时间财务图</span> <span>时间财务图</span>
</div> </div>
<BarEcharts class="w-full h-full" /> <BarEcharts class="w-full h-full mt-5" />
<!-- 没有数据展示空组件 -->
<!-- <van-empty description="暂无图表数据信息" /> -->
</div> </div>
</div> </div>
</van-tab> </van-tab>

Loading…
Cancel
Save