fix: 修改某些log等文本信息弹窗的可写性

This commit is contained in:
Xu Zhimeng 2023-11-10 14:11:25 +08:00
parent 0984cfcd5c
commit 91b29d157f
4 changed files with 31 additions and 21 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'"> <custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<pre>{{ content }}</pre> <a-textarea v-model="content" :readonly="type == 1 || type == 2"></a-textarea>
</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">
@ -145,7 +145,7 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
pre { textarea {
height: calc(100vh - 350px); height: calc(100vh - 350px);
padding: 5px; padding: 5px;
overflow: auto; overflow: auto;

View File

@ -1,7 +1,7 @@
<template> <template>
<custom-modal v-model="visible" title="BetaGamma Analyser Log" :width="800"> <custom-modal v-model="visible" title="BetaGamma Analyser Log" :width="1200">
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<a-textarea :rows="20" v-model="content"></a-textarea> <a-textarea v-model="content"></a-textarea>
</a-spin> </a-spin>
<div slot="custom-footer"> <div slot="custom-footer">
<a-button type="primary" @click="handleClick">Save As</a-button> <a-button type="primary" @click="handleClick">Save As</a-button>
@ -72,4 +72,10 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
textarea {
height: calc(100vh - 350px);
padding: 5px;
overflow: auto;
background-color: #285367;
}
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<custom-modal v-model="visible" :width="1000" title="View Sample Infomation"> <custom-modal v-model="visible" :width="1000" title="View Sample Infomation">
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<pre>{{ content }}</pre> <a-textarea v-model="content"></a-textarea>
</a-spin> </a-spin>
<div slot="custom-footer"> <div slot="custom-footer">
@ -144,8 +144,8 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
pre { textarea {
height: 450px; height: calc(100vh - 350px);
padding: 5px; padding: 5px;
overflow: auto; overflow: auto;
background-color: #285367; background-color: #285367;

View File

@ -3,16 +3,16 @@
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<a-tabs :animated="false" @change="handleTabChange"> <a-tabs :animated="false" @change="handleTabChange">
<a-tab-pane tab="Sample Spectrum" :key="1"> <a-tab-pane tab="Sample Spectrum" :key="1">
<pre>{{ content.sample && content.sample.join('\n') }}</pre> <a-textarea v-model="content.sample"></a-textarea>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="GasBg Spectrum" :key="2"> <a-tab-pane tab="GasBg Spectrum" :key="2">
<pre>{{ content.gasBg && content.gasBg.join('\n') }}</pre> <a-textarea v-model="content.gasBg"></a-textarea>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="DetBg Spectrum" :key="3"> <a-tab-pane tab="DetBg Spectrum" :key="3">
<pre>{{ content.detBg && content.detBg.join('\n') }}</pre> <a-textarea v-model="content.detBg"></a-textarea>
</a-tab-pane> </a-tab-pane>
<a-tab-pane tab="QC Spectrum" :key="4"> <a-tab-pane tab="QC Spectrum" :key="4">
<pre>{{ content.qc && content.qc.join('\n') }}</pre> <a-textarea v-model="content.qc"></a-textarea>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-spin> </a-spin>
@ -34,10 +34,10 @@ export default {
data() { data() {
return { return {
content: { content: {
detBg: [], detBg: '',
gasBg: [], gasBg: '',
qc: [], qc: '',
sample: [], sample: '',
}, },
isLoading: true, isLoading: true,
fileName: '', fileName: '',
@ -66,6 +66,10 @@ export default {
}) })
if (success) { if (success) {
if (result) { if (result) {
const keys = ['sample', 'gasBg', 'detBg', 'qc']
keys.forEach(key => {
result[key] = result[key].join('\n')
})
this.content = result this.content = result
} }
} else { } else {
@ -89,13 +93,13 @@ export default {
this.fileName = '' this.fileName = ''
let text = '' let text = ''
if (this.currTab == 1) { if (this.currTab == 1) {
text = this.content.sample.join('\n') text = this.content.sample
} else if (this.currTab == 2) { } else if (this.currTab == 2) {
text = this.content.gasBg.join('\n') text = this.content.gasBg
} else if (this.currTab == 3) { } else if (this.currTab == 3) {
text = this.content.detBg.join('\n') text = this.content.detBg
} else if (this.currTab == 4) { } else if (this.currTab == 4) {
text = this.content.qc.join('\n') text = this.content.qc
} }
if (text) { if (text) {
let name = this.newSampleData.inputFileName.split('.')[0] let name = this.newSampleData.inputFileName.split('.')[0]
@ -136,8 +140,8 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
pre { textarea {
height: 450px; height: calc(100vh - 350px);
padding: 5px; padding: 5px;
overflow: auto; overflow: auto;
background-color: #285367; background-color: #285367;