完成 查看Calibration菜单下energy 、Resolution 、 Efficiency 弹窗及接口
This commit is contained in:
parent
e73f9df914
commit
c555bdcb3d
|
@ -0,0 +1,755 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null" destroy-on-close>
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="energy-calibration">
|
||||
<div class="left">
|
||||
<!-- Calibration Data -->
|
||||
<title-over-border title="Calibration Data">
|
||||
<div class="calibration-data">
|
||||
<a-form-model
|
||||
:colon="false"
|
||||
:labelCol="{
|
||||
style: {
|
||||
width: '70px',
|
||||
textAlign: 'left',
|
||||
flexShrink: 0,
|
||||
},
|
||||
}"
|
||||
:wrapperCol="{
|
||||
style: {
|
||||
flex: 1,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<a-form-model-item label="Energy">
|
||||
<a-input type="number" v-model="model.energy" @change="handleEnergyChange"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Efficiency">
|
||||
<a-input type="number" v-model="model.efficiency" @change="handleChannelChange"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleInsert">Insert</a-button>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleModify">Modify</a-button>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleDelete">Delete</a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<!-- 表格 -->
|
||||
<custom-table
|
||||
:columns="columns"
|
||||
:list="list"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 193 }"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:canDeselect="false"
|
||||
@rowClick="handleRowClick"
|
||||
></custom-table>
|
||||
<!-- 表格结束 -->
|
||||
<div class="operators">
|
||||
<div>
|
||||
<label>
|
||||
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
|
||||
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
|
||||
</label>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||
</div>
|
||||
<div>
|
||||
<a-select v-model="funcId" @change="recalculate">
|
||||
<a-select-option v-for="(func, index) in functions" :key="index" :value="func.value">
|
||||
{{ func.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-button type="primary" @click="handleApply">Apply</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</title-over-border>
|
||||
<!-- Equation -->
|
||||
<title-over-border class="mt-20" title="Equation">
|
||||
<div class="equation" v-html="equation"></div>
|
||||
</title-over-border>
|
||||
<!-- curve -->
|
||||
<title-over-border class="mt-20" title="curve">
|
||||
<div class="curve">
|
||||
<custom-chart :option="option" :opts="opts" />
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
<div class="right">
|
||||
<title-over-border title="Data Source" style="height: 100%">
|
||||
<div class="data-source">
|
||||
<div class="content">
|
||||
<div
|
||||
class="item"
|
||||
:class="item == currSelectedDataSource ? 'active' : ''"
|
||||
v-for="(item, index) in dataSourceList"
|
||||
:key="index"
|
||||
@click="handleDataSourceClick(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer mt-20">
|
||||
<a-button type="primary" @click="handleSetToCurrent">Set to Current</a-button>
|
||||
<div class="mt-20">{{ appliedDataSource }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { getAction, postAction, putAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { showSaveFileModal } from '@/utils/file'
|
||||
|
||||
const format = (text) => {
|
||||
const num = parseFloat(text)
|
||||
return (!num ? '-' : '') + Number(text).toFixed(3)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Efficiency',
|
||||
dataIndex: 'efficiency',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
]
|
||||
|
||||
const initialOption = {
|
||||
grid: {
|
||||
top: 20,
|
||||
right: 20,
|
||||
bottom: 50,
|
||||
left: 70,
|
||||
},
|
||||
title: {
|
||||
text: 'Channel',
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
right: 10,
|
||||
bottom: 0,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: (params) => {
|
||||
const [x, y] = params[0].value
|
||||
const energy = parseInt(x)
|
||||
const efficiency = y.toFixed(3)
|
||||
return `<div class="channel">Energy: ${energy}</div>
|
||||
<div class="energy">Efficiency: ${efficiency}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
xAxis: {
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
name: 'keV',
|
||||
nameLocation: 'center',
|
||||
nameGap: 50,
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
series: [],
|
||||
}
|
||||
|
||||
const functions = [
|
||||
{
|
||||
label: 'Interpolation',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: 'HT Efficiency',
|
||||
value: 5,
|
||||
},
|
||||
{
|
||||
label: 'Log Polynomial',
|
||||
value: 6,
|
||||
},
|
||||
{
|
||||
label: 'Invlog Polynomial',
|
||||
value: 8,
|
||||
},
|
||||
{
|
||||
label: 'HAE Efficiency(1-3)',
|
||||
value: 93,
|
||||
},
|
||||
{
|
||||
label: 'HAE Efficiency(1-2)',
|
||||
value: 94,
|
||||
},
|
||||
{
|
||||
label: 'HAE Efficiency(1-2-3)',
|
||||
value: 95,
|
||||
},
|
||||
]
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder, CustomChart },
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
this.columns = columns
|
||||
this.functions = functions
|
||||
|
||||
return {
|
||||
isLoading: false,
|
||||
isCalling: false,
|
||||
isSaving: false,
|
||||
|
||||
equation: '',
|
||||
dataSourceList: [],
|
||||
list: [],
|
||||
option: cloneDeep(initialOption),
|
||||
selectedRowKeys: [],
|
||||
model: {},
|
||||
emptyModal: {},
|
||||
currSelectedDataSource: '',
|
||||
appliedDataSource: '',
|
||||
opts: {
|
||||
notMerge: true,
|
||||
},
|
||||
// ECutAnalysis_Low: -1,
|
||||
// G_energy_span: -1,
|
||||
funcId: 1,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData(currentText) {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/selfStation/EfficiencyCalibration', {
|
||||
sampleId,
|
||||
fileName,
|
||||
currentText,
|
||||
width: 922,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
const { list_dataSource, currentText: resultCurrentText } = result
|
||||
this.dataSourceList = list_dataSource
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
if (!currentText) {
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
this.appliedDataSource = resultCurrentText
|
||||
}
|
||||
|
||||
// this.ECutAnalysis_Low = ECutAnalysis_Low
|
||||
// this.G_energy_span = G_energy_span
|
||||
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
handleResult(result) {
|
||||
const { AllData, equation, param, table, uncert } = result
|
||||
// 有数据
|
||||
if (AllData) {
|
||||
const [linePoint, scatterPoint] = AllData
|
||||
this.equation = equation
|
||||
this.param = param
|
||||
this.uncert = uncert
|
||||
|
||||
this.list = table
|
||||
this.generateTableId()
|
||||
|
||||
const series = []
|
||||
series.push(
|
||||
buildLineSeries(
|
||||
'LineSeries',
|
||||
linePoint.pointlist.map(({ x, y }) => [x, y]),
|
||||
linePoint.color
|
||||
)
|
||||
)
|
||||
series.push({
|
||||
type: 'scatter',
|
||||
data: scatterPoint.pointlist.map(({ x, y }) => {
|
||||
return {
|
||||
value: [x, y],
|
||||
symbolSize: 5,
|
||||
itemStyle: {
|
||||
color: scatterPoint.color,
|
||||
borderWidth: 0,
|
||||
},
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true,
|
||||
},
|
||||
animation: false,
|
||||
zlevel: 20,
|
||||
})
|
||||
this.option.series = series
|
||||
}
|
||||
// 没数据
|
||||
else {
|
||||
this.option.series = []
|
||||
}
|
||||
},
|
||||
|
||||
beforeModalOpen() {
|
||||
this.model.energy = null
|
||||
this.model.efficiency = null
|
||||
this.selectedRowKeys = []
|
||||
this.funcId = 1
|
||||
this.getData('PHD')
|
||||
},
|
||||
|
||||
// 表格单行点击
|
||||
handleRowClick(row) {
|
||||
this.model = cloneDeep(row)
|
||||
this.model.efficiency = parseFloat(Number(this.model.efficiency).toPrecision(6))
|
||||
this.model.energy = parseFloat(Number(this.model.energy).toPrecision(6))
|
||||
this.emptyModal = cloneDeep(row)
|
||||
},
|
||||
|
||||
// 插入
|
||||
handleInsert() {
|
||||
const energy = parseFloat(this.model.energy)
|
||||
const efficiency = parseFloat(this.model.efficiency)
|
||||
|
||||
if (Number.isNaN(energy) || Number.isNaN(efficiency)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
// if (energy <= this.ECutAnalysis_Low || energy >= this.G_energy_span) {
|
||||
// this.$message.warn('Energy is out of analysis range.')
|
||||
// return
|
||||
// }
|
||||
|
||||
let i,
|
||||
num = this.list.length
|
||||
for (i = 0; i < num; ++i) {
|
||||
const currEnergy = this.list[i].energy
|
||||
if (Math.abs(currEnergy - energy) < 0.001) {
|
||||
this.$message.warn('The centroid has already existed!')
|
||||
return
|
||||
} else if (currEnergy > energy) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
this.list.splice(i, 0, {
|
||||
energy: energy,
|
||||
efficiency,
|
||||
})
|
||||
|
||||
this.uncert.splice(i, 0, 0.5)
|
||||
|
||||
this.selectedRowKeys = [i]
|
||||
this.generateTableId()
|
||||
|
||||
this.recalculate()
|
||||
},
|
||||
|
||||
// 生成table中数据的id,用以选中
|
||||
generateTableId() {
|
||||
this.list.forEach((item, index) => {
|
||||
item.id = index
|
||||
})
|
||||
},
|
||||
handleChannelChange(e) {
|
||||
if (e.target.value != parseFloat(Number(this.emptyModal.efficiency).toPrecision(6))) {
|
||||
this.emptyModal.efficiency = e.target.value
|
||||
}
|
||||
},
|
||||
handleEnergyChange(e) {
|
||||
console.log(e.target.value)
|
||||
if (e.target.value != parseFloat(Number(this.emptyModal.energy).toPrecision(6))) {
|
||||
this.emptyModal.energy = e.target.value
|
||||
}
|
||||
},
|
||||
|
||||
// 修改
|
||||
handleModify() {
|
||||
if (this.selectedRowKeys.length) {
|
||||
const energy = parseFloat(this.emptyModal.energy)
|
||||
const efficiency = parseFloat(this.emptyModal.efficiency)
|
||||
console.log(energy + '>>>>' + efficiency)
|
||||
|
||||
if (Number.isNaN(energy) || Number.isNaN(efficiency)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
// if (energy <= this.ECutAnalysis_Low || energy >= this.G_energy_span) {
|
||||
// this.$message.warn('Energy is out of analysis range.')
|
||||
// return
|
||||
// }
|
||||
|
||||
const [currSelectedIndex] = this.selectedRowKeys
|
||||
|
||||
this.list[currSelectedIndex].energy = energy
|
||||
this.list[currSelectedIndex].efficiency = efficiency
|
||||
|
||||
this.uncert[currSelectedIndex] = 0
|
||||
|
||||
this.recalculate()
|
||||
}
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete() {
|
||||
if (this.selectedRowKeys.length) {
|
||||
const [currSelectedIndex] = this.selectedRowKeys
|
||||
|
||||
this.list.splice(currSelectedIndex, 1)
|
||||
this.uncert.splice(currSelectedIndex, 1)
|
||||
this.generateTableId()
|
||||
if (this.list.length) {
|
||||
const selectedKey = this.selectedRowKeys[0]
|
||||
if (selectedKey > this.list.length - 1) {
|
||||
this.selectedRowKeys[0] = selectedKey - 1
|
||||
}
|
||||
} else {
|
||||
this.selectedRowKeys = []
|
||||
}
|
||||
this.recalculate()
|
||||
}
|
||||
},
|
||||
|
||||
// 重新计算
|
||||
async recalculate() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/changeDataEfficiency', {
|
||||
sampleId,
|
||||
fileName,
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurEffi: this.list.map((item) => item.efficiency),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
funcId: this.funcId,
|
||||
width: 922,
|
||||
curRow: this.selectedRowKeys[0] || 0,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 保存
|
||||
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
|
||||
}
|
||||
},
|
||||
|
||||
// 点击call按钮
|
||||
handleCall() {
|
||||
this.$refs.fileInput.click()
|
||||
},
|
||||
|
||||
async handleFileChange(event) {
|
||||
const { files } = event.target
|
||||
if (files.length) {
|
||||
const file = files[0]
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
formData.append('sampleFileName', fileName)
|
||||
formData.append('width', 922)
|
||||
formData.append('currentText', this.currSelectedDataSource)
|
||||
|
||||
try {
|
||||
this.isCalling = true
|
||||
const { success, result, message } = await postAction('/gamma/callDataEfficiency', formData)
|
||||
if (success) {
|
||||
const { ECutAnalysis_Low, G_energy_span } = result
|
||||
this.ECutAnalysis_Low = ECutAnalysis_Low
|
||||
this.G_energy_span = G_energy_span
|
||||
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isCalling = false
|
||||
}
|
||||
}
|
||||
event.target.value = ''
|
||||
},
|
||||
|
||||
// 应用
|
||||
async handleApply() {
|
||||
try {
|
||||
let curCalName = this.currSelectedDataSource
|
||||
// 如果沒选中以Input开头的,也就是选中了PHD之类的
|
||||
if (!curCalName.includes('Input')) {
|
||||
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
|
||||
}
|
||||
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/applyDataEfficiency', {
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurEffi: this.list.map((item) => item.efficiency),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
curCalName,
|
||||
sampleId,
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.handleDataSourceClick(curCalName)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 右侧DataSource中的选项点击
|
||||
handleDataSourceClick(item) {
|
||||
this.currSelectedDataSource = item
|
||||
this.getData(item)
|
||||
},
|
||||
|
||||
async handleSetToCurrent() {
|
||||
this.appliedDataSource = this.currSelectedDataSource
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
|
||||
const { success, message } = await putAction(
|
||||
`/gamma/setCurrentEfficiency?fileName=${fileName}¤tName=${this.currSelectedDataSource}`
|
||||
)
|
||||
if (!success) {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.energy-calibration {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.calibration-data {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.ant-form {
|
||||
width: 25%;
|
||||
|
||||
::v-deep {
|
||||
.ant-form-item {
|
||||
margin-bottom: 15px;
|
||||
|
||||
&-label,
|
||||
&-control {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-wrapper {
|
||||
width: 50%;
|
||||
|
||||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 193px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.ant-table-placeholder {
|
||||
height: 194px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operators {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
|
||||
&:last-child {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.equation {
|
||||
height: 40px;
|
||||
background-color: #1b5465;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.curve {
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 20%;
|
||||
margin-left: 20px;
|
||||
|
||||
.data-source {
|
||||
.content {
|
||||
height: 330px;
|
||||
background-color: #275466;
|
||||
overflow: auto;
|
||||
|
||||
.item {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
|
||||
&.active {
|
||||
background-color: #296d81;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
> div {
|
||||
text-align: center;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
background-color: #285367;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mt-20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
::v-deep {
|
||||
.ant-modal {
|
||||
top: 5px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,711 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1280" title="Energy Calibration" :footer="null" destroy-on-close>
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="energy-calibration">
|
||||
<div class="left">
|
||||
<!-- Calibration Data -->
|
||||
<title-over-border title="Calibration Data">
|
||||
<div class="calibration-data">
|
||||
<a-form-model
|
||||
:colon="false"
|
||||
:labelCol="{
|
||||
style: {
|
||||
width: '70px',
|
||||
textAlign: 'left',
|
||||
flexShrink: 0,
|
||||
},
|
||||
}"
|
||||
:wrapperCol="{
|
||||
style: {
|
||||
flex: 1,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<a-form-model-item label="Channel">
|
||||
<a-input type="number" v-model="model.channel" @change="handleChannelChange"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Energy">
|
||||
<a-input type="number" v-model="model.energy" @change="handleEnergyChange"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleInsert">Insert</a-button>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleModify">Modify</a-button>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleDelete">Delete</a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<!-- 表格 -->
|
||||
<custom-table
|
||||
:columns="columns"
|
||||
:list="list"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 193 }"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:canDeselect="false"
|
||||
@rowClick="handleRowClick"
|
||||
></custom-table>
|
||||
<!-- 表格结束 -->
|
||||
<div class="operators">
|
||||
<div>
|
||||
<label>
|
||||
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
|
||||
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
|
||||
</label>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||
</div>
|
||||
<div>
|
||||
<a-button type="primary" @click="handleApply">Apply</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</title-over-border>
|
||||
<!-- Equation -->
|
||||
<title-over-border class="mt-20" title="Equation">
|
||||
<div class="equation" v-html="equation"></div>
|
||||
</title-over-border>
|
||||
<!-- curve -->
|
||||
<title-over-border class="mt-20" title="curve">
|
||||
<div class="curve">
|
||||
<custom-chart :option="option" :opts="opts" />
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
<div class="right">
|
||||
<title-over-border title="Data Source" style="height: 100%">
|
||||
<div class="data-source">
|
||||
<div class="content">
|
||||
<div
|
||||
class="item"
|
||||
:class="item == currSelectedDataSource ? 'active' : ''"
|
||||
v-for="(item, index) in dataSourceList"
|
||||
:key="index"
|
||||
@click="handleDataSourceClick(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer mt-20">
|
||||
<a-button type="primary" @click="handleSetToCurrent">Set to Current</a-button>
|
||||
<div class="mt-20">{{ appliedDataSource }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { getAction, postAction, putAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { showSaveFileModal } from '@/utils/file'
|
||||
|
||||
const format = (text) => {
|
||||
const num = parseFloat(text)
|
||||
return (!num ? '-' : '') + Number(text).toFixed(3)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Channel',
|
||||
dataIndex: 'channel',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
]
|
||||
|
||||
const initialOption = {
|
||||
grid: {
|
||||
top: 20,
|
||||
right: 20,
|
||||
bottom: 50,
|
||||
left: 70,
|
||||
},
|
||||
title: {
|
||||
text: 'Channel',
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
right: 10,
|
||||
bottom: 0,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: (params) => {
|
||||
const [x, y] = params[0].value
|
||||
const channel = parseInt(x)
|
||||
const energy = y.toFixed(3)
|
||||
return `<div class="channel">Channel: ${channel}</div>
|
||||
<div class="energy">Energy: ${energy}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
xAxis: {
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
name: 'keV',
|
||||
nameLocation: 'center',
|
||||
nameGap: 50,
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
series: [],
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder, CustomChart },
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
isLoading: false,
|
||||
isCalling: false,
|
||||
isSaving: false,
|
||||
|
||||
equation: '',
|
||||
dataSourceList: [],
|
||||
list: [],
|
||||
option: cloneDeep(initialOption),
|
||||
selectedRowKeys: [],
|
||||
model: {},
|
||||
emptyModal: {},
|
||||
currSelectedDataSource: '',
|
||||
appliedDataSource: '',
|
||||
opts: {
|
||||
notMerge: true,
|
||||
},
|
||||
|
||||
// rg_high: -1,
|
||||
// rg_low: -1,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData(currentText) {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/selfStation/energyCalibration', {
|
||||
fileName,
|
||||
currentText,
|
||||
width: 80,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
const { list_dataSource, currentText: resultCurrentText } = result
|
||||
this.dataSourceList = list_dataSource
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
if (!currentText) {
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
this.appliedDataSource = resultCurrentText
|
||||
}
|
||||
|
||||
// this.rg_high = rg_high
|
||||
// this.rg_low = rg_low
|
||||
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
handleResult(result) {
|
||||
const { AllData, equation, param, table, uncert } = result
|
||||
// 有数据
|
||||
if (AllData) {
|
||||
const [linePoint, scatterPoint] = AllData
|
||||
this.equation = equation
|
||||
this.param = param
|
||||
this.uncert = uncert
|
||||
|
||||
this.list = table
|
||||
this.generateTableId()
|
||||
|
||||
const series = []
|
||||
series.push(
|
||||
buildLineSeries(
|
||||
'LineSeries',
|
||||
linePoint.pointlist.map(({ x, y }) => [x, y]),
|
||||
linePoint.color
|
||||
)
|
||||
)
|
||||
series.push({
|
||||
type: 'scatter',
|
||||
data: scatterPoint.pointlist.map(({ x, y }) => {
|
||||
return {
|
||||
value: [x, y],
|
||||
symbolSize: 5,
|
||||
itemStyle: {
|
||||
color: scatterPoint.color,
|
||||
borderWidth: 0,
|
||||
},
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true,
|
||||
},
|
||||
animation: false,
|
||||
zlevel: 20,
|
||||
})
|
||||
this.option.series = series
|
||||
}
|
||||
// 没数据
|
||||
else {
|
||||
this.option.series = []
|
||||
}
|
||||
},
|
||||
|
||||
beforeModalOpen() {
|
||||
this.selectedRowKeys = []
|
||||
this.getData('PHD')
|
||||
this.model.channel = null
|
||||
this.model.energy = null
|
||||
},
|
||||
|
||||
// 表格单行点击
|
||||
handleRowClick(row) {
|
||||
this.model = cloneDeep(row)
|
||||
this.model.channel = parseFloat(Number(this.model.channel).toPrecision(6))
|
||||
this.model.energy = parseFloat(Number(this.model.energy).toPrecision(6))
|
||||
this.emptyModal = cloneDeep(row)
|
||||
},
|
||||
|
||||
// 插入
|
||||
handleInsert() {
|
||||
const centroid = parseFloat(this.model.channel)
|
||||
const energy = parseFloat(this.model.energy)
|
||||
|
||||
if (Number.isNaN(centroid) || Number.isNaN(energy)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
// if (centroid <= this.rg_low || centroid >= this.rg_high) {
|
||||
// this.$message.warn('Centroid must be in the range of analysis!')
|
||||
// return
|
||||
// }
|
||||
|
||||
let i,
|
||||
num = this.list.length
|
||||
for (i = 0; i < num; ++i) {
|
||||
const channel = this.list[i].channel
|
||||
if (Math.abs(channel - centroid) < 0.01) {
|
||||
this.$message.warn('The centroid has already existed!')
|
||||
return
|
||||
} else if (channel > centroid) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
this.list.splice(i, 0, {
|
||||
channel: centroid,
|
||||
energy,
|
||||
})
|
||||
|
||||
this.uncert.splice(i, 0, 0.5)
|
||||
|
||||
this.selectedRowKeys = [i]
|
||||
this.generateTableId()
|
||||
|
||||
this.recalculate()
|
||||
},
|
||||
|
||||
// 生成table中数据的id,用以选中
|
||||
generateTableId() {
|
||||
this.list.forEach((item, index) => {
|
||||
item.id = index
|
||||
})
|
||||
},
|
||||
handleChannelChange(e) {
|
||||
if (e.target.value != parseFloat(Number(this.emptyModal.channel).toPrecision(6))) {
|
||||
this.emptyModal.channel = e.target.value
|
||||
}
|
||||
},
|
||||
handleEnergyChange(e) {
|
||||
console.log(e.target.value)
|
||||
if (e.target.value != parseFloat(Number(this.emptyModal.energy).toPrecision(6))) {
|
||||
this.emptyModal.energy = e.target.value
|
||||
}
|
||||
},
|
||||
|
||||
// 修改
|
||||
handleModify() {
|
||||
if (this.selectedRowKeys.length) {
|
||||
const centroid = parseFloat(this.emptyModal.channel)
|
||||
const energy = parseFloat(this.emptyModal.energy)
|
||||
|
||||
if (Number.isNaN(centroid) || Number.isNaN(energy)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
// if (centroid <= this.rg_low || centroid >= this.rg_high) {
|
||||
// this.$message.warn('Centroid must be in the range of analysis!')
|
||||
// return
|
||||
// }
|
||||
|
||||
const [currSelectedIndex] = this.selectedRowKeys
|
||||
|
||||
this.list[currSelectedIndex].channel = centroid
|
||||
this.list[currSelectedIndex].energy = energy
|
||||
|
||||
this.uncert[currSelectedIndex] = 0
|
||||
|
||||
this.recalculate()
|
||||
}
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete() {
|
||||
if (this.selectedRowKeys.length) {
|
||||
const [currSelectedIndex] = this.selectedRowKeys
|
||||
|
||||
this.list.splice(currSelectedIndex, 1)
|
||||
this.uncert.splice(currSelectedIndex, 1)
|
||||
this.generateTableId()
|
||||
if (this.list.length) {
|
||||
const selectedKey = this.selectedRowKeys[0]
|
||||
if (selectedKey > this.list.length - 1) {
|
||||
this.selectedRowKeys[0] = selectedKey - 1
|
||||
}
|
||||
} else {
|
||||
this.selectedRowKeys = []
|
||||
}
|
||||
this.recalculate()
|
||||
}
|
||||
},
|
||||
|
||||
// 重新计算
|
||||
async recalculate() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/changeDataEnergy', {
|
||||
sampleId,
|
||||
fileName,
|
||||
m_vCurCentroid: this.list.map((item) => item.channel),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
width: 922,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 保存
|
||||
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
|
||||
}
|
||||
},
|
||||
|
||||
// 点击call按钮
|
||||
handleCall() {
|
||||
this.$refs.fileInput.click()
|
||||
},
|
||||
|
||||
async handleFileChange(event) {
|
||||
const { files } = event.target
|
||||
if (files.length) {
|
||||
const file = files[0]
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
formData.append('sampleFileName', fileName)
|
||||
formData.append('width', 922)
|
||||
formData.append('currentText', this.currSelectedDataSource)
|
||||
|
||||
try {
|
||||
this.isCalling = true
|
||||
const { success, result, message } = await postAction('/gamma/callDataEnergy', formData)
|
||||
if (success) {
|
||||
const { rg_high, rg_low } = result
|
||||
this.rg_high = rg_high
|
||||
this.rg_low = rg_low
|
||||
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isCalling = false
|
||||
}
|
||||
}
|
||||
event.target.value = ''
|
||||
},
|
||||
|
||||
// 应用
|
||||
async handleApply() {
|
||||
try {
|
||||
let curCalName = this.currSelectedDataSource
|
||||
// 如果沒选中以Input开头的,也就是选中了PHD之类的
|
||||
if (!curCalName.includes('Input')) {
|
||||
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
|
||||
}
|
||||
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/applyDataEnergy', {
|
||||
m_vCurCentroid: this.list.map((item) => item.channel),
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
curCalName,
|
||||
sampleId,
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.handleDataSourceClick(curCalName)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 右侧DataSource中的选项点击
|
||||
handleDataSourceClick(item) {
|
||||
this.currSelectedDataSource = item
|
||||
this.getData(item)
|
||||
},
|
||||
|
||||
async handleSetToCurrent() {
|
||||
this.appliedDataSource = this.currSelectedDataSource
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
|
||||
const { success, message } = await putAction(
|
||||
`/gamma/setCurrentEnergy?fileName=${fileName}¤tName=${this.currSelectedDataSource}`
|
||||
)
|
||||
if (!success) {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.energy-calibration {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.calibration-data {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.ant-form {
|
||||
width: 25%;
|
||||
|
||||
::v-deep {
|
||||
.ant-form-item {
|
||||
margin-bottom: 15px;
|
||||
|
||||
&-label,
|
||||
&-control {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-wrapper {
|
||||
width: 50%;
|
||||
|
||||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 193px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.ant-table-placeholder {
|
||||
height: 194px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operators {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
|
||||
&:last-child {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.equation {
|
||||
height: 40px;
|
||||
background-color: #1b5465;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.curve {
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 20%;
|
||||
margin-left: 20px;
|
||||
|
||||
.data-source {
|
||||
.content {
|
||||
height: 330px;
|
||||
background-color: #275466;
|
||||
overflow: auto;
|
||||
|
||||
.item {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
|
||||
&.active {
|
||||
background-color: #296d81;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
> div {
|
||||
text-align: center;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
background-color: #285367;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mt-20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
::v-deep {
|
||||
.ant-modal {
|
||||
top: 5px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,708 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1280" title="Resolution Calibration" :footer="null" destroy-on-close>
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="energy-calibration">
|
||||
<div class="left">
|
||||
<!-- Calibration Data -->
|
||||
<title-over-border title="Calibration Data">
|
||||
<div class="calibration-data">
|
||||
<a-form-model
|
||||
:colon="false"
|
||||
:labelCol="{
|
||||
style: {
|
||||
width: '70px',
|
||||
textAlign: 'left',
|
||||
flexShrink: 0,
|
||||
},
|
||||
}"
|
||||
:wrapperCol="{
|
||||
style: {
|
||||
flex: 1,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<a-form-model-item label="Energy">
|
||||
<a-input type="number" v-model="model.energy" @change="handleEnergyChange"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="FWHM">
|
||||
<a-input type="number" v-model="model.fwhm" @change="handleChannelChange"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleInsert">Insert</a-button>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleModify">Modify</a-button>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="' '">
|
||||
<a-button type="primary" @click="handleDelete">Delete</a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<!-- 表格 -->
|
||||
<custom-table
|
||||
:columns="columns"
|
||||
:list="list"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 193 }"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:canDeselect="false"
|
||||
@rowClick="handleRowClick"
|
||||
></custom-table>
|
||||
<!-- 表格结束 -->
|
||||
<div class="operators">
|
||||
<div>
|
||||
<label>
|
||||
<a-button type="primary" :loading="isCalling" @click="handleCall">Call</a-button>
|
||||
<input ref="fileInput" type="file" accept=".ent" style="display: none" @change="handleFileChange" />
|
||||
</label>
|
||||
<a-button type="primary" :loading="isSaving" @click="handleSave">Save</a-button>
|
||||
</div>
|
||||
<div>
|
||||
<a-button type="primary" @click="handleApply">Apply</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</title-over-border>
|
||||
<!-- Equation -->
|
||||
<title-over-border class="mt-20" title="Equation">
|
||||
<div class="equation" v-html="equation"></div>
|
||||
</title-over-border>
|
||||
<!-- curve -->
|
||||
<title-over-border class="mt-20" title="curve">
|
||||
<div class="curve">
|
||||
<custom-chart :option="option" :opts="opts" />
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
<div class="right">
|
||||
<title-over-border title="Data Source" style="height: 100%">
|
||||
<div class="data-source">
|
||||
<div class="content">
|
||||
<div
|
||||
class="item"
|
||||
:class="item == currSelectedDataSource ? 'active' : ''"
|
||||
v-for="(item, index) in dataSourceList"
|
||||
:key="index"
|
||||
@click="handleDataSourceClick(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer mt-20">
|
||||
<a-button type="primary" @click="handleSetToCurrent">Set to Current</a-button>
|
||||
<div class="mt-20">{{ appliedDataSource }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { getAction, postAction, putAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { showSaveFileModal } from '@/utils/file'
|
||||
|
||||
const format = (text) => {
|
||||
const num = parseFloat(text)
|
||||
return (!num ? '-' : '') + Number(text).toFixed(3)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'FWHM(keV)',
|
||||
dataIndex: 'fwhm',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => format(text),
|
||||
},
|
||||
]
|
||||
|
||||
const initialOption = {
|
||||
grid: {
|
||||
top: 20,
|
||||
right: 20,
|
||||
bottom: 50,
|
||||
left: 70,
|
||||
},
|
||||
title: {
|
||||
text: 'Channel',
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
fontWeight: 'normal',
|
||||
},
|
||||
right: 10,
|
||||
bottom: 0,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: (params) => {
|
||||
const [x, y] = params[0].value
|
||||
const energy = parseInt(x)
|
||||
const fwhm = y.toFixed(3)
|
||||
return `<div class="channel">Energy: ${energy}</div>
|
||||
<div class="energy">Efficiency : ${fwhm}</div>`
|
||||
},
|
||||
className: 'figure-chart-option-tooltip',
|
||||
},
|
||||
xAxis: {
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
name: 'keV',
|
||||
nameLocation: 'center',
|
||||
nameGap: 50,
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
series: [],
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder, CustomChart },
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
data() {
|
||||
this.columns = columns
|
||||
return {
|
||||
isLoading: false,
|
||||
isCalling: false,
|
||||
isSaving: false,
|
||||
|
||||
equation: '',
|
||||
dataSourceList: [],
|
||||
list: [],
|
||||
option: cloneDeep(initialOption),
|
||||
selectedRowKeys: [],
|
||||
model: {},
|
||||
emptyModal: {},
|
||||
currSelectedDataSource: '',
|
||||
appliedDataSource: '',
|
||||
opts: {
|
||||
notMerge: true,
|
||||
},
|
||||
// ECutAnalysis_Low: -1,
|
||||
// G_energy_span: -1,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getData(currentText) {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/selfStation/resolutionCalibration', {
|
||||
fileName,
|
||||
currentText,
|
||||
width: 80,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
const { list_dataSource, currentText: resultCurrentText } = result
|
||||
this.dataSourceList = list_dataSource
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
if (!currentText) {
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
this.appliedDataSource = resultCurrentText
|
||||
}
|
||||
|
||||
// this.ECutAnalysis_Low = ECutAnalysis_Low
|
||||
// this.G_energy_span = G_energy_span
|
||||
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
handleResult(result) {
|
||||
const { AllData, equation, param, table, uncert } = result
|
||||
// 有数据
|
||||
if (AllData) {
|
||||
const [linePoint, scatterPoint] = AllData
|
||||
this.equation = equation
|
||||
this.param = param
|
||||
this.uncert = uncert
|
||||
|
||||
this.list = table
|
||||
this.generateTableId()
|
||||
|
||||
const series = []
|
||||
series.push(
|
||||
buildLineSeries(
|
||||
'LineSeries',
|
||||
linePoint.pointlist.map(({ x, y }) => [x, y]),
|
||||
linePoint.color
|
||||
)
|
||||
)
|
||||
series.push({
|
||||
type: 'scatter',
|
||||
data: scatterPoint.pointlist.map(({ x, y }) => {
|
||||
return {
|
||||
value: [x, y],
|
||||
symbolSize: 5,
|
||||
itemStyle: {
|
||||
color: scatterPoint.color,
|
||||
borderWidth: 0,
|
||||
},
|
||||
}
|
||||
}),
|
||||
emphasis: {
|
||||
disabled: true,
|
||||
},
|
||||
animation: false,
|
||||
zlevel: 20,
|
||||
})
|
||||
this.option.series = series
|
||||
}
|
||||
// 没数据
|
||||
else {
|
||||
this.option.series = []
|
||||
}
|
||||
},
|
||||
|
||||
beforeModalOpen() {
|
||||
this.selectedRowKeys = []
|
||||
this.getData('PHD')
|
||||
this.model.energy = null
|
||||
this.model.fwhm = null
|
||||
},
|
||||
|
||||
// 表格单行点击
|
||||
handleRowClick(row) {
|
||||
this.model = cloneDeep(row)
|
||||
this.model.fwhm = parseFloat(Number(this.model.fwhm).toPrecision(6))
|
||||
this.model.energy = parseFloat(Number(this.model.energy).toPrecision(6))
|
||||
this.emptyModal = cloneDeep(row)
|
||||
},
|
||||
|
||||
// 插入
|
||||
handleInsert() {
|
||||
const energy = parseFloat(this.model.energy)
|
||||
const fwhm = parseFloat(this.model.fwhm)
|
||||
if (Number.isNaN(energy) || Number.isNaN(fwhm)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
// if (energy <= this.ECutAnalysis_Low || energy >= this.G_energy_span) {
|
||||
// this.$message.warn('Energy is out of analysis range.')
|
||||
// return
|
||||
// }
|
||||
|
||||
let i,
|
||||
num = this.list.length
|
||||
for (i = 0; i < num; ++i) {
|
||||
const currEnergy = this.list[i].energy
|
||||
if (Math.abs(currEnergy - energy) < 0.001) {
|
||||
this.$message.warn('The centroid has already existed!')
|
||||
return
|
||||
} else if (currEnergy > energy) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
this.list.splice(i, 0, {
|
||||
energy: energy,
|
||||
fwhm,
|
||||
})
|
||||
|
||||
this.uncert.splice(i, 0, 0.5)
|
||||
|
||||
this.selectedRowKeys = [i]
|
||||
this.generateTableId()
|
||||
|
||||
this.recalculate()
|
||||
},
|
||||
|
||||
// 生成table中数据的id,用以选中
|
||||
generateTableId() {
|
||||
this.list.forEach((item, index) => {
|
||||
item.id = index
|
||||
})
|
||||
},
|
||||
handleChannelChange(e) {
|
||||
if (e.target.value != parseFloat(Number(this.emptyModal.fwhm).toPrecision(6))) {
|
||||
this.emptyModal.fwhm = e.target.value
|
||||
}
|
||||
},
|
||||
handleEnergyChange(e) {
|
||||
if (e.target.value != parseFloat(Number(this.emptyModal.energy).toPrecision(6))) {
|
||||
this.emptyModal.energy = e.target.value
|
||||
}
|
||||
},
|
||||
|
||||
// 修改
|
||||
handleModify() {
|
||||
if (this.selectedRowKeys.length) {
|
||||
const energy = parseFloat(this.emptyModal.energy)
|
||||
const fwhm = parseFloat(this.emptyModal.fwhm)
|
||||
|
||||
if (Number.isNaN(energy) || Number.isNaN(fwhm)) {
|
||||
this.$message.warn('Format is invalid.')
|
||||
return
|
||||
}
|
||||
|
||||
// if (energy <= this.ECutAnalysis_Low || energy >= this.G_energy_span) {
|
||||
// this.$message.warn('Energy is out of analysis range.')
|
||||
// return
|
||||
// }
|
||||
|
||||
const [currSelectedIndex] = this.selectedRowKeys
|
||||
|
||||
this.list[currSelectedIndex].energy = energy
|
||||
this.list[currSelectedIndex].fwhm = fwhm
|
||||
|
||||
this.uncert[currSelectedIndex] = 0
|
||||
|
||||
this.recalculate()
|
||||
}
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete() {
|
||||
if (this.selectedRowKeys.length) {
|
||||
const [currSelectedIndex] = this.selectedRowKeys
|
||||
|
||||
this.list.splice(currSelectedIndex, 1)
|
||||
this.uncert.splice(currSelectedIndex, 1)
|
||||
this.generateTableId()
|
||||
if (this.list.length) {
|
||||
const selectedKey = this.selectedRowKeys[0]
|
||||
if (selectedKey > this.list.length - 1) {
|
||||
this.selectedRowKeys[0] = selectedKey - 1
|
||||
}
|
||||
} else {
|
||||
this.selectedRowKeys = []
|
||||
}
|
||||
this.recalculate()
|
||||
}
|
||||
},
|
||||
|
||||
// 重新计算
|
||||
async recalculate() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/changeDataResolution', {
|
||||
sampleId,
|
||||
fileName,
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurReso: this.list.map((item) => item.fwhm),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
width: 922,
|
||||
})
|
||||
if (success) {
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 保存
|
||||
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
|
||||
}
|
||||
},
|
||||
|
||||
// 点击call按钮
|
||||
handleCall() {
|
||||
this.$refs.fileInput.click()
|
||||
},
|
||||
|
||||
async handleFileChange(event) {
|
||||
const { files } = event.target
|
||||
if (files.length) {
|
||||
const file = files[0]
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const formData = new FormData()
|
||||
formData.append('file', file)
|
||||
formData.append('sampleFileName', fileName)
|
||||
formData.append('width', 922)
|
||||
formData.append('currentText', this.currSelectedDataSource)
|
||||
|
||||
try {
|
||||
this.isCalling = true
|
||||
const { success, result, message } = await postAction('/gamma/callDataResolution', formData)
|
||||
if (success) {
|
||||
const { ECutAnalysis_Low, G_energy_span } = result
|
||||
this.ECutAnalysis_Low = ECutAnalysis_Low
|
||||
this.G_energy_span = G_energy_span
|
||||
|
||||
this.handleResult(result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isCalling = false
|
||||
}
|
||||
}
|
||||
event.target.value = ''
|
||||
},
|
||||
|
||||
// 应用
|
||||
async handleApply() {
|
||||
try {
|
||||
let curCalName = this.currSelectedDataSource
|
||||
// 如果沒选中以Input开头的,也就是选中了PHD之类的
|
||||
if (!curCalName.includes('Input')) {
|
||||
curCalName = `Input ${this.dataSourceList.filter((item) => item.includes('Input')).length + 1}`
|
||||
}
|
||||
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await postAction('/gamma/applyDataResolution', {
|
||||
m_vCurEnergy: this.list.map((item) => item.energy),
|
||||
m_vCurReso: this.list.map((item) => item.fwhm),
|
||||
m_vCurUncert: this.uncert,
|
||||
m_curParam: this.param,
|
||||
curCalName,
|
||||
sampleId,
|
||||
fileName,
|
||||
})
|
||||
if (success) {
|
||||
this.handleDataSourceClick(curCalName)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 右侧DataSource中的选项点击
|
||||
handleDataSourceClick(item) {
|
||||
this.currSelectedDataSource = item
|
||||
this.getData(item)
|
||||
},
|
||||
|
||||
async handleSetToCurrent() {
|
||||
this.appliedDataSource = this.currSelectedDataSource
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
|
||||
const { success, message } = await putAction(
|
||||
`/gamma/setCurrentResolution?fileName=${fileName}¤tName=${this.currSelectedDataSource}`
|
||||
)
|
||||
if (!success) {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.energy-calibration {
|
||||
display: flex;
|
||||
margin-top: 5px;
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.calibration-data {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.ant-form {
|
||||
width: 25%;
|
||||
|
||||
::v-deep {
|
||||
.ant-form-item {
|
||||
margin-bottom: 15px;
|
||||
|
||||
&-label,
|
||||
&-control {
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-wrapper {
|
||||
width: 50%;
|
||||
|
||||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 193px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.ant-table-placeholder {
|
||||
height: 194px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operators {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
|
||||
&:last-child {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.equation {
|
||||
height: 40px;
|
||||
background-color: #1b5465;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.curve {
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 20%;
|
||||
margin-left: 20px;
|
||||
|
||||
.data-source {
|
||||
.content {
|
||||
height: 330px;
|
||||
background-color: #275466;
|
||||
overflow: auto;
|
||||
|
||||
.item {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
|
||||
&.active {
|
||||
background-color: #296d81;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
> div {
|
||||
text-align: center;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
background-color: #285367;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mt-20 {
|
||||
margin-top: 20px;
|
||||
}
|
||||
::v-deep {
|
||||
.ant-modal {
|
||||
top: 5px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -136,14 +136,17 @@
|
|||
|
||||
<!-- Efficiency Calibration 弹窗开始 -->
|
||||
<efficiency-calibration-modal v-model="efficiencyCalibrationModalShow" />
|
||||
<efficiency-calibration-modal-beta v-model="efficiencyCalibrationModalShow_beta" />
|
||||
<!-- Efficiency Calibration 弹窗结束 -->
|
||||
|
||||
<!-- Energy Calibration 弹窗开始 -->
|
||||
<energy-calibration-modal v-model="energyCalibrationModalShow" />
|
||||
<energy-calibration-modal-beta v-model="energyCalibrationModalShow_beta" />
|
||||
<!-- Energy Calibration 弹窗结束 -->
|
||||
|
||||
<!-- Resolution Calibration 弹窗开始 -->
|
||||
<resolution-calibration-modal v-model="resolutionCalibrationModalShow" />
|
||||
<resolution-calibration-modal-beta v-model="resolutionCalibrationModalShow_beta" />
|
||||
<!-- Resolution Calibration 弹窗结束 -->
|
||||
|
||||
<!-- SpectrumComments 弹窗开始 -->
|
||||
|
@ -255,8 +258,11 @@ import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveT
|
|||
import KorsumModal from './components/Modals/KorsumModal.vue'
|
||||
import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue'
|
||||
import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue'
|
||||
import EfficiencyCalibrationModalBeta from './components/Modals/EfficiencyCalibrationModal-Beta.vue'
|
||||
import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue'
|
||||
import EnergyCalibrationModalBeta from './components/Modals/EnergyCalibrationModal-Beta.vue'
|
||||
import ResolutionCalibrationModal from './components/Modals/ResolutionCalibrationModal.vue'
|
||||
import ResolutionCalibrationModallBeta from './components/Modals/ResolutionCalibrationModal-Beta.vue'
|
||||
import SpectrumCommentsModal from './components/Modals/SpectrumCommentsModal.vue'
|
||||
import ColorConfigModal from './components/Modals/ColorConfigModal.vue'
|
||||
import DataProcessingLogModal from './components/Modals/DataProcessingLogModal.vue'
|
||||
|
@ -311,8 +317,11 @@ export default {
|
|||
KorsumModal,
|
||||
ZeroTimeModal,
|
||||
EfficiencyCalibrationModal,
|
||||
EfficiencyCalibrationModalBeta,
|
||||
EnergyCalibrationModal,
|
||||
EnergyCalibrationModalBeta,
|
||||
ResolutionCalibrationModal,
|
||||
ResolutionCalibrationModallBeta,
|
||||
SpectrumCommentsModal,
|
||||
ColorConfigModal,
|
||||
DataProcessingLogModal,
|
||||
|
@ -371,8 +380,11 @@ export default {
|
|||
korsumModalShow: false, // Korsum 弹窗
|
||||
|
||||
efficiencyCalibrationModalShow: false, // Calibration -> Efficiency 弹窗
|
||||
efficiencyCalibrationModalShow_beta: false, // Beta Calibration -> Efficiency 弹窗
|
||||
energyCalibrationModalShow: false, // Calibration -> Energy 弹窗
|
||||
energyCalibrationModalShow_beta: false, // Beta Calibration -> Energy 弹窗
|
||||
resolutionCalibrationModalShow: false, // Calibration -> Resolution 弹窗
|
||||
resolutionCalibrationModalShow_beta: false, // Beta Calibration -> Resolution 弹窗
|
||||
|
||||
gammaCommentsModalVisible: false, // Comments -> Spectrum Comments 弹窗
|
||||
isGammaCommentsAdd: true, // Spectrum Comments 是否是新增
|
||||
|
@ -1356,20 +1368,29 @@ export default {
|
|||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Energy',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.energyCalibrationModalShow = true),
|
||||
show: this.isGamma || this.isBeta,
|
||||
handler: () => {
|
||||
if (this.isGamma) this.energyCalibrationModalShow = true
|
||||
if (this.isBeta) this.energyCalibrationModalShow_beta = true
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Resolution',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.resolutionCalibrationModalShow = true),
|
||||
show: this.isGamma || this.isBeta,
|
||||
handler: () => {
|
||||
if (this.isGamma) this.resolutionCalibrationModalShow = true
|
||||
if (this.isBeta) this.resolutionCalibrationModalShow_beta = true
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Efficiency',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.efficiencyCalibrationModalShow = true),
|
||||
show: this.isGamma || this.isBeta,
|
||||
handler: () => {
|
||||
if (this.isGamma) this.efficiencyCalibrationModalShow = true
|
||||
if (this.isBeta) this.efficiencyCalibrationModalShow_beta = true
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
|
|
Loading…
Reference in New Issue
Block a user