计算结果,列表,图形设备属性判断

This commit is contained in:
limengnan 2026-05-20 09:57:13 +08:00
parent 15634202ee
commit 75c83930c3
5 changed files with 131 additions and 42 deletions

View File

@ -18,7 +18,6 @@ import {
} from 'vue';
import { init, EChartsOption } from 'echarts';
import { getByScenario } from "@/api/business/scenario";
import * as echarts from 'echarts';
import resize from '@/utils/resize';
@ -33,31 +32,48 @@ const props = defineProps({
type: String,
default: ''
},
deviceType: {
required: false,
type: String,
default: ''
},
className: {
type: String,
default: '',
},
sizeSchemaInfo: {
required: false,
type: Object,
default: () => ({})
}
});
const { mounted, chart, beforeDestroy, activated, deactivated } = resize();
function getDeviceName(code:any){
let name = ''
for(let i = 0;i<deviceData.value.length;i++){
if(deviceData.value[i].key == code){
name = deviceData.value[i].label
break
}
}
if(name == ''){
return getName(code)
}else{
return name
}
}
function getName(code:any) {
let name = ''
switch (code) {
case 'width':
return name = "宽度cm";
break;
case 'outer_diameter':
return name = "外径cm";
break;
case 'height':
return name = "高度cm";
break;
case 'length':
return name = "长度cm";
break;
case 'diameter':
return name = "外径cm";
break;
case 'volume':
return name = "体积单位L";
break;
@ -82,9 +98,23 @@ function getName(code:any) {
case 'puo2_density':
return name = "氧化钚密度g/cm3";
break;
case 'pu_isotope':
return name = "钚同位素比例PU-240占比";
break;
case 'e_pu238':
return name = "PU-238占比";
break;
case 'e_pu239':
return name = "PU-239占比";
break;
case 'e_pu240':
return name = "PU-240占比";
break;
case 'e_pu241':
return name = "PU-241占比";
break;
case 'e_pu242':
return name = "PU-242占比";
break;
case 'e_pu238':
case 'hno3_acidity':
return name = "硝酸酸度mol/L";
break;
@ -171,9 +201,9 @@ function getScenarioResults(){
const element = attrState[key];
res.data.records[i][key] = element
if(i === 0){
tempData.push(getName(key) )
tempData.push(getDeviceName(key) )
option.value.series.push({
name: getName(key),
name: getDeviceName(key),
type: 'line',
data:[]
})
@ -181,7 +211,7 @@ function getScenarioResults(){
}
tempAttrState.push({
name: getName(key),
name: getDeviceName(key),
value: element,
})
}
@ -191,9 +221,9 @@ function getScenarioResults(){
}
option.value.xAxis.data.push(res.data.records[i].step)
for(let j = 0;j<tempAttrState.length;j++){
option.value.series[j].data.push(tempAttrState[j].value)
}
for(let j = 0;j<tempAttrState.length;j++){
option.value.series[j].data.push(tempAttrState[j].value)
}
}
@ -234,11 +264,12 @@ onActivated(() => {
onDeactivated(() => {
deactivated();
});
const deviceData = ref<any>([])
onMounted(() => {
deviceData.value = props.sizeSchemaInfo[props.deviceType].fields
mounted();
nextTick(() => {
getScenarioResults()
});
});

View File

@ -9,6 +9,16 @@ import { onMounted, ref, nextTick } from "vue";
import { ElForm, ElMessage, ElMessageBox, selectEmits } from "element-plus";
import Page from '@/components/Pagination/page.vue'
import { getByScenario,exportAllExports } from "@/api/business/scenario";
// import { sizeSchemaAll } from "@/api/business/database/device";
//
const sourceTempData:any = ref([]) //
// async function getSizeSchemaList(){
// let result = await sizeSchemaAll({})
// sizeSchemaInfo.value = result
// }
const apiUrl = import.meta.env.VITE_APP_BASE_API; //
const emit = defineEmits([ 'closeEditdevice']);
@ -23,8 +33,18 @@ const props = defineProps({
type: String,
default: ''
},
deviceType: {
required: false,
type: String,
default: ''
},
sizeSchemaInfo: {
required: false,
type: Object,
default: () => {}
}
})
const sizeSchemaInfo:any = ref(props.sizeSchemaInfo);
const queryParams = ref({
current: 1,
size: 10,
@ -43,6 +63,7 @@ function getIf(list:any,code:any){
}
function getScenarioResults(){
scenarioResultData.value = []
sourceTempData.value = sizeSchemaInfo.value[props.deviceType].fields
getByScenario({
scenarioId: props.scenarioId,
deviceId: props.deviceId,
@ -68,7 +89,7 @@ function getScenarioResults(){
total.value = res.data.total
})
}
onMounted(() => {
onMounted(async () => {
getScenarioResults()
});
@ -102,10 +123,15 @@ function exportExportsClick(){
<el-table-column type="selection" width="50" align="center"></el-table-column>
<el-table-column prop="step" label="时间" width="100"></el-table-column>
<el-table-column prop="keffValue" label="keff" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'diameter')" prop="diameter" label="直径cm" min-width="100"></el-table-column>
<el-table-column v-for="(item,index) in sourceTempData" :label="item.label" min-width="100">
<template #default="scope">
{{ scope.row[item.key] }}
</template>
</el-table-column>
<!-- <el-table-column v-if="getIf(selectData,'diameter')" prop="diameter" label="直径cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'height')" prop="height" label="高度cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'width')" prop="width" label="宽度cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'length')" prop="length" label="长度cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'length')" prop="length" label="长度cm" min-width="100"></el-table-column> -->
<el-table-column v-if="getIf(selectData,'volume')" prop="volume" label="体积单位L" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'flow_rate')" prop="flow_rate" label="流量单位m3/h" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'pulse_velocity')" prop="pulse_velocity" label="脉冲速度单位Hz" min-width="160"></el-table-column>
@ -114,11 +140,17 @@ function exportExportsClick(){
<el-table-column v-if="getIf(selectData,'u_enrichment')" prop="u_enrichment" label="铀富集度" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'pu_concentration')" prop="pu_concentration" label="钚浓度g/L" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'puo2_density')" prop="puo2_density" label="氧化钚密度g/cm3" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'pu_isotope')" prop="pu_isotope" label="钚同位素比例PU-240占比" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'e_pu238')" prop="e_pu238" label="PU-238占比" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'e_pu239')" prop="e_pu239" label="PU-239占比" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'e_pu240')" prop="e_pu240" label="PU-240占比" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'e_pu241')" prop="e_pu241" label="PU-241占比" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'e_pu242')" prop="e_pu242" label="PU-242占比" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'hno3_acidity')" prop="hno3_acidity" label="硝酸酸度mol/L" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'h2c2o4_concentration')" prop="h2c2o4_concentration" label="草酸浓度mol/L" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'organic_ratio')" prop="organic_ratio" label="有机相比例" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'moisture_content')" prop="moisture_content" label="含水率" min-width="160"></el-table-column>
</el-table>
<div style="display: flex; justify-content: flex-end;">
<Page :total="total" v-model:size="queryParams.size" v-model:current="queryParams.current" @pagination="getScenarioResults" ></Page>

View File

@ -174,6 +174,7 @@ function addAttrText(item:any,index:any,useData:any){
width: 14,
height: 14,
correlationId: item.id,
deviceType: item.deviceInfo?.type || '',
type:'echarts',
attrs: {
img: {
@ -193,6 +194,7 @@ function addAttrText(item:any,index:any,useData:any){
width: 14,
height: 14,
correlationId: item.id,
deviceType: item.deviceInfo?.type || '',
type:'text',
attrs: {
img: {
@ -632,11 +634,13 @@ onMounted(() => {
if(node.store.data == null)return
if(node.store.data.type == 'echarts'){
deviceId.value = node.store.data.correlationId
deviceType.value = node.store.data.deviceType
isEchartsModel.value = true
return
}
if(node.store.data.type == 'text'){
deviceId.value = node.store.data.correlationId
deviceType.value = node.store.data.deviceType
isTableModel.value = true
return
}
@ -644,7 +648,7 @@ onMounted(() => {
})
})
const deviceType = ref<string>('')
const left = ref(0)
const top = ref(0)
@ -887,12 +891,14 @@ function dialogAttributeDialog(){ // 关闭变动设置弹窗
</div>
<div class="viewx6-DisplaySettingsButton" @click="ChangesettingsClick">显示设置</div>
</div>
<el-dialog v-model="isTableModel" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogTableModel" title="设备分析列表" append-to-body width="1430px">
<TableModels v-if="isTableModel" :deviceId="deviceId" :scenarioId="scenarioId"/>
<el-dialog v-model="isTableModel" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogTableModel"
title="设备分析列表" append-to-body width="1430px">
<TableModels v-if="isTableModel" :deviceId="deviceId" :scenarioId="scenarioId" :sizeSchemaInfo="sizeSchemaInfo"
:deviceType="deviceType"/>
</el-dialog>
<el-dialog v-model="isEchartsModel" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogEchartsModel" title="设备分析图像" append-to-body width="1430px">
<EchartsModels v-if="isEchartsModel" :deviceId="deviceId" :scenarioId="scenarioId"/>
<EchartsModels v-if="isEchartsModel" :deviceId="deviceId" :scenarioId="scenarioId" :deviceType="deviceType" :sizeSchemaInfo="sizeSchemaInfo"/>
</el-dialog>
<el-dialog v-model="isAttributeDialog" :close-on-click-modal="false" :modal="false" draggable

View File

@ -26,7 +26,7 @@ const total = ref()
const tableData: any = ref([]);
const multipleSelection = ref([]);
//
//
const sizeSchemaInfo:any = ref({});
async function getSizeSchemaList(){

View File

@ -20,20 +20,35 @@ import TableModels from '@/components/antvx6/tableModel.vue';
import EchartsModels from '@/components/antvx6/echartsModel.vue';
import Viewx6 from '@/components/antvx6/viewx6.vue';
import { searchAlgorithmsModelPage } from '@/api/business/algorithmModel';
import { sizeSchemaAll } from "@/api/business/database/device";
import { useUserStore } from '@/store/modules/user';
const userStore = useUserStore();
const username = ref(userStore.username)
const apiUrl = import.meta.env.VITE_APP_BASE_API; //
const deviceType = ref('') //
const webUrl = import.meta.env.VITE_APP_BASE_HTTP; //
const algorithmTypeData: any = ref([]); //
const stepsActive = ref(0); //
//
const sizeSchemaInfo:any = ref({});
async function getSizeSchemaList(){
let result = await sizeSchemaAll({})
sizeSchemaInfo.value = result
}
const props = defineProps({ //
projectInfo: {
required: true,
type: Object,
default: {}
}
},
});
//
const queryParams = ref({
@ -286,7 +301,7 @@ onMounted(() => {
getAlgorithmType()
gettableData();
initDeviceData()
getSizeSchemaList()
searchAlgorithmsModelPage({
pageNum: 1,
pageSize: 9999
@ -388,6 +403,7 @@ function getMenuData() {
if (res.code == 0) {
deviceList.value = res.data;
deviceId.value = res.data[0].deviceId
deviceType.value = res.data[0].deviceType
}
})
}
@ -395,10 +411,11 @@ function getMenuData() {
function handleClick(item:any, index:any){
// formulaInfo.value.correlation = JSON.parse(JSON.stringify(item.deviceName))
isAcitve.value = index
deviceType.value = ""
deviceId.value = ""
setTimeout(() => {
deviceId.value = item.deviceId
deviceType.value = item.deviceType
},
200);
}
@ -680,8 +697,11 @@ function handlefailDetail(row:any){
</div>
</div>
<div style="padding-left: 45px;padding-top: 20px; width: calc(100% - 290px); height: calc(100vh - 150px);">
<TableModels v-if="isShowResult && isEchartsModel == 1 && deviceId !=''" :deviceId="deviceId" :scenarioId="scenarioId"/>
<EchartsModels v-if="isShowResult && isEchartsModel == 2 && deviceId !=''" :deviceId="deviceId" :scenarioId="scenarioId"/>
<TableModels v-if="isShowResult && isEchartsModel == 1 && deviceId !=''"
:deviceId="deviceId" :scenarioId="scenarioId" :deviceType="deviceType" :sizeSchemaInfo="sizeSchemaInfo"/>
<EchartsModels v-if="isShowResult && isEchartsModel == 2 && deviceId !=''"
:deviceId="deviceId" :scenarioId="scenarioId" :deviceType="deviceType" :sizeSchemaInfo="sizeSchemaInfo" />
</div>
</div>