This commit is contained in:
orgin 2023-11-20 16:38:51 +08:00
commit de6e7ef96e
5 changed files with 23 additions and 69 deletions

View File

@ -174,6 +174,7 @@ export default {
onDbChange(val) {
this.name = val
this.dbName = undefined
this.dataSource = []
this.getDbNameList()
},
ondbNameChange(val) {

View File

@ -83,7 +83,7 @@
v-decorator="[
'name',
{
rules: [{ required: nameRequired, message: 'Please input name!' }],
rules: [{ required: true, message: 'Please input name!' }],
initialVale: this.formVal.name,
},
]"
@ -237,7 +237,6 @@ export default {
},
data() {
return {
nameRequired: false,
loading: false,
isAdd: true,
visible: false,
@ -444,8 +443,7 @@ export default {
this.currentId = ''
},
onTest() {
this.nameRequired = false
this.form.validateFields((err, values) => {
this.form.validateFields(['dbType', 'dbDriver', 'dbUrl', 'dbUsername', 'dbPassword'], (err, values) => {
if (!err) {
let loading = this.$message.loading('连接中……', 0)
postAction('/online/cgreport/api/testConnection', values)
@ -462,10 +460,6 @@ export default {
})
},
onSave() {
this.nameRequired = true
this.$nextTick(() => {
this.form.validateFields(['name'], { force: true })
})
this.form.validateFields((err, values) => {
if (!err) {
if (this.isAdd) {

View File

@ -1,7 +1,7 @@
<template>
<custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
<a-spin :spinning="isLoading">
<a-textarea v-model="content" :readonly="type == 1 || type == 2"></a-textarea>
<a-textarea style="font-family: 宋体" v-model="content" :readonly="type == 1 || type == 2"></a-textarea>
</a-spin>
<div slot="custom-footer" style="text-align: center">
<a-space :size="20">

View File

@ -12,6 +12,7 @@
<script>
import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import { fetchAndDownload } from '@/utils/file'
import { saveAs } from 'file-saver'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
@ -31,7 +32,7 @@ const columns = [
dataIndex: 'value',
align: 'center',
customRender: (text) => {
if (text !== 'Match' && text !== 'UnMatch') {
if (text !== 'Match' && text !== 'UnMatch' && text !== 'None') {
return parseFloat(Number(text).toPrecision(6))
} else {
return text
@ -142,37 +143,21 @@ export default {
this.list = []
this.getData()
},
SaveText() {
this.fileName = ''
this.text = `#QC RESULT\n${this.columns[0].title} ${this.columns[1].title} ${this.columns[2].title} ${this.columns[3].title}\n`
this.list.forEach((item) => {
let str = ''
str += `${item.qcFlags} `
str += `${item.evaluationMetrics} `
str += `${item.value} `
str += `${item.status} \n`
this.text += str
})
let name = this.newSampleData.inputFileName.split('.')[0]
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' })
saveAs(strData, `${name}_QC Result.txt`)
// 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) {
// saveAs(strData, `${_this.fileName}.txt`)
// }
// },
// })
async SaveText() {
let url = '/spectrumAnalysis/exportQCResultTXT'
const { sampleId, inputFileName: fileName, dbName, detFileName, gasFileName } = this.newSampleData
let params = {
sampleId: sampleId || '',
dbName,
sampleFileName: fileName,
gasFileName,
detFileName,
}
try {
await fetchAndDownload(url, params, 'get')
} catch (error) {
console.error(error)
}
},
// Excel
handleExportToExcel() {
@ -195,34 +180,6 @@ export default {
saveAs(blob, `${name}_QC Result`)
}
})
// let _this = this
// this.$confirm({
// title: 'Please enter file name',
// content: (h) => <a-input v-model={_this.fileName_excel} />,
// 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_excel) {
// let params = {
// sampleId: sampleId || '',
// fileName,
// }
// getFileAction('/spectrumAnalysis/exportQCResult', params).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: 'application/vnd.ms-excel' })
// saveAs(blob, `${_this.fileName_excel}`)
// }
// })
// }
// },
// })
} else {
this.$message.warning('No downloadable data')
}

View File

@ -159,6 +159,7 @@ const initialOption = {
top: 20,
bottom: 60,
},
tooltip: {},
legend: {
show: false,
orient: 'vertical',
@ -357,6 +358,7 @@ export default {
color: item.m_GraphPen,
},
symbol: 'circle',
symbolSize: 8,
}
})
} else {