提交 ff6ca643 编写于 作者: zhentian.jia's avatar zhentian.jia

UI回测问题

上级 ff238978
...@@ -765,4 +765,115 @@ export function ringOption(num, color) { ...@@ -765,4 +765,115 @@ export function ringOption(num, color) {
}] }]
}; };
return option; return option;
}
export function getPicOption(title, legendData, colorData, seriesData) {
let option = {
title: {
text: title,
x: "left",
left: '20px',
top: "20px",
},
tooltip: {
trigger: 'item',
// formatter: "{a} <br/>{b} : {c} ({d}%)"
formatter:function(data){
let value = data.name + ':' + data.percent.toFixed(1)+"%"
return value;
}
},
label: {
formatter:function(data){ return data.percent.toFixed(1)+"%";}
},
legend: {
orient: "vertical",
top: "center",
right: "25",
data: legendData
},
grid: {
left: "30%",
right: "0%",
bottom: "10%",
containLabel: true
},
color: colorData,
backgroundColor: '#FFFFFF',
series: [
{
name: "",
type: "pie",
radius: [0, '55%'],
center: ["50%", "57.2%"],
data: seriesData,
}
]
};
return option;
}
export function getBarOption(xAxisData, seriesData) {
let option = {
title: {
text: "人员年龄分布",
x: "left",
left: '20px',
top: "20px",
},
color: ['rgba(91, 143, 249, 0.85)'],
backgroundColor: '#FFFFFF',
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
},
formatter:function(data){
let value = data[0].name + '人数:' + data[0].value+"名"
return value;
}
},
grid: {
top: '84',
bottom: '36',
left: '20',
right: '20',
containLabel: true
},
xAxis: [
{
type: 'category',
data: xAxisData,
axisLabel: {
interval: 0
},
axisTick: { // 隐藏刻度
show: false
},
axisLine: { //隐藏轴线
show: false
},
}
],
yAxis: [
{
type: 'value',
minInterval: 1,
axisLine: { //隐藏轴线
show: false
},
axisTick: { // 隐藏刻度
show: false
},
}
],
series: [
{
name: '',
type: 'bar',
barWidth: 18,
data: seriesData,
}
]
};
return option;
} }
\ No newline at end of file
...@@ -450,6 +450,7 @@ export function getBarOption(xAxisData, seriesData) { ...@@ -450,6 +450,7 @@ export function getBarOption(xAxisData, seriesData) {
yAxis: [ yAxis: [
{ {
type: 'value', type: 'value',
minInterval: 1,
axisLine: { //隐藏轴线 axisLine: { //隐藏轴线
show: false show: false
}, },
......
...@@ -297,7 +297,7 @@ export default { ...@@ -297,7 +297,7 @@ export default {
legendData[i] = educationList[i].name; legendData[i] = educationList[i].name;
seriesData[i] = educationList[i]; seriesData[i] = educationList[i];
} }
let option = operationData.getPicOption( let option = chartData.getPicOption(
"人员学历发布", "人员学历发布",
legendData, legendData,
colorData, colorData,
...@@ -324,7 +324,7 @@ export default { ...@@ -324,7 +324,7 @@ export default {
legendData[i] = titleList[i].name; legendData[i] = titleList[i].name;
seriesData[i] = titleList[i]; seriesData[i] = titleList[i];
} }
let option = operationData.getPicOption( let option = chartData.getPicOption(
"人员职务分布", "人员职务分布",
legendData, legendData,
colorData, colorData,
...@@ -358,7 +358,7 @@ export default { ...@@ -358,7 +358,7 @@ export default {
seriesData.push(ageList[i].value); seriesData.push(ageList[i].value);
} }
} }
let option = operationData.getBarOption(xAxisData, seriesData); let option = chartData.getBarOption(xAxisData, seriesData);
setTimeout(function(){ setTimeout(function(){
let myChart3 = echarts.init(vm.$refs.age); let myChart3 = echarts.init(vm.$refs.age);
......
...@@ -125,8 +125,8 @@ ...@@ -125,8 +125,8 @@
<!-- </div> --> <!-- </div> -->
<div v-if="dataType == 1" class="data-table"> <div v-if="dataType == 1" class="data-table">
<div class="box-list"> <div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box-card box-card2" v-bind:class="{ 'box-last': index == 1 }"> <div class="box-min-2">
<!-- <el-card class="box-card box-card2" v-bind:class="{ 'box-last': index == 1 }"> --> <div v-for="(item , index) in cardData" :key="index" class="box-card box-card2" v-bind:class="{ 'box-last': index == 1 }">
<el-tooltip v-if="index == 1" class="item-tool" placement="bottom-end" effect="light"> <el-tooltip v-if="index == 1" class="item-tool" placement="bottom-end" effect="light">
<div slot="content"> <div slot="content">
<p v-for="text in item.content">{{ text }}</p> <p v-for="text in item.content">{{ text }}</p>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<p class="has">{{ item.hasKey }}:{{ item.hasNum | toThousands }}</p> <p class="has">{{ item.hasKey }}:{{ item.hasNum | toThousands }}</p>
<p class="should">{{ item.shouldKey }}:{{ item.shouldNum | toThousands }}</p> <p class="should">{{ item.shouldKey }}:{{ item.shouldNum | toThousands }}</p>
</div> </div>
<!-- </el-card> --> </div>
</div> </div>
</div> </div>
<div class="date-table"> <div class="date-table">
...@@ -1015,6 +1015,10 @@ export default { ...@@ -1015,6 +1015,10 @@ export default {
height: 106px; height: 106px;
min-width: 1050px; min-width: 1050px;
} }
.box-min-2 {
height: 106px;
min-width: 900px;
}
.box-card { .box-card {
position: relative; position: relative;
background-color: #F1F7F6; background-color: #F1F7F6;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册