This commit is contained in:
xiaoguangbin 2023-11-08 18:05:19 +08:00
commit b7dc606372
11 changed files with 133 additions and 107 deletions

View File

@ -10,7 +10,10 @@
:style="item.style" :style="item.style"
> >
<a-form-model-item :label="item.label" :prop="item.name" :labelCol="item.labelCol"> <a-form-model-item :label="item.label" :prop="item.name" :labelCol="item.labelCol">
<component :is="item.type" v-bind="item.props" v-model="formModel[item.name]" v-on="item.on"></component> <a-checkbox v-if="item.type == 'a-checkbox'" v-model="formModel[item.name]" v-on="item.on">
{{ item.innerLabel }}
</a-checkbox>
<component v-else :is="item.type" v-bind="item.props" v-model="formModel[item.name]" v-on="item.on"></component>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-button class="search-btn" type="primary" @click="onSearch"> <a-button class="search-btn" type="primary" @click="onSearch">

View File

@ -1349,7 +1349,6 @@ export default {
this.resetChartOpts() this.resetChartOpts()
}) })
this.BaseCtrls = cloneDeep(this.baseCtrls_Copy)
this.replotNeeded = false this.replotNeeded = false
} else { } else {
this.$message.error(message) this.$message.error(message)

View File

@ -13,7 +13,7 @@
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin' import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { showSaveFileModal } from '@/utils/file' import { saveAs } from 'file-saver'
export default { export default {
mixins: [ModalMixin, SampleDataMixin], mixins: [ModalMixin, SampleDataMixin],
data() { data() {
@ -25,7 +25,14 @@ export default {
async getDetail() { async getDetail() {
try { try {
this.isLoading = true this.isLoading = true
const { dbName, sampleId, inputFileName: sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData const {
dbName,
sampleId,
inputFileName: sampleFileName,
gasFileName,
detFileName,
qcFileName,
} = this.newSampleData
const result = await getAction('/spectrumAnalysis/viewBGLogViewer', { const result = await getAction('/spectrumAnalysis/viewBGLogViewer', {
dbName, dbName,
sampleId, sampleId,
@ -34,7 +41,7 @@ export default {
detFileName, detFileName,
qcFileName, qcFileName,
}) })
if(typeof result == 'string') { if (typeof result == 'string') {
this.content = result this.content = result
} else { } else {
const { success, result, message } = res const { success, result, message } = res
@ -56,8 +63,9 @@ export default {
}, },
handleClick() { handleClick() {
let name = this.newSampleData.inputFileName.split('.')[0]
const blob = new Blob([this.content], { type: 'text/plain' }) const blob = new Blob([this.content], { type: 'text/plain' })
showSaveFileModal(blob, 'txt') saveAs(blob, `${name}_beta analysis log.txt`)
}, },
}, },
} }

View File

@ -111,12 +111,12 @@ export default {
const matchedSampleList = this.sampleList.filter((item) => item.inputFileName.includes(currStationName)) const matchedSampleList = this.sampleList.filter((item) => item.inputFileName.includes(currStationName))
matchedSampleList.forEach( matchedSampleList.forEach(
({ dbName, sampleId, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => { ({ dbName, sampleId, inputFileName, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
dbNames.push(dbName || '') dbNames.push(dbName || '')
sampleIds.push(sampleId || '') sampleIds.push(sampleId || '')
sampleFileNames.push(sampleFileName) sampleFileNames.push(sampleFileName || inputFileName || '')
gasFileNames.push(gasFileName) gasFileNames.push(gasFileName || '')
detFileNames.push(detFileName) detFileNames.push(detFileName || '')
qcFileNames.push(qcFileStatus ? qcFileName : '') qcFileNames.push(qcFileStatus ? qcFileName : '')
} }
) )

View File

@ -1,11 +1,12 @@
<template> <template>
<custom-modal v-model="visible" :width="1200" title="File List"> <custom-modal v-model="visible" :width="1200" title="File List">
<search-form :items="formItems" v-model="queryParam" @search="searchQuery"></search-form> <search-form :items="formItems" v-model="queryParam" @search="handleSearch"></search-form>
<custom-table <custom-table
rowKey="name"
:columns="columns" :columns="columns"
:list="dataSource" :list="dataSource"
:loading="loading" :loading="isLoading"
:pagination="ipagination" :pagination="pagination"
:selectedRowKeys.sync="selectedRowKeys" :selectedRowKeys.sync="selectedRowKeys"
:selectionRows.sync="selectionRows" :selectionRows.sync="selectionRows"
:scroll="{ y: 440 }" :scroll="{ y: 440 }"
@ -20,7 +21,6 @@
<script> <script>
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
const columns = [ const columns = [
@ -29,79 +29,98 @@ const columns = [
dataIndex: 'name', dataIndex: 'name',
width: '45%', width: '45%',
align: 'left', align: 'left',
ellipsis: true ellipsis: true,
}, },
{ {
title: 'UpdateDate', title: 'UpdateDate',
dataIndex: 'updateDate', dataIndex: 'updateDate',
align: 'left' align: 'left',
}, },
{ {
title: 'Size', title: 'Size',
dataIndex: 'size', dataIndex: 'size',
align: 'left' align: 'left',
} },
] ]
const formItems = [ const formItems = [
{ {
label: '', label: '',
type: 'a-input', type: 'a-input',
name: 'searchName', name: 'name',
props: { props: {
placeholder: 'search...' placeholder: 'search...',
} },
} },
] ]
export default { export default {
mixins: [ModalMixin, JeecgListMixin], mixins: [ModalMixin],
data() { data() {
this.columns = columns this.columns = columns
this.formItems = formItems this.formItems = formItems
return { return {
inited: false,
queryParam: {}, queryParam: {},
dataSource: [],
selectedRowKeys: [], selectedRowKeys: [],
selectionRows: [] selectionRows: [],
pagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
const { current, pageSize } = this.pagination
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
},
showQuickJumper: true,
showSizeChanger: true,
total: 0,
},
} }
}, },
methods: { methods: {
beforeModalOpen() { beforeModalOpen() {
this.selectedRowKeys = [] this.selectedRowKeys = []
if(!this.inited) {
this.inited = true
this.getList()
}
}, },
loadData(arg) { async getList() {
// 1 try {
if (arg === 1) { this.isLoading = true
this.ipagination.current = 1 const params = {
...this.queryParam,
pageNo: this.pagination.current,
pageSize: this.pagination.pageSize,
} }
this.onClearSelected() const { success, result, message } = await getAction('/spectrumFile/get', params)
if (success) {
const params = this.getQueryParams() // this.dataSource = result.records
const searchName = this.queryParam.searchName this.pagination.total = result.total
params.name = searchName
this.loading = true
getAction('/spectrumFile/get', params)
.then(res => {
if (res.success) {
this.dataSource = res.result.records
this.dataSource.forEach((item, index) => {
item.id = index
})
if (res.result.total) {
this.ipagination.total = res.result.total
} else { } else {
this.ipagination.total = 0 this.$message.error(message)
} }
} else { } catch (error) {
this.$message.warning(res.message) console.error(error)
} finally {
this.isLoading = false
} }
})
.finally(() => {
this.loading = false
})
}, },
handleTableChange(pagination, filters, sorter) {
this.pagination = pagination
this.getList()
},
handleSearch() {
this.pagination.current = 1
this.getList()
},
async handleOk() { async handleOk() {
if (!this.selectedRowKeys.length) { if (!this.selectedRowKeys.length) {
this.$message.warn('Please Select A File to Compare') this.$message.warn('Please Select A File to Compare')
@ -110,8 +129,8 @@ export default {
this.$emit('fileSelect', this.selectionRows[0].name) this.$emit('fileSelect', this.selectionRows[0].name)
this.visible = false this.visible = false
} },
} },
} }
</script> </script>

View File

@ -3,7 +3,7 @@
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<pre class="data-processing-log">{{ text }}</pre> <pre class="data-processing-log">{{ text }}</pre>
</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">
<a-button type="primary" @click="handleOk">Export</a-button> <a-button type="primary" @click="handleOk">Export</a-button>
<a-button @click="visible = false">Cancel</a-button> <a-button @click="visible = false">Cancel</a-button>
@ -15,65 +15,49 @@
<script> <script>
import ModalMixin from '@/mixins/ModalMixin' import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { saveAs } from 'file-saver'; import { saveAs } from 'file-saver'
import SampleDataMixin from '../../SampleDataMixin' import SampleDataMixin from '../../SampleDataMixin'
export default { export default {
mixins: [ModalMixin, SampleDataMixin], mixins: [ModalMixin, SampleDataMixin],
data() { data() {
return { return {
text: "", text: '',
isLoading: false, isLoading: false,
fileName: '' fileName: '',
} }
}, },
methods: { methods: {
beforeModalOpen() { beforeModalOpen() {
this.getViewGammaviewerLog(); this.getViewGammaviewerLog()
}, },
getViewGammaviewerLog() { getViewGammaviewerLog() {
this.isLoading = true this.isLoading = true
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
let params = { let params = {
sampleId, sampleId,
fileName fileName,
} }
getAction("/gamma/viewGammaViewerLog", params).then(res => { getAction('/gamma/viewGammaViewerLog', params).then((res) => {
this.isLoading = false this.isLoading = false
if (res.success) { if (res.success) {
this.text = res.result this.text = res.result
} else { } else {
this.text = "" this.text = ''
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
handleOk() { handleOk() {
this.fileName="" this.fileName = ''
if (this.text) { if (this.text) {
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' }); let name = this.newSampleData.inputFileName.split('.')[0]
// saveAs(strData, `GammaViewer Log.txt`) let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' })
let _this = this saveAs(strData, `${name}_gamma analysis log.txt`)
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`)
}
},
});
} else { } else {
this.$message.warning("No data can be saved!") this.$message.warning('No data can be saved!')
}
} }
}, },
},
} }
</script> </script>

View File

@ -324,6 +324,7 @@ export default {
data: scatterPoint.pointlist.map(({ x, y }) => { data: scatterPoint.pointlist.map(({ x, y }) => {
return { return {
value: [x, y], value: [x, y],
symbolSize: 5,
itemStyle: { itemStyle: {
color: scatterPoint.color, color: scatterPoint.color,
borderWidth: 0, borderWidth: 0,

View File

@ -286,6 +286,7 @@ export default {
data: scatterPoint.pointlist.map(({ x, y }) => { data: scatterPoint.pointlist.map(({ x, y }) => {
return { return {
value: [x, y], value: [x, y],
symbolSize: 5,
itemStyle: { itemStyle: {
color: scatterPoint.color, color: scatterPoint.color,
borderWidth: 0, borderWidth: 0,

View File

@ -285,6 +285,7 @@ export default {
data: scatterPoint.pointlist.map(({ x, y }) => { data: scatterPoint.pointlist.map(({ x, y }) => {
return { return {
value: [x, y], value: [x, y],
symbolSize: 5,
itemStyle: { itemStyle: {
color: scatterPoint.color, color: scatterPoint.color,
borderWidth: 0, borderWidth: 0,

View File

@ -184,16 +184,23 @@ export default {
watch: { watch: {
$route: { $route: {
handler: function (val, oldVal) { handler: function (val, oldVal) {
if (val.name !== 'station-operation') { console.log('fasdfasde12312', val)
this.$message.destroy() console.log('8765432', oldVal)
clearInterval(this.timer) if (val.name === 'station-operation') {
this.timer = null this.getDataProvisionEfficiency(this.markerList_clone)
} }
}, },
deep: true, deep: true,
immediate: true, // immediate: true,
}, },
}, },
deactivated() {
//
console.log('切换出发了3')
this.$message.destroy()
clearInterval(this.timer)
this.timer = null
},
data() { data() {
return { return {
activeKey: '1', activeKey: '1',

View File

@ -292,7 +292,7 @@ export default {
props: { props: {
allowClear: true, allowClear: true,
style: { style: {
width: '190px', width: '187px',
}, },
}, },
style: { style: {
@ -315,7 +315,7 @@ export default {
filterOption: this.filterOption, filterOption: this.filterOption,
allowClear: true, allowClear: true,
style: { style: {
width: '190px', width: '187px',
}, },
}, },
style: { style: {
@ -338,7 +338,7 @@ export default {
filterOption: this.filterOption, filterOption: this.filterOption,
allowClear: true, allowClear: true,
style: { style: {
width: '190px', width: '187px',
}, },
}, },
style: { style: {
@ -355,7 +355,7 @@ export default {
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss',
style: { style: {
minWidth: 'auto', minWidth: 'auto',
width: '282px', width: '279px',
}, },
}, },
style: { style: {
@ -372,7 +372,7 @@ export default {
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss',
style: { style: {
minWidth: 'auto', minWidth: 'auto',
width: '282px', width: '279px',
}, },
}, },
style: { style: {
@ -380,16 +380,19 @@ export default {
}, },
}, },
{ {
label: '', type: 'a-checkbox',
type: 'a-checkbox-group', name: 'collectStopCheck',
props: { innerLabel: 'Collect Stop',
options: [
{ label: 'Collect Stop', value: 'collectStop' },
{ label: 'Acq.Start', value: 'acqDotStart' },
],
},
style: { style: {
width: '230px', width: '132px',
},
},
{
type: 'a-checkbox',
name: 'acqDotStartCheck',
innerLabel: 'Acq.Start',
style: {
width: '113px',
}, },
}, },
] ]