From c73915bda3963a67322e366c1883e9615a25535a Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期三, 09 十月 2024 09:16:08 +0800
Subject: [PATCH] 修改
---
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java | 6 +-
web/src/views/modules/taskReliability/TimeDiagram.vue | 79 +++++++++++++--------------------------
2 files changed, 30 insertions(+), 55 deletions(-)
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
index 909ede2..f065467 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/taskReliability/service/SimulatAssessService.java
@@ -385,12 +385,12 @@
for (int i = 0; i < smallStatusDtoList.size(); i++) {
for (TimeDiagramStatusDto status : smallStatusDtoList.get(i)) {
JSONObject lineJson = new JSONObject(templetsStrMap2.get(status.getStatus()));
- setlineXy(lineJson, status.getX1(), y, status.getX2(), y, "");
+ setlineXy(lineJson, status.getX1(), y, status.getX2()+5, y, "");
JsonUtils2.setJsonValueByPath(lineJson, "data/status".split("/"), status.getStatus());
JsonUtils2.setJsonValueByPath(lineJson, "id".split("/"), UUIDUtil.generateId().toString());
jsonArray2.add(lineJson);
}
- y = y + 20;
+ y = y + 10;
}
//鍥句緥
@@ -402,7 +402,7 @@
JSONObject f = templetsMap.get(s);
x1 = x1 + spaceWitdth;
x2 = x2 + spaceWitdth;
- setlineXy(f, x1, y, x2, y, null);
+ setlineXy(f, x1, y+10, x2, y+10, null);
jsonArray2.add(f);
}
timeDiagramDto.setDiagramJson(jsonObject.toString());
diff --git a/web/src/views/modules/taskReliability/TimeDiagram.vue b/web/src/views/modules/taskReliability/TimeDiagram.vue
index 0a3dc6d..bb2e113 100644
--- a/web/src/views/modules/taskReliability/TimeDiagram.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -2,7 +2,7 @@
<div class="fa-card-a">
<el-row :gutter="5">
<div class="mod-taskReliability-simulatAssess">
- <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" >
+ <el-form :inline="true" :model="dataForm" ref="dataForm" :disabled="dataForm.disabled">
<zt-form-item label="浜у搧鑺傜偣" prop="productId">
<zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/>
</zt-form-item>
@@ -21,8 +21,8 @@
<el-input v-model="dataForm.simulatFrequency" readonly="false">
</el-input>
</zt-form-item>
- <zt-form-item >
- <zt-button @click="getDiagram()">鏌ョ湅鏃跺簭鍥�</zt-button>
+ <zt-form-item>
+ <zt-button @click="getDiagram(null)">鏌ョ湅鏃跺簭鍥�</zt-button>
</zt-form-item>
</el-form>
<div>
@@ -58,8 +58,8 @@
export default {
data() {
return {
- title:'',
- knob:HTMLDivElement,
+ title: '',
+ knob: HTMLDivElement,
dialogVisible2: false,
timers: '',
shape: '',
@@ -173,7 +173,7 @@
data: {
id: '',
status: '',
- startTime:'',
+ startTime: '',
endTime: '',
},
attrs: {
@@ -192,7 +192,7 @@
},
keyboard: true,
})
- this.knob = document.createElement('div',false)
+ this.knob = document.createElement('div', false)
this.knob.style.position = 'absolute'
document.getElementById('timeDiagram').appendChild(this.knob)
this.graph.centerContent()
@@ -446,7 +446,7 @@
id: node.getData().dataId,
modelName: node.attr('label/textWrap/modelName'),
}
- this.title=node.attr('label/textWrap/modelName') + "妯″瀷璁捐"
+ this.title = node.attr('label/textWrap/modelName') + "妯″瀷璁捐"
this.$nextTick(() => {
this.$refs.modelView.init(param)
})
@@ -461,22 +461,22 @@
})
// 榧犳爣绉诲叆edge鑺傜偣
- this.graph.on('edge:mouseenter', ({edge,e}) => {
+ this.graph.on('edge:mouseenter', ({edge, e}) => {
const style = this.knob.style
// e.stopPropagation()
console.log('edge:mouseenter')
if (e && edge.data) {
- if (edge.getData().status==='F') {
+ if (edge.getData().status === 'F') {
//console.log(edge.getData(),"eee edge.getData()")
let startTimes = edge.getData().startTimes
let endTimes = edge.getData().endTimes
//console.log(e,'eee')
const p = this.graph.clientToGraph(e.clientX, e.clientY)
- setTimeout(()=>{
+ setTimeout(() => {
style.display = 'block'
style.left = `${p.x}px`
style.top = `${p.y}px`
- style.width = 200+ 'px'
+ style.width = 200 + 'px'
style.height = 80 + 'px'
style.textAlign = 'center'
style.background = '#000'
@@ -484,9 +484,9 @@
style.lineHeight = (40 + 'px')
style.zIndex = 100
this.knob.innerText = `寮�濮嬫椂闂达細${startTimes}\n缁撴潫鏃堕棿锛�${endTimes}`
- },0)
- console.log(p,'p p p')
- console.log(style,this.knob,'style style')
+ }, 0)
+ console.log(p, 'p p p')
+ console.log(style, this.knob, 'style style')
}
}
})
@@ -518,37 +518,7 @@
console.log(res.data)
this.simulatList = res.data
},
- async onTreeSelected(data) {
- this.graph.unfreeze()
- if (!this.dataForm.taskModelId) {
- this.$alert("璇峰厛閫夋嫨鍏蜂綋浠诲姟")
- return
- }
- if (!this.dataForm.id) {
- this.$alert("璇峰厛閫夋嫨鍏蜂綋浠跨湡璁板綍")
- return
- }
- let params = {
- productId: data.id,
- taskId: this.dataForm.taskModelId,
- fzId: this.dataForm.id
- }
- let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params})
- if (res.data !== null) {
- this.diagramJson = JSON.parse(res.data)
- console.log(this.diagramJson, 'this.Diagram json')
- this.graph.fromJSON(this.diagramJson)
- this.graph.positionContent('left')
- //this.graph.zoomToFit()
- this.graph.freeze()
- } else {
- this.graph.fromJSON(this.emptyJson)
- //this.graph.centerContent()
- //this.graph.zoomToFit()
- this.graph.freeze()
- }
- console.log(res.data)
- },
+
// 鑾峰彇淇℃伅
onProductSelected(data) {
this.isSelect = true
@@ -578,14 +548,17 @@
this.dataForm.samplPeriod = result.data.samplPeriod
this.dataForm.simulatFrequency = result.data.simulatFrequency
},
- async getDiagram() {
+ async onTreeSelected(data) {
+ this.getDiagram(data.id)
+ },
+ async getDiagram(productId) {
this.graph.unfreeze()
let params = {
- productId: this.dataForm.productId,
+ productId: productId ? productId : this.dataForm.productId,
taskId: this.dataForm.taskModelId,
fzId: this.dataForm.id,
- smallWidth:1000,
- minPointNum:5
+ smallWidth: 1000,
+ minPointNum: 5
}
let res = await this.$http.get('/taskReliability/SimulatAssess/getStatus', {params: params})
if (res.data !== null) {
@@ -593,12 +566,12 @@
console.log(this.diagramJson, 'this.Diagram json')
this.graph.fromJSON(this.diagramJson)
this.graph.centerContent()
- this.graph.zoomToFit()
+ //this.graph.zoomToFit()
this.graph.freeze()
} else {
this.graph.fromJSON(this.emptyJson)
this.graph.centerContent()
- this.graph.zoomToFit()
+ //this.graph.zoomToFit()
this.graph.freeze()
}
console.log(res.data)
@@ -612,9 +585,11 @@
border: 1px solid #dfe3e8;
width: 100% !important;
}
+
#timeDiagram .x6-cell.x6-node {
cursor: inherit;
}
+
.x6-graph-scroller.x6-graph-scroller-pannable {
width: 100% !important;
}
--
Gitblit v1.9.1