fix: 优化

This commit is contained in:
Xu Zhimeng 2024-04-11 16:00:04 +08:00
parent e9c693ee51
commit 990ab9def5
2 changed files with 18 additions and 9 deletions

View File

@ -328,7 +328,6 @@ export default {
inputFileName, inputFileName,
data: result, data: result,
from: 'db', from: 'db',
type: 'beta',
}) })
} else { } else {
this.$message.error(message) this.$message.error(message)
@ -375,7 +374,6 @@ export default {
inputFileName: this.sample.sampleFileName, inputFileName: this.sample.sampleFileName,
data: result, data: result,
from: 'file', from: 'file',
type: 'beta',
}) })
this.isLoading = false this.isLoading = false
@ -605,9 +603,14 @@ export default {
// beta // beta
removeOtherBetaSamples() { removeOtherBetaSamples() {
const filterList = sampleList.filter( const regExp = /([A-Z]+\d+_\d+)(-[\w\s_\.]+)/
(item) => item.type !== 'beta' || item.inputFileName == this.sample.inputFileName const stationAndDetectorName = this.sample.inputFileName.replace(regExp, '$1')
) // +
const filterList = sampleList.filter((item) => {
const inputFileName = item.inputFileName
return inputFileName == this.sample.inputFileName || !inputFileName.startsWith(stationAndDetectorName)
})
setSampleList(filterList) setSampleList(filterList)
}, },

View File

@ -327,7 +327,6 @@ export default {
}, },
} }
}, },
mounted() { mounted() {
this.opts.notMerge = true this.opts.notMerge = true
this.$nextTick(() => { this.$nextTick(() => {
@ -565,13 +564,20 @@ export default {
// 3D // 3D
histogramDataDList: { histogramDataDList: {
handler(newVal) { handler(newVal) {
const maxCount = Math.max(...newVal.map((item) => item.c)) let maxCount = 0
const data = []
for (const item of newVal) {
const { b, g, c } = item //
if (c > maxCount) maxCount = c
data.push([b, g, c])
}
this.threeDSurfaceOption.zAxis3D.max = Math.ceil(maxCount * 1.2) this.threeDSurfaceOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
this.threeDSurfaceOption.series.data = newVal.map((item) => [item.b, item.g, item.c]) // 3D surface this.threeDSurfaceOption.series.data = data // 设置3D surface数据 // 第一次设置耗时较多
this.threeDSurfaceOption.visualMap.max = maxCount this.threeDSurfaceOption.visualMap.max = maxCount
this.threeDScatterOption.zAxis3D.max = Math.ceil(maxCount * 1.2) this.threeDScatterOption.zAxis3D.max = Math.ceil(maxCount * 1.2)
this.threeDScatterOption.series.data = newVal.map((item) => [item.b, item.g, item.c]) // 3D scatter this.threeDScatterOption.series.data = data // 3D scatter
this.threeDScatterOption.visualMap.max = maxCount this.threeDScatterOption.visualMap.max = maxCount
}, },
immediate: true, immediate: true,