Commit e3bce801 authored by 沈翠玲's avatar 沈翠玲

首页更新

parent 1379c461
......@@ -33,11 +33,9 @@
.then((res) => {
if (res.result) {
datas.value = res.result.map((v) => ({
value: v.num,
name: v.time,
flowStatusTotalList: v.flowStatusTotalList,
value: v.realRepayTotal || 0,
name: v.month
}));
dates.value = res.result.map((v) => v.time);
}
load.value = false;
})
......@@ -56,6 +54,7 @@
const option = computed(() => {
return {
tooltip: {},
grid: {
left: '0',
right: '4%',
......@@ -88,7 +87,7 @@
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6, 7, 8, 9],
data: datas.value.map(v => v.name),
boundaryGap: [0, 0.01],
splitLine: {
show: false
......@@ -108,7 +107,7 @@
},
series: [
{
data: [160, 100, 150, 80, 190, 100, 175, 120, 160],
data: datas.value.map(v => v.value),
type: 'bar',
barMaxWidth: 36,
itemStyle: {
......
......@@ -2,7 +2,7 @@
<ul class="card-list" :style="{ marginTop: '10px' }">
<li class="art-custom-card" v-for="(item, index) in dataList" :key="index">
<span class="des subtitle">{{ item.des }}</span>
<CountTo class="number box-title" :endVal="item.num" :duration="1000" separator="" :decimals="2" :suffix="item.suffix"></CountTo>
<CountTo class="number box-title" :endVal="item.num" :duration="1000" separator="" :decimals="2" :suffix="item.unit + item.suffix"></CountTo>
<el-icon class="iconfont-sys"> <component :is="item.icon"/></el-icon>
</li>
</ul>
......@@ -11,6 +11,7 @@
<script setup>
import { CountTo } from 'vue3-count-to'
import { getLoanKanBanTotal } from '@/api/dataScreen';
import Decimal from 'decimal.js';
import { reactive, ref } from 'vue';
import { PictureRounded, Money, User, Star } from '@element-plus/icons-vue';
const props = defineProps({
......@@ -28,7 +29,7 @@
} else if (num > 1000) {
return Decimal(num).div(Decimal(1000)).toNumber().toFixed(2) + '千';
}
return num;
return num.toFixed(2);
};
const dataList = reactive([
{
......@@ -36,6 +37,8 @@
icon: 'PictureRounded',
startVal: 0,
duration: 1000,
unit: '',
suffix: '',
num: 0
},
{
......@@ -43,20 +46,26 @@
icon: 'User',
startVal: 0,
duration: 1000,
suffix: '',
unit: '',
num: 0
},
{
des: '案件总额',
icon: 'Money',
startVal: 0,
suffix: '',
duration: 1000,
unit: '',
num: 0
},
{
des: '回款金额',
icon: 'Money',
startVal: 0,
suffix: '',
duration: 1000,
unit: '',
num: 0
},
{
......@@ -65,6 +74,7 @@
startVal: 0,
suffix: '%',
duration: 1000,
unit: '',
num: 0
}
])
......@@ -75,10 +85,22 @@
}
getLoanKanBanTotal(params).then((res) => {
if (res.success) {
dataList[0].num = res.result.caseNum
dataList[1].num = res.result.borrowerNum
dataList[2].num = res.result.amount
dataList[3].num = res.result.sumRepayTotal
const num0 = numberFormat(res.result.caseNum)
dataList[0].num = num0.replace(/[亿万千]/, '')
dataList[0].unit = num0.replace(/\d*\.?\d*/, '')
const num1 = numberFormat(res.result.borrowerNum)
dataList[1].num = num1.replace(/[亿万千]/, '')
dataList[1].unit = num1.replace(/\d*\.?\d*/, '')
const num2 = numberFormat(res.result.amount)
dataList[2].num = num2.replace(/[亿万千]/, '')
dataList[2].unit = num2.replace(/\d*\.?\d*/, '')
const num3 = numberFormat(res.result.sumRepayTotal)
dataList[3].num = num3.replace(/[亿万千]/, '')
dataList[3].unit = num3.replace(/\d*\.?\d*/, '')
dataList[4].num = res.result.rate
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment