Merge branch 'develop-business-css' of http://121.37.111.42:3000/ThbTech/JavaProjectRepo into development-business-css

This commit is contained in:
wanxiaoli 2026-05-18 10:43:49 +08:00
commit 3e57f887fa
20 changed files with 963 additions and 958 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,6 +1,6 @@
import request from '@/utils/request';
//获取所有项目列表
//获取临界数据分页列表
export function searchCriticalDataPage(queryParams:any){
return request({
url: '/critical-data/by-device-type' ,
@ -12,7 +12,7 @@ export function searchCriticalDataPage(queryParams:any){
//新增项目
//新增临界数据
export function addCriticalData(data:any){
return request({
url:'/critical-data' ,
@ -22,7 +22,7 @@ export function addCriticalData(data:any){
}
//更新项目信息
//更新临界数据信息
export function updateCriticalData (queryParams:any){
return request({
url:'/critical-data' ,
@ -32,7 +32,7 @@ export function updateCriticalData (queryParams:any){
}
//单个删除项目
//单个删除临界数据
export function deleteCriticalData (queryParams:any){
return request({
url:'/critical-data/'+queryParams.id ,
@ -40,7 +40,7 @@ export function deleteCriticalData (queryParams:any){
// params: queryParams
});
}
//多选删除项目
//多选删除临界数据
export function deleteBatchCriticalData (queryParams:any){
return request({
url:'/critical-data',
@ -48,3 +48,13 @@ export function deleteBatchCriticalData (queryParams:any){
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';
//获取所有项目列表
//获取所有设备列表
export function searchDevicesPage(queryParams:any){
return request({
url: '/devices/search' ,
@ -12,7 +12,7 @@ export function searchDevicesPage(queryParams:any){
//新增项目
//新增设备
export function addDevices(data:any){
return request({
url:'/devices' ,
@ -22,7 +22,7 @@ export function addDevices(data:any){
}
//更新项目信息
//更新设备信息
export function updateDevices (queryParams:any){
return request({
url:'/devices' ,
@ -32,7 +32,7 @@ export function updateDevices (queryParams:any){
}
//单个删除项目
//单个删除设备
export function deleteDevices (queryParams:any){
return request({
url:'/devices/'+queryParams.id ,
@ -40,7 +40,7 @@ export function deleteDevices (queryParams:any){
// params: queryParams
});
}
//多选删除项目
//多选删除设备
export function deleteBatchDevices (queryParams:any){
return request({
url:'/devices',
@ -50,7 +50,7 @@ export function deleteBatchDevices (queryParams:any){
}
//获取所有项目列表
//获取所有设备列表
export function sizeSchemaAll(queryParams:any){
return request({
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';
//获取所有项目列表
//获取所有物料列表
export function searchMaterialsPage(queryParams:any){
return request({
url: '/materials/search' ,
@ -13,7 +13,7 @@ export function searchMaterialsPage(queryParams:any){
//拓扑图新增或更新项目
//拓扑图新增或更新物料
export function saveOrUpdate(data:any){
return request({
url:'/materials/saveOrUpdate' ,
@ -23,7 +23,7 @@ export function saveOrUpdate(data:any){
}
//新增项目
//新增物料
export function addMaterials(data:any){
return request({
url:'/materials' ,
@ -33,7 +33,7 @@ export function addMaterials(data:any){
}
//更新项目信息
//更新物料信息
export function updateMaterials (queryParams:any){
return request({
url:'/materials' ,
@ -43,7 +43,7 @@ export function updateMaterials (queryParams:any){
}
//单个删除项目
//单个删除物料
export function deleteMaterials (queryParams:any){
return request({
url:'/materials/'+queryParams.id ,
@ -51,7 +51,7 @@ export function deleteMaterials (queryParams:any){
// params: queryParams
});
}
//多选删除项目
//多选删除物料
export function deleteBatchMaterials (queryParams:any){
return request({
url:'/materials',
@ -59,3 +59,23 @@ export function deleteBatchMaterials (queryParams:any){
data: queryParams
});
}
// 导出物料
export function exportAllExports(){
let url = '/materials/export'
return request({
url: url ,
method: 'get',
responseType: 'arraybuffer'
});
}
//查看物料
export function materialsById (id:any){
return request({
url:'/materials/'+id ,
method: 'get'
// params: queryParams
});
}

View File

@ -16,6 +16,11 @@ const props = defineProps({
type: Object,
default: {}
},
sizeSchemaInfo: {
required: false,
type: Object,
default: {}
},
deviceId: {
required: false,
type: String,
@ -27,6 +32,7 @@ const props = defineProps({
default: ''
},
})
const sourceTempData:any = ref([])
const input = ref('') //
const loading = ref(false) //
const tableData = ref([]) //
@ -44,55 +50,56 @@ if(deviceTypetype.value == ''){
loading.value = true;
searchDevicesPage(params).then((result:any) => {
result.records.forEach((item:any) => {
if(deviceTypetype.value == 'FlatTank'){ //
let sizeInfo =JSON.parse(item.size)
item['length'] = sizeInfo.length
item['width'] = sizeInfo.width
item['height'] = sizeInfo.height
}
if(deviceTypetype.value == 'CylindricalTank'){ //
let sizeInfo =JSON.parse(item.size)
item['diameter'] = sizeInfo.diameter
item['height'] = sizeInfo.height
}
if(deviceTypetype.value == 'AnnularTank'){ //
let sizeInfo =JSON.parse(item.size)
item['outer_diameter'] = sizeInfo.outer_diameter
item['height'] = sizeInfo.height
}
item.size = JSON.parse(item.size)
// if(deviceTypetype.value == 'FlatTank'){ //
// let sizeInfo =JSON.parse(item.size)
// item['length'] = sizeInfo.length
// item['width'] = sizeInfo.width
// item['height'] = sizeInfo.height
// }
// if(deviceTypetype.value == 'CylindricalTank'){ //
// let sizeInfo =JSON.parse(item.size)
// item['diameter'] = sizeInfo.diameter
// item['height'] = sizeInfo.height
// }
// if(deviceTypetype.value == 'AnnularTank'){ //
// let sizeInfo =JSON.parse(item.size)
// item['outer_diameter'] = sizeInfo.outer_diameter
// item['height'] = sizeInfo.height
// }
if(deviceTypetype.value == 'TubeBundleTank'){ //
let sizeInfo =JSON.parse(item.size)
item['outer_diameter'] = sizeInfo.outer_diameter
item['height'] = sizeInfo.height
}
if(deviceTypetype.value == 'ExtractionColumn'){ //
let sizeInfo =JSON.parse(item.size)
item['upper_expanded_diameter'] = sizeInfo.upper_expanded.diameter
item['upper_expanded_height'] = sizeInfo.upper_expanded.height
item['tray_section_diameter'] = sizeInfo.tray_section.diameter
item['tray_section_height'] = sizeInfo.tray_section.height
item['lower_expanded_diameter'] = sizeInfo.lower_expanded.diameter
item['lower_expanded_height'] = sizeInfo.lower_expanded.height
}
if(deviceTypetype.value == 'FluidizedBed'){ //
let sizeInfo =JSON.parse(item.size)
item['expanded_section_diameter'] = sizeInfo.expanded_section.diameter
item['expanded_section_height'] = sizeInfo.expanded_section.height
// if(deviceTypetype.value == 'TubeBundleTank'){ //
// let sizeInfo =JSON.parse(item.size)
// item['outer_diameter'] = sizeInfo.outer_diameter
// item['height'] = sizeInfo.height
// }
// if(deviceTypetype.value == 'ExtractionColumn'){ //
// let sizeInfo =JSON.parse(item.size)
// item['upper_expanded_diameter'] = sizeInfo.upper_expanded.diameter
// item['upper_expanded_height'] = sizeInfo.upper_expanded.height
// item['tray_section_diameter'] = sizeInfo.tray_section.diameter
// item['tray_section_height'] = sizeInfo.tray_section.height
// item['lower_expanded_diameter'] = sizeInfo.lower_expanded.diameter
// item['lower_expanded_height'] = sizeInfo.lower_expanded.height
// }
// if(deviceTypetype.value == 'FluidizedBed'){ //
// let sizeInfo =JSON.parse(item.size)
// item['expanded_section_diameter'] = sizeInfo.expanded_section.diameter
// 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_height'] = sizeInfo.reaction_section.height
}
if(deviceTypetype.value == 'ACFTank'){ //
let sizeInfo =JSON.parse(item.size)
item['annular_cylinder_outer_diameter'] = sizeInfo.annular_cylinder.outer_diameter
item['annular_cylinder_height'] = sizeInfo.annular_cylinder.height
item['frustum_bottom_bottom_diameter'] = sizeInfo.frustum_bottom.bottom_diameter
item['frustum_bottom_height'] = sizeInfo.frustum_bottom.height
}
// item['reaction_section_diameter'] = sizeInfo.reaction_section.diameter
// item['reaction_section_height'] = sizeInfo.reaction_section.height
// }
// if(deviceTypetype.value == 'ACFTank'){ //
// let sizeInfo =JSON.parse(item.size)
// item['annular_cylinder_outer_diameter'] = sizeInfo.annular_cylinder.outer_diameter
// item['annular_cylinder_height'] = sizeInfo.annular_cylinder.height
// item['frustum_bottom_bottom_diameter'] = sizeInfo.frustum_bottom.bottom_diameter
// item['frustum_bottom_height'] = sizeInfo.frustum_bottom.height
// }
})
tableData.value = result.records;
@ -110,7 +117,7 @@ function confirmDevice(){ // 确定添加设备
const params = {
projectId: props.projectInfo.projectId,
deviceId: props.deviceId,
size: selectedDevice.value.size,
size: JSON.stringify(selectedDevice.value.size),
code: selectedDevice.value.code,
name: selectedDevice.value.name,
type: selectedDevice.value.type,
@ -130,7 +137,7 @@ function confirmClick(formEl: any) {
if (valid) {
const params = {
...info.value,
size: JSON.stringify( josnInfo.value),
size: JSON.stringify( info.value.size),
projectId: props.projectInfo.projectId,
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(() => {
// 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()
});
const infoForm = ref();
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 rules = ref({
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
@ -169,30 +182,30 @@ function addClick() {
name: "",
code: "",
type: props.deviceTypetype,
size: null,
size: {},
volume: null,
flowRate: null,
pulseVelocity: null
};
josnInfo.value = {}
if(props.deviceTypetype == 'ExtractionColumn'){
josnInfo.value = {
tray_section:{},
lower_expanded:{},
upper_expanded:{}
}
}else if(props.deviceTypetype == 'FluidizedBed'){
josnInfo.value = {
expanded_section:{},
reaction_section:{},
transition_section:{}
}
}else if(props.deviceTypetype == 'ACFTank'){
josnInfo.value = {
frustum_bottom:{},
annular_cylinder:{}
}
}
// josnInfo.value = {}
// if(props.deviceTypetype == 'ExtractionColumn'){
// josnInfo.value = {
// tray_section:{},
// lower_expanded:{},
// upper_expanded:{}
// }
// }else if(props.deviceTypetype == 'FluidizedBed'){
// josnInfo.value = {
// expanded_section:{},
// reaction_section:{},
// transition_section:{}
// }
// }else if(props.deviceTypetype == 'ACFTank'){
// josnInfo.value = {
// frustum_bottom:{},
// annular_cylinder:{}
// }
// }
isAdd.value = true
}
</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' }">
<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 v-if="deviceTypetype == 'FlatTank'" prop="length" label="长度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FlatTank'" prop="width" label="宽度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'FlatTank'" prop="height" label="高度(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'CylindricalTank'" prop="diameter" label="直径(cm)" min-width="100"></el-table-column>
<el-table-column v-if="deviceTypetype == 'CylindricalTank'" prop="height" label="高度(cm)" min-width="100"></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 v-for="(item,index) in sourceTempData" :label="item.label" min-width="100">
<template #default="scope">
{{ scope.row.size[item.key] }}
</template>
</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="pulseVelocity" label="脉冲速度(Hz)" width="120"></el-table-column>
@ -246,341 +240,25 @@ function addClick() {
</div>
<div 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-input v-model="info.code" style="width: 100%" placeholder="请输入设备编号"></el-input>
</el-form-item>
<el-form-item label="设备名称" prop="name" style="width: 100%;">
<el-input v-model="info.name" style="width: 100%" placeholder="请输入设备名称"></el-input>
</el-form-item>
<div v-if="deviceTypetype == 'FlatTank'">
<el-form-item label="长度" style="width: 100%;">
<el-form-item :label="item.label" style="width: 100%;" v-for="item in sourceTempData">
<el-input-number
placeholder="请输入长度"
v-model="josnInfo['length']"
v-model="info.size[item.key]"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
<template #suffix>{{item.unit}}</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="环形槽外径" 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-input-number
placeholder="请输入容量"

View File

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

View File

@ -18,7 +18,11 @@ const props = defineProps({
type: Object,
default: {}
},
sizeSchemaInfo:{
required: false,
type: Object,
default: {}
},
deviceInfo:{
required: false,
type: Object,
@ -93,7 +97,7 @@ function getInit(row:any){
correlation: '',
delay: '',
},{
key: "铀富集度%",
key: "铀富集度",
name: "u_enrichment",
value: row.uEnrichment,
unit: "%",
@ -117,14 +121,48 @@ function getInit(row:any){
correlation: '',
delay: '',
},{
key: "钚同位素比例PU-240占比%",
name: "pu_isotope",
value: row.puIsotope,
unit: "%",
key: "PU-238占比",
name: "e_pu238",
value: row.ePu238,
unit: "",
formula: '',
correlation: '',
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",
name: "hno3_acidity",
value: row.hno3Acidity,
@ -138,18 +176,18 @@ function getInit(row:any){
correlation: '',
delay: '',
},{
key: "有机相比例%",
key: "有机相比例",
name: "organic_ratio",
value: row.organicRatio,
unit: "%",
unit: "",
formula: '',
correlation: '',
delay: '',
},{
key: "含水率%",
key: "含水率",
name: "moisture_content",
value: row.moistureContent,
unit: "%",
unit: "",
formula: '',
correlation: '',
delay: '',
@ -266,7 +304,7 @@ function closeChangeDialogsettings(e:any){ // 变动公式值设置关闭
</div>
<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="value" label="值" width="150"></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
:before-close="dialogChangeDialogsettings" title="变动公式值设置" append-to-body width="1280px" class="materialmodel-dialog-box">
<ChangeDialogsettings v-if="isChangeDialogsettings" :projectInfo="projectInfo"
:formula = "formula" :formulaData= "formulaData" :delayList="delayList"
:formula = "formula" :formulaData= "formulaData" :delayList="delayList" :sizeSchemaInfo="sizeSchemaInfo"
@closeChangeDialogsettings="closeChangeDialogsettings" />
</el-dialog>

View File

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

View File

@ -16,6 +16,11 @@ const props = defineProps({
type: Object,
default: {}
},
sizeSchemaInfo: {
required: false,
type: Object,
default: {}
},
deviceInfo: {
required: false,
type: Object,
@ -37,7 +42,7 @@ function confirmClick(formEl: any) {
if (valid) {
const params = {
...info.value,
size: JSON.stringify(josnInfo.value)
size: JSON.stringify(info.value.size)
}
updateDevices(params).then((res:any) => {
@ -49,8 +54,9 @@ function confirmClick(formEl: any) {
}
});
}
const sourceTempData:any = ref([])
onMounted(() => {
sourceTempData.value = props.sizeSchemaInfo[props.deviceTypetype].fields
editClick(props.deviceInfo)
});
@ -59,12 +65,11 @@ const info: any = ref({
name: "",
code: "",
type: null,
size: null,
size: {},
volume: null,
flowRate: null,
pulseVelocity: null
});
const josnInfo: any = ref({}) //
const rules = ref({
name: [{ required: true, message: "请输入设备名称", trigger: "blur" }],
code: [{ required: true, message: "请输入设备编码", trigger: "blur" }],
@ -72,10 +77,8 @@ const rules = ref({
const isEdit = ref(false) //
function editClick(row: any) {
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;
}
</script>
@ -84,341 +87,27 @@ function editClick(row: any) {
<div class="editdevice-box">
<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-input v-model="info.code" style="width: 100%" placeholder="请输入设备编号" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="设备名称" prop="name" style="width: 100%;">
<el-input v-model="info.name" style="width: 100%" placeholder="请输入设备名称"></el-input>
</el-form-item>
<div v-if="deviceTypetype == 'FlatTank'">
<el-form-item label="长度" style="width: 100%;">
<el-form-item :label="item.label" style="width: 100%;" v-for="item in sourceTempData">
<el-input-number
placeholder="请输入长度"
v-model="josnInfo['length']"
v-model="info.size[item.key]"
:min="0"
align="left"
:controls="false"
style="width: 100%"
>
<template #suffix>cm</template>
<template #suffix>{{item.unit}}</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="环形槽外径" 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-input-number
placeholder="请输入容量"

View File

@ -19,9 +19,8 @@ import insertCss from 'insert-css'
import { updateProjects} from "@/api/business/project";
import Createscenario from '@/views/component/scenario/createscenario.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 { projectsById} from "@/api/business/project";
import line1 from '@/assets/x6/line1.png'
import line2 from '@/assets/x6/line2.png'
@ -44,6 +43,16 @@ const props = defineProps({
default: {}
},
})
//
const sizeSchemaInfo:any = ref({});
async function getSizeSchemaList(){
let result = await sizeSchemaAll({})
sizeSchemaInfo.value = result
}
const isLock = ref(false) //
const deviceTypetype:any = ref('') //
const isAdddevice = ref(false) //
@ -376,20 +385,22 @@ onMounted(() => {
node.attr('label/refY', 140)
node.attr('label/refX', width/2)
node.attr('label/textAnchor', 'middle')
}else if(node.store.data.attrs.text.text == '萃取柱'){
deviceTypetype.value = 'ExtractionColumn'
}
// else if(node.store.data.attrs.text.text == ''){
// deviceTypetype.value = 'ExtractionColumn'
node.size(30, 140)
const width = node.size().width
node.attr('image/xlink:href', '/assets/55.png')
node.attr('image/width', 30)
node.attr('image/height', 135)
node.attr('label/refY', 140)
node.attr('label/refX', width/2)
node.attr('label/textAnchor', 'middle')
// node.size(30, 140)
// const width = node.size().width
// node.attr('image/xlink:href', '/assets/55.png')
// node.attr('image/width', 30)
// node.attr('image/height', 135)
// node.attr('label/refY', 140)
// node.attr('label/refX', width/2)
// node.attr('label/textAnchor', 'middle')
}else if(node.store.data.attrs.text.text == '流化床'){
// }
else if(node.store.data.attrs.text.text == '流化床'){
deviceTypetype.value = 'FluidizedBed'
node.size(60, 140)
const width = node.size().width
@ -409,6 +420,26 @@ onMounted(() => {
node.attr('label/refY', 140)
node.attr('label/refX', width/2)
node.attr('label/textAnchor', 'middle')
}else if(node.store.data.attrs.text.text == '圆柱脉冲柱'){
deviceTypetype.value = 'PulsedCylindricalColumn'
node.size(30, 140)
const width = node.size().width
node.attr('image/xlink:href', '/assets/88.png')
node.attr('image/width', 30)
node.attr('image/height', 135)
node.attr('label/refY', 140)
node.attr('label/refX', width/2)
node.attr('label/textAnchor', 'middle')
}else if(node.store.data.attrs.text.text == '环形脉冲柱'){
deviceTypetype.value = 'PulsedAnnularColumn'
node.size(40, 140)
const width = node.size().width
node.attr('image/xlink:href', '/assets/99.png')
node.attr('image/width', 40)
node.attr('image/height', 135)
node.attr('label/refY', 140)
node.attr('label/refX', width/2)
node.attr('label/textAnchor', 'middle')
}
//
@ -794,16 +825,22 @@ graph.on('blank:mouseup', (e) => {
label: '管束槽',
image: '/assets/4.png',
},
{
label: '萃取柱',
image: '/assets/5.png',
},
// {
// label: '',
// image: '/assets/5.png',
// },
{
label: '流化床',
image: '/assets/6.png',
},{
label: '锥底环形槽',
image: '/assets/7.png',
},{
label: '圆柱脉冲柱',
image: '/assets/8.png',
},{
label: '环形脉冲柱',
image: '/assets/9.png',
},
]
const imageNodes = imageShapes.map((item) =>
@ -940,12 +977,21 @@ graph.on('blank:mouseup', (e) => {
const topology:any = JSON.parse(projectInfo.value.topology)
if(!topology.designData)return
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
})
const tabDeviceNum = ref(0)
const antvStatus = ref('初始化')
function preWork() {
//
const container = document.getElementById('container') as HTMLElement
@ -1020,6 +1066,14 @@ const isMenuShow = ref(false) // 是否显示右键菜单
const selectedNode:any = ref(null)
function deleteNode() { //
graph.removeNode(selectedNode.value)
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 +1215,7 @@ function closeConnectingwireModel(e:any){ // 关闭连接线弹窗
zIndex: 0
})
}
antvStatus.value = '编辑连接线'
}
isConnectingwire.value = false;
}
@ -1195,6 +1250,14 @@ function closeAdddevice(e:any){ // 关闭新增设备弹窗
retrievedNode.attr('label/text', e.name)
retrievedNode.store.data.deviceInfo = 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 = '新增设备'
isAdddevice.value = false;
}
@ -1215,6 +1278,14 @@ function closeEditdevice(e:any){ // 关闭编辑设备弹窗
retrievedNode.attr('text/text', e.name)
retrievedNode.attr('label/text', e.name)
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)
}
@ -1251,6 +1322,14 @@ function closeMaterialModel(e:any){ // 关闭物料信息弹窗
let retrievedNode:any = graph.getCellById(nodeId.value)
retrievedNode.store.data.materialInfo = 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 = '编辑物料信息'
isMaterialModel.value = false;
}
@ -1300,6 +1379,15 @@ function closeChangesettingsModel(e:any){ // 关闭变动设置弹窗
selectedMaterial.value = e
let retrievedNode:any = graph.getCellById(nodeId.value)
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;
}
@ -1491,6 +1579,9 @@ function saveDesign(is:any) { // 保存设计
});
}
});
if(is == true){
antvStatus.value = '完成保存'
}
//
return saveData
} catch (error) {
@ -1724,10 +1815,10 @@ function getName(code:any) {
return name = "氧化铀密度g/cm3";
break;
case 'u_enrichment':
return name = "铀富集度%";
return name = "铀富集度";
break;
case 'uEnrichment':
return name = "铀富集度%";
return name = "铀富集度";
break;
case 'pu_concentration':
return name = "钚浓度g/L";
@ -1742,10 +1833,10 @@ function getName(code:any) {
return name = "氧化钚密度g/cm3";
break;
case 'pu_isotope':
return name = "钚同位素比例PU-240占比%";
return name = "钚同位素比例PU-240占比";
break;
case 'puIsotope':
return name = "钚同位素比例PU-240占比%";
return name = "钚同位素比例PU-240占比";
break;
case 'hno3_acidity':
return name = "硝酸酸度mol/L";
@ -1760,16 +1851,16 @@ function getName(code:any) {
return name = "草酸浓度mol/L";
break;
case 'organic_ratio':
return name = "有机相比例%";
return name = "有机相比例";
break;
case 'organicRatio':
return name = "有机相比例%";
return name = "有机相比例";
break;
case 'moisture_content':
return name = "含水率%";
return name = "含水率";
break;
case 'moistureContent':
return name = "含水率%";
return name = "含水率";
break;
default:
return name = "";
@ -1902,6 +1993,13 @@ function getName(code:any) {
</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>
<Createscenario v-if="dialogVisible" :projectInfo="projectInfo" @closeCreatescenario ="closeCreatescenario"/>
<el-dialog v-model="isScenario" :close-on-click-modal="false"
@ -1912,12 +2010,12 @@ function getName(code:any) {
<el-dialog v-model="isAdddevice" :close-on-click-modal="false"
:modal="false" draggable :before-close="dialogAdddevice" title="添加设备"
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"/>
</el-dialog>
<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"/>
</el-dialog>
@ -1928,7 +2026,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">
<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"/>
</el-dialog>
@ -2295,4 +2394,18 @@ function getName(code:any) {
.x6-widget-stencil .x6-node.x6-node-immovable{
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>

View File

@ -7,7 +7,7 @@ export default {
<script setup lang="ts">
import { onMounted, ref, nextTick } from "vue";
import { ElForm, ElMessage, ElMessageBox } from "element-plus";
import { searchMaterialsPage, saveOrUpdate} from "@/api/business/database/material";
import { searchMaterialsPage, saveOrUpdate, materialsById} from "@/api/business/database/material";
const emit = defineEmits([ 'closeMaterialModel']);
@ -56,14 +56,23 @@ function confirmClick(formEl: any) {
uEnrichment: info.value.uEnrichment,
puConcentration: info.value.puConcentration,
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,
h2c2o4Concentration: info.value.h2c2o4Concentration,
organicRatio: info.value.organicRatio,
moistureContent: info.value.moistureContent,
customAttrs: JSON.stringify(customAttrsData.value)
customAttrs: JSON.stringify(customAttrsData.value),
}
saveOrUpdate(params).then((res:any) => {
let data = {
...params,
iconBase64: iconBase64.value,
}
saveOrUpdate(data).then((res:any) => {
if(res == true){
emit('closeMaterialModel', params)
}
@ -73,7 +82,16 @@ function confirmClick(formEl: any) {
}
onMounted(() => {
deviceName.value = props.deviceInfo.name
if(props.materialId != null){
materialsById(props.materialId).then((res:any) => {
editClick(res)
info.value.iconBase64 = res.iconBase64;
});
}else{
editClick(props.materialInfo)
}
});
const infoForm = ref();
@ -163,10 +181,10 @@ function gettableData() { // 获取物料列表
}).catch((err) => {
});
}
const iconBase64:any = ref("") //
function handleClick(item:any, index:any){
iconBase64.value = item.iconBase64
ingredientData.value = []
ingredientData.value.push({
key: "铀浓度g/L",
value: item.uConcentration,
@ -176,7 +194,7 @@ function handleClick(item:any, index:any){
value: item.uo2Density,
unit: "",
},{
key: "铀富集度%",
key: "铀富集度",
value: item.uEnrichment,
unit: "",
},{
@ -188,8 +206,24 @@ function handleClick(item:any, index:any){
value: item.puo2Density,
unit: "",
},{
key: "钚同位素比例PU-240占比%",
value: item.puIsotope,
key: "PU-238占比",
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: "",
},{
key: "硝酸酸度mol/L",
@ -200,11 +234,11 @@ function handleClick(item:any, index:any){
value: item.h2c2o4Concentration,
unit: "",
},{
key: "有机相比例%",
key: "有机相比例",
value: item.organicRatio,
unit: "",
},{
key: "含水率%",
key: "含水率",
value: item.moistureContent,
unit: "",
})
@ -234,12 +268,17 @@ function confirmMaterial(){
uEnrichment: selectedMaterial.value.uEnrichment,
puConcentration: selectedMaterial.value.puConcentration,
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,
h2c2o4Concentration: selectedMaterial.value.h2c2o4Concentration,
organicRatio: selectedMaterial.value.organicRatio,
moistureContent: selectedMaterial.value.moistureContent,
customAttrs: selectedMaterial.value.customAttrs,
iconBase64: iconBase64.value,
}
customAttrsData.value = []
if(selectedMaterial.value.customAttrs !=null && selectedMaterial.value.customAttrs != ""){
@ -247,6 +286,21 @@ function confirmMaterial(){
}
isDialogMaterial.value = false
}
function uploadIconBaseChange(file:any){
var reader = new FileReader();
reader.readAsDataURL(file.raw);
reader.onload = () => {
info.value.iconBase64 =reader.result
};
reader.onerror = function(error) {
console.log("Error: ", error);
};
}
function delIconBase(){
info.value.iconBase64 = " "
}
</script>
<template>
@ -258,7 +312,7 @@ function confirmMaterial(){
<el-input v-model="deviceName" style="width: 300px" placeholder="" :disabled="true"></el-input>
</el-form-item>
<el-form-item label="所属物料" prop="name" label-width="80px">
<el-input v-model="info.name" style="width: 300px" placeholder=""></el-input>
<el-input v-model="info.name" style="width: 280px" placeholder=""></el-input>
<el-button type="primary" style="margin-left: 10px" @click="dialogMaterialOpen">选择物料</el-button>
</el-form-item>
</div>
@ -275,7 +329,7 @@ function confirmMaterial(){
</el-form-item>
</div>
<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-form-item>
<el-form-item label="钚浓度g/L" prop="puConcentration">
@ -286,10 +340,28 @@ function confirmMaterial(){
<el-form-item label="氧化钚密度g/cm3" prop="puo2Density">
<el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input>
</el-form-item>
<el-form-item label="钚同位素比例PU-240占比%" prop="puIsotope">
<el-input v-model="info.puIsotope" style="width: 100%" placeholder="" @input="handleNumberInput('puIsotope')"></el-input>
<el-form-item label="PU-238占比" prop="ePu238">
<el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')"></el-input>
</el-form-item>
</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">
<el-form-item label="硝酸酸度mol/L" prop="hno3Acidity">
<el-input v-model="info.hno3Acidity" style="width: 100%" placeholder="" @input="handleNumberInput('hno3Acidity')"></el-input>
@ -299,13 +371,38 @@ function confirmMaterial(){
</el-form-item>
</div>
<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-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-form-item>
</div>
<el-form-item label="物料图片">
<el-upload
style="margin-left: 10px;"
class="avatar-uploader"
accept=".png, .jpg, .jpeg"
action=""
:show-file-list="false"
:auto-upload="false"
@change="uploadIconBaseChange"
>
<div style="width: 100px;height: 100px;position: relative;" v-if="info.iconBase64 != ''
&& info.iconBase64 != null && info.iconBase64 != ' '">
<img :src="info.iconBase64" class="avatar" />
<div style="position: absolute;top: 0px;left: 0px;z-index: 1;width: 100px;height: 100px;background: rgba(0,0,0,0.3);color: cornflowerblue;">
<el-icon style="position: absolute;top: 40px;left: 40px;z-index: 1;font-size: 20px;"
@click.stop="delIconBase"><Delete /></el-icon>
</div>
</div>
<div v-else>
<el-icon class="newavatar-uploader-icon"><Plus /></el-icon>
<div class="newavatar-uploader-text">物料图片</div>
</div>
</el-upload>
</el-form-item>
<div class="custom_attrs_box">
<div class="custom_attrs_header">
<div class="custom_attrs_header1">成分名称</div>
@ -355,11 +452,11 @@ function confirmMaterial(){
</div>
</div>
</div>
<div style="width: 100%;">
<div style="width: 100%; height: calc(100vh - 100px); overflow: auto;">
<div style="display: flex;justify-content: flex-end;padding-top: 20px;padding-right: 40px;padding-bottom: 20px;">
<el-button type="primary" @click="confirmMaterial"> </el-button>
</div>
<div class="custom_attrs_box" style="width: 650px;margin-left: 20px;">
<div class="custom_attrs_box" style="width: 650px;margin-left: 20px;margin-bottom: 10px;">
<div class="custom_attrs_header">
<div class="custom_attrs_header1" style="width: 60%;">成分名称</div>
<div class="custom_attrs_header2" style="width: 40%;" >成分参数</div>
@ -374,8 +471,30 @@ function confirmMaterial(){
{{ item.value }}
</div>
</div>
<div class="custom_attrs_header" style="height: 90px;" v-if="ingredientData.length>0">
<div class="custom_attrs_content1" style="width: 60%;height: 90px;display: flex;align-items: center;justify-content: center;">图片</div>
<div class="custom_attrs_content2" style="width: 40%;height: 90px;display: flex;align-items: center;justify-content: center;" >
<el-image
v-if="iconBase64 != '' && iconBase64 != null && iconBase64 != ' '"
style="
max-width: 200px;
max-height: 80px;"
class="materialmodel-iconBase64"
:src="iconBase64"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:preview-src-list="[iconBase64]"
show-progress
:initial-index="4"
fit="contain"
/>
</div>
</div>
</div>
</div>
</div>
@ -593,7 +712,37 @@ function confirmMaterial(){
.materialmodel-dialog-box.el-dialog .el-dialog__body{
padding: 0 !important;
}
.materialmodel-iconBase64 img{
max-width: 200px;
max-height: 80px;
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
width: 100px;
height: 100px;
}
.newavatar-uploader-icon{
font-size: 28px;
color: #8c939d;
width: 100px;
text-align: center;
}
.newavatar-uploader-text{
width: 100%;text-align: center;line-height: 20px;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #949494;
}
</style>

View File

@ -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,'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,'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,'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-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

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

View File

@ -7,7 +7,7 @@ export default {
<script setup lang="ts">
import { onMounted, ref, nextTick } from "vue";
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 { sizeSchemaAll } from "@/api/business/database/device";
@ -309,6 +309,25 @@ onMounted(() => {
getSizeSchemaList()
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>
<template>
@ -343,6 +362,7 @@ onMounted(() => {
:on-error="handleError">
<el-button type="primary" style="margin: 0 10px;" v-hasPerm="['criticalData:import']">导入</el-button>
</el-upload>
<el-button type="primary" @click="exportExportsClick">导出</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['criticalData:del']">删除</el-button>
</div>
@ -388,7 +408,7 @@ onMounted(() => {
:modal="false" draggable :before-close="handleClose" :title="title"
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-input-number
placeholder="请输入长度"

View File

@ -7,7 +7,8 @@ export default {
<script setup lang="ts">
import { onMounted, ref, nextTick } from "vue";
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 Page from '@/components/Pagination/page.vue'
import { getToken } from '@/utils/auth'
@ -327,6 +328,24 @@ const handleInput = (val: string) => {
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>
<template>
@ -356,7 +375,7 @@ const handleInput = (val: string) => {
accept=".xlsx,.xls" v-hasPerm="['device:import']"
class="upload-demo"
:data="{deviceType: queryParams.type}"
:action=" url + '/devices/import' "
:action=" url + '/devices/v2/import' "
:headers="{ token: getToken() }"
:show-file-list="false"
:before-upload="handlePreview"
@ -364,6 +383,7 @@ const handleInput = (val: string) => {
:on-error="handleError">
<el-button type="primary" style="margin: 0 10px;">导入</el-button>
</el-upload>
<el-button type="primary" @click="exportExportsClick">导出</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''" v-hasPerm="['device:del']"
:disabled="multipleSelection.length <= 0" @click="delClick">删除</el-button>
</div>

View File

@ -7,7 +7,7 @@ export default {
<script setup lang="ts">
import { onMounted, ref, nextTick } from "vue";
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 { getToken } from '@/utils/auth'
const url = import.meta.env.VITE_APP_BASE_API;
@ -90,6 +90,7 @@ const info: any = ref({
h2c2o4Concentration: "",
organicRatio: "",
moistureContent: "",
iconBase64: ""
});
const dialogVisible = ref(false);
@ -108,6 +109,7 @@ function addClick() {
h2c2o4Concentration: "",
organicRatio: "",
moistureContent: "",
iconBase64: ""
};
customAttrsData.value = []
dialogVisible.value = true;
@ -301,6 +303,38 @@ function handleError(file: any){
onMounted(() => {
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)
}
function uploadIconBaseChange(file:any){
var reader = new FileReader();
reader.readAsDataURL(file.raw);
reader.onload = () => {
info.value.iconBase64 =reader.result
};
reader.onerror = function(error) {
console.log("Error: ", error);
};
}
function delIconBase(){
info.value.iconBase64 = " "
}
</script>
<template>
@ -327,6 +361,7 @@ onMounted(() => {
:on-error="handleError">
<el-button type="primary" style="margin: 0 10px;" v-hasPerm="['material:import']">导入</el-button>
</el-upload>
<el-button type="primary" @click="exportExportsClick">导出</el-button>
<el-button :type="multipleSelection.length > 0 ? 'primary' : ''"
:disabled="multipleSelection.length <= 0" @click="delClick" v-hasPerm="['material:del']">删除</el-button>
</div>
@ -381,7 +416,7 @@ onMounted(() => {
</el-form-item>
</div>
<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-form-item>
<el-form-item label="钚浓度g/L" prop="puConcentration">
@ -392,10 +427,31 @@ onMounted(() => {
<el-form-item label="氧化钚密度g/cm3" prop="puo2Density">
<el-input v-model="info.puo2Density" style="width: 100%" placeholder="" @input="handleNumberInput('puo2Density')"></el-input>
</el-form-item>
<el-form-item label="钚同位素比例PU-240占比%" prop="puIsotope">
<el-input v-model="info.puIsotope" style="width: 100%" placeholder="" @input="handleNumberInput('puIsotope')"></el-input>
<el-form-item label="PU-238占比" prop="puIsotope">
<el-input v-model="info.ePu238" style="width: 100%" placeholder="" @input="handleNumberInput('ePu238')"></el-input>
</el-form-item>
</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">
<el-form-item label="硝酸酸度mol/L" prop="hno3Acidity">
<el-input v-model="info.hno3Acidity" style="width: 100%" placeholder="" @input="handleNumberInput('hno3Acidity')"></el-input>
@ -405,13 +461,39 @@ onMounted(() => {
</el-form-item>
</div>
<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-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-form-item>
</div>
<el-form-item label="物料图片">
<el-upload
style="margin-left: 10px;"
class="avatar-uploader"
accept=".png, .jpg, .jpeg"
action=""
:show-file-list="false"
:auto-upload="false"
@change="uploadIconBaseChange"
>
<div style="width: 100px;height: 100px;position: relative;" v-if="info.iconBase64 != ''
&& info.iconBase64 != null && info.iconBase64 != ' '">
<img :src="info.iconBase64" class="avatar" />
<div style="position: absolute;top: 0px;left: 0px;z-index: 1;width: 100px;height: 100px;background: rgba(0,0,0,0.3);color: cornflowerblue;">
<el-icon style="position: absolute;top: 40px;left: 40px;z-index: 1;font-size: 20px;"
@click.stop="delIconBase"><Delete /></el-icon>
</div>
</div>
<div v-else>
<el-icon class="newavatar-uploader-icon"><Plus /></el-icon>
<div class="newavatar-uploader-text">物料图片</div>
</div>
</el-upload>
</el-form-item>
<div class="Materials_dialog_titledisplay">
<div class="Materials_dialog_titleline"></div>
<div>物料成分</div>
@ -446,12 +528,13 @@ onMounted(() => {
<svg t="1766543724217" style="margin-right: 5px;" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6518" width="16" height="16"><path d="M105 480a8 8 0 0 1 8-8h799a8 8 0 0 1 8 8v64a8 8 0 0 1-8 8H113a8 8 0 0 1-8-8v-64z" fill="#266FFF" p-id="6519"></path><path d="M480 920a8 8 0 0 1-8-8V112a8 8 0 0 1 8-8h64a8 8 0 0 1 8 8v800a8 8 0 0 1-8 8h-64z" fill="#266FFF" p-id="6520"></path></svg>
添加一行
</div>
</el-form>
<span class="dialog-footer"
style="display: flex;display: -webkit-flex; justify-content: flex-end;-webkit-justify-content: flex-end;">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="confirmClick(infoForm)"> </el-button>
</span>
</el-form>
</el-dialog>
</div>
</template>
@ -722,5 +805,30 @@ onMounted(() => {
cursor: pointer;
}
.newavatar-uploader-icon{
font-size: 28px;
color: #8c939d;
width: 100px;
text-align: center;
}
.newavatar-uploader-text{
width: 100%;text-align: center;line-height: 20px;
font-family: 'Arial Normal', 'Arial';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #949494;
}
</style>
<style>
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
width: 100px;
height: 100px;
}
</style>

View File

@ -198,7 +198,7 @@ public class MaterialController {
"pu_concentration", "puo2_density", "pu_isotope",
"e_pu240", "e_pu242", "e_pu241", "e_pu239", "e_pu238",
"hno3_acidity", "h2c2o4_concentration", "organic_ratio", "moisture_content",
"custom_attrs", "created_at", "updated_at", "modifier"
"custom_attrs", "created_at", "updated_at", "modifier", "icon_base64"
);
qw.eq("project_id", "-1");
if (name != null && !name.isEmpty()) {