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"
>
<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-col>
<a-button class="search-btn" type="primary" @click="onSearch">

View File

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

View File

@ -13,7 +13,7 @@
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
import { showSaveFileModal } from '@/utils/file'
import { saveAs } from 'file-saver'
export default {
mixins: [ModalMixin, SampleDataMixin],
data() {
@ -25,7 +25,14 @@ export default {
async getDetail() {
try {
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', {
dbName,
sampleId,
@ -34,7 +41,7 @@ export default {
detFileName,
qcFileName,
})
if(typeof result == 'string') {
if (typeof result == 'string') {
this.content = result
} else {
const { success, result, message } = res
@ -56,8 +63,9 @@ export default {
},
handleClick() {
let name = this.newSampleData.inputFileName.split('.')[0]
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))
matchedSampleList.forEach(
({ dbName, sampleId, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
({ dbName, sampleId, inputFileName, sampleFileName, gasFileName, detFileName, qcFileName, qcFileStatus }) => {
dbNames.push(dbName || '')
sampleIds.push(sampleId || '')
sampleFileNames.push(sampleFileName)
gasFileNames.push(gasFileName)
detFileNames.push(detFileName)
sampleFileNames.push(sampleFileName || inputFileName || '')
gasFileNames.push(gasFileName || '')
detFileNames.push(detFileName || '')
qcFileNames.push(qcFileStatus ? qcFileName : '')
}
)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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