diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index ca9df2c..841e0cb 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -137,7 +137,7 @@ */ axisLineColor: { type: String, - default: '#96989b', + default: '#7a6b74', }, /** * 轴线上文字颜色 @@ -154,6 +154,13 @@ default: true, }, /** + * y轴最大值 + */ + max: { + type: [String, Number], + default: '', + }, + /** * 标题 */ title: { @@ -269,6 +276,9 @@ option.xAxis[0].data = props.xAxisData // 横轴 } } + if (props.max && Array.isArray(option.yAxis) && option.yAxis.length > 0) { + option.yAxis[0].max = props.max + } // 数据 if (props.data) { const newSeries: lineSeriesOption[] = [] diff --git a/src/components/Echart/LineChart.vue b/src/components/Echart/LineChart.vue index ca9df2c..841e0cb 100644 --- a/src/components/Echart/LineChart.vue +++ b/src/components/Echart/LineChart.vue @@ -137,7 +137,7 @@ */ axisLineColor: { type: String, - default: '#96989b', + default: '#7a6b74', }, /** * 轴线上文字颜色 @@ -154,6 +154,13 @@ default: true, }, /** + * y轴最大值 + */ + max: { + type: [String, Number], + default: '', + }, + /** * 标题 */ title: { @@ -269,6 +276,9 @@ option.xAxis[0].data = props.xAxisData // 横轴 } } + if (props.max && Array.isArray(option.yAxis) && option.yAxis.length > 0) { + option.yAxis[0].max = props.max + } // 数据 if (props.data) { const newSeries: lineSeriesOption[] = [] diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index 0916a59..aaaaf61 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -45,6 +45,7 @@ const StatisticxAxis: Ref = ref([]) const StatisticData: Ref = ref([]) const StaffSStatisticData: Ref = ref([]) +const maxStaffCount = ref(10) const StaffSStatisticxAxis: Ref = ref([]) const TrainLogSList: Ref = ref([]) const TrainLogTitle = ref(0) @@ -107,6 +108,7 @@ getStaffSStatistic().then((res) => { StaffSStatisticxAxis.value = res.data.map((item: planReturn) => item.date) const yValue = res.data.map((item: planReturn) => Number(item.count)) + maxStaffCount.value = Math.max(yValue) > 10 ? Math.max(yValue) : 10 StaffSStatisticData.value = [{ name: '人数', data: yValue }] }) @@ -338,6 +340,7 @@