Zero Time中的保存功能对接
This commit is contained in:
parent
8835f93580
commit
3bfaa90408
|
@ -7,9 +7,7 @@
|
|||
<title-over-border title="Fission Product Infomation">
|
||||
<div class="fission-product">
|
||||
<div class="fission-product-container">
|
||||
<div class="fission-product-title">
|
||||
Fission Product 1
|
||||
</div>
|
||||
<div class="fission-product-title">Fission Product 1</div>
|
||||
<div class="fission-product-list">
|
||||
<div
|
||||
class="fission-product-list-item"
|
||||
|
@ -23,9 +21,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="fission-product-container">
|
||||
<div class="fission-product-title">
|
||||
Fission Product 2
|
||||
</div>
|
||||
<div class="fission-product-title">Fission Product 2</div>
|
||||
<div class="fission-product-list">
|
||||
<div
|
||||
class="fission-product-list-item"
|
||||
|
@ -53,20 +49,14 @@
|
|||
<title-over-border title="Active of Fission Product">
|
||||
<div class="active-of-fission-product">
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
Fission Product 1
|
||||
</div>
|
||||
<div class="title">Fission Product 1</div>
|
||||
<div>
|
||||
<a-input v-model="model.product1"></a-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operator">
|
||||
-----Bq-----
|
||||
</div>
|
||||
<div class="operator">-----Bq-----</div>
|
||||
<div class="item">
|
||||
<div class="title">
|
||||
Fission Product 2
|
||||
</div>
|
||||
<div class="title">Fission Product 2</div>
|
||||
<div>
|
||||
<a-input v-model="model.product2"></a-input>
|
||||
</div>
|
||||
|
@ -105,7 +95,7 @@
|
|||
<a-button type="primary" :disabled="disabled" :loading="isAnalyzing" @click="handleAnalysis">
|
||||
Analysis
|
||||
</a-button>
|
||||
<a-button type="primary">Save</a-button>
|
||||
<a-button type="primary" :disabled="disabled" @click="handleSave">Save</a-button>
|
||||
<a-button type="primary" @click="visible = false">Exit</a-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -118,15 +108,16 @@
|
|||
<script>
|
||||
import ModalMixin from '@/mixins/ModalMixin'
|
||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { getAction, getFileAction } from '@/api/manage'
|
||||
import { saveAs } from 'file-saver'
|
||||
|
||||
export default {
|
||||
components: { TitleOverBorder },
|
||||
mixins: [ModalMixin],
|
||||
props: {
|
||||
sampleId: {
|
||||
type: Number
|
||||
}
|
||||
type: Number,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -138,7 +129,8 @@ export default {
|
|||
|
||||
isAnalyzing: false,
|
||||
|
||||
result: { }
|
||||
result: {},
|
||||
fileName: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -146,7 +138,7 @@ export default {
|
|||
try {
|
||||
this.isLoading = true
|
||||
const { success, result, message } = await getAction('/gamma/ZeroTime', {
|
||||
sampleId: this.sampleId
|
||||
sampleId: this.sampleId,
|
||||
})
|
||||
if (success) {
|
||||
this.isLoading = false
|
||||
|
@ -182,11 +174,11 @@ export default {
|
|||
target: 'U-235',
|
||||
energyTFH: 'T',
|
||||
date: undefined,
|
||||
time: undefined
|
||||
time: undefined,
|
||||
}
|
||||
|
||||
this.result = {
|
||||
zeroTime: '2015-05-30 17:30:60'
|
||||
zeroTime: '2015-05-30 17:30:60',
|
||||
}
|
||||
this.getInfo()
|
||||
},
|
||||
|
@ -211,13 +203,44 @@ export default {
|
|||
} finally {
|
||||
this.isAnalyzing = false
|
||||
}
|
||||
},
|
||||
handleSave() {
|
||||
if (!this.model.product1 || !this.model.product2) {
|
||||
this.$message.warn('The Fission Product is invalid!')
|
||||
return
|
||||
}
|
||||
this.fileName = ''
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
title: 'Please enter file name',
|
||||
content: (h) => <a-input v-model={_this.fileName} />,
|
||||
okText: 'Cancle',
|
||||
cancelText: 'Save',
|
||||
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
|
||||
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
|
||||
onOk() {
|
||||
console.log('Cancel')
|
||||
},
|
||||
onCancel() {
|
||||
if (_this.fileName) {
|
||||
getFileAction('/gamma/exportZeroTimeAnalyse', _this.model).then((res) => {
|
||||
if (res.code && res.code == 500) {
|
||||
this.$message.warning('This operation fails. Contact your system administrator')
|
||||
} else {
|
||||
const blob = new Blob([res], { type: 'text/plain;charset=utf-8' })
|
||||
saveAs(blob, `${_this.fileName}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
return !this.model.nuclide1 || !this.model.nuclide2 || this.model.nuclide1 == this.model.nuclide2
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user