diff --git a/src/views/spectrumAnalysis/beta-analysis.vue b/src/views/spectrumAnalysis/beta-analysis.vue new file mode 100644 index 0000000..93efa7c --- /dev/null +++ b/src/views/spectrumAnalysis/beta-analysis.vue @@ -0,0 +1,292 @@ + + + + + \ No newline at end of file diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue new file mode 100644 index 0000000..92f12fc --- /dev/null +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue @@ -0,0 +1,758 @@ + + + + + \ No newline at end of file diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue index 36d40f7..4256a97 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue @@ -56,11 +56,11 @@ const twoDOption = { top: 15, left: 55, right: 10, - bottom: 45 + bottom: 45, }, tooltip: { trigger: 'item', - formatter: params => { + formatter: (params) => { const [b, g, c] = params.value return `Beta: ${b}
Gamma: ${g}
Count: ${c}` }, @@ -68,76 +68,76 @@ const twoDOption = { animation: false, type: 'cross', lineStyle: { - type: 'dashed' - } - } + type: 'dashed', + }, + }, }, xAxis: { name: 'Beta Channel', nameTextStyle: { color: '#5b9cba', - fontSize: 16 + fontSize: 16, }, nameLocation: 'center', nameGap: 30, axisLine: { lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } + color: 'rgba(119, 181, 213, .3)', + }, }, axisLabel: { color: '#ade6ee', - fontSize: 12 + fontSize: 12, }, splitLine: { show: true, lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } + color: 'rgba(119, 181, 213, .3)', + }, }, axisTick: { - show: false + show: false, }, min: 0, max: 256, - interval: 64 + interval: 64, }, yAxis: { name: 'Gamma Channel', nameTextStyle: { color: '#5b9cba', - fontSize: 16 + fontSize: 16, }, nameLocation: 'center', nameGap: 35, axisLine: { lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } + color: 'rgba(119, 181, 213, .3)', + }, }, axisLabel: { color: '#ade6ee', - fontSize: 12 + fontSize: 12, }, splitLine: { show: true, lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } + color: 'rgba(119, 181, 213, .3)', + }, }, axisTick: { - show: false + show: false, }, min: 0, max: 256, - interval: 64 + interval: 64, }, series: { type: 'scatterGL', symbolSize: 4, data: [], itemStyle: { - color: '#fff' + color: '#fff', }, markLine: { silent: true, @@ -146,12 +146,12 @@ const twoDOption = { animation: false, lineStyle: { type: 'solid', - width: 2 - } - } + width: 2, + }, + }, }, brush: {}, - animation: false + animation: false, } //3D Surface 配置 @@ -162,66 +162,66 @@ const threeDSurfaceOption = { formatter: ({ value: [x, y, z] }) => { // 自定义 tooltip 的内容 return `Beta Channel:${x} Count:${z} Gamma Channel: ${y}` - } + }, }, visualMap: { show: false, min: 0, max: 0, inRange: { - color: ['#0DCF38', '#B5475E'] - } + color: ['#0DCF38', '#B5475E'], + }, }, grid3D: { axisLabel: { - color: '#ade6ee' + color: '#ade6ee', }, axisPointer: { - show: false + show: false, }, axisLine: { lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } + color: 'rgba(119, 181, 213, .3)', + }, }, splitLine: { lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } - } + color: 'rgba(119, 181, 213, .3)', + }, + }, }, xAxis3D: { name: 'Beta Channel', nameTextStyle: { color: '#5b9cba', - fontSize: 14 + fontSize: 14, }, min: 0, max: 256, - interval: 64 + interval: 64, }, yAxis3D: { name: 'Gamma Channel', nameTextStyle: { color: '#5b9cba', - fontSize: 14 + fontSize: 14, }, min: 0, max: 256, - interval: 64 + interval: 64, }, zAxis3D: { name: 'Count', nameTextStyle: { color: '#5b9cba', - fontSize: 14 + fontSize: 14, }, - max: 0 + max: 0, }, series: { type: 'surface', - data: [] - } + data: [], + }, } // 3D Scatter 配置 @@ -231,92 +231,92 @@ const threeDScatterOption = { formatter: ({ value: [x, y, z] }) => { // 自定义 tooltip 的内容 return `Beta Channel:${x} Count:${z} Gamma Channel: ${y}` - } + }, }, visualMap: { show: false, min: 0, max: 0, inRange: { - color: ['#0DCF38', '#B5475E'] - } + color: ['#0DCF38', '#B5475E'], + }, }, grid3D: { axisLabel: { - color: '#ade6ee' + color: '#ade6ee', }, axisPointer: { - show: false + show: false, }, axisLine: { lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } + color: 'rgba(119, 181, 213, .3)', + }, }, splitLine: { lineStyle: { - color: 'rgba(119, 181, 213, .3)' - } - } + color: 'rgba(119, 181, 213, .3)', + }, + }, }, xAxis3D: { name: 'Beta Channel', nameTextStyle: { color: '#5b9cba', - fontSize: 14 + fontSize: 14, }, min: 0, max: 256, - interval: 64 + interval: 64, }, yAxis3D: { name: 'Gamma Channel', nameTextStyle: { color: '#5b9cba', - fontSize: 14 + fontSize: 14, }, min: 0, max: 256, - interval: 64 + interval: 64, }, zAxis3D: { name: 'Count', nameTextStyle: { color: '#5b9cba', - fontSize: 14 + fontSize: 14, }, - max: 0 + max: 0, }, series: { type: 'scatter3D', symbolSize: 5, emphasis: { label: { - show: false - } + show: false, + }, }, - data: [] - } + data: [], + }, } export default { props: { histogramDataList: { type: Array, - default: () => [] + default: () => [], }, histogramDataDList: { type: Array, - default: () => [] + default: () => [], }, boundary: { type: Array, - default: () => [] - } + default: () => [], + }, }, components: { CustomChart, - ColorPalette + ColorPalette, }, data() { this.buttons = buttons @@ -328,7 +328,7 @@ export default { twoDOption, threeDSurfaceOption, threeDScatterOption, - showROI: true + showROI: true, } }, @@ -390,8 +390,8 @@ export default { key: 'brush', brushOption: { // 参见 brush 组件的 brushType。如果设置为 false 则关闭“可刷选状态”。 - brushType: 'rect' - } + brushType: 'rect', + }, }) }, @@ -406,12 +406,12 @@ export default { // 清理刷选的范围 chart.dispatchAction({ type: 'brush', - areas: [] + areas: [], }) // 改为不可刷选状态 chart.dispatchAction({ - type: 'takeGlobalCursor' + type: 'takeGlobalCursor', }) }, @@ -423,8 +423,8 @@ export default { const range = areas.range const [[minX, maxX], [minY, maxY]] = range - const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map(num => parseInt(num.toFixed())) - const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map(num => parseInt(num.toFixed())) + const point1 = chart.convertFromPixel({ seriesIndex: 0 }, [minX, minY]).map((num) => parseInt(num.toFixed())) + const point2 = chart.convertFromPixel({ seriesIndex: 0 }, [maxX, maxY]).map((num) => parseInt(num.toFixed())) const [x1, y2, x2, y1] = [...point1, ...point2] // 根据解析出的数据确定真实的范围 @@ -449,7 +449,7 @@ export default { buildScatterList() { const { xAxis: { min: minX, max: maxX }, - yAxis: { min: minY, max: maxY } + yAxis: { min: minY, max: maxY }, } = this.twoDOption this.twoDOption.series.data = this.histogramDataDList @@ -459,12 +459,12 @@ export default { // 构造一个scatter 的点 buildScatterItem(xAxis, yAxis, count) { - const { r, g, b } = this.interpolateColor(1 - (count / this.currCount)) + const { r, g, b } = this.interpolateColor(1 - count / this.currCount) return { value: [xAxis, yAxis], itemStyle: { - color: `rgb(${r}, ${g}, ${b})` - } + color: `rgb(${r}, ${g}, ${b})`, + }, } }, @@ -503,7 +503,7 @@ export default { [minX, minY], [maxX, minY], [maxX, maxY], - [minX, maxY] + [minX, maxY], ] rectList.push(...this.drawOneRect(rect, color)) @@ -521,18 +521,18 @@ export default { const rectList = [] const { xAxis: { min: minX, max: maxX }, - yAxis: { min: minY, max: maxY } + yAxis: { min: minY, max: maxY }, } = this.twoDOption const inchartPoints = this.getInChartPoints(rect) - const outchartPoints = rect.filter(pointItem => !inchartPoints.includes(pointItem)) + const outchartPoints = rect.filter((pointItem) => !inchartPoints.includes(pointItem)) // 如果框选范围内只有俩点 if (inchartPoints.length == 2) { const [point1, point2] = inchartPoints const isVerticleLine = this.isVerticleLine(point1, point2) // 如果是纵向标记线,判断另两个点是在左边还是右边 if (isVerticleLine) { - const find = outchartPoints.find(outcharPoint => point1[1] == outcharPoint[1]) // 找出纵坐标相同的在图表外面的点 + const find = outchartPoints.find((outcharPoint) => point1[1] == outcharPoint[1]) // 找出纵坐标相同的在图表外面的点 // 判断在图表外的这个点是在左边还是右边 const isLeft = find[0] <= point1[0] /** @@ -546,7 +546,7 @@ export default { **/ if (isLeft) { - inchartPoints.forEach(point => { + inchartPoints.forEach((point) => { rectList.push(this.generateLineDataByTwoPoints([minX, point[1]], point)) }) @@ -554,7 +554,7 @@ export default { } // 如果是右边,同理,推入右边俩点构成矩形 else { - inchartPoints.forEach(point => { + inchartPoints.forEach((point) => { rectList.push(this.generateLineDataByTwoPoints([maxX, point[1]], point)) }) rectList.push(this.generateLineDataByTwoPoints(point1, point2)) @@ -562,7 +562,7 @@ export default { } // 如果是纵向标记线,判断另两个点是在上边还是下边 else { - const find = outchartPoints.find(outcharPoint => point1[0] == outcharPoint[0]) // 找出横坐标相同的在图表外面的点 + const find = outchartPoints.find((outcharPoint) => point1[0] == outcharPoint[0]) // 找出横坐标相同的在图表外面的点 // 判断在图表外的这个点是在上边还是右边 const isBottom = find[1] <= point1[1] /** @@ -570,7 +570,7 @@ export default { **/ if (isBottom) { - inchartPoints.forEach(point => { + inchartPoints.forEach((point) => { rectList.push(this.generateLineDataByTwoPoints([point[0], minY], point)) }) @@ -578,7 +578,7 @@ export default { } // 如果是上边,同理,推入上边俩点构成矩形 else { - inchartPoints.forEach(point => { + inchartPoints.forEach((point) => { rectList.push(this.generateLineDataByTwoPoints([point[0], maxY], point)) }) @@ -589,8 +589,8 @@ export default { // 只有一个点在范围内,则是选中了矩形的一个角 else if (inchartPoints.length == 1) { const point = inchartPoints[0] - const isLeft = !!outchartPoints.find(outPoint => outPoint[0] < point[0]) - const isBottom = !!outchartPoints.find(outPoint => outPoint[1] < point[1]) + const isLeft = !!outchartPoints.find((outPoint) => outPoint[0] < point[0]) + const isBottom = !!outchartPoints.find((outPoint) => outPoint[1] < point[1]) // 截取的右上角 if (isLeft && isBottom) { rectList.push(this.generateLineDataByTwoPoints(point, [minX, point[1]])) @@ -626,7 +626,7 @@ export default { // 全不在里面 else { // 筛选出所有的在框选范围内的横坐标 - const xAxisList = rect.map(item => item[0]).filter(xAxis => xAxis > minX && xAxis < maxX) + const xAxisList = rect.map((item) => item[0]).filter((xAxis) => xAxis > minX && xAxis < maxX) const leftBottomPoint = rect[0] const rightBottomPoint = rect[1] const rightTopPoint = rect[3] @@ -646,7 +646,7 @@ export default { } // 筛选出所有的在框选范围内的横坐标 - const yAxisList = rect.map(item => item[1]).filter(xAxis => xAxis > minY && xAxis < maxY) + const yAxisList = rect.map((item) => item[1]).filter((xAxis) => xAxis > minY && xAxis < maxY) const minXAxis = leftBottomPoint[0] const maxXAxis = rightBottomPoint[0] // 需要显示上下两侧的框线 @@ -663,9 +663,9 @@ export default { } } // 补齐颜色 - rectList.forEach(item => { + rectList.forEach((item) => { item[0].lineStyle = { - color + color, } }) return rectList @@ -678,10 +678,10 @@ export default { getInChartPoints(rectInfo) { const { xAxis: { min: minX, max: maxX }, - yAxis: { min: minY, max: maxY } + yAxis: { min: minY, max: maxY }, } = this.twoDOption - return rectInfo.filter(point => { + return rectInfo.filter((point) => { const [xAxis, yAxis] = point return xAxis >= minX && xAxis <= maxX && yAxis >= minY && yAxis <= maxY }) @@ -702,12 +702,12 @@ export default { return [ { xAxis: point1[0], - yAxis: point1[1] + yAxis: point1[1], }, { xAxis: point2[0], - yAxis: point2[1] - } + yAxis: point2[1], + }, ] }, @@ -728,7 +728,7 @@ export default { const g = color1.g + (color2.g - color1.g) * percentage const b = color1.b + (color2.b - color1.b) * percentage return { r, g, b } - } + }, }, watch: { // 2D 图表 @@ -737,43 +737,43 @@ export default { this.active = 0 this.buildScatterList() }, - immediate: true + immediate: true, }, // 3D 图表 histogramDataDList: { handler(newVal) { - const maxCount = Math.max(...newVal.map(item => item.c)) + const maxCount = Math.max(...newVal.map((item) => item.c)) 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 = newVal.map((item) => [item.b, item.g, item.c]) // 设置3D surface数据 this.threeDSurfaceOption.visualMap.max = maxCount 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 = newVal.map((item) => [item.b, item.g, item.c]) // 设置3D scatter数据 this.threeDScatterOption.visualMap.max = maxCount }, - immediate: true + immediate: true, }, // 2D 图表 上的 矩形 boundary: { handler(newVal) { newVal.forEach((item, index) => { - item.color = rectColorList[index%5] + item.color = rectColorList[index % 5] }) this.boundaryData = newVal this.reDrawRect() }, - immediate: true + immediate: true, }, currCount: { handler() { this.buildScatterList() }, - immediate: true - } - } + immediate: true, + }, + }, } diff --git a/src/views/spectrumAnalysis/components/ResultDisplay-Beta.vue b/src/views/spectrumAnalysis/components/ResultDisplay-Beta.vue new file mode 100644 index 0000000..9b812dd --- /dev/null +++ b/src/views/spectrumAnalysis/components/ResultDisplay-Beta.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/spectrumAnalysis/components/RoiLimits.vue b/src/views/spectrumAnalysis/components/RoiLimits.vue new file mode 100644 index 0000000..eb34296 --- /dev/null +++ b/src/views/spectrumAnalysis/components/RoiLimits.vue @@ -0,0 +1,169 @@ + + + + + \ No newline at end of file diff --git a/src/views/spectrumAnalysis/components/RoiParam.vue b/src/views/spectrumAnalysis/components/RoiParam.vue new file mode 100644 index 0000000..bcee179 --- /dev/null +++ b/src/views/spectrumAnalysis/components/RoiParam.vue @@ -0,0 +1,69 @@ + + + + + \ No newline at end of file diff --git a/src/views/spectrumAnalysis/index.vue b/src/views/spectrumAnalysis/index.vue index 9c77ea1..f10f93e 100644 --- a/src/views/spectrumAnalysis/index.vue +++ b/src/views/spectrumAnalysis/index.vue @@ -50,6 +50,8 @@ /> + + import { postAction } from '@/api/manage' import GammaAnalysis from './gamma-analysis.vue' +import BetaAnalysis from './beta-analysis.vue' import BetaGammaAnalysis from './beta-gamma-analysis.vue' import SpectraListInMenu from './components/SpectraListInMenu.vue' import LoadFromDbModal from './components/Modals/LoadFromDBModal.vue' @@ -291,6 +294,7 @@ export default { name: 'SpectrumAnalysis', components: { BetaGammaAnalysis, + BetaAnalysis, GammaAnalysis, SpectraListInMenu, LoadFromDbModal, @@ -1647,6 +1651,10 @@ export default { isGamma() { return this.analysisType == ANALYZE_TYPE.GAMMA }, + // 当前类型是否是Beta + isBeta() { + return this.analysisType == ANALYZE_TYPE.BETA_GAMMA ? false : true + }, // 当前类型是否是Beta-Gamma isBetaGamma() {