Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
af6aa12959
|
@ -6,7 +6,7 @@ import * as echarts from 'echarts'
|
|||
import 'echarts-gl'
|
||||
|
||||
const events = ['click', 'brushEnd']
|
||||
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click']
|
||||
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']
|
||||
export default {
|
||||
props: {
|
||||
option: {
|
||||
|
|
|
@ -63,8 +63,10 @@ export default {
|
|||
if (this.okHandler instanceof Function) {
|
||||
try {
|
||||
this.confirmLoading = true
|
||||
await this.okHandler()
|
||||
this.visible = false
|
||||
const success = await this.okHandler()
|
||||
if(success !== false) {
|
||||
this.visible = false
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
|
|
|
@ -99,9 +99,20 @@ export function findSeriesByName(series, seriesName) {
|
|||
* 限定数字在一定范围
|
||||
* @param {Number} min
|
||||
* @param {Number} max
|
||||
* @returns {(num: number) => number }
|
||||
*/
|
||||
export function rangeNumber(min, max) {
|
||||
return num => {
|
||||
return num > max ? max : num < min ? min : num
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图表某条轴线的最大值
|
||||
* @param {import("echarts").ECharts} chartInstance
|
||||
* @param {'xAxis' | 'yAxis'} axis
|
||||
* @returns
|
||||
*/
|
||||
export function getAxisMax(chartInstance, axis) {
|
||||
return chartInstance.getModel().getComponent(axis).axis.scale._extent[1]
|
||||
}
|
10
src/utils/number.js
Normal file
10
src/utils/number.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { isNullOrUndefined } from './util'
|
||||
|
||||
/**
|
||||
* 保留小数
|
||||
* @param { string | number } num 数字
|
||||
* @param { number } digit 保留位数
|
||||
*/
|
||||
export const toFixed = (num, digit) => {
|
||||
return isNullOrUndefined(num) ? '' : Number(num).toFixed(digit)
|
||||
}
|
|
@ -16,6 +16,7 @@
|
|||
:options="SampleType"
|
||||
@change="changeChartByType"
|
||||
style="width: 246px"
|
||||
class="sample-select"
|
||||
></custom-select>
|
||||
</div>
|
||||
|
||||
|
@ -132,6 +133,7 @@ import BetaGammaQcFlags from './components/SubOperators/BetaGammaQcFlags.vue'
|
|||
import PopOverWithIcon from './components/SubOperators/PopOverWithIcon.vue'
|
||||
import Spectra from './components/SubOperators/Spectra.vue'
|
||||
import CustomSelect from '@/components/CustomSelect/index.vue'
|
||||
import axios from 'axios'
|
||||
|
||||
const StatisticsType = {
|
||||
'Collection Time': 'Colloc_Time',
|
||||
|
@ -218,6 +220,9 @@ export default {
|
|||
currSample: {},
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
this.cancelLastRequest()
|
||||
},
|
||||
methods: {
|
||||
handleGetFlag(val, obj) {
|
||||
this.resultDisplay.forEach((item) => {
|
||||
|
@ -233,10 +238,16 @@ export default {
|
|||
const { dbName, sampleId } = this.sample
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { success, result, message } = await getAction('/spectrumAnalysis/getDBSpectrumChart', {
|
||||
dbName,
|
||||
sampleId,
|
||||
})
|
||||
this.cancelLastRequest()
|
||||
const cancelToken = this.createCancelToken()
|
||||
const { success, result, message } = await getAction(
|
||||
'/spectrumAnalysis/getDBSpectrumChart',
|
||||
{
|
||||
dbName,
|
||||
sampleId,
|
||||
},
|
||||
cancelToken
|
||||
)
|
||||
if (success) {
|
||||
this.sampleDetail = result
|
||||
this.changeChartByType('sample')
|
||||
|
@ -263,7 +274,13 @@ export default {
|
|||
}
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { success, result, message } = await getAction('/spectrumAnalysis/getFileSpectrumChart', params)
|
||||
this.cancelLastRequest()
|
||||
const cancelToken = this.createCancelToken()
|
||||
const { success, result, message } = await getAction(
|
||||
'/spectrumAnalysis/getFileSpectrumChart',
|
||||
params,
|
||||
cancelToken
|
||||
)
|
||||
if (success) {
|
||||
this.sampleDetail = result
|
||||
this.changeChartByType('sample')
|
||||
|
@ -276,6 +293,19 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
cancelLastRequest() {
|
||||
if (this._cancelToken && typeof this._cancelToken == 'function') {
|
||||
this._cancelToken()
|
||||
}
|
||||
},
|
||||
|
||||
createCancelToken() {
|
||||
const cancelToken = new axios.CancelToken((c) => {
|
||||
this._cancelToken = c
|
||||
})
|
||||
return cancelToken
|
||||
},
|
||||
|
||||
changeChartByType(val) {
|
||||
if (val === 'qc' && !this.sample.qcFileStatus) {
|
||||
this.$message.warning('No qc spectrum file!')
|
||||
|
@ -437,6 +467,15 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.sample-select {
|
||||
::v-deep {
|
||||
.ant-select-selection {
|
||||
background-color: transparent !important;
|
||||
color: #ade6ee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-main {
|
||||
height: calc(100% - 51px);
|
||||
display: flex;
|
||||
|
|
|
@ -358,6 +358,8 @@ export default {
|
|||
|
||||
this.emitRangeChange([0, 256, 0, 256])
|
||||
this.reDrawRect()
|
||||
|
||||
this.rangeScatter()
|
||||
},
|
||||
|
||||
// 点击ROI
|
||||
|
@ -436,11 +438,29 @@ export default {
|
|||
this.emitRangeChange([x1, x2, y1, y2])
|
||||
|
||||
this.reDrawRect()
|
||||
|
||||
this.rangeScatter()
|
||||
}
|
||||
|
||||
this.clearBrush(chart)
|
||||
},
|
||||
|
||||
/**
|
||||
* 因scatterGL 不受axis中max和min的控制,手动处理溢出部分
|
||||
*/
|
||||
rangeScatter() {
|
||||
const {
|
||||
xAxis: { min: minX, max: maxX },
|
||||
yAxis: { min: minY, max: maxY }
|
||||
} = this.twoDOption
|
||||
|
||||
const data = this.histogramDataList
|
||||
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
|
||||
.map(({ b, g, c }) => [b, g, c])
|
||||
|
||||
this.twoDOption.series.data = data
|
||||
},
|
||||
|
||||
// 通知上层范围改变
|
||||
emitRangeChange(range) {
|
||||
this.$emit('rangeChange', range)
|
||||
|
@ -462,6 +482,7 @@ export default {
|
|||
}
|
||||
|
||||
this.reDrawRect()
|
||||
this.rangeScatter()
|
||||
},
|
||||
|
||||
// 重绘矩形框区域
|
||||
|
@ -705,6 +726,7 @@ export default {
|
|||
handler(newVal) {
|
||||
this.active = 0
|
||||
this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 设置2D Scatter数据
|
||||
this.rangeScatter()
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
|
|
|
@ -407,6 +407,12 @@ const thumbnailOption = {
|
|||
series: null
|
||||
}
|
||||
|
||||
const nuclideIdentifyModal = {
|
||||
possibleNuclide: '',
|
||||
tolerance: 0.5,
|
||||
identifiedNuclide: ''
|
||||
}
|
||||
|
||||
// 操作类型
|
||||
export const Operators = {
|
||||
ADD: 1, // 新增
|
||||
|
@ -442,6 +448,7 @@ export default {
|
|||
energy: [],
|
||||
list: [],
|
||||
BaseCtrls: {},
|
||||
FitBaseLine: '#fff',
|
||||
sampleId: -1,
|
||||
|
||||
peakCommentModalVisible: false, // Comment 弹窗是否显示
|
||||
|
@ -454,11 +461,7 @@ export default {
|
|||
fitPeaksAndBaselineModalVisible: false, // Fit Peaks And Base Line 弹窗
|
||||
nuclideReviewModalVisible: false, // Nuclide Review 弹窗
|
||||
|
||||
model: {
|
||||
possibleNuclide: '',
|
||||
tolerance: 0.5,
|
||||
identifiedNuclide: ''
|
||||
},
|
||||
model: cloneDeep(nuclideIdentifyModal),
|
||||
|
||||
currChannel: undefined, // 当currChannel前选中的channel
|
||||
selectedTableItem: undefined, // 当前选中的表格项
|
||||
|
@ -483,6 +486,9 @@ export default {
|
|||
try {
|
||||
this.isLoading = true
|
||||
this.option.series = []
|
||||
this.thumbnailOption.series = []
|
||||
this.list = []
|
||||
this.model = cloneDeep(nuclideIdentifyModal)
|
||||
|
||||
const { success, result, message } = await getAction('/gamma/InteractiveTool', {
|
||||
sampleId: this.sampleId,
|
||||
|
@ -501,7 +507,8 @@ export default {
|
|||
channelPeakChart,
|
||||
energy,
|
||||
table,
|
||||
BaseCtrls
|
||||
BaseCtrls,
|
||||
FitBaseLine
|
||||
} = result
|
||||
|
||||
console.log('%c [ ]-374', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
|
@ -512,6 +519,7 @@ export default {
|
|||
this.channelPeakChart = channelPeakChart
|
||||
this.energy = energy
|
||||
this.BaseCtrls = BaseCtrls
|
||||
this.FitBaseLine = FitBaseLine
|
||||
|
||||
const series = []
|
||||
|
||||
|
@ -1246,7 +1254,7 @@ export default {
|
|||
const baseLineEditSeries = buildLineSeries(
|
||||
'BaseLine_Edit',
|
||||
this._channelBaseLineChart.pointlist.map(({ x, y }) => [x, y]),
|
||||
'#fff',
|
||||
this.FitBaseLine,
|
||||
{
|
||||
zlevel: 21
|
||||
}
|
||||
|
@ -1296,6 +1304,8 @@ export default {
|
|||
buildGraphicRect(xAxis, yAxis) {
|
||||
const chart = this.$refs.chartRef.getChartInstance()
|
||||
const [xPix, yPix] = chart.convertToPixel('grid', [xAxis, yAxis])
|
||||
const that = this
|
||||
|
||||
return {
|
||||
type: 'rect',
|
||||
id: Math.random().toString(),
|
||||
|
@ -1312,12 +1322,12 @@ export default {
|
|||
fill: 'transparent',
|
||||
lineWidth: 2
|
||||
},
|
||||
draggable: false,
|
||||
draggable: this.isModifying,
|
||||
ondrag: function() {
|
||||
const [xPixel] = chart.convertToPixel('grid', [xAxis, yAxis])
|
||||
// 保持x轴不变
|
||||
this.position[0] = xPixel
|
||||
this.redrawBaseLine()
|
||||
that.redrawBaseLine()
|
||||
},
|
||||
ondragend: ({ offsetY }) => {
|
||||
this.setGraphicDraggable(false)
|
||||
|
@ -1351,7 +1361,7 @@ export default {
|
|||
|
||||
// 重新生成基线
|
||||
redrawBaseLine() {
|
||||
console.log('%c [ 重新生成基线 ]-1355', 'font-size:13px; background:pink; color:#bf2c9f;', )
|
||||
console.log('%c [ 重新生成基线 ]-1355', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
},
|
||||
|
||||
// 根据数据绘制 + 号
|
||||
|
@ -1472,7 +1482,7 @@ export default {
|
|||
|
||||
// 修改控制点
|
||||
handleModifyCP() {
|
||||
this.setGraphicDraggable(true)
|
||||
this.setGraphicDraggable(!this.isModifying)
|
||||
},
|
||||
|
||||
// 编辑斜率
|
||||
|
|
|
@ -13,44 +13,40 @@
|
|||
<a-form-model :colon="false" :labelCol="{ style: { width: '160px' } }">
|
||||
<a-form-model-item label="ECutAnalysis_Low">
|
||||
<div class="input-with-unit">
|
||||
<a-input-number v-model="model.edit_ps_low"></a-input-number>
|
||||
<a-input v-model="model.edit_ps_low"></a-input>
|
||||
KeV
|
||||
</div>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="ECutAnalysis_High">
|
||||
<div class="input-with-unit">
|
||||
<a-input-number v-model="model.edit_ps_high"></a-input-number>
|
||||
<a-input v-model="model.edit_ps_high"></a-input>
|
||||
KeV
|
||||
</div>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="EnergyTolerance">
|
||||
<div class="input-with-unit">
|
||||
<a-input-number v-model="model.edit_energy"></a-input-number>
|
||||
<a-input v-model="model.edit_energy"></a-input>
|
||||
KeV
|
||||
</div>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="PSS_low">
|
||||
<a-input-number v-model="model.edit_pss_low"></a-input-number>
|
||||
<a-input v-model="model.edit_pss_low"></a-input>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</title-over-border>
|
||||
<title-over-border title="Calibration Peak Searching">
|
||||
<a-form-model :colon="false" :labelCol="{ style: { width: '170px' } }">
|
||||
<a-form-model-item label="CalibrationPSS_low">
|
||||
<a-input-number v-model="model.edit_cal_low" disabled></a-input-number>
|
||||
<a-input v-model="model.edit_cal_low" disabled></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="CalibrationPSS_high">
|
||||
<a-input-number v-model="model.edit_cal_high" disabled></a-input-number>
|
||||
<a-input v-model="model.edit_cal_high" disabled></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item>
|
||||
<a-checkbox v-model="model.checkBox_updateCal" disabled>
|
||||
Update Calibration
|
||||
</a-checkbox>
|
||||
<a-checkbox v-model="model.checkBox_updateCal" disabled> Update Calibration </a-checkbox>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item>
|
||||
<a-checkbox v-model="model.checkBox_keepPeak" disabled>
|
||||
Keep Calibration Peak Search Peaks
|
||||
</a-checkbox>
|
||||
<a-checkbox v-model="model.checkBox_keepPeak" disabled> Keep Calibration Peak Search Peaks </a-checkbox>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</title-over-border>
|
||||
|
@ -61,13 +57,13 @@
|
|||
<title-over-border title="Baseline Param">
|
||||
<a-form-model :colon="false" :labelCol="{ style: { width: '90px' } }">
|
||||
<a-form-model-item label="k_back">
|
||||
<a-input-number v-model="model.edit_k_back"></a-input-number>
|
||||
<a-input v-model="model.edit_k_back"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="k_alpha">
|
||||
<a-input-number v-model="model.edit_k_alpha"></a-input-number>
|
||||
<a-input v-model="model.edit_k_alpha"></a-input>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="k_beta">
|
||||
<a-input-number v-model="model.edit_k_beta"></a-input-number>
|
||||
<a-input v-model="model.edit_k_beta"></a-input>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</title-over-border>
|
||||
|
@ -75,12 +71,12 @@
|
|||
<a-form-model :colon="false" :labelCol="{ style: { width: '150px' } }">
|
||||
<title-over-border title="BaseImprove">
|
||||
<a-form-model-item label="BaseImprovePSS">
|
||||
<a-input-number v-model="model.edit_bi_pss"></a-input-number>
|
||||
<a-input v-model="model.edit_bi_pss"></a-input>
|
||||
</a-form-model-item>
|
||||
</title-over-border>
|
||||
<title-over-border title="LC Computing" style="margin-top: 20px">
|
||||
<a-form-model-item label="RiskLevelK">
|
||||
<a-input-number v-model="model.edit_riskLevelK"></a-input-number>
|
||||
<a-input v-model="model.edit_riskLevelK"></a-input>
|
||||
</a-form-model-item>
|
||||
</title-over-border>
|
||||
</a-form-model>
|
||||
|
@ -90,10 +86,20 @@
|
|||
<!-- 第三行 -->
|
||||
<div class="analysis-settings-item">
|
||||
<title-over-border title="Activity Reference Time">
|
||||
<custom-date-picker show-time v-model="model.dateTime_Act"></custom-date-picker>
|
||||
<custom-date-picker
|
||||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="model.dateTime_Act"
|
||||
></custom-date-picker>
|
||||
</title-over-border>
|
||||
<title-over-border title="Concentration Reference Time">
|
||||
<custom-date-picker show-time v-model="model.dateTime_Conc"></custom-date-picker>
|
||||
<custom-date-picker
|
||||
show-time
|
||||
format="YYYY/MM/DD HH:mm:ss"
|
||||
valueFormat="YYYY/MM/DD HH:mm:ss"
|
||||
v-model="model.dateTime_Conc"
|
||||
></custom-date-picker>
|
||||
</title-over-border>
|
||||
</div>
|
||||
|
||||
|
@ -106,10 +112,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder },
|
||||
|
@ -117,7 +124,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
model: {}
|
||||
model: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -127,13 +134,18 @@ export default {
|
|||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/configure', {
|
||||
sampleId,
|
||||
fileName
|
||||
fileName,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
this.model = result
|
||||
if (result.edit_ps_high == -9999) {
|
||||
result.edit_ps_high = 'inf'
|
||||
}
|
||||
|
||||
console.log('%c [ ]-137', 'font-size:13px; background:pink; color:#bf2c9f;', result)
|
||||
result.dateTime_Act = moment(result.dateTime_Act).format('YYYY/MM/DD HH:mm:ss')
|
||||
result.dateTime_Conc = moment(result.dateTime_Conc).format('YYYY/MM/DD HH:mm:ss')
|
||||
|
||||
this.model = result
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -145,10 +157,56 @@ export default {
|
|||
beforeModalOpen() {
|
||||
this.getInfo()
|
||||
},
|
||||
handleOk() {
|
||||
console.log('%c [ handleOk ]-121', 'font-size:13px; background:pink; color:#bf2c9f;')
|
||||
}
|
||||
}
|
||||
async handleOk() {
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
|
||||
const {
|
||||
edit_ps_low,
|
||||
edit_ps_high,
|
||||
edit_energy,
|
||||
edit_pss_low,
|
||||
edit_cal_low,
|
||||
edit_cal_high,
|
||||
edit_k_back,
|
||||
edit_k_alpha,
|
||||
edit_k_beta,
|
||||
edit_bi_pss,
|
||||
edit_riskLevelK,
|
||||
dateTime_Act,
|
||||
dateTime_Conc,
|
||||
} = this.model
|
||||
|
||||
const param = {
|
||||
fileName,
|
||||
ecutAnalysis_Low: edit_ps_low,
|
||||
ecutAnalysis_High: edit_ps_high == 'inf' ? -9999 : edit_ps_high,
|
||||
energyTolerance: edit_energy,
|
||||
pss_low: edit_pss_low,
|
||||
calibrationPSS_low: edit_cal_low,
|
||||
calibrationPSS_high: edit_cal_high,
|
||||
k_back: edit_k_back,
|
||||
k_alpha: edit_k_alpha,
|
||||
k_beta: edit_k_beta,
|
||||
baseImprovePSS: edit_bi_pss,
|
||||
riskLevelK: edit_riskLevelK,
|
||||
refTime_act: dateTime_Act,
|
||||
refTime_conc: dateTime_Conc,
|
||||
}
|
||||
|
||||
const { success, message } = await postAction('/gamma/configureSave', param)
|
||||
if (success) {
|
||||
this.$message.success('Save Success')
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
return false
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -198,7 +256,7 @@ export default {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.ant-input-number {
|
||||
.ant-input {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1000" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
|
||||
<custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
|
||||
<a-spin :spinning="isLoading">
|
||||
<pre>{{ content }}</pre>
|
||||
</a-spin>
|
||||
<div slot="custom-footer" style="text-align: center;">
|
||||
<div slot="custom-footer" style="text-align: center">
|
||||
<a-space :size="20">
|
||||
<a-button type="primary" @click="handleOk">Export</a-button>
|
||||
<a-button @click="visible = false">Cancel</a-button>
|
||||
|
@ -14,25 +14,25 @@
|
|||
|
||||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import { saveAs } from 'file-saver';
|
||||
import { getAction, postAction } from '../../../../api/manage'
|
||||
import { saveAs } from 'file-saver'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
props: {
|
||||
type: {
|
||||
type: Number
|
||||
type: Number,
|
||||
},
|
||||
extraData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
isLoading: true,
|
||||
fileName: ''
|
||||
fileName: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -56,15 +56,22 @@ export default {
|
|||
this.content = ''
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const res = await getAction(url, {
|
||||
const method = this.type == 4? postAction : getAction
|
||||
const res = await method(url, {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.extraData
|
||||
...this.extraData,
|
||||
})
|
||||
if (res.success) {
|
||||
this.content = res.result
|
||||
|
||||
if (typeof res == 'string') {
|
||||
this.content = res
|
||||
} else {
|
||||
this.content = ""
|
||||
const { success, result, message } = res
|
||||
if (success) {
|
||||
this.content = result
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
@ -77,9 +84,9 @@ export default {
|
|||
this.getContent()
|
||||
},
|
||||
handleOk() {
|
||||
this.fileName=""
|
||||
this.fileName = ''
|
||||
if (this.content) {
|
||||
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
|
||||
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' })
|
||||
// if (this.type == 1 || this.type == 3) {
|
||||
// saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`)
|
||||
// } else {
|
||||
|
@ -88,31 +95,31 @@ export default {
|
|||
let _this = this
|
||||
this.$confirm({
|
||||
title: 'Please enter file name',
|
||||
content: h => <a-input v-model={_this.fileName} />,
|
||||
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"}},
|
||||
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
|
||||
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
|
||||
onOk() {
|
||||
console.log('Cancel');
|
||||
console.log('Cancel')
|
||||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
saveAs(strData, `${_this.fileName}.txt`)
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
} else {
|
||||
this.$message.warning("No data can be saved!")
|
||||
this.$message.warning('No data can be saved!')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
pre {
|
||||
height: 450px;
|
||||
height: calc(100vh - 350px);
|
||||
padding: 5px;
|
||||
overflow: auto;
|
||||
background-color: #285367;
|
||||
|
|
|
@ -8,14 +8,18 @@
|
|||
<div class="content">
|
||||
<div class="settings">
|
||||
<div class="channel-and-width">
|
||||
<span> Channel: {{ betaGammaInfo.channel }} </span>
|
||||
<span>
|
||||
<div>
|
||||
<label>Channel:</label>
|
||||
<span>{{ betaGammaInfo.channel }}</span>
|
||||
</div>
|
||||
<div>
|
||||
Gamma Channel Width:
|
||||
<a-input-number :min="1" v-model="gammaChannelWidth" size="small"></a-input-number>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="energy">
|
||||
Energy: <span>{{ betaGammaInfo.energy }}</span>
|
||||
<label>Energy:</label>
|
||||
<span>{{ betaGammaInfo.energy }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="beta-gamma-chart">
|
||||
|
@ -38,28 +42,30 @@
|
|||
<div class="gamma-gated-beta-spectrum">
|
||||
<p>Gamma-gated Beta Spectrum: QC</p>
|
||||
<div class="content">
|
||||
<div class="gamma-gated-chart">
|
||||
<custom-chart
|
||||
ref="gammaGatedChartRef"
|
||||
:option="gammaGatedChartOption"
|
||||
@zr:click="handleGammaGatedSpectrumChartClick"
|
||||
/>
|
||||
<a-button type="primary" size="small" @click="handleSnapshot($refs.gammaGatedChartRef)"
|
||||
>Snapshot</a-button
|
||||
>
|
||||
<!-- 自定义tooltip,用于点击图表后的tooltip显示 -->
|
||||
<div
|
||||
v-if="tooltipVisible"
|
||||
class="custom-tool-tip"
|
||||
:style="{
|
||||
top: tooltipPosition.top + 'px',
|
||||
left: tooltipPosition.left + 'px',
|
||||
}"
|
||||
>
|
||||
<div class="channel">Channel: {{ tooltipChannel }}</div>
|
||||
<a-spin :spinning="isLoadingGammaGated">
|
||||
<div class="gamma-gated-chart">
|
||||
<custom-chart
|
||||
ref="gammaGatedChartRef"
|
||||
:option="gammaGatedChartOption"
|
||||
@zr:click="handleGammaGatedSpectrumChartClick"
|
||||
/>
|
||||
<a-button type="primary" size="small" @click="handleSnapshot($refs.gammaGatedChartRef)"
|
||||
>Snapshot</a-button
|
||||
>
|
||||
<!-- 自定义tooltip,用于点击图表后的tooltip显示 -->
|
||||
<div
|
||||
v-if="tooltipVisible"
|
||||
class="custom-tool-tip"
|
||||
:style="{
|
||||
top: tooltipPosition.top + 'px',
|
||||
left: tooltipPosition.left + 'px',
|
||||
}"
|
||||
>
|
||||
<div class="channel">Channel: {{ tooltipChannel }}</div>
|
||||
</div>
|
||||
<!-- tooltip结束 -->
|
||||
</div>
|
||||
<!-- tooltip结束 -->
|
||||
</div>
|
||||
</a-spin>
|
||||
</div>
|
||||
<div class="content channel-and-energy">
|
||||
<a-form-model layout="inline">
|
||||
|
@ -180,6 +186,7 @@ import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/
|
|||
import { graphic } from 'echarts'
|
||||
import { isNullOrUndefined } from '@/utils/util'
|
||||
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
|
||||
import axios from 'axios'
|
||||
|
||||
const initialBetaGammaChartOption = {
|
||||
grid: {
|
||||
|
@ -538,11 +545,6 @@ const newCalibrationFuncModel = {
|
|||
export default {
|
||||
mixins: [SampleDataMixin],
|
||||
components: { CustomChart, TitleOverBorder },
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
|
||||
|
@ -553,6 +555,7 @@ export default {
|
|||
|
||||
list: [],
|
||||
isLoading: false,
|
||||
isLoadingGammaGated: false,
|
||||
|
||||
gammaEnergy: [],
|
||||
gammaGatedBetaSpectrum: [],
|
||||
|
@ -596,9 +599,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
// if (this.sampleId) {
|
||||
this.getData()
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
handleExit() {
|
||||
|
@ -676,17 +677,27 @@ export default {
|
|||
// 获取右侧图表数据
|
||||
async getGammaGated(gammaChannel) {
|
||||
try {
|
||||
this.cancelLastRequest()
|
||||
const cancelToken = this.createCancelToken()
|
||||
this.isLoadingGammaGated = true
|
||||
const { sampleId, qcFileName } = this.newSampleData
|
||||
const {
|
||||
success,
|
||||
result: { data },
|
||||
message,
|
||||
} = await getAction('/spectrumAnalysis/getGammaGated', {
|
||||
gammaChannel,
|
||||
sampleId: this.sampleId,
|
||||
chartHeight: this.gammaEnergy.length,
|
||||
channelWidth: this.gammaChannelWidth,
|
||||
})
|
||||
} = await getAction(
|
||||
'/spectrumAnalysis/getGammaGated',
|
||||
{
|
||||
gammaChannel,
|
||||
sampleId,
|
||||
chartHeight: this.gammaEnergy.length,
|
||||
channelWidth: this.gammaChannelWidth,
|
||||
qcFileName,
|
||||
},
|
||||
cancelToken
|
||||
)
|
||||
if (success) {
|
||||
this.isLoadingGammaGated = false
|
||||
const max = Math.max(...data.map(({ y }) => y))
|
||||
|
||||
const { max: _max, interval } = splitAxis(max, 0, 4)
|
||||
|
@ -702,6 +713,19 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
cancelLastRequest() {
|
||||
if (this._cancelToken && typeof this._cancelToken == 'function') {
|
||||
this._cancelToken()
|
||||
}
|
||||
},
|
||||
|
||||
createCancelToken() {
|
||||
const cancelToken = new axios.CancelToken((c) => {
|
||||
this._cancelToken = c
|
||||
})
|
||||
return cancelToken
|
||||
},
|
||||
|
||||
// 绿框跟随鼠标移动
|
||||
handleBetaGammaChartMouseMove(param) {
|
||||
const { offsetX, offsetY } = param
|
||||
|
@ -974,6 +998,20 @@ p {
|
|||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.energy {
|
||||
span {
|
||||
color: #f00;
|
||||
}
|
||||
}
|
||||
|
||||
.channel-and-width,
|
||||
.energy {
|
||||
label {
|
||||
width: 60px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.beta-gamma-chart {
|
||||
height: 353px;
|
||||
position: relative;
|
||||
|
|
|
@ -434,11 +434,6 @@ const newCalibrationFuncModel = {
|
|||
export default {
|
||||
mixins: [SampleDataMixin],
|
||||
components: { CustomChart, TitleOverBorder },
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
this.columns = columns
|
||||
|
||||
|
@ -475,9 +470,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
// if (this.sampleId) {
|
||||
this.getData()
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
handleExit() {
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
>
|
||||
<a-tabs :animated="false" v-model="currTab">
|
||||
<a-tab-pane tab="Gamma Detector Calibration" key="gamma">
|
||||
<gamma-detector-calibration :sampleId="sampleId" />
|
||||
<gamma-detector-calibration />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="Beta Detector Calibration" key="beta">
|
||||
<beta-detector-calibration :sampleId="sampleId" />
|
||||
<beta-detector-calibration />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<div class="footer">
|
||||
|
@ -50,11 +50,6 @@ import TitleOverBorder from '@/views/spectrumAnalysis/components/TitleOverBorder
|
|||
export default {
|
||||
components: { BetaDetectorCalibration, GammaDetectorCalibration, TitleOverBorder },
|
||||
mixins: [ModalMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currTab: 'gamma',
|
||||
|
@ -68,6 +63,10 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
beforeModalOpen() {
|
||||
this.currTab = 'gamma'
|
||||
},
|
||||
|
||||
recalculateROICountsForChange(checkedVal) {
|
||||
this.recalculateROICountsFor = checkedVal
|
||||
this.checkFlag.checkSample = checkedVal.includes('sample') ? true : false
|
||||
|
|
|
@ -451,6 +451,14 @@ export default {
|
|||
methods: {
|
||||
beforeModalOpen() {
|
||||
this.customToolTip.visible = false
|
||||
const gammaSeries = this.gammaSpectrumChartOption.series
|
||||
gammaSeries[0].data = []
|
||||
gammaSeries[1].data = []
|
||||
|
||||
const betaSeries = this.betaSpectrumChartOption.series
|
||||
betaSeries[0].data = []
|
||||
betaSeries[1].data = []
|
||||
|
||||
this.getDetail()
|
||||
},
|
||||
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1200" title="File List">
|
||||
<search-form :items="formItems" v-model="queryParam" @search="searchQuery"></search-form>
|
||||
<custom-table
|
||||
:columns="columns"
|
||||
:list="dataSource"
|
||||
:loading="loading"
|
||||
:pagination="ipagination"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:selectionRows.sync="selectionRows"
|
||||
:scroll="{ y: 440 }"
|
||||
@change="handleTableChange"
|
||||
></custom-table>
|
||||
<div slot="custom-footer">
|
||||
<a-button type="primary" :loading="isComparing" @click="handleOk">Compare</a-button>
|
||||
<a-button @click="visible = false">Cancel</a-button>
|
||||
</div>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
width: '45%',
|
||||
align: 'left',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: 'UpdateDate',
|
||||
dataIndex: 'updateDate',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
title: 'Size',
|
||||
dataIndex: 'size',
|
||||
align: 'left'
|
||||
}
|
||||
]
|
||||
|
||||
const formItems = [
|
||||
{
|
||||
label: '',
|
||||
type: 'a-input',
|
||||
name: 'searchName',
|
||||
props: {
|
||||
placeholder: 'search...'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin, JeecgListMixin, SampleDataMixin],
|
||||
data() {
|
||||
this.columns = columns
|
||||
this.formItems = formItems
|
||||
|
||||
return {
|
||||
queryParam: {},
|
||||
selectedRowKeys: [],
|
||||
selectionRows: [],
|
||||
isComparing: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeModalOpen() {
|
||||
this.selectedRowKeys = []
|
||||
},
|
||||
|
||||
loadData(arg) {
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1
|
||||
}
|
||||
this.onClearSelected()
|
||||
|
||||
const params = this.getQueryParams() //查询条件
|
||||
const searchName = this.queryParam.searchName
|
||||
params.name = `${searchName ? `${searchName},` : ''}_S_`
|
||||
this.loading = true
|
||||
getAction('/spectrumFile/get', params)
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.dataSource.forEach((item, index) => {
|
||||
item.id = index
|
||||
})
|
||||
if (res.result.total) {
|
||||
this.ipagination.total = res.result.total
|
||||
} else {
|
||||
this.ipagination.total = 0
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
async handleOk() {
|
||||
if (!this.selectedRowKeys.length) {
|
||||
this.$message.warn('Please Select A File to Compare')
|
||||
return
|
||||
}
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const compareFileName = this.selectionRows[0].name
|
||||
|
||||
this.isComparing = true
|
||||
|
||||
const { success, result, message } = await getAction('/gamma/Compare', {
|
||||
fileName,
|
||||
compareFileName
|
||||
})
|
||||
if (success) {
|
||||
this.visible = false
|
||||
this.$emit('compareWithFile', result)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isComparing = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
|
@ -44,7 +44,7 @@
|
|||
:pagination="false"
|
||||
size="small"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 182 }"
|
||||
:scroll="{ y: 193 }"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:canDeselect="false"
|
||||
@rowClick="handleRowClick"
|
||||
|
@ -52,7 +52,16 @@
|
|||
<!-- 表格结束 -->
|
||||
<div class="operators">
|
||||
<div>
|
||||
<a-button type="primary">Call</a-button>
|
||||
<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>
|
||||
|
@ -107,7 +116,7 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import { getAction, postAction, putAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
@ -241,6 +250,7 @@ export default {
|
|||
|
||||
return {
|
||||
isLoading: false,
|
||||
isCalling: false,
|
||||
isSaving: false,
|
||||
|
||||
equation: '',
|
||||
|
@ -491,6 +501,43 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
// 点击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 {
|
||||
|
@ -526,8 +573,20 @@ export default {
|
|||
this.getData(item)
|
||||
},
|
||||
|
||||
handleSetToCurrent() {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -574,7 +633,7 @@ export default {
|
|||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 182px;
|
||||
height: 193px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
|
@ -582,7 +641,7 @@ export default {
|
|||
|
||||
::v-deep {
|
||||
.ant-table-placeholder {
|
||||
height: 183px;
|
||||
height: 194px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
:pagination="false"
|
||||
size="small"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 182 }"
|
||||
:scroll="{ y: 193 }"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:canDeselect="false"
|
||||
@rowClick="handleRowClick"
|
||||
|
@ -52,7 +52,16 @@
|
|||
<!-- 表格结束 -->
|
||||
<div class="operators">
|
||||
<div>
|
||||
<a-button type="primary">Call</a-button>
|
||||
<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>
|
||||
|
@ -102,7 +111,7 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import { getAction, postAction, putAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
@ -203,6 +212,7 @@ export default {
|
|||
this.columns = columns
|
||||
return {
|
||||
isLoading: false,
|
||||
isCalling: false,
|
||||
isSaving: false,
|
||||
|
||||
equation: '',
|
||||
|
@ -450,6 +460,43 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
// 点击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 {
|
||||
|
@ -485,8 +532,20 @@ export default {
|
|||
this.getData(item)
|
||||
},
|
||||
|
||||
handleSetToCurrent() {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -533,7 +592,7 @@ export default {
|
|||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 182px;
|
||||
height: 193px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
|
@ -541,7 +600,7 @@ export default {
|
|||
|
||||
::v-deep {
|
||||
.ant-table-placeholder {
|
||||
height: 183px;
|
||||
height: 194px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:selectionRows.sync="selectionRows"
|
||||
:multiple="true"
|
||||
:scroll="{ y: 'calc(100vh - 550px)' }"
|
||||
>
|
||||
</custom-table>
|
||||
<!-- 底部操作栏 -->
|
||||
|
@ -36,6 +37,7 @@
|
|||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import { getAction } from '../../../../api/manage'
|
||||
import moment from 'moment'
|
||||
import { cloneDeep } from 'lodash'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -51,7 +53,8 @@ const columns = [
|
|||
{
|
||||
title: 'Detector',
|
||||
align: 'left',
|
||||
dataIndex: 'detectorsName'
|
||||
dataIndex: 'detectorsName',
|
||||
width: 130
|
||||
},
|
||||
{
|
||||
title: 'Sample',
|
||||
|
@ -71,12 +74,14 @@ const columns = [
|
|||
{
|
||||
title: 'Col.Stop',
|
||||
align: 'left',
|
||||
dataIndex: 'collectStop'
|
||||
dataIndex: 'collectStop',
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: 'Acq.Start',
|
||||
align: 'left',
|
||||
dataIndex: 'acquisitionStart'
|
||||
dataIndex: 'acquisitionStart',
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: 'Acq.real',
|
||||
|
@ -197,7 +202,7 @@ export default {
|
|||
}
|
||||
this.selectedRowKeys = []
|
||||
this.visible = false
|
||||
this.$emit('loadSample', this.selectionRows)
|
||||
this.$emit('loadSample', cloneDeep(this.selectionRows))
|
||||
},
|
||||
|
||||
// 获取台站和探测器列表
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
:columns="daughterColumns"
|
||||
:list="daughterList"
|
||||
:pagination="false"
|
||||
:scroll="{ y: 123 }"
|
||||
:scroll="{ y: 84 }"
|
||||
rowKey="daughters"
|
||||
@rowDblClick="handleParentDBClick($event.daughters)"
|
||||
></custom-table>
|
||||
|
@ -77,7 +77,7 @@
|
|||
:columns="mainColumns"
|
||||
:dataSource="nuclLinesLibs"
|
||||
:pagination="false"
|
||||
:scroll="{ y: 175 }"
|
||||
:scroll="{ y: 330 }"
|
||||
>
|
||||
<template slot="keyLine" slot-scope="text">
|
||||
<span v-if="text == 1" class="green-check-mark"> </span>
|
||||
|
@ -115,6 +115,7 @@ import ModalMixin from '@/mixins/ModalMixin'
|
|||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
import { toFixed } from '@/utils/number'
|
||||
|
||||
// 右上角表格配置
|
||||
const daughterColumns = [
|
||||
|
@ -151,22 +152,34 @@ const mainColumns = [
|
|||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy',
|
||||
width: 100
|
||||
width: 100,
|
||||
customRender: text => {
|
||||
return toFixed(text, 3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Energy Uncert(%)',
|
||||
dataIndex: 'energyUncert',
|
||||
width: 120
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return text ? toFixed(text * 100, 6) : ''
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Yield',
|
||||
dataIndex: 'yield',
|
||||
width: 80
|
||||
width: 80,
|
||||
customRender: text => {
|
||||
return toFixed(text, 3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Yield Uncert(%)',
|
||||
dataIndex: 'yieldUncert',
|
||||
width: 120
|
||||
width: 120,
|
||||
customRender: text => {
|
||||
return toFixed(text, 3)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'KeyLine',
|
||||
|
@ -295,7 +308,7 @@ export default {
|
|||
&-list {
|
||||
padding: 5px;
|
||||
width: 150px;
|
||||
height: 516px;
|
||||
height: 632px;
|
||||
overflow: auto;
|
||||
background-color: #275466;
|
||||
|
||||
|
@ -339,7 +352,7 @@ export default {
|
|||
}
|
||||
|
||||
.content {
|
||||
height: 150px;
|
||||
height: 111px;
|
||||
}
|
||||
|
||||
.parents {
|
||||
|
@ -364,7 +377,7 @@ export default {
|
|||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 123px;
|
||||
height: 84px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
|
@ -373,7 +386,7 @@ export default {
|
|||
::v-deep {
|
||||
.ant-table {
|
||||
&-placeholder {
|
||||
height: 124px;
|
||||
height: 85px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -400,7 +413,7 @@ export default {
|
|||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 175px;
|
||||
height: 330px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
|
@ -409,7 +422,7 @@ export default {
|
|||
::v-deep {
|
||||
.ant-table {
|
||||
&-placeholder {
|
||||
height: 176px;
|
||||
height: 331px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
:pagination="false"
|
||||
size="small"
|
||||
:class="list.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 182 }"
|
||||
:scroll="{ y: 193 }"
|
||||
:selectedRowKeys.sync="selectedRowKeys"
|
||||
:canDeselect="false"
|
||||
@rowClick="handleRowClick"
|
||||
|
@ -52,7 +52,16 @@
|
|||
<!-- 表格结束 -->
|
||||
<div class="operators">
|
||||
<div>
|
||||
<a-button type="primary">Call</a-button>
|
||||
<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>
|
||||
|
@ -102,7 +111,7 @@
|
|||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import { getAction, postAction, putAction } from '@/api/manage'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { buildLineSeries } from '@/utils/chartHelper'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
@ -203,6 +212,7 @@ export default {
|
|||
this.columns = columns
|
||||
return {
|
||||
isLoading: false,
|
||||
isCalling: false,
|
||||
isSaving: false,
|
||||
|
||||
equation: '',
|
||||
|
@ -448,6 +458,43 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
// 点击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 {
|
||||
|
@ -483,8 +530,20 @@ export default {
|
|||
this.getData(item)
|
||||
},
|
||||
|
||||
handleSetToCurrent() {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +590,7 @@ export default {
|
|||
&.has-data {
|
||||
::v-deep {
|
||||
.ant-table-body {
|
||||
height: 182px;
|
||||
height: 193px;
|
||||
background-color: #06282a;
|
||||
}
|
||||
}
|
||||
|
@ -539,7 +598,7 @@ export default {
|
|||
|
||||
::v-deep {
|
||||
.ant-table-placeholder {
|
||||
height: 183px;
|
||||
height: 194px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
|
@ -2,15 +2,12 @@
|
|||
<custom-modal v-model="visible" :width="750" title="Sample Infomation">
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="sample-infomation">
|
||||
<a-form-model :labelCol="{ style: { width: '150px', textAlign: 'left' } }">
|
||||
<a-row>
|
||||
<a-col :span="12" v-for="(item, index) in columns" :key="index">
|
||||
<a-form-model-item :label="item.title">
|
||||
{{ data[item.key] }}
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
<a-row>
|
||||
<a-col class="sample-infomation-item" :span="12" v-for="(item, index) in columns" :key="index">
|
||||
<div class="label">{{ item.title }}:</div>
|
||||
<div class="value">{{ data[item.key] }}</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</a-spin>
|
||||
<div slot="custom-footer" style="text-align: center;">
|
||||
|
@ -25,7 +22,7 @@
|
|||
<script>
|
||||
import { getAction, getFileAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import { saveAs } from 'file-saver';
|
||||
import { saveAs } from 'file-saver'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
|
@ -125,19 +122,19 @@ export default {
|
|||
},
|
||||
// 导出到Excel
|
||||
handleExportToExcel() {
|
||||
this.fileName = ""
|
||||
this.fileName = ''
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
if (Object.keys(this.data).length > 0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
title: 'Please enter file name',
|
||||
content: h => <a-input v-model={_this.fileName} />,
|
||||
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"}},
|
||||
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
|
||||
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
|
||||
onOk() {
|
||||
console.log('Cancel');
|
||||
console.log('Cancel')
|
||||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
|
@ -147,17 +144,17 @@ export default {
|
|||
}
|
||||
getFileAction('/gamma/exportSampleInformation', params).then(res => {
|
||||
if (res.code && res.code == 500) {
|
||||
this.$message.warning("This operation fails. Contact your system administrator")
|
||||
this.$message.warning('This operation fails. Contact your system administrator')
|
||||
} else {
|
||||
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
|
||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
saveAs(blob, `${_this.fileName}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning("No downloadable data")
|
||||
this.$message.warning('No downloadable data')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -169,8 +166,14 @@ export default {
|
|||
background-color: #143644;
|
||||
padding: 20px;
|
||||
|
||||
.ant-form-item {
|
||||
margin-bottom: 0;
|
||||
&-item {
|
||||
display: flex;
|
||||
height: 30px;
|
||||
|
||||
.label {
|
||||
width: 150px;
|
||||
color: #5b9cba;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction } from '@/api/manage'
|
||||
import { getAction, putAction } from '@/api/manage'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
|
@ -16,13 +16,13 @@ export default {
|
|||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
comments: ''
|
||||
comments: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -30,18 +30,20 @@ export default {
|
|||
beforeModalOpen() {
|
||||
if (this.isAdd) {
|
||||
this.comments = ''
|
||||
this.getTotalComment()
|
||||
} else {
|
||||
this.getInfo()
|
||||
}
|
||||
},
|
||||
|
||||
// View接口
|
||||
async getInfo() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/viewComment', {
|
||||
sampleId,
|
||||
fileName
|
||||
fileName,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
|
@ -53,10 +55,35 @@ export default {
|
|||
console.error(error)
|
||||
}
|
||||
},
|
||||
handleOk() {
|
||||
console.log('%c [ ]-26', 'font-size:13px; background:pink; color:#bf2c9f;', this.comments)
|
||||
}
|
||||
}
|
||||
|
||||
// Add 获取 Comment 接口
|
||||
async getTotalComment() {
|
||||
try {
|
||||
this.isLoading = true
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const { success, result, message } = await getAction('/gamma/viewGeneralComment', {
|
||||
fileName,
|
||||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
this.comments = result
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
async handleOk() {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
const { success, message } = await putAction(`/gamma/addComment?fileName=${fileName}&comment=${this.comments}`)
|
||||
if (!success) {
|
||||
this.$message.error(message)
|
||||
throw new Error(message)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
<template>
|
||||
<a-menu class="spectra-list-in-menu">
|
||||
<a-menu-item class="spectra-list-in-menu-item" v-for="(item,index) in list" :key="`${item.sampleId}${index}`" @click="handleClick(item)">
|
||||
<a-menu-item
|
||||
class="spectra-list-in-menu-item"
|
||||
v-for="(item, index) in list"
|
||||
:key="`${item.sampleId}${index}`"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<span class="checkbox">
|
||||
<a-icon v-if="item.checked" type="check" style="color: #0de30d" />
|
||||
</span>
|
||||
<span class="name">{{ item.inputFileName }}</span>
|
||||
<a-icon type="delete" @click.stop="handleRemove(item)" />
|
||||
<a-icon type="delete" @click.stop="handleRemove(item, index)" />
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
|
@ -26,25 +31,25 @@ export default {
|
|||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
handleRemove(spectraItem) {
|
||||
const index = this.list.findIndex(item => item == spectraItem)
|
||||
this.list.splice(index, 1)
|
||||
handleRemove(spectraItem, index) {
|
||||
// 如果删除了一个选中的
|
||||
if (spectraItem.checked) {
|
||||
if (index == 0) {
|
||||
// 如果是第一个,则选中下一个
|
||||
this.handleClick(this.list[0])
|
||||
} else {
|
||||
// 如果不是第一个,则选中上一个
|
||||
// // 如果是倒数第一个,则选中上一个
|
||||
if (index == this.list.length - 1) {
|
||||
this.handleClick(this.list[index - 1])
|
||||
}
|
||||
// 否则选中下一个
|
||||
else {
|
||||
this.handleClick(this.list[index + 1])
|
||||
}
|
||||
}
|
||||
this.list.splice(index, 1)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
list(newVal) {
|
||||
if (newVal.length) {
|
||||
if (newVal.length && !newVal.find(item => item.checked)) {
|
||||
this.handleClick(newVal[0])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ export default {
|
|||
align-items: center;
|
||||
width: 150px;
|
||||
height: 30px;
|
||||
cursor: default;
|
||||
cursor: pointer;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 2px;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,7 @@
|
|||
<a-button type="primary">{{ operation.title }}</a-button>
|
||||
<div slot="overlay">
|
||||
<template v-for="(child, index) in operation.children">
|
||||
<component :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
|
||||
<component v-if="child.show !== false" :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
|
||||
<template v-for="item in child.children">
|
||||
<component v-if="item.show !== false" :is="item.type" :key="item.title" @click="item.handler">
|
||||
{{ item.title }}
|
||||
|
@ -89,10 +89,6 @@
|
|||
<korsum-modal v-model="korsumModalShow" />
|
||||
<!-- Korsum 弹窗结束 -->
|
||||
|
||||
<!-- ReProcessing 弹窗开始 -->
|
||||
<re-processing-modal v-model="reprocessingModalVisible" />
|
||||
<!-- ReProcessing 弹窗结束 -->
|
||||
|
||||
<!-- Zero Time 弹窗开始 -->
|
||||
<zero-time-modal v-model="zeroTimeModalVisible" :sampleId="sampleData.sampleId" />
|
||||
<!-- Zero Time 弹窗结束 -->
|
||||
|
@ -162,7 +158,6 @@
|
|||
<!-- Beta-Gamma 的Energy Calibration开始 -->
|
||||
<beta-gamma-energy-calibration-modal
|
||||
v-model="betaGammaEnergyCalibrationModalVisible"
|
||||
:sampleId="this.sampleData.sampleId"
|
||||
@sendInfo="getCheckFlag"
|
||||
/>
|
||||
<!-- Beta-Gamma 的Energy Calibration结束 -->
|
||||
|
@ -209,7 +204,6 @@ import SaveSettingModal from './components/Modals/SaveSettingModal.vue'
|
|||
import AnalyzeSettingModal from './components/Modals/AnalyzeSettingModal.vue'
|
||||
import AnalyzeInteractiveToolModal from './components/Modals/AnalyzeInteractiveToolModal/index.vue'
|
||||
import KorsumModal from './components/Modals/KorsumModal.vue'
|
||||
import ReProcessingModal from './components/Modals/ReProcessingModal/index.vue'
|
||||
import ZeroTimeModal from './components/Modals/ZeroTimeModal.vue'
|
||||
import EfficiencyCalibrationModal from './components/Modals/EfficiencyCalibrationModal.vue'
|
||||
import EnergyCalibrationModal from './components/Modals/EnergyCalibrationModal.vue'
|
||||
|
@ -235,6 +229,7 @@ import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals
|
|||
import StripModal from './components/Modals/StripModal.vue'
|
||||
import AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
|
||||
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
|
||||
// 分析类型
|
||||
const ANALYZE_TYPE = {
|
||||
|
@ -255,7 +250,6 @@ export default {
|
|||
AnalyzeSettingModal,
|
||||
AnalyzeInteractiveToolModal,
|
||||
KorsumModal,
|
||||
ReProcessingModal,
|
||||
ZeroTimeModal,
|
||||
EfficiencyCalibrationModal,
|
||||
EnergyCalibrationModal,
|
||||
|
@ -313,7 +307,6 @@ export default {
|
|||
saveSettingModalVisible: false, // 保存设置弹窗
|
||||
|
||||
analyzeConfigureModalVisible: false, // 分析设置弹窗
|
||||
reprocessingModalVisible: false, // 重新分析弹窗
|
||||
analyzeInteractiveToolModalVisible: false, // 分析工具弹窗
|
||||
zeroTimeModalVisible: false, // Zero Time 弹窗
|
||||
korsumModalShow: false, // Korsum 弹窗
|
||||
|
@ -388,12 +381,12 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.$bus.$on('reanalyse', this.handleReanalyse)
|
||||
this.loadSelectedSample({
|
||||
sampleId: 426530,
|
||||
sampleType: 'G',
|
||||
dbName: 'auto',
|
||||
inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD',
|
||||
})
|
||||
// this.loadSelectedSample({
|
||||
// sampleId: 426530,
|
||||
// sampleType: 'G',
|
||||
// dbName: 'auto',
|
||||
// inputFileName: 'CAX05_001-20230731_1528_S_FULL_37563.6.PHD',
|
||||
// })
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
|
@ -438,7 +431,7 @@ export default {
|
|||
})
|
||||
arr.forEach((item) => {
|
||||
item.dbName = ''
|
||||
item.sampleId = ''
|
||||
item.sampleId = null
|
||||
item.inputFileName = item.sampleFileName
|
||||
item.sampleType = item.sampleSystemType
|
||||
})
|
||||
|
@ -475,10 +468,29 @@ export default {
|
|||
* 保存结果到数据库
|
||||
* @param { 'all' | 'current' } type
|
||||
*/
|
||||
handleSaveResultsToDB(type) {
|
||||
console.log('%c [ saveResultsToDB ]-157', 'font-size:13px; background:pink; color:#bf2c9f;', type)
|
||||
if (type === 'current') {
|
||||
this.handleSaveResultsToDB_Cuurrent()
|
||||
async handleSaveResultsToDB(type) {
|
||||
if (this.isBetaGamma) {
|
||||
if (type === 'current') {
|
||||
this.handleSaveResultsToDB_Cuurrent()
|
||||
}
|
||||
} else if (this.isGamma) {
|
||||
if (type == 'current') {
|
||||
const hideLoading = this.$message.loading('Saving...', 0)
|
||||
try {
|
||||
const { success, message } = await getAction('/gamma/saveToDB', {
|
||||
fileName: this.sampleData.inputFileName
|
||||
})
|
||||
if (success) {
|
||||
this.$message.success('Save Success')
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSaveResultsToDB_Cuurrent() {
|
||||
|
@ -623,8 +635,9 @@ export default {
|
|||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll,
|
||||
title: 'Compare',
|
||||
show: this.isGamma,
|
||||
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(),
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
|
@ -638,6 +651,11 @@ export default {
|
|||
show: this.isGamma,
|
||||
handler: () => (this.ftransltModalVisible = true),
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Clean All',
|
||||
handler: this.handleCleanAll,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -660,8 +678,7 @@ export default {
|
|||
if (spectra) {
|
||||
this.loadSelectedSample(spectra)
|
||||
} else {
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
this.handleCleanAll()
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -673,6 +690,7 @@ export default {
|
|||
children: [
|
||||
{
|
||||
type: 'MultiLevelMenu',
|
||||
show: this.isBetaGamma || this.isGamma,
|
||||
attrs: {
|
||||
children: [
|
||||
{
|
||||
|
@ -736,9 +754,9 @@ export default {
|
|||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'ReProcessing',
|
||||
title: 'Reprocessing',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.reprocessingModalVisible = true),
|
||||
handler: () => this.$refs.gammaAnalysisRef.reProcessing(),
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
|
@ -824,7 +842,6 @@ export default {
|
|||
},
|
||||
{
|
||||
title: 'NUCLIDELIBRARY',
|
||||
show: !this.isBetaGamma,
|
||||
children: [
|
||||
{
|
||||
type: 'a-menu',
|
||||
|
@ -832,11 +849,13 @@ export default {
|
|||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Nuclide Library',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.nuclideLibraryModalVisible = true),
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Config User Library',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.configUserLibModalVisible = true),
|
||||
},
|
||||
],
|
||||
|
@ -1024,6 +1043,7 @@ export default {
|
|||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Automatic Analysis Log',
|
||||
show: this.isBetaGamma || this.isGamma,
|
||||
handler: () => {
|
||||
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
|
||||
this.autoAnalysisMogModalVisible = true
|
||||
|
|
167
src/views/spectrumAnalysis/settings.js
Normal file
167
src/views/spectrumAnalysis/settings.js
Normal file
|
@ -0,0 +1,167 @@
|
|||
import { buildLineSeries } from "@/utils/chartHelper"
|
||||
|
||||
export const GammaOptions = {
|
||||
option: {
|
||||
grid: {
|
||||
top: 40,
|
||||
left: 60,
|
||||
right: 50,
|
||||
containLabel: true
|
||||
},
|
||||
title: {
|
||||
text: '',
|
||||
left: 'center',
|
||||
bottom: 10,
|
||||
textStyle: {
|
||||
color: '#8FD4F8',
|
||||
rich: {
|
||||
a: {
|
||||
padding: [0, 20, 0, 0],
|
||||
fontSize: 16
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
lineStyle: {
|
||||
color: '#3CAEBB',
|
||||
width: 1,
|
||||
type: 'solid'
|
||||
}
|
||||
},
|
||||
formatter: undefined,
|
||||
className: 'figure-chart-option-tooltip'
|
||||
},
|
||||
xAxis: {
|
||||
name: 'Channel',
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 16,
|
||||
align: 'right',
|
||||
verticalAlign: 'top',
|
||||
padding: [30, 0, 0, 0]
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
animation: false,
|
||||
axisLabel: {
|
||||
formatter: value => {
|
||||
return parseInt(value)
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
name: 'Counts',
|
||||
type: 'value',
|
||||
nameTextStyle: {
|
||||
color: '#8FD4F8',
|
||||
fontSize: 16
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(173, 230, 238, .2)'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
min: 1,
|
||||
max: 'dataMax',
|
||||
animation: false,
|
||||
axisLabel: {
|
||||
formatter: value => {
|
||||
return value.toFixed(1)
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [],
|
||||
brush: {}
|
||||
},
|
||||
// 缩略图配置
|
||||
thumbnailOption: {
|
||||
grid: {
|
||||
top: 0,
|
||||
left: 5,
|
||||
right: 5,
|
||||
bottom: 0
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
min: 1,
|
||||
max: 'dataMax'
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisLabel: {
|
||||
show: false
|
||||
},
|
||||
min: 1,
|
||||
max: 'dataMax'
|
||||
},
|
||||
series: [
|
||||
buildLineSeries('Spectrum', [], '#fff', {
|
||||
silent: true,
|
||||
markLine: {
|
||||
silent: true,
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#1397a3',
|
||||
width: 1
|
||||
},
|
||||
data: []
|
||||
}
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
export const graphAssistance = {
|
||||
axisType: 'Channel',
|
||||
spectrumType: 'Lines',
|
||||
Baseline: true,
|
||||
SCAC: true,
|
||||
Lc: true,
|
||||
}
|
Loading…
Reference in New Issue
Block a user