feat: 对接PeakInfomation、ARR、RRR、QC Results、SampleInfomation和Spectrum弹窗接口

This commit is contained in:
Xu Zhimeng 2023-08-30 13:36:53 +08:00
parent 62ca472c62
commit cfe0b7f134
8 changed files with 306 additions and 419 deletions

View File

@ -1,25 +1,29 @@
export default {
props: {
value: {
type: Boolean
}
},
data() {
return {
isLoading: false
}
},
computed: {
visible: {
get() {
return this.value
},
set(val) {
if (val && this.beforeModalOpen && typeof this.beforeModalOpen == 'function') {
this.beforeModalOpen()
}
this.$emit('input', val)
}
}
props: {
value: {
type: Boolean
}
}
},
data() {
return {
isLoading: false
}
},
methods: {
beforeModalOpen() {}
},
computed: {
visible: {
get() {
return this.value
},
set(val) {
if (val && this.beforeModalOpen && typeof this.beforeModalOpen == 'function') {
this.beforeModalOpen()
}
this.$emit('input', val)
}
}
}
}

View File

@ -38,22 +38,29 @@ export default {
methods: {
async getContent() {
let url = ''
console.log('%c [ ]-42', 'font-size:13px; background:pink; color:#bf2c9f;', this.type)
switch (this.type) {
case 1:
url = '/gamma/viewARR'
break
case 2:
url = '/gamma/viewRRR'
break
case 3:
url = '/spectrumAnalysis/viewARR'
break
case 4:
url = '/spectrumAnalysis/viewRRR'
break;
break
}
try {
this.content = ''
this.isLoading = true
const res = await getAction(url, { sampleId: this.sampleId, ...this.extraData })
if(res.success) {
if (res.success) {
this.content = res.result
}
else {
} else {
this.content = res
}
} catch (error) {
@ -64,6 +71,8 @@ export default {
},
beforeModalOpen() {
console.log('%c [ ]-75', 'font-size:13px; background:pink; color:#bf2c9f;', this.sampleId)
if (this.sampleId) {
this.getContent()
}

View File

@ -28,18 +28,27 @@
</a-space>
</a-form-model>
<!-- 顶部搜索栏结束 -->
<!-- 主体部分 -->
<div v-if="compareVisible" class="comparison-list">
<div class="comparison-list-item" v-for="(item, index) in compareList" :key="index">
<div class="comparison-list-item-title">{{ item.title }}</div>
<custom-table :list="item.list" :columns="columns"></custom-table>
<a-spin :spinning="isLoading">
<!-- 主体部分 -->
<div v-if="compareVisible" class="comparison-list">
<div class="comparison-list-item">
<div class="comparison-list-item-title">ARMD</div>
<custom-table :list="list" :scroll="{ y: 230 }" :columns="columns"></custom-table>
</div>
<div class="comparison-list-item">
<div class="comparison-list-item-title">IDC</div>
<custom-table :list="compareList" :scroll="{ y: 230 }" :columns="columns"></custom-table>
</div>
</div>
</div>
<custom-table v-else :list="list" :columns="columns"></custom-table>
<custom-table v-else :columns="columns" :list="list" :scroll="{ y: 460 }" :canSelect="false"></custom-table>
</a-spin>
</custom-modal>
</template>
<script>
import { getAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
const columns = [
{
title: 'Nuclide',
@ -51,7 +60,10 @@ const columns = [
},
{
title: 'Energy (keV)',
dataIndex: 'energy'
dataIndex: 'energy',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
{
title: 'Yield (%)',
@ -59,33 +71,52 @@ const columns = [
},
{
title: 'Efficiency',
dataIndex: 'efficiency'
dataIndex: 'efficiency',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
{
title: 'Activity (Bq)',
dataIndex: 'activity'
dataIndex: 'activity',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
{
title: 'Act Err (%)',
dataIndex: 'actErr'
dataIndex: 'actErr',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
{
title: 'MDA (Bq)',
dataIndex: 'mda'
dataIndex: 'mda',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
{
title: 'Conc (uBq/m3)',
dataIndex: 'conc'
dataIndex: 'conc',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(6) : text
}
},
{
title: 'MDC (uBq/m3)',
dataIndex: 'mdc'
dataIndex: 'mdc',
customRender: text => {
return text && text !== 'null' ? Number(text).toPrecision(5) : text
}
}
]
export default {
mixins: [ModalMixin],
props: {
value: {
type: Boolean
sampleId: {
type: Number
}
},
data() {
@ -96,58 +127,10 @@ export default {
concentrationReferenceTime: undefined
},
compareVisible: false,
isLoading: false,
list: [
{
nuclide: 'nuclide',
halfLife: 'halfLife',
energy: 'energy',
yield: 'yield',
efficiency: 'efficiency',
activity: 'activity',
actErr: 'actErr',
mda: 'mda',
conc: 'conc',
mdc: 'mdc'
}
],
compareList: [
{
title: 'ARMD',
list: [
{
nuclide: 'nuclide',
halfLife: 'halfLife',
energy: 'energy',
yield: 'yield',
efficiency: 'efficiency',
activity: 'activity',
actErr: 'actErr',
mda: 'mda',
conc: 'conc',
mdc: 'mdc'
}
]
},
{
title: 'IDC',
list: [
{
nuclide: 'nuclide',
halfLife: 'halfLife',
energy: 'energy',
yield: 'yield',
efficiency: 'efficiency',
activity: 'activity',
actErr: 'actErr',
mda: 'mda',
conc: 'conc',
mdc: 'mdc'
}
]
}
]
list: [],
compareList: []
}
},
methods: {
@ -156,18 +139,34 @@ export default {
this.compareVisible = !this.compareVisible
},
async getInfo() {
try {
this.isLoading = true
const { success, result, message } = await getAction('/gamma/radionuclideActivity', {
sampleId: this.sampleId
})
if (success) {
const { dateTime_act_ref, dateTime_con_ref, table } = result
this.queryParam.activityReferenceTime = dateTime_act_ref
this.queryParam.concentrationReferenceTime = dateTime_con_ref
this.list = table
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.compareVisible = false
this.getInfo()
},
// Excel
handleExportToExcel() {}
},
computed: {
visible: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
}
}
}
}
</script>

View File

@ -1,44 +1,97 @@
<template>
<custom-modal v-model="visible" :width="750" title="QC Results">
<a-table :columns="columns" :dataSource="list" :pagination="false" />
<a-spin :spinning="isLoading">
<a-table :columns="columns" :dataSource="list" :pagination="false" />
</a-spin>
<a-button slot="custom-footer" type="primary">Export to Excel</a-button>
</custom-modal>
</template>
<script>
import { getAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
const columns = [
{
title: 'Name',
dataIndex: 'name'
dataIndex: 'name',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
}
},
{
title: 'Pass/Fail',
dataIndex: 'status'
dataIndex: 'flag',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
}
},
{
title: 'Value',
dataIndex: 'value'
dataIndex: 'value',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
}
},
{
title: 'Standard',
dataIndex: 'standard'
dataIndex: 'standard',
customCell: (record) => {
return {
style: {
backgroundColor: record.flag == 'FAIL'? 'red': ''
}
}
}
}
]
export default {
mixins: [ModalMixin],
props: {
sampleId: {
type: Number
}
},
data() {
this.columns = columns
return {
list: [
{
name: 'name',
status: 'status',
value: 'value',
standard: 'standard'
isLoading: false,
list: []
}
},
methods: {
async getData() {
try {
this.isLoading = true
const { success, result, message } = await getAction('/gamma/viewQCResult', {
sampleId: this.sampleId
})
if (success) {
this.list = result
} else {
this.$message.error(message)
}
]
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getData()
}
}
}

View File

@ -1,16 +1,18 @@
<template>
<custom-modal v-model="visible" :width="750" title="Sample Infomation">
<div class="sample-infomation">
<a-form-model :labelCol="{ style: { width: '150px', textAlign: 'left' } }">
<a-row>
<a-col :span="12" v-for="(item, index) in columns" :key="index">
<a-form-model-item :label="item.title">
{{ data[item.key] }}
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<a-spin :spinning="isLoading">
<div class="sample-infomation">
<a-form-model :labelCol="{ style: { width: '150px', textAlign: 'left' } }">
<a-row>
<a-col :span="12" v-for="(item, index) in columns" :key="index">
<a-form-model-item :label="item.title">
{{ item.key == 'sampleId' && !isLoading ? sampleId : data[item.key] }}
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
</a-spin>
<div slot="custom-footer" style="text-align: center;">
<a-space :size="20">
<a-button type="primary">Export to Excel</a-button>
@ -21,6 +23,7 @@
</template>
<script>
import { getAction } from '@/api/manage'
import ModalMixin from '@/mixins/ModalMixin'
const columns = [
@ -50,7 +53,7 @@ const columns = [
},
{
title: 'Collection Start',
key: 'collectionStart'
key: 'collectStart'
},
{
title: 'Sampling Time',
@ -58,7 +61,7 @@ const columns = [
},
{
title: 'Collection Stop',
key: 'collectionStop'
key: 'collectStop'
},
{
title: 'Decay Time',
@ -84,25 +87,40 @@ const columns = [
export default {
mixins: [ModalMixin],
props: {
sampleId: {
type: Number
}
},
data() {
this.columns = columns
return {
data: {
stationId: 'stationId',
detectorId: 'detectorId',
sampleId: 'sampleId',
sampleGeometry: 'sampleGeometry',
sampleQuantity: 'sampleQuantity',
sampleType: 'sampleType',
collectionStart: 'collectionStart',
samplingTime: 'samplingTime',
collectionStop: 'collectionStop',
decayTime: 'decayTime',
acquisitionStart: 'acquisitionStart',
acquisitionTime: 'acquisitionTime',
acquisitionStop: 'acquisitionStop',
avgFlowRate: 'avgFlowRate'
isLoading: false,
data: {}
}
},
methods: {
async getInfo() {
try {
this.isLoading = true
const { success, result, message } = await getAction('/gamma/sampleInformation', {
sampleId: this.sampleId
})
if (success) {
this.data = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.data = {}
this.getInfo()
}
}
}

View File

@ -1,53 +1,50 @@
<template>
<custom-modal v-model="visible" :width="1000" title="Spectrum" :footer="null">
<pre>
<custom-modal v-model="visible" :width="800" title="Spectrum" :footer="null">
<a-spin :spinning="isLoading">
<pre>
{{ content }}
</pre
>
</pre>
</a-spin>
</custom-modal>
</template>
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '../../../../api/manage'
import { getAction } from '@/api/manage'
export default {
mixins: [ModalMixin],
props: {
sampleId: {
type: Number
}
},
data() {
return {
content: `-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
-------------------------- SampleAnalyse Beginning at 2023-07-10 11:44:56 --------------------------
`,
content: '',
isLoading: true
}
},
methods: {
async getContent() {
try {
const res = getAction('/')
this.isLoading = true
const { success, result, message } = await getAction('/gamma/Spectrum', {
sampleId: this.sampleId
})
if (success) {
this.content = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.getContent()
}
}
}
@ -55,7 +52,7 @@ export default {
<style lang="less" scoped>
pre {
max-height: 450px;
height: 450px;
padding: 5px;
overflow: auto;
background-color: #285367;

View File

@ -1,13 +1,18 @@
<template>
<a-modal v-model="visible" title="Peak Infomation" :width="1231" :footer="null" class="peak-infomation">
<div v-if="compareVisible" class="comparison-list">
<div class="comparison-list-item" v-for="(item, index) in compareList" :key="index">
<div class="comparison-list-item-title">{{ item.title }}</div>
<custom-table :list="item.list" :scroll="{ y: 230 }" :columns="columns"></custom-table>
<custom-modal v-model="visible" title="Peak Infomation" :width="1231" :footer="null" class="peak-infomation">
<a-spin :spinning="isLoading">
<div v-if="compareVisible" class="comparison-list">
<div class="comparison-list-item">
<div class="comparison-list-item-title">ARMD</div>
<custom-table :list="list" :scroll="{ y: 230 }" :columns="columns"></custom-table>
</div>
<div class="comparison-list-item">
<div class="comparison-list-item-title">IDC</div>
<custom-table :list="compareList" :scroll="{ y: 230 }" :columns="columns"></custom-table>
</div>
</div>
</div>
<custom-table v-else :columns="columns" :list="list"></custom-table>
<custom-table v-else :columns="columns" :list="list" :scroll="{ y: 460 }" :canSelect="false"></custom-table>
</a-spin>
<!-- 底部按钮 -->
<div class="peak-infomation-footer">
<a-space :size="20">
@ -21,10 +26,13 @@
</a-button>
</a-space>
</div>
</a-modal>
</custom-modal>
</template>
<script>
import ModalMixin from '@/mixins/ModalMixin'
import { getAction } from '@/api/manage'
const columns = [
{
title: 'Index',
@ -72,233 +80,19 @@ const columns = [
}
]
export default {
mixins: [ModalMixin],
props: {
value: {
type: Boolean
sampleId: {
type: Number
}
},
data() {
this.columns = columns
return {
list: [
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
}
],
compareList: [
{
title: 'ARMD',
list: [
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
},
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
}
]
},
{
title: 'IDC',
list: [
{
id: 1,
energy: 'energy',
centroid: 'centroid',
multiplet: 'multiplet',
fwhm: 'fwhm',
netArea: 'netArea',
areaErr: 'areaErr',
significant: 'significant',
sensitivity: 'sensitivity',
indentify: 'indentify'
}
]
}
],
compareVisible: true
list: [],
compareList: [],
compareVisible: false, //
isLoading: false
}
},
methods: {
@ -307,18 +101,31 @@ export default {
this.compareVisible = !this.compareVisible
},
async getInfo() {
try {
this.isLoading = true
const { success, result, message } = await getAction('/gamma/peakInformation', {
sampleId: this.sampleId
})
if (success) {
this.list = result
} else {
this.$message.error(message)
}
} catch (error) {
console.error(error)
} finally {
this.isLoading = false
}
},
beforeModalOpen() {
this.compareVisible = false
this.getInfo()
},
// Excel
handleExportToExcel() {}
},
computed: {
visible: {
get() {
return this.value
},
set(val) {
this.$emit('input', val)
}
}
}
}
</script>

View File

@ -60,11 +60,11 @@
<!-- Ftransit 弹窗结束 -->
<!-- Peak Infomation 弹窗开始 -->
<peak-infomation v-model="peakInfomationModalVisible" />
<peak-infomation v-model="peakInfomationModalVisible" :sampleId="sampleData.sampleId" />
<!-- Peak Infomation 弹窗结束 -->
<!-- Nuclide Activity and MDC 弹窗开始 -->
<nuclide-activity-and-mdc-modal v-model="nuclideActivityAndMDCModalVisible" />
<nuclide-activity-and-mdc-modal v-model="nuclideActivityAndMDCModalVisible" :sampleId="sampleData.sampleId" />
<!-- Nuclide Activity and MDC 弹窗结束 -->
<!-- Save Setting 弹窗开始 -->
@ -141,11 +141,11 @@
<!-- Spectrum 弹窗结束 -->
<!-- SampleInfo 弹窗开始 -->
<sample-infomation-modal v-model="sampleInfomationModalVisible" />
<sample-infomation-modal v-model="sampleInfomationModalVisible" :sampleId="sampleData.sampleId" />
<!-- SampleInfo 弹窗结束 -->
<!-- Qc Results 弹窗开始 -->
<qc-results-modal v-model="qcResultsModalVisible" />
<qc-results-modal v-model="qcResultsModalVisible" :sampleId="sampleData.sampleId" />
<!-- Qc Results 弹窗结束 -->
<!-- RLR 弹窗开始 -->