This commit is contained in:
xiaoguangbin 2023-10-27 16:47:45 +08:00
commit 34d884ee7a
17 changed files with 351 additions and 275 deletions

View File

@ -1,6 +1,6 @@
const sample = {
state: {
sampleList: []
sampleList: [] // [{ inputFileName: String; data: Object; }]
},
mutations: {
SET_SAMPLE_LIST: (state, sampleList) => {
@ -8,12 +8,12 @@ const sample = {
},
ADD_SAMPLE_DATA: (state, sampleData) => {
state.sampleList.push(sampleData)
},
GET_SAMPLE_DATA: (state, inputFileName) => {
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
return find
const find = state.sampleList.find(item => item.inputFileName == sampleData.inputFileName)
if(find) {
find.data = sampleData.data
} else {
state.sampleList.push(sampleData)
}
},
REMOVE_SAMPLE_DATA: (state, inputFileName) => {
@ -24,6 +24,12 @@ const sample = {
CLEAR_SAMPLE_DATA: () => {
state.sampleList = []
}
},
actions: {
GET_SAMPLE_DATA: ({ state }, inputFileName) => {
const find = state.sampleList.find(item => item.inputFileName == inputFileName)
return find ? find : null
}
}
}

View File

@ -235,7 +235,7 @@ export default {
async getSampleDetail() {
this.spectraType = this.SampleType[0].value
const { dbName, sampleId } = this.sample
const { dbName, sampleId, inputFileName } = this.sample
try {
this.isLoading = true
this.cancelLastRequest()
@ -251,11 +251,14 @@ export default {
if (success) {
this.sampleDetail = result
this.changeChartByType('sample')
this.$emit('getFiles', {
detFileName: result.detBg.fileName,
gasFileName: result.gasBg.fileName,
qcFileName: result.qc.fileName || '',
this.emitGetFiles(result)
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName,
data: result,
from: 'db'
})
} else {
this.$message.error(message)
}
@ -265,6 +268,15 @@ export default {
this.isLoading = false
}
},
emitGetFiles(result) {
this.$emit('getFiles', {
detFileName: result.detBg.fileName,
gasFileName: result.gasBg.fileName,
qcFileName: result.qc ? result.qc.fileName : ''
})
},
async getSampleDetail_file() {
this.spectraType = this.SampleType[0].value
let params = {
@ -285,6 +297,12 @@ export default {
if (success) {
this.sampleDetail = result
this.changeChartByType('sample')
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName: this.sample.sampleFileName,
data: result,
from: 'file'
})
this.isLoading = false
} else {
this.$message.error(message)
@ -435,12 +453,23 @@ export default {
},
watch: {
sample: {
handler(newVal, oldVal) {
async handler(newVal, oldVal) {
this.resultDisplay = []
if (newVal.sampleId) {
this.getSampleDetail()
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
if(sampleData) {
const { data, from } = sampleData
this.sampleDetail = data
this.changeChartByType('sample')
if(from == 'db') {
this.sampleDetail = data
this.emitGetFiles(data)
}
} else {
this.getSampleDetail_file()
if (newVal.sampleId) {
this.getSampleDetail()
} else {
this.getSampleDetail_file()
}
}
},
immediate: true,

View File

@ -1,4 +1,5 @@
import { deleteAction } from '@/api/manage'
import store from '@/store'
/**
* 发起请求清理后端对sample的缓存
* @param {Array<any>} sampleList
@ -13,5 +14,6 @@ export const clearSampleCache = (sampleList) => {
params = { sampleFileName , qcFileName }
}
deleteAction(url, params)
store.commit('REMOVE_SAMPLE_DATA', fileName)
})
}

View File

@ -56,17 +56,7 @@ export default {
try {
this.content = ''
this.isLoading = true
console.log(this.sampleData)
const {
sampleId,
inputFileName: fileName,
dbName,
detFileName,
gasFileName,
qcFileName,
sampleFileName,
} = this.sampleData
// const method = this.type == 4 ? postAction : getAction
const { sampleId, inputFileName: fileName, dbName, detFileName, gasFileName, qcFileName } = this.newSampleData
let res = null
if (this.type == 4) {
let params = {
@ -76,7 +66,7 @@ export default {
gasBgData: this.extraData.GasBgData,
detBgData: this.extraData.DetBgData,
qcData: this.extraData.QCData,
sampleFileName,
sampleFileName: fileName,
gasFileName,
detFileName,
qcFileName,
@ -85,7 +75,7 @@ export default {
} else {
res = await getAction(url, {
sampleId,
fileName,
// fileName,
...this.extraData,
})
}

View File

@ -38,7 +38,7 @@ export default {
try {
this.isLoading = true
const { sampleId } = this.sampleData
const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '/gamma/viewAutomaticAnalysisLog', { // gammam,beta
const res = await getAction(this.type == 1 ? '/gamma/viewAutomaticAnalysisLog' : '/spectrumAnalysis/viewAutomaticAnalysisLog', { // gammam,beta
sampleId
})
if(typeof res == 'string') {

View File

@ -34,6 +34,10 @@ export default {
type: Boolean,
default: true,
},
comment: {
type: String,
default: '',
},
},
data() {
return {
@ -56,7 +60,9 @@ export default {
})
if (res.success) {
this.comments = res.result
this.$emit('sedInfo', this.comments)
if(this.value) { //
this.comments.spectrumAnalysisCommentInfo = this.comment
}
} else {
this.$message.error(res.message)
}
@ -72,7 +78,9 @@ export default {
this.getCommets()
},
handleOk() {
console.log('%c [ ]-26', 'font-size:13px; background:pink; color:#bf2c9f;', this.comments)
this.$emit('sendInfo', this.comments)
this.$message.success('Commit successful')
this.visible = false
},
},
}

View File

@ -706,7 +706,7 @@ export default {
return
}
const { sampleId, dbName, sampleFileName, detFileName } = this.sampleData
const { sampleId, dbName, inputFileName: sampleFileName, detFileName } = this.newSampleData
try {
const params = {
sampleId,

View File

@ -12,49 +12,49 @@
<script>
import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import { saveAs } from 'file-saver';
import { saveAs } from 'file-saver'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
const columns = [
{
title: 'QC Flags',
dataIndex: 'qcFlags',
align: 'center'
align: 'center',
},
{
title: 'Evaluation Metrics',
dataIndex: 'evaluationMetrics',
align: 'center'
align: 'center',
},
{
title: 'Value',
dataIndex: 'value',
align: 'center'
align: 'center',
},
{
title: 'Status',
dataIndex: 'status',
align: 'center',
scopedSlots: {
customRender: 'status'
customRender: 'status',
},
customCell: record => {
customCell: (record) => {
return {
style: {
backgroundColor: record.status.toLowerCase() == 'pass' ? '#008000 !important' : '#f00 !important'
}
backgroundColor: record.status.toLowerCase() == 'pass' ? '#008000 !important' : '#f00 !important',
},
}
}
}
},
},
]
export default {
mixins: [ModalMixin, SampleDataMixin],
props: {
sampleId: {
type: Number
}
},
// props: {
// sampleId: {
// type: Number
// }
// },
data() {
this.columns = columns
return {
@ -62,15 +62,20 @@ export default {
isLoading: false,
text: '',
fileName: '',
fileName_excel: ''
fileName_excel: '',
}
},
methods: {
async getData() {
const { sampleId, inputFileName: fileName, dbName, detFileName, gasFileName } = this.newSampleData
try {
this.isLoading = true
const res = await getAction('/spectrumAnalysis/viewQCResult', {
sampleId: this.sampleId
sampleId,
dbName,
sampleFileName: fileName,
gasFileName,
detFileName,
})
if (res.success) {
const result = res.result
@ -79,42 +84,42 @@ export default {
qcFlags: 'Collection Time (h)',
evaluationMetrics: result.collectTimeEvaluationMetrics,
value: result.collectTimeValue,
status: result.collectTimeStatus
status: result.collectTimeStatus,
})
this.list.push({
qcFlags: 'Acquisition Time (h)',
evaluationMetrics: result.acquisitionTimeEvaluationMetrics,
value: result.acquisitionTimeValue,
status: result.acquisitionTimeStatus
status: result.acquisitionTimeStatus,
})
this.list.push({
qcFlags: 'Xenon Volume (ml)',
evaluationMetrics: result.xenonVolumeEvaluationMetrics,
value: result.xenonVolumeValue,
status: result.xenonVolumeStatus
status: result.xenonVolumeStatus,
})
this.list.push({
qcFlags: 'Gas Bg',
evaluationMetrics: result.gasBgValueAndStatus,
value: result.gasBgValueAndStatus ? 'Match' : 'UnMatch',
status: result.gasBgValueAndStatus ? 'Pass' : 'Failed'
status: result.gasBgValueAndStatus ? 'Pass' : 'Failed',
})
this.list.push({
qcFlags: 'Det Bg',
evaluationMetrics: result.detBgValueAndStatus,
value: result.detBgValueAndStatus ? 'Match' : 'UnMatch',
status: result.detBgValueAndStatus ? 'Pass' : 'Failed'
status: result.detBgValueAndStatus ? 'Pass' : 'Failed',
})
this.list.push({
qcFlags: 'MDC for Xe133(mBq/m3)',
evaluationMetrics: result.xe133MDCEvaluationMetrics,
value: result.xe133MDCValue,
status: result.xe133MDCStatus
status: result.xe133MDCStatus,
})
} else {
this.$message.error(res.message)
@ -131,73 +136,73 @@ export default {
this.getData()
},
SaveText() {
this.fileName=""
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 = ""
this.list.forEach((item) => {
let str = ''
str += `${item.qcFlags} `
str += `${item.evaluationMetrics} `
str += `${item.value} `
str += `${item.status} \n`
this.text+=str
this.text += str
})
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' });
let strData = new Blob([this.text], { type: 'text/plain;charset=utf-8' })
let _this = this
this.$confirm({
title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />,
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"}},
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() {
console.log('Cancel');
console.log('Cancel')
},
onCancel() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
}
},
});
})
},
// Excel
handleExportToExcel() {
this.fileName_excel = ""
this.fileName_excel = ''
const { sampleId, inputFileName: fileName } = this.sampleData
if (this.list.length>0) {
if (this.list.length > 0) {
let _this = this
this.$confirm({
title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName_excel} />,
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"}},
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() {
console.log('Cancel');
console.log('Cancel')
},
onCancel() {
if (_this.fileName_excel) {
let params = {
sampleId: sampleId || "",
fileName
sampleId: sampleId || '',
fileName,
}
getFileAction('/spectrumAnalysis/exportQCResult', params).then(res => {
getFileAction('/spectrumAnalysis/exportQCResult', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${_this.fileName_excel}`)
}
})
}
},
});
})
} else {
this.$message.warning("No downloadable data")
this.$message.warning('No downloadable data')
}
}
}
},
},
}
</script>
<style lang="less" scoped></style>

View File

@ -17,21 +17,21 @@
<script>
import { getAction, getFileAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
import { saveAs } from 'file-saver';
import { saveAs } from 'file-saver'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
export default {
mixins: [ModalMixin, SampleDataMixin],
props: {
sampleId: {
type: Number
}
type: Number,
},
},
data() {
return {
content: '',
isLoading: true,
fileName: '',
fileName_excel: ''
fileName_excel: '',
}
},
methods: {
@ -40,13 +40,13 @@ export default {
this.content = ''
this.isLoading = true
const res = await getAction('/spectrumAnalysis/viewSampleInformation', {
sampleId: this.sampleId
sampleId: this.sampleId,
sampleFileName: this.newSampleData.inputFileName,
})
if(res.success) {
if (res.success) {
this.content = res.result
}
else {
this.content = ""
} else {
this.content = ''
this.$message.error(res.message)
}
} catch (error) {
@ -57,74 +57,74 @@ export default {
},
beforeModalOpen() {
if (this.sampleId) {
this.getContent()
}
// if (this.sampleId) {
this.getContent()
// }
},
saveText() {
this.fileName=""
if (this.content) {
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' });
this.fileName = ''
if (this.content) {
let strData = new Blob([this.content], { type: 'text/plain;charset=utf-8' })
// saveAs(strData, `Beta-View Sample Infomation.txt`)
let _this = this
this.$confirm({
title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />,
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"}},
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() {
console.log('Cancel');
console.log('Cancel')
},
onCancel() {
if (_this.fileName) {
saveAs(strData, `${_this.fileName}.txt`)
}
},
});
})
} else {
this.$message.warning("No data can be saved!")
this.$message.warning('No data can be saved!')
}
},
// Excel
handleExportToExcel() {
this.fileName_excel = ""
this.fileName_excel = ''
const { sampleId, inputFileName: fileName } = this.sampleData
if (this.content) {
let _this = this
this.$confirm({
title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName_excel} />,
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"}},
okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() {
console.log('Cancel');
console.log('Cancel')
},
onCancel() {
if (_this.fileName_excel) {
let params = {
sampleId: sampleId || "",
fileName
sampleId: sampleId || '',
fileName,
}
getFileAction('/spectrumAnalysis/exportSampleInformation', params).then(res => {
getFileAction('/spectrumAnalysis/exportSampleInformation', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
saveAs(blob, `${_this.fileName_excel}`)
}
})
}
},
});
})
} else {
this.$message.warning("No downloadable data")
this.$message.warning('No downloadable data')
}
}
}
},
},
}
</script>

View File

@ -3,16 +3,16 @@
<a-spin :spinning="isLoading">
<a-tabs :animated="false" @change="handleTabChange">
<a-tab-pane tab="Sample Spectrum" :key="1">
<pre>{{ content.sample.join('\n') }}</pre>
<pre>{{ content.sample && content.sample.join('\n') }}</pre>
</a-tab-pane>
<a-tab-pane tab="GasBg Spectrum" :key="2">
<pre>{{ content.gasBg.join('\n') }}</pre>
<pre>{{ content.gasBg && content.gasBg.join('\n') }}</pre>
</a-tab-pane>
<a-tab-pane tab="DetBg Spectrum" :key="3">
<pre>{{ content.detBg.join('\n') }}</pre>
<pre>{{ content.detBg && content.detBg.join('\n') }}</pre>
</a-tab-pane>
<a-tab-pane tab="QC Spectrum" :key="4">
<pre>{{ content.qc.join('\n') }}</pre>
<pre>{{ content.qc && content.qc.join('\n') }}</pre>
</a-tab-pane>
</a-tabs>
</a-spin>
@ -28,13 +28,9 @@
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '../../../../../api/manage'
import SampleDataMixin from '@/views/spectrumAnalysis/SampleDataMixin'
export default {
mixins: [ModalMixin],
props: {
sampleId: {
type: Number
}
},
mixins: [ModalMixin, SampleDataMixin],
data() {
return {
content: {
@ -52,13 +48,21 @@ export default {
async getContent() {
try {
this.isLoading = true
const res = await getAction('/spectrumAnalysis/viewSpectrum', {
sampleId: this.sampleId
const { sampleId, dbName, sampleFileName, gasFileName, detFileName, qcFileName } = this.newSampleData
const { success, result, message } = await getAction('/spectrumAnalysis/viewSpectrum', {
sampleId,
dbName,
sampleFileName,
gasFileName,
detFileName,
qcFileName
})
if (res.success) {
this.content = res.result
if (success) {
if(result) {
this.content = result
}
} else {
this.$message.error(res.message)
this.$message.error(message)
}
} catch (error) {
console.error(error)
@ -68,9 +72,7 @@ export default {
},
beforeModalOpen() {
if (this.sampleId) {
this.getContent()
}
this.getContent()
},
handleTabChange(key) {
this.currTab = key

View File

@ -17,7 +17,7 @@
</a-space>
</a-form-model-item>
<a-form-model-item label="Detector">
<custom-select :options="detectorList" v-model="queryParams.detectorName" size="small"></custom-select>
<custom-select :options="detectorList" v-model="queryParams.detectorId" size="small"></custom-select>
</a-form-model-item>
</a-form-model>
</title-over-border>
@ -61,7 +61,7 @@
<template slot="title">
<a-checkbox v-model="queryParams.filterGrpbox">Filter</a-checkbox>
</template>
<a-checkbox>Xe Result Flag</a-checkbox>
<a-checkbox :disabled="filterDisabled">Xe Result Flag</a-checkbox>
<!-- 配置详情 -->
<div class="filter-options">
<div class="filter-option">
@ -291,7 +291,7 @@ export default {
this.setStationAndDetector(result)
} else {
this.detectorList = []
this.queryParams.detectorName = undefined
this.queryParams.detectorId = ''
}
} catch (error) {
console.error(error)
@ -301,20 +301,21 @@ export default {
//
setStationAndDetector({ detectorList, stationName, stationId }) {
this.queryParams.stationName = stationName
this.detectorList = detectorList.map(({ detectorCode }) => ({
this.detectorList = detectorList.map(({ detectorCode, detectorId }) => ({
label: detectorCode,
value: detectorCode
value: detectorId || ''
}))
this.queryParams.detectorName = detectorList[0].detectorCode
this.queryParams.detectorId = detectorList[0].detectorId || ''
this.queryParams.stationId = stationId
},
//
handleReset() {
this.queryParams.stationName = this.initialMDC.stationName
this.detectorList = this.initialMDC.detectorList.map(({ detectorCode }) => ({
this.detectorList = this.initialMDC.detectorList.map(({ detectorCode, detectorId }) => ({
label: detectorCode,
value: detectorCode
value: detectorId || ''
}))
},
@ -326,7 +327,11 @@ export default {
}
try {
const { success, message, result } = await postAction('/spectrumAnalysis/statisticsQuery', this.queryParams)
const find = this.detectorList.find(item => item.value == this.queryParams.detectorId)
const { success, message, result } = await postAction('/spectrumAnalysis/statisticsQuery', {
detectorCode: find? find.label: '',
...this.queryParams
})
if (success) {
if (result) {

View File

@ -26,7 +26,7 @@
<a-form-model-item label="Detector">
<custom-select
:options="detectorList"
v-model="queryParams.detectorName"
v-model="queryParams.detectorId"
size="small"
dropdownClassName="statistics-paramer-history-select"
></custom-select>
@ -194,7 +194,7 @@ export default {
this.setStationAndDetector(result)
} else {
this.detectorList = []
this.queryParams.detectorName = undefined
this.queryParams.detectorId = ''
}
} catch (error) {
console.error(error)
@ -204,27 +204,32 @@ export default {
//
setStationAndDetector({ detectorList, stationName, stationId }) {
this.queryParams.stationName = stationName
this.detectorList = detectorList.map(({ detectorCode }) => ({
this.detectorList = detectorList.map(({ detectorCode, detectorId }) => ({
label: detectorCode,
value: detectorCode,
value: detectorId || '',
}))
this.queryParams.detectorName = detectorList[0].detectorCode
this.queryParams.stationId = stationId
this.queryParams.detectorId = detectorList[0].detectorId || ''
this.queryParams.stationId = stationId || ''
},
//
handleReset() {
this.queryParams.stationName = this.initialMDC.stationName
this.detectorList = this.initialMDC.detectorList.map(({ detectorCode }) => ({
this.detectorList = this.initialMDC.detectorList.map(({ detectorCode, detectorId }) => ({
label: detectorCode,
value: detectorCode,
value: detectorId || '',
}))
},
//
async handleStatisticsQuery() {
try {
const { success, message, result } = await getAction('/spectrumAnalysis/statisticsQueryBtn', this.queryParams)
const find = this.detectorList.find(item => item.value == this.queryParams.detectorId)
const { success, message, result } = await getAction('/spectrumAnalysis/statisticsQueryBtn', {
detectorCode: find? find.label: '',
...this.queryParams
})
if (success) {
if (result) {
const data = result.m_Values

View File

@ -445,9 +445,10 @@ export default {
})
if (findFile) {
const regExp = new RegExp(`(${otherFilePrefix}${fileType}_${qualify}_\\d{1,}\\.{0,}\\d{0,}).*?(\\.PHD)`)
record[nameKeys[index]] = {
file: findFile,
fileName: findFile.name,
fileName: findFile.name.replace(regExp, '$1$2'),
}
} else {
record[nameKeys[index]] = {

View File

@ -140,7 +140,6 @@ import { ACCESS_TOKEN } from '@/store/mutation-types'
import StripModal from './components/Modals/StripModal.vue'
import { FilePicker } from '@/utils/FilePicker'
import { zipFile } from '@/utils/file'
import { mapMutations } from 'vuex'
export default {
props: {
@ -532,6 +531,14 @@ export default {
},
dataProcess(result, flag) {
const { inputFileName } = this.sample
this.$store.commit('ADD_SAMPLE_DATA', {
inputFileName,
data: result,
from: flag,
})
this.isLoading = false
const {
@ -562,7 +569,7 @@ export default {
this.detailedInfomation = DetailedInformation
this.qcFlags = QCFlag
if(peak) {
if (peak) {
this.peakList = peak
}
@ -1576,6 +1583,9 @@ export default {
this.option.xAxis.name = 'Channel'
this.option.yAxis.type = 'log'
this.thumbnailOption.yAxis.type = 'log'
this.option.series[0].markLine.data[0].xAxis = -1
this.setChartBottomTitle(0, 0, 0)
},
/**
@ -1697,8 +1707,6 @@ export default {
const arrFunc = isList ? Array.prototype.filter : Array.prototype.find
return arrFunc.call(allData, (item) => item.name == name && item.group == group) || {}
},
...mapMutations(['ADD_SAMPLE_DATA', 'GET_SAMPLE_DATA']),
},
watch: {
currStep: {
@ -1711,13 +1719,13 @@ export default {
immediate: true,
},
sample: {
handler(newVal, oldVal) {
async handler(newVal, oldVal) {
console.log('newValnewVal', newVal)
this.graphAssistance.axisType = 'Channel'
this.handleResetState()
const sampleData = this.GET_SAMPLE_DATA(newVal.inputFileName)
const sampleData = await this.$store.dispatch('GET_SAMPLE_DATA', newVal.inputFileName)
if (sampleData) {
console.log('%c [ ]-1521', 'font-size:13px; background:pink; color:#bf2c9f;', sampleData)
this.dataProcess(sampleData.data, sampleData.from)
} else {
if (newVal.sampleId) {
this.getSampleDetail()

View File

@ -157,6 +157,7 @@
<beta-gamma-comments-modal
v-model="betaGammaCommentsModalVisible"
:isAdd="isBetaGammaCommentsAdd"
:comment="params_toDB.comment"
@sendInfo="getcommentsInfo"
/>
<!-- Beta-Gamma 的Comments 结束 -->
@ -174,7 +175,7 @@
<!-- Beta-Gamma Extrapolation 弹窗结束 -->
<!-- Beta-Gamma Spectrum 弹窗 -->
<beta-gamma-spectrum-modal v-model="betaGammaSpectrumModalVisible" :sampleId="this.sampleData.sampleId" />
<beta-gamma-spectrum-modal v-model="betaGammaSpectrumModalVisible" />
<!-- Beta-Gamma Spectrum 弹窗 结束 -->
<!-- Beta-Gamma Sample Infomation 弹窗 -->
@ -400,6 +401,7 @@ export default {
destroyed() {
this.$bus.$off('reanalyse', this.handleReanalyse)
this.$store.commit('CLEAR_SAMPLE_DATA')
},
methods: {
@ -415,10 +417,10 @@ export default {
},
getStationName(arg, val, flag) {
arg.forEach((item) => {
item.conc = item.conc.toFixed(6)
item.concErr = item.concErr.toFixed(6)
item.lc = item.lc.toFixed(6)
item.mdc = item.mdc.toFixed(6)
item.conc = Number(item.conc).toFixed(6)
item.concErr = Number(item.concErr).toFixed(6)
item.lc = Number(item.lc).toFixed(6)
item.mdc = Number(item.mdc).toFixed(6)
})
this.resultDisplayFlag = arg
this.params_toDB.stationName = val
@ -477,6 +479,7 @@ export default {
this.analysisType = ANALYZE_TYPE.GAMMA
}
this.sampleData = this.newSampleData = sample
this.params_toDB.comment = ''
},
//

View File

@ -3,6 +3,14 @@ import { MarkerType } from './markerEnum'
// 核设施详情弹窗中的字段配置
export default {
[MarkerType.NuclearFacility]: [
{
label: 'FACILITY_NAME',
key: 'facilityName'
},
{
label: 'FACILITY ID',
key: 'facilityId'
},
{
label: 'ACTIVITY DAY',
key: 'activityDay'
@ -31,14 +39,6 @@ export default {
label: 'CRITICALITYDATE',
key: 'criticalityDate'
},
{
label: 'FACILITY ID',
key: 'facilityId'
},
{
label: 'FACILITY_NAME',
key: 'facilityName'
},
{
label: 'GRIDCONEETIONDATE',
key: 'gridconeetionDate'
@ -81,6 +81,12 @@ export default {
},
],
[MarkerType.ImsRnStationP]: [{
label: 'STATIONCODE',
key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, {
label: 'COUNTRYCODE',
key: 'countryCode'
}, {
@ -104,12 +110,6 @@ export default {
}, {
label: 'MODDATE',
key: 'moddate'
}, {
label: 'STATIONCODE',
key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, {
label: 'STATUS',
key: 'status'
@ -136,6 +136,12 @@ export default {
key: 'phdMetSoh'
}],
[MarkerType.ImsRnStationG]: [{
label: 'STATIONCODE',
key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, {
label: 'COUNTRYCODE',
key: 'countryCode'
}, {
@ -159,12 +165,6 @@ export default {
}, {
label: 'MODDATE',
key: 'moddate'
}, {
label: 'STATIONCODE',
key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, {
label: 'STATUS',
key: 'status'
@ -191,6 +191,12 @@ export default {
key: 'phdMetSoh'
}],
[MarkerType.NRL]: [{
label: 'STATIONCODE',
key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, {
label: 'COUNTRYCODE',
key: 'countryCode'
}, {
@ -214,12 +220,6 @@ export default {
}, {
label: 'MODDATE',
key: 'moddate'
}, {
label: 'STATIONCODE',
key: 'stationCode'
}, {
label: 'STATIONID',
key: 'stationId'
}, {
label: 'STATUS',
key: 'status'

View File

@ -38,7 +38,7 @@
:scrollContainer="getScrollContainer"
class="data-list has-search"
:class="{
'show-search': searchPlacementVisible
'show-search': searchPlacementVisible,
}"
>
<div class="search-filter-placement">
@ -144,13 +144,13 @@
ref="mapRef"
token="AAPK2b935e8bbf564ef581ca3c6fcaa5f2a71ZH84cPqqFvyz3KplFRHP8HyAwJJkh6cnpcQ-qkWh5aiyDQsGJbsXglGx0QM2cPm"
>
<MapMarker
:list="markerList"
:currList="upDateStationList"
:orgList="orgStationList"
:marker-type="markerType"
:radius="circleRadius"
@markerClick="onMarkerClick"
<MapMarker
:list="markerList"
:currList="upDateStationList"
:orgList="orgStationList"
:marker-type="markerType"
:radius="circleRadius"
@markerClick="onMarkerClick"
/>
<MapPane
ref="mapPane"
@ -171,27 +171,27 @@ import DataListItem from './components/DataListItem.vue'
import ScrollContainer from '@/components/ScrollContainer/index.vue'
import { getAction } from '../../api/manage'
import { cloneDeep } from 'lodash'
const key= "updateList"
const key = 'updateList'
export default {
components: {
Map,
MapMarker,
MapPane,
ScrollContainer,
DataListItem
DataListItem,
},
watch: {
"$route": {
handler:function(val,oldVal) {
if (val.name!=="station-operation") {
$route: {
handler: function (val, oldVal) {
if (val.name !== 'station-operation') {
this.$message.destroy()
clearInterval(this.timer);
clearInterval(this.timer)
this.timer = null
}
},
deep:true,
immediate:true
}
deep: true,
immediate: true,
},
},
data() {
return {
@ -216,7 +216,7 @@ export default {
filter: {
searchText: undefined,
status: undefined,
type: undefined
type: undefined,
},
filterVisible: false, //
@ -226,7 +226,7 @@ export default {
treeData: [], //
timer: null,
updataFilterType: []
updataFilterType: [],
}
},
created() {
@ -235,8 +235,8 @@ export default {
this.getStationTypeList()
this.getStationTree()
},
beforeDestroy () {
clearInterval(this.timer);
beforeDestroy() {
clearInterval(this.timer)
this.timer = null
},
methods: {
@ -249,12 +249,12 @@ export default {
this.dataList = cloneDeep(res)
this.markerList = cloneDeep(res)
this.markerList_clone = cloneDeep(res)
this.getDataProvisionEfficiency(this.markerList_clone,"one")
this.timer = setInterval(() => {
setTimeout(() => {
this.getDataProvisionEfficiency(this.markerList_clone)
}, 0);
}, 15000);
this.getDataProvisionEfficiency(this.markerList_clone, 'one')
// this.timer = setInterval(() => {
// setTimeout(() => {
// this.getDataProvisionEfficiency(this.markerList_clone)
// }, 0);
// }, 15000);
this.$nextTick(() => {
this.$refs.scrollContainerRef.checkScrollEnd()
})
@ -267,51 +267,62 @@ export default {
//
async getDataProvisionEfficiency(arr, str) {
if (str && this.$route.path=="/station-operation") {
this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 })
if (str && this.$route.path == '/station-operation') {
this.$message.loading({ content: 'Loading station data, please wait...', key, duration: 0 })
}
getAction('/stationOperation/getDataProvisionEfficiency').then(res => {
if (res.success) {
getAction('/stationOperation/getDataProvisionEfficiency')
.then((res) => {
if (res.success) {
this.$message.destroy()
if (str && this.$route.path == '/station-operation') {
this.$message.success({ content: 'Loaded!', key, duration: 2 })
}
res.result.forEach((item) => {
arr.forEach((el) => {
if (
parseInt(item.id) == el.stationId &&
el.stationType != 'Nuclear Facility' &&
el.stationType != 'NRL'
) {
item.stationType = el.stationType
item.stationId = el.stationId
}
})
})
this.orgStationList = res.result
if (this.updataFilterType.length > 0) {
this.upDateStationList = this.orgStationList.filter((item) =>
this.updataFilterType.includes(item.stationType)
)
} else {
this.upDateStationList = res.result
}
if (this.markerList.length > 0) {
let curList = []
this.markerList.forEach((item) => {
if (item.stationType != 'Nuclear Facility' && item.stationType != 'NRL') {
this.orgStationList.forEach((el) => {
if (parseInt(el.id) == item.stationId) {
curList.push(el)
}
})
}
})
this.upDateStationList = curList
} else {
this.upDateStationList = []
}
setTimeout(() => {
this.getDataProvisionEfficiency(this.markerList_clone)
}, 10000)
} else {
this.$message.warning('This operation fails. Contact your system administrator')
}
})
.catch((error) => {
this.$message.destroy()
if (str && this.$route.path == "/station-operation") {
this.$message.success({ content: 'Loaded!', key, duration: 2 })
}
res.result.forEach(item => {
arr.forEach(el => {
if (parseInt(item.id) == el.stationId&&el.stationType!="Nuclear Facility"&&el.stationType!="NRL") {
item.stationType = el.stationType
item.stationId = el.stationId
}
})
})
this.orgStationList = res.result
if (this.updataFilterType.length>0) {
this.upDateStationList = this.orgStationList.filter(item => this.updataFilterType.includes(item.stationType))
} else {
this.upDateStationList = res.result
}
if (this.markerList.length > 0) {
let curList = []
this.markerList.forEach(item => {
if (item.stationType!="Nuclear Facility" && item.stationType!="NRL") {
this.orgStationList.forEach(el => {
if (parseInt(el.id) == item.stationId) {
curList.push(el)
}
})
}
})
this.upDateStationList=curList
} else {
this.upDateStationList=[]
}
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}
}).catch(error => {
this.$message.destroy()
console.error(error)
})
console.error(error)
})
},
//
@ -338,7 +349,7 @@ export default {
async getStationTypeList() {
try {
const res = await getAction('/jeecg-station-operation/stationOperation/findStationType')
this.stationTypeList = res.filter(item => item).map(item => ({ label: item, value: item }))
this.stationTypeList = res.filter((item) => item).map((item) => ({ label: item, value: item }))
} catch (error) {
console.error(error)
}
@ -349,10 +360,10 @@ export default {
try {
const { success, result, message } = await getAction('/stationOperation/findTree')
if (success) {
result.forEach(item => {
result.forEach((item) => {
item.stationCode = item.code
item.stationId = `root_${item.stationId}`
item.children.forEach(child => {
item.children.forEach((child) => {
child.stationCode = child.code
child.stationId = `${item.stationId}_parent_${child.stationId}`
})
@ -398,7 +409,7 @@ export default {
// All Data
onFilterChange() {
this.dataList = this.originalDataList.filter(dataItem => {
this.dataList = this.originalDataList.filter((dataItem) => {
const filterSearchText =
!this.filter.searchText ||
-1 !== dataItem.stationName.toLowerCase().indexOf(this.filter.searchText.toLowerCase())
@ -415,7 +426,8 @@ export default {
//
locateFacility(stationItem) {
const find = this.markerList.find(
markerItem => markerItem.stationId == stationItem.stationId && markerItem.stationType == stationItem.stationType
(markerItem) =>
markerItem.stationId == stationItem.stationId && markerItem.stationType == stationItem.stationType
)
if (!find) {
//
@ -427,7 +439,7 @@ export default {
setTimeout(() => {
// panTo
const overlays = this.$refs.mapRef.map.getOverlays()
const currOverlay = overlays.getArray().find(item => item.id == `marker_${stationType}_${stationId}`)
const currOverlay = overlays.getArray().find((item) => item.id == `marker_${stationType}_${stationId}`)
const innerEle = currOverlay.getElement()
innerEle.classList.add('ani-bounding')
@ -445,10 +457,10 @@ export default {
onChangeMarker(markerList) {
this.markerList = markerList
let curList = []
if (markerList.length>0) {
markerList.forEach(item => {
if (item.stationType!="Nuclear Facility" && item.stationType!="NRL") {
this.orgStationList.forEach(el => {
if (markerList.length > 0) {
markerList.forEach((item) => {
if (item.stationType != 'Nuclear Facility' && item.stationType != 'NRL') {
this.orgStationList.forEach((el) => {
if (parseInt(el.id) == item.stationId) {
el.stationType = item.stationType
el.stationId = item.stationId
@ -457,9 +469,9 @@ export default {
})
}
})
this.upDateStationList=curList
this.upDateStationList = curList
} else {
this.upDateStationList=[]
this.upDateStationList = []
}
},
@ -480,8 +492,8 @@ export default {
filterType,
filterDataQuality
)
this.markerList = this.originalDataList.filter(item => filterType.includes(item.stationType))
this.upDateStationList = this.orgStationList.filter(item => filterType.includes(item.stationType))
this.markerList = this.originalDataList.filter((item) => filterType.includes(item.stationType))
this.upDateStationList = this.orgStationList.filter((item) => filterType.includes(item.stationType))
},
//
@ -495,8 +507,8 @@ export default {
getDictSelectTagContainer() {
return document.body
}
}
},
},
}
</script>
<style lang="less" scoped>