Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
f9472a529f
|
@ -6,7 +6,7 @@ import * as echarts from 'echarts'
|
|||
import 'echarts-gl'
|
||||
|
||||
const events = ['click', 'brushEnd']
|
||||
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick']
|
||||
const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu']
|
||||
export default {
|
||||
props: {
|
||||
option: {
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,7 +251,6 @@ export default {
|
|||
if (success) {
|
||||
this.sampleDetail = result
|
||||
this.changeChartByType('sample')
|
||||
this.isLoading = false
|
||||
this.$emit('getFiles', {
|
||||
detFileName: result.detBg.fileName,
|
||||
gasFileName: result.gasBg.fileName,
|
||||
|
@ -262,6 +261,8 @@ export default {
|
|||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
async getSampleDetail_file() {
|
||||
|
@ -334,6 +335,7 @@ export default {
|
|||
} = this.sampleDetail[this.spectraType]
|
||||
const {
|
||||
XeData, // 右下角Result Display
|
||||
savedAnalysisResult,
|
||||
} = this.sampleDetail
|
||||
|
||||
this.spectrumData = spectrumData
|
||||
|
@ -350,9 +352,9 @@ export default {
|
|||
this.betaProjectedData = betaProjectedData
|
||||
this.betaEnergyData = betaEnergyData
|
||||
|
||||
this.resultDisplay = XeData
|
||||
this.resultDisplay = this.resultDisplay.length > 0 ? this.resultDisplay : XeData
|
||||
|
||||
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode)
|
||||
this.$emit('sendInfo', this.resultDisplay, this.spectrumData.stationCode, savedAnalysisResult)
|
||||
|
||||
this.qcFlags = {
|
||||
AcqTimeBtn,
|
||||
|
@ -434,6 +436,7 @@ export default {
|
|||
watch: {
|
||||
sample: {
|
||||
handler(newVal, oldVal) {
|
||||
this.resultDisplay = []
|
||||
if (newVal.sampleId) {
|
||||
this.getSampleDetail()
|
||||
} else {
|
||||
|
@ -445,8 +448,8 @@ export default {
|
|||
},
|
||||
analyseCurrentSpectrum: {
|
||||
handler(newVal, oldVal) {
|
||||
this.currResultDisplay = newVal.XeData
|
||||
this.resultDisplay = newVal.XeData
|
||||
// this.currResultDisplay = newVal.XeData
|
||||
this.resultDisplay = newVal.XeData || []
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
|
|
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)
|
||||
})
|
||||
}
|
|
@ -24,8 +24,8 @@
|
|||
@brushEnd="handleBrushEnd"
|
||||
/>
|
||||
<div class="bar">
|
||||
<color-palette v-model="currCount" :maxValue="4" />
|
||||
<div>{{ currCount + 1 }}</div>
|
||||
<color-palette v-model="currCount" />
|
||||
<div>{{ currCount }}</div>
|
||||
<div class="bar-main"></div>
|
||||
<div>0</div>
|
||||
</div>
|
||||
|
@ -322,8 +322,7 @@ export default {
|
|||
return {
|
||||
active: 0,
|
||||
|
||||
maxCount: 15, // count的最大值
|
||||
currCount: 15,
|
||||
currCount: 50,
|
||||
|
||||
twoDOption,
|
||||
threeDSurfaceOption,
|
||||
|
@ -359,7 +358,7 @@ export default {
|
|||
this.emitRangeChange([0, 256, 0, 256])
|
||||
this.reDrawRect()
|
||||
|
||||
this.rangeScatter()
|
||||
this.buildScatterList()
|
||||
},
|
||||
|
||||
// 点击ROI
|
||||
|
@ -439,26 +438,33 @@ export default {
|
|||
|
||||
this.reDrawRect()
|
||||
|
||||
this.rangeScatter()
|
||||
this.buildScatterList()
|
||||
}
|
||||
|
||||
this.clearBrush(chart)
|
||||
},
|
||||
|
||||
/**
|
||||
* 因scatterGL 不受axis中max和min的控制,手动处理溢出部分
|
||||
*/
|
||||
rangeScatter() {
|
||||
// 构造scatter列表
|
||||
buildScatterList() {
|
||||
const {
|
||||
xAxis: { min: minX, max: maxX },
|
||||
yAxis: { min: minY, max: maxY }
|
||||
} = this.twoDOption
|
||||
|
||||
const data = this.histogramDataList
|
||||
this.twoDOption.series.data = this.histogramDataDList
|
||||
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
|
||||
.map(({ b, g, c }) => [b, g, c])
|
||||
.map(({ b, g, c }) => this.buildScatterItem(b, g, c))
|
||||
},
|
||||
|
||||
this.twoDOption.series.data = data
|
||||
// 构造一个scatter 的点
|
||||
buildScatterItem(xAxis, yAxis, count) {
|
||||
const { r, g, b } = this.interpolateColor(1 - (count / this.currCount))
|
||||
return {
|
||||
value: [xAxis, yAxis],
|
||||
itemStyle: {
|
||||
color: `rgb(${r}, ${g}, ${b})`
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 通知上层范围改变
|
||||
|
@ -482,7 +488,7 @@ export default {
|
|||
}
|
||||
|
||||
this.reDrawRect()
|
||||
this.rangeScatter()
|
||||
this.buildScatterList()
|
||||
},
|
||||
|
||||
// 重绘矩形框区域
|
||||
|
@ -713,7 +719,10 @@ export default {
|
|||
},
|
||||
|
||||
// 颜色插值算法
|
||||
interpolateColor(color1, color2, percentage) {
|
||||
interpolateColor(percentage) {
|
||||
const color1 = { r: 255, g: 0, b: 0 },
|
||||
color2 = { r: 255, g: 255, b: 255 }
|
||||
|
||||
const r = color1.r + (color2.r - color1.r) * percentage
|
||||
const g = color1.g + (color2.g - color1.g) * percentage
|
||||
const b = color1.b + (color2.b - color1.b) * percentage
|
||||
|
@ -723,10 +732,9 @@ export default {
|
|||
watch: {
|
||||
// 2D 图表
|
||||
histogramDataList: {
|
||||
handler(newVal) {
|
||||
handler() {
|
||||
this.active = 0
|
||||
this.twoDOption.series.data = newVal.filter(item => item.c).map(item => [item.b, item.g, item.c]) // 设置2D Scatter数据
|
||||
this.rangeScatter()
|
||||
this.buildScatterList()
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
|
@ -759,18 +767,8 @@ export default {
|
|||
},
|
||||
|
||||
currCount: {
|
||||
handler(val) {
|
||||
if (val <= this.maxCount) {
|
||||
const { r, g, b } = this.interpolateColor(
|
||||
{ r: 255, g: 0, b: 0 },
|
||||
{ r: 255, g: 255, b: 255 },
|
||||
val / this.maxCount
|
||||
)
|
||||
|
||||
this.twoDOption.series.itemStyle.color = `rgb(${r}, ${g}, ${b})`
|
||||
} else {
|
||||
this.twoDOption.series.itemStyle.color = '#fff'
|
||||
}
|
||||
handler() {
|
||||
this.buildScatterList()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
|
|
@ -23,16 +23,19 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const startRange = [0, 36], // 1 所在的角度范围
|
||||
endRange = [324, 360], // 50 所在的角度范围
|
||||
angleRange = [startRange]
|
||||
for (let i = 0; i <= 47; i++) {
|
||||
angleRange.push([36 + i * 6, 36 + (i + 1) * 6])
|
||||
}
|
||||
angleRange.push(endRange)
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
maxValue: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
circleWidth: {
|
||||
type: Number,
|
||||
default: 26
|
||||
|
@ -48,7 +51,8 @@ export default {
|
|||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
isMouseDown: false
|
||||
isMouseDown: false,
|
||||
angleRange
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -79,16 +83,23 @@ export default {
|
|||
},
|
||||
|
||||
setPositionByMouseEvent(offsetX, offsetY) {
|
||||
const { degree, radian } = this.getDegree([offsetX, offsetY])
|
||||
for (let index = 0; index < this.range; index++) {
|
||||
if (degree >= this.perDegree * index && degree < this.perDegree * (index + 1)) {
|
||||
this.$emit('input', index)
|
||||
const { angle } = this.getDegree([offsetX, offsetY])
|
||||
for (let i = 0; i < this.angleRange.length; i++) {
|
||||
const [start, end] = this.angleRange[i]
|
||||
if (angle >= start && angle <= end) {
|
||||
const center = (start + end) / 2
|
||||
const radian = (center * Math.PI) / 180
|
||||
this.setDotPosition(radian)
|
||||
this.$emit('input', i + 1)
|
||||
break
|
||||
}
|
||||
}
|
||||
this.setDotPosition(radian)
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置圆点位置
|
||||
* @param {*} radian
|
||||
*/
|
||||
setDotPosition(radian) {
|
||||
const circleRadius = this.circleWidth / 2 // 半径
|
||||
const dotRadius = circleRadius - this.dotWidth // 绘制圆点时的半径
|
||||
|
@ -102,6 +113,7 @@ export default {
|
|||
|
||||
/**
|
||||
* 根据圆心和某个点,计算从圆心到该点的角度
|
||||
* @returns { { radian: number; angle: number; } } radian: 弧度 angle: 角度
|
||||
*/
|
||||
getDegree(point) {
|
||||
// 计算两个点在 x 轴上的差值和在 y 轴上的差值
|
||||
|
@ -112,13 +124,13 @@ export default {
|
|||
const deltaY = pointY - circleRadius
|
||||
// 使用反正切函数计算角度(弧度)
|
||||
const radian = Math.atan2(deltaX, deltaY)
|
||||
let degree = radian * (180 / Math.PI)
|
||||
if (degree < 0) {
|
||||
degree = 360 + degree
|
||||
let angle = radian * (180 / Math.PI)
|
||||
if (angle < 0) {
|
||||
angle = 360 + angle
|
||||
}
|
||||
return {
|
||||
radian,
|
||||
degree
|
||||
angle
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -126,22 +138,13 @@ export default {
|
|||
watch: {
|
||||
value: {
|
||||
handler(newVal) {
|
||||
const degree = newVal * this.perDegree
|
||||
const radian = (degree * Math.PI) / 180 // 角度转弧度
|
||||
|
||||
const [start, end] = this.angleRange[newVal - 1]
|
||||
const center = (start + end) / 2
|
||||
const radian = (center * Math.PI) / 180 // 角度转弧度
|
||||
this.setDotPosition(radian)
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
range() {
|
||||
return this.maxValue > 50 ? this.maxValue : 50
|
||||
},
|
||||
|
||||
perDegree() {
|
||||
return 360 / this.range
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -476,7 +476,8 @@ export default {
|
|||
isAccepting: false,
|
||||
isReploting: false,
|
||||
|
||||
operationStack: [] // 操作记录
|
||||
operationStack: [], // 操作记录
|
||||
replotNeeded: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -563,6 +564,7 @@ export default {
|
|||
this.btnGroupType = 1
|
||||
this.opts.notMerge = false
|
||||
this.isFitting = false
|
||||
this.replotNeeded = false
|
||||
this.$nextTick(() => {
|
||||
this.option.brush = { toolbox: [] }
|
||||
this.selectedKeys = []
|
||||
|
@ -611,13 +613,12 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
const selectedRow = this.list[index]
|
||||
|
||||
this.selectedKeys = [selectedRow.index]
|
||||
|
||||
this.getSelPosNuclide(selectedRow)
|
||||
|
||||
this.selectedTableItem = selectedRow
|
||||
if (this.list.length) {
|
||||
const selectedRow = this.list[index]
|
||||
this.selectedKeys = [selectedRow.index]
|
||||
this.getSelPosNuclide(selectedRow)
|
||||
this.selectedTableItem = selectedRow
|
||||
}
|
||||
|
||||
// 如果点击了Fit按钮
|
||||
if (this.isFitting) {
|
||||
|
@ -1027,6 +1028,7 @@ export default {
|
|||
if (this.btnGroupType == 1) {
|
||||
this.btnGroupType = 2
|
||||
this.baseCtrls_Copy = cloneDeep(this.BaseCtrls)
|
||||
this.replotNeeded = false
|
||||
|
||||
// 供编辑的白色基线
|
||||
const baseLineEditSeries = buildLineSeries(
|
||||
|
@ -1100,6 +1102,7 @@ export default {
|
|||
|
||||
// 重新生成基线
|
||||
redrawBaseLine() {
|
||||
this.replotNeeded = true
|
||||
try {
|
||||
console.time('updateBaseLine')
|
||||
const res = updateBaseLine(JSON.stringify(this.baseCtrls_Copy))
|
||||
|
@ -1117,7 +1120,7 @@ export default {
|
|||
|
||||
// 重绘Peaks
|
||||
redrawPeaks(peakList) {
|
||||
this.option.series = this.option.series.filter((item) => {
|
||||
this.option.series = this.option.series.filter(item => {
|
||||
return !item.name.includes('Peak_')
|
||||
})
|
||||
this.option.series.push(...this.buildPeaks(peakList))
|
||||
|
@ -1257,13 +1260,16 @@ export default {
|
|||
|
||||
// 将原先的基线和控制点移动到新位置
|
||||
async handleReplot() {
|
||||
if (!this.replotNeeded) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const { inputFileName: fileName } = this.sampleData
|
||||
this.isReploting = true
|
||||
const { success, result, message } = await postAction('/gamma/replotBaseLine', {
|
||||
...this.baseCtrls_Copy,
|
||||
fileName,
|
||||
replotNeeded: true
|
||||
replotNeeded: this.replotNeeded
|
||||
})
|
||||
if (success) {
|
||||
const { chartData, peakSet, shapeData } = result
|
||||
|
@ -1295,6 +1301,7 @@ export default {
|
|||
})
|
||||
|
||||
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
|
||||
this.replotNeeded = false
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
|
|
@ -52,16 +52,43 @@ export default {
|
|||
url = '/spectrumAnalysis/viewRRR'
|
||||
break
|
||||
}
|
||||
console.log(this.extraData)
|
||||
try {
|
||||
this.content = ''
|
||||
this.isLoading = true
|
||||
const { sampleId, inputFileName: fileName } = this.sampleData
|
||||
const method = this.type == 4? postAction : getAction
|
||||
const res = await method(url, {
|
||||
console.log(this.sampleData)
|
||||
const {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.extraData,
|
||||
})
|
||||
inputFileName: fileName,
|
||||
dbName,
|
||||
detFileName,
|
||||
gasFileName,
|
||||
qcFileName,
|
||||
sampleFileName,
|
||||
} = this.sampleData
|
||||
// const method = this.type == 4 ? postAction : getAction
|
||||
let res = null
|
||||
if (this.type == 4) {
|
||||
let params = {
|
||||
dbName,
|
||||
sampleId,
|
||||
sampleData: this.extraData.sampleData,
|
||||
gasBgData: this.extraData.GasBgData,
|
||||
detBgData: this.extraData.DetBgData,
|
||||
qcData: this.extraData.QCData,
|
||||
sampleFileName,
|
||||
gasFileName,
|
||||
detFileName,
|
||||
qcFileName,
|
||||
}
|
||||
res = await postAction(url, params)
|
||||
} else {
|
||||
res = await getAction(url, {
|
||||
sampleId,
|
||||
fileName,
|
||||
...this.extraData,
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof res == 'string') {
|
||||
this.content = res
|
||||
|
|
|
@ -110,6 +110,8 @@ export default {
|
|||
item.mdc = item.mdc.toFixed(6)
|
||||
})
|
||||
this.$emit('sendXeData', res.result.XeData)
|
||||
this.$message.success('Analyse Success!')
|
||||
this.visible = false
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
|
|
|
@ -30,9 +30,21 @@
|
|||
<!-- 两个图表开始 -->
|
||||
<div class="gamma-beta-spectrum-sample border">
|
||||
<div class="gamma-spectrum-sample">
|
||||
<div class="title">Gamma Spectrum:Sample</div>
|
||||
<div class="title">
|
||||
<div>Gamma Spectrum:Sample</div>
|
||||
<div class="total-counts">
|
||||
<span>Total Counts:</span>
|
||||
<span class="count-1">{{ totalCount[0] }}</span>
|
||||
<span class="count-2">{{ totalCount[1] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart border">
|
||||
<custom-chart ref="gammaSpectrumChart" :option="gammaSpectrumChartOption" @zr:click="handleChartClick" />
|
||||
<custom-chart
|
||||
ref="gammaSpectrumChart"
|
||||
:option="gammaSpectrumChartOption"
|
||||
@zr:click="handleChartClick($event, true)"
|
||||
@zr:contextmenu="handleChartClick($event, false)"
|
||||
/>
|
||||
<!-- 自定义tooltip,用于点击图表后的tooltip显示 -->
|
||||
<div
|
||||
v-if="customToolTip.visible"
|
||||
|
@ -45,6 +57,17 @@
|
|||
<div class="channel">Channel: {{ customToolTip.channel }}</div>
|
||||
<div class="channel">Energy: {{ customToolTip.energy }}</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="customToolTip2.visible"
|
||||
class="custom-tool-tip"
|
||||
:style="{
|
||||
top: customToolTip2.top + 'px',
|
||||
left: customToolTip2.left + 'px'
|
||||
}"
|
||||
>
|
||||
<div class="channel">Channel: {{ customToolTip2.channel }}</div>
|
||||
<div class="channel">Energy: {{ customToolTip2.energy }}</div>
|
||||
</div>
|
||||
<!-- tooltip结束 -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -66,33 +89,35 @@
|
|||
<div class="title">Gamma Window Setting</div>
|
||||
<div class="content">
|
||||
<div class="label">Gamma Window Begin:</div>
|
||||
<a-input-number size="small"></a-input-number> Channel
|
||||
<a-input-number size="small" v-model="model.windowBegin" @change="calculateTotalCount"></a-input-number>
|
||||
Channel
|
||||
<div class="label">Gamma Window End:</div>
|
||||
<a-input-number size="small"></a-input-number> Channel
|
||||
<a-input-number size="small" v-model="model.windowEnd" @change="calculateTotalCount"></a-input-number>
|
||||
Channel
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="title">Parameter Setting</div>
|
||||
<div class="content">
|
||||
<div class="label">Min of Energy:</div>
|
||||
<a-input-number size="small"></a-input-number> keV
|
||||
<a-input-number size="small" v-model="model.minEnergy"></a-input-number> keV
|
||||
<div class="label">Half Life:</div>
|
||||
<a-input-number size="small"></a-input-number> Day
|
||||
<a-input-number size="small" v-model="model.halfLife"></a-input-number> Day
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="title">Function of Fitting</div>
|
||||
<div class="content">
|
||||
<a-radio-group v-model="model.fittingType">
|
||||
<a-radio value="1">Linear</a-radio>
|
||||
<a-radio value="2">2-polynomial</a-radio>
|
||||
<a-radio-group v-model="model.fitType" @change="handleFuncChange">
|
||||
<a-radio value="liner">Linear</a-radio>
|
||||
<a-radio value="poly2">2-polynomial</a-radio>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btns">
|
||||
<a-button type="primary">Analyse</a-button>
|
||||
<a-button type="primary" :loading="isAnalysing" @click="handleAnalyse">Analyse</a-button>
|
||||
<a-button @click="visible = false">Exit</a-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -110,8 +135,10 @@
|
|||
:class="tableList.length ? 'has-data' : ''"
|
||||
:scroll="{ y: 101 }"
|
||||
>
|
||||
<template slot="delete">
|
||||
<a-button type="link" size="small">Delete</a-button>
|
||||
<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-button>
|
||||
</template>
|
||||
</a-table>
|
||||
<!-- 表格结束 -->
|
||||
|
@ -132,25 +159,20 @@
|
|||
<!-- 右下角信息开始 -->
|
||||
<div class="info">
|
||||
<title-over-border title="Function of Fitting">
|
||||
<template v-if="model.fittingType == '1'">
|
||||
y = ax + b
|
||||
</template>
|
||||
<template v-if="model.fittingType == '2'">
|
||||
y = axx + bx + c
|
||||
</template>
|
||||
{{ currFunction }}
|
||||
</title-over-border>
|
||||
<title-over-border title="Xe Activity (Bq)">
|
||||
<div class="xe-activity">
|
||||
<div class="item">
|
||||
<label>Reference Time :</label>
|
||||
<span>
|
||||
这是内容
|
||||
{{ xeActivity.referenceTime }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<label>Xe Activity (Bq) :</label>
|
||||
<span>
|
||||
这是内容
|
||||
{{ xeActivity.activity }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -170,10 +192,11 @@ import ModalMixin from '@/mixins/ModalMixin'
|
|||
import { cloneDeep } from 'lodash'
|
||||
import CustomChart from '@/components/CustomChart/index.vue'
|
||||
import { exportEchartImg, getXAxisAndYAxisByPosition, splitAxis } from '@/utils/chartHelper'
|
||||
import { getAction } from '@/api/manage'
|
||||
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'
|
||||
|
||||
const initialGammaChartOption = {
|
||||
grid: {
|
||||
|
@ -226,7 +249,8 @@ const initialGammaChartOption = {
|
|||
},
|
||||
axisLabel: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
animation: false
|
||||
},
|
||||
series: [
|
||||
{
|
||||
|
@ -248,8 +272,9 @@ const initialGammaChartOption = {
|
|||
lineStyle: {
|
||||
color: '#f00'
|
||||
},
|
||||
data: []
|
||||
}
|
||||
data: [{ xAxis: -1 }, { xAxis: -1 }]
|
||||
},
|
||||
animation: false
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
|
@ -257,7 +282,8 @@ const initialGammaChartOption = {
|
|||
color: '#A8DA56'
|
||||
},
|
||||
symbol: 'none',
|
||||
data: []
|
||||
data: [],
|
||||
animation: false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -313,7 +339,8 @@ const initialBetaChartOption = {
|
|||
},
|
||||
axisLabel: {
|
||||
color: '#ade6ee'
|
||||
}
|
||||
},
|
||||
animation: false
|
||||
},
|
||||
series: [
|
||||
{
|
||||
|
@ -336,7 +363,8 @@ const initialBetaChartOption = {
|
|||
color: '#f00'
|
||||
},
|
||||
data: []
|
||||
}
|
||||
},
|
||||
animation: false
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
|
@ -344,7 +372,8 @@ const initialBetaChartOption = {
|
|||
color: '#A8DA56'
|
||||
},
|
||||
symbol: 'none',
|
||||
data: []
|
||||
data: [],
|
||||
animation: false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -359,32 +388,23 @@ const initialResultChartOption = {
|
|||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
markLine: {
|
||||
symbol: 'none',
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
animation: false,
|
||||
emphasis: {
|
||||
disabled: true
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#f00'
|
||||
},
|
||||
data: []
|
||||
}
|
||||
animation: false
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
type: 'scatter',
|
||||
itemStyle: {
|
||||
color: '#A8DA56'
|
||||
color: 'red'
|
||||
},
|
||||
symbol: 'none',
|
||||
data: []
|
||||
symbolSize: 6,
|
||||
data: [],
|
||||
zlevel: 2,
|
||||
animation: false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
initialResultChartOption.yAxis.boundaryGap = ['20%', '20%']
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'Index',
|
||||
|
@ -395,17 +415,17 @@ const columns = [
|
|||
},
|
||||
{
|
||||
title: 'Eb',
|
||||
dataIndex: 'Eb',
|
||||
dataIndex: 'eb',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'Nx',
|
||||
dataIndex: 'Nx',
|
||||
dataIndex: 'nx',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: 'Ny',
|
||||
dataIndex: 'Ny',
|
||||
dataIndex: 'ny',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
|
@ -417,6 +437,20 @@ const columns = [
|
|||
}
|
||||
]
|
||||
|
||||
const initialModel = {
|
||||
windowBegin: undefined,
|
||||
windowEnd: undefined,
|
||||
minEnergy: 0.1,
|
||||
halfLife: 5.243,
|
||||
fitType: 'liner'
|
||||
}
|
||||
|
||||
// Function of Fitting
|
||||
const funcList = {
|
||||
liner: 'y = ax + b',
|
||||
poly2: 'y = axx + bx + c'
|
||||
}
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin, SampleDataMixin],
|
||||
components: {
|
||||
|
@ -437,27 +471,41 @@ export default {
|
|||
channel: '',
|
||||
energy: ''
|
||||
},
|
||||
customToolTip2: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
visible: false,
|
||||
channel: '',
|
||||
energy: ''
|
||||
},
|
||||
|
||||
totalCount: [0, 0],
|
||||
currFunction: '',
|
||||
xeActivity: {},
|
||||
|
||||
isLoading: false,
|
||||
|
||||
detail: {},
|
||||
gammaChannelEnergy: [],
|
||||
|
||||
model: {
|
||||
fittingType: '1'
|
||||
},
|
||||
tableList: []
|
||||
model: cloneDeep(initialModel),
|
||||
tableList: [],
|
||||
isAnalysing: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeModalOpen() {
|
||||
this.customToolTip.visible = false
|
||||
const gammaSeries = this.gammaSpectrumChartOption.series
|
||||
gammaSeries[0].data = []
|
||||
gammaSeries[1].data = []
|
||||
this.customToolTip2.visible = false
|
||||
this.gammaSpectrumChartOption = cloneDeep(initialGammaChartOption)
|
||||
this.betaSpectrumChartOption = cloneDeep(initialBetaChartOption)
|
||||
this.resultChartOption = cloneDeep(initialResultChartOption)
|
||||
|
||||
const betaSeries = this.betaSpectrumChartOption.series
|
||||
betaSeries[0].data = []
|
||||
betaSeries[1].data = []
|
||||
this.model = cloneDeep(initialModel)
|
||||
this.currFunction = funcList[this.model.fitType]
|
||||
this.tableList = []
|
||||
|
||||
this.calculateTotalCount()
|
||||
|
||||
this.getDetail()
|
||||
},
|
||||
|
@ -518,28 +566,171 @@ export default {
|
|||
}
|
||||
},
|
||||
// 图表点击
|
||||
handleChartClick(param) {
|
||||
const { offsetX, offsetY } = param
|
||||
handleChartClick({ offsetX, offsetY, event }, isMouseLeft) {
|
||||
event.preventDefault()
|
||||
|
||||
const point = getXAxisAndYAxisByPosition(this.$refs.gammaSpectrumChart.getChartInstance(), offsetX, offsetY)
|
||||
if (point) {
|
||||
const markLineData = this.gammaSpectrumChartOption.series[0].markLine.data
|
||||
const xAxis = parseInt(point[0].toFixed())
|
||||
this.gammaSpectrumChartOption.series[0].markLine.data = [{ xAxis }]
|
||||
|
||||
this.customToolTip.top = offsetY
|
||||
if (xAxis > 225) {
|
||||
this.customToolTip.left = offsetX - 125
|
||||
} else {
|
||||
this.customToolTip.left = offsetX + 20
|
||||
let currToolTip = this.customToolTip2
|
||||
|
||||
// 如果是左键
|
||||
if (isMouseLeft) {
|
||||
// 如果有右值且左值大于等于右值,清空
|
||||
if (!isNullOrUndefined(this.model.windowEnd) && xAxis >= this.model.windowEnd) {
|
||||
this.clearMarkLineAndToolTip()
|
||||
return
|
||||
}
|
||||
|
||||
currToolTip = this.customToolTip
|
||||
|
||||
markLineData[0].xAxis = xAxis
|
||||
this.model.windowBegin = xAxis
|
||||
}
|
||||
this.customToolTip.visible = true
|
||||
this.customToolTip.channel = xAxis
|
||||
// 如果是右键
|
||||
else {
|
||||
if (!isNullOrUndefined(this.model.windowBegin) && xAxis <= this.model.windowBegin) {
|
||||
this.clearMarkLineAndToolTip()
|
||||
return
|
||||
}
|
||||
|
||||
markLineData[1].xAxis = xAxis
|
||||
this.model.windowEnd = xAxis
|
||||
}
|
||||
|
||||
currToolTip.top = offsetY
|
||||
if (xAxis > 225) {
|
||||
currToolTip.left = offsetX - 125
|
||||
} else {
|
||||
currToolTip.left = offsetX + 20
|
||||
}
|
||||
currToolTip.visible = true
|
||||
currToolTip.channel = xAxis
|
||||
const energy = this.gammaChannelEnergy[xAxis] || 0
|
||||
this.customToolTip.energy = parseInt(energy) + 'keV'
|
||||
currToolTip.energy = parseInt(energy) + 'keV'
|
||||
|
||||
this.calculateTotalCount()
|
||||
}
|
||||
},
|
||||
|
||||
clearMarkLineAndToolTip() {
|
||||
const markLineData = this.gammaSpectrumChartOption.series[0].markLine.data
|
||||
markLineData[0].xAxis = -1
|
||||
markLineData[1].xAxis = -1
|
||||
|
||||
this.customToolTip.visible = false
|
||||
this.customToolTip2.visible = false
|
||||
|
||||
this.model.windowBegin = null
|
||||
this.model.windowEnd = null
|
||||
|
||||
this.calculateTotalCount()
|
||||
},
|
||||
|
||||
// 计算Total Count
|
||||
calculateTotalCount() {
|
||||
if (!this.model.windowBegin || !this.model.windowEnd || this.model.windowBegin >= this.model.windowEnd) {
|
||||
this.totalCount = [0, 0]
|
||||
return
|
||||
}
|
||||
|
||||
const gammaOriginSeriseData = this.gammaSpectrumChartOption.series[0].data
|
||||
const betaProjectedSeriseData = this.betaSpectrumChartOption.series[1].data
|
||||
|
||||
const originSeriseTotalCount = gammaOriginSeriseData
|
||||
.slice(this.model.windowBegin, this.model.windowEnd + 1)
|
||||
.reduce((prev, curr) => prev + curr[1], 0)
|
||||
const projectedSeriseTotalCount = betaProjectedSeriseData
|
||||
.slice(this.model.windowBegin, this.model.windowEnd + 1)
|
||||
.reduce((prev, curr) => prev + curr[1], 0)
|
||||
this.totalCount = [originSeriseTotalCount, projectedSeriseTotalCount]
|
||||
},
|
||||
|
||||
// Function of Fitting 改变
|
||||
handleFuncChange() {
|
||||
this.xeActivity = {}
|
||||
this.currFunction = funcList[this.model.fitType]
|
||||
},
|
||||
|
||||
handleSnapshot() {
|
||||
exportEchartImg(this.$refs.chartRef.getChartInstance())
|
||||
},
|
||||
|
||||
// 分析
|
||||
async handleAnalyse() {
|
||||
const { windowBegin, windowEnd, minEnergy, halfLife, fitType } = this.model
|
||||
if (
|
||||
isNullOrUndefined(windowBegin) ||
|
||||
isNullOrUndefined(windowEnd) ||
|
||||
isNullOrUndefined(minEnergy) ||
|
||||
isNullOrUndefined(halfLife)
|
||||
) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const { sampleFileName, detFileName } = this.sampleData
|
||||
|
||||
const params = {
|
||||
sampleId: null,
|
||||
dbName: '',
|
||||
sampleFileName,
|
||||
detFileName,
|
||||
gammaBegin: windowBegin,
|
||||
gammaEnd: windowEnd,
|
||||
minEnergy,
|
||||
halfLife,
|
||||
fitType //选择Linear 传 liner 选择2-Polynomial 传 poly2
|
||||
}
|
||||
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
|
||||
} = result
|
||||
|
||||
this.currFunction = functionFit
|
||||
|
||||
const [lineSeries, scatterSeries] = 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)
|
||||
}
|
||||
|
||||
this.tableList = tableData
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isAnalysing = false
|
||||
}
|
||||
},
|
||||
|
||||
resetResultChartPerform() {
|
||||
this.resultChartOption.yAxis.min = undefined
|
||||
this.resultChartOption.yAxis.max = undefined
|
||||
this.resultChartOption.xAxis.min = undefined
|
||||
this.resultChartOption.xAxis.max = undefined
|
||||
this.resultChartOption.yAxis.interval = undefined
|
||||
this.resultChartOption.xAxis.interval = undefined
|
||||
},
|
||||
|
||||
// 表格删除
|
||||
handleDel(index) {
|
||||
this.tableList.splice(index, 1)
|
||||
this.resultChartOption.series[1].data.splice(index, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -551,6 +742,21 @@ export default {
|
|||
|
||||
.title {
|
||||
color: @primary-color;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.total-counts {
|
||||
.count-1 {
|
||||
color: @primary-color;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.count-2 {
|
||||
color: #ffc90e;
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.sample-infomation {
|
||||
|
@ -570,6 +776,7 @@ export default {
|
|||
padding: 5px;
|
||||
width: 200px;
|
||||
height: 100%;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -635,7 +842,7 @@ export default {
|
|||
width: 100%;
|
||||
|
||||
&:last-child {
|
||||
margin-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -725,7 +932,7 @@ export default {
|
|||
}
|
||||
|
||||
.xe-activity {
|
||||
width: 80%;
|
||||
width: 90%;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
@change="handleTableChange"
|
||||
></custom-table>
|
||||
<div slot="custom-footer">
|
||||
<a-button type="primary" :loading="isComparing" @click="handleOk">Compare</a-button>
|
||||
<a-button type="primary" @click="handleOk">Ok</a-button>
|
||||
<a-button @click="visible = false">Cancel</a-button>
|
||||
</div>
|
||||
</custom-modal>
|
||||
|
@ -22,7 +22,6 @@
|
|||
import { getAction } from '@/api/manage'
|
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import SampleDataMixin from '../../SampleDataMixin'
|
||||
|
||||
const columns = [
|
||||
{
|
||||
|
@ -56,7 +55,7 @@ const formItems = [
|
|||
]
|
||||
|
||||
export default {
|
||||
mixins: [ModalMixin, JeecgListMixin, SampleDataMixin],
|
||||
mixins: [ModalMixin, JeecgListMixin],
|
||||
data() {
|
||||
this.columns = columns
|
||||
this.formItems = formItems
|
||||
|
@ -64,8 +63,7 @@ export default {
|
|||
return {
|
||||
queryParam: {},
|
||||
selectedRowKeys: [],
|
||||
selectionRows: [],
|
||||
isComparing: false
|
||||
selectionRows: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -109,27 +107,9 @@ export default {
|
|||
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
|
||||
}
|
||||
this.$emit('fileSelect', this.selectionRows[0].name)
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null" destroy-on-close>
|
||||
<custom-modal v-model="visible" :width="1280" title="Efficiency Calibration" :footer="null">
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="energy-calibration">
|
||||
<div class="left">
|
||||
|
@ -125,19 +125,23 @@ import { showSaveFileModal } from '@/utils/file'
|
|||
const columns = [
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy'
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Efficiency',
|
||||
dataIndex: 'efficiency'
|
||||
dataIndex: 'efficiency',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit'
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta'
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -282,11 +286,11 @@ export default {
|
|||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
|
||||
const { list_dataSource, ECutAnalysis_Low, G_energy_span, currentText: resultCurrentText } = result
|
||||
this.dataSourceList = list_dataSource
|
||||
if (!currentText) {
|
||||
this.currSelectedDataSource = list_dataSource[list_dataSource.length - 1]
|
||||
this.appliedDataSource = list_dataSource[list_dataSource.length - 1]
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
this.appliedDataSource = resultCurrentText
|
||||
}
|
||||
|
||||
this.ECutAnalysis_Low = ECutAnalysis_Low
|
||||
|
|
|
@ -120,19 +120,23 @@ import { showSaveFileModal } from '@/utils/file'
|
|||
const columns = [
|
||||
{
|
||||
title: 'Channel',
|
||||
dataIndex: 'channel'
|
||||
dataIndex: 'channel',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy'
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit'
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta'
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -244,11 +248,11 @@ export default {
|
|||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
const { list_dataSource, rg_high, rg_low } = result
|
||||
const { list_dataSource, rg_high, rg_low, currentText: resultCurrentText } = result
|
||||
this.dataSourceList = list_dataSource
|
||||
if (!currentText) {
|
||||
this.currSelectedDataSource = list_dataSource[list_dataSource.length - 1]
|
||||
this.appliedDataSource = list_dataSource[list_dataSource.length - 1]
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
this.appliedDataSource = resultCurrentText
|
||||
}
|
||||
|
||||
this.rg_high = rg_high
|
||||
|
|
|
@ -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,36 +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">Canberra IEC1455(.IEC)</div>
|
||||
<div class="data-type">
|
||||
Data type
|
||||
<div class="data-type-select">
|
||||
<custom-select :option="[{ label: 'SAMPLEPHD', value: 1 }]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">IMS .ims .rms</div>
|
||||
</div>
|
||||
<a-transfer></a-transfer>
|
||||
<spectrum-transfer-com :params="params" :fileOptions="fileOptions" />
|
||||
</title-over-border>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -117,28 +108,60 @@
|
|||
<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',
|
||||
},
|
||||
{
|
||||
title: 'IMS.ims.rms',
|
||||
accept: '.IMS,.RMS,.PHD',
|
||||
transformUrl: '/gamma/ftransit/ImsToIec'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeModalOpen() {
|
||||
this.params = cloneDeep(initParams)
|
||||
this.states = cloneDeep(initStates)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -229,63 +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;
|
||||
}
|
||||
}
|
||||
|
||||
.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,36 +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">ORTEC int.spc</div>
|
||||
<div class="data-type">
|
||||
Data type
|
||||
<div class="data-type-select">
|
||||
<custom-select :option="[{ label: 'SAMPLEPHD', value: 1 }]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="title">IMS .ims .rms</div>
|
||||
</div>
|
||||
<a-transfer></a-transfer>
|
||||
<spectrum-transfer-com :params="params" :fileOptions="fileOptions" />
|
||||
</title-over-border>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -117,28 +108,60 @@
|
|||
<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',
|
||||
},
|
||||
{
|
||||
title: 'IMS.ims.rms',
|
||||
accept: '.IMS,.RMS,.PHD',
|
||||
transformUrl: '/gamma/ftransit/ImsToSpc'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeModalOpen() {
|
||||
this.params = cloneDeep(initParams)
|
||||
this.states = cloneDeep(initStates)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -229,63 +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;
|
||||
}
|
||||
}
|
||||
|
||||
.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: {
|
||||
|
|
|
@ -631,14 +631,27 @@ export default {
|
|||
// 如果文件系统可用
|
||||
if (this.canUseFilePicker) {
|
||||
const propNames = ['sampleFileName', 'gasFileName', 'detFileName', 'qcFileName']
|
||||
const propStatus = ['sampleFileStatus', 'gasFileStatus', 'detFileStatus', 'qcFileStatus']
|
||||
const files = []
|
||||
const allFiles = []
|
||||
for (const item of this.list) {
|
||||
propNames.forEach((propName) => {
|
||||
const value = item[propName]
|
||||
if (value && value.file) {
|
||||
files.push(value.file)
|
||||
if (item.fileType) {
|
||||
let fileObj = {
|
||||
files: [],
|
||||
fileType: item.fileType,
|
||||
}
|
||||
})
|
||||
propNames.forEach((propName, index) => {
|
||||
const value = item[propName]
|
||||
if (value && value.file) {
|
||||
fileObj[propStatus[index]] = true
|
||||
files.push(value.file)
|
||||
fileObj.files.push(value.fileName)
|
||||
} else {
|
||||
fileObj[propStatus[index]] = false
|
||||
}
|
||||
})
|
||||
allFiles.push(fileObj)
|
||||
}
|
||||
}
|
||||
if (!files.length) {
|
||||
this.$message.warn('File is Empty ')
|
||||
|
@ -649,24 +662,47 @@ export default {
|
|||
try {
|
||||
const { success, message } = await this.uploadZipFile(zipedFiles)
|
||||
if (success) {
|
||||
try {
|
||||
const { success, result, message } = await getAction('/spectrumAnalysis/getFilesBySampleFile', {
|
||||
fileName: this.list
|
||||
.filter((item) => item.sampleFileName)
|
||||
.map((item) => item.sampleFileName.file.name)
|
||||
.join(','),
|
||||
})
|
||||
if (success) {
|
||||
this.visible = false
|
||||
this.$emit('loadFormFile', result)
|
||||
let result = []
|
||||
console.log('allFiles', allFiles)
|
||||
allFiles.forEach((el) => {
|
||||
let obj = {}
|
||||
if (el.fileType == 'B') {
|
||||
obj.sampleSystemType = el.fileType
|
||||
el.files.forEach((item) => {
|
||||
if (item.includes('_S_')) {
|
||||
obj.sampleFileName = item
|
||||
}
|
||||
if (item.includes('_G_')) {
|
||||
obj.gasFileName = item
|
||||
obj.gasFileStatus = el.gasFileStatus
|
||||
}
|
||||
if (item.includes('_D_')) {
|
||||
obj.detFileName = item
|
||||
obj.detFileStatus = el.detFileStatus
|
||||
}
|
||||
if (item.includes('_Q_')) {
|
||||
obj.qcFileName = item
|
||||
obj.qcFileStatus = el.qcFileStatus
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
el.files.forEach((item) => {
|
||||
if (item.includes('_S_')) {
|
||||
obj.sampleSystemType = el.fileType
|
||||
obj.sampleFileName = item
|
||||
obj.gasFileName = ''
|
||||
obj.detFileName = ''
|
||||
obj.qcFileName = ''
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isUploadingZip = false
|
||||
}
|
||||
result.push(obj)
|
||||
})
|
||||
console.log(result)
|
||||
this.$emit('loadFormFile', result)
|
||||
this.visible = false
|
||||
this.isUploadingZip = false
|
||||
// }
|
||||
} else {
|
||||
this.isUploadingZip = false
|
||||
this.$message.error(message)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<a-input v-model="model.dataType" @change="e=>handleValueChange(e.target.value)"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Priority Level">
|
||||
<custom-select v-model="model.priorityLevel" style="width: 150px" :options="priorityLevbelOptions" @change="handleValueChange"> </custom-select>
|
||||
<custom-select v-model="model.priorityLevel" :options="priorityLevbelOptions" @change="handleValueChange"> </custom-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Station Code">
|
||||
<a-input v-model="model.stationCode" @change="e=>handleValueChange(e.target.value)"/>
|
||||
|
@ -27,13 +27,13 @@
|
|||
<a-input v-model="model.labDetector" @change="e=>handleValueChange(e.target.value)"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Report Type">
|
||||
<custom-select v-model="model.reportType" style="width: 150px" :options="reportTypeOptions" @change="handleValueChange"> </custom-select>
|
||||
<custom-select v-model="model.reportType" :options="reportTypeOptions" @change="handleValueChange"> </custom-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Report Number">
|
||||
<a-input-number v-model="model.reportnumber" style="width: 100%;" @change="handleValueChange"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Sample Category">
|
||||
<custom-select v-model="model.sampleCategory" style="width: 150px" :options="sampleCategoryOptions" @change="handleValueChange"> </custom-select>
|
||||
<custom-select v-model="model.sampleCategory" :options="sampleCategoryOptions" @change="handleValueChange"> </custom-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Message Transmission Time">
|
||||
<custom-date-picker v-model="model.transmission" show-time @change="(mont,date)=>handleValueChange(date)"/>
|
||||
|
|
|
@ -120,19 +120,23 @@ import { showSaveFileModal } from '@/utils/file'
|
|||
const columns = [
|
||||
{
|
||||
title: 'Energy(keV)',
|
||||
dataIndex: 'energy'
|
||||
dataIndex: 'energy',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'FWHM(keV)',
|
||||
dataIndex: 'fwhm'
|
||||
dataIndex: 'fwhm',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Fit(keV)',
|
||||
dataIndex: 'fit'
|
||||
dataIndex: 'fit',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
},
|
||||
{
|
||||
title: 'Delta(%)',
|
||||
dataIndex: 'delta'
|
||||
dataIndex: 'delta',
|
||||
customRender: (text) => Number(text).toFixed(3)
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -243,11 +247,11 @@ export default {
|
|||
})
|
||||
this.isLoading = false
|
||||
if (success) {
|
||||
const { list_dataSource, ECutAnalysis_Low, G_energy_span } = result
|
||||
const { list_dataSource, ECutAnalysis_Low, G_energy_span, currentText: resultCurrentText } = result
|
||||
this.dataSourceList = list_dataSource
|
||||
if (!currentText) {
|
||||
this.currSelectedDataSource = list_dataSource[list_dataSource.length - 1]
|
||||
this.appliedDataSource = list_dataSource[list_dataSource.length - 1]
|
||||
this.currSelectedDataSource = resultCurrentText
|
||||
this.appliedDataSource = resultCurrentText
|
||||
}
|
||||
|
||||
this.ECutAnalysis_Low = ECutAnalysis_Low
|
||||
|
|
|
@ -1,25 +1,45 @@
|
|||
<template>
|
||||
<custom-modal v-model="visible" title="Ratio" :width="240" :okHandler="handleOk">
|
||||
<custom-modal v-model="visible" title="Ratio" :width="240" @cancel="handleReject">
|
||||
<a-input-number :min="1" v-model="ratio"></a-input-number>
|
||||
|
||||
<div slot="custom-footer">
|
||||
<a-button type="primary" @click="handleOk">OK</a-button>
|
||||
<a-button @click="handleCancel">Cancel</a-button>
|
||||
</div>
|
||||
</custom-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
export default {
|
||||
mixins: [ModalMixin],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
ratio: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getRatio() {
|
||||
this.visible = true
|
||||
this.ratio = 1
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.resolve = resolve
|
||||
this.reject = reject
|
||||
})
|
||||
},
|
||||
|
||||
handleOk() {
|
||||
console.log('%c [ ]-14', 'font-size:13px; background:pink; color:#bf2c9f;', this.ratio)
|
||||
if(!this.ratio) {
|
||||
this.$message.warn('Ratio Cannot Be Null')
|
||||
throw new Error('Ratio Empty')
|
||||
}
|
||||
this.resolve(this.ratio)
|
||||
this.visible = false
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.resolve()
|
||||
this.visible = false
|
||||
},
|
||||
|
||||
handleReject() {
|
||||
this.reject('cancel')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -89,7 +89,12 @@
|
|||
:nuclide="nuclideReview.nuclide"
|
||||
/>
|
||||
|
||||
<compare-file-list-modal v-model="compareFileListModalVisible" @compareWithFile="handleCompareWithFile" />
|
||||
<compare-file-list-modal v-model="compareFileListModalVisible" @fileSelect="handleFileSelect" />
|
||||
|
||||
<!-- Strip 弹窗开始 -->
|
||||
<strip-modal ref="stripModal" />
|
||||
<!-- Strip 弹窗结束 -->
|
||||
|
||||
<!-- ReProcessing 弹窗开始 -->
|
||||
<re-processing-modal
|
||||
v-if="abc"
|
||||
|
@ -132,6 +137,7 @@ import { GammaOptions, graphAssistance } from './settings'
|
|||
import store from '@/store/'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import StripModal from './components/Modals/StripModal.vue'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
@ -153,6 +159,7 @@ export default {
|
|||
NuclideReviewModal,
|
||||
CompareFileListModal,
|
||||
ReProcessingModal,
|
||||
StripModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -205,6 +212,8 @@ export default {
|
|||
currChannel: -1,
|
||||
|
||||
compareFileListModalVisible: false, // Compare 弹窗
|
||||
isStrip: false,
|
||||
|
||||
reprocessingModalVisible: false, // 重新分析弹窗
|
||||
isProcessing: false, // 正在处理
|
||||
websock: null,
|
||||
|
@ -213,6 +222,7 @@ export default {
|
|||
checkBox_updateCal: false, //update复选框状态
|
||||
newCheckBox_updateCal: false, //update复选框状态
|
||||
currStep: '',
|
||||
isReAnalyed: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -303,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
|
||||
|
@ -333,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
|
||||
|
@ -357,7 +367,7 @@ export default {
|
|||
return cancelToken
|
||||
},
|
||||
|
||||
dataProsess(result, flag) {
|
||||
dataProcess(result, flag) {
|
||||
this.isLoading = false
|
||||
|
||||
const {
|
||||
|
@ -379,6 +389,7 @@ export default {
|
|||
} = result
|
||||
if (flag && (flag == 'dab' || flag == 'file')) {
|
||||
this.bAnalyed = result.bAnalyed
|
||||
this.$emit('reAnalyed', this.bAnalyed)
|
||||
this.checkBox_updateCal = result.checkBox_updateCal
|
||||
this.newCheckBox_updateCal = '2'
|
||||
console.log(this.checkBox_updateCal)
|
||||
|
@ -516,7 +527,12 @@ export default {
|
|||
})
|
||||
)
|
||||
|
||||
this.opts.notMerge = true
|
||||
this.option.series = series
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.resetChartOpts()
|
||||
})
|
||||
},
|
||||
|
||||
// chart 的 tooltip
|
||||
|
@ -777,7 +793,7 @@ export default {
|
|||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
this.list = []
|
||||
this.nuclideLibraryList = []
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoadingNuclide = false
|
||||
|
@ -1158,7 +1174,7 @@ export default {
|
|||
this.handleResetState()
|
||||
data.DetailedInformation = this.detailedInfomation
|
||||
this.clearCompareLine()
|
||||
this.dataProsess(data)
|
||||
this.dataProcess(data)
|
||||
},
|
||||
|
||||
// 分析工具Accept时刷新部分数据
|
||||
|
@ -1196,7 +1212,7 @@ export default {
|
|||
},
|
||||
|
||||
// 显示比较弹窗
|
||||
showCompareModal() {
|
||||
showCompareModal(isStrip) {
|
||||
if (this.isLoading) {
|
||||
this.$message.warn('Sample is Loading')
|
||||
return
|
||||
|
@ -1204,21 +1220,55 @@ export default {
|
|||
this.handleResetChart()
|
||||
this.clearCompareLine()
|
||||
this.compareFileListModalVisible = true
|
||||
|
||||
this.isStrip = isStrip
|
||||
},
|
||||
|
||||
// 文件之间对比
|
||||
handleCompareWithFile([channelData, energyData]) {
|
||||
this.channelCompareLine = channelData
|
||||
this.energyCompareLine = energyData
|
||||
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
||||
async handleFileSelect(selectedFileName) {
|
||||
const { inputFileName: fileName } = this.sample
|
||||
|
||||
if (this.isScatter()) {
|
||||
lineSeries.type = 'scatterGL'
|
||||
try {
|
||||
let param = {
|
||||
fileName,
|
||||
compareFileName: selectedFileName,
|
||||
},
|
||||
url = '/gamma/Compare'
|
||||
// 如果是Strip
|
||||
if (this.isStrip) {
|
||||
const ratio = await this.$refs.stripModal.getRatio()
|
||||
|
||||
param = {
|
||||
fileName,
|
||||
stripFileName: selectedFileName,
|
||||
ratioRate: ratio || 1,
|
||||
}
|
||||
url = '/gamma/Strip'
|
||||
}
|
||||
|
||||
this.isLoading = true
|
||||
const { success, result, message } = await getAction(url, param)
|
||||
if (success) {
|
||||
const [channelData, energyData] = result
|
||||
this.channelCompareLine = channelData
|
||||
this.energyCompareLine = energyData
|
||||
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
||||
|
||||
if (this.isScatter()) {
|
||||
lineSeries.type = 'scatterGL'
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||
})
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||
})
|
||||
},
|
||||
|
||||
// 移除 Compare 线
|
||||
|
@ -1233,7 +1283,7 @@ export default {
|
|||
},
|
||||
|
||||
// 重新分析
|
||||
async reProcessing() {
|
||||
async reProcessing(showMessage = true) {
|
||||
if (this.isProcessing) {
|
||||
return
|
||||
}
|
||||
|
@ -1248,16 +1298,20 @@ export default {
|
|||
const { inputFileName: fileName } = this.sample
|
||||
const { success, result, message } = await postAction(`/gamma/Reprocessing?fileName=${fileName}`)
|
||||
if (success) {
|
||||
this.isReAnalyed = true
|
||||
this.$emit('reAnalyed', this.isReAnalyed)
|
||||
this.handleResetState()
|
||||
result.DetailedInformation = this.detailedInfomation
|
||||
this.dataProsess(result)
|
||||
this.dataProcess(result)
|
||||
} else {
|
||||
this.isLoading = false
|
||||
const arr = message.split('\n')
|
||||
this.$warning({
|
||||
title: 'Warning',
|
||||
content: () => arr.map((text) => <div>{text}</div>),
|
||||
})
|
||||
if(showMessage) {
|
||||
const arr = message.split('\n')
|
||||
this.$warning({
|
||||
title: 'Warning',
|
||||
content: () => arr.map((text) => <div>{text}</div>),
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
|
|
@ -30,7 +30,13 @@
|
|||
<!-- 频谱分析部分 -->
|
||||
<div class="spectrum-analysis-main">
|
||||
<!-- Gamma 分析 -->
|
||||
<gamma-analysis v-if="isGamma" ref="gammaAnalysisRef" :sample="sampleData" :updateFlag="updateFlag" />
|
||||
<gamma-analysis
|
||||
v-if="isGamma"
|
||||
ref="gammaAnalysisRef"
|
||||
:sample="sampleData"
|
||||
:updateFlag="updateFlag"
|
||||
@reAnalyed="handleReAnalyed"
|
||||
/>
|
||||
<!-- Gamma 分析 -->
|
||||
|
||||
<!-- Beta-Gamma 分析 -->
|
||||
|
@ -57,10 +63,6 @@
|
|||
<load-from-file-modal v-model="loadFromFileModalVisible" @loadFormFile="handleLoadSampleFromFile" />
|
||||
<!-- 从文件加载结束 -->
|
||||
|
||||
<!-- Strip 弹窗开始 -->
|
||||
<strip-modal v-model="stripModalVisible" />
|
||||
<!-- Strip 弹窗结束 -->
|
||||
|
||||
<!-- Ftransit 弹窗开始 -->
|
||||
<ftranslt-modal v-model="ftransltModalVisible" />
|
||||
<!-- Ftransit 弹窗结束 -->
|
||||
|
@ -231,10 +233,10 @@ import BetaGammaRlrModal from './components/Modals/BetaGammaModals/BetaGammaRLRM
|
|||
import StatisticsParamerHistoryModal from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModal.vue'
|
||||
import FtransltModal from './components/Modals/FtransltModal/index.vue'
|
||||
import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/index.vue'
|
||||
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'
|
||||
import { clearSampleCache } from './clearSampleCache'
|
||||
|
||||
// 分析类型
|
||||
const ANALYZE_TYPE = {
|
||||
|
@ -277,7 +279,6 @@ export default {
|
|||
StatisticsParamerHistoryModal,
|
||||
FtransltModal,
|
||||
BetaGammaEnergyCalibrationModal,
|
||||
StripModal,
|
||||
AutomaticAnalysisLogModal,
|
||||
BetaGammaExtrapolationModal,
|
||||
},
|
||||
|
@ -303,7 +304,6 @@ export default {
|
|||
|
||||
loadFromDbModalVisible: false, // 从数据库加载弹窗
|
||||
loadFromFileModalVisible: false, // 从文件加载弹窗
|
||||
stripModalVisible: false, // Strip 弹窗
|
||||
ftransltModalVisible: false, // Ftransit 弹窗
|
||||
|
||||
sampleData: {}, // 要分析的谱数据
|
||||
|
@ -383,6 +383,8 @@ export default {
|
|||
xe135Flag: null,
|
||||
},
|
||||
updateFlag: '2',
|
||||
isReAnalyed_gamma: false,
|
||||
isReAnalyed_beta: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -400,6 +402,9 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
handleReAnalyed(val) {
|
||||
this.isReAnalyed_gamma = val
|
||||
},
|
||||
getUpdateFlag(val) {
|
||||
console.log('qerq', val)
|
||||
this.updateFlag = val
|
||||
|
@ -407,7 +412,7 @@ export default {
|
|||
getcommentsInfo(val) {
|
||||
this.params_toDB.comment = val.spectrumAnalysisCommentInfo
|
||||
},
|
||||
getStationName(arg, val) {
|
||||
getStationName(arg, val, flag) {
|
||||
arg.forEach((item) => {
|
||||
item.conc = item.conc.toFixed(6)
|
||||
item.concErr = item.concErr.toFixed(6)
|
||||
|
@ -416,6 +421,7 @@ export default {
|
|||
})
|
||||
this.resultDisplayFlag = arg
|
||||
this.params_toDB.stationName = val
|
||||
this.isReAnalyed_beta = flag
|
||||
},
|
||||
getCheckFlag(val) {
|
||||
this.params_toDB.checkSample = val.checkSample
|
||||
|
@ -474,6 +480,8 @@ export default {
|
|||
|
||||
// 清理全部
|
||||
handleCleanAll() {
|
||||
clearSampleCache(this.sampleList)
|
||||
|
||||
this.sampleList = []
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
|
@ -591,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
|
||||
|
@ -648,6 +670,7 @@ export default {
|
|||
}
|
||||
postAction('/spectrumAnalysis/analyseCurrentSpectrum', params).then((res) => {
|
||||
if (res.success) {
|
||||
this.isReAnalyed_beta = true
|
||||
this.analyseCurrentSpectrumData = res.result
|
||||
this.resultDisplayFlag = res.result.XeData
|
||||
this.resultDisplayFlag.forEach((item) => {
|
||||
|
@ -723,24 +746,25 @@ export default {
|
|||
type: 'a-menu-item',
|
||||
title: 'Compare',
|
||||
show: this.isGamma,
|
||||
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(),
|
||||
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(false),
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'Strip',
|
||||
show: this.isGamma,
|
||||
handler: () => (this.stripModalVisible = true),
|
||||
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(true),
|
||||
},
|
||||
{
|
||||
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()
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -764,7 +788,8 @@ export default {
|
|||
if (spectra) {
|
||||
this.loadSelectedSample(spectra)
|
||||
} else {
|
||||
this.handleCleanAll()
|
||||
this.analysisType = undefined
|
||||
this.sampleData = {}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -794,6 +819,7 @@ export default {
|
|||
key: 'all',
|
||||
},
|
||||
],
|
||||
key: 'resultsToDB',
|
||||
},
|
||||
{
|
||||
title: 'Save PHD to File',
|
||||
|
@ -807,6 +833,7 @@ export default {
|
|||
key: 'all',
|
||||
},
|
||||
],
|
||||
key: 'phdToFile',
|
||||
},
|
||||
],
|
||||
width: '170px',
|
||||
|
@ -817,9 +844,9 @@ export default {
|
|||
this.saveSettingModalVisible = true
|
||||
},
|
||||
submenuClick: ({ item, child }) => {
|
||||
if (item.title == 'Save Results to DB') {
|
||||
if (item.key == 'resultsToDB') {
|
||||
this.handleSaveResultsToDB(child.key)
|
||||
} else if (item.title == 'Save PHD to File') {
|
||||
} else if (item.key == 'phdToFile') {
|
||||
this.handleSavePHDToFile(child.key)
|
||||
}
|
||||
},
|
||||
|
@ -931,6 +958,7 @@ export default {
|
|||
},
|
||||
{
|
||||
title: 'NUCLIDELIBRARY',
|
||||
show: !this.isBetaGamma,
|
||||
children: [
|
||||
{
|
||||
type: 'a-menu',
|
||||
|
@ -938,13 +966,11 @@ 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),
|
||||
},
|
||||
],
|
||||
|
@ -1032,9 +1058,13 @@ export default {
|
|||
type: 'a-menu-item',
|
||||
title: 'RRR',
|
||||
handler: () => {
|
||||
this.arrOrRRRModalVisible = true
|
||||
this.arrOrRRRModalExtraData = {}
|
||||
this.arrOrRRRModalType = 2
|
||||
if (this.isReAnalyed_gamma) {
|
||||
this.arrOrRRRModalVisible = true
|
||||
this.arrOrRRRModalExtraData = {}
|
||||
this.arrOrRRRModalType = 2
|
||||
} else {
|
||||
this.$message.warning('Please analyze the spectrum first!')
|
||||
}
|
||||
},
|
||||
show: this.isGamma,
|
||||
},
|
||||
|
@ -1075,28 +1105,36 @@ export default {
|
|||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'View ARR',
|
||||
handler: () => {
|
||||
this.arrOrRRRModalVisible = true
|
||||
this.arrOrRRRModalExtraData = {}
|
||||
this.arrOrRRRModalType = 3
|
||||
},
|
||||
show: this.isBetaGamma,
|
||||
handler: () => {
|
||||
if (this.newSampleData.sampleId) {
|
||||
this.arrOrRRRModalVisible = true
|
||||
this.arrOrRRRModalExtraData = {}
|
||||
this.arrOrRRRModalType = 3
|
||||
} else {
|
||||
this.$message.warning("The file isn't existed.")
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'a-menu-item',
|
||||
title: 'View RRR',
|
||||
handler: () => {
|
||||
this.arrOrRRRModalVisible = true
|
||||
this.arrOrRRRModalExtraData = {
|
||||
dbName: this.sampleData.dbName,
|
||||
sampleData: false,
|
||||
GasBgData: false,
|
||||
DetBgData: false,
|
||||
QCData: false,
|
||||
bGammaEnergyValid: false,
|
||||
bBetaEnergyValid: false,
|
||||
if (this.isReAnalyed_beta) {
|
||||
this.arrOrRRRModalVisible = true
|
||||
this.arrOrRRRModalExtraData = {
|
||||
dbName: this.sampleData.dbName,
|
||||
sampleData: false,
|
||||
GasBgData: false,
|
||||
DetBgData: false,
|
||||
QCData: false,
|
||||
bGammaEnergyValid: false,
|
||||
bBetaEnergyValid: false,
|
||||
}
|
||||
this.arrOrRRRModalType = 4
|
||||
} else {
|
||||
this.$message.warning('Please analyze the spectrum first!')
|
||||
}
|
||||
this.arrOrRRRModalType = 4
|
||||
},
|
||||
show: this.isBetaGamma,
|
||||
},
|
||||
|
@ -1139,16 +1177,13 @@ export default {
|
|||
title: 'Automatic Analysis Log',
|
||||
show: this.isBetaGamma || this.isGamma,
|
||||
handler: () => {
|
||||
if (this.isGamma) {
|
||||
if (this.isBetaGamma || this.isGamma) {
|
||||
if (this.newSampleData.sampleId) {
|
||||
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
|
||||
this.autoAnalysisMogModalVisible = true
|
||||
} else {
|
||||
this.$message.warning("The file isn't existed.")
|
||||
}
|
||||
} else if (this.isBetaGamma) {
|
||||
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
|
||||
this.autoAnalysisMogModalVisible = true
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user