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

图表+审批可以不填意见

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