Merge branch 'feature-particulate-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into feature-particulate-renpy

This commit is contained in:
orgin 2023-08-02 10:55:44 +08:00
commit b53d2c51b6

View File

@ -564,7 +564,7 @@ export default {
this.dataSourceSpectrumX_B = this.allData.bspectrumBlock&&this.allData.bspectrumBlock.bspectrumSubBlock.map((item, index) => {
return index
})
this.allData.histogramBlock.histogramSubBlock.forEach(item => {
this.allData.histogramBlock&&this.allData.histogramBlock.histogramSubBlock.forEach(item => {
if (item.c === 1) {
this.dataSourceHistogray.level_1.push(item)
} else if (item.c <= 5 && item.c > 1) {
@ -647,10 +647,37 @@ export default {
getUid() {
return (Math.random()+new Date().getTime()).toString(32).slice(0,8)
},
changeData(data) {
let arr = data.map(item => {
if (item==0) {
return 1.001
} else {
return item
}
})
return arr
},
yLogChange(e,str) {
let yAxisType = e.target.checked ? "log" : "value"
str==="G"?this.yAxisType_g = yAxisType:this.yAxisType_b = yAxisType
str === "G" ? this.yAxisType_g = yAxisType : this.yAxisType_b = yAxisType
let dataArr =[]
if (e.target.checked) {
dataArr = this.changeData(str === "G"?this.dataSourceSpectrum_G:this.dataSourceSpectrum_B)
} else {
dataArr = str === "G"?this.dataSourceSpectrum_G:this.dataSourceSpectrum_B
}
let options = {
tooltip: {
trigger: 'axis',
formatter: function (params) {
return `<div>${params[0].axisValueLabel}</div>
<div style="color:#0656ff">
value${e.target.checked ? params[0].value == 1.001 ? 0 : params[0].value : params[0].value}
</div>
`
}
},
yAxis: {
type: str==="G"?this.yAxisType_g:this.yAxisType_b,
splitLine: {
@ -658,8 +685,25 @@ export default {
lineStyle: {
color: "rgbA(64, 105, 121, 0.2)"
}
}
},
axisLabel: {
formatter: function (value) {
if (e.target.checked) {
return value == 1 ? 0 : value
} else {
return value
}
}
},
scale: false
},
series: [
{
type: 'line',
itemStyle: { normal: { color: '#0656ff' } },
data: dataArr
}
]
}
if (str === "G") {
this.spectrumChart_G.setOption(options)
@ -743,7 +787,7 @@ export default {
dataZoom: [
{
start: 0,
end: 255
end: 100
}
],
series: [
@ -759,14 +803,14 @@ export default {
this.spectrumChart_G = echarts.init(document.getElementById("spectrumChartRef_G"))
this.spectrumChart_G.setOption(this.getOptions("G"))
window.addEventListener("resize", function () {
spectrumChart_G.resize();
this,spectrumChart_G.resize();
});
},
drawSpectrumChart_B() {
this.spectrumChart_B = echarts.init(document.getElementById("spectrumChartRef_B"))
this.spectrumChart_B.setOption(this.getOptions("B"))
window.addEventListener("resize", function () {
spectrumChart_B.resize();
this.spectrumChart_B.resize();
});
},
drawHistogramChart() {
@ -832,7 +876,7 @@ export default {
series
})
window.addEventListener("resize", function () {
histogramChart.resize();
this.histogramChart.resize();
});
}
}