JavaProjectRepo/business-css/frontend/src/components/antvx6/tableModel.vue

117 lines
4.9 KiB
Vue
Raw Normal View History

2026-01-17 14:59:23 +08:00
<script lang="ts">
export default {
name: "x6查看结果数据",
};
</script>
<script setup lang="ts">
import { onMounted, ref, nextTick } from "vue";
2026-01-19 17:31:35 +08:00
import { ElForm, ElMessage, ElMessageBox, selectEmits } from "element-plus";
import Page from '@/components/Pagination/page.vue'
2026-01-17 14:59:23 +08:00
import { getByScenario } from "@/api/business/scenario";
const emit = defineEmits([ 'closeEditdevice']);
const props = defineProps({
deviceId: {
required: false,
type: String,
default: ''
},
scenarioId: {
required: false,
type: String,
default: ''
},
})
2026-01-19 17:31:35 +08:00
const queryParams = ref({
current: 1,
size: 10,
})
const total = ref(0)
2026-01-17 14:59:23 +08:00
const scenarioResultData:any = ref([])
2026-01-19 17:31:35 +08:00
const selectData = ref<any>([])
function getIf(list:any,code:any){
for(let i = 0;i<list.length;i++){
if(list[i] == code){
return true
}
}
}
2026-01-17 14:59:23 +08:00
function getScenarioResults(){
scenarioResultData.value = []
getByScenario({
scenarioId: props.scenarioId,
deviceId: props.deviceId,
2026-01-19 17:31:35 +08:00
pageNum:queryParams.value.current,
pageSize:queryParams.value.size
2026-01-17 14:59:23 +08:00
}).then((res:any) => {
2026-01-19 17:31:35 +08:00
for(let i = 0;i<res.data.records.length;i++){
if(res.data.records[i].attrState != null){
let attrState = JSON.parse(res.data.records[i].attrState)
for (const key in attrState) {
if (!Object.hasOwn(attrState, key)) continue;
const element = attrState[key];
res.data.records[i][key] = element
if(i == 0){
selectData.value.push(key)
}
}
}
}
2026-01-17 14:59:23 +08:00
scenarioResultData.value = res.data.records
2026-01-19 17:31:35 +08:00
total.value = res.data.total
2026-01-17 14:59:23 +08:00
})
}
onMounted(() => {
getScenarioResults()
});
</script>
<template>
<div class="editdevice-box">
2026-01-19 17:31:35 +08:00
<el-table :data="scenarioResultData" style="width: 100%; height: calc(100vh - 260px);margin-bottom: 10px;" border
:header-cell-style="{ background: 'rgb(250 250 250)', color: '#383838', height: '50px' }">
<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-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,'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>
<el-table-column v-if="getIf(selectData,'u_concentration')" prop="u_concentration" label="铀浓度g/L" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'uo2_density')" prop="uo2_density" label="氧化铀密度g/cm3" min-width="160"></el-table-column>
<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,'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>
</div>
2026-01-17 14:59:23 +08:00
</div>
</template>
<style scoped>
</style>