Merge branch 'develop-business-css' of http://121.37.111.42:3000/ThbTech/JavaProjectRepo into development-business-css
@ -59,4 +59,20 @@ export function topologyDevicesLsit(queryParams:any){
|
||||
});
|
||||
}
|
||||
|
||||
//初始化项目模拟数据
|
||||
export function simulationInit(queryParams:any){
|
||||
return request({
|
||||
url:'/projects/simulation/init' ,
|
||||
method: 'Post',
|
||||
params:queryParams
|
||||
});
|
||||
}
|
||||
|
||||
// 运行项目模拟
|
||||
export function simulationRun(projectId:string,scenarioId:string, data:any){
|
||||
return request({
|
||||
url:'/projects/simulation/run?projectId='+projectId+'&scenarioId='+scenarioId ,
|
||||
method: 'Post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
@ -48,3 +48,12 @@ export function deleteBatchScenarios(queryParams:any){
|
||||
data: queryParams
|
||||
});
|
||||
}
|
||||
|
||||
//获取所有项目列表
|
||||
export function getActiveAlgorithms(){
|
||||
return request({
|
||||
url: '/algorithms/getActiveAlgorithms' ,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
BIN
business-css/frontend/src/assets/table/moni.png
Normal file
|
After Width: | Height: | Size: 679 B |
BIN
business-css/frontend/src/assets/table/moni_disabled.png
Normal file
|
After Width: | Height: | Size: 687 B |
BIN
business-css/frontend/src/assets/table/result.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
business-css/frontend/src/assets/table/result_disabled.png
Normal file
|
After Width: | Height: | Size: 615 B |
BIN
business-css/frontend/src/assets/table/see.png
Normal file
|
After Width: | Height: | Size: 616 B |
BIN
business-css/frontend/src/assets/table/shifa.png
Normal file
|
After Width: | Height: | Size: 555 B |
BIN
business-css/frontend/src/assets/table/u267.png
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
business-css/frontend/src/assets/table/u419_disabled.png
Normal file
|
After Width: | Height: | Size: 510 B |
BIN
business-css/frontend/src/assets/table/view.png
Normal file
|
After Width: | Height: | Size: 517 B |
@ -120,7 +120,7 @@ function confirmDevice(){ // 确定添加设备
|
||||
}
|
||||
addDevices(params).then((res:any) => {
|
||||
if(res == true){
|
||||
emit('closeAdddevice', selectedDevice.value)
|
||||
emit('closeAdddevice', params)
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -213,8 +213,6 @@ function addClick() {
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="tableData" style="width: 100%; height: calc(100vh - 300px);margin-bottom: 10px;" border
|
||||
@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="selection" width="50" align="center"></el-table-column>
|
||||
<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 v-if="deviceTypetype == 'FlatTank'" prop="length" label="长度(cm)" min-width="100"></el-table-column>
|
||||
|
||||
374
business-css/frontend/src/components/antvx6/changesettings.vue
Normal file
@ -0,0 +1,374 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "变动设置",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, nextTick } from "vue";
|
||||
import { ElForm, ElMessage, ElMessageBox } from "element-plus";
|
||||
import { searchDevicesPage } from "@/api/business/database/device";
|
||||
import { topologyDevicesLsit } from '@/api/business/project';
|
||||
|
||||
const emit = defineEmits([ 'closeChangesettingsModel']);
|
||||
|
||||
const props = defineProps({
|
||||
projectInfo: {
|
||||
required: false,
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
|
||||
deviceInfo:{
|
||||
required: false,
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
materialInfo: {
|
||||
required: false,
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
materialId: {
|
||||
required: false,
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
changesettingsData: {
|
||||
required: false,
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
})
|
||||
const deviceTypetype:any = ref("")
|
||||
const deviceName:any = ref(props.deviceInfo.name) // 变动设备信息
|
||||
const materialName:any = ref(props.materialInfo.name) // 变动物料信息
|
||||
const tableData:any = ref([])
|
||||
|
||||
function gettableData() {
|
||||
if(deviceTypetype.value == ''){
|
||||
return
|
||||
}
|
||||
topologyDevicesLsit({
|
||||
id: props.projectInfo.projectId
|
||||
}).then((res:any) => {
|
||||
if (res.code == 0) {
|
||||
deviceList.value = res.data;
|
||||
}
|
||||
})
|
||||
// topologyDevicesLsit(params).then((result:any) => {
|
||||
// deviceList.value = result.records;
|
||||
// }).catch((err) => {
|
||||
|
||||
// });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
deviceTypetype.value = props.deviceInfo.type
|
||||
if(props.changesettingsData != null && props.changesettingsData.length > 0){
|
||||
tableData.value = props.changesettingsData
|
||||
}else{
|
||||
getInit(props.materialInfo);
|
||||
}
|
||||
gettableData()
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function getInit(row:any){
|
||||
tableData.value = []
|
||||
if(row != null){
|
||||
tableData.value.push({
|
||||
key: "铀浓度(g/L)",
|
||||
name: "u_concentration",
|
||||
value: row.uConcentration,
|
||||
|
||||
unit: "g/L",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "氧化铀密度(g/cm3)",
|
||||
name: "uo2_density",
|
||||
value: row.uo2Density,
|
||||
unit: "g/cm3",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "铀富集度(%)",
|
||||
name: "u_enrichment",
|
||||
value: row.uEnrichment,
|
||||
unit: "%",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "钚浓度(g/L)",
|
||||
name: "pu_concentration",
|
||||
value: row.puConcentration,
|
||||
unit: "g/L",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "氧化钚密度(g/cm3)",
|
||||
name: "puo2_density",
|
||||
value: row.puo2Density,
|
||||
unit: "g/cm3",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "钚同位素比例(PU-240占比)%",
|
||||
name: "pu_isotope",
|
||||
value: row.puIsotope,
|
||||
unit: "%",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "硝酸酸度(mol/L)",
|
||||
name: "hno3_acidity",
|
||||
value: row.hno3Acidity,
|
||||
unit: "mol/L",
|
||||
},{
|
||||
key: "草酸浓度(mol/L)",
|
||||
name: "h2c2o4_concentration",
|
||||
value: row.h2c2o4Concentration,
|
||||
unit: "mol/L",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "有机相比例%",
|
||||
name: "organic_ratio",
|
||||
value: row.organicRatio,
|
||||
unit: "%",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
},{
|
||||
key: "含水率%",
|
||||
name: "moisture_content",
|
||||
value: row.moistureContent,
|
||||
unit: "%",
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
})
|
||||
let tempData = []
|
||||
if(row.customAttrs !=null && row.customAttrs != ""){
|
||||
tempData = JSON.parse(row.customAttrs)
|
||||
}
|
||||
for(let i = 0; i < tempData.length; i++){
|
||||
let attr = tempData[i]
|
||||
tableData.value.push({
|
||||
key: attr.key,
|
||||
value: attr.value,
|
||||
unit: attr.unit,
|
||||
formula: '',
|
||||
correlation: '',
|
||||
delay: '',
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
function confirmClick(){ // 确认变动设置
|
||||
emit('closeChangesettingsModel',tableData.value)
|
||||
}
|
||||
const isDialogFormula:any = ref(false) // 变动公式设置弹窗
|
||||
const deviceList:any = ref([]) // 变动设备列表
|
||||
const isAcitve:any = ref(-1) // 变动设备索引
|
||||
const tempFormulaInfo:any = ref({})
|
||||
const formulaInfo:any = ref({})
|
||||
const tableIndex:any = ref(-1) // 变动设备索引
|
||||
function dialogFormulaOpen(row:any,index:any){
|
||||
isAcitve.value = -1
|
||||
tableIndex.value = index
|
||||
formulaInfo.value = JSON.parse(JSON.stringify(row))
|
||||
tempFormulaInfo.value = row
|
||||
isDialogFormula.value = true
|
||||
}
|
||||
function dialogMaterialClose(){ // 变动公式设置关闭
|
||||
isDialogFormula.value = false
|
||||
}
|
||||
function handleClick(item:any, index:any){
|
||||
formulaInfo.value.correlation = JSON.parse(JSON.stringify(item.deviceName))
|
||||
isAcitve.value = index
|
||||
}
|
||||
function handleClose(){ // 变动公式设置关闭
|
||||
isDialogFormula.value = false
|
||||
}
|
||||
function confirmTableClick(){ // 确认变动公式设置
|
||||
tableData.value[tableIndex.value].formula = formulaInfo.value.formula
|
||||
tableData.value[tableIndex.value].correlation = formulaInfo.value.correlation
|
||||
tableData.value[tableIndex.value].delay = formulaInfo.value.delay
|
||||
isDialogFormula.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="editdevice-box">
|
||||
<div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="width: 80px;">
|
||||
变动设备
|
||||
</div>
|
||||
<el-input v-model="deviceName" style="width: 300px" placeholder="" :disabled="true"></el-input>
|
||||
<div style="width: 80px;">
|
||||
物料名称
|
||||
</div>
|
||||
<el-input v-model="materialName" style="width: 300px" placeholder="" :disabled="true"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;align-items: center;padding: 20px 0;">
|
||||
<div class="materialmodel-title-line"></div>
|
||||
<div>物料成分</div>
|
||||
</div>
|
||||
|
||||
<div class="table-box">
|
||||
<el-table :data="tableData" style="width: 100%" 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>
|
||||
<el-table-column fixed="right" label="操作" width="80" align="center">
|
||||
<template #default="scope">
|
||||
<span style=" font-family: '微软雅黑';
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #266FFF;
|
||||
text-align: left;
|
||||
cursor: pointer;" @click="dialogFormulaOpen(scope.row,scope.$index)">设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: flex-end;margin-top: 10px;">
|
||||
<el-button type="primary" @click="confirmClick">确定</el-button>
|
||||
</div>
|
||||
<el-dialog v-model="isDialogFormula" :close-on-click-modal="false" :modal="false" draggable
|
||||
:before-close="dialogMaterialClose" title="变动公式设置" append-to-body width="994px" class="materialmodel-dialog-box">
|
||||
<div style="display: flex;">
|
||||
<div class="choiceMateria-left">
|
||||
<div class="choiceMateria-left-title">设备列表</div>
|
||||
<div style="height: calc(100% - 70px);overflow: auto;margin-top: 10px;">
|
||||
<div v-for="(item, index) in deviceList" :key="index" class="choiceMateria-left-item"
|
||||
:class="{'choiceMateria-item-active': index == isAcitve}"
|
||||
@click="handleClick(item, index)">
|
||||
{{ item.deviceName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-left: 45px;padding-top: 40px; width: calc(100% - 290px);">
|
||||
<el-form :model="formulaInfo" label-width="80px"
|
||||
style="height: calc(100vh - 360px) ; overflow: auto;">
|
||||
<el-form-item label="变动设备" style="width: 100%;" label-width="80px">
|
||||
<el-input v-model="deviceName" style="width: 100%" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" style="width: 100%;" label-width="80px">
|
||||
<el-input v-model="materialName" style="width: 100%" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="成分" style="width: 100%;" label-width="80px">
|
||||
<el-input v-model="formulaInfo.key" style="width: 100%" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
<div style="display: flex;align-items: center;padding: 20px 0;">
|
||||
<div class="materialmodel-title-line"></div>
|
||||
<div>变动公式</div>
|
||||
</div>
|
||||
<el-form-item label="值=" style="width: 100%;" label-width="80px">
|
||||
<el-input v-model="formulaInfo.formula" style="width: 100%"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<div style="display: flex;align-items: center;padding: 20px 0;">
|
||||
<div class="materialmodel-title-line"></div>
|
||||
<div>延时设置</div>
|
||||
</div>
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-form-item label="关联设备" >
|
||||
<el-input v-model="formulaInfo.correlation" style="width: 100%" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="延时时间" >
|
||||
<el-input v-model="formulaInfo.delay" style="width: 100%" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
</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="confirmTableClick">确 定</el-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.editdevice-box{
|
||||
width: 100%;
|
||||
height: calc(100vh - 200px);
|
||||
}
|
||||
|
||||
.materialmodel-title-line{
|
||||
width: 4px;
|
||||
height: 12px;
|
||||
background-color: rgba(38, 111, 255, 1);
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.choiceMateria-left{
|
||||
width: 240px;
|
||||
height: calc(100vh - 200px);
|
||||
border-right: 1px solid rgba(240, 240, 240, 1);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.choiceMateria-left-title{
|
||||
width: 240px;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #1B1B1B;
|
||||
padding-left: 16px;
|
||||
border-bottom: 1px solid rgba(240, 240, 240, 1);
|
||||
}
|
||||
.choiceMateria-left-item{
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 16px;
|
||||
font-family: 'Arial Normal', 'Arial';
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
cursor: pointer;
|
||||
}
|
||||
.choiceMateria-left-item:hover{
|
||||
background-color: #f5f8ff;
|
||||
}
|
||||
.choiceMateria-item-active{
|
||||
background-color: #f5f8ff;
|
||||
color: #266fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<style>
|
||||
.materialmodel-dialog-box.el-dialog .el-dialog__body{
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@ -35,7 +35,7 @@ import line6 from '@/assets/x6/line6.png'
|
||||
import AdddeviceModel from './adddevice.vue';
|
||||
import EditdeviceModel from './editdevice.vue';
|
||||
import MaterialModels from './materialmodel.vue';
|
||||
|
||||
import ChangesettingsModels from './changesettings.vue';
|
||||
|
||||
|
||||
const emit = defineEmits([ 'closeAntvx6']);
|
||||
@ -639,7 +639,6 @@ graph.on('blank:mouseup', (e) => {
|
||||
},
|
||||
}),
|
||||
)
|
||||
console.log(imageNodes)
|
||||
stencil.load(imageNodes, 'group2')
|
||||
|
||||
// 创建管线节点
|
||||
@ -858,51 +857,7 @@ function copyNode() { // 复制节点
|
||||
function closeAntvx6() {
|
||||
emit('closeAntvx6')
|
||||
}
|
||||
function saveDesign() { // 保存设计
|
||||
try {
|
||||
// 获取画布内容并转换为JSON
|
||||
const designData:any = graph.toJSON()
|
||||
let cells = []
|
||||
if(designData !=null && designData.cells.length>0){
|
||||
cells = designData.cells
|
||||
}
|
||||
const topology = {
|
||||
projectId: projectInfo.value.projectId,
|
||||
name: projectInfo.value.name,
|
||||
devices:[],
|
||||
pipelines:[],
|
||||
systemboundaries:[],
|
||||
globalDisplay:{
|
||||
device:{
|
||||
showProperties:[]
|
||||
},
|
||||
material:{
|
||||
showProperties:[]
|
||||
},
|
||||
|
||||
},
|
||||
designData:cells
|
||||
}
|
||||
// 添加保存信息
|
||||
const saveData = {
|
||||
projectId: projectInfo.value.projectId,
|
||||
topology: JSON.stringify(topology)
|
||||
}
|
||||
updateProjects(saveData).then((res:any) => {
|
||||
if(res === true){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "保存成功",
|
||||
});
|
||||
}
|
||||
});
|
||||
// 返回保存的数据
|
||||
return saveData
|
||||
} catch (error) {
|
||||
console.error('保存设计失败:', error)
|
||||
return null
|
||||
}
|
||||
}
|
||||
function revokeClick(){
|
||||
graph.undo()
|
||||
}
|
||||
@ -989,14 +944,183 @@ function dialogMaterialModel(){ // 关闭物料信息弹窗
|
||||
}
|
||||
function closeMaterialModel(e:any){ // 关闭物料信息弹窗
|
||||
if(e == false){
|
||||
isEditdevice.value = false;
|
||||
isMaterialModel.value = false;
|
||||
return
|
||||
}
|
||||
|
||||
selectedMaterial.value = e
|
||||
let retrievedNode:any = graph.getCellById(nodeId.value)
|
||||
retrievedNode.store.data.materialInfo = e
|
||||
isEditdevice.value = false;
|
||||
isMaterialModel.value = false;
|
||||
}
|
||||
|
||||
const isChangesettings = ref(false)
|
||||
const changesettingsData:any = ref([]) // 是否变动设置
|
||||
function dialogChangesettings(){ // 关闭变动设置弹窗
|
||||
isChangesettings.value = false;
|
||||
}
|
||||
function ChangesettingsClick(){ // 打开变动设置弹窗
|
||||
changesettingsData.value = []
|
||||
if(selectedNode.value.store.data.deviceInfo == null){
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "请先添加设备信息",
|
||||
});
|
||||
return
|
||||
}
|
||||
if(selectedNode.value.store.data.materialInfo == null){
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "请先添加物料信息",
|
||||
});
|
||||
return
|
||||
}
|
||||
deviceInfo.value = selectedNode.value.store.data.deviceInfo
|
||||
materialInfo.value = selectedNode.value.store.data.materialInfo
|
||||
|
||||
if(selectedNode.value.store.data.changesettings != null){
|
||||
changesettingsData.value = selectedNode.value.store.data.changesettings
|
||||
}
|
||||
|
||||
nodeId.value = selectedNode.value.id
|
||||
if(materialInfo.value != null){
|
||||
deviceTypetype.value = materialInfo.value.type
|
||||
}
|
||||
isChangesettings.value = true;
|
||||
}
|
||||
|
||||
function closeChangesettingsModel(e:any){ // 关闭变动设置弹窗
|
||||
if(e == false){
|
||||
isChangesettings.value = false;
|
||||
return
|
||||
}
|
||||
selectedMaterial.value = e
|
||||
let retrievedNode:any = graph.getCellById(nodeId.value)
|
||||
retrievedNode.store.data.changesettings = e
|
||||
isChangesettings.value = false;
|
||||
}
|
||||
|
||||
function setFormulaInit(formula:any) {
|
||||
// const formula = "【(圆柱槽B)*0.2+(环形槽A)*1.0+0.5】";
|
||||
// 匹配*号后、+或)前的数字(支持整数和小数)
|
||||
const regex = /\*(\d+\.?\d*)/g;
|
||||
const coefficients = [];
|
||||
let match;
|
||||
|
||||
// 循环提取所有匹配项
|
||||
while ((match = regex.exec(formula)) !== null) {
|
||||
coefficients.push(parseFloat(match[1])); // 转为数字类型
|
||||
}
|
||||
console.log(coefficients); // 输出: [0.2, 1.0]
|
||||
return coefficients
|
||||
|
||||
}
|
||||
|
||||
function getBias(formula:any){
|
||||
// 从后往前找最后一个+的位置
|
||||
// 匹配最后一个+号后面的数字(支持整数、小数)
|
||||
const regex = /\+(\d+\.?\d*)$/;
|
||||
const match = formula.match(regex);
|
||||
const constant = parseFloat(match[1]);
|
||||
return constant
|
||||
}
|
||||
|
||||
|
||||
function saveDesign() { // 保存设计
|
||||
try {
|
||||
// 获取画布内容并转换为JSON
|
||||
const designData:any = graph.toJSON()
|
||||
let cells:any = []
|
||||
if(designData !=null && designData.cells.length>0){
|
||||
cells = designData.cells
|
||||
}
|
||||
let devices = []
|
||||
for(let i=0;i<cells.length;i++){
|
||||
if(cells[i].shape == 'custom-image'){
|
||||
let tempData:any = {}
|
||||
if(cells[i].changesettings && cells[i].changesettings.length > 0){
|
||||
for(let j=0;j<cells[i].changesettings.length;j++){
|
||||
if(cells[i].changesettings[j].formula != '' && cells[i].changesettings[j].formula != null){
|
||||
const key = cells[i].changesettings[j].name as string
|
||||
const unit = cells[i].changesettings[j].unit
|
||||
const name = cells[i].changesettings[j].name
|
||||
const delay= cells[i].changesettings[j].delay
|
||||
let tempSources = []
|
||||
|
||||
for(let k=0;k<setFormulaInit(cells[i].changesettings[j].formula).length;k++){
|
||||
tempSources.push({
|
||||
entityType: 'material', //圆柱槽B
|
||||
entityId: cells[i].materialInfo.materialId , //materialId : cdeeca2e-1e0c-4bdd-b946-f347c104752c
|
||||
property: name, // 铀浓度(g/L)
|
||||
coefficient: setFormulaInit(cells[i].changesettings[j].formula)[k], //0.2
|
||||
delay: { enabled: true, time: delay, unit: 's' } // 5
|
||||
})
|
||||
}
|
||||
tempData[key] = {
|
||||
name: tempData[key],
|
||||
type:'influence',
|
||||
unit:unit,
|
||||
base:0,
|
||||
bias: getBias(cells[i].changesettings[j].formula) || 0,
|
||||
sources:tempSources,
|
||||
expression:cells[i].changesettings[j].formula
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
devices.push({
|
||||
deviceId:cells[i].id,
|
||||
name:cells[i].deviceInfo.name,
|
||||
type:cells[i].deviceInfo.type,
|
||||
properties:{},
|
||||
material: cells[i].materialInfo != null ? {
|
||||
materialId:cells[i].id,
|
||||
name:cells[i].materialInfo.name,
|
||||
properties:tempData
|
||||
}:{}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const topology = {
|
||||
projectId: projectInfo.value.projectId,
|
||||
name: projectInfo.value.name,
|
||||
devices:devices,
|
||||
pipelines:[],
|
||||
systemboundaries:[],
|
||||
globalDisplay:{
|
||||
device:{
|
||||
showProperties:[]
|
||||
},
|
||||
material:{
|
||||
showProperties:[]
|
||||
},
|
||||
|
||||
},
|
||||
designData:cells
|
||||
}
|
||||
console.log(topology)
|
||||
// 添加保存信息
|
||||
const saveData = {
|
||||
projectId: projectInfo.value.projectId,
|
||||
topology: JSON.stringify(topology)
|
||||
}
|
||||
updateProjects(saveData).then((res:any) => {
|
||||
if(res === true){
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "保存成功",
|
||||
});
|
||||
}
|
||||
});
|
||||
// 返回保存的数据
|
||||
return saveData
|
||||
} catch (error) {
|
||||
console.error('保存设计失败:', error)
|
||||
return null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1062,7 +1186,7 @@ function closeMaterialModel(e:any){ // 关闭物料信息弹窗
|
||||
<div class="context-menu" v-if="isMenuShow" :style="{left: left +'px', top: top+'px'}">
|
||||
<img src="@/assets/x6/info.png" alt="图标" title="设备信息" style="cursor: pointer;" @click="EditdeviceClick">
|
||||
<img src="@/assets/x6/material.png" alt="图标" title="物料信息" style="cursor: pointer;" @click="MaterialModelClick">
|
||||
<img src="@/assets/x6/change.png" alt="图标" title="变动设置" style="cursor: pointer;">
|
||||
<img src="@/assets/x6/change.png" alt="图标" title="变动设置" style="cursor: pointer;" @click="ChangesettingsClick">
|
||||
<img src="@/assets/x6/copy.png" alt="图标" title="复制" style="cursor: pointer;" @click="copyNode">
|
||||
<img src="@/assets/x6/del.png" alt="图标" title="删除" style="cursor: pointer;"
|
||||
@click="deleteNode">
|
||||
@ -1100,20 +1224,17 @@ function closeMaterialModel(e:any){ // 关闭物料信息弹窗
|
||||
:deviceTypetype="deviceTypetype" ref="Editdevice" @closeEditdevice="closeEditdevice"/>
|
||||
</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"
|
||||
:deviceTypetype="deviceTypetype" ref="Editdevice" @closeEditdevice="closeEditdevice"/>
|
||||
</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"
|
||||
:deviceTypetype="deviceTypetype" ref="Editdevice" @closeEditdevice="closeEditdevice"/>
|
||||
</el-dialog> -->
|
||||
|
||||
<el-dialog v-model="isMaterialModel" :close-on-click-modal="false" :modal="false" draggable :before-close="dialogMaterialModel" title="物料信息" append-to-body width="1014px">
|
||||
<MaterialModels v-if="isMaterialModel == true" :materiaId="nodeId" :materialInfo="materialInfo" :deviceInfo="deviceInfo"
|
||||
:deviceTypetype="deviceTypetype" ref="MaterialModel" @closeMaterialModel="closeMaterialModel"/>
|
||||
<MaterialModels v-if="isMaterialModel == true" :materialId="nodeId" :projectInfo="projectInfo"
|
||||
:materialInfo="materialInfo" :deviceInfo="deviceInfo" :deviceTypetype="deviceTypetype" ref="MaterialModel" @closeMaterialModel="closeMaterialModel"/>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<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"
|
||||
:materialInfo="materialInfo" :deviceInfo="deviceInfo" ref="ChangesettingsModel" @closeChangesettingsModel="closeChangesettingsModel"/>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -215,7 +215,7 @@ function handleClick(item:any, index:any){
|
||||
for(let i = 0; i < tempData.length; i++){
|
||||
let attr = tempData[i]
|
||||
ingredientData.value.push({
|
||||
key: attr.name,
|
||||
key: attr.key,
|
||||
value: attr.value,
|
||||
unit: attr.unit,
|
||||
})
|
||||
@ -443,6 +443,7 @@ function confirmMaterial(){
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
cursor: pointer;
|
||||
}
|
||||
.choiceMateria-left-item:hover{
|
||||
background-color: #f5f8ff;
|
||||
|
||||
1518
business-css/frontend/src/components/antvx6/viewx6.vue
Normal file
@ -10,7 +10,7 @@ import { ElForm, ElMessage, ElMessageBox } from "element-plus";
|
||||
import { getDictItemById } from '@/api/dict';
|
||||
import { eventsBatchSave } from '@/api/business/event';
|
||||
import ConditionModel from '@/views/component/scenario/condition.vue'
|
||||
import { addScenarios,updateScenarios} from "@/api/business/scenario";
|
||||
import { addScenarios,updateScenarios,getActiveAlgorithms } from "@/api/business/scenario";
|
||||
|
||||
const emit = defineEmits([ 'closeCreatescenario']);
|
||||
const props = defineProps({ // 接收父组件传递的项目信息
|
||||
@ -41,15 +41,8 @@ function handleScenarioClose(){
|
||||
}
|
||||
const getAlgorithmType = async () => {
|
||||
try {
|
||||
let params = {
|
||||
dictId: '595502b91e7741b5033b53622d8731a3',
|
||||
size:99,
|
||||
current:1
|
||||
}
|
||||
const result:any = await getDictItemById(params);
|
||||
if (result.code == '0') {
|
||||
algorithmTypeData.value = result.data.records
|
||||
}
|
||||
const result:any = await getActiveAlgorithms();
|
||||
algorithmTypeData.value = result
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
@ -152,7 +145,7 @@ onMounted(() => {
|
||||
</el-form-item>
|
||||
<el-form-item label="算法类型:" prop="algorithmType">
|
||||
<el-select v-model="info.algorithmType" placeholder="请选择" style="width:100%;" clearable>
|
||||
<el-option v-for="item in algorithmTypeData" :key="item.id" :label="item.dictName" :value="item.itemCode" />
|
||||
<el-option v-for="item in algorithmTypeData" :key="item.algorithmType" :label="item.name" :value="item.algorithmType" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="事故情景描述:">
|
||||
|
||||
@ -8,6 +8,9 @@ export default {
|
||||
import { onMounted, ref, nextTick } from "vue";
|
||||
import { ElForm, ElMessage, ElMessageBox } from "element-plus";
|
||||
import { searchScenariosLsit,addScenarios,updateScenarios,deleteScenarios,deleteBatchScenarios} from "@/api/business/scenario";
|
||||
|
||||
import { simulationInit,simulationRun } from "@/api/business/project";
|
||||
|
||||
import Page from '@/components/Pagination/page.vue'
|
||||
import { getDictItemById } from '@/api/dict';
|
||||
// import ConditionModel from '@/views/component/scenario/condition.vue'
|
||||
@ -268,6 +271,48 @@ function closeCreatescenario(){
|
||||
dialogVisible.value = false;
|
||||
gettableData();
|
||||
}
|
||||
|
||||
function confirmationAnalysis(row: any) {
|
||||
ElMessageBox.confirm("确定对"+ row.name +"故情景分析进行模拟吗?", "确认模拟", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
let params = {
|
||||
projectId: row.projectId,
|
||||
scenarioId: row.scenarioId,
|
||||
};
|
||||
simulationInit(params).then((res:any) => {
|
||||
if (res.code == '0') {
|
||||
let data = {
|
||||
data: res.data
|
||||
}
|
||||
simulationRun(row.projectId, row.scenarioId, data || {}).then((res) => {
|
||||
gettableData();
|
||||
}).catch((error) => {
|
||||
console.error('模拟运行失败:', error);
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "模拟运行失败,请检查后端服务是否正常",
|
||||
});
|
||||
})
|
||||
}else{
|
||||
ElMessage({
|
||||
type: "error",
|
||||
message: "模拟初始化失败",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -312,14 +357,26 @@ function closeCreatescenario(){
|
||||
<span
|
||||
style="display: flex;display: -webkit-flex; justify-content: space-around;-webkit-justify-content: space-around; ">
|
||||
|
||||
<img src="@/assets/table/edit.png" alt="" title="修改"
|
||||
<img src="@/assets/table/edit.png" alt="" title="修改" v-if="scope.row.status == 0"
|
||||
@click="editClick(scope.row)" style="cursor: pointer; ">
|
||||
<img src="@/assets/table/design.png" alt="" title="分享设计"
|
||||
style="cursor: pointer; ">
|
||||
<img src="@/assets/table/simulation.png" alt="" title="模拟分析"
|
||||
style="cursor: pointer; ">
|
||||
<img src="@/assets/table/export.png" alt="" title="导出事故情景工程"
|
||||
style="cursor: pointer; ">
|
||||
<img src="@/assets/table/view.png" alt="" title="查看" v-if="scope.row.status != 0"
|
||||
@click="editClick(scope.row)" style="cursor: pointer; ">
|
||||
|
||||
<img src="@/assets/table/shifa.png" alt="" title="始发事件" v-if="scope.row.status == 0"
|
||||
@click="editClick(scope.row)" style="cursor: pointer; ">
|
||||
<img src="@/assets/table/see.png" alt="" title="查看始发事件" v-if="scope.row.status != 0"
|
||||
@click="editClick(scope.row)" style="cursor: pointer; ">
|
||||
|
||||
<img src="@/assets/table/moni.png" alt="" title="模拟计算" v-if="scope.row.status == 0"
|
||||
@click="confirmationAnalysis(scope.row)" style="cursor: pointer; ">
|
||||
<img src="@/assets/table/moni_disabled.png" alt="" title="查看始发事件" v-if="scope.row.status != 0">
|
||||
|
||||
<img src="@/assets/table/result.png" alt="" title="计算结果" v-if="scope.row.status == 2"
|
||||
@click="editClick(scope.row)" style="cursor: pointer; ">
|
||||
<img src="@/assets/table/result_disabled.png" alt="" title="计算结果" v-if="scope.row.status != 2">
|
||||
|
||||
|
||||
|
||||
<img src="@/assets/table/del.png" alt="" title="删除"
|
||||
@click="delAloneClick(scope.row)" style="cursor: pointer; ">
|
||||
</span>
|
||||
|
||||