完成analysis模块Gamma下面 log 菜单弹窗中的文件保存功能

This commit is contained in:
renpy 2023-09-05 16:31:09 +08:00
parent 595e71c2f4
commit ac6f99933b
4 changed files with 26 additions and 3 deletions

View File

@ -26,6 +26,7 @@
"echarts": "^5.4.2",
"echarts-gl": "^2.0.9",
"enquire.js": "^2.1.6",
"file-saver": "^2.0.5",
"js-cookie": "^2.2.0",
"lodash.get": "^4.4.2",
"lodash.pick": "^4.4.0",
@ -56,6 +57,7 @@
"xss": "^1.0.13"
},
"devDependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/polyfill": "^7.2.5",
"@types/crypto-js": "^4.1.1",
"@vue/cli-plugin-babel": "^3.3.0",

View File

@ -12,6 +12,7 @@
import { getAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { saveAs } from 'file-saver';
export default {
mixins: [ModalMixin, SampleDataMixin],
@ -46,7 +47,8 @@ export default {
},
handleOk() {
console.log('%c [ ]-15', 'font-size:13px; background:pink; color:#bf2c9f;')
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
saveAs(strData, `Automatic Analysis Log.txt`)
}
}
}

View File

@ -5,7 +5,7 @@
</a-spin>
<div slot="custom-footer" style="text-align: center;">
<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-space>
</div>
@ -15,6 +15,7 @@
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage'
import { saveAs } from 'file-saver';
export default {
mixins: [ModalMixin],
props: {
@ -35,7 +36,8 @@ export default {
getViewGammaviewerLog() {
this.isLoading = true
let params = {
sampleId: this.sampleId
sampleId: this.sampleId,
fileName:"CAX05_001-20230731_1528_S_FULL_37563.6.PHD"
}
getAction("/gamma/viewGammaviewerLog", params).then(res => {
this.isLoading = false
@ -45,6 +47,10 @@ export default {
this.$message.warning("This operation fails. Contact your system administrator")
}
})
},
handleOk() {
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' });
saveAs(strData, `GammaViewer Log.txt`)
}
},
}

View File

@ -69,6 +69,19 @@ module.exports = {
.use()
.loader('babel-loader')
.end()
config.module
.rule('ol')
.test(/\.js$/)
.include
.add(resolve('node_modules/ol'))
.end()
.use()
.loader('babel-loader')
.options({
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-proposal-nullish-coalescing-operator']
})
.end()
},
css: {