whychw
2020-11-10 be613e707f0edd044fd5db56b0a5dc4f0d4ce4a7
U 参试设备的修改
4个文件已修改
59 ■■■■ 已修改文件
src/api/services/subject/index.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/script/common.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/script/config_subject.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/subject/history.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/services/subject/index.js
@@ -16,6 +16,13 @@
  }
  /**
   *
   *
   *
   *
   */
  /**
   * Ac230v_upsAction_prt_serchByInfo
   * // AC230V不间断电源设备实时数据显示(前100笔数据服务器的时间)
   * 参数json:{"dev_id":"15001"}
@@ -43,6 +50,10 @@
   * Electrical_monitor_stationAction_prt_serchByInfo
   * 电气综合监控台实时数据显示(前100笔数据服务器的时间)
   * 参数json:{"dev_id":"8001"}
   *
   * Battery_monitorAction_prt_serchByInfo
   * 蓄电池充电与监测装置实时数据显示(前100笔数据服务器的时间)
   * 参数json:{"dev_id":"14001"}
   * 
   * 
   */
@@ -71,7 +82,7 @@
        url = 'get100Data_TODO_13';
        break;
      case 14:
        url = 'get100Data_TODO_14';
        url = 'Battery_monitorAction_prt_serchByInfo';
        break;
      case 15:
        url = 'Ac230v_upsAction_prt_serchByInfo';
@@ -121,6 +132,10 @@
   * Electrical_monitor_stationAction_prt_serchHistory
   * 电气综合监控台设备历史数据查询
   * 参数json:{"dev_id":"8001","record_time":"2020-11-04 15:44:29","record_time1":"2020-11-04 15:54:29"}
   *
   * Battery_monitorAction_prt_serchHistory
   * 蓄电池充电与监测装置设备历史数据查询
   * 参数json:{"dev_id":"14001","record_time":"2020-11-04 15:44:29","record_time1":"2020-11-04 15:54:29"}
   * 
   */
  ,getHisData (data) {
@@ -148,7 +163,7 @@
        url = 'getHisData_TODO_13';
        break;
      case 14:
        url = 'getHisData_TODO_14';
        url = 'Battery_monitorAction_prt_serchHistory';
        break;
      case 15:
        url = 'Ac230v_upsAction_prt_serchHistory';
@@ -243,6 +258,11 @@
   * json:{"dev_name":"1号舱室配电板","dev_id":"17001","export_num":"17","table_name":"2020_11_04","record_time":"2020-11-04 14:25:45","record_time1":"2020-11-04 14:25:54","states":"三相线电压AB,三相线电压BC,三相线电压CA,频率","tablists":"threeAB_vol,threeBC_vol,threeCA_vol,Q1F"}
   * json:{"dev_name":"1号可靠分配电板","dev_id":"18001","export_num":"18","table_name":"2020_11_04","record_time":"2020-11-04 14:29:40","record_time1":"2020-11-04 14:29:46","states":"三相线电压AB,三相线电压BC,三相线电压CA,频率","tablists":"threeAB_vol,threeBC_vol,threeCA_vol,Q1F"}
   *
   * CsvFileDownloadAction!searchDownloadFile_partinsystem
   * 历史数据导出
   * 传参
   * json:{"dev_name":"1号蓄电池充电与监测装置","dev_id":"14001","export_num":"14","table_name":"2020_11_04","record_time":"2020-11-04  14:20:54","record_time1":"2020-11-04 14:29:56","states":"电池组电压,电池组电流,最高温度,平均电压,1号单体电压","tablists":"group_vol,group_curr,max_tmp,avg_vol,mon_vol1"}
   *
   */
  ,download (data) {
    return self.$axios({
src/script/common.js
@@ -162,6 +162,10 @@
    return res;
}
function isArray (target) {
    return Object.prototype.toString.call(target) === '[object Array]';
}
// 一维数组去重 得用filter
function unique (arr) {
    return arr.filter(function (v, i, a) {
@@ -267,6 +271,7 @@
    getCurrentDate,
    RAF,
    CAF,
    isArray,
    // throttle,
    setLocalStorage(key,val){
        const _val = (typeof val == 'object') ? JSON.stringify(val) : val;
src/script/config_subject.js
@@ -2599,6 +2599,10 @@
    ,"mon_tmp400": '℃'
  }
}
const test = {
  status: ['Q100', 'Q200', 'Q300', 'Q400']
  ,unit: {}
}
const emptyObj = {
  unit: {}
}
src/views/subject/history.vue
@@ -121,6 +121,7 @@
import CONFIG from '@/script/config_subject';
import Loading from '@/components/Loading'
import ProgressLoad from '@/components/ProgressLoad'
import common from '@/script/common';
// 设定值的备份 因为要处理最后的余项
let category_len = 10;
@@ -128,6 +129,8 @@
let config = null;
// 图表实例对象
let G = null;
const isArray = common.isArray;
let dev_idx = 0;
export default {
  name: 'subject_history',
  components: {
@@ -310,7 +313,7 @@
    }
    // 选择设备
    ,selectDev (data) {
      // console.log(data, 'selectdev');
      console.log(data, 'selectdev');
      // 设定设备名称
      this.cur_devname = data.dev_name;
      this.cur_devid = data.dev_id;
@@ -467,7 +470,7 @@
      let selectedLegends = [];
      if (config) {
        // console.log(config);
        Object.keys(config).forEach((v) => {
        /*Object.keys(config).forEach((v) => {
          if (v != 'unit') {
            allLegends.push({
              key: v,
@@ -476,7 +479,22 @@
            });
            selectedLegends.push(v);
          }
        });
        });*/
        let idx = idx || 0;
        let props = Object.keys(config);
        for (let i = 0, j = props.length; i < j; i++) {
          const v = props[i];
          if (v != 'unit') {
            allLegends.push({
              key: v,
              label: isArray(config[v]) ? config[v][idx] : config[v],
              unit: config.unit[v]
            });
            selectedLegends.push(v);
          }
        }
      }
      this.allLegends = allLegends;
      this.selectedLegends = selectedLegends;
@@ -498,7 +516,7 @@
      this.$api.subject.checkHis(param).then((res) => {
        res = JSON.parse(res.data.result);
        if (res.code) {
          console.log(res.data, 'data=========');
          // console.log(res.data, 'data=========');
          let data = res.data;
          let start = data[0] == '0' ? 0 : new Date(data[0] + ' 00:00:00').getTime();
          let end = data[1] == '0' ? 0 : new Date(data[1] + ' 23:59:59').getTime();