From a8ce806c8a81f685fa9fafaa453820197ced9961 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 10 十二月 2024 10:39:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
web/src/views/modules/taskReliability/TimeDiagram.vue | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 49 insertions(+), 6 deletions(-)
diff --git a/web/src/views/modules/taskReliability/TimeDiagram.vue b/web/src/views/modules/taskReliability/TimeDiagram.vue
index cf48ad0..bf021da 100644
--- a/web/src/views/modules/taskReliability/TimeDiagram.vue
+++ b/web/src/views/modules/taskReliability/TimeDiagram.vue
@@ -23,6 +23,15 @@
</zt-form-item>
<zt-form-item>
<zt-button @click="getDiagram(null)">鏌ョ湅鏃跺簭鍥�</zt-button>
+ <el-dropdown style="margin-left: 10px" @command="download">
+ <el-button type="primary">
+ 涓嬭浇xml<i class="el-icon-arrow-down el-icon--right"></i>
+ </el-button>
+ <el-dropdown-menu slot="dropdown">
+ <el-dropdown-item command="1">杈撳叆xml</el-dropdown-item>
+ <el-dropdown-item command="2">杈撳嚭xml</el-dropdown-item>
+ </el-dropdown-menu>
+ </el-dropdown>
</zt-form-item>
</el-form>
<div style="display: flex">
@@ -59,6 +68,8 @@
import ModelView from "./ModelView";
import textDiagram from "./textDiagram";
import timeDiagramThumbnail from "./timeDiagramThumbnail"
+ import qs from "qs";
+ import Cookies from "js-cookie";
export default {
@@ -132,14 +143,14 @@
},
created() {
let scrollView = this.$refs['scrollView']
- window.addEventListener('scroll', this.handleScroll,true);
+ window.addEventListener('scroll', this.handleScroll,{passive:false});
},
destroyed() {
let scrollView = this.$refs['scrollView']
- window.removeEventListener('scroll', this.handleScroll,true);
+ window.removeEventListener('scroll', this.handleScroll);
},
mounted() {
- this.getProductList()
+ this.getProductList(Cookies.get('productId'))
this.init()
this.$refs.textDiagram.init()
this.$refs.timeDiagramThumbnail.init()
@@ -158,6 +169,20 @@
let top = this.graph.getScrollbarPosition().top
this.$refs.textDiagram.setScroll(top)
this.$refs.timeDiagramThumbnail.getNodePointX(left,this.bigWidth)
+ },
+ getPath(){
+ if (Cookies.get('productId') != null){
+ this.dataForm.id = Cookies.get('fzId')
+ this.dataForm.productId = Cookies.get('productId')
+ this.dataForm.taskModelId = Cookies.get('taskModelId')
+ console.log(this.dataForm.id)
+ this.getTaskList()
+ this.$nextTick(() => {
+ this.onProductSelected({id:this.dataForm.productId})
+ this.onTaskSelected({id:Cookies.get('taskModelId')})
+ this.onSimulatSelected({id:Cookies.get('fzId')})
+ })
+ }
},
init() {
this.graph = new Graph({
@@ -352,10 +377,14 @@
style.display = 'none'
})
},
- async getProductList() {
+ async getProductList(productId) {
let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList')
this.productList = res.data
- this.onProductSelected(this.productList[0])
+ if(productId!=null){
+ this.getPath()
+ }else{
+ this.onProductSelected(this.productList[0])
+ }
},
async getTaskList() {
let params = {
@@ -439,7 +468,21 @@
getPoint(x,smallWidth){
let pointX = Number((x * (this.bigWidth / smallWidth )).toFixed(0))
this.graph.setScrollbarPosition(pointX, null)
- }
+ },
+ async download(selsect) {
+ if(this.dataForm.id){
+ let param = qs.stringify({
+ 'token': Cookies.get('token'),
+ type: 'sxt',
+ xml:selsect,
+ id: this.dataForm.id
+ })
+ let apiURL = `/taskReliability/SimulatAssess/downloadXml`
+ window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}`
+ }else{
+ this.$alert('杩樻湭閫夋嫨浠跨湡璁板綍')
+ }
+ },
}
}
</script>
--
Gitblit v1.9.1