Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev

This commit is contained in:
orgin 2023-10-28 20:46:09 +08:00
commit c46da76c99
10 changed files with 443 additions and 337 deletions

View File

@ -103,29 +103,35 @@ export default {
handleOk() {
this.fileName = ''
if (this.content) {
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' })
// if (this.type == 1 || this.type == 3) {
// saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`)
// } else {
// saveAs(strData, `${this.type == 2 ?'Gamma-':'Beta-'} RRR.txt`)
// }
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() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
if (this.type == 1 || this.type == 3) {
saveAs(strData, `${name}_ARR.txt`)
} else {
saveAs(strData, `${name}_RRR.txt`)
}
},
})
// 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() {
// if (_this.fileName) {
// saveAs(strData, `${_this.fileName}.txt`)
// }
// },
// })
} else {
this.$message.warning('No data can be saved!')
}

View File

@ -37,9 +37,10 @@ export default {
async getInfo() {
try {
this.isLoading = true
const { sampleId } = this.sampleData
const { sampleId, sampleFileName } = this.sampleData
const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '/spectrumAnalysis/viewAutomaticAnalysisLog', { // gammam,beta
sampleId
sampleId,
sampleFileName
})
if(typeof res == 'string') {
this.content = res

View File

@ -146,58 +146,76 @@ export default {
str += `${item.status} \n`
this.text += str
})
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' })
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() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
}
},
})
saveAs(strData, `${name}_QC Result.txt`)
// 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() {
// if (_this.fileName) {
// saveAs(strData, `${_this.fileName}.txt`)
// }
// },
// })
},
// Excel
handleExportToExcel() {
this.fileName_excel = ''
const { sampleId, inputFileName: fileName } = this.sampleData
const { sampleId, inputFileName: fileName, dbName, detFileName, gasFileName } = this.newSampleData
if (this.list.length > 0) {
let _this = this
this.$confirm({
title: 'Please enter file name',
content: (h) => <a-input v-model={_this.fileName_excel} />,
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() {
if (_this.fileName_excel) {
let name = this.newSampleData.inputFileName.split('.')[0]
let params = {
sampleId: sampleId || '',
fileName,
dbName,
sampleFileName: fileName,
gasFileName,
detFileName,
}
getFileAction('/spectrumAnalysis/exportQCResult', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${_this.fileName_excel}`)
saveAs(blob, `${name}_QC Result`)
}
})
}
},
})
// let _this = this
// this.$confirm({
// title: 'Please enter file name',
// content: (h) => <a-input v-model={_this.fileName_excel} />,
// 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() {
// if (_this.fileName_excel) {
// let params = {
// sampleId: sampleId || '',
// fileName,
// }
// getFileAction('/spectrumAnalysis/exportQCResult', params).then((res) => {
// if (res.code && res.code == 500) {
// this.$message.warning('This operation fails. Contact your system administrator')
// } else {
// const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
// saveAs(blob, `${_this.fileName_excel}`)
// }
// })
// }
// },
// })
} else {
this.$message.warning('No downloadable data')
}

View File

@ -55,6 +55,7 @@
<script>
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import GeneralInfomation from './components/GeneralInfomation.vue'
import TransportInfomation from './components/TransportInfomation.vue'
import AnalysisResults from './components/AnalysisResults.vue'
@ -104,7 +105,7 @@ const tabs = [
]
export default {
mixins: [ModalMixin],
mixins: [ModalMixin, SampleDataMixin],
components: {
GeneralInfomation,
TransportInfomation,
@ -301,24 +302,26 @@ export default {
ysical: this.addInfo.ysical || '',
}
postFileAction('/spectrumAnalysis/exportRLR', params).then((res) => {
let name = this.newSampleData.inputFileName.split('.')[0]
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
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() {
if (_this.fileName) {
saveAs(blob, `${_this.fileName}`)
}
},
})
saveAs(blob, `${name}RLR`)
// 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() {
// if (_this.fileName) {
// saveAs(blob, `${_this.fileName}`)
// }
// },
// })
})
},
},

View File

@ -64,25 +64,27 @@ export default {
saveText() {
this.fileName = ''
if (this.content) {
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' })
// saveAs(strData, `Beta-View Sample Infomation.txt`)
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() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
}
},
})
saveAs(strData, `${name}_Sample Infomation.txt`)
// 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() {
// if (_this.fileName) {
// saveAs(strData, `${_this.fileName}.txt`)
// }
// },
// })
} else {
this.$message.warning('No data can be saved!')
}
@ -91,35 +93,48 @@ export default {
handleExportToExcel() {
this.fileName_excel = ''
const { sampleId, inputFileName: fileName } = this.sampleData
let name = this.newSampleData.inputFileName.split('.')[0]
if (this.content) {
let _this = this
this.$confirm({
title: 'Please enter file name',
content: (h) => <a-input v-model={_this.fileName_excel} />,
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() {
if (_this.fileName_excel) {
let params = {
sampleId: sampleId || '',
fileName,
sampleFileName: fileName,
}
getFileAction('/spectrumAnalysis/exportSampleInformation', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${_this.fileName_excel}`)
saveAs(blob, `${name}_Sample Infomation`)
}
})
}
},
})
// let _this = this
// this.$confirm({
// title: 'Please enter file name',
// content: (h) => <a-input v-model={_this.fileName_excel} />,
// 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() {
// if (_this.fileName_excel) {
// let params = {
// sampleId: sampleId || '',
// fileName,
// }
// getFileAction('/spectrumAnalysis/exportSampleInformation', params).then((res) => {
// if (res.code && res.code == 500) {
// this.$message.warning('This operation fails. Contact your system administrator')
// } else {
// const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
// saveAs(blob, `${_this.fileName_excel}`)
// }
// })
// }
// },
// })
} else {
this.$message.warning('No downloadable data')
}

View File

@ -85,6 +85,7 @@ export default {
this.currTab = key
},
handleOk() {
console.log(this.sampleData)
this.fileName = ''
let text = ''
if (this.currTab == 1) {
@ -97,25 +98,35 @@ export default {
text = this.content.qc.join('\n')
}
if (text) {
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([text], { type: 'text/plain;charset=utf-8' })
// saveAs(strData, `GammaViewer Log.txt`)
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() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
if (this.currTab == 1) {
saveAs(strData, `${name}_Sample Spectrum.txt`)
} else if (this.currTab == 2) {
saveAs(strData, `${name}_GasBg Spectrum.txt`)
} else if (this.currTab == 3) {
saveAs(strData, `${name}_DetBg Spectrum.txt`)
} else if (this.currTab == 4) {
saveAs(strData, `${name}_QC Spectrum.txt`)
}
},
})
// 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() {
// if (_this.fileName) {
// saveAs(strData, `${_this.fileName}.txt`)
// }
// },
// })
} else {
this.$message.warning('No data can be saved!')
}

View File

@ -48,71 +48,71 @@
<script>
import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import { saveAs } from 'file-saver';
import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin'
const columns = [
{
title: 'Nuclide',
dataIndex: 'nuclide'
dataIndex: 'nuclide',
},
{
title: 'HalfLife',
dataIndex: 'halfLife'
dataIndex: 'halfLife',
},
{
title: 'Energy (keV)',
dataIndex: 'energy',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
},
{
title: 'Yield (%)',
dataIndex: 'yield'
dataIndex: 'yield',
},
{
title: 'Efficiency',
dataIndex: 'efficiency',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
},
{
title: 'Activity (Bq)',
dataIndex: 'activity',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
},
{
title: 'Act Err (%)',
dataIndex: 'actErr',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
},
{
title: 'MDA (Bq)',
dataIndex: 'mda',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
},
{
title: 'Conc (uBq/m3)',
dataIndex: 'conc',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
},
{
title: 'MDC (uBq/m3)',
dataIndex: 'mdc',
customRender: text => {
customRender: (text) => {
return text && text !== 'null' ? Number(text).toPrecision(5) : text
}
}
},
},
]
export default {
mixins: [ModalMixin, SampleDataMixin],
@ -121,14 +121,14 @@ export default {
return {
queryParam: {
activityReferenceTime: undefined,
concentrationReferenceTime: undefined
concentrationReferenceTime: undefined,
},
compareVisible: false,
isLoading: false,
list: [],
compareList: [],
fileName: ''
fileName: '',
}
},
methods: {
@ -143,7 +143,7 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/radionuclideActivity', {
sampleId,
fileName
fileName,
})
if (success) {
const { dateTime_act_ref, dateTime_con_ref, table } = result
@ -167,42 +167,55 @@ export default {
// Excel
handleExportToExcel() {
this.fileName = ""
this.fileName = ''
const { sampleId, inputFileName: fileName } = this.sampleData
if (this.list.length > 0) {
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() {
if (_this.fileName) {
let name = this.newSampleData.inputFileName.split('.')[0]
let params = {
sampleId,
fileName
fileName,
}
getFileAction('/gamma/exportRadionuclideActivity', params).then(res => {
getFileAction('/gamma/exportRadionuclideActivity', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
saveAs(blob, `${_this.fileName}`)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${name}_Nuclide Activity and MDC`)
}
})
// 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() {
// if (_this.fileName) {
// let params = {
// sampleId,
// fileName
// }
// getFileAction('/gamma/exportRadionuclideActivity', params).then(res => {
// if (res.code && res.code == 500) {
// this.$message.warning("This operation fails. Contact your system administrator")
// } else {
// const blob = new Blob([res], { type: "application/vnd.ms-excel" })
// saveAs(blob, `${_this.fileName}`)
// }
// })
// }
// },
// });
} else {
this.$message.warning('No downloadable data')
}
},
});
} else {
this.$message.warning("No downloadable data")
}
}
}
},
}
</script>

View File

@ -10,7 +10,7 @@
<script>
import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import { saveAs } from 'file-saver';
import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin'
const columns = [
{
@ -19,44 +19,44 @@ const columns = [
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
backgroundColor: record.flag == 'FAIL' ? 'red' : '',
},
}
},
},
{
title: 'Pass/Fail',
dataIndex: 'flag',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
backgroundColor: record.flag == 'FAIL' ? 'red' : '',
},
}
},
},
{
title: 'Value',
dataIndex: 'value',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
backgroundColor: record.flag == 'FAIL' ? 'red' : '',
},
}
},
},
{
title: 'Standard',
dataIndex: 'standard',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
}
backgroundColor: record.flag == 'FAIL' ? 'red' : '',
},
}
},
},
]
export default {
mixins: [ModalMixin, SampleDataMixin],
@ -65,7 +65,7 @@ export default {
return {
isLoading: false,
list: [],
fileName: ''
fileName: '',
}
},
methods: {
@ -75,7 +75,7 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/viewQCResult', {
sampleId,
fileName
fileName,
})
if (success) {
this.list = result
@ -94,42 +94,55 @@ export default {
},
// Excel
handleExportToExcel() {
this.fileName = ""
this.fileName = ''
const { sampleId, inputFileName: fileName } = this.sampleData
if (this.list.length > 0) {
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() {
if (_this.fileName) {
let name = this.newSampleData.inputFileName.split('.')[0]
let params = {
sampleId,
fileName
fileName,
}
getFileAction('/gamma/exportQCResult', params).then(res => {
getFileAction('/gamma/exportQCResult', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
saveAs(blob, `${_this.fileName}`)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${name}_QC Result`)
}
})
// 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() {
// if (_this.fileName) {
// let params = {
// sampleId,
// fileName
// }
// getFileAction('/gamma/exportQCResult', params).then(res => {
// if (res.code && res.code == 500) {
// this.$message.warning("This operation fails. Contact your system administrator")
// } else {
// const blob = new Blob([res], { type: "application/vnd.ms-excel" })
// saveAs(blob, `${_this.fileName}`)
// }
// })
// }
// },
// });
} else {
this.$message.warning('No downloadable data')
}
},
});
} else {
this.$message.warning("No downloadable data")
}
}
}
},
}
</script>
<style lang="less" scoped></style>

View File

@ -10,7 +10,7 @@
</a-row>
</div>
</a-spin>
<div slot="custom-footer" style="text-align: center;">
<div slot="custom-footer" style="text-align: center">
<a-space :size="20">
<a-button type="primary" @click="handleExportToExcel">Export to Excel</a-button>
<a-button @click="visible = false">Close</a-button>
@ -28,60 +28,60 @@ import SampleDataMixin from '../../SampleDataMixin'
const columns = [
{
title: 'Station Id',
key: 'stationId'
key: 'stationId',
},
{
title: 'Detector Id',
key: 'detectorId'
key: 'detectorId',
},
{
title: 'Sample Id',
key: 'sampleId'
key: 'sampleId',
},
{
title: 'Sample Geometry',
key: 'sampleGeometry'
key: 'sampleGeometry',
},
{
title: 'Sample Quantity',
key: 'sampleQuantity'
key: 'sampleQuantity',
},
{
title: 'Sample Type',
key: 'sampleType'
key: 'sampleType',
},
{
title: 'Collection Start',
key: 'collectStart'
key: 'collectStart',
},
{
title: 'Sampling Time',
key: 'samplingTime'
key: 'samplingTime',
},
{
title: 'Collection Stop',
key: 'collectStop'
key: 'collectStop',
},
{
title: 'Decay Time',
key: 'decayTime'
key: 'decayTime',
},
{
title: 'Acquisition Start',
key: 'acquisitionStart'
key: 'acquisitionStart',
},
{
title: 'Acquisition Time',
key: 'acquisitionTime'
key: 'acquisitionTime',
},
{
title: 'Acquisition Stop',
key: 'acquisitionStop'
key: 'acquisitionStop',
},
{
title: 'Avg Flow Rate',
key: 'avgFlowRate'
}
key: 'avgFlowRate',
},
]
export default {
@ -91,7 +91,7 @@ export default {
return {
isLoading: false,
data: {},
fileName: ''
fileName: '',
}
},
methods: {
@ -101,7 +101,7 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/sampleInformation', {
sampleId,
fileName
fileName,
})
if (success) {
result.sampleId = sampleId
@ -125,39 +125,52 @@ export default {
this.fileName = ''
const { sampleId, inputFileName: fileName } = this.sampleData
if (Object.keys(this.data).length > 0) {
let _this = this
this.$confirm({
title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />,
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() {
if (_this.fileName) {
let name = this.newSampleData.inputFileName.split('.')[0]
let params = {
sampleId,
fileName
fileName,
}
getFileAction('/gamma/exportSampleInformation', params).then(res => {
getFileAction('/gamma/exportSampleInformation', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${_this.fileName}`)
}
})
}
saveAs(blob, `${name}_Sample Infomation`)
}
})
// 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() {
// if (_this.fileName) {
// let params = {
// sampleId,
// fileName
// }
// getFileAction('/gamma/exportSampleInformation', params).then(res => {
// if (res.code && res.code == 500) {
// this.$message.warning('This operation fails. Contact your system administrator')
// } else {
// const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
// saveAs(blob, `${_this.fileName}`)
// }
// })
// }
// }
// })
} else {
this.$message.warning('No downloadable data')
}
}
}
},
},
}
</script>

View File

@ -32,7 +32,7 @@
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction, getFileAction } from '@/api/manage'
import { saveAs } from 'file-saver';
import { saveAs } from 'file-saver'
import SampleDataMixin from '../SampleDataMixin'
const columns = [
@ -42,44 +42,44 @@ const columns = [
align: 'center',
customRender: (_, __, index) => {
return index + 1
}
},
},
{
title: 'Energy(keV)',
dataIndex: 'energy'
dataIndex: 'energy',
},
{
title: 'Centroid',
dataIndex: 'centroid'
dataIndex: 'centroid',
},
{
title: 'Multiplet',
dataIndex: 'multiplet'
dataIndex: 'multiplet',
},
{
title: 'Fwhm(keV)',
dataIndex: 'fwhm'
dataIndex: 'fwhm',
},
{
title: 'NetArea',
dataIndex: 'netArea'
dataIndex: 'netArea',
},
{
title: 'AreaErr(%)',
dataIndex: 'areaErr'
dataIndex: 'areaErr',
},
{
title: 'Significant',
dataIndex: 'significant'
dataIndex: 'significant',
},
{
title: 'Sensitivity',
dataIndex: 'sensitivity'
dataIndex: 'sensitivity',
},
{
title: 'Indentify',
dataIndex: 'indentify'
}
dataIndex: 'indentify',
},
]
export default {
mixins: [ModalMixin, SampleDataMixin],
@ -90,7 +90,7 @@ export default {
compareList: [],
compareVisible: false, //
isLoading: false,
fileName: ''
fileName: '',
}
},
methods: {
@ -105,7 +105,7 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/peakInformation', {
sampleId,
fileName
fileName,
})
if (success) {
this.list = result
@ -126,42 +126,55 @@ export default {
// Excel
handleExportToExcel() {
this.fileName = ""
this.fileName = ''
const { sampleId, inputFileName: fileName } = this.sampleData
if (this.list.length > 0) {
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() {
if (_this.fileName) {
let name = this.newSampleData.inputFileName.split('.')[0]
let params = {
sampleId,
fileName
fileName,
}
getFileAction('/gamma/exportPeakInformation', params).then(res => {
getFileAction('/gamma/exportPeakInformation', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
saveAs(blob, `${_this.fileName}`)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${name}_Peak Infomation`)
}
})
// 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() {
// if (_this.fileName) {
// let params = {
// sampleId,
// fileName
// }
// getFileAction('/gamma/exportPeakInformation', params).then(res => {
// if (res.code && res.code == 500) {
// this.$message.warning("This operation fails. Contact your system administrator")
// } else {
// const blob = new Blob([res], { type: "application/vnd.ms-excel" })
// saveAs(blob, `${_this.fileName}`)
// }
// })
// }
// },
// });
} else {
this.$message.warning('No downloadable data')
}
},
});
} else {
this.$message.warning("No downloadable data")
}
}
}
},
}
</script>