2023-07-13 19:18:23 +08:00
|
|
|
<template>
|
|
|
|
<custom-modal v-model="visible" :width="1000" title="Data Processing Log">
|
2023-08-31 09:59:14 +08:00
|
|
|
<a-spin :spinning="isLoading">
|
|
|
|
<pre class="data-processing-log">{{ text }}</pre>
|
|
|
|
</a-spin>
|
2023-09-06 15:12:15 +08:00
|
|
|
<div slot="custom-footer" style="text-align: center;">
|
|
|
|
<a-space :size="20">
|
|
|
|
<a-button type="primary" @click="handleOk">Export</a-button>
|
|
|
|
<a-button @click="visible = false">Cancel</a-button>
|
|
|
|
</a-space>
|
|
|
|
</div>
|
2023-07-13 19:18:23 +08:00
|
|
|
</custom-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import ModalMixin from '@/mixins/ModalMixin'
|
2023-08-31 09:59:14 +08:00
|
|
|
import { getAction } from '@/api/manage'
|
2023-09-05 16:31:09 +08:00
|
|
|
import { saveAs } from 'file-saver';
|
2023-07-13 19:18:23 +08:00
|
|
|
export default {
|
|
|
|
mixins: [ModalMixin],
|
2023-08-31 09:59:14 +08:00
|
|
|
props: {
|
|
|
|
sampleId: {
|
|
|
|
type: Number
|
|
|
|
}
|
|
|
|
},
|
2023-07-13 19:18:23 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2023-08-31 09:59:14 +08:00
|
|
|
text: "",
|
|
|
|
isLoading: false,
|
2023-09-06 15:12:15 +08:00
|
|
|
fileName: ''
|
2023-08-31 09:59:14 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
beforeModalOpen() {
|
|
|
|
this.getViewGammaviewerLog();
|
|
|
|
},
|
|
|
|
getViewGammaviewerLog() {
|
|
|
|
this.isLoading = true
|
|
|
|
let params = {
|
2023-09-05 16:31:09 +08:00
|
|
|
sampleId: this.sampleId,
|
|
|
|
fileName:"CAX05_001-20230731_1528_S_FULL_37563.6.PHD"
|
2023-08-31 09:59:14 +08:00
|
|
|
}
|
|
|
|
getAction("/gamma/viewGammaviewerLog", params).then(res => {
|
|
|
|
this.isLoading = false
|
|
|
|
if (res.success) {
|
|
|
|
this.text = res.result
|
|
|
|
} else {
|
|
|
|
this.$message.warning("This operation fails. Contact your system administrator")
|
|
|
|
}
|
|
|
|
})
|
2023-09-05 16:31:09 +08:00
|
|
|
},
|
|
|
|
handleOk() {
|
|
|
|
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' });
|
2023-09-06 15:12:15 +08:00
|
|
|
// saveAs(strData, `GammaViewer Log.txt`)
|
|
|
|
let _this = this
|
|
|
|
this.$confirm({
|
|
|
|
title: 'Please enter file name',
|
|
|
|
content: h => <a-input v-model={_this.fileName} />,
|
|
|
|
okText: 'Save',
|
|
|
|
cancelText: 'Cancle',
|
|
|
|
onOk() {
|
|
|
|
if (_this.fileName) {
|
|
|
|
_this.visible = false
|
|
|
|
saveAs(strData, `${_this.fileName}.txt`)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onCancel() {
|
|
|
|
console.log('Cancel');
|
|
|
|
},
|
|
|
|
});
|
2023-07-13 19:18:23 +08:00
|
|
|
}
|
2023-08-31 09:59:14 +08:00
|
|
|
},
|
2023-07-13 19:18:23 +08:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.data-processing-log {
|
2023-08-31 09:59:14 +08:00
|
|
|
height: 450px;
|
2023-07-17 19:37:46 +08:00
|
|
|
max-height: 450px;
|
2023-07-13 19:18:23 +08:00
|
|
|
padding: 5px;
|
|
|
|
overflow: auto;
|
|
|
|
background-color: #285367;
|
|
|
|
}
|
|
|
|
</style>
|