| | |
| | | <el-progress v-if="isShow" :percentage="percentage"></el-progress> |
| | | <div> |
| | | <el-col :span="4"> |
| | | <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect"> |
| | | <product-model-tree :isShow="false" ></product-model-tree> |
| | | <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect"> |
| | | <product-model-tree @on-selected="onTreeSelected" showXdy="false" |
| | | ref="ProductModelTree" :isShow="false"/> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="20"> |
| | | |
| | | <div style="margin-top: 20px"> |
| | | <div style="margin-left: 400px" v-if="isShow"> |
| | | <el-tag type="info" effect="dark" style="font-size: 20px">MTBF:{{MTBF}}</el-tag> |
| | | <el-tag type="info" effect="dark" style="margin-left: 50px;font-size: 20px">MTTR:{{MTTR}}</el-tag> |
| | | </div> |
| | | <div> |
| | | <SimulatCurve ref="SimulatCurve"></SimulatCurve> |
| | | </div> |
| | |
| | | id: '', |
| | | pid: '', |
| | | productId: '', |
| | | taskId: '', |
| | | showProductId: '', |
| | | taskModelId: '', |
| | | dataType: '', |
| | | isRepair: '', |
| | | dataType: 'fz', |
| | | samplPeriod: '', |
| | | simulatFrequency: '', |
| | | simulatTime: '' |
| | |
| | | watch: { |
| | | percentage() { |
| | | if (this.percentage === 100) { |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm.taskId,this.dataForm.samplPeriod); |
| | | this.$refs.SimulatCurve.initEcharts(this.dataForm); |
| | | } |
| | | } |
| | | }, |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | onTreeSelected(data) { |
| | | console.log(data, 'onProductSelected') |
| | | this.dataForm.showProductId = data.id |
| | | this.$refs.SimulatCurve.getProductEcharts(this.dataForm); |
| | | }, |
| | | // 获取信息 |
| | | onProductSelected(data) { |
| | | this.isSelect = true |
| | |
| | | this.dataForm.taskModelId = data.id |
| | | }, |
| | | async getProductList() { |
| | | let res = await this.$http.get('/taskReliability/Task/getTaskProductList') |
| | | let res = await this.$http.get('/basicInfo/XhProductModel/getTaskProductList') |
| | | this.productList = res.data |
| | | }, |
| | | async getTaskList() { |
| | |
| | | //console.log('getStroke:',this.progress.start,",",this.progress.speed) |
| | | if (this.percentage < 100) { |
| | | //console.log('getStroke2') |
| | | /* this.$http.get(`sys/common/stroke?progressId=${this.progress.id}`).then( |
| | | this.$http.get(`/taskReliability/SimulatAssess/getCalcProgress?taskId=${this.dataForm.id}`).then( |
| | | res => { |
| | | if (res.success) { |
| | | this.percentage = parseFloat(res.data.percentage) |
| | | // console.log(res.data, 'res.data') |
| | | if (res.data) { |
| | | this.percentage = parseFloat(res.data) |
| | | } |
| | | } |
| | | )*/ |
| | | ) |
| | | } else { |
| | | clearInterval(this.timers) |
| | | this.percentage = 0 |
| | | } |
| | | }, |
| | | async analyze() { |
| | | this.isShow = true |
| | | this.timers = window.setInterval(this.getStroke, 1000) |
| | | /* let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm) |
| | | if (res.success) { |
| | | let stopPolling = false |
| | | if (!stopPolling) { |
| | | let timer = setInterval(async () => { |
| | | let res2 = await this.$http.get(`/taskReliability/SimulatAssess/${res.data}`) |
| | | if (res2.data) { |
| | | if (res2.data.code === '0' || res2.data.errorMsg === '0') { |
| | | stopPolling = true |
| | | // 中止轮询 |
| | | clearInterval(timer) |
| | | alert('已获取')*/ |
| | | //this.$refs.SimulatCurve.initEcharts(); |
| | | // 清除定时器 |
| | | /* } else { |
| | | stopPolling = true |
| | | // 中止轮询 |
| | | clearInterval(timer) |
| | | alert('数据有误,重新输入') |
| | | } |
| | | } |
| | | }, 400) |
| | | } |
| | | |
| | | }*/ |
| | | let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`) |
| | | this.dataForm.id = result.data |
| | | let res = await this.$http.post('/taskReliability/SimulatAssess/analyze', this.dataForm) |
| | | if (res.success) { |
| | | this.timers = window.setInterval(this.getStroke, 1000) |
| | | } |
| | | } |
| | | } |
| | | } |