修改前段设备物料,计算结果逻辑

This commit is contained in:
limengnan 2026-05-18 08:55:39 +08:00
parent 14ee33aecd
commit faa4b9482a
15 changed files with 720 additions and 928 deletions

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
//获取所有项目列表 //获取临界数据分页列表
export function searchCriticalDataPage(queryParams:any){ export function searchCriticalDataPage(queryParams:any){
return request({ return request({
url: '/critical-data/by-device-type' , url: '/critical-data/by-device-type' ,
@ -12,7 +12,7 @@ export function searchCriticalDataPage(queryParams:any){
//新增项目 //新增临界数据
export function addCriticalData(data:any){ export function addCriticalData(data:any){
return request({ return request({
url:'/critical-data' , url:'/critical-data' ,
@ -22,7 +22,7 @@ export function addCriticalData(data:any){
} }
//更新项目信息 //更新临界数据信息
export function updateCriticalData (queryParams:any){ export function updateCriticalData (queryParams:any){
return request({ return request({
url:'/critical-data' , url:'/critical-data' ,
@ -32,7 +32,7 @@ export function updateCriticalData (queryParams:any){
} }
//单个删除项目 //单个删除临界数据
export function deleteCriticalData (queryParams:any){ export function deleteCriticalData (queryParams:any){
return request({ return request({
url:'/critical-data/'+queryParams.id , url:'/critical-data/'+queryParams.id ,
@ -40,7 +40,7 @@ export function deleteCriticalData (queryParams:any){
// params: queryParams // params: queryParams
}); });
} }
//多选删除项目 //多选删除临界数据
export function deleteBatchCriticalData (queryParams:any){ export function deleteBatchCriticalData (queryParams:any){
return request({ return request({
url:'/critical-data', url:'/critical-data',
@ -48,3 +48,13 @@ export function deleteBatchCriticalData (queryParams:any){
data: queryParams data: queryParams
}); });
} }
// 导出临界数据
export function exportAllExports(deviceType:any){
let url = '/critical-data/v2/export/?deviceType='+deviceType
return request({
url: url ,
method: 'get',
responseType: 'arraybuffer'
});
}

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
//获取所有项目列表 //获取所有设备列表
export function searchDevicesPage(queryParams:any){ export function searchDevicesPage(queryParams:any){
return request({ return request({
url: '/devices/search' , url: '/devices/search' ,
@ -12,7 +12,7 @@ export function searchDevicesPage(queryParams:any){
//新增项目 //新增设备
export function addDevices(data:any){ export function addDevices(data:any){
return request({ return request({
url:'/devices' , url:'/devices' ,
@ -22,7 +22,7 @@ export function addDevices(data:any){
} }
//更新项目信息 //更新设备信息
export function updateDevices (queryParams:any){ export function updateDevices (queryParams:any){
return request({ return request({
url:'/devices' , url:'/devices' ,
@ -32,7 +32,7 @@ export function updateDevices (queryParams:any){
} }
//单个删除项目 //单个删除设备
export function deleteDevices (queryParams:any){ export function deleteDevices (queryParams:any){
return request({ return request({
url:'/devices/'+queryParams.id , url:'/devices/'+queryParams.id ,
@ -40,7 +40,7 @@ export function deleteDevices (queryParams:any){
// params: queryParams // params: queryParams
}); });
} }
//多选删除项目 //多选删除设备
export function deleteBatchDevices (queryParams:any){ export function deleteBatchDevices (queryParams:any){
return request({ return request({
url:'/devices', url:'/devices',
@ -50,7 +50,7 @@ export function deleteBatchDevices (queryParams:any){
} }
//获取所有项目列表 //获取所有设备列表
export function sizeSchemaAll(queryParams:any){ export function sizeSchemaAll(queryParams:any){
return request({ return request({
url: '/devices/v2/size-schema/all' , url: '/devices/v2/size-schema/all' ,
@ -59,4 +59,13 @@ export function sizeSchemaAll(queryParams:any){
}); });
} }
// 导出全部结果
export function exportAllExports(deviceType:any){
let url = '/devices/v2/export/?deviceType='+deviceType
return request({
url: url ,
method: 'get',
responseType: 'arraybuffer'
});
}

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
//获取所有项目列表 //获取所有物料列表
export function searchMaterialsPage(queryParams:any){ export function searchMaterialsPage(queryParams:any){
return request({ return request({
url: '/materials/search' , url: '/materials/search' ,
@ -13,7 +13,7 @@ export function searchMaterialsPage(queryParams:any){
//拓扑图新增或更新项目 //拓扑图新增或更新物料
export function saveOrUpdate(data:any){ export function saveOrUpdate(data:any){
return request({ return request({
url:'/materials/saveOrUpdate' , url:'/materials/saveOrUpdate' ,
@ -23,7 +23,7 @@ export function saveOrUpdate(data:any){
} }
//新增项目 //新增物料
export function addMaterials(data:any){ export function addMaterials(data:any){
return request({ return request({
url:'/materials' , url:'/materials' ,
@ -33,7 +33,7 @@ export function addMaterials(data:any){
} }
//更新项目信息 //更新物料信息
export function updateMaterials (queryParams:any){ export function updateMaterials (queryParams:any){
return request({ return request({
url:'/materials' , url:'/materials' ,
@ -43,7 +43,7 @@ export function updateMaterials (queryParams:any){
} }
//单个删除项目 //单个删除物料
export function deleteMaterials (queryParams:any){ export function deleteMaterials (queryParams:any){
return request({ return request({
url:'/materials/'+queryParams.id , url:'/materials/'+queryParams.id ,
@ -51,7 +51,7 @@ export function deleteMaterials (queryParams:any){
// params: queryParams // params: queryParams
}); });
} }
//多选删除项目 //多选删除物料
export function deleteBatchMaterials (queryParams:any){ export function deleteBatchMaterials (queryParams:any){
return request({ return request({
url:'/materials', url:'/materials',
@ -59,3 +59,14 @@ export function deleteBatchMaterials (queryParams:any){
data: queryParams data: queryParams
}); });
} }
// 导出物料
export function exportAllExports(){
let url = '/materials/export'
return request({
url: url ,
method: 'get',
responseType: 'arraybuffer'
});
}

View File

@ -16,6 +16,11 @@ const props = defineProps({
type: Object, type: Object,
default: {} default: {}
}, },
sizeSchemaInfo: {
required: false,
type: Object,
default: {}
},
deviceId: { deviceId: {
required: false, required: false,
type: String, type: String,
@ -27,6 +32,7 @@ const props = defineProps({
default: '' default: ''
}, },
}) })
const sourceTempData:any = ref([])
const input = ref('') // const input = ref('') //
const loading = ref(false) // const loading = ref(false) //
const tableData = ref([]) // const tableData = ref([]) //
@ -44,55 +50,56 @@ if(deviceTypetype.value == ''){
loading.value = true; loading.value = true;
searchDevicesPage(params).then((result:any) => { searchDevicesPage(params).then((result:any) => {
result.records.forEach((item:any) => { result.records.forEach((item:any) => {
if(deviceTypetype.value == 'FlatTank'){ // item.size = JSON.parse(item.size)
let sizeInfo =JSON.parse(item.size) // if(deviceTypetype.value == 'FlatTank'){ //
item['length'] = sizeInfo.length // let sizeInfo =JSON.parse(item.size)
item['width'] = sizeInfo.width // item['length'] = sizeInfo.length
item['height'] = sizeInfo.height // item['width'] = sizeInfo.width
} // item['height'] = sizeInfo.height
if(deviceTypetype.value == 'CylindricalTank'){ // // }
let sizeInfo =JSON.parse(item.size) // if(deviceTypetype.value == 'CylindricalTank'){ //
item['diameter'] = sizeInfo.diameter // let sizeInfo =JSON.parse(item.size)
item['height'] = sizeInfo.height // item['diameter'] = sizeInfo.diameter
} // item['height'] = sizeInfo.height
if(deviceTypetype.value == 'AnnularTank'){ // // }
let sizeInfo =JSON.parse(item.size) // if(deviceTypetype.value == 'AnnularTank'){ //
item['outer_diameter'] = sizeInfo.outer_diameter // let sizeInfo =JSON.parse(item.size)
item['height'] = sizeInfo.height // item['outer_diameter'] = sizeInfo.outer_diameter
} // item['height'] = sizeInfo.height
// }
if(deviceTypetype.value == 'TubeBundleTank'){ // // if(deviceTypetype.value == 'TubeBundleTank'){ //
let sizeInfo =JSON.parse(item.size) // let sizeInfo =JSON.parse(item.size)
item['outer_diameter'] = sizeInfo.outer_diameter // item['outer_diameter'] = sizeInfo.outer_diameter
item['height'] = sizeInfo.height // item['height'] = sizeInfo.height
} // }
if(deviceTypetype.value == 'ExtractionColumn'){ // // if(deviceTypetype.value == 'ExtractionColumn'){ //
let sizeInfo =JSON.parse(item.size) // let sizeInfo =JSON.parse(item.size)
item['upper_expanded_diameter'] = sizeInfo.upper_expanded.diameter // item['upper_expanded_diameter'] = sizeInfo.upper_expanded.diameter
item['upper_expanded_height'] = sizeInfo.upper_expanded.height // item['upper_expanded_height'] = sizeInfo.upper_expanded.height
item['tray_section_diameter'] = sizeInfo.tray_section.diameter // item['tray_section_diameter'] = sizeInfo.tray_section.diameter
item['tray_section_height'] = sizeInfo.tray_section.height // item['tray_section_height'] = sizeInfo.tray_section.height
item['lower_expanded_diameter'] = sizeInfo.lower_expanded.diameter // item['lower_expanded_diameter'] = sizeInfo.lower_expanded.diameter
item['lower_expanded_height'] = sizeInfo.lower_expanded.height // item['lower_expanded_height'] = sizeInfo.lower_expanded.height
} // }
if(deviceTypetype.value == 'FluidizedBed'){ // // if(deviceTypetype.value == 'FluidizedBed'){ //
let sizeInfo =JSON.parse(item.size) // let sizeInfo =JSON.parse(item.size)
item['expanded_section_diameter'] = sizeInfo.expanded_section.diameter // item['expanded_section_diameter'] = sizeInfo.expanded_section.diameter
item['expanded_section_height'] = sizeInfo.expanded_section.height // item['expanded_section_height'] = sizeInfo.expanded_section.height
item['transition_section_height'] = sizeInfo.transition_section.height // item['transition_section_height'] = sizeInfo.transition_section.height
item['reaction_section_diameter'] = sizeInfo.reaction_section.diameter // item['reaction_section_diameter'] = sizeInfo.reaction_section.diameter
item['reaction_section_height'] = sizeInfo.reaction_section.height // item['reaction_section_height'] = sizeInfo.reaction_section.height
} // }
if(deviceTypetype.value == 'ACFTank'){ // // if(deviceTypetype.value == 'ACFTank'){ //
let sizeInfo =JSON.parse(item.size) // let sizeInfo =JSON.parse(item.size)
item['annular_cylinder_outer_diameter'] = sizeInfo.annular_cylinder.outer_diameter // item['annular_cylinder_outer_diameter'] = sizeInfo.annular_cylinder.outer_diameter
item['annular_cylinder_height'] = sizeInfo.annular_cylinder.height // item['annular_cylinder_height'] = sizeInfo.annular_cylinder.height
item['frustum_bottom_bottom_diameter'] = sizeInfo.frustum_bottom.bottom_diameter // item['frustum_bottom_bottom_diameter'] = sizeInfo.frustum_bottom.bottom_diameter
item['frustum_bottom_height'] = sizeInfo.frustum_bottom.height // item['frustum_bottom_height'] = sizeInfo.frustum_bottom.height
} // }
}) })
tableData.value = result.records; tableData.value = result.records;
@ -110,7 +117,7 @@ function confirmDevice(){ // 确定添加设备
const params = { const params = {
projectId: props.projectInfo.projectId, projectId: props.projectInfo.projectId,
deviceId: props.deviceId, deviceId: props.deviceId,
size: selectedDevice.value.size, size: JSON.stringify(selectedDevice.value.size),
code: selectedDevice.value.code, code: selectedDevice.value.code,
name: selectedDevice.value.name, name: selectedDevice.value.name,
type: selectedDevice.value.type, type: selectedDevice.value.type,
@ -130,7 +137,7 @@ function confirmClick(formEl: any) {
if (valid) { if (valid) {
const params = { const params = {
...info.value, ...info.value,
size: JSON.stringify( josnInfo.value), size: JSON.stringify( info.value.size),
projectId: props.projectInfo.projectId, projectId: props.projectInfo.projectId,
deviceId: props.deviceId deviceId: props.deviceId
} }
@ -143,22 +150,28 @@ function confirmClick(formEl: any) {
} }
}); });
} }
const info: any = ref({
name: "",
code: "",
type: null,
size: {},
volume: null,
flowRate: null,
pulseVelocity: null
});
onMounted(() => { onMounted(() => {
// sizeSchemaInfo.value = props.sizeSchemaInfo
sourceTempData.value = props.sizeSchemaInfo[props.deviceTypetype].fields
sourceTempData.value.forEach((item:any) => {
info.value.size[item.key] = null
})
// sizeSchemaInfo.value[queryParams.value.type]
gettableData() gettableData()
}); });
const infoForm = ref(); const infoForm = ref();
const isAdd = ref(false) // const isAdd = ref(false) //
const info: any = ref({
name: "",
code: "",
type: null,
size: null,
volume: null,
flowRate: null,
pulseVelocity: null
});
const josnInfo: any = ref({}) // const josnInfo: any = ref({}) //
const rules = ref({ const rules = ref({
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }], name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
@ -169,30 +182,30 @@ function addClick() {
name: "", name: "",
code: "", code: "",
type: props.deviceTypetype, type: props.deviceTypetype,
size: null, size: {},
volume: null, volume: null,
flowRate: null, flowRate: null,
pulseVelocity: null pulseVelocity: null
}; };
josnInfo.value = {} // josnInfo.value = {}
if(props.deviceTypetype == 'ExtractionColumn'){ // if(props.deviceTypetype == 'ExtractionColumn'){
josnInfo.value = { // josnInfo.value = {
tray_section:{}, // tray_section:{},
lower_expanded:{}, // lower_expanded:{},
upper_expanded:{} // upper_expanded:{}
} // }
}else if(props.deviceTypetype == 'FluidizedBed'){ // }else if(props.deviceTypetype == 'FluidizedBed'){
josnInfo.value = { // josnInfo.value = {
expanded_section:{}, // expanded_section:{},
reaction_section:{}, // reaction_section:{},
transition_section:{} // transition_section:{}
} // }
}else if(props.deviceTypetype == 'ACFTank'){ // }else if(props.deviceTypetype == 'ACFTank'){
josnInfo.value = { // josnInfo.value = {
frustum_bottom:{}, // frustum_bottom:{},
annular_cylinder:{} // annular_cylinder:{}
} // }
} // }
isAdd.value = true isAdd.value = true
} }
</script> </script>
@ -215,30 +228,11 @@ function addClick() {
@cell-click="selectPatient" highlight-current-row row-key="id" :header-cell-style="{ background: 'rgb(250 250 250)', color: '#383838', height: '50px' }"> @cell-click="selectPatient" highlight-current-row row-key="id" :header-cell-style="{ background: 'rgb(250 250 250)', color: '#383838', height: '50px' }">
<el-table-column type="index" label="序号" width="70" align="center"></el-table-column> <el-table-column type="index" label="序号" width="70" align="center"></el-table-column>
<el-table-column prop="name" label="设备名称" min-width="180"></el-table-column> <el-table-column prop="name" label="设备名称" min-width="180"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FlatTank'" prop="length" label="长度(cm)" min-width="100"></el-table-column> <el-table-column v-for="(item,index) in sourceTempData" :label="item.label" min-width="100">
<el-table-column v-if="deviceTypetype == 'FlatTank'" prop="width" label="宽度(cm)" min-width="100"></el-table-column> <template #default="scope">
<el-table-column v-if="deviceTypetype == 'FlatTank'" prop="height" label="高度(cm)" min-width="100"></el-table-column> {{ scope.row.size[item.key] }}
<el-table-column v-if="deviceTypetype == 'CylindricalTank'" prop="diameter" label="直径(cm)" min-width="100"></el-table-column> </template>
<el-table-column v-if="deviceTypetype == 'CylindricalTank'" prop="height" label="高度(cm)" min-width="100"></el-table-column> </el-table-column>
<el-table-column v-if="deviceTypetype == 'AnnularTank'" prop="outer_diameter" label="环形槽外径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'AnnularTank'" prop="height" label="环形槽高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'TubeBundleTank'" prop="outer_diameter" label="外径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'TubeBundleTank'" prop="height" label="高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ExtractionColumn'" prop="upper_expanded_diameter" label="上扩大段直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ExtractionColumn'" prop="upper_expanded_height" label="上扩大段高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ExtractionColumn'" prop="tray_section_diameter" label="板段直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ExtractionColumn'" prop="tray_section_height" label="板段高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ExtractionColumn'" prop="lower_expanded_diameter" label="下扩大段直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ExtractionColumn'" prop="lower_expanded_height" label="下扩大段高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FluidizedBed'" prop="expanded_section_diameter" label="扩大段直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FluidizedBed'" prop="expanded_section_height" label="扩大段高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FluidizedBed'" prop="transition_section_height" label="过渡段高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FluidizedBed'" prop="reaction_section_diameter" label="反应段直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FluidizedBed'" prop="reaction_section_height" label="反应段高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ACFTank'" prop="annular_cylinder_outer_diameter" label="环形圆柱外径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ACFTank'" prop="annular_cylinder_height" label="环形圆柱高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ACFTank'" prop="frustum_bottom_bottom_diameter" label="圆锥台底部直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'ACFTank'" prop="frustum_bottom_height" label="圆锥台底部高度(cm)" min-width="100"></el-table-column>
<el-table-column prop="volume" label="容量(L)" width="120"></el-table-column> <el-table-column prop="volume" label="容量(L)" width="120"></el-table-column>
<el-table-column prop="flowRate" label="流量(m³/h)" width="120"></el-table-column> <el-table-column prop="flowRate" label="流量(m³/h)" width="120"></el-table-column>
<el-table-column prop="pulseVelocity" label="脉冲速度(Hz)" width="120"></el-table-column> <el-table-column prop="pulseVelocity" label="脉冲速度(Hz)" width="120"></el-table-column>
@ -246,341 +240,25 @@ function addClick() {
</div> </div>
<div v-if="isAdd == true"> <div v-if="isAdd == true">
<el-form ref="infoForm" :model="info" :rules="rules" label-width="120px" v-if="isAdd == true" <el-form ref="infoForm" :model="info" :rules="rules" label-width="120px" v-if="isAdd == true"
style="width: 100%;height: calc(100vh - 340px);margin-top: 30px;"> style="width: 100%;max-height: calc(100vh - 300px);margin-top: 20px;overflow: auto;">
<el-form-item label="设备编号" prop="code" style="width: 100%;"> <el-form-item label="设备编号" prop="code" style="width: 100%;">
<el-input v-model="info.code" style="width: 100%" placeholder="请输入设备编号"></el-input> <el-input v-model="info.code" style="width: 100%" placeholder="请输入设备编号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="name" style="width: 100%;"> <el-form-item label="设备名称" prop="name" style="width: 100%;">
<el-input v-model="info.name" style="width: 100%" placeholder="请输入设备名称"></el-input> <el-input v-model="info.name" style="width: 100%" placeholder="请输入设备名称"></el-input>
</el-form-item> </el-form-item>
<div v-if="deviceTypetype == 'FlatTank'"> <el-form-item :label="item.label" style="width: 100%;" v-for="item in sourceTempData">
<el-form-item label="长度" style="width: 100%;"> <el-input-number
<el-input-number placeholder="请输入长度"
placeholder="请输入长度" v-model="info.size[item.key]"
v-model="josnInfo['length']" :min="0"
:min="0" align="left"
align="left" :controls="false"
:controls="false" style="width: 100%"
style="width: 100%" >
> <template #suffix>{{item.unit}}</template>
<template #suffix>cm</template> </el-input-number>
</el-input-number> </el-form-item>
</el-form-item>
<el-form-item label="宽度" style="width: 100%;">
<el-input-number
placeholder="请输入宽度"
v-model="josnInfo.width"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'CylindricalTank'">
<el-form-item label="直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'AnnularTank'">
<el-form-item label="环形槽外径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.outer_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="环形槽高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'TubeBundleTank'">
<el-form-item label="外径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.outer_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'ExtractionColumn'">
<div class="flex">
<el-form-item label="上扩大段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.upper_expanded.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="上扩大段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.upper_expanded.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="板段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.tray_section.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="板段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.tray_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="下扩大段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.lower_expanded.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="下扩大段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.lower_expanded.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
</div>
<div v-if="deviceTypetype == 'FluidizedBed'">
<div class="flex">
<el-form-item label="扩大段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.expanded_section.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="扩大段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.expanded_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<el-form-item label="过渡段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.transition_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<div class="flex">
<el-form-item label="反应段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.reaction_section.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="反应段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.reaction_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
</div>
<div v-if="deviceTypetype == 'ACFTank'">
<div class="flex">
<el-form-item label="环形圆柱外径" style="width: 100%;">
<el-input-number
placeholder="请输入外径"
v-model="josnInfo.annular_cylinder.outer_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="环形圆柱高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.annular_cylinder.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="圆锥台底部直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.frustum_bottom.bottom_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="圆锥台底部高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.frustum_bottom.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
</div>
<el-form-item label="容量" style="width: 100%;"> <el-form-item label="容量" style="width: 100%;">
<el-input-number <el-input-number
placeholder="请输入容量" placeholder="请输入容量"
@ -606,16 +284,16 @@ function addClick() {
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="脉冲速度" style="width: 100%;"> <el-form-item label="脉冲速度" style="width: 100%;">
<el-input-number <el-input-number
placeholder="请输入脉冲速度" placeholder="请输入脉冲速度"
v-model="info.pulseVelocity" v-model="info.pulseVelocity"
:min="0" :min="0"
align="left" align="left"
:controls="false" :controls="false"
style="width: 100%" style="width: 100%"
> >
<template #suffix>Hz</template> <template #suffix>Hz</template>
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
<!-- <span class="dialog-footer" <!-- <span class="dialog-footer"
style="display: flex;display: -webkit-flex; justify-content: flex-end;-webkit-justify-content: flex-end;"> style="display: flex;display: -webkit-flex; justify-content: flex-end;-webkit-justify-content: flex-end;">

View File

@ -17,49 +17,56 @@ function getName(code:any) {
key: '', key: '',
type: '' type: ''
} }
if( getFormula(deviceType.value ,code).isDevice == true){
return tempInfo = {
name: getFormula(deviceType.value ,code).label,
key: getFormula(deviceType.value ,code).key,
type: 'device'
};
}
switch (code) { switch (code) {
case 'width': // case 'width':
return tempInfo = { // return tempInfo = {
name: "宽度cm", // name: "cm",
key: 'width', // key: 'width',
type: 'device' // type: 'device'
}; // };
break; // break;
case 'outer_diameter': // case 'outer_diameter':
return tempInfo = { // return tempInfo = {
name: "外径cm", // name: "cm",
key: 'outer_diameter', // key: 'outer_diameter',
type: 'device' // type: 'device'
}; // };
break; // break;
case 'height': // case 'height':
return tempInfo = { // return tempInfo = {
name: "高度cm", // name: "cm",
key: 'height', // key: 'height',
type: 'device' // type: 'device'
}; // };
break; // break;
case 'length': // case 'length':
return tempInfo = { // return tempInfo = {
name: "长度cm", // name: "cm",
key: 'length', // key: 'length',
type: 'device' // type: 'device'
}; // };
break; // break;
case 'diameter': // case 'diameter':
return tempInfo = { // return tempInfo = {
name: "外径cm", // name: "cm",
key: 'diameter', // key: 'diameter',
type: 'device' // type: 'device'
}; // };
break; // break;
case 'volume': // case 'volume':
return tempInfo = { // return tempInfo = {
name: "体积单位L", // name: "L",
key: 'volume', // key: 'volume',
type: 'device' // type: 'device'
}; // };
break; // break;
case 'flow_rate': case 'flow_rate':
return tempInfo = { return tempInfo = {
name: "流量单位m3/h", name: "流量单位m3/h",
@ -90,7 +97,7 @@ function getName(code:any) {
break; break;
case 'u_enrichment': case 'u_enrichment':
return tempInfo = { return tempInfo = {
name: "铀富集度%", name: "铀富集度",
key: 'u_enrichment', key: 'u_enrichment',
type: 'material' type: 'material'
}; };
@ -109,10 +116,39 @@ function getName(code:any) {
type: 'material' type: 'material'
}; };
break; break;
case 'pu_isotope': case 'e_pu238':
return tempInfo = { return tempInfo = {
name: "钚同位素比例PU-240占比%", name: "PU-238占比",
key: 'pu_isotope', key: 'e_pu238',
type: 'material'
};
break;
case 'e_pu239':
return tempInfo = {
name: "PU-239占比",
key: 'e_pu239',
type: 'material'
};
break;
case 'e_pu240':
return tempInfo = {
name: "PU-240占比",
key: 'e_pu240',
type: 'material'
};
break;
case 'e_pu241':
return tempInfo = {
name: "PU-241占比",
key: 'e_pu241',
type: 'material'
};
break;
case 'e_pu242':
return tempInfo = {
name: "PU-242占比",
key: 'e_pu242',
type: 'material' type: 'material'
}; };
break; break;
@ -132,14 +168,14 @@ function getName(code:any) {
break; break;
case 'organic_ratio': case 'organic_ratio':
return tempInfo = { return tempInfo = {
name: "有机相比例%", name: "有机相比例",
key: 'organic_ratio', key: 'organic_ratio',
type: 'material' type: 'material'
}; };
break; break;
case 'moisture_content': case 'moisture_content':
return tempInfo = { return tempInfo = {
name: "含水率%", name: "含水率",
key: 'moisture_content', key: 'moisture_content',
type: 'material' type: 'material'
}; };
@ -154,12 +190,38 @@ function getName(code:any) {
return tempInfo return tempInfo
} }
const getFormula:any = (deviceType:any,code:any)=>{
let deviceTemp = {
isDevice: false,
label: '',
key: '',
}
let tempFields = props.sizeSchemaInfo[deviceType].fields
for(let i = 0; i < tempFields.length; i++){
if(tempFields[i].key == code){
deviceTemp = {
isDevice: true,
label:tempFields[i].label,
key: tempFields[i].key,
}
break
}
}
return deviceTemp
}
const props = defineProps({ const props = defineProps({
projectInfo: { projectInfo: {
required: false, required: false,
type: Object, type: Object,
default: {} default: {}
}, },
sizeSchemaInfo:{
required: false,
type: Object,
default: {}
},
formula: { formula: {
required: false, required: false,
type: String, type: String,
@ -196,7 +258,10 @@ function gettableData() {
} }
}) })
} }
const deviceType:any = ref('')
function handleClick(item:any, index:any){ function handleClick(item:any, index:any){
deviceType.value = item.deviceType
attributeList.value = []; attributeList.value = [];
if(item.deviceSize != "" && item.deviceSize != null){ if(item.deviceSize != "" && item.deviceSize != null){
let deviceSize = JSON.parse(item.deviceSize); let deviceSize = JSON.parse(item.deviceSize);

View File

@ -18,7 +18,11 @@ const props = defineProps({
type: Object, type: Object,
default: {} default: {}
}, },
sizeSchemaInfo:{
required: false,
type: Object,
default: {}
},
deviceInfo:{ deviceInfo:{
required: false, required: false,
type: Object, type: Object,
@ -93,7 +97,7 @@ function getInit(row:any){
correlation: '', correlation: '',
delay: '', delay: '',
},{ },{
key: "铀富集度%", key: "铀富集度",
name: "u_enrichment", name: "u_enrichment",
value: row.uEnrichment, value: row.uEnrichment,
unit: "%", unit: "%",
@ -117,14 +121,48 @@ function getInit(row:any){
correlation: '', correlation: '',
delay: '', delay: '',
},{ },{
key: "钚同位素比例PU-240占比%", key: "PU-238占比",
name: "pu_isotope", name: "e_pu238",
value: row.puIsotope, value: row.ePu238,
unit: "%", unit: "",
formula: '', formula: '',
correlation: '', correlation: '',
delay: '', delay: '',
},{ },{
key: "PU-239占比",
name: "e_pu239",
value: row.ePu239,
unit: "",
formula: '',
correlation: '',
delay: '',
},{
key: "PU-240占比",
name: "e_pu240",
value: row.ePu240,
unit: "",
formula: '',
correlation: '',
delay: '',
},{
key: "PU-241占比",
name: "e_pu241",
value: row.ePu241,
unit: "",
formula: '',
correlation: '',
delay: '',
},{
key: "PU-242占比",
name: "e_pu242",
value: row.ePu242,
unit: "",
formula: '',
correlation: '',
delay: '',
},
{
key: "硝酸酸度mol/L", key: "硝酸酸度mol/L",
name: "hno3_acidity", name: "hno3_acidity",
value: row.hno3Acidity, value: row.hno3Acidity,
@ -138,18 +176,18 @@ function getInit(row:any){
correlation: '', correlation: '',
delay: '', delay: '',
},{ },{
key: "有机相比例%", key: "有机相比例",
name: "organic_ratio", name: "organic_ratio",
value: row.organicRatio, value: row.organicRatio,
unit: "%", unit: "",
formula: '', formula: '',
correlation: '', correlation: '',
delay: '', delay: '',
},{ },{
key: "含水率%", key: "含水率",
name: "moisture_content", name: "moisture_content",
value: row.moistureContent, value: row.moistureContent,
unit: "%", unit: "",
formula: '', formula: '',
correlation: '', correlation: '',
delay: '', delay: '',
@ -266,7 +304,7 @@ function closeChangeDialogsettings(e:any){ // 变动公式值设置关闭
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table :data="tableData" style="width: 100%" border> <el-table :data="tableData" style="width: 100%;height: calc(100vh - 360px); overflow: auto;" border >
<el-table-column prop="key" label="属性" width="280"></el-table-column> <el-table-column prop="key" label="属性" width="280"></el-table-column>
<el-table-column prop="value" label="值" width="150"></el-table-column> <el-table-column prop="value" label="值" width="150"></el-table-column>
<el-table-column prop="formula" label="计算公式" min-width="100"></el-table-column> <el-table-column prop="formula" label="计算公式" min-width="100"></el-table-column>
@ -360,7 +398,7 @@ function closeChangeDialogsettings(e:any){ // 变动公式值设置关闭
<el-dialog v-model="isChangeDialogsettings" :close-on-click-modal="false" :modal="false" draggable <el-dialog v-model="isChangeDialogsettings" :close-on-click-modal="false" :modal="false" draggable
:before-close="dialogChangeDialogsettings" title="变动公式值设置" append-to-body width="1280px" class="materialmodel-dialog-box"> :before-close="dialogChangeDialogsettings" title="变动公式值设置" append-to-body width="1280px" class="materialmodel-dialog-box">
<ChangeDialogsettings v-if="isChangeDialogsettings" :projectInfo="projectInfo" <ChangeDialogsettings v-if="isChangeDialogsettings" :projectInfo="projectInfo"
:formula = "formula" :formulaData= "formulaData" :delayList="delayList" :formula = "formula" :formulaData= "formulaData" :delayList="delayList" :sizeSchemaInfo="sizeSchemaInfo"
@closeChangeDialogsettings="closeChangeDialogsettings" /> @closeChangeDialogsettings="closeChangeDialogsettings" />
</el-dialog> </el-dialog>

View File

@ -74,7 +74,7 @@ function getName(code:any) {
return name = "氧化铀密度g/cm3"; return name = "氧化铀密度g/cm3";
break; break;
case 'u_enrichment': case 'u_enrichment':
return name = "铀富集度%"; return name = "铀富集度";
break; break;
case 'pu_concentration': case 'pu_concentration':
return name = "钚浓度g/L"; return name = "钚浓度g/L";
@ -83,7 +83,7 @@ function getName(code:any) {
return name = "氧化钚密度g/cm3"; return name = "氧化钚密度g/cm3";
break; break;
case 'pu_isotope': case 'pu_isotope':
return name = "钚同位素比例PU-240占比%"; return name = "钚同位素比例PU-240占比";
break; break;
case 'hno3_acidity': case 'hno3_acidity':
return name = "硝酸酸度mol/L"; return name = "硝酸酸度mol/L";
@ -92,10 +92,10 @@ function getName(code:any) {
return name = "草酸浓度mol/L"; return name = "草酸浓度mol/L";
break; break;
case 'organic_ratio': case 'organic_ratio':
return name = "有机相比例%"; return name = "有机相比例";
break; break;
case 'moisture_content': case 'moisture_content':
return name = "含水率%"; return name = "含水率";
break; break;
default: default:
return name = ""; return name = "";

View File

@ -16,6 +16,11 @@ const props = defineProps({
type: Object, type: Object,
default: {} default: {}
}, },
sizeSchemaInfo: {
required: false,
type: Object,
default: {}
},
deviceInfo: { deviceInfo: {
required: false, required: false,
type: Object, type: Object,
@ -37,7 +42,7 @@ function confirmClick(formEl: any) {
if (valid) { if (valid) {
const params = { const params = {
...info.value, ...info.value,
size: JSON.stringify(josnInfo.value) size: JSON.stringify(info.value.size)
} }
updateDevices(params).then((res:any) => { updateDevices(params).then((res:any) => {
@ -49,8 +54,9 @@ function confirmClick(formEl: any) {
} }
}); });
} }
const sourceTempData:any = ref([])
onMounted(() => { onMounted(() => {
sourceTempData.value = props.sizeSchemaInfo[props.deviceTypetype].fields
editClick(props.deviceInfo) editClick(props.deviceInfo)
}); });
@ -59,12 +65,11 @@ const info: any = ref({
name: "", name: "",
code: "", code: "",
type: null, type: null,
size: null, size: {},
volume: null, volume: null,
flowRate: null, flowRate: null,
pulseVelocity: null pulseVelocity: null
}); });
const josnInfo: any = ref({}) //
const rules = ref({ const rules = ref({
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }], name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
code: [{ required: true, message: "请输入设备编码", trigger: "blur" }], code: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
@ -72,10 +77,8 @@ const rules = ref({
const isEdit = ref(false) // const isEdit = ref(false) //
function editClick(row: any) { function editClick(row: any) {
info.value = JSON.parse(JSON.stringify(row)); info.value = JSON.parse(JSON.stringify(row));
info.value.size = JSON.parse(row.size)
if(row.size != null){
josnInfo.value = JSON.parse(row.size);
}
isEdit.value = true; isEdit.value = true;
} }
</script> </script>
@ -84,352 +87,38 @@ function editClick(row: any) {
<div class="editdevice-box"> <div class="editdevice-box">
<el-form ref="infoForm" :model="info" :rules="rules" label-width="120px" v-if="isEdit" <el-form ref="infoForm" :model="info" :rules="rules" label-width="120px" v-if="isEdit"
style="width: 100%;height: calc(100vh - 340px);margin-top: 30px;"> style="width: 100%;max-height: calc(100vh - 260px);margin-top: 20px;overflow: auto;">
<el-form-item label="设备编号" prop="code" style="width: 100%;"> <el-form-item label="设备编号" prop="code" style="width: 100%;">
<el-input v-model="info.code" style="width: 100%" placeholder="请输入设备编号" :disabled="true"></el-input> <el-input v-model="info.code" style="width: 100%" placeholder="请输入设备编号" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="name" style="width: 100%;"> <el-form-item label="设备名称" prop="name" style="width: 100%;">
<el-input v-model="info.name" style="width: 100%" placeholder="请输入设备名称"></el-input> <el-input v-model="info.name" style="width: 100%" placeholder="请输入设备名称"></el-input>
</el-form-item> </el-form-item>
<div v-if="deviceTypetype == 'FlatTank'">
<el-form-item label="长度" style="width: 100%;">
<el-input-number
placeholder="请输入长度"
v-model="josnInfo['length']"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="宽度" style="width: 100%;">
<el-input-number
placeholder="请输入宽度"
v-model="josnInfo.width"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'CylindricalTank'">
<el-form-item label="直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'AnnularTank'"> <el-form-item :label="item.label" style="width: 100%;" v-for="item in sourceTempData">
<el-form-item label="环形槽外径" style="width: 100%;"> <el-input-number
<el-input-number placeholder="请输入长度"
placeholder="请输入直径" v-model="info.size[item.key]"
v-model="josnInfo.outer_diameter" :min="0"
:min="0" align="left"
align="left" :controls="false"
:controls="false" style="width: 100%"
style="width: 100%" >
> <template #suffix>{{item.unit}}</template>
<template #suffix>cm</template> </el-input-number>
</el-input-number> </el-form-item>
</el-form-item>
<el-form-item label="环形槽高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'TubeBundleTank'">
<el-form-item label="外径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.outer_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div v-if="deviceTypetype == 'ExtractionColumn'">
<div class="flex">
<el-form-item label="上扩大段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.upper_expanded.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="上扩大段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.upper_expanded.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="板段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.tray_section.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="板段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.tray_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="下扩大段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.lower_expanded.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="下扩大段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.lower_expanded.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
</div>
<div v-if="deviceTypetype == 'FluidizedBed'">
<div class="flex">
<el-form-item label="扩大段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.expanded_section.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="扩大段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.expanded_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<el-form-item label="过渡段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.transition_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<div class="flex">
<el-form-item label="反应段直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.reaction_section.diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="反应段高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.reaction_section.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
</div>
<div v-if="deviceTypetype == 'ACFTank'">
<div class="flex">
<el-form-item label="环形圆柱外径" style="width: 100%;">
<el-input-number
placeholder="请输入外径"
v-model="josnInfo.annular_cylinder.outer_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="环形圆柱高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.annular_cylinder.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
<div class="flex">
<el-form-item label="圆锥台底部直径" style="width: 100%;">
<el-input-number
placeholder="请输入直径"
v-model="josnInfo.frustum_bottom.bottom_diameter"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
<el-form-item label="圆锥台底部高度" style="width: 100%;">
<el-input-number
placeholder="请输入高度"
v-model="josnInfo.frustum_bottom.height"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
</el-input-number>
</el-form-item>
</div>
</div>
<el-form-item label="容量" style="width: 100%;"> <el-form-item label="容量" style="width: 100%;">
<el-input-number <el-input-number
placeholder="请输入容量" placeholder="请输入容量"
v-model="info.volume" v-model="info.volume"
:min="0" :min="0"
align="left" align="left"
:controls="false" :controls="false"
style="width: 100%" style="width: 100%"
> >
<template #suffix>L</template> <template #suffix>L</template>
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="流量" style="width: 100%;"> <el-form-item label="流量" style="width: 100%;">
<el-input-number <el-input-number

View File

@ -19,9 +19,8 @@ import insertCss from 'insert-css'
import { updateProjects} from "@/api/business/project"; import { updateProjects} from "@/api/business/project";
import Createscenario from '@/views/component/scenario/createscenario.vue' import Createscenario from '@/views/component/scenario/createscenario.vue'
import ScenarioModel from '@/views/component/scenario/index.vue' import ScenarioModel from '@/views/component/scenario/index.vue'
import { addDevices } from "@/api/business/database/device"; import { addDevices,sizeSchemaAll } from "@/api/business/database/device";
import { saveOrUpdate} from "@/api/business/database/material"; import { saveOrUpdate} from "@/api/business/database/material";
import { projectsById} from "@/api/business/project"; import { projectsById} from "@/api/business/project";
import line1 from '@/assets/x6/line1.png' import line1 from '@/assets/x6/line1.png'
import line2 from '@/assets/x6/line2.png' import line2 from '@/assets/x6/line2.png'
@ -44,6 +43,16 @@ const props = defineProps({
default: {} default: {}
}, },
}) })
//
const sizeSchemaInfo:any = ref({});
async function getSizeSchemaList(){
let result = await sizeSchemaAll({})
sizeSchemaInfo.value = result
}
const isLock = ref(false) // const isLock = ref(false) //
const deviceTypetype:any = ref('') // const deviceTypetype:any = ref('') //
const isAdddevice = ref(false) // const isAdddevice = ref(false) //
@ -940,12 +949,21 @@ graph.on('blank:mouseup', (e) => {
const topology:any = JSON.parse(projectInfo.value.topology) const topology:any = JSON.parse(projectInfo.value.topology)
if(!topology.designData)return if(!topology.designData)return
graph.fromJSON(topology.designData); graph.fromJSON(topology.designData);
let json = graph.toJSON()
tabDeviceNum.value = 0
for(let i = 0; i < json.cells.length; i++){
if(json.cells[i].shape == 'custom-image'){
tabDeviceNum.value++
}
}
} }
}) })
getSizeSchemaList()
// #endregion // #endregion
}) })
const tabDeviceNum = ref(0)
const antvStatus = ref('初始化')
function preWork() { function preWork() {
// //
const container = document.getElementById('container') as HTMLElement const container = document.getElementById('container') as HTMLElement
@ -1020,7 +1038,15 @@ const isMenuShow = ref(false) // 是否显示右键菜单
const selectedNode:any = ref(null) const selectedNode:any = ref(null)
function deleteNode() { // function deleteNode() { //
graph.removeNode(selectedNode.value) graph.removeNode(selectedNode.value)
isMenuShow.value = false let json = graph.toJSON()
tabDeviceNum.value = 0
for(let i = 0; i < json.cells.length; i++){
if(json.cells[i].shape == 'custom-image'){
tabDeviceNum.value++
}
}
antvStatus.value = '删除设备'
isMenuShow.value = false
} }
@ -1161,6 +1187,7 @@ function closeConnectingwireModel(e:any){ // 关闭连接线弹窗
zIndex: 0 zIndex: 0
}) })
} }
antvStatus.value = '编辑连接线'
} }
isConnectingwire.value = false; isConnectingwire.value = false;
} }
@ -1194,7 +1221,15 @@ function closeAdddevice(e:any){ // 关闭新增设备弹窗
retrievedNode.attr('text/text', e.name) retrievedNode.attr('text/text', e.name)
retrievedNode.attr('label/text', e.name) retrievedNode.attr('label/text', e.name)
retrievedNode.store.data.deviceInfo = e retrievedNode.store.data.deviceInfo = e
saveDesign(false) saveDesign(false)
let json = graph.toJSON()
tabDeviceNum.value = 0
for(let i = 0; i < json.cells.length; i++){
if(json.cells[i].shape == 'custom-image'){
tabDeviceNum.value++
}
}
antvStatus.value = '新增设备'
isAdddevice.value = false; isAdddevice.value = false;
} }
@ -1215,6 +1250,14 @@ function closeEditdevice(e:any){ // 关闭编辑设备弹窗
retrievedNode.attr('text/text', e.name) retrievedNode.attr('text/text', e.name)
retrievedNode.attr('label/text', e.name) retrievedNode.attr('label/text', e.name)
isEditdevice.value = false; isEditdevice.value = false;
let json = graph.toJSON()
tabDeviceNum.value = 0
for(let i = 0; i < json.cells.length; i++){
if(json.cells[i].shape == 'custom-image'){
tabDeviceNum.value++
}
}
antvStatus.value = '编辑设备'
saveDesign(false) saveDesign(false)
} }
@ -1251,6 +1294,14 @@ function closeMaterialModel(e:any){ // 关闭物料信息弹窗
let retrievedNode:any = graph.getCellById(nodeId.value) let retrievedNode:any = graph.getCellById(nodeId.value)
retrievedNode.store.data.materialInfo = e retrievedNode.store.data.materialInfo = e
saveDesign(false) saveDesign(false)
let json = graph.toJSON()
tabDeviceNum.value = 0
for(let i = 0; i < json.cells.length; i++){
if(json.cells[i].shape == 'custom-image'){
tabDeviceNum.value++
}
}
antvStatus.value = '编辑物料信息'
isMaterialModel.value = false; isMaterialModel.value = false;
} }
@ -1300,6 +1351,15 @@ function closeChangesettingsModel(e:any){ // 关闭变动设置弹窗
selectedMaterial.value = e selectedMaterial.value = e
let retrievedNode:any = graph.getCellById(nodeId.value) let retrievedNode:any = graph.getCellById(nodeId.value)
retrievedNode.store.data.changesettings = e retrievedNode.store.data.changesettings = e
saveDesign(false)
let json = graph.toJSON()
tabDeviceNum.value = 0
for(let i = 0; i < json.cells.length; i++){
if(json.cells[i].shape == 'custom-image'){
tabDeviceNum.value++
}
}
antvStatus.value = '编辑变动设置'
isChangesettings.value = false; isChangesettings.value = false;
} }
@ -1491,6 +1551,9 @@ function saveDesign(is:any) { // 保存设计
}); });
} }
}); });
if(is == true){
antvStatus.value = '完成保存'
}
// //
return saveData return saveData
} catch (error) { } catch (error) {
@ -1519,7 +1582,7 @@ const confirmCopyClick = async ()=>{
return return
} }
loading.value = true loading.value = true
copyNodeInfo.value.store.data.attrs.label.text = copyDeviceInfo.value.name copyNodeInfo.value.store.data.attrs.label.text = copyDeviceInfo.value.name
copyNodeInfo.value.store.data.deviceInfo.name = copyDeviceInfo.value.name copyNodeInfo.value.store.data.deviceInfo.name = copyDeviceInfo.value.name
copyNodeInfo.value.store.data.deviceInfo.code = copyDeviceInfo.value.code + '-copy' copyNodeInfo.value.store.data.deviceInfo.code = copyDeviceInfo.value.code + '-copy'
copyNodeInfo.value.store.data.deviceInfo.deviceId = copyNodeInfo.value.id copyNodeInfo.value.store.data.deviceInfo.deviceId = copyNodeInfo.value.id
@ -1724,10 +1787,10 @@ function getName(code:any) {
return name = "氧化铀密度g/cm3"; return name = "氧化铀密度g/cm3";
break; break;
case 'u_enrichment': case 'u_enrichment':
return name = "铀富集度%"; return name = "铀富集度";
break; break;
case 'uEnrichment': case 'uEnrichment':
return name = "铀富集度%"; return name = "铀富集度";
break; break;
case 'pu_concentration': case 'pu_concentration':
return name = "钚浓度g/L"; return name = "钚浓度g/L";
@ -1742,10 +1805,10 @@ function getName(code:any) {
return name = "氧化钚密度g/cm3"; return name = "氧化钚密度g/cm3";
break; break;
case 'pu_isotope': case 'pu_isotope':
return name = "钚同位素比例PU-240占比%"; return name = "钚同位素比例PU-240占比";
break; break;
case 'puIsotope': case 'puIsotope':
return name = "钚同位素比例PU-240占比%"; return name = "钚同位素比例PU-240占比";
break; break;
case 'hno3_acidity': case 'hno3_acidity':
return name = "硝酸酸度mol/L"; return name = "硝酸酸度mol/L";
@ -1760,16 +1823,16 @@ function getName(code:any) {
return name = "草酸浓度mol/L"; return name = "草酸浓度mol/L";
break; break;
case 'organic_ratio': case 'organic_ratio':
return name = "有机相比例%"; return name = "有机相比例";
break; break;
case 'organicRatio': case 'organicRatio':
return name = "有机相比例%"; return name = "有机相比例";
break; break;
case 'moisture_content': case 'moisture_content':
return name = "含水率%"; return name = "含水率";
break; break;
case 'moistureContent': case 'moistureContent':
return name = "含水率%"; return name = "含水率";
break; break;
default: default:
return name = ""; return name = "";
@ -1902,6 +1965,13 @@ function getName(code:any) {
</div> </div>
</div> </div>
<div class="tab-device-num">
<div style="margin-left: 10px; margin-right: 10px;"> 设备数量<span style="color: #0089ff;">{{ tabDeviceNum }}</span></div>
<div> 完成操作
<span style="color: #0089ff;" v-if="antvStatus=='初始化'">{{ antvStatus }}</span>
<span style="color: red;" v-else>{{ antvStatus }}</span>
</div>
</div>
</div> </div>
<Createscenario v-if="dialogVisible" :projectInfo="projectInfo" @closeCreatescenario ="closeCreatescenario"/> <Createscenario v-if="dialogVisible" :projectInfo="projectInfo" @closeCreatescenario ="closeCreatescenario"/>
<el-dialog v-model="isScenario" :close-on-click-modal="false" <el-dialog v-model="isScenario" :close-on-click-modal="false"
@ -1912,12 +1982,12 @@ function getName(code:any) {
<el-dialog v-model="isAdddevice" :close-on-click-modal="false" <el-dialog v-model="isAdddevice" :close-on-click-modal="false"
:modal="false" draggable :before-close="dialogAdddevice" title="添加设备" :modal="false" draggable :before-close="dialogAdddevice" title="添加设备"
append-to-body width="1050px"> append-to-body width="1050px">
<AdddeviceModel v-if="isAdddevice == true" :deviceId="nodeId" :projectInfo="projectInfo" <AdddeviceModel v-if="isAdddevice == true" :deviceId="nodeId" :projectInfo="projectInfo" :sizeSchemaInfo="sizeSchemaInfo"
:deviceTypetype="deviceTypetype" ref="Adddevice" @closeAdddevice="closeAdddevice"/> :deviceTypetype="deviceTypetype" ref="Adddevice" @closeAdddevice="closeAdddevice"/>
</el-dialog> </el-dialog>
<el-dialog v-model="isEditdevice" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogEditdevice" title="设备信息" append-to-body width="1050px"> <el-dialog v-model="isEditdevice" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogEditdevice" title="设备信息" append-to-body width="1050px">
<EditdeviceModel v-if="isEditdevice == true" :deviceId="nodeId" :deviceInfo="deviceInfo" <EditdeviceModel v-if="isEditdevice == true" :deviceId="nodeId" :deviceInfo="deviceInfo" :sizeSchemaInfo="sizeSchemaInfo"
:deviceTypetype="deviceTypetype" ref="Editdevice" @closeEditdevice="closeEditdevice"/> :deviceTypetype="deviceTypetype" ref="Editdevice" @closeEditdevice="closeEditdevice"/>
</el-dialog> </el-dialog>
@ -1928,7 +1998,8 @@ function getName(code:any) {
<el-dialog v-model="isChangesettings" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogChangesettings" title="变动设置" append-to-body width="1014px"> <el-dialog v-model="isChangesettings" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogChangesettings" title="变动设置" append-to-body width="1014px">
<ChangesettingsModels v-if="isChangesettings == true" :materialId="nodeId" :projectInfo="projectInfo" :changesettingsData="changesettingsData" <ChangesettingsModels v-if="isChangesettings == true" :materialId="nodeId" :projectInfo="projectInfo"
:changesettingsData="changesettingsData" :sizeSchemaInfo="sizeSchemaInfo"
:materialInfo="materialInfo" :deviceInfo="deviceInfo" ref="ChangesettingsModel" @closeChangesettingsModel="closeChangesettingsModel"/> :materialInfo="materialInfo" :deviceInfo="deviceInfo" ref="ChangesettingsModel" @closeChangesettingsModel="closeChangesettingsModel"/>
</el-dialog> </el-dialog>
@ -2295,4 +2366,18 @@ function getName(code:any) {
.x6-widget-stencil .x6-node.x6-node-immovable{ .x6-widget-stencil .x6-node.x6-node-immovable{
cursor: pointer; cursor: pointer;
} }
.tab-device-num{
position: absolute;
left: 300px;
bottom: 0px;
font-size: 14px;
color: #808080;
width: calc(100% - 300px);
height: 60px;
border-top: 1px solid #cfcfcf;
z-index: 1;
display: flex;
align-items: center;
/* justify-content: center; */
}
</style> </style>

View File

@ -56,7 +56,11 @@ function confirmClick(formEl: any) {
uEnrichment: info.value.uEnrichment, uEnrichment: info.value.uEnrichment,
puConcentration: info.value.puConcentration, puConcentration: info.value.puConcentration,
puo2Density: info.value.puo2Density, puo2Density: info.value.puo2Density,
puIsotope: info.value.puIsotope, ePu238: info.value.ePu238,
ePu239: info.value.ePu239,
ePu240: info.value.ePu240,
ePu241: info.value.ePu241,
ePu242: info.value.ePu242,
hno3Acidity: info.value.hno3Acidity, hno3Acidity: info.value.hno3Acidity,
h2c2o4Concentration: info.value.h2c2o4Concentration, h2c2o4Concentration: info.value.h2c2o4Concentration,
organicRatio: info.value.organicRatio, organicRatio: info.value.organicRatio,
@ -176,7 +180,7 @@ function handleClick(item:any, index:any){
value: item.uo2Density, value: item.uo2Density,
unit: "", unit: "",
},{ },{
key: "铀富集度%", key: "铀富集度",
value: item.uEnrichment, value: item.uEnrichment,
unit: "", unit: "",
},{ },{
@ -188,8 +192,24 @@ function handleClick(item:any, index:any){
value: item.puo2Density, value: item.puo2Density,
unit: "", unit: "",
},{ },{
key: "钚同位素比例PU-240占比%", key: "PU-238占比",
value: item.puIsotope, value: item.ePu238,
unit: "",
},{
key: "PU-239占比",
value: item.ePu239,
unit: "",
},{
key: "PU-240占比",
value: item.ePu240,
unit: "",
},{
key: "PU-241占比",
value: item.ePu241,
unit: "",
},{
key: "PU-242占比",
value: item.ePu242,
unit: "", unit: "",
},{ },{
key: "硝酸酸度mol/L", key: "硝酸酸度mol/L",
@ -200,11 +220,11 @@ function handleClick(item:any, index:any){
value: item.h2c2o4Concentration, value: item.h2c2o4Concentration,
unit: "", unit: "",
},{ },{
key: "有机相比例%", key: "有机相比例",
value: item.organicRatio, value: item.organicRatio,
unit: "", unit: "",
},{ },{
key: "含水率%", key: "含水率",
value: item.moistureContent, value: item.moistureContent,
unit: "", unit: "",
}) })
@ -234,7 +254,11 @@ function confirmMaterial(){
uEnrichment: selectedMaterial.value.uEnrichment, uEnrichment: selectedMaterial.value.uEnrichment,
puConcentration: selectedMaterial.value.puConcentration, puConcentration: selectedMaterial.value.puConcentration,
puo2Density: selectedMaterial.value.puo2Density, puo2Density: selectedMaterial.value.puo2Density,
puIsotope: selectedMaterial.value.puIsotope, ePu238: selectedMaterial.value.ePu238,
ePu239: selectedMaterial.value.ePu239,
ePu240: selectedMaterial.value.ePu240,
ePu241: selectedMaterial.value.ePu241,
ePu242: selectedMaterial.value.ePu242,
hno3Acidity: selectedMaterial.value.hno3Acidity, hno3Acidity: selectedMaterial.value.hno3Acidity,
h2c2o4Concentration: selectedMaterial.value.h2c2o4Concentration, h2c2o4Concentration: selectedMaterial.value.h2c2o4Concentration,
organicRatio: selectedMaterial.value.organicRatio, organicRatio: selectedMaterial.value.organicRatio,
@ -275,21 +299,39 @@ function confirmMaterial(){
</el-form-item> </el-form-item>
</div> </div>
<div class="materialmodel_dialog_display"> <div class="materialmodel_dialog_display">
<el-form-item label="铀富集度%" prop="uEnrichment"> <el-form-item label="铀富集度" prop="uEnrichment">
<el-input v-model="info.uEnrichment" style="width: 100%" placeholder="" @input="handleNumberInput('uEnrichment')"></el-input> <el-input v-model="info.uEnrichment" style="width: 100%" placeholder="" @input="handleNumberInput('uEnrichment')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="钚浓度g/L" prop="puConcentration"> <el-form-item label="钚浓度g/L" prop="puConcentration">
<el-input v-model="info.puConcentration" style="width: 100%" placeholder="" @input="handleNumberInput('puConcentration')"></el-input> <el-input v-model="info.puConcentration" style="width: 100%" placeholder="" @input="handleNumberInput('puConcentration')"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="materialmodel_dialog_display"> <div class="materialmodel_dialog_display">
<el-form-item label="氧化钚密度g/cm3" prop="puo2Density"> <el-form-item label="氧化钚密度g/cm3" prop="puo2Density">
<el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input> <el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="钚同位素比例PU-240占比%" prop="puIsotope"> <el-form-item label="PU-238占比" prop="ePu238">
<el-input v-model="info.puIsotope" style="width: 100%" placeholder="" @input="handleNumberInput('puIsotope')"></el-input> <el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="materialmodel_dialog_display">
<el-form-item label="PU-239占比" prop="ePu239">
<el-input v-model="info.ePu239" style="width: 100%" placeholder="" @input="handleNumberInput('ePu239')"></el-input>
</el-form-item>
<el-form-item label="PU-240占比" prop="ePu240">
<el-input v-model="info.ePu240" style="width: 100%" placeholder="" @input="handleNumberInput('ePu240')"></el-input>
</el-form-item>
</div>
<div class="materialmodel_dialog_display">
<el-form-item label="PU-241占比" prop="ePu241">
<el-input v-model="info.ePu241" style="width: 100%" placeholder="" @input="handleNumberInput('ePu241')"></el-input>
</el-form-item>
<el-form-item label="PU-242占比" prop="ePu242">
<el-input v-model="info.ePu242" style="width: 100%" placeholder="" @input="handleNumberInput('ePu242')"></el-input>
</el-form-item>
</div>
<div class="materialmodel_dialog_display"> <div class="materialmodel_dialog_display">
<el-form-item label="硝酸酸度mol/L" prop="hno3Acidity"> <el-form-item label="硝酸酸度mol/L" prop="hno3Acidity">
<el-input v-model="info.hno3Acidity" style="width: 100%" placeholder="" @input="handleNumberInput('hno3Acidity')"></el-input> <el-input v-model="info.hno3Acidity" style="width: 100%" placeholder="" @input="handleNumberInput('hno3Acidity')"></el-input>
@ -299,10 +341,10 @@ function confirmMaterial(){
</el-form-item> </el-form-item>
</div> </div>
<div class="materialmodel_dialog_display"> <div class="materialmodel_dialog_display">
<el-form-item label="有机相比例%" prop="organicRatio"> <el-form-item label="有机相比例" prop="organicRatio">
<el-input v-model="info.organicRatio" style="width: 100%" placeholder="" @input="handleNumberInput('organicRatio')"></el-input> <el-input v-model="info.organicRatio" style="width: 100%" placeholder="" @input="handleNumberInput('organicRatio')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="含水率%" prop="moistureContent"> <el-form-item label="含水率" prop="moistureContent">
<el-input v-model="info.moistureContent" style="width: 100%" placeholder="" @input="handleNumberInput('moistureContent')"></el-input> <el-input v-model="info.moistureContent" style="width: 100%" placeholder="" @input="handleNumberInput('moistureContent')"></el-input>
</el-form-item> </el-form-item>
</div> </div>

View File

@ -84,7 +84,7 @@ function downloadFile(obj :any, name :any, suffix :any) {
document.body.removeChild(link) document.body.removeChild(link)
} }
function exportExportsClick(){ function exportExportsClick(){
exportAllExports(props.scenarioId,props.deviceId).then((response:any) => { exportAllExports(props.scenarioId,props.deviceId).then((response:any) => {
downloadFile(response, '结果数据' , 'xlsx') downloadFile(response, '结果数据' , 'xlsx')
}); });
@ -111,14 +111,14 @@ function downloadFile(obj :any, name :any, suffix :any) {
<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,'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,'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,'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,'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,'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,'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,'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,'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,'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,'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-column v-if="getIf(selectData,'moisture_content')" prop="moisture_content" label="含水率" min-width="160"></el-table-column>
</el-table> </el-table>
<div style="display: flex; justify-content: flex-end;"> <div style="display: flex; justify-content: flex-end;">
<Page :total="total" v-model:size="queryParams.size" v-model:current="queryParams.current" @pagination="getScenarioResults" ></Page> <Page :total="total" v-model:size="queryParams.size" v-model:current="queryParams.current" @pagination="getScenarioResults" ></Page>

View File

@ -14,9 +14,10 @@ import {
Snapline, Snapline,
Transform Transform
} from '@antv/x6' } from '@antv/x6'
import { getDictItemById } from '@/api/dict';
// @ts-ignore // @ts-ignore
import { updateProjects,projectsById} from "@/api/business/project"; import { updateProjects,projectsById} from "@/api/business/project";
import { sizeSchemaAll } from "@/api/business/database/device";
import { getByScenario } from "@/api/business/scenario"; import { getByScenario } from "@/api/business/scenario";
import textimg from '@/assets/x6/text.png' import textimg from '@/assets/x6/text.png'
import echartsimg from '@/assets/x6/charts.png' import echartsimg from '@/assets/x6/charts.png'
@ -44,6 +45,59 @@ const props = defineProps({
default: '' default: ''
} }
}) })
const menuData:any = ref([])
//
function menuInit() {
let params = {
dictId: 'fe2c3418b8998f4e64d56ab46bfe0fed',
size:99,
current:1
}
getDictItemById(params).then((result: any) => {
menuData.value = result.data.records;
getSizeSchemaList()
}).catch((err: any) => {
});
}
//
const sizeSchemaInfo:any = ref({});
function getDeviceTypeName(deviceType:any){
let name:any = ""
for(let i = 0;i<menuData.value.length;i++){
if(menuData.value[i].itemCode == deviceType){
name = menuData.value[i].dictName
}
}
return name
}
async function getSizeSchemaList(){
let result:any = await sizeSchemaAll({})
for(let item in result){
result[item].deviceTypeName = getDeviceTypeName(result[item].deviceType)
result[item].fields.forEach((items:any) => {
items.name = items.label
items.code = items.key
items.checked = false
items.deviceType = result[item].deviceType,
items.deviceTypeName = getDeviceTypeName(result[item].deviceType)
})
// item.checked = true
// item.fields.forEach((items:any) => {
// items.checked = true
// }
// })
}
sizeSchemaInfo.value = result
}
const sliderIndex = ref<any>(0) // const sliderIndex = ref<any>(0) //
const sliderValues = ref<any>([]) // const sliderValues = ref<any>([]) //
const deviceTypetype:any = ref('') // const deviceTypetype:any = ref('') //
@ -154,6 +208,7 @@ function addAttrText(item:any,index:any,useData:any){
let tempData:any = [] let tempData:any = []
if(item.scenarioResults[index].attrState){ if(item.scenarioResults[index].attrState){
let attrState = JSON.parse(item.scenarioResults[index].attrState) let attrState = JSON.parse(item.scenarioResults[index].attrState)
debugger
for (const key in attrState) { for (const key in attrState) {
if (!Object.hasOwn(attrState, key)) continue; if (!Object.hasOwn(attrState, key)) continue;
const element = attrState[key]; const element = attrState[key];
@ -200,7 +255,7 @@ function getName(code:any) {
return name = "氧化铀密度g/cm3"; return name = "氧化铀密度g/cm3";
break; break;
case 'u_enrichment': case 'u_enrichment':
return name = "铀富集度%"; return name = "铀富集度";
break; break;
case 'pu_concentration': case 'pu_concentration':
return name = "钚浓度g/L"; return name = "钚浓度g/L";
@ -209,7 +264,7 @@ function getName(code:any) {
return name = "氧化钚密度g/cm3"; return name = "氧化钚密度g/cm3";
break; break;
case 'pu_isotope': case 'pu_isotope':
return name = "钚同位素比例PU-240占比%"; return name = "钚同位素比例PU-240占比";
break; break;
case 'hno3_acidity': case 'hno3_acidity':
return name = "硝酸酸度mol/L"; return name = "硝酸酸度mol/L";
@ -218,10 +273,10 @@ function getName(code:any) {
return name = "草酸浓度mol/L"; return name = "草酸浓度mol/L";
break; break;
case 'organic_ratio': case 'organic_ratio':
return name = "有机相比例%"; return name = "有机相比例";
break; break;
case 'moisture_content': case 'moisture_content':
return name = "含水率%"; return name = "含水率";
break; break;
default: default:
return name = ""; return name = "";
@ -296,7 +351,7 @@ function groupByDeviceId(data:any) { // 按设备id分组
} }
onMounted(() => { onMounted(() => {
menuInit()
scenarioId.value = props.scenarioId scenarioId.value = props.scenarioId
// #region // #region
graph = new Graph({ graph = new Graph({
@ -804,10 +859,26 @@ function dialogAttributeDialog(){ // 关闭变动设置弹窗
function confirmClick(){ function confirmClick(){
let tempData:any = [] let tempData:any = []
for(let i = 0;i<deviceList.value.length;i++){ // for(let i = 0;i<deviceList.value.length;i++){
if(deviceList.value[i].checked){ // if(deviceList.value[i].checked){
tempData.push(deviceList.value[i].code) // tempData.push(deviceList.value[i].code)
} // }
// }
// items.name = items.label
// items.code = items.key
// items.checked = false
// items.deviceType = result[item].deviceType,
// items.deviceTypeName = getDeviceTypeName(result[item].deviceType)
for(let item in sizeSchemaInfo.value){
sizeSchemaInfo.value[item].fields.forEach((items:any) => {
if(items.checked == true){
tempData.push(items.deviceType+items.code)
}
})
} }
for(let i = 0;i<materialList.value.length;i++){ for(let i = 0;i<materialList.value.length;i++){
if(materialList.value[i].checked){ if(materialList.value[i].checked){
@ -883,9 +954,24 @@ function dialogAttributeDialog(){ // 关闭变动设置弹窗
</div> </div>
<div style="width: 100%; height: calc(100vh - 300px);overflow: auto;"> <div style="width: 100%; height: calc(100vh - 300px);overflow: auto;">
<div class="deviceList-box" v-if="isTab == 0"> <div class="deviceList-box" v-if="isTab == 0">
<div v-for="(item,index) in deviceList" :key="index" class="deviceList-li">
<el-checkbox v-model="item.checked" :label="item.name"></el-checkbox> <div v-for="(item,index) in sizeSchemaInfo" :key="index">
<div class="deviceList-li">
{{item.deviceTypeName}}{{item.deviceType}}
</div>
<div v-for="(items,index) in item.fields" :key="index" class="deviceList-li">
<el-checkbox v-model="items.checked" :label="items.name"></el-checkbox>
</div>
<!-- <div v-for="(item,index) in deviceList" :key="index" class="deviceList-li">
<el-checkbox v-model="item.checked" :label="item.name"></el-checkbox>
</div> -->
</div> </div>
</div> </div>
<div class="deviceList-box" v-if="isTab == 1"> <div class="deviceList-box" v-if="isTab == 1">
<div v-for="(item,index) in materialList" :key="index" class="deviceList-li"> <div v-for="(item,index) in materialList" :key="index" class="deviceList-li">

View File

@ -7,7 +7,7 @@ export default {
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, nextTick } from "vue"; import { onMounted, ref, nextTick } from "vue";
import { ElForm, ElMessage, ElMessageBox } from "element-plus"; import { ElForm, ElMessage, ElMessageBox } from "element-plus";
import { searchCriticalDataPage,addCriticalData,updateCriticalData,deleteCriticalData,deleteBatchCriticalData} from "@/api/business/database/criticalData"; import { searchCriticalDataPage,addCriticalData,updateCriticalData,deleteCriticalData,deleteBatchCriticalData,exportAllExports} from "@/api/business/database/criticalData";
import { getDictItemById } from '@/api/dict'; import { getDictItemById } from '@/api/dict';
import { sizeSchemaAll } from "@/api/business/database/device"; import { sizeSchemaAll } from "@/api/business/database/device";
@ -309,6 +309,25 @@ onMounted(() => {
getSizeSchemaList() getSizeSchemaList()
menuInit() menuInit()
}); });
function exportExportsClick(){
exportAllExports(queryParams.value.type).then((response:any) => {
downloadFile(response, '临界数据数据' , 'xlsx')
});
}
function downloadFile(obj :any, name :any, suffix :any) {
const url = window.URL.createObjectURL(new Blob([obj]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const fileName = name.trim() + '.' + suffix
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
</script> </script>
<template> <template>
@ -343,6 +362,7 @@ onMounted(() => {
:on-error="handleError"> :on-error="handleError">
<el-button type="primary" style="margin: 0 10px;" v-hasPerm="['criticalData:import']">导入</el-button> <el-button type="primary" style="margin: 0 10px;" v-hasPerm="['criticalData:import']">导入</el-button>
</el-upload> </el-upload>
<el-button type="primary" @click="exportExportsClick">导出</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''" <el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['criticalData:del']">删除</el-button> :disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['criticalData:del']">删除</el-button>
</div> </div>
@ -388,7 +408,7 @@ onMounted(() => {
:modal="false" draggable :before-close="handleClose" :title="title" :modal="false" draggable :before-close="handleClose" :title="title"
append-to-body width="677px" height="530px"> append-to-body width="677px" height="530px">
<el-form ref="infoForm" :model="info" :rules="rules" label-width="100px" > <el-form ref="infoForm" :model="info" :rules="rules" label-width="100px" style="height: calc(100vh - 160px);overflow: auto;">
<el-form-item :label="item.label" style="width: 100%;" v-for="item in sourceTempData"> <el-form-item :label="item.label" style="width: 100%;" v-for="item in sourceTempData">
<el-input-number <el-input-number
placeholder="请输入长度" placeholder="请输入长度"

View File

@ -7,7 +7,8 @@ export default {
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, nextTick } from "vue"; import { onMounted, ref, nextTick } from "vue";
import { ElForm, ElMessage, ElMessageBox } from "element-plus"; import { ElForm, ElMessage, ElMessageBox } from "element-plus";
import { searchDevicesPage,addDevices,updateDevices,deleteDevices,deleteBatchDevices,sizeSchemaAll} from "@/api/business/database/device"; import { searchDevicesPage,addDevices,updateDevices,deleteDevices,deleteBatchDevices,sizeSchemaAll,
exportAllExports} from "@/api/business/database/device";
import { getDictItemById } from '@/api/dict'; import { getDictItemById } from '@/api/dict';
import Page from '@/components/Pagination/page.vue' import Page from '@/components/Pagination/page.vue'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
@ -327,6 +328,24 @@ const handleInput = (val: string) => {
val = value.slice(0, -1); val = value.slice(0, -1);
} }
}; };
function exportExportsClick(){
exportAllExports(queryParams.value.type).then((response:any) => {
downloadFile(response, '设备数据' , 'xlsx')
});
}
function downloadFile(obj :any, name :any, suffix :any) {
const url = window.URL.createObjectURL(new Blob([obj]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const fileName = name.trim() + '.' + suffix
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
</script> </script>
<template> <template>
@ -356,7 +375,7 @@ const handleInput = (val: string) => {
accept=".xlsx,.xls" v-hasPerm="['device:import']" accept=".xlsx,.xls" v-hasPerm="['device:import']"
class="upload-demo" class="upload-demo"
:data="{deviceType: queryParams.type}" :data="{deviceType: queryParams.type}"
:action=" url + '/devices/import' " :action=" url + '/devices/v2/import' "
:headers="{ token: getToken() }" :headers="{ token: getToken() }"
:show-file-list="false" :show-file-list="false"
:before-upload="handlePreview" :before-upload="handlePreview"
@ -364,6 +383,7 @@ const handleInput = (val: string) => {
:on-error="handleError"> :on-error="handleError">
<el-button type="primary" style="margin: 0 10px;">导入</el-button> <el-button type="primary" style="margin: 0 10px;">导入</el-button>
</el-upload> </el-upload>
<el-button type="primary" @click="exportExportsClick">导出</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''" v-hasPerm="['device:del']" <el-button :type="multipleSelection.length > 0 ? 'primary' : ''" v-hasPerm="['device:del']"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button> :disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
</div> </div>

View File

@ -7,7 +7,7 @@ export default {
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, nextTick } from "vue"; import { onMounted, ref, nextTick } from "vue";
import { ElForm, ElMessage, ElMessageBox } from "element-plus"; import { ElForm, ElMessage, ElMessageBox } from "element-plus";
import { searchMaterialsPage,addMaterials,updateMaterials,deleteMaterials,deleteBatchMaterials} from "@/api/business/database/material"; import { searchMaterialsPage,addMaterials,updateMaterials,deleteMaterials,deleteBatchMaterials,exportAllExports} from "@/api/business/database/material";
import Page from '@/components/Pagination/page.vue' import Page from '@/components/Pagination/page.vue'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
const url = import.meta.env.VITE_APP_BASE_API; const url = import.meta.env.VITE_APP_BASE_API;
@ -301,6 +301,23 @@ function handleError(file: any){
onMounted(() => { onMounted(() => {
gettableData(); gettableData();
}); });
function exportExportsClick(){
exportAllExports().then((response:any) => {
downloadFile(response, '物料数据' , 'xlsx')
});
}
function downloadFile(obj :any, name :any, suffix :any) {
const url = window.URL.createObjectURL(new Blob([obj]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const fileName = name.trim() + '.' + suffix
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
</script> </script>
<template> <template>
@ -327,6 +344,7 @@ onMounted(() => {
:on-error="handleError"> :on-error="handleError">
<el-button type="primary" style="margin: 0 10px;" v-hasPerm="['material:import']">导入</el-button> <el-button type="primary" style="margin: 0 10px;" v-hasPerm="['material:import']">导入</el-button>
</el-upload> </el-upload>
<el-button type="primary" @click="exportExportsClick">导出</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''" <el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['material:del']">删除</el-button> :disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['material:del']">删除</el-button>
</div> </div>
@ -381,7 +399,7 @@ onMounted(() => {
</el-form-item> </el-form-item>
</div> </div>
<div class="Materials_dialog_display"> <div class="Materials_dialog_display">
<el-form-item label="铀富集度%" prop="uEnrichment"> <el-form-item label="铀富集度" prop="uEnrichment">
<el-input v-model="info.uEnrichment" style="width: 100%" placeholder="" @input="handleNumberInput('uEnrichment')"></el-input> <el-input v-model="info.uEnrichment" style="width: 100%" placeholder="" @input="handleNumberInput('uEnrichment')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="钚浓度g/L" prop="puConcentration"> <el-form-item label="钚浓度g/L" prop="puConcentration">
@ -392,10 +410,31 @@ onMounted(() => {
<el-form-item label="氧化钚密度g/cm3" prop="puo2Density"> <el-form-item label="氧化钚密度g/cm3" prop="puo2Density">
<el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input> <el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="钚同位素比例PU-240占比%" prop="puIsotope"> <el-form-item label="PU-238占比" prop="puIsotope">
<el-input v-model="info.puIsotope" style="width: 100%" placeholder="" @input="handleNumberInput('puIsotope')"></el-input> <el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="Materials_dialog_display">
<el-form-item label="PU-239占比" prop="puIsotope">
<el-input v-model="info.ePu239" style="width: 100%" placeholder="" @input="handleNumberInput('ePu239')"></el-input>
</el-form-item>
<el-form-item label="PU-240占比" prop="puIsotope">
<el-input v-model="info.ePu240" style="width: 100%" placeholder="" @input="handleNumberInput('ePu240')"></el-input>
</el-form-item>
</div>
<div class="Materials_dialog_display">
<el-form-item label="PU-241占比" prop="puIsotope">
<el-input v-model="info.ePu241" style="width: 100%" placeholder="" @input="handleNumberInput('ePu241')"></el-input>
</el-form-item>
<el-form-item label="PU-242占比" prop="puIsotope">
<el-input v-model="info.ePu242" style="width: 100%" placeholder="" @input="handleNumberInput('ePu242')"></el-input>
</el-form-item>
</div>
<div class="Materials_dialog_display"> <div class="Materials_dialog_display">
<el-form-item label="硝酸酸度mol/L" prop="hno3Acidity"> <el-form-item label="硝酸酸度mol/L" prop="hno3Acidity">
<el-input v-model="info.hno3Acidity" style="width: 100%" placeholder="" @input="handleNumberInput('hno3Acidity')"></el-input> <el-input v-model="info.hno3Acidity" style="width: 100%" placeholder="" @input="handleNumberInput('hno3Acidity')"></el-input>
@ -405,10 +444,10 @@ onMounted(() => {
</el-form-item> </el-form-item>
</div> </div>
<div class="Materials_dialog_display"> <div class="Materials_dialog_display">
<el-form-item label="有机相比例%" prop="organicRatio"> <el-form-item label="有机相比例" prop="organicRatio">
<el-input v-model="info.organicRatio" style="width: 100%" placeholder="" @input="handleNumberInput('organicRatio')"></el-input> <el-input v-model="info.organicRatio" style="width: 100%" placeholder="" @input="handleNumberInput('organicRatio')"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="含水率%" prop="moistureContent"> <el-form-item label="含水率" prop="moistureContent">
<el-input v-model="info.moistureContent" style="width: 100%" placeholder="" @input="handleNumberInput('moistureContent')"></el-input> <el-input v-model="info.moistureContent" style="width: 100%" placeholder="" @input="handleNumberInput('moistureContent')"></el-input>
</el-form-item> </el-form-item>
</div> </div>