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() { handleOk() {
this.fileName = '' this.fileName = ''
if (this.content) { if (this.content) {
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' }) let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' })
// if (this.type == 1 || this.type == 3) { // if (this.type == 1 || this.type == 3) {
// saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`) // saveAs(strData, `${this.type == 1 ?'Gamma-':'Beta-'} ARR.txt`)
// } else { // } else {
// saveAs(strData, `${this.type == 2 ?'Gamma-':'Beta-'} RRR.txt`) // saveAs(strData, `${this.type == 2 ?'Gamma-':'Beta-'} RRR.txt`)
// } // }
let _this = this if (this.type == 1 || this.type == 3) {
this.$confirm({ saveAs(strData, `${name}_ARR.txt`)
title: 'Please enter file name', } else {
content: (h) => <a-input v-model={_this.fileName} />, saveAs(strData, `${name}_RRR.txt`)
okText: 'Cancle', }
cancelText: 'Save', // let _this = this
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } }, // this.$confirm({
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } }, // title: 'Please enter file name',
onOk() { // content: (h) => <a-input v-model={_this.fileName} />,
console.log('Cancel') // okText: 'Cancle',
}, // cancelText: 'Save',
onCancel() { // okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
if (_this.fileName) { // cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
saveAs(strData, `${_this.fileName}.txt`) // onOk() {
} // console.log('Cancel')
}, // },
}) // onCancel() {
// if (_this.fileName) {
// saveAs(strData, `${_this.fileName}.txt`)
// }
// },
// })
} else { } else {
this.$message.warning('No data can be saved!') this.$message.warning('No data can be saved!')
} }

View File

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

View File

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

View File

@ -55,6 +55,7 @@
<script> <script>
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import GeneralInfomation from './components/GeneralInfomation.vue' import GeneralInfomation from './components/GeneralInfomation.vue'
import TransportInfomation from './components/TransportInfomation.vue' import TransportInfomation from './components/TransportInfomation.vue'
import AnalysisResults from './components/AnalysisResults.vue' import AnalysisResults from './components/AnalysisResults.vue'
@ -104,7 +105,7 @@ const tabs = [
] ]
export default { export default {
mixins: [ModalMixin], mixins: [ModalMixin, SampleDataMixin],
components: { components: {
GeneralInfomation, GeneralInfomation,
TransportInfomation, TransportInfomation,
@ -301,24 +302,26 @@ export default {
ysical: this.addInfo.ysical || '', ysical: this.addInfo.ysical || '',
} }
postFileAction('/spectrumAnalysis/exportRLR', params).then((res) => { postFileAction('/spectrumAnalysis/exportRLR', params).then((res) => {
let name = this.newSampleData.inputFileName.split('.')[0]
const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
let _this = this saveAs(blob, `${name}RLR`)
this.$confirm({ // let _this = this
title: 'Please enter file name', // this.$confirm({
content: (h) => <a-input v-model={_this.fileName} />, // title: 'Please enter file name',
okText: 'Cancle', // content: (h) => <a-input v-model={_this.fileName} />,
cancelText: 'Save', // okText: 'Cancle',
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } }, // cancelText: 'Save',
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } }, // okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
onOk() { // cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
console.log('Cancel') // onOk() {
}, // console.log('Cancel')
onCancel() { // },
if (_this.fileName) { // onCancel() {
saveAs(blob, `${_this.fileName}`) // if (_this.fileName) {
} // saveAs(blob, `${_this.fileName}`)
}, // }
}) // },
// })
}) })
}, },
}, },

View File

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

View File

@ -85,6 +85,7 @@ export default {
this.currTab = key this.currTab = key
}, },
handleOk() { handleOk() {
console.log(this.sampleData)
this.fileName = '' this.fileName = ''
let text = '' let text = ''
if (this.currTab == 1) { if (this.currTab == 1) {
@ -97,25 +98,35 @@ export default {
text = this.content.qc.join('\n') text = this.content.qc.join('\n')
} }
if (text) { if (text) {
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([text], { type: 'text/plain;charset=utf-8' }) let strData = new Blob([text], { type: 'text/plain;charset=utf-8' })
// saveAs(strData, `GammaViewer Log.txt`) // saveAs(strData, `GammaViewer Log.txt`)
let _this = this if (this.currTab == 1) {
this.$confirm({ saveAs(strData, `${name}_Sample Spectrum.txt`)
title: 'Please enter file name', } else if (this.currTab == 2) {
content: (h) => <a-input v-model={_this.fileName} />, saveAs(strData, `${name}_GasBg Spectrum.txt`)
okText: 'Cancle', } else if (this.currTab == 3) {
cancelText: 'Save', saveAs(strData, `${name}_DetBg Spectrum.txt`)
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } }, } else if (this.currTab == 4) {
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } }, saveAs(strData, `${name}_QC Spectrum.txt`)
onOk() { }
console.log('Cancel') // let _this = this
}, // this.$confirm({
onCancel() { // title: 'Please enter file name',
if (_this.fileName) { // content: (h) => <a-input v-model={_this.fileName} />,
saveAs(strData, `${_this.fileName}.txt`) // 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 { } else {
this.$message.warning('No data can be saved!') this.$message.warning('No data can be saved!')
} }

View File

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

View File

@ -10,7 +10,7 @@
<script> <script>
import { getAction, getFileAction } from '@/api/manage' import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
const columns = [ const columns = [
{ {
@ -19,10 +19,10 @@ const columns = [
customCell: (record) => { customCell: (record) => {
return { return {
style: { style: {
backgroundColor: record.flag == 'FAIL'? 'red': '' backgroundColor: record.flag == 'FAIL' ? 'red' : '',
} },
} }
} },
}, },
{ {
title: 'Pass/Fail', title: 'Pass/Fail',
@ -30,10 +30,10 @@ const columns = [
customCell: (record) => { customCell: (record) => {
return { return {
style: { style: {
backgroundColor: record.flag == 'FAIL'? 'red': '' backgroundColor: record.flag == 'FAIL' ? 'red' : '',
} },
} }
} },
}, },
{ {
title: 'Value', title: 'Value',
@ -41,10 +41,10 @@ const columns = [
customCell: (record) => { customCell: (record) => {
return { return {
style: { style: {
backgroundColor: record.flag == 'FAIL'? 'red': '' backgroundColor: record.flag == 'FAIL' ? 'red' : '',
} },
} }
} },
}, },
{ {
title: 'Standard', title: 'Standard',
@ -52,11 +52,11 @@ const columns = [
customCell: (record) => { customCell: (record) => {
return { return {
style: { style: {
backgroundColor: record.flag == 'FAIL'? 'red': '' backgroundColor: record.flag == 'FAIL' ? 'red' : '',
} },
} }
} },
} },
] ]
export default { export default {
mixins: [ModalMixin, SampleDataMixin], mixins: [ModalMixin, SampleDataMixin],
@ -65,7 +65,7 @@ export default {
return { return {
isLoading: false, isLoading: false,
list: [], list: [],
fileName: '' fileName: '',
} }
}, },
methods: { methods: {
@ -75,7 +75,7 @@ export default {
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
const { success, result, message } = await getAction('/gamma/viewQCResult', { const { success, result, message } = await getAction('/gamma/viewQCResult', {
sampleId, sampleId,
fileName fileName,
}) })
if (success) { if (success) {
this.list = result this.list = result
@ -94,42 +94,55 @@ export default {
}, },
// Excel // Excel
handleExportToExcel() { handleExportToExcel() {
this.fileName = "" this.fileName = ''
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
if (this.list.length > 0) { if (this.list.length > 0) {
let _this = this let name = this.newSampleData.inputFileName.split('.')[0]
this.$confirm({ let params = {
title: 'Please enter file name', sampleId,
content: h => <a-input v-model={_this.fileName} />, fileName,
okText: 'Cancle', }
cancelText: 'Save', getFileAction('/gamma/exportQCResult', params).then((res) => {
okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}}, if (res.code && res.code == 500) {
cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}}, this.$message.warning('This operation fails. Contact your system administrator')
onOk() { } else {
console.log('Cancel'); const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
}, saveAs(blob, `${name}_QC Result`)
onCancel() { }
if (_this.fileName) { })
let params = { // let _this = this
sampleId, // this.$confirm({
fileName // title: 'Please enter file name',
} // content: h => <a-input v-model={_this.fileName} />,
getFileAction('/gamma/exportQCResult', params).then(res => { // okText: 'Cancle',
if (res.code && res.code == 500) { // cancelText: 'Save',
this.$message.warning("This operation fails. Contact your system administrator") // okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}},
} else { // cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}},
const blob = new Blob([res], { type: "application/vnd.ms-excel" }) // onOk() {
saveAs(blob, `${_this.fileName}`) // 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 { } else {
this.$message.warning("No downloadable data") this.$message.warning('No downloadable data')
} }
} },
} },
} }
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped></style>

View File

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

View File

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