feat: 添加所有菜单和事件,增加Load From File 弹窗及其逻辑
This commit is contained in:
parent
005a057f47
commit
e1a2e89c2b
30
src/views/spectrumAnalysis/components/LoadFromDBModal.vue
Normal file
30
src/views/spectrumAnalysis/components/LoadFromDBModal.vue
Normal file
|
@ -0,0 +1,30 @@
|
|||
<template>
|
||||
<a-modal v-model="visible" title="Load From Database" class="load-from-db-modal">
|
||||
从数据库加载
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visible: {
|
||||
get() {
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.load-from-db-modal {
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,76 @@
|
|||
<template>
|
||||
<a-modal v-model="visible" title="Select File" :footer="null">
|
||||
<a-table :data-source="list" :columns="columns" :loading="loading" :pagination="false">
|
||||
<template slot="operator" slot-scope="record">
|
||||
<a-icon type="check" style="cursor: pointer;" @click="handleSelect(record)"></a-icon>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const columns = [
|
||||
{
|
||||
title: 'File Name',
|
||||
dataIndex: 'fileName',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: 'Action',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
scopedSlots: {
|
||||
customRender: 'operator'
|
||||
}
|
||||
}
|
||||
]
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
loading: false,
|
||||
list: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true
|
||||
const res = await ''
|
||||
console.log('%c [ res ]-13', 'font-size:13px; background:pink; color:#bf2c9f;', res)
|
||||
this.loading = false
|
||||
this.list = [{ fileName: '文件1' }, { fileName: '文件2' }]
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 选中
|
||||
handleSelect(fileInfo) {
|
||||
console.log('%c [ ]-56', 'font-size:13px; background:pink; color:#bf2c9f;', fileInfo)
|
||||
this.$emit('select', fileInfo)
|
||||
this.visible = false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
visible: {
|
||||
get() {
|
||||
if (this.value) {
|
||||
this.getList()
|
||||
}
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
|
@ -0,0 +1,156 @@
|
|||
<template>
|
||||
<a-modal v-model="visible" :width="1400" title="Load Data From File">
|
||||
<a-table :data-source="list" :columns="columns" :pagination="false">
|
||||
<template slot="status" slot-scope="text">
|
||||
<span class="status"></span>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<template slot="footer">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handleReset">Reset</a-button>
|
||||
<a-button type="primary" @click="handleLoad">Load</a-button>
|
||||
<a-button type="primary" @click="handleCancel">Cancel</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<!-- 底部按钮结束 -->
|
||||
|
||||
<ftp-file-modal v-model="ftpFileModalVisible" @select="handleSelect" />
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import FtpFileModal from './FtpFileModal.vue'
|
||||
export default {
|
||||
components: { FtpFileModal },
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.getInitialList(),
|
||||
ftpFileModalVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getInitialList() {
|
||||
return new Array(10).fill(0).map(() => ({
|
||||
sampleData: '',
|
||||
gasBkData: '',
|
||||
detBkData: '',
|
||||
qcData: ''
|
||||
}))
|
||||
},
|
||||
|
||||
/**
|
||||
* 从ftp中选择文件
|
||||
* @param rowData 选中的行的数据
|
||||
* @param { string } dataKey 选中的数据的那一列的key
|
||||
*/
|
||||
selectFileFromFtp(rowData, dataKey) {
|
||||
this.currRowData = rowData
|
||||
this.currDataKey = dataKey
|
||||
this.ftpFileModalVisible = true
|
||||
},
|
||||
|
||||
handleSelect(fileInfo) {
|
||||
this.currRowData[this.currDataKey] = fileInfo.fileName
|
||||
},
|
||||
|
||||
handleReset() {
|
||||
this.list = this.getInitialList()
|
||||
},
|
||||
|
||||
handleLoad() {},
|
||||
|
||||
handleCancel() {}
|
||||
},
|
||||
computed: {
|
||||
visible: {
|
||||
get() {
|
||||
return this.value
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val)
|
||||
}
|
||||
},
|
||||
columns() {
|
||||
return [
|
||||
{
|
||||
title: 'SampleData',
|
||||
dataIndex: 'sampleData',
|
||||
customCell: record => {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
this.selectFileFromFtp(record, 'sampleData')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'GasBkData',
|
||||
dataIndex: 'gasBkData',
|
||||
customCell: record => {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
this.selectFileFromFtp(record, 'gasBkData')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'DetBkData',
|
||||
dataIndex: 'detBkData',
|
||||
customCell: record => {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
this.selectFileFromFtp(record, 'detBkData')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'QCData',
|
||||
dataIndex: 'qcData',
|
||||
customCell: record => {
|
||||
return {
|
||||
on: {
|
||||
click: () => {
|
||||
this.selectFileFromFtp(record, 'qcData')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Status',
|
||||
align: 'center',
|
||||
scopedSlots: {
|
||||
customRender: 'status'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.status {
|
||||
display: inline-block;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
border-radius: 50%;
|
||||
|
||||
background-color: #00e170;
|
||||
}
|
||||
</style>
|
|
@ -24,7 +24,7 @@
|
|||
<!-- 顶部操作栏结束 -->
|
||||
|
||||
<!-- 二级交互栏 -->
|
||||
<div class="spectrum-analysis-sub-operators">
|
||||
<div class="spectrum-analysis-SubOperators">
|
||||
<pop-over-with-icon placement="bottomLeft">
|
||||
Detailed-Information
|
||||
<detailed-infomation slot="content" />
|
||||
|
@ -70,19 +70,29 @@
|
|||
<resize-observer @notify="handleResize" />
|
||||
</div>
|
||||
<!-- 频谱分析部分结束 -->
|
||||
|
||||
<!-- 从数据库加载开始 -->
|
||||
<load-from-db-modal v-model="loadFromDbModalVisible" />
|
||||
<!-- 从数据库加载结束 -->
|
||||
|
||||
<!-- 从文件加载开始 -->
|
||||
<load-from-file-modal v-model="loadFromFileModalVisible" />
|
||||
<!-- 从文件加载结束 -->
|
||||
</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 ButtonWithSwitchIcon from './components/SubOperators/ButtonWithSwitchIcon.vue'
|
||||
import DetailedInfomation from './components/SubOperators/DetailedInfomation.vue'
|
||||
import GraphAssistance from './components/SubOperators/GraphAssistance.vue'
|
||||
import NuclearLibrary from './components/SubOperators/NuclearLibrary.vue'
|
||||
import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
|
||||
import QcFlags from './components/SubOperators/QcFlags.vue'
|
||||
import GammaAnalysis from './gamma-analysis.vue'
|
||||
import BetaGammaAnalysis from './beta-gamma-analysis.vue'
|
||||
import Spectra from './components/sub-operators/Spectra.vue'
|
||||
import Spectra from './components/SubOperators/Spectra.vue'
|
||||
import SpectraListInMenu from './components/SpectraListInMenu.vue'
|
||||
import LoadFromDbModal from './components/LoadFromDBModal.vue'
|
||||
import LoadFromFileModal from './components/LoadFromFileModal/Index.vue'
|
||||
|
||||
// 分析类型
|
||||
const ANALYZE_TYPE = {
|
||||
|
@ -100,7 +110,9 @@ export default {
|
|||
DetailedInfomation,
|
||||
NuclearLibrary,
|
||||
Spectra,
|
||||
SpectraListInMenu
|
||||
SpectraListInMenu,
|
||||
LoadFromDbModal,
|
||||
LoadFromFileModal
|
||||
},
|
||||
data() {
|
||||
this.ANALYZE_TYPE = ANALYZE_TYPE
|
||||
|
@ -113,23 +125,120 @@ export default {
|
|||
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' }
|
||||
]
|
||||
],
|
||||
|
||||
loadFromDbModalVisible: false,
|
||||
loadFromFileModalVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 从数据库加载
|
||||
handleLoadFromDb() {
|
||||
console.log('%c [ handleLoadFromDb ]-46', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
this.loadFromDbModalVisible = true
|
||||
},
|
||||
|
||||
// 从文件加载
|
||||
handleLoadFromFile() {
|
||||
console.log('%c [ handleLoadFromFile ]-46', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
this.loadFromFileModalVisible = true
|
||||
},
|
||||
|
||||
// 清理全部
|
||||
handleCleanAll() {
|
||||
console.log('%c [ handleCleanAll ]-118', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
this.spectraList = []
|
||||
},
|
||||
|
||||
// 保存结果到文件
|
||||
saveResultsToFile() {
|
||||
console.log('%c [ saveResultsToFile ]-152', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 保存结果到数据库
|
||||
saveResultsToDB() {
|
||||
console.log('%c [ saveResultsToDB ]-157', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 将谱列表中所有谱数据均以IMS2.0格式保存为PHD文件
|
||||
savePHDToFile() {
|
||||
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 执行β-γ符合谱分析流程,对当前谱数据进行再分析
|
||||
handleAnalyzeCurrSample() {
|
||||
console.log('%c [ handleAnalyzeCurrSample ]-152', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 对谱列表中所有谱数据进行再分析
|
||||
handleAnalyzeAllSample() {
|
||||
console.log('%c [ handleAnalyzeAllSample ]-156', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 弹出能量刻度界面
|
||||
handleEnergy() {
|
||||
console.log('%c [ handleEnergy ]-163', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 弹出分辨率刻度界面
|
||||
handleResolution() {
|
||||
console.log('%c [ handleResolution ]-167', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 弹出分辨率刻度界面
|
||||
handleEfficiency() {
|
||||
console.log('%c [ handleEfficiency ]-167', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 弹出 Nuclide Library 弹窗
|
||||
handleNuclideLib() {
|
||||
console.log('%c [ handleNuclideLib ]-178', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
handleConfigUserLib() {
|
||||
console.log('%c [ handleConfigUserLib ]-182', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 查看自动处理报告
|
||||
handleViewARR() {
|
||||
console.log('%c [ handleViewARR ]-186', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 查看交互分析报告
|
||||
handleViewRRR() {
|
||||
console.log('%c [ handleViewRRR ]-192', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 显示接收到的原始谱文件
|
||||
handleViewSpectrum() {
|
||||
console.log('%c [ handleViewSpectrum ]-198', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 可浏览原始谱中台站操作员对样品采集和测量过程的注释信息;可以浏览分析人员对分析过程的注释信息
|
||||
handleViewComments() {
|
||||
console.log('%c [ viewComments ]-162', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 可添加能谱分析注释
|
||||
handleAddComments() {
|
||||
console.log('%c [ handleAddComments ]-167', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 查看自动处理日志
|
||||
handleAutoAnalysisLog() {
|
||||
console.log('%c [ handleAutoAnalysisLog ]-211', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 查看交互分析日志
|
||||
handleGammaViewerLog() {
|
||||
console.log('%c [ handleGammaViewerLog ]-211', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 查看软件操作帮助文档
|
||||
handleHelp() {
|
||||
console.log('%c [ handleHelp ]-221', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 设置软件中主界面和交互分析界面中各曲线的颜色
|
||||
handleLineColorConfig() {
|
||||
console.log('%c [ handleLineColorConfig ]-225', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// peak info 点击左右方向
|
||||
|
@ -199,16 +308,19 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'Save Results to File',
|
||||
handler: this.saveResultsToFile
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
type: 'a-menu-item',
|
||||
title: 'Save Results to DB',
|
||||
handler: this.saveResultsToDB
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'Save PHD to File',
|
||||
handler: this.savePHDToFile
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -221,16 +333,14 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'Analyze Current Sample',
|
||||
handler: this.handleAnalyzeCurrSample
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'Analyze All Sample',
|
||||
handler: this.handleAnalyzeAllSample
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -243,16 +353,19 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'Energy',
|
||||
handler: this.handleEnergy
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
type: 'a-menu-item',
|
||||
title: 'Resolution',
|
||||
handler: this.handleResolution
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'Efficiency',
|
||||
handler: this.handleEfficiency
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -265,16 +378,14 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'Nuclide Library',
|
||||
handler: this.handleNuclideLib
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'Config User Library',
|
||||
handler: this.handleConfigUserLib
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -287,16 +398,14 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'View Comments',
|
||||
handler: this.handleViewComments
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'Add Comments',
|
||||
handler: this.handleAddComments
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -309,16 +418,19 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'View ARR',
|
||||
handler: this.handleViewARR
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
type: 'a-menu-item',
|
||||
title: 'View RRR',
|
||||
handler: this.handleViewRRR
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'View Spectrum',
|
||||
handler: this.handleViewSpectrum
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -331,16 +443,14 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'Automatic Analysis Log',
|
||||
handler: this.handleAutoAnalysisLog
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'GammaViewer Log',
|
||||
handler: this.handleGammaViewerLog
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -353,16 +463,14 @@ export default {
|
|||
type: 'a-menu',
|
||||
children: [
|
||||
{
|
||||
title: 'Load From DB',
|
||||
handler: this.handleLoadFromDb
|
||||
type: 'a-menu-item',
|
||||
title: 'Help',
|
||||
handler: this.handleHelp
|
||||
},
|
||||
{
|
||||
title: 'Load From File',
|
||||
handler: this.handleLoadFromFile
|
||||
},
|
||||
{
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll
|
||||
type: 'a-menu-item',
|
||||
title: 'Line Color Config',
|
||||
handler: this.handleLineColorConfig
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -428,7 +536,7 @@ export default {
|
|||
// 顶部操作栏结束
|
||||
|
||||
// 二级操作栏开始
|
||||
&-sub-operators {
|
||||
&-SubOperators {
|
||||
flex-shrink: 0;
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in New Issue
Block a user