Commit 8e2957ce authored by ww-xxy's avatar ww-xxy

修改绩效目标

parent 33eafaaf
...@@ -21,26 +21,52 @@ export default { ...@@ -21,26 +21,52 @@ export default {
}, },
styleObj: { styleObj: {
type: Object, type: Object,
default: () => {}, default: () => { },
}, },
parameter: {
type: Object,
default: () => { }
}
}, },
data() { data() {
return {}; return {
myChart: null
};
}, },
watch: { watch: {
title(val) { title(val) {
console.log(val); this.myChart && this.myChart.setOption({title:{text:val}})
this.drawLine();
}, },
parameter: {
handler: function (v) {
this.drawLine(v)
},
deep: true
}
}, },
mounted() { mounted() {
this.drawLine(); this.drawLine();
}, },
methods: { methods: {
drawLine() { drawLine(obj) {
if (obj && this.myChart) {
// 更新
this.myChart.setOption({
xAxis: {
data: obj.x
},
series: [
{
data: obj.y,
},
]
})
return
}
// 基于dom,初始化echarts实例 // 基于dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById(this.id)); let myChart = this.$echarts.init(document.getElementById(this.id));
this.myChart = myChart
// 绘制图表 // 绘制图表
myChart.setOption({ myChart.setOption({
title: { title: {
...@@ -50,7 +76,7 @@ export default { ...@@ -50,7 +76,7 @@ export default {
fontSize: this.legendName == "旷工率" ? 24 : 18, fontSize: this.legendName == "旷工率" ? 24 : 18,
}, },
}, },
color:'#6e98ed', color: '#6e98ed',
legend: { legend: {
orient: "horizontal", orient: "horizontal",
right: "50px", right: "50px",
...@@ -65,7 +91,7 @@ export default { ...@@ -65,7 +91,7 @@ export default {
}, },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
data: ["部门1", "部门2", "部门3", "部门4", "部门5", "部门6"], data: [],
}, },
grid: { grid: {
left: "5%", left: "5%",
...@@ -79,9 +105,9 @@ export default { ...@@ -79,9 +105,9 @@ export default {
{ {
name: this.legendName, name: this.legendName,
type: "bar", type: "bar",
data: [5, 20, 36, 10, 10, 20], data: [],
itemStyle: { itemStyle: {
lineStyle: { lineStyle: {
type: "dotted", //'dotted'虚线 'solid'实线 type: "dotted", //'dotted'虚线 'solid'实线
}, },
......
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