gamma 的 save to file功能(Save as Txt ,Save as Excel)接口对接联调

gamma 的 Save PHD to File 功能接口对接,联调
This commit is contained in:
任珮宇 2023-10-16 16:12:04 +08:00
parent eddab8db4c
commit aa6ac23fd5
3 changed files with 46 additions and 34 deletions

View File

@ -2,16 +2,14 @@
<custom-modal v-model="visible" title="Save Setting" :width="380" :okHandler="handleOk"> <custom-modal v-model="visible" title="Save Setting" :width="380" :okHandler="handleOk">
<div class="save-setting"> <div class="save-setting">
<div class="save-setting-all"> <div class="save-setting-all">
<a-checkbox v-model="saveAll"> <a-checkbox v-model="saveAll"> Save All </a-checkbox>
Save All
</a-checkbox>
</div> </div>
<div> <div>
<title-over-border title="Format"> <title-over-border title="Format">
<a-radio-group v-model="saveFormat" class="format-radio-group"> <a-radio-group v-model="saveFormat" class="format-radio-group">
<a-radio value="txt">Save as Txt</a-radio> <a-radio value="txt">Save as Txt</a-radio>
<a-radio value="xls">Save as Excel</a-radio> <a-radio value="xls">Save as Excel</a-radio>
<a-radio value="html">Save as Html</a-radio> <!-- <a-radio value="html">Save as Html</a-radio> -->
</a-radio-group> </a-radio-group>
</title-over-border> </title-over-border>
</div> </div>
@ -25,13 +23,13 @@ export default {
components: { TitleOverBorder }, components: { TitleOverBorder },
props: { props: {
value: { value: {
type: Boolean type: Boolean,
} },
}, },
data() { data() {
return { return {
saveAll: false, saveAll: false,
saveFormat: 'txt' saveFormat: 'txt',
} }
}, },
methods: { methods: {
@ -42,7 +40,7 @@ export default {
handleOk() { handleOk() {
this.$emit('save', this.saveFormat) this.$emit('save', this.saveFormat)
} },
}, },
computed: { computed: {
visible: { visible: {
@ -55,9 +53,9 @@ export default {
} }
return this.value return this.value
} },
} },
} },
} }
</script> </script>

View File

@ -1193,7 +1193,6 @@ export default {
this.channelData.baseLineCP = shapeChannelData this.channelData.baseLineCP = shapeChannelData
this.energyData.baseLineCP = shapeEnergyData this.energyData.baseLineCP = shapeEnergyData
this.redrawCtrlPointBySeriesName() this.redrawCtrlPointBySeriesName()
}, },
// //
@ -1475,7 +1474,6 @@ export default {
watch: { watch: {
currStep: { currStep: {
handler(val) { handler(val) {
console.log('dfad', val)
if (val && val == '0') { if (val && val == '0') {
this.abc = true this.abc = true
this.reprocessingModalVisible = true this.reprocessingModalVisible = true
@ -1496,7 +1494,6 @@ export default {
}, },
updateFlag: { updateFlag: {
handler(val) { handler(val) {
console.log('dfad', val)
this.newCheckBox_updateCal = val this.newCheckBox_updateCal = val
}, },
immediate: true, immediate: true,

View File

@ -481,30 +481,39 @@ export default {
// //
async handleSaveResultsToFile(saveFormat) { async handleSaveResultsToFile(saveFormat) {
const url = if (this.isGamma) {
saveFormat == 'xls' const url = saveFormat == 'xls' ? '/gamma/saveToExcel' : saveFormat == 'txt' ? '/gamma/saveToTxt' : ''
? '/spectrumAnalysis/saveToExcel' let params = {
: saveFormat == 'txt' fileName: this.newSampleData.inputFileName,
? '/spectrumAnalysis/saveToTxt' }
: saveFormat == 'html' downloadFile(url, `result.${saveFormat}`, params, 'get')
? '/spectrumAnalysis/saveToHTML'
: ''
if (!this.resultDisplayFlag) {
this.$message.warn('Please Analyse Spectrum First')
return
} }
if (this.isBetaGamma) {
const url =
saveFormat == 'xls'
? '/spectrumAnalysis/saveToExcel'
: saveFormat == 'txt'
? '/spectrumAnalysis/saveToTxt'
: saveFormat == 'html'
? '/spectrumAnalysis/saveToHTML'
: ''
if (!this.resultDisplayFlag) {
this.$message.warn('Please Analyse Spectrum First')
return
}
this.resultDisplayFlag.forEach((item) => { this.resultDisplayFlag.forEach((item) => {
this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag this.params_toDB[`${item.nuclideName.toLowerCase()}Flag`] = item.nidFlag
}) })
this.params_toDB.sampleFileName = this.newSampleData.inputFileName this.params_toDB.sampleFileName = this.newSampleData.inputFileName
this.params_toDB.gasFileName = this.newSampleData.gasFileName this.params_toDB.gasFileName = this.newSampleData.gasFileName
this.params_toDB.detFileName = this.newSampleData.detFileName this.params_toDB.detFileName = this.newSampleData.detFileName
this.params_toDB.qcFileName = this.newSampleData.qcFileName this.params_toDB.qcFileName = this.newSampleData.qcFileName
this.params_toDB.dbName = this.newSampleData.dbName this.params_toDB.dbName = this.newSampleData.dbName
downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post') downloadFile(url, `result.${saveFormat}`, this.params_toDB, 'post')
}
}, },
/** /**
@ -572,6 +581,13 @@ export default {
*/ */
handleSavePHDToFile(type) { handleSavePHDToFile(type) {
console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type) console.log('%c [ savePHDToFile ]-162', 'font-size:13px; background:pink; color:#bf2c9f;', type)
if (this.isGamma) {
const url = '/gamma/saveToPHD'
let params = {
fileName: this.newSampleData.inputFileName,
}
downloadFile(url, `result.PHD`, params, 'get')
}
}, },
handleReprocessAll() { handleReprocessAll() {
@ -797,6 +813,7 @@ export default {
}, },
on: { on: {
menuClick: () => { menuClick: () => {
console.log(this.isBetaGamma, this.isGamma)
this.saveSettingModalVisible = true this.saveSettingModalVisible = true
}, },
submenuClick: ({ item, child }) => { submenuClick: ({ item, child }) => {