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

首页更新

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