Commit 0de297e5 authored by 刘殿昕's avatar 刘殿昕

图表+审批可以不填意见

parent 4977fb18
......@@ -11,37 +11,37 @@ export default {
type: Array,
default: () => {
return [];
}
},
},
text: {
type: String,
default: ""
default: "",
},
show_center_data: {
type: Boolean,
default: true
default: true,
},
bar_width: {
type: Number,
default: 5
default: 5,
},
isFwsp: {
type: Boolean,
default: false
default: false,
},
isPercent: {
type: Boolean,
default: true
default: true,
},
color: {
type: Array,
default: null
}
default: null,
},
},
components: {},
data() {
return {
yylx_asy: uuidv1()
yylx_asy: uuidv1(),
};
},
watch: {
......@@ -50,7 +50,7 @@ export default {
this.init_yylx_asy(this.data, this.text);
},
deep: true,
}
},
},
computed: {},
created() {},
......@@ -71,29 +71,31 @@ export default {
white: {
color: "#ddd",
align: "center",
padding: [3, 0]
}
padding: [3, 0],
},
};
var placeHolderStyle = {
normal: {
label: {
show: false
show: false,
},
labelLine: {
show: false
show: false,
},
color: "rgba(0, 0, 0, 0)",
borderColor: "rgba(0, 0, 0, 0)",
borderWidth: 0
}
borderWidth: 0,
},
};
var data = [];
var total = 0;
var color = this.color?this.color:["#274fee", "#f5ab4c", "#e15260", "#a9aec0", "#e56600"];
var color = this.color
? this.color
: ["#274fee", "#f5ab4c", "#e15260", "#a9aec0", "#e56600"];
var color2 = ["#ef9433", "#515fe7"];
var legendarr = [];
var temp2_data = 0;
data_val.forEach(e => {
data_val.forEach((e) => {
temp2_data = temp2_data + e.value;
});
for (var i = 0; i < data_val.length; i++) {
......@@ -105,15 +107,15 @@ export default {
normal: {
borderWidth: this.bar_width,
// shadowBlur: 20,
borderColor: this.isFwsp ? color2[i] : color[i]
borderColor: this.isFwsp ? color2[i] : color[i],
// shadowColor: color[i],
}
}
},
},
},
{
value: temp2_data / 30,
name: "",
itemStyle: placeHolderStyle
itemStyle: placeHolderStyle,
}
);
legendarr.push(data_val[i].name);
......@@ -136,7 +138,7 @@ export default {
show: true,
position: "outside",
color: "#58617a",
formatter: params => {
formatter: (params) => {
if (this.isPercent) {
var percent = 0;
percent =
......@@ -156,12 +158,12 @@ export default {
}
}
},
rich: rich
}
}
rich: rich,
},
},
},
data: data
}
data: data,
},
];
var options = {
title: {
......@@ -169,19 +171,20 @@ export default {
textStyle: {
color: "#000",
fontSize: 40,
fontWeight: 200
fontWeight: 200,
},
subtext: text,
subtextStyle: {
color: "#c9cedd"
color: "#c9cedd",
},
itemGap: 0, // 主副标题距离
left: "center",
top: "32%"
top: "32%",
},
color: this.isFwsp ? color2 : color,
tooltip: {
show: false
trigger: "item",
formatter: "{b}: {c} ({d}%)",
},
legend: {
bottom: -5,
......@@ -190,17 +193,17 @@ export default {
itemHeight: 10,
orient: "horizontal",
data: legendarr,
backgroundColor: "#f4f7fc"
backgroundColor: "#f4f7fc",
},
toolbox: {
show: false
show: false,
},
series: seriesObj
series: seriesObj,
};
return options;
}
}
},
},
};
</script>
......
......@@ -111,7 +111,7 @@ export default {
rules: {
result: [{ required: true, message: "请选择意见", trigger: "change" }],
option: [
{ required: true, message: "请输入意见", trigger: "blur" },
// { required: true, message: "请输入意见", trigger: "blur" },
{
min: 0,
max: 200,
......
......@@ -1740,7 +1740,8 @@ export default {
var options = {
color: color,
tooltip: {
show: false
trigger: "item",
formatter: "{b}: {c} ({d}%)",
},
// legend: {
// bottom: -5,
......
......@@ -78,7 +78,7 @@ export default {
{ required: true, message: '请选择意见', trigger: 'change' },
],
option:[
{ required: true, message: '请输入意见', trigger: 'blur' },
// { required: true, message: '请输入意见', trigger: 'blur' },
{
min: 0,max:200, message: '长度应小于200个字符', trigger: 'blur'
}
......
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