feat: Strip功能

This commit is contained in:
Xu Zhimeng 2023-10-17 15:25:53 +08:00
parent f0dc116793
commit d2878ecd36
4 changed files with 91 additions and 56 deletions

View File

@ -12,7 +12,7 @@
@change="handleTableChange" @change="handleTableChange"
></custom-table> ></custom-table>
<div slot="custom-footer"> <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> <a-button @click="visible = false">Cancel</a-button>
</div> </div>
</custom-modal> </custom-modal>
@ -22,7 +22,6 @@
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '../../SampleDataMixin'
const columns = [ const columns = [
{ {
@ -56,7 +55,7 @@ const formItems = [
] ]
export default { export default {
mixins: [ModalMixin, JeecgListMixin, SampleDataMixin], mixins: [ModalMixin, JeecgListMixin],
data() { data() {
this.columns = columns this.columns = columns
this.formItems = formItems this.formItems = formItems
@ -64,8 +63,7 @@ export default {
return { return {
queryParam: {}, queryParam: {},
selectedRowKeys: [], selectedRowKeys: [],
selectionRows: [], selectionRows: []
isComparing: false
} }
}, },
methods: { methods: {
@ -109,27 +107,9 @@ export default {
this.$message.warn('Please Select A File to Compare') this.$message.warn('Please Select A File to Compare')
return return
} }
try {
const { inputFileName: fileName } = this.sampleData
const compareFileName = this.selectionRows[0].name
this.isComparing = true this.$emit('fileSelect', this.selectionRows[0].name)
this.visible = false
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
}
} }
} }
} }

View File

@ -1,25 +1,45 @@
<template> <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> <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> </custom-modal>
</template> </template>
<script> <script>
import ModalMixin from '@/mixins/ModalMixin'
export default { export default {
mixins: [ModalMixin],
data() { data() {
return { return {
visible: false,
ratio: 1 ratio: 1
} }
}, },
methods: { methods: {
getRatio() {
this.visible = true
this.ratio = 1
return new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
},
handleOk() { handleOk() {
console.log('%c [ ]-14', 'font-size:13px; background:pink; color:#bf2c9f;', this.ratio) this.resolve(this.ratio)
if(!this.ratio) { this.visible = false
this.$message.warn('Ratio Cannot Be Null') },
throw new Error('Ratio Empty')
} handleCancel() {
this.resolve()
this.visible = false
},
handleReject() {
this.reject('cancel')
} }
} }
} }

View File

@ -89,7 +89,12 @@
:nuclide="nuclideReview.nuclide" :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 弹窗开始 --> <!-- ReProcessing 弹窗开始 -->
<re-processing-modal <re-processing-modal
v-if="abc" v-if="abc"
@ -132,6 +137,7 @@ import { GammaOptions, graphAssistance } from './settings'
import store from '@/store/' import store from '@/store/'
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import StripModal from './components/Modals/StripModal.vue'
export default { export default {
props: { props: {
@ -153,6 +159,7 @@ export default {
NuclideReviewModal, NuclideReviewModal,
CompareFileListModal, CompareFileListModal,
ReProcessingModal, ReProcessingModal,
StripModal,
}, },
data() { data() {
return { return {
@ -205,6 +212,8 @@ export default {
currChannel: -1, currChannel: -1,
compareFileListModalVisible: false, // Compare compareFileListModalVisible: false, // Compare
isStrip: false,
reprocessingModalVisible: false, // reprocessingModalVisible: false, //
isProcessing: false, // isProcessing: false, //
websock: null, websock: null,
@ -1196,7 +1205,7 @@ export default {
}, },
// //
showCompareModal() { showCompareModal(isStrip) {
if (this.isLoading) { if (this.isLoading) {
this.$message.warn('Sample is Loading') this.$message.warn('Sample is Loading')
return return
@ -1204,21 +1213,55 @@ export default {
this.handleResetChart() this.handleResetChart()
this.clearCompareLine() this.clearCompareLine()
this.compareFileListModalVisible = true this.compareFileListModalVisible = true
this.isStrip = isStrip
}, },
// //
handleCompareWithFile([channelData, energyData]) { async handleFileSelect(selectedFileName) {
this.channelCompareLine = channelData const { inputFileName: fileName } = this.sample
this.energyCompareLine = energyData
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
if (this.isScatter()) { try {
lineSeries.type = 'scatterGL' 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 线 // Compare 线

View File

@ -57,10 +57,6 @@
<load-from-file-modal v-model="loadFromFileModalVisible" @loadFormFile="handleLoadSampleFromFile" /> <load-from-file-modal v-model="loadFromFileModalVisible" @loadFormFile="handleLoadSampleFromFile" />
<!-- 从文件加载结束 --> <!-- 从文件加载结束 -->
<!-- Strip 弹窗开始 -->
<strip-modal v-model="stripModalVisible" />
<!-- Strip 弹窗结束 -->
<!-- Ftransit 弹窗开始 --> <!-- Ftransit 弹窗开始 -->
<ftranslt-modal v-model="ftransltModalVisible" /> <ftranslt-modal v-model="ftransltModalVisible" />
<!-- Ftransit 弹窗结束 --> <!-- Ftransit 弹窗结束 -->
@ -231,7 +227,6 @@ import BetaGammaRlrModal from './components/Modals/BetaGammaModals/BetaGammaRLRM
import StatisticsParamerHistoryModal from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModal.vue' import StatisticsParamerHistoryModal from './components/Modals/BetaGammaModals/StatisticsParamerHistoryModal.vue'
import FtransltModal from './components/Modals/FtransltModal/index.vue' import FtransltModal from './components/Modals/FtransltModal/index.vue'
import BetaGammaEnergyCalibrationModal from './components/Modals/BetaGammaModals/BetaGammaEnergyCalibrationModal/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 AutomaticAnalysisLogModal from './components/Modals/BetaGammaModals/AutomaticAnalysisLogModal.vue'
import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue' import BetaGammaExtrapolationModal from './components/Modals/BetaGammaModals/BetaGammaExtrapolationModal.vue'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
@ -277,7 +272,6 @@ export default {
StatisticsParamerHistoryModal, StatisticsParamerHistoryModal,
FtransltModal, FtransltModal,
BetaGammaEnergyCalibrationModal, BetaGammaEnergyCalibrationModal,
StripModal,
AutomaticAnalysisLogModal, AutomaticAnalysisLogModal,
BetaGammaExtrapolationModal, BetaGammaExtrapolationModal,
}, },
@ -303,7 +297,6 @@ export default {
loadFromDbModalVisible: false, // loadFromDbModalVisible: false, //
loadFromFileModalVisible: false, // loadFromFileModalVisible: false, //
stripModalVisible: false, // Strip
ftransltModalVisible: false, // Ftransit ftransltModalVisible: false, // Ftransit
sampleData: {}, // sampleData: {}, //
@ -723,13 +716,13 @@ export default {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Compare', title: 'Compare',
show: this.isGamma, show: this.isGamma,
handler: () => this.$refs.gammaAnalysisRef.showCompareModal(), handler: () => this.$refs.gammaAnalysisRef.showCompareModal(false),
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Strip', title: 'Strip',
show: this.isGamma, show: this.isGamma,
handler: () => (this.stripModalVisible = true), handler: () => this.$refs.gammaAnalysisRef.showCompareModal(true),
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
@ -933,6 +926,7 @@ export default {
}, },
{ {
title: 'NUCLIDELIBRARY', title: 'NUCLIDELIBRARY',
show: !this.isBetaGamma,
children: [ children: [
{ {
type: 'a-menu', type: 'a-menu',
@ -940,13 +934,11 @@ export default {
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Nuclide Library', title: 'Nuclide Library',
show: this.isGamma,
handler: () => (this.nuclideLibraryModalVisible = true), handler: () => (this.nuclideLibraryModalVisible = true),
}, },
{ {
type: 'a-menu-item', type: 'a-menu-item',
title: 'Config User Library', title: 'Config User Library',
show: this.isGamma,
handler: () => (this.configUserLibModalVisible = true), handler: () => (this.configUserLibModalVisible = true),
}, },
], ],