whychdw
2021-10-12 e3f6713b35ce2251da9829e3722cfa981d2870d6
内容提交
3个文件已修改
101 ■■■■■ 已修改文件
src/assets/js/apis/dcdc/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/components/elePriceTpl.vue 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/realTime.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/dcdc/index.js
@@ -196,4 +196,17 @@
            data: "json=" + JSON.stringify(data),
        });
    },
    /**
     * 统计削峰填谷价格
     * @param data
     * @returns {AxiosPromise}
     */
    getPeakPrice(data) {
        // 请求后台查询内容
        return axios({
            method: 'post',
            url: 'Peak_statisticsAction!serchByCondition',
            data: "json=" + JSON.stringify(data),
        })
    }
};
src/pages/dataTest/components/elePriceTpl.vue
@@ -24,7 +24,15 @@
              </flex-box>
            </div>
            <div class="layout-content-bottom">
              <flex-box title="每日节约电费统计" size="mini">
              <flex-box title="节约电费统计" size="mini">
                <div slot="tools">
                  <el-select v-model="timeNum" size="mini">
                    <el-option
                        v-for="(item, key) in timeNums" :key="'key'+key"
                        :label="item.label" :value="item.value"></el-option>
                  </el-select>
                  <el-button size="mini" type="primary">查询</el-button>
                </div>
                <dot-line ref="priceDotLine" :show-area="true"></dot-line>
              </flex-box>
            </div>
@@ -42,6 +50,7 @@
import eLeCapPie from "@/components/chart/eLeCapPie";
import DotLine from "@/components/chart/line/dotLine";
import {formatSeconds} from "@/assets/js/tools";
import getItemByKey from "@/assets/js/tools/getItemByKey";
export default {
  name: "elePriceTpl",
  props: {
@@ -75,6 +84,44 @@
        left: 15,
        right: 9,
      },
      timeNum: 1,
      timeNums: [
        {
          key: 1,
          value: 1,
          num: 1, // 按月统计
          label: '最近7天',
          days: 7,
        },
        {
          key: 2,
          value: 2,
          num: 1, // 按月统计
          label: '最近30天',
          days: 30,
        },
        {
          key: 3,
          value: 3,
          num: 1, // 按月统计
          label: '最近3个月',
          days: 30*3,
        },
        {
          key: 4,
          value: 4,
          num: 1, // 按月统计
          label: '最近6个月',
          days: 30*6,
        },
        {
          key: 5,
          value: 5,
          num: 3,   // 按年统计
          label: "最近1年",
          days: 365,
        }
      ],
    }
  },
  watch: {
@@ -97,12 +144,35 @@
    searchData() {
      console.log(this.batt);
    },
    getPeakPrice() { // 统计削峰填谷价格
      let batt = this.batt;
      let timeNum = getItemByKey(this.timeNum, this.timeNums);
      let num = timeNum.num;
      let recordTime = new Date().format("yyyy-MM-dd");
      let recordTime1 = new Date(new Date().getTime()+timeNum.days*24*3600*1000).format("yyyy-MM-dd");
      // 构造查询条件
      let searchParams = {
        BattGroupId: batt.BattGroupId,
        num: num,
        record_time: recordTime,
        record_time1: recordTime1
      };
      // 查询后台
      this.$apis.dcdc.getPeakPrice(searchParams).then(res=>{
        let rs = JSON.parse(res.data.result);
        console.log(rs);
      }).catch(error => {
      });
    },
  },
  computed: {
  },
  mounted() {
    this.searchData();
    this.getPeakPrice();
    // 设置容量
    let xData = [];
src/pages/dataTest/realTime.vue
@@ -2805,13 +2805,19 @@
      if (this.inputs.batt_state === 2) {
        list.batt_syrl_cap = "---";
      } else {
        list.batt_syrl_cap = this.inputs.batt_rest_cap.toFixed(1) + "AH";
        // 为0是不更新剩余容量
        if(this.inputs.batt_rest_cap != 0) {
          list.batt_syrl_cap = this.inputs.batt_rest_cap.toFixed(1)
        }
      }
      if (this.inputs.batt_state === 3) {
        list.sysc = sethoubeiTime(
          parseFloat(this.inputs.batt_rest_cap) /
            parseFloat(this.inputs.group_curr)
        );
        // 为0是不更新续航时长
        if(this.inputs.batt_rest_cap != 0) {
          list.sysc = sethoubeiTime(
              parseFloat(this.inputs.batt_rest_cap) /
              parseFloat(this.inputs.group_curr)
          );
        }
      } else {
        list.sysc = "------";
      }