2023-07-13 19:18:23 +08:00
|
|
|
<template>
|
|
|
|
<custom-modal v-model="visible" title="Spectrum Comments" :okHandler="handleOk" :footer="isAdd ? undefined : null">
|
2023-08-28 19:52:35 +08:00
|
|
|
<a-spin :spinning="isLoading">
|
|
|
|
<a-textarea v-model="comments" :rows="8" :disabled="!isAdd"></a-textarea>
|
|
|
|
</a-spin>
|
2023-07-13 19:18:23 +08:00
|
|
|
</custom-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-08-28 19:52:35 +08:00
|
|
|
import { getAction } from '@/api/manage'
|
2023-07-13 19:18:23 +08:00
|
|
|
import ModalMixin from '@/mixins/ModalMixin'
|
2023-09-05 19:06:19 +08:00
|
|
|
import SampleDataMixin from '../../SampleDataMixin'
|
|
|
|
|
2023-07-13 19:18:23 +08:00
|
|
|
export default {
|
2023-09-05 19:06:19 +08:00
|
|
|
mixins: [ModalMixin, SampleDataMixin],
|
2023-07-13 19:18:23 +08:00
|
|
|
props: {
|
|
|
|
isAdd: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2023-08-28 19:52:35 +08:00
|
|
|
isLoading: false,
|
2023-07-13 19:18:23 +08:00
|
|
|
comments: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// ModalMixin 中的生命周期方法
|
|
|
|
beforeModalOpen() {
|
2023-08-28 19:52:35 +08:00
|
|
|
if (this.isAdd) {
|
|
|
|
this.comments = ''
|
|
|
|
} else {
|
|
|
|
this.getInfo()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
async getInfo() {
|
|
|
|
try {
|
|
|
|
this.isLoading = true
|
2023-09-05 19:06:19 +08:00
|
|
|
const { sampleId, inputFileName: fileName } = this.sampleData
|
2023-08-28 19:52:35 +08:00
|
|
|
const { success, result, message } = await getAction('/gamma/viewComment', {
|
2023-09-05 19:06:19 +08:00
|
|
|
sampleId,
|
|
|
|
fileName
|
2023-08-28 19:52:35 +08:00
|
|
|
})
|
|
|
|
this.isLoading = false
|
|
|
|
if (success) {
|
|
|
|
this.comments = result
|
|
|
|
} else {
|
|
|
|
this.$message.error(message)
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
2023-07-13 19:18:23 +08:00
|
|
|
},
|
|
|
|
handleOk() {
|
|
|
|
console.log('%c [ ]-26', 'font-size:13px; background:pink; color:#bf2c9f;', this.comments)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|