wente
2024-08-19 6bae24b32e3196f5e01d4a9fed62a4e51528b809
web/src/views/modules/taskReliability/SchemeCompar.vue
@@ -1,8 +1,7 @@
<template>
  <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" width="100px">
            <zt-select v-model="dataForm.productId" :datas="productList" @change="onProductSelected"/>
          </zt-form-item>
@@ -14,15 +13,14 @@
            <zt-button @click="compair()">方案对比</zt-button>
          </zt-form-item>
        </el-form>
        <div>
          <el-col :span="4">
            <div style="margin-right: 5px;height: calc(88vh - 100px)" v-if="isSelect">
            <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 style="margin-top: 20px;position: relative;height: 600px">
            <div class="fa-card-a" style="position: relative;height: calc(100vh - 230px)">
              <div v-if="isShow">
                <el-button v-if="isZk" type="info" size="small" icon="el-icon-caret-bottom"
                           style="position: absolute;right: 10%;top: 10%;z-index: 1" @click="zk()"></el-button>
@@ -38,7 +36,7 @@
                    <el-table-column
                      prop="mtbf"
                      label="MTBF"
                      width="90px"
                      width="100px"
                      align="right">
                      <template slot-scope="scope">
                        <span>{{  keepNumber(scope.row.mtbf) }}</span>
@@ -47,7 +45,7 @@
                    <el-table-column
                      prop="mttr"
                      label="MTTR"
                      width="90px"
                      width="100px"
                      align="right">
                      <template slot-scope="scope">
                        <span>{{  keepNumber(scope.row.mttr) }}</span>
@@ -56,7 +54,7 @@
                    <el-table-column
                      prop="msr"
                      label="MSR"
                      width="90px"
                      width="100px"
                      align="right">
                      <template slot-scope="scope">
                        <span>{{  keepNumber(scope.row.mttr) }}</span>
@@ -70,8 +68,6 @@
              </div>
            </div>
          </el-col>
        </div>
      </div>
    </el-row>
  </div>
</template>
@@ -119,11 +115,21 @@
    },
    methods: {
      onTreeSelected(data) {
        if (this.dataForm.id) {
      async onTreeSelected(data) {
        if (this.dataForm.taskModelId.length > 0) {
          console.log(this.dataForm.taskModelId)
          console.log(data, 'onProductSelected')
          this.dataForm.showProductId = data.id
          this.$refs.SimulatCurve.getProductEcharts(this.dataForm);
          let params = {
            taskList: this.dataForm.taskModelId,
            showProductId: this.dataForm.showProductId
          }
          console.log(this.dataForm.taskModelId, 'this.dataForm.taskModelId')
          let res = await this.$http.get('/taskReliability/SimulatAssess/SchemeCompar', {params: params})
          console.log(res.data, "res")
          this.xDataList = res.data.xdataList
          this.seriesList = res.data.curveList
          this.tableData = res.data.dataList
        }
      },
      // 获取信息
@@ -136,9 +142,9 @@
          this.$refs.ProductModelTree.getProductList()
        })
      },
      onTaskSelected(data){
        console.log(data,'onTaskSelected(data)')
        for (let item of data){
      onTaskSelected(data) {
        console.log(data, 'onTaskSelected(data)')
        for (let item of data) {
          this.taskList.push(item.name)
        }
      },
@@ -160,12 +166,13 @@
      },
      async compair() {
        let params = {
          taskList: this.dataForm.taskModelId
          taskList: this.dataForm.taskModelId,
          showProductId: null
        }
        console.log(this.dataForm.taskModelId,'this.dataForm.taskModelId')
        console.log(this.dataForm.taskModelId, 'this.dataForm.taskModelId')
        let res = await this.$http.get('/taskReliability/SimulatAssess/SchemeCompar', {params: params})
        console.log(res.data, "res")
        this.xDataList =res.data.xdataList
        this.xDataList = res.data.xdataList
        this.seriesList = res.data.curveList
        this.tableData = res.data.dataList
@@ -174,7 +181,14 @@
        this.option = {
          xAxis: {
            data: this.xDataList,
            name: '仿真总时长'
            name: '仿真总时长',
            type: 'category',
            axisLabel: {
              formatter: function(value) {
                // 将 X 轴刻度值格式化为保留两位小数的字符串
                return parseFloat(value).toFixed(2);
              }
            }
          },
          yAxis: {
            type: 'value',