Zero Time中的保存功能对接
This commit is contained in:
parent
8835f93580
commit
3bfaa90408
|
@ -7,9 +7,7 @@
|
||||||
<title-over-border title="Fission Product Infomation">
|
<title-over-border title="Fission Product Infomation">
|
||||||
<div class="fission-product">
|
<div class="fission-product">
|
||||||
<div class="fission-product-container">
|
<div class="fission-product-container">
|
||||||
<div class="fission-product-title">
|
<div class="fission-product-title">Fission Product 1</div>
|
||||||
Fission Product 1
|
|
||||||
</div>
|
|
||||||
<div class="fission-product-list">
|
<div class="fission-product-list">
|
||||||
<div
|
<div
|
||||||
class="fission-product-list-item"
|
class="fission-product-list-item"
|
||||||
|
@ -23,9 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fission-product-container">
|
<div class="fission-product-container">
|
||||||
<div class="fission-product-title">
|
<div class="fission-product-title">Fission Product 2</div>
|
||||||
Fission Product 2
|
|
||||||
</div>
|
|
||||||
<div class="fission-product-list">
|
<div class="fission-product-list">
|
||||||
<div
|
<div
|
||||||
class="fission-product-list-item"
|
class="fission-product-list-item"
|
||||||
|
@ -53,20 +49,14 @@
|
||||||
<title-over-border title="Active of Fission Product">
|
<title-over-border title="Active of Fission Product">
|
||||||
<div class="active-of-fission-product">
|
<div class="active-of-fission-product">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="title">
|
<div class="title">Fission Product 1</div>
|
||||||
Fission Product 1
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<a-input v-model="model.product1"></a-input>
|
<a-input v-model="model.product1"></a-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="operator">
|
<div class="operator">-----Bq-----</div>
|
||||||
-----Bq-----
|
|
||||||
</div>
|
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="title">
|
<div class="title">Fission Product 2</div>
|
||||||
Fission Product 2
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<a-input v-model="model.product2"></a-input>
|
<a-input v-model="model.product2"></a-input>
|
||||||
</div>
|
</div>
|
||||||
|
@ -105,7 +95,7 @@
|
||||||
<a-button type="primary" :disabled="disabled" :loading="isAnalyzing" @click="handleAnalysis">
|
<a-button type="primary" :disabled="disabled" :loading="isAnalyzing" @click="handleAnalysis">
|
||||||
Analysis
|
Analysis
|
||||||
</a-button>
|
</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>
|
<a-button type="primary" @click="visible = false">Exit</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -118,15 +108,16 @@
|
||||||
<script>
|
<script>
|
||||||
import ModalMixin from '@/mixins/ModalMixin'
|
import ModalMixin from '@/mixins/ModalMixin'
|
||||||
import TitleOverBorder from '../TitleOverBorder.vue'
|
import TitleOverBorder from '../TitleOverBorder.vue'
|
||||||
import { getAction } from '@/api/manage'
|
import { getAction, getFileAction } from '@/api/manage'
|
||||||
|
import { saveAs } from 'file-saver'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { TitleOverBorder },
|
components: { TitleOverBorder },
|
||||||
mixins: [ModalMixin],
|
mixins: [ModalMixin],
|
||||||
props: {
|
props: {
|
||||||
sampleId: {
|
sampleId: {
|
||||||
type: Number
|
type: Number,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -138,7 +129,8 @@ export default {
|
||||||
|
|
||||||
isAnalyzing: false,
|
isAnalyzing: false,
|
||||||
|
|
||||||
result: { }
|
result: {},
|
||||||
|
fileName: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -146,7 +138,7 @@ export default {
|
||||||
try {
|
try {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
const { success, result, message } = await getAction('/gamma/ZeroTime', {
|
const { success, result, message } = await getAction('/gamma/ZeroTime', {
|
||||||
sampleId: this.sampleId
|
sampleId: this.sampleId,
|
||||||
})
|
})
|
||||||
if (success) {
|
if (success) {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
@ -182,11 +174,11 @@ export default {
|
||||||
target: 'U-235',
|
target: 'U-235',
|
||||||
energyTFH: 'T',
|
energyTFH: 'T',
|
||||||
date: undefined,
|
date: undefined,
|
||||||
time: undefined
|
time: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.result = {
|
this.result = {
|
||||||
zeroTime: '2015-05-30 17:30:60'
|
zeroTime: '2015-05-30 17:30:60',
|
||||||
}
|
}
|
||||||
this.getInfo()
|
this.getInfo()
|
||||||
},
|
},
|
||||||
|
@ -211,13 +203,44 @@ export default {
|
||||||
} finally {
|
} finally {
|
||||||
this.isAnalyzing = false
|
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: {
|
computed: {
|
||||||
disabled() {
|
disabled() {
|
||||||
return !this.model.nuclide1 || !this.model.nuclide2 || this.model.nuclide1 == this.model.nuclide2
|
return !this.model.nuclide1 || !this.model.nuclide2 || this.model.nuclide1 == this.model.nuclide2
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user