jinlin
2024-08-16 b19917255abcd8b44be207822a116292ba42a0cd
web/src/views/modules/taskReliability/SchemeCompar.vue
@@ -38,7 +38,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 +47,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 +56,7 @@
                    <el-table-column
                      prop="msr"
                      label="MSR"
                      width="90px"
                      width="100px"
                      align="right">
                      <template slot-scope="scope">
                        <span>{{  keepNumber(scope.row.mttr) }}</span>
@@ -119,11 +119,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 +146,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 +170,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 +185,14 @@
        this.option = {
          xAxis: {
            data: this.xDataList,
            name: '仿真总时长'
            name: '仿真总时长',
            type: 'category',
            axisLabel: {
              formatter: function(value) {
                // 将 X 轴刻度值格式化为保留两位小数的字符串
                return parseFloat(value).toFixed(2);
              }
            }
          },
          yAxis: {
            type: 'value',