analysis模块reports ARR/RRR 增加文件保存功能

This commit is contained in:
renpy 2023-09-05 17:50:36 +08:00
parent 0a4615e261
commit 301a42b93e

View File

@ -5,7 +5,7 @@
</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">Export</a-button> <a-button type="primary" @click="handleOk">Export</a-button>
<a-button @click="visible = false">Cancel</a-button> <a-button @click="visible = false">Cancel</a-button>
</a-space> </a-space>
</div> </div>
@ -15,6 +15,7 @@
<script> <script>
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '../../../../api/manage' import { getAction } from '../../../../api/manage'
import { saveAs } from 'file-saver';
export default { export default {
mixins: [ModalMixin], mixins: [ModalMixin],
props: { props: {
@ -76,6 +77,10 @@ export default {
if (this.sampleId) { if (this.sampleId) {
this.getContent() this.getContent()
} }
},
handleOk() {
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
saveAs(strData, `${this.type == 1 || this.type == 3 ? 'ARR' : 'RRR'}.txt`)
} }
} }
} }