whychw
2020-09-26 dbe9afb8a7929a97f682d4c4d9e2598a05c6fd37
U 修改所里的一些需求
16个文件已修改
744 ■■■■ 已修改文件
src/api/services/batt/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/common.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/m-element-ui.css 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chart/LineChartMul.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chart/theme/transparent.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/script/chargepower.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/script/config.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/script/draw_general.js 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/script/general.js 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/chargePower/alone.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/chargePower/main.vue 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/general/index.vue 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/motor/index.vue 288 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/rectifier/group.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/rectifier/main.vue 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/services/batt/index.js
@@ -4,13 +4,15 @@
export default {
  /**
    * 电池组实时数据
    * Batt_rtstateAction!searchAll
    * 查询四组蓄电池组端实时数据
    */
  getRTData (data) {
  getRTData () {
    return self.$axios({
      method: 'post'
      ,url: 'Batt_rtstateAction!serchByCondition'
      ,data: 'json=' + JSON.stringify(data)
      // ,url: 'Batt_rtstateAction!serchByCondition'
      ,url: 'Batt_rtstateAction!searchAll'
      ,data: null
    });
  }
  
src/assets/css/common.css
@@ -629,6 +629,10 @@
}
/************************状态灯*********end****************/
.el-drawer__wrapper,
.el-drawer__header {
    color: #fff;
}
.p_motor_drawer {
    background: url('~@/assets/images/dw_bg.png') 50% 50% / auto no-repeat;
}
src/assets/css/m-element-ui.css
@@ -268,7 +268,8 @@
}
.el-form-item .el-form-item__label {
    color: #606266;
    /*color: #606266;*/
    color: inherit;
}
.el-green .el-form-item__label {
src/components/chart/LineChartMul.vue
@@ -23,6 +23,8 @@
import "./theme/transparent"
let resizeHandler;
let chart = null;
let g_opt = null;
export default {
    props: {
        title: {
@@ -73,6 +75,10 @@
            type: Number,
            default: 1
        }
        ,showXaxis: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
@@ -94,10 +100,22 @@
    },
    methods: {
        setOption(opt) {
            // console.trace();
            let dataZoom = this.dataZoom;
            // let tooltip = this.tooltip;
            const self = this;
            const itemHeight = (this.showZoom ? this.$refs.root.offsetHeight - 30 : this.$refs.root.offsetHeight) / this.categoryLen - 2;
            let rootH = this.$refs.root.offsetHeight;
            g_opt = opt;
            // console.log(this.$refs.root.clientHeight, this.$refs.root.offsetHeight, 99999999988888);
            if (this.showZoom) {
                rootH -= 30;
            }
            if (this.showXaxis) {
                rootH -= 30;
            }
            const itemHeight = rootH / this.categoryLen - 2;
            // console.log(rootH, itemHeight, '??');
            // console.log(this.$refs.root.offsetHeight);
            // 默认配置项
            let option = {
@@ -144,7 +162,7 @@
                let yAxis = [];
                let series = [];
                let xAxisIndex = [];
                opt.series.forEach((v, i) => {
                opt.series.forEach((v, i, a) => {
                    // 生成 title
                    title.push({
                        left: 'left',
@@ -161,7 +179,8 @@
                        ,height: itemHeight
                    });
                    xAxis.push({
                        show: false
                        show: i == a.length - 1
                        // show: true
                        ,type: 'category'
                        ,gridIndex: i
                        ,data: xLabel
@@ -191,6 +210,7 @@
                    this.unit.push(v.unit);
                    xAxisIndex.push(i);
                });
                // console.log(xAxis, 'xAxis');
                option.title = title;
                option.grid = grid;
                option.xAxis = xAxis;
@@ -247,7 +267,7 @@
    },
    mounted() {
        var ele = document.getElementById(this.id);
        let chart = ECharts.init(ele, 'transparent');
        chart = ECharts.init(ele, 'transparent');
        // 将图表添加到图表管理
        this.$G.chartManage.set(this.id, chart);
        // 设置配置
@@ -269,6 +289,15 @@
    },
    updated () {
        // let h = this.$refs.root.currentStyle || window.getComputedStyle(this.$refs.root, null);
        // console.log('update', h.height);
        this.$nextTick(() => {
            // console.log('resize', h.height);
            this.setOption(g_opt).resize();
        });
        // debugger;
    },
    destroyed() {
        // 销毁echarts
        this.$G.chartManage.del(this.id);
src/components/chart/theme/transparent.js
@@ -49,13 +49,15 @@
      }
    },
    axisTick: {
      show: false,
      // show: false,
      show: true,
      lineStyle: {
        color: contrastColor
      }
    },
    axisLabel: {
      show: false,
      // show: false,
      show: true,
      textStyle: {
        color: contrastColor
      }
src/main.js
@@ -13,7 +13,7 @@
import G from './global'
import common from './script/common.js'
// import config from './script/config.js'
import config from './script/config.js'
import user from './script/user.js'
import filters from './script/filter.js'
@@ -32,7 +32,7 @@
// Vue.prototype.$message = Message;
Vue.prototype.$common = common;
// Vue.prototype.config = config;
Vue.prototype.$config = config;
Vue.prototype.$user = user;
Vue.prototype.$G = G;
// Vue.prototype.$api = api;
src/script/chargepower.js
@@ -201,7 +201,7 @@
 * 画开关
 * 
 */
EleCircle.prototype.drawSwitch = function (options, whetherAdd) {
EleCircleCharge.prototype.drawSwitch = function (options, whetherAdd) {
  var type = 'switch';
  var self = this;
  var defaults = {
@@ -506,7 +506,7 @@
      break;
    // 水平 起点 逆时针
    case 6:
      // console.log('水平 起点 逆时针');
      console.log('水平 起点 逆时针', 'chargepower');
      opts.lineStartX = opts.startX;
      opts.lineStartY = opts.startY;
      opts.lineEndX = opts.endX;
src/script/config.js
@@ -7,4 +7,5 @@
    // apiUrl:'',
    // test
    // apiUrl: 'http://localhost:8919/zijing/'
    url: process.env.NODE_ENV == 'dev' ? 'http://localhost:8919/DyEnvir_system/' : ''
}
src/script/draw_general.js
@@ -230,25 +230,25 @@
    startX: 760
    ,startY: 415
    ,endX: 760
    ,endY: 475
    ,endY: 445
  });
  can.drawGradualLine({
    startX: 880
    ,startY: 415
    ,endX: 880
    ,endY: 475
    ,endY: 445
  });
  can.drawGradualLine({
    startX: 1000
    ,startY: 415
    ,endX: 1000
    ,endY: 475
    ,endY: 445
  });
  can.drawGradualLine({
    startX: 1120
    ,startY: 415
    ,endX: 1120
    ,endY: 475
    ,endY: 445
  });
  // 画水管
@@ -270,13 +270,13 @@
    ,startY: 95
    ,direction: 'v'
    ,endX: 1200
    ,endY: 655
    ,endY: 745
  });
  can.drawWaterLine({
    startX: 1020
    ,startY: 651
    ,startY: 741
    ,endX: 1204
    ,endY: 651
    ,endY: 741
  });
    // 画高压开关柜
@@ -365,7 +365,7 @@
  }, true);
  can.drawWater({
    startX: 933
    ,startY: 600
    ,startY: 690
    ,label: '3号水冷装置'
    ,cbfn_click: function () {
      context.$router.push('/watercooling/index/9');
@@ -375,7 +375,7 @@
  // 画电池组
  can.drawBatt({
    startX: 727
    ,startY: 474
    ,startY: 444
    ,label: '电池组1'
    ,cbfn_click: function () {
      window.open('/DyEnvir_system/big_screen/index.html#/?idx=0', '_self');
@@ -383,7 +383,7 @@
  }, true);
  can.drawBatt({
    startX: 847
    ,startY: 474
    ,startY: 444
    ,label: '电池组2'
    ,cbfn_click: function () {
      window.open('/DyEnvir_system/big_screen/index.html#/?idx=1', '_self');
@@ -391,7 +391,7 @@
  }, true);
  can.drawBatt({
    startX: 967
    ,startY: 474
    ,startY: 444
    ,label: '电池组3'
    ,cbfn_click: function () {
      window.open('/DyEnvir_system/big_screen/index.html#/?idx=2', '_self');
@@ -399,7 +399,7 @@
  }, true);
  can.drawBatt({
    startX: 1087
    ,startY: 474
    ,startY: 444
    ,label: '电池组4'
    ,cbfn_click: function () {
      window.open('/DyEnvir_system/big_screen/index.html#/?idx=3', '_self');
@@ -536,21 +536,23 @@
  // 水冷
  can.drawRect({
    startX: 548
    startX: 508
    ,startY: 636
    ,width: 150
    ,height: 40
    ,strokeStyle: 'transparent'
  }, true);
  // 3号水冷
  can.drawRect({
    startX: 940
    ,startY: 554
    startX: 900
    ,startY: 644
    ,width: 150
    ,height: 40
    ,strokeStyle: 'transparent'
  }, true);
  // 2号水冷
  can.drawRect({
    startX: 1020
    startX: 980
    ,startY: 334
    ,width: 150
    ,height: 40
@@ -609,6 +611,36 @@
    ,height: 40
    ,strokeStyle: 'transparent'
  }, true);
  // 电池组信息面板 index 15
  can.drawRect({
    startX: 728
    ,startY: 512
    ,width: 110
    ,height: 110
    ,strokeStyle: 'transparent'
  }, true);
  can.drawRect({
    startX: 848
    ,startY: 512
    ,width: 110
    ,height: 110
    ,strokeStyle: 'transparent'
  }, true);
  can.drawRect({
    startX: 968
    ,startY: 512
    ,width: 110
    ,height: 110
    ,strokeStyle: 'transparent'
  }, true);
  can.drawRect({
    startX: 1088
    ,startY: 512
    ,width: 110
    ,height: 110
    ,strokeStyle: 'transparent'
  }, true);
  
}
src/script/general.js
@@ -598,7 +598,7 @@
 * 画开关
 * 
 */
EleCircle.prototype.drawSwitch = function (options, whetherAdd) {
EleCircleGeneral.prototype.drawSwitch = function (options, whetherAdd) {
  var type = 'switch';
  var self = this;
  var defaults = {
@@ -669,7 +669,7 @@
  switch (opts.isHor * 4 + opts.fromStart * 2 + opts.clockwise) {
    // 竖直 终点 逆时针
    case 0:
      // console.log('竖直 终点 逆时针');
      console.log('竖直 终点 逆时针');
      opts.lineStartX = opts.endX;
      opts.lineStartY = opts.endY;
      opts.lineEndX = opts.startX - opts.switchHeight + opts.lineWidth;
@@ -708,7 +708,7 @@
      break;
    // 竖直 终点 顺时针
    case 1:
      // console.log('竖直 终点 顺时针');
      console.log('竖直 终点 顺时针');
      opts.lineStartX = opts.endX;
      opts.lineStartY = opts.endY;
      opts.lineEndX = opts.startX + opts.switchHeight - opts.lineWidth;
@@ -747,7 +747,7 @@
      break;
    // 竖直 起点 逆时针
    case 2:
      // console.log('竖直 起点 逆时针');
      console.log('竖直 起点 逆时针');
      opts.lineStartX = opts.startX;
      opts.lineStartY = opts.startY;
      opts.lineEndX = opts.endX + opts.switchHeight - opts.lineWidth;
@@ -786,7 +786,7 @@
      break;
    // 竖直 起点 顺时针
    case 3:
      // console.log('竖直 起点 顺时针');
      console.log('竖直 起点 顺时针');
      opts.lineStartX = opts.startX;
      opts.lineStartY = opts.startY;
      opts.lineEndX = opts.endX - opts.switchHeight + opts.lineWidth;
@@ -825,7 +825,7 @@
      break;
    // 水平 终点 逆时针
    case 4:
      // console.log('水平 终点 逆时针');
      console.log('水平 终点 逆时针');
      opts.lineStartX = opts.endX;
      opts.lineStartY = opts.endY;
      opts.lineEndX = opts.startX;
@@ -871,7 +871,7 @@
      break;
    // 水平 终点 顺时针
    case 5:
      // console.log('水平 终点 顺时针');
      console.log('水平 终点 顺时针');
      opts.lineStartX = opts.endX;
      opts.lineStartY = opts.endY;
      opts.lineEndX = opts.startX;
@@ -918,7 +918,7 @@
      break;
    // 水平 起点 逆时针
    case 6:
      // console.log('水平 起点 逆时针');
      console.log('水平 起点 逆时针');
      opts.lineStartX = opts.startX;
      opts.lineStartY = opts.startY;
      opts.lineEndX = opts.endX;
@@ -959,6 +959,7 @@
      obj.right = opts.startX + opts.switchWidth;
      obj.top = opts.startY  - opts.switchHeight ;
      obj.bottom = opts.startY;
      console.log(obj, 989989);
      // 开关在上方
      beAbove = true;
      break;
src/views/chargePower/alone.vue
@@ -99,6 +99,7 @@
            title="我是标题"
            height="100%"
            :max-size='true'
            :show-xaxis="true"
            :categoryLen="5"
            :subtext="true"  trigger-on="mousemove"></line-chart-mul>
        </div>
@@ -477,14 +478,16 @@
      if (!this.record_time) {
        return false;
      }
      this.G_data.push({
        brachdccurr: this.brachdccurr,
        brachdcvol: this.brachdcvol,
        localgivecurr: this.local_set_cur,
        localgivevol: this.local_set_vol,
        controlangle: this.controlangle,
        record_time: this.record_time
      });
      if (!this.G_data.length || (this.G_data.length && this.record_time != this.G_data[this.G_data.length - 1].record_time)) {
        this.G_data.push({
          brachdccurr: this.brachdccurr,
          brachdcvol: this.brachdcvol,
          localgivecurr: this.local_set_cur,
          localgivevol: this.local_set_vol,
          controlangle: this.controlangle,
          record_time: this.record_time
        });
      }
      if (this.G_data.length > 50) {
        this.G_data.shift();
      }
src/views/chargePower/main.vue
@@ -177,13 +177,17 @@
            <el-date-picker type="date" size="mini" placeholder="选择日期" :clearable="false" value-format="yyyy-MM-dd" v-model="select_date"></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="mini" @click="search">查询</el-button>
            <el-button-group>
              <el-button type="primary" size="mini" @click="search">查询</el-button>
              <el-button type="primary" size="mini" @click="exportCsv">导出</el-button>
            </el-button-group>
          </el-form-item>
        </el-form>
        <div class="wrap_G">
          <line-chart-mul id="G_dialog_id" ref="G_dialog_id" 
            title="我是标题"
            height="100%"
            :show-xaxis="true"
            :max-size='true'
            :categoryLen="5"
            :show-zoom='true'
@@ -576,12 +580,12 @@
    ,showGraph (group) {
      this.G_title = group + '机组历史曲线';
      this.G_Visible = true;
      this.getHisData(group).then((res) => {
      this.getHisData(group, this.select_date).then((res) => {
        // console.log(res, 9999);
        this.$refs['G_dialog_id'].setOption(res);
      }).catch(e => {
        this.$refs['G_dialog_id'].setOption(this.format([]));
        console.error(e);
        console.warn(e);
      });
    }
    // 历史曲线 查询
@@ -595,7 +599,62 @@
        this.$refs['G_dialog_id'].setOption(res);
      }).catch(e => {
        this.$refs['G_dialog_id'].setOption(this.format([]));
        console.error(e);
        console.warn(e);
      });
    }
    ,exportCsv () {
      //json:{"dev_name":"1#蓄电池组","dev_id":"1000004","test_record_count":"1","export_num":"3","table_name":"2020_09_14"}
      //json:{"dev_name":"A套电源","dev_id":"4001","export_num":"4","table_name":"2020_09_24","record_time":"2020-09-24 00:00:00"}
      //json:{"dev_name":"A组电源","dev_id":"6001","export_num":"6","table_name":"2020_09_24","record_time":"2020-09-24 00:00:00"}
      // json:{"dev_name":"电机加载系统","dev_id":"2001","export_num":"2","table_name":"2020_09_25","record_time":"2020-09-25 00:00:00"}
      const reg = /A|B/;
      reg.test(this.G_title);
      const group = RegExp.lastMatch;
      let param = {
        dev_name: group + "组电源",
        dev_id: this.groupInfo[group].electric2KW_id,
        export_num: 6,
        table_name: this.select_date.replace(/-/g, '_'),
        record_time: this.select_date + " 00:00:00"
      };
      console.log(param, 'param');
      this.$axios({
        method: 'post'
        ,url: 'CsvFileDownloadAction!searchDownloadFile'
        ,data: 'json=' + JSON.stringify(param)
        ,timeout: 0
      }).then(res=>{
          res = JSON.parse(res.data.result);
          console.log(res, 'download res');
          if(res.code == 1) {
              // 关闭进度条
              // this.progress.show = false;
              // this.progress.value = 0;
              let data = res.data[0];
              const link = document.createElement("a");
              link.href = encodeURI(this.$config.url + 'tomcat7_csv/' + data.fileName);
              link.download = data.fileName;
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
              setTimeout(()=>{
                  // 关闭进度条
                  // this.progress.show = false;
                  // this.progress.value = 0;
              }, 1000);
          }else {
              // 关闭进度条
              // this.progress.show = false;
              // this.progress.value = 0;
              this.$layer.msg('生成文件失败!');
          }
      }).catch(error=>{
          // 关闭进度条
          // this.progress.show = false;
          // this.progress.value = 0;
          this.$layer.msg('生成文件失败!');
          console.warn(error);
      });
    }
    ,format (data) {
src/views/general/index.vue
@@ -24,6 +24,9 @@
    <div class="status" v-for="(item, idx) in status.slice(3)" :key="'status_' + idx" :style="getStyle(item)">
      <label>通讯:</label>
      <span :class="['indicator_css', {'status_normal': item.status, 'status_error': !item.status}]"></span>
      <span class="posR">
        <div v-if="idx > 0 && idx < 4" class="water-tmp">温度:{{'??????'}}℃</div>
      </span>
    </div>
    <!-- 电源状态 -->
    <div class="status" v-for="(item, idx) in status.slice(0, 3)" :key="'status_power_' + idx" :style="getStyle(item)">
@@ -36,7 +39,7 @@
        <span :class="['indicator_css', {'status_normal': item.run, 'status_error': !item.run}]"></span>
      </div>
    </div>
    <div class="power-info" v-for="(item, idx) in powerInfo" :key="'info_' + idx" :style="getPowerInfoStyle(item)">
    <div class="power-info" v-for="(item, idx) in powerInfo" :key="'info_' + idx" :style="getStyle(item)">
      <div class="pos_bl">
        <label>电流:</label>
        <span>{{item.cur}}A</span>
@@ -44,8 +47,25 @@
        <span>{{item.vol}}V</span>
      </div>
    </div>
  </div>
    <!-- 电池组信息 -->
    <div class="batt-info" v-for="(item, idx) in battInfo" :key="'batt_info_' + idx" :style="getStyle(item)">
      <div class="pos_tl">
        <div>
          <label>电流:</label>
          <span>{{item.list[0].value | toFixed}}A</span>
        </div>
        <div>
          <label>电压:</label>
          <span>{{item.list[1].value | toFixed}}V</span>
        </div>
        <div>
          <label>温度:</label>
          <span>{{"??"}}℃</span>
        </div>
      </div>
    </div>
  <!-- ROOTEND -->
  </div>
</template>
<script>
@@ -315,21 +335,23 @@
          title: '1#蓄电池组',
          top: 0,
          left: 0,
          width: 0,
          height: 0,
          list: [
            {
              text: '组端电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '在线电压:',
              text: '电流:',
              value: 0,
              unit: 'V'
            },
            {
              text: '电池电流:',
              text: '电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '温度:',
              value: 0,
              unit: '℃'
            }
          ]
        }, {
@@ -337,21 +359,23 @@
          title: '2#蓄电池组',
          top: 0,
          left: 0,
          width: 0,
          height: 0,
          list: [
            {
              text: '组端电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '在线电压:',
              text: '电流:',
              value: 0,
              unit: 'V'
            },
            {
              text: '电池电流:',
              text: '电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '温度:',
              value: 0,
              unit: '℃'
            }
          ]
        }, {
@@ -359,21 +383,23 @@
          title: '3#蓄电池组',
          top: 0,
          left: 0,
          width: 0,
          height: 0,
          list: [
            {
              text: '组端电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '在线电压:',
              text: '电流:',
              value: 0,
              unit: 'V'
            },
            {
              text: '电池电流:',
              text: '电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '温度:',
              value: 0,
              unit: '℃'
            }
          ]
        }, {
@@ -381,21 +407,23 @@
          title: '4#蓄电池组',
          top: 0,
          left: 0,
          width: 0,
          height: 0,
          list: [
            {
              text: '组端电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '在线电压:',
              text: '电流:',
              value: 0,
              unit: 'V'
            },
            {
              text: '电池电流:',
              text: '电压:',
              value: 0,
              unit: 'A'
            },
            {
              text: '温度:',
              value: 0,
              unit: '℃'
            }
          ]
        }
@@ -409,7 +437,7 @@
            {
              text: '已输出功率:',
              value: 0,
              unit: 'KVA'
              unit: 'kVA'
            },
            {
              text: '电压:',
@@ -431,7 +459,7 @@
            {
              text: '已输出功率:',
              value: 0,
              unit: 'KVA'
              unit: 'kVA'
            },
            {
              text: '电压:',
@@ -453,7 +481,7 @@
            {
              text: '已输出功率:',
              value: 0,
              unit: 'KVA'
              unit: 'kVA'
            },
            {
              text: '电压:',
@@ -475,7 +503,7 @@
            {
              text: '已输出功率:',
              value: 0,
              unit: 'KVA'
              unit: 'kVA'
            },
            {
              text: '电压:',
@@ -490,6 +518,10 @@
          ]
        }
      ],
      // status 1-3电源
      // 4 电机
      // 5-7 水冷
      // 8-11 负载
      status: [
        {
          left: 0,
@@ -694,6 +726,7 @@
      this.setFloatBoxPos();
      this.setPanelPos();
      this.setPowerInfoPos();
      this.getBattPos();
      // this.setRect();
    }
    // 添加电源数据
@@ -821,10 +854,31 @@
    ,setBattData () {
      /*let param = {
          BattGroupId: batt.BattGroupId
      };
      this.$api.batt.getRTData(param).then((res) => {
      });*/
      };*/
      this.$api.batt.getRTData().then((res) => {
        res = JSON.parse(res.data.result);
        // console.log(res, 'batt');
        if (res.code) {
          for (let i = 0, j = res.data.length; i < j; i++) {
            this.battInfo[i].list[0].value = res.data[i].group_curr;
            this.battInfo[i].list[1].value = res.data[i].group_vol;
            // this.battInfo[i].list[2] = res.data[i].group_vol;
          }
          // console.log(this.battInfo);
        }
      });
    }
    ,getBattPos () {
      const $container = this.$refs.container;
      const width = $container.offsetWidth;
      const height = $container.offsetHeight;
      for (let i = 14; i < 18; i++) {
        let position = this.$common.transSize(width, height, 1880, 810, can.getInfo('rect_' + i));
        this.battInfo[i - 14].top = position.top;
        this.battInfo[i - 14].left = position.left;
        this.battInfo[i - 14].width = position.width;
        this.battInfo[i - 14].height = position.height;
      }
    }
    // 获取负载列表
    ,getLoadList () {
@@ -915,20 +969,11 @@
      this.floatBox[3].top = pos.top;
    }
    ,getStyle (obj) {
      console.log(obj, 90)
      return {
        left: obj.left + 'px',
        top: obj.top + 'px',
        width: obj.width + 'px',
        height: obj.height + 'px'
      }
    }
    ,getPowerInfoStyle (obj) {
      return {
        left: obj.left + 'px'
        ,top: obj.top + 'px'
        ,width: obj.width + 'px'
        ,height: obj.height + 'px'
      }
    }
    ,setPanelPos () {
@@ -1063,6 +1108,7 @@
      // 添加电源数据
      this.setPowerData();
      this.setMotorData();
      this.setBattData();
      this.getConnect();
@@ -1082,6 +1128,7 @@
      this.setFloatBoxPos();
      this.setPanelPos();
      this.setPowerInfoPos();
      this.getBattPos();
    }
    window.addEventListener('resize', resizeHandler);
@@ -1140,7 +1187,7 @@
    height: 100%;
    display: block;
    -o-object-fit: contain;
    object-fit: contain;
    object-fit: contain;
  }
  .can1 {
    position: absolute;
@@ -1162,6 +1209,7 @@
  .box {
    z-index: 1;
  }
  .batt-info,
  .power-info {
    position: absolute;
  }
@@ -1184,4 +1232,11 @@
    -webkit-transform: translateY(10px);
    transform: translateY(10px);
  }
  .water-tmp {
    position: absolute;
    left: 0;
    top: 0;
    line-height: 24px;
    white-space: nowrap;
  }
</style>
src/views/motor/index.vue
@@ -37,18 +37,18 @@
          <div class="panel_status posR">
            <div class="">
              <!--  -->
              <div class="info_detail">{{latelyAlarm}}</div>
              <div class="btn_3d w_8em" @click="confirmAlarm">故障确认</div>
              <div class="info_detail">最近故障: <span>{{latelyAlarm || '暂无'}}</span></div>
              <div class="btn_3d w_8em" :class="{'disabled': !latelyAlarm}" @click="confirmAlarm">故障确认</div>
            </div>
            <div class="p_main">
              <!--  -->
              <div class="info_list">
                <div class="flexR_center"><label>就绪</label><span :class="{'status_off': !inverter_status.ready, 'status_normal': inverter_status.ready}"></span></div>
                <div class="flexR_center"><label>运行</label><span :class="{'status_off': !inverter_status.running, 'status_normal': inverter_status.running}"></span></div>
                <div class="flexR_center"><label>报警</label><span :class="{'status_off': !inverter_status.alarm, 'status_error': inverter_status.alarm}"></span></div>
                <div class="flexR_center"><label>故障</label><span :class="{'status_off': !inverter_status.fault, 'status_error': inverter_status.fault}"></span></div>
                <div class="flexR_center"><label>遥控</label><span :class="{'status_off': inverter_status.remote_control, 'status_normal': !inverter_status.remote_control}"></span></div>
                <div class="flexR_center"><label>就地</label><span :class="{'status_off': !inverter_status.remote_control, 'status_normal': inverter_status.remote_control}"></span></div>
                <div class="flexC_center"><label>就绪</label><span :class="{'status_off': !inverter_status.ready, 'status_normal': inverter_status.ready}"></span></div>
                <div class="flexC_center"><label>运行</label><span :class="{'status_off': !inverter_status.running, 'status_normal': inverter_status.running}"></span></div>
                <div class="flexC_center"><label>报警</label><span :class="{'status_off': !inverter_status.alarm, 'status_error': inverter_status.alarm}"></span></div>
                <div class="flexC_center"><label>故障</label><span :class="{'status_off': !inverter_status.fault, 'status_error': inverter_status.fault}"></span></div>
                <div class="flexC_center"><label>遥控</label><span :class="{'status_off': inverter_status.remote_control, 'status_normal': !inverter_status.remote_control}"></span></div>
                <div class="flexC_center"><label>就地</label><span :class="{'status_off': !inverter_status.remote_control, 'status_normal': inverter_status.remote_control}"></span></div>
              </div>
              <!-- 按钮 -->
              <!-- <div class="btn_grp">
@@ -257,8 +257,8 @@
              <div class="">
                <el-pagination
                  @current-change="handleCurrentChange"
                  :current-page="1"
                  :page-size="100"
                  :current-page="pageCurr_hisAlarm"
                  :page-size="10"
                  layout="total, prev, pager, next, jumper"
                  :total="drawer_alarm.his_len">
                </el-pagination>
@@ -279,13 +279,26 @@
      <div class="drawer_data_contain">
        <div class="" :class="{'fullScreen': isMaxSize1}">
          <div class="tool_bar clearfix">
            <!-- 筛选条件 -->
            <el-form :inline="true" class="demo-form-inline f_left">
              <el-form-item label="日期">
                <el-date-picker type="date" size="mini" placeholder="选择日期" :clearable="false" value-format="yyyy-MM-dd" v-model="select_date"></el-date-picker>
              </el-form-item>
              <el-form-item>
                <el-button-group>
                  <el-button type="primary" size="mini" @click="search">查询</el-button>
                  <el-button type="primary" size="mini" @click="exportCsv">导出</el-button>
                </el-button-group>
              </el-form-item>
            </el-form>
            <i class="iconfont f_right" :class="{'icon-zuidahua': !isMaxSize1, 'icon-zuidahuahuanyuan': isMaxSize1}" @click="changeSize1"></i>
          </div>
          <div class="wrap_charts">
            <line-chart-mul id="G_drawer_data" ref="G_drawer_data" 
              title="电机加载试验数据归档"
              height="400"
              :max-size='true'
              height="100%"
              :max-size='isMaxSize1'
              :show-xaxis="true"
              :categoryLen="categoryLen2"
              :show-zoom='true'
              :subtext="true"  trigger-on="mousemove"></line-chart-mul>
@@ -355,10 +368,12 @@
      timer: new this.$common.Timeout(),
      timer_nowtime: new this.$common.Timeout(),
      timer_g_control: new this.$common.Timeout(),
      select_date: new Date().format('yyyy-MM-dd'),
      latelyAlarm: '',
      latelyAlarm_num: false,
      categoryLen: 1,
      categoryLen2: 1,
      pageCurr_hisAlarm: 1,
      // 设备列表
      dev_list: [],
      motor_id: 0,
@@ -524,6 +539,7 @@
      drawer_alarm: {
        show: false,
        tableData: [],
        tableDataHis: [],
        his_len: 0
      },
      drawer_data: {
@@ -790,7 +806,9 @@
      });
    }
    ,handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      // console.log(`当前页: ${val}`);
      this.pageCurr_hisAlarm = val;
      this.getHisAlarm();
    }
    ,controlCancel (obj) {
      // console.log('cancel');
@@ -866,7 +884,7 @@
      let param = {
        motor_id: this.motor_id,
        page: {
          pageCurr: 1,
          pageCurr: this.pageCurr_hisAlarm,
          pageSize: 10
        }
      }
@@ -874,6 +892,7 @@
        res = JSON.parse(res.data.result);
        // console.log(res, '-=res');
        let data = [];
        let his_len = 0;
        if (res.code) {
          res.data.forEach((v, i) => {
            data.push({
@@ -884,10 +903,12 @@
              ,index: v.alarm_num
            });
          });
          his_len = res.sum;
        } else {
          console.info(res.msg);
        }
        this.drawer_alarm.tableDataHis = data;
        this.drawer_alarm.his_len = his_len;
      });
    }
    ,showData () {
@@ -925,9 +946,34 @@
    }
    ,changeSize1 () {
      this.isMaxSize1 = !this.isMaxSize1;
      console.log(this.$G.chartManage.get('G_drawer_data'), 63)
      this.$nextTick(() => {
        if (this.$G.chartManage.get('G_drawer_data')) {
          this.$G.chartManage.get('G_drawer_data').resize();
          this.$refs['G_drawer_data'].setOption({
          xLabel: [20191010, 20191011, 20191012, 20191013, 20191014, 20191015, 20191016],
          series: [
            {
                name: '电压',
                unit: 'V',
                data: [120, 132, 101, 134, 90, 230, 210]
            },
            {
                unit: 'A',
                name: '电流',
                data: [220, 182, 191, 234, 290, 330, 310]
            },
            {
                name: '功率',
                unit: 'kW',
                data: [150, 232, 201, 154, 190, 330, 410]
            },
            {
                name: '转速',
                unit: 'rpm',
                data: [320, 332, 301, 334, 390, 330, 320]
            }
          ]
        }).resize();
        }
      });
    }
@@ -935,7 +981,32 @@
      this.isMaxSize2 = !this.isMaxSize2;
      this.$nextTick(() => {
        if (this.$G.chartManage.get('G_drawer_data')) {
          this.$G.chartManage.get('G_drawer_data').resize();
          console.dir(this.$refs['G_drawer_data']);
          this.$refs['G_drawer_data'].setOption({
          xLabel: [20191010, 20191011, 20191012, 20191013, 20191014, 20191015, 20191016],
          series: [
            {
                name: '电压',
                unit: 'V',
                data: [120, 132, 101, 134, 90, 230, 210]
            },
            {
                unit: 'A',
                name: '电流',
                data: [220, 182, 191, 234, 290, 330, 310]
            },
            {
                name: '功率',
                unit: 'kW',
                data: [150, 232, 201, 154, 190, 330, 410]
            },
            {
                name: '转速',
                unit: 'rpm',
                data: [320, 332, 301, 334, 390, 330, 320]
            }
          ]
        }).resize();
        }
      });
    }
@@ -1011,6 +1082,122 @@
        xLabel,
        series
      }
    }
    // 历史曲线 查询
    ,search () {
      /*const reg = /A|B|C|D/;
      reg.test(this.G_title);
      const group = RegExp.lastMatch;
      // console.log(group, this.select_date, 9878);
      this.getHisData(group, this.select_date).then((res) => {
        // console.log(res, 9999);
        this.$refs['G_dialog_id'].setOption(res);
      }).catch(e => {
        this.$refs['G_dialog_id'].setOption(this.format([]));
        console.warn(e);
      });*/
    }
    ,format (data) {
      let xLabel = [],
          series = [],
          data_dccurr = [],
          data_dcvol = [],
          data_controlangle = [],
          data_localgivecurr = [],
          data_localgivevol = [];
      data.forEach((v) => {
        xLabel.push(v.record_time);
        data_dccurr.push(v.dccurr  / 10);
        data_dcvol.push(v.dcvol / 10);
        data_controlangle.push(v.controlangle / 10);
      });
      series.push({
        name: '支路电流',
        unit: 'A',
        data: data_dccurr
      }, {
        name: '支路电压',
        unit: 'V',
        data: data_dcvol
      }, {
        name: '控制角',
        unit: '度',
        data: data_controlangle
      });
      // console.log(xLabel, series);
      return {
        xLabel,
        series
      }
    }
    // 查询历史数据
    ,getHisData (date) {
      /*const param = {
        electric_id: info[group],
        record_time: (date ? date : new Date().format('yyyy-MM-dd')) + " 00:00:00"
      };
      // console.log(param, 'his', info, group);
      // console.trace('getHis_callStack');
      return this.$api.electric.getHisData(param).then((res) => {
        res = JSON.parse(res.data.result);
        if (res.code) {
          return this.format(res.data);
        } else {
          throw res.msg;
        }
      });*/
    }
    ,exportCsv () {
      //json:{"dev_name":"1#蓄电池组","dev_id":"1000004","test_record_count":"1","export_num":"3","table_name":"2020_09_14"}
      //json:{"dev_name":"A套电源","dev_id":"4001","export_num":"4","table_name":"2020_09_24","record_time":"2020-09-24 00:00:00"}
      //json:{"dev_name":"A组电源","dev_id":"6001","export_num":"6","table_name":"2020_09_24","record_time":"2020-09-24 00:00:00"}
      // json:{"dev_name":"电机加载系统","dev_id":"2001","export_num":"2","table_name":"2020_09_25","record_time":"2020-09-25 00:00:00"}
      let param = {
        dev_name: "电机加载系统",
        dev_id: 2001,
        export_num: 2,
        table_name: this.select_date.replace(/-/g, '_'),
        record_time: this.select_date + " 00:00:00"
      };
      console.log(param, 'param');
      this.$axios({
        method: 'post'
        ,url: 'CsvFileDownloadAction!searchDownloadFile'
        ,data: 'json=' + JSON.stringify(param)
        ,timeout: 0
      }).then(res=>{
          res = JSON.parse(res.data.result);
          console.log(res, 'download res');
          if(res.code == 1) {
              // 关闭进度条
              // this.progress.show = false;
              // this.progress.value = 0;
              let data = res.data[0];
              const link = document.createElement("a");
              link.href = encodeURI(this.$config.url + 'tomcat7_csv/' + data.fileName);
              link.download = data.fileName;
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
              setTimeout(()=>{
                  // 关闭进度条
                  // this.progress.show = false;
                  // this.progress.value = 0;
              }, 1000);
          }else {
              // 关闭进度条
              // this.progress.show = false;
              // this.progress.value = 0;
              this.$layer.msg('生成文件失败!');
          }
      }).catch(error=>{
          // 关闭进度条
          // this.progress.show = false;
          // this.progress.value = 0;
          this.$layer.msg('生成文件失败!');
          console.warn(error);
      });
    }
  },
  mounted () {
@@ -1142,8 +1329,13 @@
  .panel_status .p_main .info_list {
    display: -webkit-flex;
    display: flex;
    flex-direction: column;
    /*flex-direction: column;*/
    flex-wrap: wrap;
    justify-content: space-around;
    flex: 1;
  }
  .panel_status .p_main .info_list > div {
    flex: 1;
  }
  .panel_status .p_main .btn_grp {
    flex: auto;
@@ -1159,6 +1351,13 @@
  }
  .info_detail {
    padding: .16rem;
    height: 100px;
    border: 1px #15e3f3 solid;
    margin-bottom: 1em;
  }
  .info_detail span {
    padding-left: .6em;
    color: #ff0;
  }
  .flex_footer {
    flex: 1;
@@ -1200,23 +1399,40 @@
    display: flex;
    flex-direction: column;
    flex: auto;
    padding: 10px;
  }
  .p_data .panel_datas .data_row {
    flex: 1;
    display: -webkit-flex;
    display: flex;
    justify-content: center;
    /*justify-content: center;*/
    align-items: center;
    border: 1px #15e3f3 solid;
    position: relative;
  }
  .p_data .panel_datas .data_row:after {
    content: '';
    position: absolute;
    height: 100%;
    width: 1px;
    top: 0;
    left: 60%;
    background: #15e3f3;
  }
  .p_data .panel_datas .data_row ~ .data_row {
    border-top: 0 none;
  }
  .p_data .panel_datas .data_row label {
    width: 10em;
    text-align: right;
    margin-right: .4em;
    width: 60%;
    text-align: left;
    /*margin-right: .4em;*/
    padding-left: .4em;
  }
  .p_data .panel_datas .data_row span {
    width: 8em;
    /*width: 8em;*/
    padding-left: .4em;
  }
  .p_data ~ div:before {
  /* .p_data ~ div:before {
    content: '';
    position: absolute;
    left: 0;
@@ -1226,7 +1442,7 @@
    background: #15e3f3;
    -webkit-transform: translate(-4px, 0) scaleY(.8);
    transform: translate(-4px, 0) scaleY(.8);
  }
  } */
  .status_item {
    /*flex: 1;*/
    display: -webkit-flex;
@@ -1246,6 +1462,9 @@
    height: 40px;
    margin-left: .4em;
  }
  .info_list span {
    margin-left: 0;
  }
  .p_motor_drawer ._status span {
    width: 36px;
    height: 36px;
@@ -1259,10 +1478,6 @@
  .control_content ._btn_grp span.status_normal,
  .drawer_top ._status span.status_normal,
  .info_list span.status_normal {
    /*background: url(~@/assets/images/light_g.png) 50% 50% / 80% auto no-repeat;*/
    /* background: radial-gradient(circle, #eee 5%, transparent 69%) 20% 20% / 60% 60% no-repeat,
                radial-gradient(circle, #090 60%, transparent 0) 50% 50% / contain no-repeat,
                radial-gradient(circle, #ccc 80%, transparent 0) 50% 50% / contain no-repeat; */
    position: relative;
    background: radial-gradient(circle, #333 20%, transparent 0) 2% 2% / 30% 30% no-repeat,
                radial-gradient(circle, #333 20%, transparent 0) 98% 2% / 30% 30% no-repeat,
@@ -1307,20 +1522,12 @@
  .info_list span.status_error:before {
    background: radial-gradient(circle, #ccc 0%, transparent 69%) 20% 20% / 60% 60% no-repeat,
                #e33;
    /*background: url(~@/assets/images/light_r.png) 50% 50% / 80% auto no-repeat;*/
    /* background: radial-gradient(circle, #ccc 0%, transparent 69%) 20% 20% / 60% 60% no-repeat,
                radial-gradient(circle, #e33 60%, transparent 0) 50% 50% / contain no-repeat,
                radial-gradient(circle, #ccc 80%, transparent 0) 50% 50% / contain no-repeat; */
  }
  .control_content ._btn_grp span.status_off:before,
  .drawer_top ._status span.status_off:before,
  .info_list span.status_off:before {
    background: radial-gradient(circle, #ccc 0%, transparent 69%) 20% 20% / 60% 60% no-repeat,
                #999;
    /*background: url(~@/assets/images/light_off.png) 50% 50% / 80% auto no-repeat;*/
    /* background: radial-gradient(circle, #ccc 0%, transparent 69%) 20% 20% / 60% 60% no-repeat,
                radial-gradient(circle, #999 60%, transparent 0) 50% 50% / contain no-repeat,
                radial-gradient(circle, #ccc 80%, transparent 0) 50% 50% / contain no-repeat; */
  }
  .control_content {
    flex: 3;
@@ -1463,15 +1670,17 @@
    flex-direction: column;
  }
  .drawer_data_contain > * {
    flex: 1;
    /*flex: 1;*/
    height: 50%;
    display: -webkit-flex;
    display: flex;
    flex-direction: column;
  }
  .drawer_data_contain .wrap_charts {
    width: 100%;
    height: auto;
    flex: 1;
    /*height: auto;*/
    height: 100%;
    /*flex: 1;*/
    /*background: rgba(255, 255, 255, .4);*/
    margin: 0 0 10px;
  }
@@ -1486,6 +1695,7 @@
    top: 0;
    right: 0;
    bottom: 0;
    height: auto;
    background: url(~@/assets/images/dw_bg.png) no-repeat;
    z-index: 99;
  }
src/views/rectifier/group.vue
@@ -348,6 +348,7 @@
                title="我是标题"
                height="100%"
                :max-size='true'
                :show-xaxis="true"
                :categoryLen="3"
                :show-zoom='true'
                :subtext="true"  trigger-on="mousemove"></line-chart-mul>
@@ -359,6 +360,7 @@
                title="我是标题"
                height="100%"
                :max-size='true'
                :show-xaxis="true"
                :categoryLen="3"
                :show-zoom='true'
                :subtext="true"  trigger-on="mousemove"></line-chart-mul>
src/views/rectifier/main.vue
@@ -197,13 +197,17 @@
            <el-date-picker type="date" size="mini" placeholder="选择日期" :clearable="false" value-format="yyyy-MM-dd" v-model="select_date"></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="mini" @click="search">查询</el-button>
            <el-button-group>
              <el-button type="primary" size="mini" @click="search">查询</el-button>
              <el-button type="primary" size="mini" @click="exportCsv">导出</el-button>
            </el-button-group>
          </el-form-item>
        </el-form>
        <div class="wrap_G">
          <line-chart-mul id="G_dialog_id" ref="G_dialog_id" 
            title="我是标题"
            height="100%"
            :show-xaxis="true"
            :max-size='true'
            :categoryLen="3"
            :show-zoom='true'
@@ -298,7 +302,7 @@
        <div class="">
          <el-pagination
            @current-change="handleCurrentChange"
            :current-page="1"
            :current-page="pageCurr_hisAlarm"
            :page-size="10"
            layout="total, prev, pager, next, jumper"
            :total="fault_total">
@@ -770,6 +774,61 @@
        }
      });
    }
    ,exportCsv () {
      //json:{"dev_name":"1#蓄电池组","dev_id":"1000004","test_record_count":"1","export_num":"3","table_name":"2020_09_14"}
      //json:{"dev_name":"A套电源","dev_id":"4001","export_num":"4","table_name":"2020_09_24","record_time":"2020-09-24 00:00:00"}
      //json:{"dev_name":"A组电源","dev_id":"6001","export_num":"6","table_name":"2020_09_24","record_time":"2020-09-24 00:00:00"}
      // json:{"dev_name":"电机加载系统","dev_id":"2001","export_num":"2","table_name":"2020_09_25","record_time":"2020-09-25 00:00:00"}
      const reg = /A|B|C|D/;
      reg.test(this.G_title);
      const group = RegExp.lastMatch;
      let param = {
        dev_name: group + "套电源",
        dev_id: info[group],
        export_num: 4,
        table_name: this.select_date.replace(/-/g, '_'),
        record_time: this.select_date + " 00:00:00"
      };
      console.log(param, 'param');
      this.$axios({
        method: 'post'
        ,url: 'CsvFileDownloadAction!searchDownloadFile'
        ,data: 'json=' + JSON.stringify(param)
        ,timeout: 0
      }).then(res=>{
          res = JSON.parse(res.data.result);
          console.log(res, 'download res');
          if(res.code == 1) {
              // 关闭进度条
              // this.progress.show = false;
              // this.progress.value = 0;
              let data = res.data[0];
              const link = document.createElement("a");
              link.href = encodeURI(this.$config.url + 'tomcat7_csv/' + data.fileName);
              link.download = data.fileName;
              document.body.appendChild(link);
              link.click();
              document.body.removeChild(link);
              setTimeout(()=>{
                  // 关闭进度条
                  // this.progress.show = false;
                  // this.progress.value = 0;
              }, 1000);
          }else {
              // 关闭进度条
              // this.progress.show = false;
              // this.progress.value = 0;
              this.$layer.msg('生成文件失败!');
          }
      }).catch(error=>{
          // 关闭进度条
          // this.progress.show = false;
          // this.progress.value = 0;
          this.$layer.msg('生成文件失败!');
          console.warn(error);
      });
    }
    ,searchPower() {
      let list = this.list;
      // 查询后台
@@ -895,7 +954,7 @@
      this.$api.electric.alarmInfo().then((res)=>{
        let rs = JSON.parse(res.data.result);
        if(rs.code == 1) {
          console.log(rs, '0000000000000')
          // console.log(rs, '0000000000000')
          rs.data.forEach((v) => {
            let arr = v.alarm_starttime.split(' ');
            v.alarm_date = arr[0];
@@ -922,7 +981,7 @@
      return this.$api.electric.getHisAlarm(param).then((res) => {
        res = JSON.parse(res.data.result);
        if (res.code) {
          console.log(res, '===res');
          // console.log(res, '===res');
          res.data.forEach((v) => {
            let arr = v.alarm_starttime.split(' ');
            v.alarm_date = arr[0];