whyczyk
2021-05-24 1c6aa4735d39ae4b36bcb9b4ace96d1fc2239ef5
试验点状态列表接口对接
3个文件已修改
131 ■■■■ 已修改文件
src/pages/test/dialog/testStepConfirmKz.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/js/api.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/noLoadTest.vue 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/test/dialog/testStepConfirmKz.vue
@@ -60,43 +60,37 @@
          span: 8,
        },
        params: {
          speed: '',
          noise: '',
          speed: 120,
          noise: 80,
          point: [{
              duration: "", // 负载时长
              experimentId: "", // 对应试验
              duration: 20, // 负载时长
              name: '负载点1', // 负载点名称
              percentage: "", // 负载百分数
              percentage: 150, // 负载百分数
            },
            {
              duration: "", // 负载时长
              experimentId: "", // 对应试验
              duration: 20, // 负载时长
              name: '负载点2', // 负载点名称
              percentage: "", // 负载百分数
              percentage: 120, // 负载百分数
            },
            {
              duration: "", // 负载时长
              experimentId: "", // 对应试验
              duration: 20, // 负载时长
              name: '负载点3', // 负载点名称
              percentage: "", // 负载百分数
              percentage: 100, // 负载百分数
            },
            {
              duration: "", // 负载时长
              experimentId: "", // 对应试验
              duration: 20, // 负载时长
              name: '负载点4', // 负载点名称
              percentage: "", // 负载百分数
              percentage: 80, // 负载百分数
            },
            {
              duration: "", // 负载时长
              experimentId: "", // 对应试验
              duration: 20, // 负载时长
              name: '负载点5', // 负载点名称
              percentage: "", // 负载百分数
              percentage: 70, // 负载百分数
            },
            {
              duration: "", // 负载时长
              experimentId: "", // 对应试验
              duration: 20, // 负载时长
              name: '负载点6', // 负载点名称
              percentage: "", // 负载百分数
              percentage: 50, // 负载百分数
            },
          ]
        },
src/pages/test/js/api.js
@@ -110,6 +110,20 @@
        method: "POST",
        url: "/experiment/kzfz",
        data,
    });
}
/**
 * 查询测试点列表
 * @param data
 * @returns {AxiosPromise}
 */
export const experimentPoint = (params) => {
    return axios({
        method: "GET",
        url: "/experiment/point",
        params: params,
    });
}
src/pages/test/noLoadTest.vue
@@ -189,7 +189,7 @@
        </div>
      </div>
    </div>
    <load-test-dialog type="kz"></load-test-dialog>
    <load-test-dialog type="kz" :visible="dialogVisible"></load-test-dialog>
  </div>
</template>
@@ -205,6 +205,10 @@
  import MwSectionProcess from '@/components/smallModule/mwSectionProcess.vue';
  import MwThermometer from '@/components/smallModule/mwThermometer.vue';
  import LoadTestDialog from "@/pages/test/dialog/LoadTestDialog";
  import {
    getExitTest,
    experimentPoint
  } from "@/pages/test/js/api";
  let diagram;
  export default {
    components: {
@@ -221,6 +225,7 @@
    },
    data() {
      return {
        dialogVisible: false,
        dcBox: [{
            label: '电压:',
            value: 0,
@@ -299,45 +304,7 @@
          color: '#666ee8',
          status: true
        }],
        list: [{
            name: '负载点一',
            status: 2,
            start: '开始时间\n10:30',
            end: '完成时间\n10:30',
            endText: '平均功率\n100kW'
          },
          {
            name: '负载点二',
            status: 2,
            start: '开始时间\n10:30',
            end: '完成时间\n10:30',
            endText: '平均功率\n100kW'
          },
          {
            name: '负载点三',
            status: 2,
            start: '开始时间\n10:30',
            end: '完成时间\n10:30'
          },
          {
            name: '负载点四',
            status: 1,
            start: '开始时间\n10:30',
            end: ''
          },
          {
            name: '负载点五',
            status: 0,
            start: '开始时间\n10:30',
            end: ''
          },
          {
            name: '负载点六',
            status: 0,
            start: '开始时间\n10:30',
            end: ''
          },
        ]
        list: []
      }
    },
    watch: {
@@ -357,8 +324,44 @@
    mounted() {
      this.initChart();
      diagram = gridCircuitDiagram(this.$refs.static, this.$refs.flush);
      this.checkIsTesting();
    },
    methods: {
      experimentPoint(id) {
        let postData = {
          experimentId: id
        }
        experimentPoint(postData).then((res) => {
          let rsData = res.data;
          console.log(res.data)
          if (rsData.code == 1) {
            rsData.data.map(item => {
              this.list.push({
                name: item.name,
                status: item.status,
                start: item.startTime ? `开始时间\n${item.startTime}` : '',
                end: item.endTime ? `完成时间\n${item.endTime}` : '',
                endText: item.averagePower ? `平均功率\n${item.averagePower}kW` : '',
              })
            })
          }
        }).catch((err) => {
          console.log(err)
        });
      },
      checkIsTesting() {
        getExitTest().then(res => {
          let rs = res.data;
          if (rs.code == 1) {
            this.$layer.msg('已存在试验');
            this.experimentPoint(rs.data.id)
          } else {
            this.dialogVisible = true;
          }
        }).catch(error => {
        });
      },
      changeSpeed(type) {
        if (type == 'add') {
          this.speedValue += 1