From a86c2eb2db34d2d350e5c2eb72bf6416ec89c0d2 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期二, 19 十一月 2024 11:43:03 +0800
Subject: [PATCH] 1)可靠性评定时新增模型检查处理; 2)获取任务二项分布参数时,去掉模型的匹配。
---
web/src/views/modules/taskReliability/SimulatAssess.vue | 111 ++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 77 insertions(+), 34 deletions(-)
diff --git a/web/src/views/modules/taskReliability/SimulatAssess.vue b/web/src/views/modules/taskReliability/SimulatAssess.vue
index a864ee6..7b59686 100644
--- a/web/src/views/modules/taskReliability/SimulatAssess.vue
+++ b/web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -9,33 +9,49 @@
<zt-select v-model="dataForm.taskModelId" :datas="taskList" @change="onTaskSelected"/>
</zt-form-item>
<zt-form-item label="鏃堕棿鍒嗙墖" prop="samplPeriod">
- <el-input type="number" :min="1" v-model="dataForm.samplPeriod">
+ <el-input type="number" :min="1" v-model="dataForm.samplPeriod"
+ style="width: 150px;vertical-align: baseline;">
<template slot="append">鍒嗛挓</template>
</el-input>
</zt-form-item>
<zt-form-item label="浠跨湡娆℃暟" prop="simulatFrequency">
- <el-input type="number" :min="1" v-model="dataForm.simulatFrequency">
+ <el-input type="number" :min="1" v-model="dataForm.simulatFrequency"
+ style="width: 150px;vertical-align: baseline;">
<template slot="append">娆℃暟</template>
</el-input>
</zt-form-item>
- <zt-form-item>
+ <el-form-item prop="repairDiracFlag" label-width="150px" style="margin-left: 20px">
+ <el-checkbox v-model="dataForm.repairDiracFlag">鍙慨璁惧鍙潬搴︿负1</el-checkbox>
+ </el-form-item>
+ <zt-form-item style="margin-left: 10px">
<zt-button @click="analyze()">浠跨湡鍒嗘瀽</zt-button>
+ <zt-button @click="displayProcess()">绠楁硶搴撹繘绋�</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>
<el-progress v-if="isShow" :percentage="percentage"></el-progress>
- <el-col :span="4">
- <div style="margin-right: 5px;height: calc(100vh - 230px)" v-if="isSelect">
- <product-model-tree @on-selected="onTreeSelected" showXdy="false"
- ref="ProductModelTree" :isShow="false" basic="4" :productId="dataForm.productId"/>
- </div>
- </el-col>
- <el-col :span="20">
- <div class="fa-card-a" style="height: calc(100vh - 230px)">
- <SimulatCurve ref="SimulatCurve"></SimulatCurve>
- </div>
- </el-col>
+ <el-col :span="4">
+ <div style="margin-right: 5px;height: calc(100vh - 230px)" v-if="isSelect">
+ <product-model-tree @on-selected="onTreeSelected" showXdy="false"
+ ref="ProductModelTree" :isShow="false" basic="4" :productId="dataForm.productId"/>
+ </div>
+ </el-col>
+ <el-col :span="20">
+ <div class="fa-card-a" style="height: calc(100vh - 230px)">
+ <SimulatCurve ref="SimulatCurve"></SimulatCurve>
+ </div>
+ </el-col>
</el-row>
- <el-dialog v-dialogDrag :close-on-click-modal="false" top="8vh" :visible.sync="dialogVisible" title="妯″瀷妫�鏌�" width="60%" @close="dialogVisible = false">
+ <el-dialog v-dialogDrag :close-on-click-modal="false" top="8vh" :visible.sync="dialogVisible" title="妯″瀷妫�鏌�"
+ width="60%" @close="dialogVisible = false">
<el-tag type="danger" style="margin-bottom: 10px">妯″瀷瀹氫箟/鍙傛暟閰嶇疆閲屽瓨鍦ㄤ互涓嬮棶棰橈細</el-tag>
<el-table :data="modelCheckResult" height="350"
:header-cell-style="{'text-align':'center'}">
@@ -52,18 +68,22 @@
<el-button type="primary" @click="dialogVisible = false">鍏� 闂�</el-button>
</div>
</el-dialog>
+ <Process ref="process"></Process>
</div>
</template>
<script>
import SimulatCurve from "./SimulatCurve";
import ProductModelTree from "../basicInfo/ProductModelTree";
+ import Process from "./Process";
+ import qs from "qs";
+ import Cookies from "js-cookie";
export default {
data() {
return {
- timers: '',
+ timers: null,
isSelect: false,
isShow: false,
percentage: 0,
@@ -81,6 +101,7 @@
samplPeriod: '10',
simulatFrequency: 500,
simulatTime: '',
+ repairDiracFlag: false
},
dialogVisible: false,
modelCheckResult: [],
@@ -90,20 +111,21 @@
this.getProductList()
},
watch: {
- percentage() {
- if (this.percentage === 100) {
- this.$refs.SimulatCurve.initEcharts(this.dataForm);
- }
- }
+ // percentage() {
+ // if (this.percentage === 100) {
+ // this.$refs.SimulatCurve.initEcharts(this.dataForm);
+ // }
+ // }
},
components: {
ProductModelTree,
SimulatCurve,
+ Process,
},
methods: {
onTreeSelected(data) {
- if (this.dataForm.id){
+ if (this.dataForm.id) {
console.log(data, 'onProductSelected')
this.dataForm.showProductId = data.id
this.$refs.SimulatCurve.getProductEcharts(this.dataForm);
@@ -137,18 +159,20 @@
console.log(res.data)
this.taskList = res.data
},
- getStroke() {
- if (this.percentage < 100) {
- let param = {
- taskList: [this.dataForm.id]
- }
- this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param}).then(
- res => {
- if (res.data) {
- this.percentage = parseFloat(res.data)
- }
+ async getStroke() {
+ let param = {
+ taskList: [this.dataForm.id]
+ }
+ let res = await this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress`, {params: param})
+ if (res.success) {
+ if (res.data) {
+ this.percentage = parseFloat(res.data)
+ if (this.percentage >= 100) {
+ clearInterval(this.timers)
+ this.percentage = 0
+ this.$refs.SimulatCurve.initEcharts(this.dataForm);
}
- )
+ }
} else {
clearInterval(this.timers)
this.percentage = 0
@@ -160,9 +184,10 @@
this.isShow = true
let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`)
this.dataForm.id = result.data
+ this.percentage = 0
let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm)
if (res.success) {
- console.log(res.data)
+ console.log(res.data, 'res.data')
if (res.data && res.data.length > 0) {
this.modelCheckResult = res.data
this.dialogVisible = true
@@ -170,6 +195,24 @@
this.timers = window.setInterval(this.getStroke, 1000)
}
}
+ },
+ async download(selsect) {
+ if(this.dataForm.id){
+ let param = qs.stringify({
+ 'token': Cookies.get('token'),
+ type: 'fz',
+ xml:selsect,
+ id: this.dataForm.id
+ })
+ let apiURL = `/taskReliability/SimulatAssess/downloadXml`
+ window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}`
+ }else{
+ this.$alert('杩樻湭杩涜浠跨湡鎿嶄綔')
+ }
+
+ },
+ displayProcess() {
+ this.$refs.process.$refs.dialog.init()
}
}
}
--
Gitblit v1.9.1