Browse Source

fix--jwpy样式修改

master
parent
commit
085cf21476
  1. 117
      src/views/datav/Jwpy.vue

117
src/views/datav/Jwpy.vue

@ -292,10 +292,46 @@ const time = ref([
const getDistributionFun = async()=>{ const getDistributionFun = async()=>{
console.log('---------') console.log('---------')
const res = await selectDistribution(time.value); const res = await selectDistribution(time.value);
option4.value.series[0].data=res.total;
option4.value.series[1].data=res.checkStatus; //
// option4.value.series[2].data=res.checkStatus; const names = res.name;
option4.value.yAxis.data=res.name; const totalData = res.total;
const checkStatusData = res.checkStatus;
//
const combinedData = names.map((name, index) => ({
name: name,
total: totalData[index],
checkStatus: checkStatusData[index]
}));
//
// combinedData.sort((a, b) => b.total - a.total);
combinedData.sort((a, b) => a.total - b.total);
//
option4.value.yAxis.data = combinedData.map(item => item.name);
option4.value.series[0].data = combinedData.map(item => ({
value: item.checkStatus,
itemStyle: {
color: '#4987F6'
},
label: {
show: true,
position: 'right',
color: '#fff',
formatter: (params) => {
const item = combinedData[params.dataIndex];
return `${item.checkStatus}/${item.total}`;
}
}
}));
option4.value.series[1].data = combinedData.map(item => ({
value: item.total - item.checkStatus,
itemStyle: {
color: '#193775'
}
}));
console.log('option4',option4.value) console.log('option4',option4.value)
} }
@ -329,14 +365,14 @@ const toggleSelect=()=> {
const handleYearChange = (checkedYear) => { const handleYearChange = (checkedYear) => {
toggleSelect() toggleSelect()
yearValue.value= years.value.find(s=>s.ID == checkedYear).PeriodName; yearValue.value= years.value.find(s=>s.ID == checkedYear).PeriodName;
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value) console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value)
getData(); getData();
} }
const handleMonthChange = (checkedMonth) => { const handleMonthChange = (checkedMonth) => {
toggleSelect() toggleSelect()
monthValue.value= months.value.find(s=>s.ID === checkedMonth).SonPeriodName; monthValue.value= months.value.find(s=>s.ID === checkedMonth).SonPeriodName;
console.log(monthValue.value) console.log(monthValue.value)
console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value) console.log("年份" + selectYear.value + " 月份" + selectMonth.value + " 单位" + selectOrg.value + " task" + task.value)
getData(); getData();
@ -648,9 +684,23 @@ const option3 = ref({
grid: {left: '8%', right: '0%', top: '10%', bottom: '10%'}, grid: {left: '8%', right: '0%', top: '10%', bottom: '10%'},
}); });
const option4 = ref({ const option4 = ref({
tooltip: {}, tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function(params) {
const check = params[0].value;
const remaining = params[1].value;
const total = check + remaining;
return `${params[0].name}<br/>
下发数: ${total}<br/>
查实数: ${check}<br/>
占比: ${((check/total)*100).toFixed(1)}%`;
}
},
legend: { legend: {
data: ['下发数', '查实数'], data: ['查实数', '下发数'],
textStyle: { textStyle: {
color: '#fff', color: '#fff',
}, },
@ -681,54 +731,27 @@ const option4 = ref({
}, },
series: [ series: [
{ {
name: '下发数', name: '查实数',
type: 'bar', type: 'bar',
stack: 'total',
barWidth: '60%',
data: [], data: [],
label: {
show: true,
position: 'right',
color:'#fff'
},
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ color: '#4987F6'
offset: 0, }
color: 'rgba(40,230,255,0.63)'
}, {offset: 1, color: 'rgba(40,230,255,0)'}])
},
}, },
{ {
name: '查实数', name: '下发数',
type: 'bar', type: 'bar',
stack: 'total',
barWidth: '60%',
data: [], data: [],
label: {
show: true,
position: 'right',
color:'#fff'
},
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, color: '#193775'
[{offset: 0, color: 'rgba(255,218,51,0.52)'}, },
{offset: 1, color: 'rgba(255,219,49,0)'}]) }
}
},
// {
// name: '',
// type: 'bar',
// data: [],
// label: {
// show: true,
// position: 'right',
// color:'#fff'
// },
// itemStyle: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
// offset: 0,
// color: '#6FDBA0'
// }, {offset: 1, color: '#6FDBA0'}])
// }
// }
], ],
grid: {left: '17%', right: '0%', top: '10%', bottom: '10%'}, grid: {left: '17%', right: '15%', top: '10%', bottom: '10%'},
}); });

Loading…
Cancel
Save