jinlin
2024-07-24 3cdad023eec111154857d3b7b0eb59336c6a3378
web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -26,8 +26,8 @@
        <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 :isShow="false"></product-model-tree>
            </div>
          </el-col>
          <el-col :span="20">
@@ -68,7 +68,6 @@
          id: '',
          pid: '',
          productId: '',
          taskId: '',
          taskModelId: '',
          dataType: '',
          isRepair: '',
@@ -84,7 +83,7 @@
    watch: {
      percentage() {
        if (this.percentage === 100) {
          this.$refs.SimulatCurve.initEcharts(this.dataForm.taskId,this.dataForm.samplPeriod);
          this.$refs.SimulatCurve.initEcharts(this.dataForm.id,this.dataForm.taskModelId, this.dataForm.samplPeriod);
        }
      }
    },
@@ -107,7 +106,7 @@
        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() {
@@ -122,45 +121,25 @@
        //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)
                this.percentage = parseFloat(res.data)
              }
            }
          )*/
          )
        } else {
          clearInterval(this.timers)
        }
      },
      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)
        }
      }
    }
  }