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) { onDbChange(val) {
this.name = val this.name = val
this.dbName = undefined this.dbName = undefined
this.dataSource = []
this.getDbNameList() this.getDbNameList()
}, },
ondbNameChange(val) { ondbNameChange(val) {

View File

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

View File

@ -1,7 +1,7 @@
<template> <template>
<custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'"> <custom-modal v-model="visible" :width="1200" :title="type == 1 || type == 3 ? 'ARR' : 'RRR'">
<a-spin :spinning="isLoading"> <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> </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">

View File

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

View File

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