修复计算结果图形化显示不正确问题

This commit is contained in:
limengnan 2026-05-20 10:49:26 +08:00
parent 75c83930c3
commit 26de84817b
3 changed files with 14 additions and 35 deletions

View File

@ -211,7 +211,6 @@ onMounted(() => {
rowHeight: 100,
},
getDragNode: (sourceNode:any) => {
console.log('1111')
let node:any = sourceNode
if (node.data && node.data.lineStyle) {
// 线线
@ -342,12 +341,11 @@ onMounted(() => {
if(node.store.data.attrs.text.text == '圆柱槽'){
deviceTypetype.value = 'CylindricalTank'
node.size(110, 140)
const width = node.size().width
node.attr('image/xlink:href', '/assets/11.png')
node.attr('image/width', 105)
node.attr('image/height', 135)
node.attr('label/refY', 140)
node.attr('label/refX', width/2)
node.attr('label/refX', 0.5)
node.attr('label/textAnchor', 'middle')
}else if(node.store.data.attrs.text.text == '扁平槽'){
deviceTypetype.value = 'FlatTank'

View File

@ -128,10 +128,6 @@ function exportExportsClick(){
{{ scope.row[item.key] }}
</template>
</el-table-column>
<!-- <el-table-column v-if="getIf(selectData,'diameter')" prop="diameter" label="直径cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'height')" prop="height" label="高度cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'width')" prop="width" label="宽度cm" min-width="100"></el-table-column>
<el-table-column v-if="getIf(selectData,'length')" prop="length" label="长度cm" min-width="100"></el-table-column> -->
<el-table-column v-if="getIf(selectData,'volume')" prop="volume" label="体积单位L" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'flow_rate')" prop="flow_rate" label="流量单位m3/h" min-width="160"></el-table-column>
<el-table-column v-if="getIf(selectData,'pulse_velocity')" prop="pulse_velocity" label="脉冲速度单位Hz" min-width="160"></el-table-column>

View File

@ -135,8 +135,10 @@ function getScenarioResults(){
}
sliderIndex.value = customImageData.value[i].scenarioResults.length - 1
selecteTime.value = customImageData.value[i].scenarioResults[sliderIndex.value].step
sliderValues.value = tempSliderValues
addAttrText(customImageData.value[i],sliderIndex.value,selectedData.value)
sliderValues.value = tempSliderValues
addAttrText(customImageData.value[i],sliderIndex.value,selectedData.value)
}
}
}
@ -149,7 +151,7 @@ function addAttrText(item:any,index:any,useData:any){
graph.addNode({
shape: 'rect-text',
x: item.position.x ,
y: item.position.y + 160,
y: item.position.y + item.attrs.label.refY + 20,
width: 100,
height: 30,
attrs: {
@ -170,7 +172,7 @@ function addAttrText(item:any,index:any,useData:any){
graph.addNode({
shape: 'image-node',
x: item.position.x + 135 ,
y: item.position.y + 166,
y: item.position.y + item.attrs.label.refY + 26,
width: 14,
height: 14,
correlationId: item.id,
@ -190,7 +192,7 @@ function addAttrText(item:any,index:any,useData:any){
graph.addNode({
shape: 'image-node',
x: item.position.x + 110 ,
y: item.position.y + 166,
y: item.position.y + item.attrs.label.refY + 26,
width: 14,
height: 14,
correlationId: item.id,
@ -199,8 +201,8 @@ function addAttrText(item:any,index:any,useData:any){
attrs: {
img: {
width: 14,
height: 14,
'xlink:href': textimg,
height: 14,
'xlink:href': textimg,
},
label: {
text: '',
@ -239,7 +241,7 @@ const result = [...deviceResult,...materialResult]
graph.addNode({
shape: 'rect-text',
x: item.position.x,
y: item.position.y + 183 + i * 25,
y: item.position.y + item.attrs.label.refY + 44 + i * 25,
width: 260,
height: 30,
// label: data[i].name + '' + data[i].value,
@ -493,9 +495,9 @@ onMounted(() => {
refY: 0,
},
label: {
refX: 45,
refX: 0.5,
refY: 80,
textAnchor: 'start',
textAnchor: 'middle',
textVerticalAnchor: 'top',
fontSize: 14,
fill: '#000',
@ -882,12 +884,6 @@ function dialogAttributeDialog(){ // 关闭变动设置弹窗
</div>
<div id="graph-container" style="width: 100%; height: calc(100% - 60px);">
<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;" @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"> -->
</div>
<div class="viewx6-DisplaySettingsButton" @click="ChangesettingsClick">显示设置</div>
</div>
@ -940,18 +936,7 @@ function dialogAttributeDialog(){ // 关闭变动设置弹窗
</el-dialog>
<div
style="width: 100%;position: absolute;bottom: 20px;z-index: 10; display: flex; justify-content: center;">
<!-- <el-slider v-if="sliderValues.length>0" v-model="selecteTime" :format-tooltip="formatTooltip"
:min="0"
:max="sliderValues.length - 1"
:step="1"
:marks="sliderMarks"
show-stops size="large"
@change="handleTimeChange"
style="width: 80%;"
/> -->
<div style="width: 100%;position: absolute;bottom: 20px;z-index: 10; display: flex; justify-content: center;">
<el-slider v-if="sliderValues.length>0" v-model="selecteTime" :format-tooltip="formatTooltip"
:min="0"
:max="sliderValues.length - 1"