AnalysisSystemForRadionucli.../src/views/spectrumAnalysis/index.vue

509 lines
13 KiB
Vue
Raw Normal View History

2023-05-10 08:40:05 +08:00
<template>
2023-06-28 19:25:11 +08:00
<div class="spectrum-analysis">
<!-- 顶部操作栏 -->
<div class="spectrum-analysis-operators">
<a-dropdown
class="spectrum-analysis-operators-item"
overlayClassName="spectrum-analysis-operators-dropdown-overlay"
:overlay-style="operation.style"
v-for="operation in operations"
:key="operation.title"
>
2023-06-28 19:25:11 +08:00
<a-button type="primary">{{ operation.title }}</a-button>
<div slot="overlay">
<template v-for="(child, index) in operation.children">
<component :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
<component :is="item.type" v-for="item in child.children" :key="item.title" @click="item.handler">
{{ item.title }}
</component>
</component>
</template>
</div>
2023-06-28 19:25:11 +08:00
</a-dropdown>
</div>
<!-- 顶部操作栏结束 -->
<!-- 二级交互栏 -->
<div class="spectrum-analysis-sub-operators">
<pop-over-with-icon placement="bottomLeft">
Detailed-Information
<detailed-infomation slot="content" />
</pop-over-with-icon>
<pop-over-with-icon placement="bottomLeft">
QC Flags
<qc-flags slot="content" :data="{ collectionTime: '123' }" />
</pop-over-with-icon>
<!-- gamma 独有的二级交互栏 -->
<template v-if="analysisType == ANALYZE_TYPE.GAMMA">
<pop-over-with-icon>
Graph Assistance
<graph-assistance slot="content" />
</pop-over-with-icon>
<pop-over-with-icon>
Nuclide Library
<nuclear-library slot="content" />
</pop-over-with-icon>
<div class="peak-info">
<button-with-switch-icon @change="handlePeakInfoChange">
Peak Information
</button-with-switch-icon>
</div>
</template>
<!-- gamma 独有的二级交互栏结束 -->
<!-- beta-gamma 独有的二级交互栏 -->
<template v-if="analysisType == ANALYZE_TYPE.BETA_GAMMA">
<pop-over-with-icon placement="bottomLeft" style="width: 159px" v-model="spectraVisible">
2023-06-28 19:25:11 +08:00
Spectra
<spectra slot="content" v-model="spectraType" @input="spectraVisible = false" />
2023-06-28 19:25:11 +08:00
</pop-over-with-icon>
</template>
<!-- beta-gamma 独有的二级交互栏结束 -->
</div>
<!-- 二级交互栏结束 -->
<!-- 频谱分析部分 -->
<div class="spectrum-analysis-main">
<gamma-analysis v-if="analysisType == ANALYZE_TYPE.GAMMA" ref="gammaAnalysisRef" />
<beta-gamma-analysis v-if="analysisType == ANALYZE_TYPE.BETA_GAMMA" ref="betaGammaAnalysisRef" />
<resize-observer @notify="handleResize" />
</div>
<!-- 频谱分析部分结束 -->
</div>
</template>
<script>
import ButtonWithSwitchIcon from './components/sub-operators/ButtonWithSwitchIcon.vue'
import DetailedInfomation from './components/sub-operators/DetailedInfomation.vue'
import GraphAssistance from './components/sub-operators/GraphAssistance.vue'
import NuclearLibrary from './components/sub-operators/NuclearLibrary.vue'
import PopOverWithIcon from './components/sub-operators/PopOverWithIcon.vue'
import QcFlags from './components/sub-operators/QcFlags.vue'
import GammaAnalysis from './gamma-analysis.vue'
import BetaGammaAnalysis from './beta-gamma-analysis.vue'
import Spectra from './components/sub-operators/Spectra.vue'
import SpectraListInMenu from './components/SpectraListInMenu.vue'
2023-06-28 19:25:11 +08:00
// 分析类型
const ANALYZE_TYPE = {
GAMMA: 'gammaAnalysis',
BETA_GAMMA: 'betaGammaAnalysis'
}
export default {
components: {
PopOverWithIcon,
ButtonWithSwitchIcon,
BetaGammaAnalysis,
GammaAnalysis,
QcFlags,
GraphAssistance,
DetailedInfomation,
NuclearLibrary,
Spectra,
SpectraListInMenu
2023-06-28 19:25:11 +08:00
},
data() {
this.ANALYZE_TYPE = ANALYZE_TYPE
return {
analysisType: ANALYZE_TYPE.BETA_GAMMA, // 分析类型
spectraType: 'Sample Data',
spectraVisible: false,
spectraList: [
{ id: 1, name: 'AUX01 003-20151223 1855 S FULL 40183.7.PHD' },
{ id: 2, name: 'AUX02 003-20151223 1855 S FULL 40183.7.PHD' }
]
2023-06-28 19:25:11 +08:00
}
},
methods: {
// 从数据库加载
2023-06-28 19:25:11 +08:00
handleLoadFromDb() {
console.log('%c [ handleLoadFromDb ]-46', 'font-size:13px; background:pink; color:#bf2c9f;')
},
// 从文件加载
2023-06-28 19:25:11 +08:00
handleLoadFromFile() {
console.log('%c [ handleLoadFromFile ]-46', 'font-size:13px; background:pink; color:#bf2c9f;')
},
// 清理全部
handleCleanAll() {
console.log('%c [ handleCleanAll ]-118', 'font-size:13px; background:pink; color:#bf2c9f;')
},
2023-06-28 19:25:11 +08:00
// peak info 点击左右方向
handlePeakInfoChange(direction) {
this.$refs.gammaAnalysisRef.moveMarkLine(direction)
},
handleResize() {
this.$refs.gammaAnalysisRef && this.$refs.gammaAnalysisRef.resize()
this.$refs.betaGammaAnalysisRef && this.$refs.betaGammaAnalysisRef.resize()
}
},
computed: {
operations() {
return [
{
title: 'SAMPLE',
children: [
{
type: 'a-menu',
children: [
{
type: 'a-menu-item',
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
type: 'a-menu-item',
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
type: 'a-menu-item',
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
},
{
type: 'a-divider',
attrs: {
style: {
marginTop: '5px',
marginBottom: '5px',
display: this.spectraList.length ? '' : 'none'
}
}
},
{
type: 'SpectraListInMenu',
attrs: {
list: this.spectraList
},
on: {
change: event => {
console.log('%c [ event ]-187', 'font-size:13px; background:pink; color:#bf2c9f;', event)
console.log('%c [ ]-188', 'font-size:13px; background:pink; color:#bf2c9f;', this)
}
}
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'SAVE',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'ANALYZE',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'CALIBRATION',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'NUCLIDELIBRARY',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'COMMENTS',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'REPORTS',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'LOG',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
},
{
title: 'HELP',
children: [
{
type: 'a-menu',
children: [
{
title: 'Load From DB',
handler: this.handleLoadFromDb
},
{
title: 'Load From File',
handler: this.handleLoadFromFile
},
{
title: 'Clean All',
handler: this.handleCleanAll
}
]
2023-06-28 19:25:11 +08:00
}
]
}
]
}
}
}
</script>
<style lang="less" scoped>
.spectrum-analysis {
padding-top: 17px;
height: 100%;
display: flex;
flex-direction: column;
// 顶部操作栏开始
&-operators {
flex-shrink: 0;
display: flex;
justify-content: space-between;
flex-wrap: nowrap;
overflow: auto;
&-item {
width: 158px;
border: 1px solid rgba(12, 235, 201, 0.6);
border-top-width: 3px;
height: 30px;
background-color: rgba(51, 202, 217, 0.2);
color: #ccede8;
&:not(:last-child) {
margin-right: 15px;
}
::v-deep {
span {
text-shadow: none;
line-height: 26px;
letter-spacing: 2px;
}
}
&:nth-child(4) {
width: 224px;
}
&:nth-child(5) {
width: 268px;
}
&:nth-child(6) {
width: 257px;
}
&:nth-child(7) {
width: 234px;
}
&:nth-child(8) {
width: 125px;
}
}
}
// 顶部操作栏结束
// 二级操作栏开始
&-sub-operators {
flex-shrink: 0;
margin-top: 15px;
display: flex;
flex-wrap: nowrap;
overflow: auto;
.pop-over-with-icon {
height: 32px;
&:not(:last-child) {
margin-right: 11px;
}
&:nth-child(1) {
width: 256px;
}
&:nth-child(2) {
width: 186px;
}
&:nth-child(3) {
width: 246px;
}
&:nth-child(4) {
width: 246px;
}
}
.peak-info {
width: 306px;
height: 32px;
display: inline-block;
}
}
// 二级操作栏结束
// 主体部分开始
&-main {
flex: 1;
margin-top: 19px;
height: calc(100% - 100px);
}
// 主体部分结束
}
</style>
<style lang="less">
.spectrum-analysis-operators-dropdown-overlay {
background-color: #03353f;
.ant-menu {
background: transparent;
padding: 0;
position: relative;
border-right: 0;
&-item {
color: #fff;
font-family: Arial;
border: 0;
background-color: transparent !important;
padding: 4px 14px;
height: 30px;
line-height: 22px;
&:hover {
background-color: #055565 !important;
}
&-selected {
font-weight: normal;
}
&-disabled {
color: #476d74 !important;
&:hover {
background-color: transparent !important;
}
}
}
}
}
</style>