From e2b211bfcc2e13bd576eb37ea1442c2a54dcd767 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Mon, 18 Sep 2023 19:28:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Nuclide=20Library=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=BC=B9=E5=87=BA=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=88=87=E6=8D=A2Peak=20Infomation=E6=97=B6=E6=9C=AA=E8=8E=B7?= =?UTF-8?q?=E5=8F=96Nuclide=20Library=E9=97=AE=E9=A2=98=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8F=8C=E5=87=BB=E5=BC=B9=E5=87=BANuclide=20Review?= =?UTF-8?q?=20=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/NuclideReviewModal.vue | 12 +- .../AnalyzeInteractiveToolModal/index.vue | 6 + ...{NuclearLibrary.vue => NuclideLibrary.vue} | 19 ++- .../SubOperators/PopOverWithIcon.vue | 41 ------ src/views/spectrumAnalysis/gamma-analysis.vue | 120 ++++++++++++++++-- 5 files changed, 136 insertions(+), 62 deletions(-) rename src/views/spectrumAnalysis/components/SubOperators/{NuclearLibrary.vue => NuclideLibrary.vue} (62%) diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue index c8b0d2e..43c7e6b 100644 --- a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue @@ -159,6 +159,9 @@ export default { props: { channel: { type: Number + }, + nuclide: { + type: String } }, data() { @@ -265,13 +268,17 @@ export default { } this.handleResData(result) + this.isLoading = false + + if (this.nuclide && this.nuclideList.length) { + this.currNuclide = this.nuclide + this.getInfoByNuclide() + } } else { this.$message.error(message) } } catch (error) { console.error(error) - } finally { - this.isLoading = false } }, @@ -307,7 +314,6 @@ export default { fileName: inputFileName }) if (success) { - console.log('%c [ ]-301', 'font-size:13px; background:pink; color:#bf2c9f;', result) const { chart, halfLife, halfLifeErr, lines, name, table } = result this.info = { diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue index ff76c75..40e8b85 100644 --- a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue +++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue @@ -1317,6 +1317,7 @@ export default { const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis]) // 保持x轴不变 this.position[0] = xPixel + this.redrawBaseLine() }, ondragend: ({ offsetY }) => { this.setGraphicDraggable(false) @@ -1348,6 +1349,11 @@ export default { } }, + // 重新生成基线 + redrawBaseLine() { + console.log('%c [ 重新生成基线 ]-1355', 'font-size:13px; background:pink; color:#bf2c9f;', ) + }, + // 根据数据绘制 + 号 buildGraphicPlusByData() { this.option.graphic[1].children.forEach(item => { diff --git a/src/views/spectrumAnalysis/components/SubOperators/NuclearLibrary.vue b/src/views/spectrumAnalysis/components/SubOperators/NuclideLibrary.vue similarity index 62% rename from src/views/spectrumAnalysis/components/SubOperators/NuclearLibrary.vue rename to src/views/spectrumAnalysis/components/SubOperators/NuclideLibrary.vue index d5e4912..4f2f521 100644 --- a/src/views/spectrumAnalysis/components/SubOperators/NuclearLibrary.vue +++ b/src/views/spectrumAnalysis/components/SubOperators/NuclideLibrary.vue @@ -1,6 +1,6 @@ @@ -78,13 +98,14 @@ import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue' import DetailedInfomation from './components/SubOperators/DetailedInfomation.vue' import QcFlags from './components/SubOperators/QcFlags.vue' import GraphAssistance from './components/SubOperators/GraphAssistance.vue' -import NuclearLibrary from './components/SubOperators/NuclearLibrary.vue' +import NuclideLibrary from './components/SubOperators/NuclideLibrary.vue' import ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue' import { getAction } from '@/api/manage' import Response from './response.json' import { buildLineSeries, findSeriesByName, getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper' import { cloneDeep } from 'lodash' import axios from 'axios' +import NuclideReviewModal from './components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue' // 初始配置 const initialOption = { @@ -246,12 +267,14 @@ export default { DetailedInfomation, QcFlags, GraphAssistance, - NuclearLibrary, - ButtonWithSwitchIcon + NuclideLibrary, + ButtonWithSwitchIcon, + NuclideReviewModal }, data() { return { isLoading: false, + isLoadingNuclide: false, option: cloneDeep(initialOption), opts: { notMerge: false @@ -261,6 +284,7 @@ export default { detailedInfomation: [], qcFlags: [], graphAssistance: cloneDeep(graphAssistance), + nuclideLibraryVisible: false, channelPeakGroup: [], energyPeakGroup: [], @@ -272,7 +296,13 @@ export default { content: '', top: 0, left: 0 - } + }, + + nuclideReview: { + visible: false, + nuclide: '' + }, + currChannel: -1 } }, created() { @@ -584,10 +614,10 @@ export default { this.thumbnailOption.series[0].symbol = 'none' break case 'Scatter': - this.option.series[0].type = 'scatterGL' + this.option.series[0].type = 'scatter' this.option.series[0].symbol = 'circle' - this.thumbnailOption.series[0].type = 'scatterGL' + this.thumbnailOption.series[0].type = 'scatter' this.thumbnailOption.series[0].symbol = 'circle' break } @@ -618,6 +648,10 @@ export default { } }, + handleChangeNuclideVisible() { + this.nuclideLibraryVisible = !this.nuclideLibraryVisible + }, + // 根据seriesName重绘线 redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true) { const series = findSeriesByName(this.option.series, seriesName) @@ -695,8 +729,10 @@ export default { // 获取 Nuclide Library 数据 async getSelPosNuclide(channel) { + this.currChannel = channel + try { - this.loading = true + this.isLoadingNuclide = true const { sampleId, inputFileName: fileName } = this.sample const { success, result, message } = await getAction('/gamma/getSelPosNuclide', { @@ -714,10 +750,17 @@ export default { this.list = [] console.error(error) } finally { - this.loading = false + this.isLoadingNuclide = false } }, + // Nuclide Library 单项双击 + handleNuclideDblClick(nuclide) { + this.nuclideLibraryVisible = false + this.nuclideReview.nuclide = nuclide + this.nuclideReview.visible = true + }, + resize() { this.$refs.chartRef.resize() this.$refs.thumbnailChartRef.resize() @@ -794,19 +837,25 @@ export default { const max = item.pointlist.find(point => point.y == Math.max(...allY)) return max.x }) + + let find = null if (direction == 'right') { // 找到第一个比prevAxis大的xAxis - const find = maxXAxises.find(xAxis => xAxis > prevAxis) + find = maxXAxises.find(xAxis => xAxis > prevAxis) if (find) { this.option.series[0].markLine.data[0].xAxis = find } } else if (direction == 'left') { // 找到第一个比prevAxis小的xAxis - const find = maxXAxises.reverse().find(xAxis => xAxis < prevAxis) + find = maxXAxises.reverse().find(xAxis => xAxis < prevAxis) if (find) { this.option.series[0].markLine.data[0].xAxis = find } } + + if (find) { + this.getSelPosNuclide(find) + } }, // 鼠标按下时开启可刷选状态 @@ -1225,6 +1274,42 @@ export default { background-color: #153e44; } } + +::v-deep { + .pop-over-with-icon { + height: 100%; + display: flex; + justify-content: space-between; + align-items: center; + border: 1px solid #0a544e; + height: 100%; + padding: 0 11px; + cursor: pointer; + + .text { + font-family: MicrosoftYaHei; + color: #ade6ee; + letter-spacing: 1px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + user-select: none; + } + + img { + margin-left: 5px; + transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); + flex-shrink: 0; + user-select: none; + } + + &.ant-popover-open { + img { + transform: rotate(180deg); + } + } + } +}