Merge branch 'feature-spectrum-analysis' into feature-analysis-RLR-renpy
# Conflicts: # src/views/spectrumAnalysis/gamma-analysis.vue
This commit is contained in:
commit
76c46d54cc
33
src/utils/file.js
Normal file
33
src/utils/file.js
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import { Modal } from 'ant-design-vue'
|
||||||
|
import { saveAs } from 'file-saver'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弹窗填入文件名保存文件
|
||||||
|
* @param {Blob} data 数据
|
||||||
|
* @param {string} ext 扩展名,不带.
|
||||||
|
*/
|
||||||
|
export const showSaveFileModal = (data, ext) => {
|
||||||
|
let fileName = ''
|
||||||
|
const handleClick = event => {
|
||||||
|
fileName = event.target.value
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.confirm({
|
||||||
|
title: 'Please enter file name',
|
||||||
|
content: h => <a-input onChange={handleClick} />,
|
||||||
|
okText: 'Cancle',
|
||||||
|
cancelText: 'Save',
|
||||||
|
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
|
||||||
|
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
|
||||||
|
onOk() {
|
||||||
|
console.log('Cancel')
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
if (fileName) {
|
||||||
|
saveAs(data, `${fileName}.${ext}`)
|
||||||
|
} else {
|
||||||
|
throw new Error()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
|
@ -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 = {
|
||||||
|
|
|
@ -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 => {
|
||||||
|
|
|
@ -41,7 +41,11 @@ export default {
|
||||||
const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '/gamma/viewAutomaticAnalysisLog', { // 自动分析日志接口暂用都是gammam,beta暂时没有
|
const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '/gamma/viewAutomaticAnalysisLog', { // 自动分析日志接口暂用都是gammam,beta暂时没有
|
||||||
sampleId
|
sampleId
|
||||||
})
|
})
|
||||||
this.content = ""
|
if(typeof res == 'string') {
|
||||||
|
this.content = res
|
||||||
|
} else if(typeof res == 'object') {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
|
|
||||||
<div class="config-user-library-btns">
|
<div class="config-user-library-btns">
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary">Default</a-button>
|
<a-button type="primary" @click="handleDefault">Default</a-button>
|
||||||
<a-button type="primary">Load</a-button>
|
<a-button type="primary">Load</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary">Save</a-button>
|
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||||
<a-button type="primary">Apply</a-button>
|
<a-button type="primary">Apply</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,14 +33,17 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalMixin from '@/mixins/ModalMixin'
|
import ModalMixin from '@/mixins/ModalMixin'
|
||||||
import { getAction } from '@/api/manage'
|
import { getAction, postAction } from '@/api/manage'
|
||||||
import SampleDataMixin from '../../SampleDataMixin'
|
import SampleDataMixin from '../../SampleDataMixin'
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [ModalMixin, SampleDataMixin],
|
mixins: [ModalMixin, SampleDataMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
targetKeys: []
|
targetKeys: [],
|
||||||
|
isSaving: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -66,6 +69,8 @@ export default {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.targetKeys = UserNuclides.map(item => item)
|
this.targetKeys = UserNuclides.map(item => item)
|
||||||
|
|
||||||
|
this.initialTargetKeys = cloneDeep(this.targetKeys)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -76,6 +81,32 @@ export default {
|
||||||
|
|
||||||
beforeModalOpen() {
|
beforeModalOpen() {
|
||||||
this.getInfo()
|
this.getInfo()
|
||||||
|
},
|
||||||
|
|
||||||
|
// 默认
|
||||||
|
handleDefault() {
|
||||||
|
this.targetKeys = cloneDeep(this.initialTargetKeys)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
async handleSave() {
|
||||||
|
try {
|
||||||
|
this.isSaving = true
|
||||||
|
const { inputFileName: fileName } = this.sampleData
|
||||||
|
const { success, result, message } = await postAction('/gamma/saveUserLibrary', {
|
||||||
|
fileName,
|
||||||
|
userLibraryName: this.targetKeys
|
||||||
|
})
|
||||||
|
if (success) {
|
||||||
|
this.$message.success('Save Success')
|
||||||
|
} else {
|
||||||
|
this.$message.error(message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<div class="operators">
|
<div class="operators">
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary">Call</a-button>
|
<a-button type="primary">Call</a-button>
|
||||||
<a-button type="primary">Save</a-button>
|
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a-select v-model="funcId" @change="recalculate">
|
<a-select v-model="funcId" @change="recalculate">
|
||||||
|
@ -111,6 +111,7 @@ import { getAction, postAction } from '@/api/manage'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { buildLineSeries } from '@/utils/chartHelper'
|
import { buildLineSeries } from '@/utils/chartHelper'
|
||||||
import SampleDataMixin from '../../SampleDataMixin'
|
import SampleDataMixin from '../../SampleDataMixin'
|
||||||
|
import { showSaveFileModal } from '@/utils/file'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -240,6 +241,8 @@ export default {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
isSaving: false,
|
||||||
|
|
||||||
equation: '',
|
equation: '',
|
||||||
dataSourceList: [],
|
dataSourceList: [],
|
||||||
list: [],
|
list: [],
|
||||||
|
@ -264,11 +267,11 @@ export default {
|
||||||
const { success, result, message } = await getAction('/gamma/EfficiencyCalibration', {
|
const { success, result, message } = await getAction('/gamma/EfficiencyCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
fileName,
|
fileName,
|
||||||
currentText
|
currentText,
|
||||||
|
width: 922
|
||||||
})
|
})
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
if (success) {
|
if (success) {
|
||||||
console.log('%c [ ]-220', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
|
||||||
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
|
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
|
||||||
this.dataSourceList = list_dataSource
|
this.dataSourceList = list_dataSource
|
||||||
if (!currentText) {
|
if (!currentText) {
|
||||||
|
@ -450,7 +453,8 @@ export default {
|
||||||
m_vCurEffi: this.list.map(item => item.efficiency),
|
m_vCurEffi: this.list.map(item => item.efficiency),
|
||||||
m_vCurUncert: this.uncert,
|
m_vCurUncert: this.uncert,
|
||||||
m_curParam: this.param,
|
m_curParam: this.param,
|
||||||
funcId: this.funcId
|
funcId: this.funcId,
|
||||||
|
width: 922
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.handleResult(result)
|
this.handleResult(result)
|
||||||
|
@ -464,6 +468,29 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
async handleSave() {
|
||||||
|
try {
|
||||||
|
this.isSaving = true
|
||||||
|
const res = await postAction('/gamma/saveDataEfficiency', {
|
||||||
|
m_vCurEnergy: this.list.map(item => item.energy),
|
||||||
|
m_vCurEffi: this.list.map(item => item.efficiency),
|
||||||
|
m_vCurUncert: this.uncert,
|
||||||
|
funcId: this.funcId
|
||||||
|
})
|
||||||
|
if (typeof res == 'string') {
|
||||||
|
const blob = new Blob([res], { type: 'text/plain' })
|
||||||
|
showSaveFileModal(blob, 'ent')
|
||||||
|
} else if (typeof res == 'object') {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 应用
|
// 应用
|
||||||
async handleApply() {
|
async handleApply() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<div class="operators">
|
<div class="operators">
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary">Call</a-button>
|
<a-button type="primary">Call</a-button>
|
||||||
<a-button type="primary">Save</a-button>
|
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary" @click="handleApply">Apply</a-button>
|
<a-button type="primary" @click="handleApply">Apply</a-button>
|
||||||
|
@ -106,6 +106,7 @@ import { getAction, postAction } from '@/api/manage'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { buildLineSeries } from '@/utils/chartHelper'
|
import { buildLineSeries } from '@/utils/chartHelper'
|
||||||
import SampleDataMixin from '../../SampleDataMixin'
|
import SampleDataMixin from '../../SampleDataMixin'
|
||||||
|
import { showSaveFileModal } from '@/utils/file'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -202,6 +203,8 @@ export default {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
isSaving: false,
|
||||||
|
|
||||||
equation: '',
|
equation: '',
|
||||||
dataSourceList: [],
|
dataSourceList: [],
|
||||||
list: [],
|
list: [],
|
||||||
|
@ -226,7 +229,8 @@ export default {
|
||||||
const { success, result, message } = await getAction('/gamma/energyCalibration', {
|
const { success, result, message } = await getAction('/gamma/energyCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
fileName,
|
fileName,
|
||||||
currentText
|
currentText,
|
||||||
|
width: 922
|
||||||
})
|
})
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
if (success) {
|
if (success) {
|
||||||
|
@ -409,7 +413,8 @@ export default {
|
||||||
m_vCurCentroid: this.list.map(item => item.channel),
|
m_vCurCentroid: this.list.map(item => item.channel),
|
||||||
m_vCurEnergy: this.list.map(item => item.energy),
|
m_vCurEnergy: this.list.map(item => item.energy),
|
||||||
m_vCurUncert: this.uncert,
|
m_vCurUncert: this.uncert,
|
||||||
m_curParam: this.param
|
m_curParam: this.param,
|
||||||
|
width: 922
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.handleResult(result)
|
this.handleResult(result)
|
||||||
|
@ -423,6 +428,28 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
async handleSave() {
|
||||||
|
try {
|
||||||
|
this.isSaving = true
|
||||||
|
const res = await postAction('/gamma/saveDataEnergy', {
|
||||||
|
m_vCurCentroid: this.list.map(item => item.channel),
|
||||||
|
m_vCurEnergy: this.list.map(item => item.energy),
|
||||||
|
m_vCurUncert: this.uncert
|
||||||
|
})
|
||||||
|
if (typeof res == 'string') {
|
||||||
|
const blob = new Blob([res], { type: 'text/plain' })
|
||||||
|
showSaveFileModal(blob, 'ent')
|
||||||
|
} else if (typeof res == 'object') {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 应用
|
// 应用
|
||||||
async handleApply() {
|
async handleApply() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<div class="operators">
|
<div class="operators">
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary">Call</a-button>
|
<a-button type="primary">Call</a-button>
|
||||||
<a-button type="primary">Save</a-button>
|
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary" @click="handleApply">Apply</a-button>
|
<a-button type="primary" @click="handleApply">Apply</a-button>
|
||||||
|
@ -106,6 +106,7 @@ import { getAction, postAction } from '@/api/manage'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
import { buildLineSeries } from '@/utils/chartHelper'
|
import { buildLineSeries } from '@/utils/chartHelper'
|
||||||
import SampleDataMixin from '../../SampleDataMixin'
|
import SampleDataMixin from '../../SampleDataMixin'
|
||||||
|
import { showSaveFileModal } from '@/utils/file'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -202,6 +203,8 @@ export default {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
return {
|
return {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
isSaving: false,
|
||||||
|
|
||||||
equation: '',
|
equation: '',
|
||||||
dataSourceList: [],
|
dataSourceList: [],
|
||||||
list: [],
|
list: [],
|
||||||
|
@ -225,11 +228,11 @@ export default {
|
||||||
const { success, result, message } = await getAction('/gamma/resolutionCalibration', {
|
const { success, result, message } = await getAction('/gamma/resolutionCalibration', {
|
||||||
sampleId,
|
sampleId,
|
||||||
fileName,
|
fileName,
|
||||||
currentText
|
currentText,
|
||||||
|
width: 922
|
||||||
})
|
})
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
if (success) {
|
if (success) {
|
||||||
console.log('%c [ ]-220', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
|
||||||
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
|
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
|
||||||
this.dataSourceList = list_dataSource
|
this.dataSourceList = list_dataSource
|
||||||
if (!currentText) {
|
if (!currentText) {
|
||||||
|
@ -423,6 +426,28 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
async handleSave() {
|
||||||
|
try {
|
||||||
|
this.isSaving = true
|
||||||
|
const res = await postAction('/gamma/saveDataResolution', {
|
||||||
|
m_vCurEnergy: this.list.map(item => item.energy),
|
||||||
|
m_vCurReso: this.list.map(item => item.fwhm),
|
||||||
|
m_vCurUncert: this.uncert
|
||||||
|
})
|
||||||
|
if (typeof res == 'string') {
|
||||||
|
const blob = new Blob([res], { type: 'text/plain' })
|
||||||
|
showSaveFileModal(blob, 'ent')
|
||||||
|
} else if (typeof res == 'object') {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isSaving = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 应用
|
// 应用
|
||||||
async handleApply() {
|
async handleApply() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -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>
|
|
@ -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>
|
|
||||||
|
|
|
@ -20,10 +20,21 @@
|
||||||
@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 +80,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 +96,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 +265,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 +282,7 @@ export default {
|
||||||
detailedInfomation: [],
|
detailedInfomation: [],
|
||||||
qcFlags: [],
|
qcFlags: [],
|
||||||
graphAssistance: cloneDeep(graphAssistance),
|
graphAssistance: cloneDeep(graphAssistance),
|
||||||
|
nuclideLibraryVisible: false,
|
||||||
|
|
||||||
channelPeakGroup: [],
|
channelPeakGroup: [],
|
||||||
energyPeakGroup: [],
|
energyPeakGroup: [],
|
||||||
|
@ -273,6 +295,12 @@ export default {
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
nuclideReview: {
|
||||||
|
visible: false,
|
||||||
|
nuclide: '',
|
||||||
|
},
|
||||||
|
currChannel: -1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -609,10 +637,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
|
||||||
}
|
}
|
||||||
|
@ -643,6 +671,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)
|
||||||
|
@ -722,8 +754,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', {
|
||||||
|
@ -732,8 +766,8 @@ export default {
|
||||||
fileName,
|
fileName,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
const { identify } = result
|
const { possible } = result
|
||||||
this.nuclideLibraryList = identify
|
this.nuclideLibraryList = possible
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(message)
|
this.$message.error(message)
|
||||||
}
|
}
|
||||||
|
@ -741,10 +775,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()
|
||||||
|
@ -821,19 +862,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') {
|
||||||
// 找到第一个比prevAxis大的xAxis
|
// 找到第一个比prevAxis大的xAxis
|
||||||
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') {
|
||||||
// 找到第一个比prevAxis小的xAxis
|
// 找到第一个比prevAxis小的xAxis
|
||||||
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)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 鼠标按下时开启可刷选状态
|
// 鼠标按下时开启可刷选状态
|
||||||
|
|
|
@ -1183,6 +1183,43 @@ export default {
|
||||||
// 主体部分结束
|
// 主体部分结束
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
::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 lang="less">
|
<style lang="less">
|
||||||
.spectrum-analysis-operators-dropdown-overlay {
|
.spectrum-analysis-operators-dropdown-overlay {
|
||||||
background-color: #03353f;
|
background-color: #03353f;
|
||||||
|
@ -1265,4 +1302,11 @@ export default {
|
||||||
color: yellow;
|
color: yellow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popover-with-icon {
|
||||||
|
z-index: 999;
|
||||||
|
.ant-popover-inner-content {
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user