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

完成率

parent e8ff9033
...@@ -35,3 +35,6 @@ export const getFourFollowTypeTotal = (params) => { ...@@ -35,3 +35,6 @@ export const getFourFollowTypeTotal = (params) => {
export const getRepayRecordTotal = (params) => { export const getRepayRecordTotal = (params) => {
return request.get('repayRecord/getRepayRecordTotal', params); return request.get('repayRecord/getRepayRecordTotal', params);
}; };
export const getTractRecordFollowRate = (params) => {
return request.get('/Loan/getTractRecordFollowRate', params);
};
\ No newline at end of file
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
formatter: (a) => { formatter: (a) => {
console.log('sadsa4444', a); console.log('sadsa4444', a);
let html = ''; let html = '';
html += a.name + '\n' + a.seriesName + ':' + a.data.value; html += a.name + '\n' + a.seriesName + ':' + a.data.value+ '%';
return html; return html;
}, },
}, },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import ECharts from '@/components/ECharts/index.vue'; import ECharts from '@/components/ECharts/index.vue';
import echarts from '@/components/ECharts/config'; import echarts from '@/components/ECharts/config';
const Tenantlist = ref([]); const Tenantlist = ref([]);
import { getTractRecordFollowRate } from '@/api/dataScreenMock'; import { getTractRecordFollowRate } from '@/api/dataScreen';
const load = ref(false); const load = ref(false);
const treeValue = ref([]); const treeValue = ref([]);
const timer1 = ref(); const timer1 = ref();
...@@ -26,18 +26,28 @@ ...@@ -26,18 +26,28 @@
var option = computed(() => { var option = computed(() => {
return { return {
tooltip: { tooltip: {
formatter: '{b}:<br />完成率: {c}%', formatter: (a) => {
let html = '';
html += a.name + '<br/>' + a.seriesName + ':' + (a.data.value === 0.000000001 ? 0 : a.data.value)+ '%';
return html;
}
}, },
color: ['rgb(100,200,300)'], color: ['rgb(100,200,300)'],
series: [ series: [
{ {
name: '完成率', name: '完成率',
type: 'treemap', type: 'treemap',
visibleMin: 100, visibleMin: 0,
breadcrumb: {
show: true,
emphasis: {
textStyle: {}
},
leavesOnly: false // 允许显示值为0的节点
},
data: [ data: [
// 注意,最外层是一个数组,而非从某个根节点开始。 // 注意,最外层是一个数组,而非从某个根节点开始。
{ {
value: 100,
children: treeValue.value, children: treeValue.value,
}, },
// { // {
...@@ -49,9 +59,9 @@ ...@@ -49,9 +59,9 @@
label: { label: {
normal: { normal: {
formatter: (a) => { formatter: (a) => {
console.log('sadsa4444', a); console.log('asda', a)
let html = ''; let html = '';
html += a.name + '\n' + a.seriesName + ':' + a.data.value; html += a.name + '\n' + a.seriesName + ':' + (a.data.value === 0.000000001 ? 0 : a.data.value)+ '%';
return html; return html;
}, },
}, },
...@@ -105,7 +115,22 @@ ...@@ -105,7 +115,22 @@
getTractRecordFollowRate(param).then((res) => { getTractRecordFollowRate(param).then((res) => {
if (res.result) { if (res.result) {
load.value = false; load.value = false;
res.result.forEach(v => {
if (!v.children) {
v.children = []
}
if (v.value === 0) {
v.value = 0.000000001
}
v.children.forEach(child => {
if (child.value === 0) {
child.value = 0.000000001
}
})
})
treeValue.value = res.result treeValue.value = res.result
console.log('treeValue.value', treeValue.value)
} }
}); });
}; };
......
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