Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
2b3731322c
|
@ -1,6 +1,11 @@
|
|||
import { Modal } from 'ant-design-vue'
|
||||
import { saveAs } from 'file-saver'
|
||||
import JSZip from 'jszip'
|
||||
import Vue from 'vue'
|
||||
import signMd5Utils from '@/utils/encryption/signMd5Utils'
|
||||
import Axios from 'axios'
|
||||
import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
|
||||
import { message } from 'ant-design-vue'
|
||||
|
||||
/**
|
||||
* 弹窗填入文件名保存文件
|
||||
|
@ -85,3 +90,52 @@ export const zipFile = async (fileList, zipName) => {
|
|||
const content = await zip.generateAsync({ type: 'blob' })
|
||||
return new File([content], zipName, { type: content.type })
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据响应头获取文件名
|
||||
* @param {String} contentDisposition
|
||||
*/
|
||||
export function getFileNameByHeaderContentDisposition(contentDisposition) {
|
||||
const patt = new RegExp('file[Nn]ame=([^;]+\\.[^\\.;]+);*')
|
||||
contentDisposition = decodeURI(contentDisposition)
|
||||
const result = patt.exec(contentDisposition)
|
||||
let fileName = result[1]
|
||||
fileName = fileName.replace(/"/g, '')
|
||||
return fileName
|
||||
}
|
||||
|
||||
export const fetchAndDownload = async (url, data) => {
|
||||
const apiBaseUrl = window._CONFIG['domianURL'] || '/jeecg-boot'
|
||||
const sign = signMd5Utils.getSign(url, data)
|
||||
const response = await Axios({
|
||||
baseURL: apiBaseUrl,
|
||||
method: 'post',
|
||||
url,
|
||||
data: data,
|
||||
headers: {
|
||||
'X-Sign': sign,
|
||||
'X-TIMESTAMP': signMd5Utils.getTimestamp(),
|
||||
'X-Access-Token': Vue.ls.get(ACCESS_TOKEN),
|
||||
'tenant-id': Vue.ls.get(TENANT_ID)
|
||||
}
|
||||
})
|
||||
const { status, headers, data: responseData } = response
|
||||
if (status == 200) {
|
||||
if (typeof responseData == 'object') {
|
||||
const { message: msg } = responseData
|
||||
message.error(msg)
|
||||
throw new Error(msg)
|
||||
} else {
|
||||
const disposition = headers['content-disposition']
|
||||
const fileName = getFileNameByHeaderContentDisposition(disposition)
|
||||
if (typeof responseData == 'string') {
|
||||
const blob = new Blob([responseData], { type: headers['content-type'] })
|
||||
saveAs(blob, fileName)
|
||||
return fileName
|
||||
}
|
||||
}
|
||||
} else {
|
||||
message.error('This operation fails. Contact your system administrator')
|
||||
throw new Error('This operation fails. Contact your system administrator')
|
||||
}
|
||||
}
|
||||
|
|
17
src/views/spectrumAnalysis/clearSampleCache.js
Normal file
17
src/views/spectrumAnalysis/clearSampleCache.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { deleteAction } from '@/api/manage'
|
||||
/**
|
||||
* 发起请求清理后端对sample的缓存
|
||||
* @param {Array<any>} sampleList
|
||||
*/
|
||||
export const clearSampleCache = (sampleList) => {
|
||||
sampleList.forEach(sample => {
|
||||
const { inputFileName: fileName, sampleFileName, qcFileName } = sample
|
||||
let url = '/gamma/delPHDCache',
|
||||
params = { fileName }
|
||||
if (sample.sampleType == 'B') {
|
||||
url = '/spectrumAnalysis/deleteSpectrumCacheData'
|
||||
params = { sampleFileName , qcFileName }
|
||||
}
|
||||
deleteAction(url, params)
|
||||
})
|
||||
}
|
|
@ -51,7 +51,7 @@
|
|||
class="custom-tool-tip"
|
||||
:style="{
|
||||
top: customToolTip.top + 'px',
|
||||
left: customToolTip.left + 'px'
|
||||
left: customToolTip.left + 'px',
|
||||
}"
|
||||
>
|
||||
<div class="channel">Channel: {{ customToolTip.channel }}</div>
|
||||
|
@ -62,7 +62,7 @@
|
|||
class="custom-tool-tip"
|
||||
:style="{
|
||||
top: customToolTip2.top + 'px',
|
||||
left: customToolTip2.left + 'px'
|
||||
left: customToolTip2.left + 'px',
|
||||
}"
|
||||
>
|
||||
<div class="channel">Channel: {{ customToolTip2.channel }}</div>
|
||||
|
@ -89,10 +89,18 @@
|
|||
<div class="title">Gamma Window Setting</div>
|
||||
<div class="content">
|
||||
<div class="label">Gamma Window Begin:</div>
|
||||
<a-input-number size="small" v-model="model.windowBegin" @change="calculateTotalCount"></a-input-number>
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="model.windowBegin"
|
||||
@change="handleGammaWindowSettingChange"
|
||||
></a-input-number>
|
||||
Channel
|
||||
<div class="label">Gamma Window End:</div>
|
||||
<a-input-number size="small" v-model="model.windowEnd" @change="calculateTotalCount"></a-input-number>
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="model.windowEnd"
|
||||
@change="handleGammaWindowSettingChange"
|
||||
></a-input-number>
|
||||
Channel
|
||||
</div>
|
||||
</div>
|
||||
|
@ -100,9 +108,19 @@
|
|||
<div class="title">Parameter Setting</div>
|
||||
<div class="content">
|
||||
<div class="label">Min of Energy:</div>
|
||||
<a-input-number size="small" v-model="model.minEnergy"></a-input-number> keV
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="model.minEnergy"
|
||||
@change="handleParameterSettingChange"
|
||||
></a-input-number>
|
||||
keV
|
||||
<div class="label">Half Life:</div>
|
||||
<a-input-number size="small" v-model="model.halfLife"></a-input-number> Day
|
||||
<a-input-number
|
||||
size="small"
|
||||
v-model="model.halfLife"
|
||||
@change="handleParameterSettingChange"
|
||||
></a-input-number>
|
||||
Day
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
|
@ -137,7 +155,7 @@
|
|||
>
|
||||
<template slot="delete" slot-scope="text, record, index">
|
||||
<a-button type="link" size="small" @click="handleDel(index)">
|
||||
<a-icon type="delete" style="color: red;"></a-icon>
|
||||
<a-icon type="delete" style="color: red"></a-icon>
|
||||
</a-button>
|
||||
</template>
|
||||
</a-table>
|
||||
|
@ -196,7 +214,7 @@ import { getAction, postAction } from '@/api/manage'
|
|||
import { useBaseChartSetting } from '../../../useChart'
|
||||
import TitleOverBorder from '../../TitleOverBorder.vue'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import { isNullOrUndefined } from '@/utils/util'
|
||||
import { isNumber } from 'xe-utils/methods'
|
||||
|
||||
const initialGammaChartOption = {
|
||||
grid: {
|
||||
|
@ -204,7 +222,7 @@ const initialGammaChartOption = {
|
|||
right: 15,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
containLabel: true
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
min: 0,
|
||||
|
@ -212,21 +230,21 @@ const initialGammaChartOption = {
|
|||
interval: 64,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(119, 181, 213, 0.5)'
|
||||
}
|
||||
color: 'rgb(119, 181, 213, 0.5)',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(119, 181, 213, .2)'
|
||||
}
|
||||
color: 'rgba(119, 181, 213, .2)',
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
color: '#ade6ee',
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
|
@ -235,57 +253,57 @@ const initialGammaChartOption = {
|
|||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgb(119, 181, 213, 0.5)'
|
||||
}
|
||||
color: 'rgb(119, 181, 213, 0.5)',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(119, 181, 213, .2)'
|
||||
}
|
||||
color: 'rgba(119, 181, 213, .2)',
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#ade6ee'
|
||||
color: '#ade6ee',
|
||||
},
|
||||
animation: false
|
||||
animation: false,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
color: '#04ADD9'
|
||||
color: '#04ADD9',
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
markLine: {
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
animation: false,
|
||||
emphasis: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#f00'
|
||||
color: '#f00',
|
||||
},
|
||||
data: [{ xAxis: -1 }, { xAxis: -1 }]
|
||||
data: [{ xAxis: -1 }, { xAxis: -1 }],
|
||||
},
|
||||
animation: false
|
||||
animation: false,
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
color: '#A8DA56'
|
||||
color: '#A8DA56',
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
animation: false
|
||||
}
|
||||
]
|
||||
animation: false,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const initialBetaChartOption = {
|
||||
|
@ -294,7 +312,7 @@ const initialBetaChartOption = {
|
|||
right: 15,
|
||||
bottom: 10,
|
||||
left: 10,
|
||||
containLabel: true
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
min: 0,
|
||||
|
@ -302,21 +320,21 @@ const initialBetaChartOption = {
|
|||
interval: 64,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgb(119, 181, 213, 0.5)'
|
||||
}
|
||||
color: 'rgb(119, 181, 213, 0.5)',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(119, 181, 213, .2)'
|
||||
}
|
||||
color: 'rgba(119, 181, 213, .2)',
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
color: '#ade6ee',
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
|
@ -325,57 +343,57 @@ const initialBetaChartOption = {
|
|||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgb(119, 181, 213, 0.5)'
|
||||
}
|
||||
color: 'rgb(119, 181, 213, 0.5)',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(119, 181, 213, .2)'
|
||||
}
|
||||
color: 'rgba(119, 181, 213, .2)',
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#ade6ee'
|
||||
color: '#ade6ee',
|
||||
},
|
||||
animation: false
|
||||
animation: false,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
color: '#04ADD9'
|
||||
color: '#04ADD9',
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
markLine: {
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
show: false,
|
||||
},
|
||||
animation: false,
|
||||
emphasis: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#f00'
|
||||
color: '#f00',
|
||||
},
|
||||
data: []
|
||||
data: [],
|
||||
},
|
||||
animation: false
|
||||
animation: false,
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
color: '#A8DA56'
|
||||
color: '#A8DA56',
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
animation: false
|
||||
}
|
||||
]
|
||||
animation: false,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const initialResultChartOption = {
|
||||
|
@ -384,23 +402,23 @@ const initialResultChartOption = {
|
|||
{
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
color: '#04ADD9'
|
||||
color: '#04ADD9',
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
animation: false
|
||||
animation: false,
|
||||
},
|
||||
{
|
||||
type: 'scatter',
|
||||
itemStyle: {
|
||||
color: 'red'
|
||||
color: 'red',
|
||||
},
|
||||
symbolSize: 6,
|
||||
data: [],
|
||||
zlevel: 2,
|
||||
animation: false
|
||||
}
|
||||
]
|
||||
animation: false,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
initialResultChartOption.yAxis.boundaryGap = ['20%', '20%']
|
||||
|
@ -411,30 +429,30 @@ const columns = [
|
|||
customRender: (_, __, index) => {
|
||||
return index + 1
|
||||
},
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'Eb',
|
||||
dataIndex: 'eb',
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'Nx',
|
||||
dataIndex: 'nx',
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'Ny',
|
||||
dataIndex: 'ny',
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: 'Delete',
|
||||
scopedSlots: {
|
||||
customRender: 'delete'
|
||||
customRender: 'delete',
|
||||
},
|
||||
align: 'center',
|
||||
},
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
|
||||
const initialModel = {
|
||||
|
@ -442,20 +460,20 @@ const initialModel = {
|
|||
windowEnd: undefined,
|
||||
minEnergy: 0.1,
|
||||
halfLife: 5.243,
|
||||
fitType: 'liner'
|
||||
fitType: 'liner',
|
||||
}
|
||||
|
||||
// Function of Fitting
|
||||
const funcList = {
|
||||
liner: 'y = ax + b',
|
||||
poly2: 'y = axx + bx + c'
|
||||
poly2: 'y = axx + bx + c',
|
||||
}
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
components: {
|
||||
CustomChart,
|
||||
TitleOverBorder
|
||||
TitleOverBorder,
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
|
@ -469,14 +487,14 @@ export default {
|
|||
left: 0,
|
||||
visible: false,
|
||||
channel: '',
|
||||
energy: ''
|
||||
energy: '',
|
||||
},
|
||||
customToolTip2: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
visible: false,
|
||||
channel: '',
|
||||
energy: ''
|
||||
energy: '',
|
||||
},
|
||||
|
||||
totalCount: [0, 0],
|
||||
|
@ -490,7 +508,7 @@ export default {
|
|||
|
||||
model: cloneDeep(initialModel),
|
||||
tableList: [],
|
||||
isAnalysing: false
|
||||
isAnalysing: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -502,7 +520,7 @@ export default {
|
|||
this.resultChartOption = cloneDeep(initialResultChartOption)
|
||||
|
||||
this.model = cloneDeep(initialModel)
|
||||
this.currFunction = funcList[this.model.fitType]
|
||||
this.handleFuncChange()
|
||||
this.tableList = []
|
||||
|
||||
this.calculateTotalCount()
|
||||
|
@ -516,7 +534,7 @@ export default {
|
|||
const { sampleId, inputFileName: sampleFileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/spectrumAnalysis/viewExtrapolation', {
|
||||
sampleId,
|
||||
sampleFileName
|
||||
sampleFileName,
|
||||
})
|
||||
if (success) {
|
||||
this.detail = result
|
||||
|
@ -526,7 +544,7 @@ export default {
|
|||
betaProjectedSeriseData,
|
||||
gammaChannelEnergy,
|
||||
gammaOriginSeriseData,
|
||||
gammaProjectedSeriseData
|
||||
gammaProjectedSeriseData,
|
||||
} = result
|
||||
|
||||
this.gammaChannelEnergy = gammaChannelEnergy
|
||||
|
@ -579,8 +597,8 @@ export default {
|
|||
// 如果是左键
|
||||
if (isMouseLeft) {
|
||||
// 如果有右值且左值大于等于右值,清空
|
||||
if (!isNullOrUndefined(this.model.windowEnd) && xAxis >= this.model.windowEnd) {
|
||||
this.clearMarkLineAndToolTip()
|
||||
if (!isNumber(this.model.windowEnd) && xAxis >= this.model.windowEnd) {
|
||||
this.reset()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -591,8 +609,8 @@ export default {
|
|||
}
|
||||
// 如果是右键
|
||||
else {
|
||||
if (!isNullOrUndefined(this.model.windowBegin) && xAxis <= this.model.windowBegin) {
|
||||
this.clearMarkLineAndToolTip()
|
||||
if (!isNumber(this.model.windowBegin) && xAxis <= this.model.windowBegin) {
|
||||
this.reset()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -612,10 +630,11 @@ export default {
|
|||
currToolTip.energy = parseInt(energy) + 'keV'
|
||||
|
||||
this.calculateTotalCount()
|
||||
this.getTableAndChartData()
|
||||
}
|
||||
},
|
||||
|
||||
clearMarkLineAndToolTip() {
|
||||
reset() {
|
||||
const markLineData = this.gammaSpectrumChartOption.series[0].markLine.data
|
||||
markLineData[0].xAxis = -1
|
||||
markLineData[1].xAxis = -1
|
||||
|
@ -626,12 +645,18 @@ export default {
|
|||
this.model.windowBegin = null
|
||||
this.model.windowEnd = null
|
||||
|
||||
this.tableList = []
|
||||
const [lineSeries, scatterSeries] = this.resultChartOption.series
|
||||
lineSeries.data = []
|
||||
scatterSeries.data = []
|
||||
|
||||
this.calculateTotalCount()
|
||||
},
|
||||
|
||||
// 计算Total Count
|
||||
calculateTotalCount() {
|
||||
if (!this.model.windowBegin || !this.model.windowEnd || this.model.windowBegin >= this.model.windowEnd) {
|
||||
const { windowBegin, windowEnd } = this.model
|
||||
if (!isNumber(windowBegin) || !isNumber(windowEnd) || windowBegin >= windowEnd) {
|
||||
this.totalCount = [0, 0]
|
||||
return
|
||||
}
|
||||
|
@ -658,56 +683,96 @@ export default {
|
|||
exportEchartImg(this.$refs.chartRef.getChartInstance())
|
||||
},
|
||||
|
||||
// 分析
|
||||
async handleAnalyse() {
|
||||
handleGammaWindowSettingChange() {
|
||||
this.calculateTotalCount()
|
||||
this.getTableAndChartData()
|
||||
},
|
||||
|
||||
handleParameterSettingChange() {
|
||||
this.getTableAndChartData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取表格和图表数据
|
||||
*/
|
||||
async getTableAndChartData() {
|
||||
const { windowBegin, windowEnd, minEnergy, halfLife, fitType } = this.model
|
||||
if (
|
||||
isNullOrUndefined(windowBegin) ||
|
||||
isNullOrUndefined(windowEnd) ||
|
||||
isNullOrUndefined(minEnergy) ||
|
||||
isNullOrUndefined(halfLife)
|
||||
) {
|
||||
const [lineSeries, scatterSeries] = this.resultChartOption.series
|
||||
lineSeries.data = []
|
||||
|
||||
if (!this.validateSettingValue()) {
|
||||
scatterSeries.data = []
|
||||
this.tableList = []
|
||||
return
|
||||
}
|
||||
try {
|
||||
const { sampleFileName, detFileName } = this.sampleData
|
||||
|
||||
const { sampleId, dbName, sampleFileName, detFileName } = this.sampleData
|
||||
try {
|
||||
const params = {
|
||||
sampleId: null,
|
||||
dbName: '',
|
||||
sampleId,
|
||||
dbName,
|
||||
sampleFileName,
|
||||
detFileName,
|
||||
gammaBegin: windowBegin,
|
||||
gammaEnd: windowEnd,
|
||||
minEnergy,
|
||||
halfLife,
|
||||
fitType //选择Linear 传 liner 选择2-Polynomial 传 poly2
|
||||
fitType, //选择Linear 传 liner 选择2-Polynomial 传 poly2
|
||||
}
|
||||
const { success, result, message } = await postAction('/spectrumAnalysis/changeDataExtrapolation', params)
|
||||
if (success) {
|
||||
const { resultViewScatterDataValue, tableData } = result
|
||||
scatterSeries.data = resultViewScatterDataValue.map(({ x, y }) => [x, y])
|
||||
this.resetResultChartPerform()
|
||||
|
||||
this.tableList = tableData
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 分析
|
||||
async handleAnalyse() {
|
||||
const { minEnergy, halfLife, fitType } = this.model
|
||||
if (!this.validateSettingValue()) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const { acquisitionRealTime: acqRealTime, acquisitionStart: acqStartTime } = this.detail
|
||||
|
||||
const params = {
|
||||
eb: this.tableList.map(({ eb }) => eb),
|
||||
nx: this.tableList.map(({ nx }) => nx),
|
||||
ny: this.tableList.map(({ ny }) => ny),
|
||||
acqRealTime,
|
||||
minEnergy,
|
||||
halfLife,
|
||||
acqStartTime,
|
||||
fitType,
|
||||
}
|
||||
|
||||
this.isAnalysing = true
|
||||
const { success, result, message } = await postAction('/spectrumAnalysis/analyseExtrapolation', params)
|
||||
if (success) {
|
||||
console.log('%c [ ]-679', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
const {
|
||||
functionFit, // Function of Fitting
|
||||
resultViewLineDataValue, // 折线
|
||||
resultViewScatterDataValue, // 原点
|
||||
tableData, // 表格数据
|
||||
xeAct
|
||||
xeAct,
|
||||
} = result
|
||||
|
||||
this.currFunction = functionFit
|
||||
|
||||
const [lineSeries, scatterSeries] = this.resultChartOption.series
|
||||
const [lineSeries] = this.resultChartOption.series
|
||||
lineSeries.data = resultViewLineDataValue.map(({ x, y }) => [x, y])
|
||||
scatterSeries.data = resultViewScatterDataValue.map(({ x, y }) => [x, y])
|
||||
this.resetResultChartPerform()
|
||||
|
||||
this.xeActivity = {
|
||||
referenceTime: this.detail.acquisitionStart,
|
||||
activity: Number.isNaN(xeAct)? xeAct: Number(xeAct).toPrecision(6)
|
||||
activity: Number.isNaN(xeAct) ? xeAct : Number(xeAct).toPrecision(6),
|
||||
}
|
||||
|
||||
this.tableList = tableData
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -718,6 +783,18 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
validateSettingValue() {
|
||||
const { windowBegin, windowEnd, minEnergy, halfLife } = this.model
|
||||
if (!isNumber(windowBegin) || !isNumber(windowEnd) || !isNumber(minEnergy) || !isNumber(halfLife)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
|
||||
/**
|
||||
* 图表最大值、最小值等设为按实际情况取值
|
||||
*/
|
||||
resetResultChartPerform() {
|
||||
this.resultChartOption.yAxis.min = undefined
|
||||
this.resultChartOption.yAxis.max = undefined
|
||||
|
@ -731,8 +808,8 @@ export default {
|
|||
handleDel(index) {
|
||||
this.tableList.splice(index, 1)
|
||||
this.resultChartOption.series[1].data.splice(index, 1)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
<a-form-model class="settings" :labelCol="{ style: { width: '75px', textAlign: 'center' } }">
|
||||
<div class="top-left">
|
||||
<a-form-model-item label="MSG_ID">
|
||||
<a-input v-model="canberraIecImsParams.msgId"></a-input>
|
||||
<a-input v-model="params.msg_id"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Comment">
|
||||
<a-textarea v-model="canberraIecImsParams.comment"></a-textarea>
|
||||
<a-textarea v-model="params.comment"></a-textarea>
|
||||
</a-form-model-item>
|
||||
<title-over-border title="Collection Block">
|
||||
<a-form-model-item label="Start Time">
|
||||
|
@ -14,7 +14,7 @@
|
|||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="canberraIecImsParams.startTime"
|
||||
v-model="params.collect_start"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Stop Time">
|
||||
|
@ -22,12 +22,12 @@
|
|||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="canberraIecImsParams.stopTime"
|
||||
v-model="params.collect_stop"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<div>
|
||||
<p>Total air volume sampled</p>
|
||||
<a-input v-model="canberraIecImsParams.totalAir"></a-input>
|
||||
<a-input-number v-model="params.air_volume" style="width: 100%;"></a-input-number>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
|
@ -35,43 +35,43 @@
|
|||
<div class="header-block-list">
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.designatorEditable"></a-checkbox>
|
||||
Designator
|
||||
</div>
|
||||
<a-input v-model="canberraIecImsParams.designator"></a-input>
|
||||
<a-input :disabled="!states.designatorEditable" v-model="params.designator"></a-input>
|
||||
</div>
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.stationCodeEditable"></a-checkbox>
|
||||
Station code
|
||||
</div>
|
||||
<a-input v-model="canberraIecImsParams.stationCode"></a-input>
|
||||
<a-input :disabled="!states.stationCodeEditable" v-model="params.station"></a-input>
|
||||
</div>
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.detectorCodeEditable"></a-checkbox>
|
||||
Detector code
|
||||
</div>
|
||||
<a-input v-model="canberraIecImsParams.detectorCode"></a-input>
|
||||
<a-input :disabled="!states.detectorCodeEditable" v-model="params.detector"></a-input>
|
||||
</div>
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.sampleGeometryEditable"></a-checkbox>
|
||||
Sample geometry
|
||||
</div>
|
||||
<a-input v-model="canberraIecImsParams.sampleGeometry"></a-input>
|
||||
<a-input :disabled="!states.sampleGeometryEditable" v-model="params.sam_geom"></a-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="system-type-and-spectrum-qualifier">
|
||||
<title-over-border title="System type" class="system-type">
|
||||
<a-radio-group v-model="canberraIecImsParams.systemType">
|
||||
<a-radio-group v-model="params.sys_type">
|
||||
<a-radio value="P">P</a-radio>
|
||||
<a-radio value="G">G</a-radio>
|
||||
<a-radio value="B">B</a-radio>
|
||||
</a-radio-group>
|
||||
</title-over-border>
|
||||
<title-over-border title="Spectrum qualifier" class="spectrum-qualifier">
|
||||
<a-radio-group v-model="canberraIecImsParams.spectrumQualifier">
|
||||
<a-radio-group v-model="params.quantity">
|
||||
<a-radio value="PREL">PREL</a-radio>
|
||||
<a-radio value="FULL">FULL</a-radio>
|
||||
</a-radio-group>
|
||||
|
@ -80,44 +80,27 @@
|
|||
<div class="identifications">
|
||||
<div>
|
||||
<p>Sample reference identification</p>
|
||||
<a-input v-model="canberraIecImsParams.sampleRef"></a-input>
|
||||
<a-input v-model="params.srId"></a-input>
|
||||
</div>
|
||||
<div>
|
||||
<p>Background measurement identification</p>
|
||||
<a-input v-model="canberraIecImsParams.backgroundMea"></a-input>
|
||||
<a-input v-model="params.bgMeasureId"></a-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="transmit-time">
|
||||
<a-checkbox>Transmit time</a-checkbox>
|
||||
<a-checkbox v-model="states.transmitTimeEditable">Transmit time</a-checkbox>
|
||||
<custom-date-picker
|
||||
:disabled="!states.transmitTimeEditable"
|
||||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="canberraIecImsParams.transmitTime"
|
||||
v-model="params.transmit"
|
||||
/>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</a-form-model>
|
||||
<title-over-border title="Spectrum Transfer" class="spectrum-transfer">
|
||||
<div class="title-container">
|
||||
<div class="title">
|
||||
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="ortecBeforeUpload">
|
||||
<div>Canberra IEC1455(.IEC)</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
<div class="data-type">
|
||||
Data type
|
||||
<div class="data-type-select">
|
||||
<custom-select :option="[{ label: 'SAMPLEPHD', value: 1 }]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="imsBeforeUpload">
|
||||
<div>IMS .ims .rms</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
</div>
|
||||
<a-transfer :render="(item) => item.title" :data-source="dataSource" :target-keys="targetKeys" />
|
||||
<spectrum-transfer-com :params="params" :fileOptions="fileOptions" />
|
||||
</title-over-border>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -125,50 +108,58 @@
|
|||
<script>
|
||||
import TitleOverBorder from '../../../TitleOverBorder.vue'
|
||||
import moment from 'moment'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import SpectrumTransferCom from './SpectrumTransferCom.vue'
|
||||
|
||||
const initParams = {
|
||||
msg_id: '123456789',
|
||||
comment: '',
|
||||
collect_start: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
collect_stop: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
air_volume: '0',
|
||||
designator: '3',
|
||||
station: 'CNL06',
|
||||
detector: 'CNL06_001',
|
||||
sam_geom: 'DISC70MMX5MM',
|
||||
sys_type: 'P',
|
||||
quantity: 'FULL',
|
||||
srId: '123456789',
|
||||
bgMeasureId: '0',
|
||||
transmit: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
}
|
||||
|
||||
const initStates = {
|
||||
designatorEditable: false,
|
||||
stationCodeEditable: false,
|
||||
detectorCodeEditable: false,
|
||||
sampleGeometryEditable: false,
|
||||
transmitTimeEditable: false,
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder },
|
||||
components: { TitleOverBorder, SpectrumTransferCom },
|
||||
data() {
|
||||
return {
|
||||
canberraIecImsParams: {
|
||||
msgId: '123456789',
|
||||
comment: '',
|
||||
startTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
stopTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
totalAir: '0',
|
||||
designator: '3',
|
||||
stationCode: 'CNL06',
|
||||
detectorCode: 'CNL06_001',
|
||||
sampleGeometry: 'DISC70MMX5MM',
|
||||
systemType: 'P',
|
||||
spectrumQualifier: 'FULL',
|
||||
sampleRef: '123456789',
|
||||
backgroundMea: '0',
|
||||
transmitTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
params: cloneDeep(initParams),
|
||||
states: cloneDeep(initStates),
|
||||
fileOptions: [
|
||||
{
|
||||
title: 'Canberra IEC1455(.IEC)',
|
||||
accept: '.IEC',
|
||||
transformUrl: '/gamma/ftransit/IecToIms',
|
||||
},
|
||||
dataSource: [],
|
||||
targetKeys: [],
|
||||
{
|
||||
title: 'IMS.ims.rms',
|
||||
accept: '.IMS,.RMS,.PHD',
|
||||
transformUrl: '/gamma/ftransit/ImsToIec'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
ortecBeforeUpload(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
this.dataSource = fileList.map((item) => {
|
||||
return {
|
||||
key: item.uid,
|
||||
title: item.name,
|
||||
}
|
||||
})
|
||||
},
|
||||
imsBeforeUpload(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
let arr = fileList.map((item) => {
|
||||
return {
|
||||
key: item.uid,
|
||||
title: item.name,
|
||||
}
|
||||
})
|
||||
this.targetKeys = arr.map((item) => item.key)
|
||||
this.dataSource.push(...arr)
|
||||
beforeModalOpen() {
|
||||
this.params = cloneDeep(initParams)
|
||||
this.states = cloneDeep(initStates)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -261,67 +252,5 @@ export default {
|
|||
|
||||
.spectrum-transfer {
|
||||
margin-top: 20px;
|
||||
|
||||
.title-container {
|
||||
display: flex;
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
background-color: #225a6a;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
/deep/.ant-upload {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.data-type {
|
||||
width: 166px;
|
||||
padding: 0 8px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
line-height: 32px;
|
||||
|
||||
&-select {
|
||||
top: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-transfer {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
::v-deep {
|
||||
.ant-transfer {
|
||||
&-list {
|
||||
flex: 1;
|
||||
|
||||
&-header {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-operation {
|
||||
width: 150px;
|
||||
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
<template>
|
||||
<div class="int-spc-canberra-iec-transfer">
|
||||
<div class="spectrum-transfer">
|
||||
<div class="title-container">
|
||||
<div class="title">Select .SPC File</div>
|
||||
<div class="title">Select .IEC File</div>
|
||||
</div>
|
||||
<a-transfer></a-transfer>
|
||||
<spectrum-transfer-com :fileOptions="fileOptions" :showDataType="false" />
|
||||
|
||||
<div class="desc">
|
||||
<p>使用说明</p>
|
||||
|
@ -17,64 +13,31 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import TitleOverBorder from '../../../TitleOverBorder.vue'
|
||||
import SpectrumTransferCom from './SpectrumTransferCom.vue'
|
||||
export default {
|
||||
components: { TitleOverBorder }
|
||||
components: { SpectrumTransferCom },
|
||||
data() {
|
||||
return {
|
||||
fileOptions: [
|
||||
{
|
||||
title: 'Select .SPC File',
|
||||
accept: '.SPC',
|
||||
transformUrl: '/gamma/ftransit/SpcToIec',
|
||||
},
|
||||
{
|
||||
title: 'Select .IEC File',
|
||||
accept: '.IEC',
|
||||
transformUrl: '/gamma/ftransit/IecToSpc',
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
|
||||
.spectrum-transfer {
|
||||
margin-top: 20px;
|
||||
|
||||
.title-container {
|
||||
display: flex;
|
||||
gap: 66px;
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
background-color: #225a6a;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-transfer {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
::v-deep {
|
||||
.ant-transfer {
|
||||
&-list {
|
||||
flex: 1;
|
||||
height: 400px;
|
||||
|
||||
&-header {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-operation {
|
||||
width: 50px;
|
||||
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
text-align: center;
|
||||
|
||||
&:first-child {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 20px;
|
||||
|
||||
|
@ -82,5 +45,17 @@ export default {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.spectrum-transfer-com {
|
||||
grid-template-rows: 30px 450px;
|
||||
grid-template-columns: 1fr 75px 1fr;
|
||||
|
||||
::v-deep {
|
||||
.operators {
|
||||
justify-content: center;
|
||||
gap: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
<a-form-model class="settings" :labelCol="{ style: { width: '75px', textAlign: 'center' } }">
|
||||
<div class="top-left">
|
||||
<a-form-model-item label="MSG_ID">
|
||||
<a-input v-model="intSpacImsParams.msgId"></a-input>
|
||||
<a-input v-model="params.msg_id"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Comment">
|
||||
<a-textarea v-model="intSpacImsParams.comment"></a-textarea>
|
||||
<a-textarea v-model="params.comment"></a-textarea>
|
||||
</a-form-model-item>
|
||||
<title-over-border title="Collection Block">
|
||||
<a-form-model-item label="Start Time">
|
||||
|
@ -14,7 +14,7 @@
|
|||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="intSpacImsParams.startTime"
|
||||
v-model="params.collect_start"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Stop Time">
|
||||
|
@ -22,12 +22,12 @@
|
|||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="intSpacImsParams.stopTime"
|
||||
v-model="params.collect_stop"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<div>
|
||||
<p>Total air volume sampled</p>
|
||||
<a-input v-model="intSpacImsParams.totalAir"></a-input>
|
||||
<a-input-number v-model="params.air_volume" style="width: 100%;"></a-input-number>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</div>
|
||||
|
@ -35,43 +35,43 @@
|
|||
<div class="header-block-list">
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.designatorEditable"></a-checkbox>
|
||||
Designator
|
||||
</div>
|
||||
<a-input v-model="intSpacImsParams.designator"></a-input>
|
||||
<a-input :disabled="!states.designatorEditable" v-model="params.designator"></a-input>
|
||||
</div>
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.stationCodeEditable"></a-checkbox>
|
||||
Station code
|
||||
</div>
|
||||
<a-input v-model="intSpacImsParams.stationCode"></a-input>
|
||||
<a-input :disabled="!states.stationCodeEditable" v-model="params.station"></a-input>
|
||||
</div>
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.detectorCodeEditable"></a-checkbox>
|
||||
Detector code
|
||||
</div>
|
||||
<a-input v-model="intSpacImsParams.detectorCode"></a-input>
|
||||
<a-input :disabled="!states.detectorCodeEditable" v-model="params.detector"></a-input>
|
||||
</div>
|
||||
<div class="header-block-item">
|
||||
<div>
|
||||
<a-checkbox></a-checkbox>
|
||||
<a-checkbox v-model="states.sampleGeometryEditable"></a-checkbox>
|
||||
Sample geometry
|
||||
</div>
|
||||
<a-input v-model="intSpacImsParams.sampleGeometry"></a-input>
|
||||
<a-input :disabled="!states.sampleGeometryEditable" v-model="params.sam_geom"></a-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="system-type-and-spectrum-qualifier">
|
||||
<title-over-border title="System type" class="system-type">
|
||||
<a-radio-group v-model="intSpacImsParams.systemType">
|
||||
<a-radio-group v-model="params.sys_type">
|
||||
<a-radio value="P">P</a-radio>
|
||||
<a-radio value="G">G</a-radio>
|
||||
<a-radio value="B">B</a-radio>
|
||||
</a-radio-group>
|
||||
</title-over-border>
|
||||
<title-over-border title="Spectrum qualifier" class="spectrum-qualifier">
|
||||
<a-radio-group v-model="intSpacImsParams.spectrumQualifier">
|
||||
<a-radio-group v-model="params.quantity">
|
||||
<a-radio value="PREL">PREL</a-radio>
|
||||
<a-radio value="FULL">FULL</a-radio>
|
||||
</a-radio-group>
|
||||
|
@ -80,44 +80,27 @@
|
|||
<div class="identifications">
|
||||
<div>
|
||||
<p>Sample reference identification</p>
|
||||
<a-input v-model="intSpacImsParams.sampleRef"></a-input>
|
||||
<a-input v-model="params.srId"></a-input>
|
||||
</div>
|
||||
<div>
|
||||
<p>Background measurement identification</p>
|
||||
<a-input v-model="intSpacImsParams.backgroundMea"></a-input>
|
||||
<a-input v-model="params.bgMeasureId"></a-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="transmit-time">
|
||||
<a-checkbox>Transmit time</a-checkbox>
|
||||
<a-checkbox v-model="states.transmitTimeEditable">Transmit time</a-checkbox>
|
||||
<custom-date-picker
|
||||
:disabled="!states.transmitTimeEditable"
|
||||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="intSpacImsParams.transmitTime"
|
||||
v-model="params.transmit"
|
||||
/>
|
||||
</div>
|
||||
</title-over-border>
|
||||
</a-form-model>
|
||||
<title-over-border title="Spectrum Transfer" class="spectrum-transfer">
|
||||
<div class="title-container">
|
||||
<div class="title">
|
||||
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="ortecBeforeUpload">
|
||||
<div>ORTEC int.spc</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
<div class="data-type">
|
||||
Data type
|
||||
<div class="data-type-select">
|
||||
<custom-select :option="[{ label: 'SAMPLEPHD', value: 1 }]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a-upload name="file" :multiple="true" :showUploadList="false" :beforeUpload="imsBeforeUpload">
|
||||
<div>IMS .ims .rms</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
</div>
|
||||
<a-transfer :render="(item) => item.title" :data-source="dataSource" :target-keys="targetKeys" />
|
||||
<spectrum-transfer-com :params="params" :fileOptions="fileOptions" />
|
||||
</title-over-border>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -125,50 +108,58 @@
|
|||
<script>
|
||||
import TitleOverBorder from '../../../TitleOverBorder.vue'
|
||||
import moment from 'moment'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import SpectrumTransferCom from './SpectrumTransferCom.vue'
|
||||
|
||||
const initParams = {
|
||||
msg_id: '123456789',
|
||||
comment: '',
|
||||
collect_start: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
collect_stop: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
air_volume: '0',
|
||||
designator: '3',
|
||||
station: 'CNL06',
|
||||
detector: 'CNL06_001',
|
||||
sam_geom: 'DISC70MMX5MM',
|
||||
sys_type: 'P',
|
||||
quantity: 'FULL',
|
||||
srId: '123456789',
|
||||
bgMeasureId: '0',
|
||||
transmit: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
}
|
||||
|
||||
const initStates = {
|
||||
designatorEditable: false,
|
||||
stationCodeEditable: false,
|
||||
detectorCodeEditable: false,
|
||||
sampleGeometryEditable: false,
|
||||
transmitTimeEditable: false,
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder },
|
||||
components: { TitleOverBorder, SpectrumTransferCom },
|
||||
data() {
|
||||
return {
|
||||
intSpacImsParams: {
|
||||
msgId: '123456789',
|
||||
comment: '',
|
||||
startTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
stopTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
totalAir: '0',
|
||||
designator: '3',
|
||||
stationCode: 'CNL06',
|
||||
detectorCode: 'CNL06_001',
|
||||
sampleGeometry: 'DISC70MMX5MM',
|
||||
systemType: 'P',
|
||||
spectrumQualifier: 'FULL',
|
||||
sampleRef: '123456789',
|
||||
backgroundMea: '0',
|
||||
transmitTime: moment(new Date()).format('YYYY/MM/DD HH:mm:ss'),
|
||||
params: cloneDeep(initParams),
|
||||
states: cloneDeep(initStates),
|
||||
fileOptions: [
|
||||
{
|
||||
title: 'ORTEC int.spc',
|
||||
accept: '.SPC',
|
||||
transformUrl: '/gamma/ftransit/SpcToIms',
|
||||
},
|
||||
dataSource: [],
|
||||
targetKeys: [],
|
||||
{
|
||||
title: 'IMS.ims.rms',
|
||||
accept: '.IMS,.RMS,.PHD',
|
||||
transformUrl: '/gamma/ftransit/ImsToSpc'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
ortecBeforeUpload(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
this.dataSource = fileList.map((item) => {
|
||||
return {
|
||||
key: item.uid,
|
||||
title: item.name,
|
||||
}
|
||||
})
|
||||
},
|
||||
imsBeforeUpload(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
let arr = fileList.map((item) => {
|
||||
return {
|
||||
key: item.uid,
|
||||
title: item.name,
|
||||
}
|
||||
})
|
||||
this.targetKeys = arr.map((item) => item.key)
|
||||
this.dataSource.push(...arr)
|
||||
beforeModalOpen() {
|
||||
this.params = cloneDeep(initParams)
|
||||
this.states = cloneDeep(initStates)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -261,67 +252,5 @@ export default {
|
|||
|
||||
.spectrum-transfer {
|
||||
margin-top: 20px;
|
||||
|
||||
.title-container {
|
||||
display: flex;
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
background-color: #225a6a;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
/deep/.ant-upload {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.data-type {
|
||||
width: 166px;
|
||||
padding: 0 8px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
line-height: 32px;
|
||||
|
||||
&-select {
|
||||
top: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
padding: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-transfer {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
::v-deep {
|
||||
.ant-transfer {
|
||||
&-list {
|
||||
flex: 1;
|
||||
|
||||
&-header {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-operation {
|
||||
width: 150px;
|
||||
|
||||
.ant-btn {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -0,0 +1,255 @@
|
|||
<template>
|
||||
<div class="spectrum-transfer-com">
|
||||
<div class="title">
|
||||
<a-upload
|
||||
name="file"
|
||||
:multiple="true"
|
||||
:showUploadList="false"
|
||||
:beforeUpload="beforeLeftFileUpload"
|
||||
:accept="fileOptions[0].accept"
|
||||
>
|
||||
<div>{{ fileOptions[0].title }}</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
<div class="data-type">
|
||||
<template v-if="showDataType"> Data type </template>
|
||||
</div>
|
||||
<div class="title">
|
||||
<a-upload
|
||||
name="file"
|
||||
:multiple="true"
|
||||
:showUploadList="false"
|
||||
:beforeUpload="beforeRightFileUpload"
|
||||
:accept="fileOptions[1].accept"
|
||||
>
|
||||
<div>{{ fileOptions[1].title }}</div>
|
||||
</a-upload>
|
||||
</div>
|
||||
<div class="file-list">
|
||||
<div
|
||||
class="file-item"
|
||||
:class="{ active: leftSelFileIndex == index }"
|
||||
v-for="(file, index) in leftFileList"
|
||||
:key="index"
|
||||
@click="handleFileClick('left', index)"
|
||||
>
|
||||
{{ file.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="operators">
|
||||
<div class="data-type-select" v-if="showDataType">
|
||||
<custom-select :options="dataTypeList" v-model="dataType" />
|
||||
</div>
|
||||
<div class="transit">
|
||||
<a-button :disabled="leftSelFileIndex == null" type="primary" @click="handleTransfer('right')">
|
||||
<a-icon type="double-right" />
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="transit">
|
||||
<a-button :disabled="rightSelFileIndex == null" type="primary" @click="handleTransfer('left')">
|
||||
<a-icon type="double-left" />
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-list">
|
||||
<div
|
||||
class="file-item"
|
||||
:class="{ active: rightSelFileIndex == index }"
|
||||
v-for="(file, index) in rightFileList"
|
||||
:key="index"
|
||||
@click="handleFileClick('right', index)"
|
||||
>
|
||||
{{ file.name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { fetchAndDownload } from '@/utils/file'
|
||||
import { isNullOrUndefined } from '@/utils/util'
|
||||
const dataTypeList = ['SAMPLEPHD', 'BLANKPHD', 'DETBKPHD', 'CALIBPHD', 'QCPHD']
|
||||
|
||||
const rules = {
|
||||
msg_id: `MSG_ID can't be null`,
|
||||
designator: `Designator can't be null!`,
|
||||
station: `Station code can't be null!`,
|
||||
detector: `Detector code can't be null!`,
|
||||
sam_geom: `Sample geometry can't be null!`,
|
||||
srId: `Sample reference identification can't be null!`,
|
||||
air_volume: `The format of Total air volume sampled is error!`,
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
params: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
fileOptions: {
|
||||
type: Array,
|
||||
},
|
||||
showDataType: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.dataTypeList = dataTypeList.map((item) => ({
|
||||
label: item,
|
||||
value: item,
|
||||
}))
|
||||
|
||||
return {
|
||||
dataType: dataTypeList[0],
|
||||
leftFileList: [],
|
||||
rightFileList: [],
|
||||
|
||||
leftSelFileIndex: null,
|
||||
rightSelFileIndex: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeLeftFileUpload(file) {
|
||||
this.leftFileList = [...this.leftFileList, file]
|
||||
return false
|
||||
},
|
||||
|
||||
beforeRightFileUpload(file) {
|
||||
this.rightFileList = [...this.rightFileList, file]
|
||||
return false
|
||||
},
|
||||
|
||||
handleFileClick(side, index) {
|
||||
if (side == 'left') {
|
||||
this.leftSelFileIndex = index
|
||||
} else {
|
||||
this.rightSelFileIndex = index
|
||||
}
|
||||
},
|
||||
|
||||
validateForm() {
|
||||
const entries = Object.entries(this.params)
|
||||
if (entries.length) {
|
||||
for (const item of entries) {
|
||||
const [k, v] = item
|
||||
const rule = rules[k]
|
||||
if (rule) {
|
||||
// 如果这个字段需要验证
|
||||
if (typeof v == 'string' && (!v || !v.trim())) {
|
||||
this.$message.warn(rule)
|
||||
return false
|
||||
} else if (typeof v == 'object' && isNullOrUndefined(v)) {
|
||||
this.$message.warn(rule)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
|
||||
// 转换
|
||||
async handleTransfer(target) {
|
||||
const validate = this.validateForm()
|
||||
if (!validate) {
|
||||
return
|
||||
}
|
||||
|
||||
let url = this.fileOptions[1].transformUrl
|
||||
let file = this.rightFileList[this.rightSelFileIndex]
|
||||
const formData = new FormData()
|
||||
|
||||
if (target == 'right') {
|
||||
url = this.fileOptions[0].transformUrl
|
||||
file = this.leftFileList[this.leftSelFileIndex]
|
||||
Object.entries(this.params).forEach(([k, v]) => {
|
||||
if (['collect_start', 'collect_stop', 'transmit'].includes(k)) {
|
||||
v = v + '.0'
|
||||
}
|
||||
formData.append(k, v)
|
||||
})
|
||||
}
|
||||
|
||||
if (!file.size) {
|
||||
return
|
||||
}
|
||||
|
||||
formData.append('file', file)
|
||||
|
||||
if (this.showDataType) {
|
||||
formData.append('data_type', this.dataType)
|
||||
}
|
||||
|
||||
try {
|
||||
const fileName = await fetchAndDownload(url, formData)
|
||||
if (target == 'left') {
|
||||
this.leftFileList.push({
|
||||
name: fileName,
|
||||
})
|
||||
} else {
|
||||
this.rightFileList.push({
|
||||
name: fileName,
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.spectrum-transfer-com {
|
||||
display: grid;
|
||||
grid-template-rows: 30px 175px;
|
||||
grid-template-columns: 1fr 166px 1fr;
|
||||
row-gap: 8px;
|
||||
column-gap: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
background-color: #225a6a;
|
||||
line-height: 30px;
|
||||
/deep/.ant-upload {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.data-type {
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.file-list {
|
||||
background-color: #225a6a;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.file-item {
|
||||
padding: 0 5px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
cursor: pointer;
|
||||
|
||||
&.active {
|
||||
background-color: #296d81;
|
||||
}
|
||||
}
|
||||
|
||||
.operators {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.transit {
|
||||
.ant-btn {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1080" title="File-Format-Ftransit" :footer="null">
|
||||
<custom-modal v-model="visible" :width="1080" title="File-Format-Ftransit" :footer="null" destroy-on-close>
|
||||
<a-tabs :animated="false">
|
||||
<a-tab-pane tab="INT.SPC<=>.IMS" key="1">
|
||||
<int-spc-ims-transfer />
|
||||
|
|
|
@ -148,6 +148,7 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import * as XLSX from 'xlsx';
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -183,15 +184,18 @@ const columns = [
|
|||
const outputColumns = [
|
||||
{
|
||||
title: 'Energy',
|
||||
dataIndex: 'energy'
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6))
|
||||
},
|
||||
{
|
||||
title: 'Correct Factor',
|
||||
dataIndex: 'correctFactor'
|
||||
dataIndex: 'correctFactor',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6))
|
||||
},
|
||||
{
|
||||
title: 'Uncertainty(%)',
|
||||
dataIndex: 'uncertainty'
|
||||
dataIndex: 'uncertainty',
|
||||
customRender: (text) => parseFloat(Number(text).toPrecision(6))
|
||||
}
|
||||
]
|
||||
export default {
|
||||
|
@ -210,7 +214,10 @@ export default {
|
|||
selectedItem: {}, // output中左侧选中的项
|
||||
outputTableList: [], // output中表格列表数据
|
||||
|
||||
filterWord: '' // 筛选
|
||||
filterWord: '', // 筛选
|
||||
|
||||
fileName: '', // save excel name
|
||||
analyseData: {} // 分析结果
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -264,6 +271,7 @@ export default {
|
|||
...this.efficiency,
|
||||
energys: this.list.map(item => item.energy)
|
||||
})
|
||||
console.log(success);
|
||||
if (success) {
|
||||
this.list = result
|
||||
} else {
|
||||
|
@ -275,8 +283,22 @@ export default {
|
|||
},
|
||||
|
||||
// 分析
|
||||
handleAnalyze() {
|
||||
async handleAnalyze() {
|
||||
console.log('%c [ 分析 ]-178', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { success, result, message } = await postAction('/gamma/KorSumAnalyse', this.list)
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
this.analyseData = result
|
||||
console.log(result);
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
this.isLoading = false;
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
// 退出
|
||||
|
@ -286,12 +308,66 @@ export default {
|
|||
|
||||
// output栏点击左侧列表
|
||||
handleOutputItemClick(item) {
|
||||
if(!this.analyseData) {
|
||||
this.$message.error("Analyse Fail!")
|
||||
return false;
|
||||
}
|
||||
this.selectedItem = item
|
||||
this.outputTableList = [];
|
||||
|
||||
// 根据核素名获取结果集
|
||||
let data = this.analyseData[this.selectedItem]
|
||||
if(!data || data.energy.length < 1) {
|
||||
this.$message.error("Analyse Fail!")
|
||||
return false;
|
||||
}
|
||||
|
||||
let result = [];
|
||||
for(let i = 0; i < data.energy.length; i++ ) {
|
||||
// 将数据进行填充并
|
||||
let obj = {
|
||||
"energy": data.energy[i],
|
||||
"correctFactor" : data.factor[i],
|
||||
"uncertainty" : (data.factor[i] - 1) / 10 * 100
|
||||
}
|
||||
result.push(obj);
|
||||
}
|
||||
|
||||
this.outputTableList = result;
|
||||
},
|
||||
|
||||
// 导出到excel
|
||||
handleExport() {
|
||||
console.log('%c [ 导出到excel ]-246', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
title: 'Please enter file name',
|
||||
content: (h) => <a-input v-model={_this.fileName} />,
|
||||
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() {
|
||||
console.log(_this.fileName);
|
||||
if (_this.fileName) {
|
||||
// saveAs(blob, `${_this.fileName}`)
|
||||
// 创建工作簿
|
||||
const workbook = XLSX.utils.book_new();
|
||||
|
||||
// 创建工作表
|
||||
const worksheet = XLSX.utils.json_to_sheet(_this.outputTableList);
|
||||
|
||||
// 将工作表添加到工作簿
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||
|
||||
// 导出Excel文件
|
||||
XLSX.writeFile(workbook, _this.fileName + ".xlsx");
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { clearSampleCache } from '../clearSampleCache'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
list: {
|
||||
|
@ -43,7 +45,8 @@ export default {
|
|||
this.handleClick(this.list[index + 1])
|
||||
}
|
||||
}
|
||||
this.list.splice(index, 1)
|
||||
const deleted = this.list.splice(index, 1)
|
||||
clearSampleCache(deleted)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -313,7 +313,7 @@ export default {
|
|||
)
|
||||
console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
if (success) {
|
||||
this.dataProsess(result, 'db')
|
||||
this.dataProcess(result, 'db')
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
this.isLoading = false
|
||||
|
@ -343,7 +343,7 @@ export default {
|
|||
)
|
||||
console.log('%c [ result ]-243', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
if (success) {
|
||||
this.dataProsess(result, 'file')
|
||||
this.dataProcess(result, 'file')
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
this.isLoading = false
|
||||
|
@ -367,7 +367,7 @@ export default {
|
|||
return cancelToken
|
||||
},
|
||||
|
||||
dataProsess(result, flag) {
|
||||
dataProcess(result, flag) {
|
||||
this.isLoading = false
|
||||
|
||||
const {
|
||||
|
@ -527,7 +527,12 @@ export default {
|
|||
})
|
||||
)
|
||||
|
||||
this.opts.notMerge = true
|
||||
this.option.series = series
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.resetChartOpts()
|
||||
})
|
||||
},
|
||||
|
||||
// chart 的 tooltip
|
||||
|
@ -788,7 +793,7 @@ export default {
|
|||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
this.list = []
|
||||
this.nuclideLibraryList = []
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoadingNuclide = false
|
||||
|
@ -1169,7 +1174,7 @@ export default {
|
|||
this.handleResetState()
|
||||
data.DetailedInformation = this.detailedInfomation
|
||||
this.clearCompareLine()
|
||||
this.dataProsess(data)
|
||||
this.dataProcess(data)
|
||||
},
|
||||
|
||||
// 分析工具Accept时刷新部分数据
|
||||
|
@ -1278,7 +1283,7 @@ export default {
|
|||
},
|
||||
|
||||
// 重新分析
|
||||
async reProcessing() {
|
||||
async reProcessing(showMessage = true) {
|
||||
if (this.isProcessing) {
|
||||
return
|
||||
}
|
||||
|
@ -1297,15 +1302,17 @@ export default {
|
|||
this.$emit('reAnalyed', this.isReAnalyed)
|
||||
this.handleResetState()
|
||||
result.DetailedInformation = this.detailedInfomation
|
||||
this.dataProsess(result)
|
||||
this.dataProcess(result)
|
||||
} else {
|
||||
this.isLoading = false
|
||||
if(showMessage) {
|
||||
const arr = message.split('\n')
|
||||
this.$warning({
|
||||
title: 'Warning',
|
||||
content: () => arr.map((text) => <div>{text}</div>),
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
|
|
|
@ -236,6 +236,7 @@ import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals
|
|||
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
|
||||
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { clearSampleCache } from './clearSampleCache'
|
||||
|
||||
// 分析类型
|
||||
const ANALYZE_TYPE = {
|
||||
|
@ -479,6 +480,8 @@ export default {
|
|||
|
||||
// 清理全部
|
||||
handleCleanAll() {
|
||||
clearSampleCache(this.sampleList)
|
||||
|
||||
this.sampleList = []
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
|
@ -596,7 +599,21 @@ export default {
|
|||
},
|
||||
|
||||
handleReprocessAll() {
|
||||
console.log('%c [ handleReprocessAll ]-216', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
const { inputFileName, sampleType } = this.sampleData
|
||||
|
||||
// 先排除当前的谱
|
||||
const otherSampleList = this.sampleList.filter((sample) => sample.inputFileName !== inputFileName)
|
||||
|
||||
const betaSamples = otherSampleList.filter((sample) => sample.sampleType == 'B')
|
||||
const gammaSamples = otherSampleList.filter((sample) => sample.sampleType !== 'B')
|
||||
gammaSamples.forEach((gammaSample) => {
|
||||
postAction(`/gamma/Reprocessing?fileName=${gammaSample.inputFileName}`)
|
||||
})
|
||||
|
||||
// 处理当前的谱的reprocessing
|
||||
if(inputFileName && sampleType !== 'B') {
|
||||
this.$refs.gammaAnalysisRef.reProcessing(false)
|
||||
}
|
||||
},
|
||||
|
||||
// 查看Comments
|
||||
|
@ -740,13 +757,14 @@ export default {
|
|||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Ftransit',
|
||||
show: this.isGamma || this.isBetaGamma,
|
||||
handler: () => (this.ftransltModalVisible = true),
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll,
|
||||
handler: () => {
|
||||
this.handleCleanAll()
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -770,7 +788,8 @@ export default {
|
|||
if (spectra) {
|
||||
this.loadSelectedSample(spectra)
|
||||
} else {
|
||||
this.handleCleanAll()
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user