fix: Nuclide Library改为点击弹出,修复切换Peak Infomation时未获取Nuclide Library问题,增加双击弹出Nuclide Review 功能

This commit is contained in:
Xu Zhimeng 2023-09-18 19:28:08 +08:00
parent 08ca6c154d
commit e2b211bfcc
5 changed files with 136 additions and 62 deletions

View File

@ -159,6 +159,9 @@ export default {
props: { props: {
channel: { channel: {
type: Number type: Number
},
nuclide: {
type: String
} }
}, },
data() { data() {
@ -265,13 +268,17 @@ export default {
} }
this.handleResData(result) this.handleResData(result)
this.isLoading = false
if (this.nuclide && this.nuclideList.length) {
this.currNuclide = this.nuclide
this.getInfoByNuclide()
}
} else { } else {
this.$message.error(message) this.$message.error(message)
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} finally {
this.isLoading = false
} }
}, },
@ -307,7 +314,6 @@ export default {
fileName: inputFileName fileName: inputFileName
}) })
if (success) { if (success) {
console.log('%c [ ]-301', 'font-size:13px; background:pink; color:#bf2c9f;', result)
const { chart, halfLife, halfLifeErr, lines, name, table } = result const { chart, halfLife, halfLifeErr, lines, name, table } = result
this.info = { this.info = {

View File

@ -1317,6 +1317,7 @@ export default {
const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis]) const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis])
// x // x
this.position[0] = xPixel this.position[0] = xPixel
this.redrawBaseLine()
}, },
ondragend: ({ offsetY }) => { ondragend: ({ offsetY }) => {
this.setGraphicDraggable(false) this.setGraphicDraggable(false)
@ -1348,6 +1349,11 @@ export default {
} }
}, },
// 线
redrawBaseLine() {
console.log('%c [ 重新生成基线 ]-1355', 'font-size:13px; background:pink; color:#bf2c9f;', )
},
// + // +
buildGraphicPlusByData() { buildGraphicPlusByData() {
this.option.graphic[1].children.forEach(item => { this.option.graphic[1].children.forEach(item => {

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="nuclear-library"> <div class="nuclear-library">
<div class="nuclear-library-item" v-for="(item, index) in list" :key="index"> <div class="nuclear-library-item" v-for="(item, index) in list" :key="index" @dblclick="handleDblClick(item)">
{{ item }} {{ item }}
</div> </div>
<div v-if="!list.length" class="is-empty"> <div v-if="!list.length" class="is-empty">
@ -15,22 +15,33 @@ export default {
list: { list: {
type: Array type: Array
} }
} },
methods: {
handleDblClick(item) {
this.$emit('dblclick', item)
}
},
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.nuclear-library { .nuclear-library {
width: 230px; width: 230px;
max-height: 200px; height: 160px;
overflow: auto; overflow: auto;
&-item { &-item {
padding: 4px 14px; padding: 4px 14px;
cursor: pointer;
&:hover {
background-color: #055565;
user-select: none;
}
} }
.is-empty { .is-empty {
padding: 20px 0; padding: 15px 0;
} }
} }
</style> </style>

View File

@ -40,44 +40,3 @@ export default {
} }
} }
</script> </script>
<style lang="less" scoped>
.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;
}
&.ant-popover-open {
img {
transform: rotate(180deg);
}
}
}
</style>
<style lang="less">
.popover-with-icon {
.ant-popover-inner-content {
padding: 8px;
}
}
</style>

View File

@ -20,10 +20,23 @@
@reset="handleReset" @reset="handleReset"
/> />
</pop-over-with-icon> </pop-over-with-icon>
<pop-over-with-icon> <a-popover
Nuclide Library overlayClassName="popover-with-icon"
<nuclear-library slot="content" :list="nuclideLibraryList" /> :visible="nuclideLibraryVisible"
</pop-over-with-icon> @click="handleChangeNuclideVisible"
placement="bottom"
>
<div class="pop-over-with-icon">
<span class="text">
Nuclide Library
</span>
<img src="@/assets/images/global/select-down.png" alt="" />
</div>
<a-spin slot="content" :spinning="isLoadingNuclide">
<nuclide-library :list="nuclideLibraryList" @dblclick="handleNuclideDblClick" />
</a-spin>
</a-popover>
<div class="peak-info"> <div class="peak-info">
<button-with-switch-icon @change="handlePeakInfoChange" @click="handleTogglePeak"></button-with-switch-icon> <button-with-switch-icon @change="handlePeakInfoChange" @click="handleTogglePeak"></button-with-switch-icon>
</div> </div>
@ -69,6 +82,13 @@
</div> </div>
<!-- 主体部分结束 --> <!-- 主体部分结束 -->
</a-spin> </a-spin>
<nuclide-review-modal
v-model="nuclideReview.visible"
:sampleId="sample.sampleId"
:channel="currChannel"
:nuclide="nuclideReview.nuclide"
/>
</div> </div>
</template> </template>
@ -78,13 +98,14 @@ import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
import DetailedInfomation from './components/SubOperators/DetailedInfomation.vue' import DetailedInfomation from './components/SubOperators/DetailedInfomation.vue'
import QcFlags from './components/SubOperators/QcFlags.vue' import QcFlags from './components/SubOperators/QcFlags.vue'
import GraphAssistance from './components/SubOperators/GraphAssistance.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 ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import Response from './response.json' import Response from './response.json'
import { buildLineSeries, findSeriesByName, getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper' import { buildLineSeries, findSeriesByName, getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
import axios from 'axios' import axios from 'axios'
import NuclideReviewModal from './components/Modals/AnalyzeInteractiveToolModal/components/NuclideReviewModal.vue'
// //
const initialOption = { const initialOption = {
@ -246,12 +267,14 @@ export default {
DetailedInfomation, DetailedInfomation,
QcFlags, QcFlags,
GraphAssistance, GraphAssistance,
NuclearLibrary, NuclideLibrary,
ButtonWithSwitchIcon ButtonWithSwitchIcon,
NuclideReviewModal
}, },
data() { data() {
return { return {
isLoading: false, isLoading: false,
isLoadingNuclide: false,
option: cloneDeep(initialOption), option: cloneDeep(initialOption),
opts: { opts: {
notMerge: false notMerge: false
@ -261,6 +284,7 @@ export default {
detailedInfomation: [], detailedInfomation: [],
qcFlags: [], qcFlags: [],
graphAssistance: cloneDeep(graphAssistance), graphAssistance: cloneDeep(graphAssistance),
nuclideLibraryVisible: false,
channelPeakGroup: [], channelPeakGroup: [],
energyPeakGroup: [], energyPeakGroup: [],
@ -272,7 +296,13 @@ export default {
content: '', content: '',
top: 0, top: 0,
left: 0 left: 0
} },
nuclideReview: {
visible: false,
nuclide: ''
},
currChannel: -1
} }
}, },
created() { created() {
@ -584,10 +614,10 @@ export default {
this.thumbnailOption.series[0].symbol = 'none' this.thumbnailOption.series[0].symbol = 'none'
break break
case 'Scatter': case 'Scatter':
this.option.series[0].type = 'scatterGL' this.option.series[0].type = 'scatter'
this.option.series[0].symbol = 'circle' this.option.series[0].symbol = 'circle'
this.thumbnailOption.series[0].type = 'scatterGL' this.thumbnailOption.series[0].type = 'scatter'
this.thumbnailOption.series[0].symbol = 'circle' this.thumbnailOption.series[0].symbol = 'circle'
break break
} }
@ -618,6 +648,10 @@ export default {
} }
}, },
handleChangeNuclideVisible() {
this.nuclideLibraryVisible = !this.nuclideLibraryVisible
},
// seriesName线 // seriesName线
redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true) { redrawLineBySeriesName(seriesName, energyData, channelData, isShow = true) {
const series = findSeriesByName(this.option.series, seriesName) const series = findSeriesByName(this.option.series, seriesName)
@ -695,8 +729,10 @@ export default {
// Nuclide Library // Nuclide Library
async getSelPosNuclide(channel) { async getSelPosNuclide(channel) {
this.currChannel = channel
try { try {
this.loading = true this.isLoadingNuclide = true
const { sampleId, inputFileName: fileName } = this.sample const { sampleId, inputFileName: fileName } = this.sample
const { success, result, message } = await getAction('/gamma/getSelPosNuclide', { const { success, result, message } = await getAction('/gamma/getSelPosNuclide', {
@ -714,10 +750,17 @@ export default {
this.list = [] this.list = []
console.error(error) console.error(error)
} finally { } finally {
this.loading = false this.isLoadingNuclide = false
} }
}, },
// Nuclide Library
handleNuclideDblClick(nuclide) {
this.nuclideLibraryVisible = false
this.nuclideReview.nuclide = nuclide
this.nuclideReview.visible = true
},
resize() { resize() {
this.$refs.chartRef.resize() this.$refs.chartRef.resize()
this.$refs.thumbnailChartRef.resize() this.$refs.thumbnailChartRef.resize()
@ -794,19 +837,25 @@ export default {
const max = item.pointlist.find(point => point.y == Math.max(...allY)) const max = item.pointlist.find(point => point.y == Math.max(...allY))
return max.x return max.x
}) })
let find = null
if (direction == 'right') { if (direction == 'right') {
// prevAxisxAxis // prevAxisxAxis
const find = maxXAxises.find(xAxis => xAxis > prevAxis) find = maxXAxises.find(xAxis => xAxis > prevAxis)
if (find) { if (find) {
this.option.series[0].markLine.data[0].xAxis = find this.option.series[0].markLine.data[0].xAxis = find
} }
} else if (direction == 'left') { } else if (direction == 'left') {
// prevAxisxAxis // prevAxisxAxis
const find = maxXAxises.reverse().find(xAxis => xAxis < prevAxis) find = maxXAxises.reverse().find(xAxis => xAxis < prevAxis)
if (find) { if (find) {
this.option.series[0].markLine.data[0].xAxis = find this.option.series[0].markLine.data[0].xAxis = find
} }
} }
if (find) {
this.getSelPosNuclide(find)
}
}, },
// //
@ -1225,6 +1274,42 @@ export default {
background-color: #153e44; 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);
}
}
}
}
</style> </style>
<style lang="less"> <style lang="less">
.peak-infomation-tooltip { .peak-infomation-tooltip {
@ -1241,4 +1326,11 @@ export default {
background-color: #55a9fe; background-color: #55a9fe;
border-color: #55a9fe; border-color: #55a9fe;
} }
.popover-with-icon {
z-index: 999;
.ant-popover-inner-content {
padding: 8px;
}
}
</style> </style>