Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev

This commit is contained in:
orgin 2023-11-08 14:35:11 +08:00
commit 385f0d7bd0
10 changed files with 47 additions and 62 deletions

View File

@ -1,10 +1,9 @@
<template> <template>
<global-layout> <global-layout>
<transition name="page-transition"> <transition name="page-transition">
<keep-alive v-if="keepAlive"> <keep-alive>
<router-view /> <router-view />
</keep-alive> </keep-alive>
<router-view v-else />
</transition> </transition>
</global-layout> </global-layout>
</template> </template>
@ -22,14 +21,6 @@
} }
}, },
computed: {
keepAlive () {
return this.$route.meta.keepAlive
}
},
methods: {
},
} }
</script> </script>

View File

@ -1,9 +1,8 @@
<template> <template>
<div class="main"> <div class="main">
<keep-alive :include="includedComponents"> <keep-alive>
<router-view v-if="keepAlive" /> <router-view />
</keep-alive> </keep-alive>
<router-view v-if="!keepAlive" />
</div> </div>
</template> </template>

View File

@ -1,4 +1,4 @@
import { TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts' import { TabLayout, RouteView, BlankLayout, PageView, BasicLayout } from '@/components/layouts'
import Login from '@/views/user/Login' import Login from '@/views/user/Login'
/** /**
@ -10,7 +10,7 @@ export const asyncRouterMap = [
{ {
path: '/', path: '/',
name: 'dashboard', name: 'dashboard',
component: TabLayout, component: BasicLayout,
meta: { title: '首页' }, meta: { title: '首页' },
redirect: '/station-operation', redirect: '/station-operation',
children: [ children: [

View File

@ -88,7 +88,7 @@ export function generateIndexRouter(data) {
path: '/', path: '/',
name: 'dashboard', name: 'dashboard',
//component: () => import('@/components/layouts/BasicLayout'), //component: () => import('@/components/layouts/BasicLayout'),
component: resolve => require(['@/components/layouts/TabLayout'], resolve), component: resolve => require(['@/components/layouts/BasicLayout'], resolve),
meta: { title: '首页' }, meta: { title: '首页' },
redirect: '/station-operation', redirect: '/station-operation',
children: [ children: [

View File

@ -99,6 +99,7 @@ const columns = [
] ]
export default { export default {
name: 'LogManage',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
components: { components: {
TreeWithLine TreeWithLine

View File

@ -183,15 +183,15 @@ export default {
sampleInfo: { sampleInfo: {
type: Object, type: Object,
}, },
analyseCurrentSpectrum: { // analyseCurrentSpectrum: {
type: Object, // type: Object,
}, // },
}, },
data() { data() {
this.SampleType = SampleType this.SampleType = SampleType
return { return {
// analyseCurrentSpectrum: {}, analyseCurrentSpectrum: {},
qcFlags: {}, qcFlags: {},
spectraVisible: false, spectraVisible: false,
@ -539,9 +539,9 @@ export default {
} }
const minX = left - 10, const minX = left - 10,
maxX = right + 10, maxX = right + 10,
minY = bottom - 10, minY = bottom - 10,
maxY = top + 10 maxY = top + 10
this.$refs.betaGammaChartRef.setRange(minX, maxX, 'x') this.$refs.betaGammaChartRef.setRange(minX, maxX, 'x')
this.$refs.betaGammaChartRef.setRange(minY, maxY, 'y') this.$refs.betaGammaChartRef.setRange(minY, maxY, 'y')
@ -590,7 +590,7 @@ export default {
data: newVal.XeData, data: newVal.XeData,
}) })
}, },
immediate: true, // immediate: true,
deep: true, deep: true,
}, },
sampleInfo: { sampleInfo: {

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

@ -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,64 +15,48 @@
<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

@ -53,8 +53,8 @@
@reAnalyAll="getReAnalyAll" @reAnalyAll="getReAnalyAll"
:sampleInfo="sampleInfo" :sampleInfo="sampleInfo"
:sample="sampleData" :sample="sampleData"
:analyseCurrentSpectrum="analyseCurrentSpectrumData"
/> />
<!-- :analyseCurrentSpectrum="analyseCurrentSpectrumData" -->
<!-- Beta-Gamma 分析 --> <!-- Beta-Gamma 分析 -->
<div v-else class="empty">Please Select a Sample</div> <div v-else class="empty">Please Select a Sample</div>
<resize-observer @notify="handleResize" /> <resize-observer @notify="handleResize" />
@ -259,6 +259,7 @@ const ANALYZE_TYPE = {
BETA_GAMMA: 'betaGammaAnalysis', BETA_GAMMA: 'betaGammaAnalysis',
} }
export default { export default {
name: 'SpectrumAnalysis',
components: { components: {
BetaGammaAnalysis, BetaGammaAnalysis,
GammaAnalysis, GammaAnalysis,
@ -375,7 +376,7 @@ export default {
betaGammaRlrModalVisible: false, // beta-gamma RLR betaGammaRlrModalVisible: false, // beta-gamma RLR
statisticsParamerHistoryModalVisible: false, // beta-gamma Statistics Paramer History statisticsParamerHistoryModalVisible: false, // beta-gamma Statistics Paramer History
bgLogViewerVisible: false, // beta-gamma Log BG log viewer bgLogViewerVisible: false, // beta-gamma Log BG log viewer
analyseCurrentSpectrumData: {}, // analyseCurrentSpectrumData: {},
resultDisplayFlag: [], resultDisplayFlag: [],
params_toDB: { params_toDB: {
comment: '', comment: '',
@ -466,7 +467,7 @@ export default {
this.params_toDB.checkDet = val.checkDet this.params_toDB.checkDet = val.checkDet
}, },
getXeData(val) { getXeData(val) {
this.$set(this.analyseCurrentSpectrumData, 'XeData', val) // this.$set(this.analyseCurrentSpectrumData, 'XeData', val)
this.resultDisplayFlag = val this.resultDisplayFlag = val
}, },
// formDB sampleData // formDB sampleData

View File

@ -173,6 +173,7 @@ import { getAction } from '../../api/manage'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
const key = 'updateList' const key = 'updateList'
export default { export default {
name: 'StationOperation',
components: { components: {
Map, Map,
MapMarker, MapMarker,