Browse Source

修改长度

main
likunming 8 months ago
parent
commit
681fea2024
  1. 282
      irbs.frontend/src/views/report/RptRatingDistribution.vue

282
irbs.frontend/src/views/report/RptRatingDistribution.vue

@ -1,10 +1,10 @@
<template> <template>
<div class="h-full"> <div class="h-full">
<q-splitter v-model="splitterModel" horizontal class="h-full"> <q-splitter v-model="state.splitterModel" horizontal class="h-full">
<template #before> <template #before>
<w-grid <w-grid
ref="rptRatingDistributionGridRef" ref="rptRatingDistributionGridRef"
title="客户评级分布表" title="客户评级分布表"
:data-url="Environment.apiContextPath('api/irbs/rptRatingDistribution/list')" :data-url="Environment.apiContextPath('api/irbs/rptRatingDistribution/list')"
:sort-no="true" :sort-no="true"
:dense="true" :dense="true"
@ -14,84 +14,230 @@
:columns="rptRatingDistributionGrid.columns" :columns="rptRatingDistributionGrid.columns"
:toolbar-actions="rptRatingDistributionGrid.buttons" :toolbar-actions="rptRatingDistributionGrid.buttons"
:pageable="false" :pageable="false"
@after-request-data="afterRequestData"
></w-grid> ></w-grid>
</template> </template>
<template #after> <template #after>
<w-echarts <div class="h-full">
:option="{ <q-splitter v-model="state.echartsSplitterModel" unit="px" horizontal disable class="w-full h-full">
tooltip: { <template #before>
trigger: 'axis', <q-tabs v-model="state.tab" inline-label indicator-color="primary" align="left" :breakpoint="1">
axisPointer: { <q-tab name="cust" icon="account_box" label="全部客户" />
type: 'shadow', <q-tab name="creditBalance" icon="currency_yen" label="信贷余额" />
}, </q-tabs>
}, </template>
grid: { <template #after>
top: '10%', <q-tab-panels
left: '3%', v-model="state.tab"
right: '4%', :keep-alive="true"
bottom: '3%', animated
containLabel: true, swipeable
}, vertical
dataZoom: [ transition-prev="jump-up"
{ transition-next="jump-up"
type: 'slider', class="w-full h-full"
show: true, // >
borderColor: '#e3e3e3', // <q-tab-panel name="cust" class="w-full h-full p-0">
showDetail: false, // detail <w-echarts
startValue: 0, // :option="{
endValue: 8, // tooltip: {
filterMode: 'empty', trigger: 'axis',
width: '80%', // axisPointer: {
height: 8, // type: 'shadow',
left: 'center', // },
zoomLoxk: true, // },
handleSize: 0, // toolbox: {
bottom: 0, // feature: {
}, saveAsImage: { show: true },
{ },
type: 'inside', },
zoomOnMouseWheel: false, // legend: {
moveOnMouseMove: true, // data: ['客户数', '本月新增客户数', '违约客户数', '占比', '本月新增占比', '违约占比'],
moveOnMouseWheel: true, // },
}, grid: {
], top: '15%',
xAxis: { left: '3%',
type: 'category', right: '4%',
data: ['AAA', 'AA', 'A', 'BBB', 'BB', 'B', 'CCC', 'CC', 'C', 'D'], bottom: '3%',
axisTick: { containLabel: true,
alignWithLabel: true, },
}, xAxis: {
}, type: 'category',
yAxis: [ data: state.xData,
{ axisTick: {
type: 'value', alignWithLabel: true,
}, },
], },
series: [ yAxis: [
{ {
name: '数量', type: 'value',
type: 'bar', },
barWidth: '20%', {
data: [1, 2, 3, 4, 5, 6, 7, 8, 9], type: 'value',
}, interval: 10,
], axisLabel: {
}" formatter: '{value} %',
></w-echarts> },
},
],
series: [
{
name: '客户数',
type: 'bar',
barWidth: '20%',
data: state.custData.number,
},
{
name: '占比',
type: 'line',
yAxisIndex: 1,
data: state.custData.ratio,
},
{
name: '本月新增客户数',
type: 'bar',
barWidth: '20%',
data: state.custData.addNumber,
},
{
name: '本月新增占比',
type: 'line',
yAxisIndex: 1,
data: state.custData.addRatio,
},
{
name: '违约客户数',
type: 'bar',
barWidth: '20%',
data: state.custData.defaultNumber,
},
{
name: '违约占比',
type: 'line',
yAxisIndex: 1,
data: state.custData.defaultRatio,
},
],
}"
></w-echarts>
</q-tab-panel>
<q-tab-panel name="creditBalance" class="w-full h-full p-0">
<w-echarts
:option="{
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
toolbox: {
feature: {
saveAsImage: { show: true },
},
},
legend: {
data: ['信贷余额', '占比'],
},
grid: {
top: '15%',
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: {
type: 'category',
data: state.xData,
axisTick: {
alignWithLabel: true,
},
},
yAxis: [
{
type: 'value',
},
{
type: 'value',
interval: 10,
axisLabel: {
formatter: '{value} %',
},
},
],
series: [
{
name: '信贷余额',
type: 'bar',
barWidth: '20%',
data: state.custData.creditBalance,
},
{
name: '占比',
type: 'line',
yAxisIndex: 1,
data: state.custData.creditRatio,
},
],
}"
></w-echarts>
</q-tab-panel>
</q-tab-panels>
</template>
</q-splitter>
</div>
</template> </template>
</q-splitter> </q-splitter>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive } from 'vue';
import { useQuasar } from 'quasar';
import { Environment, EnumTools, DictionaryTools, Options, Formater, axios, NotifyManager } from 'platform-core';
import { Round } from '@/views/custRating/CustRating.ts'; import { Round } from '@/views/custRating/CustRating.ts';
import { axios, Environment, Formater } from 'platform-core';
import { useQuasar } from 'quasar';
import { reactive, ref } from 'vue';
const $q = useQuasar(); const $q = useQuasar();
const rptRatingDistributionGridRef = ref(); const rptRatingDistributionGridRef = ref();
const splitterModel = ref(60); const state = reactive({
splitterModel: 60,
echartsSplitterModel: 50,
tab: 'cust',
xData: <any>[],
custData: {
number: <any>[],
ratio: <any>[],
addNumber: <any>[],
addRatio: <any>[],
defaultNumber: <any>[],
defaultRatio: <any>[],
creditBalance: <any>[],
creditRatio: <any>[],
},
});
const afterRequestData = () => {
const rows = rptRatingDistributionGridRef.value.getRows();
state.xData = [];
state.custData.number = [];
state.custData.ratio = [];
state.custData.addNumber = [];
state.custData.addRatio = [];
state.custData.defaultNumber = [];
state.custData.defaultRatio = [];
state.custData.creditBalance = [];
state.custData.creditRatio = [];
rows.forEach((item) => {
state.xData.push(item['ratingLevel']);
state.custData.number.push(item['custCnt']);
state.custData.ratio.push(item['custRatio'] && typeof item['custRatio'] === 'number' ? Round(item['custRatio'] * 100, 2) : 0);
state.custData.addNumber.push(item['currInctCnt']);
state.custData.addRatio.push(item['currInctRatio'] && typeof item['currInctRatio'] === 'number' ? Round(item['currInctRatio'] * 100, 2) : 0);
state.custData.defaultNumber.push(item['defCustCnt']);
state.custData.defaultRatio.push(item['defCustRatio'] && typeof item['defCustRatio'] === 'number' ? Round(item['defCustRatio'] * 100, 2) : 0);
state.custData.creditBalance.push(item['borrBal']);
state.custData.creditRatio.push(item['borrBalRatio'] && typeof item['borrBalRatio'] === 'number' ? Round(item['borrBalRatio'] * 100, 2) : 0);
});
};
const rptRatingDistributionGrid = { const rptRatingDistributionGrid = {
buttons: [ buttons: [
@ -173,7 +319,7 @@ const rptRatingDistributionGrid = {
}, },
], ],
columns: [ columns: [
{ label: '<span>评级</span><br/>等级', name: 'ratingLevel', align: 'center' }, { label: '评级等级', name: 'ratingLevel', align: 'center' },
{ {
label: '全部客户', label: '全部客户',
name: 'totalCustHeader', name: 'totalCustHeader',

Loading…
Cancel
Save