This commit is contained in:
zmj 2024-01-21 09:50:50 +08:00
parent 8b1df79cc0
commit deeef493e4
2 changed files with 87 additions and 4 deletions

View File

@ -330,14 +330,13 @@ var option = {
}
},
legend: {
data: ['Forest', 'Steppe', 'Desert', 'Wetland']
data: ['名称', 'Steppe', 'Desert', 'Wetland']
},
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
},
xAxis: [
{
@ -694,6 +693,81 @@ let option3 = {
// option
const setHistogramOption = (legend, xAxisData, series) => {
return {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
// legend: {
// data: ['', 'Steppe', 'Desert', 'Wetland']
// },
legend,
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
},
xAxis: [
{
type: 'category',
axisTick: { show: false },
// data: ['2012', '2013', '2014', '2015', '2016', '2012', '2013', '2014', '2015', '2016']
data: xAxisData
}
],
yAxis: [
{
type: 'value'
}
],
// series: [
// // {
// // name: '',
// // type: 'bar',
// // barGap: 0,
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// // data: [320, 332, 301, 334, 390]
// // },
// // {
// // name: 'Steppe',
// // type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// // data: [220, 182, 191, 234, 290]
// // },
// // {
// // name: 'Desert',
// // type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// // data: [150, 232, 201, 154, 190]
// // },
// // {
// // name: 'Wetland',
// // type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// // data: [98, 77, 101, 99, 40]
// // }
// ]
series
}
}
@ -705,7 +779,16 @@ const initChart = (id, opt) => {
myChart.setOption(opt);
}
onMounted(() => {
initChart("customNum", customoption)
initChart("customNum", setHistogramOption({ data: ['名称'] }, ['2012', '2013', '2014', '2015', '2016', '2012', '2013', '2014', '2015', '2016'], [{
name: '名称',
type: 'bar',
barGap: 0,
label: labelOption,
emphasis: {
focus: 'series'
},
data: [320, 332, 301, 334, 390]
},]))
initChart("projectApproved", option2)
initChart("main", option3)

View File

@ -34,7 +34,7 @@
<el-input v-model="formData.supplier" clearable placeholder="请输入需求提供人" />
</el-form-item>
<el-form-item label="提供人联系方式" prop="supplier_contacts"
:rules="[{ validator: checkPhone, trigger: 'blur' }]">
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
<el-input v-model="formData.supplier_contacts" clearable placeholder="请输入提供人联系方式" />
</el-form-item>
<el-form-item label="重要程度" prop="importance">