<template>
  <div id="main" class="h-all">
    <el-container class="h-all">
      <el-header height="auto">
        <!-- 条件查询工具栏 -->
        <div class="header-search">
          <div class="search-input-box">
            <label>{{$t("Performance.startTime") + '：'}}</label>
            <el-date-picker
              v-model="beginTimestamp"
              type="datetime"
              size="mini"
              format="yyyy-MM-dd HH:mm"
              :clearable="false"
              align="center"
              :picker-options="startDatePicker"
              @change="beginDateChange"
              :placeholder="$t('Performance.startTimePlaceholder')">
            </el-date-picker>
          </div>
          <div class="search-input-box">
            <label>{{$t("Performance.endTime") + '：'}}</label>
            <el-date-picker
              v-model="endTimestamp"
              type="datetime"
              size="mini"
              format="yyyy-MM-dd HH:mm"
              :clearable="false"
              align="center"
              :picker-options="endDatePicker"
              @change="endDateChange"
              :placeholder="$t('Performance.endTimePlaceholder')">
            </el-date-picker>
          </div>
          <div class="search-input-box">
            <label>{{$t("Performance.performanceEvent") + '：'}}</label>
            <el-select v-model="queryPerformType" multiple multiple-limit="5" collapse-tags size="mini" :placeholder="$t('common.selectOption')" :clearable="true">
              <el-option
                v-for="item in performTypeList"
                :key="item.deviceParam"
                :label="item.peformTypeName"
                :value="item.deviceParam">
              </el-option>
            </el-select>
          </div>
          <div class="search-input-box">
            <label>{{$t("Performance.networkElementType") + '：'}}</label>
            <el-select v-model="queryDeviceType"
                       size="mini" :placeholder="$t('common.selectOption')"
                       @change="deviceTypeChange"
                       @clear="deviceModelChange"
                       :clearable="true">
              <el-option
                v-for="item in deviceTypeList"
                :key="item.deviceTypeKey"
                :label="item.deviceTypeName"
                :value="item.deviceTypeKey">
              </el-option>
            </el-select>
          </div>
          <div class="search-input-box">
            <label>{{$t("Performance.deviceModel") + '：'}}</label>
            <el-select v-model="queryDeviceModel" size="mini" :placeholder="$t('common.selectOption')" :clearable="true">
              <el-option v-for="item in deviceModelList1"
                         :key="item.deviceModelKey"
                         :label="item.deviceModel"
                         :value="item.deviceModel">
              </el-option>
            </el-select>
          </div>
          <div class="search-input-box">
            <label>{{$t("Performance.subnet") + '：'}}</label>
            <el-select v-model="querySubnet" size="mini" :placeholder="$t('common.selectOption')" :clearable="true">
              <el-option
                v-for="item in subnetList"
                :key="item.subnetKey"
                :label="item.subnetName"
                :value="item.subnetKey">
              </el-option>
            </el-select>
          </div>
          <div class="search-input-box">
            <label>{{$t("Performance.TopNum") + '：'}}</label>
            <el-input-number v-model="num" style="width:200px" :clearable="false" :min='1' :max='100' :step=10 size="mini" controls-position="right"></el-input-number>
          </div>
          <div class="search-input-box">
            <el-button size='mini' icon="el-icon-search" type="primary" @click="queryPerformDataByCondition">{{$t("common.queryBtn")}}</el-button>
            <el-button size='mini' icon="el-icon-download" type="success" @click="exportToExcelInit">{{$t("common.exportBtn")}}</el-button>
          </div>
        </div>
      </el-header>
      <!-- table数据表格 -->
      <el-main class="adapt-height-box">
        <el-table
          :empty-text="$t('common.noData')"
          ref="multipleTable"
          :data="performList"
          header-row-class-name="table-header"
          cell-class-name="table-cell"
          class="adapt-height"
          stripe
          tooltip-effect="dark"
          :highlight-current-row="true"
          height="auto"
          border
          @selection-change="handleSelectionChange">
          <el-table-column
            type="index"
            v-if="showFlag"
            :label="$t('Performance.index')"
            width="50">
          </el-table-column>
          <el-table-column
            v-for="(item, index) in tableLabel"
            :key="index"
            :show-overflow-tooltip="true"
            :prop="item.prop"
            :width="item.width"
            :label="item.label">
          </el-table-column>
        </el-table>
<!--        <el-pagination-->
<!--          background-->
<!--          @current-change="handleCurrentChange"-->
<!--          :current-page.sync="currentPage"-->
<!--          :page-size="pageSize"-->
<!--          layout="total, prev, pager, next, jumper"-->
<!--          :total="total">-->
<!--        </el-pagination>-->
      </el-main>
    </el-container>
  </div>
</template>

<script>
import DeviceService from '../../domain/services/DeviceService'
import PerformanceMonitorService from '../../domain/services/PerformanceMonitorService'
import PerformanceDataQuaryService from '../../domain/services/PerformanceDataQuaryService'
import DeviceManager from '../../domain/models/DeviceManager'
import HelperUtil from '../../utils/HelperUtil'
import loading from '../../utils/Loading'
import SubnetService from '../../domain/services/SubnetService'
import legitimacyCheck from "../../utils/legitimacyCheck";

export default {
  name: 'TopNPerformanceReport',
  created: function () {
    this.check = legitimacyCheck()
    this.setDefaultDateTime()
    this.getAllSubnetInit()
    this.getAllDevice()
    this.getAllPerformType()
    this.getAllDeviceModel()
    this.getAllDeviceType()
  },

  // 存放数据
  data: function () {
    return {
      beginTimestamp: '', // 开始时间
      endTimestamp: '', // 结束时间
      addBeginTimestamp: '00.000', // 查询开始时间默认添加
      addEndTimestamp: '59.999', // 查询结束时间默认添加
      startDatePicker: this.beginDate(),
      endDatePicker: this.endDate(),

      // 查询条件控件
      queryDeviceOptions: [], // 设备名称
      queryDeviceShow: false, // 设备名称选择器是否禁用
      deviceKey: '', // 设备ID（对应设备名称）（下拉列表）
      deviceTypeKey: '',
      deviceParam: '',
      deviceCollection: {}, // 设备collection

      performTypeList: [],
      performTypeList1: [], // 全部性能事件
      performTypeCollection: {},
      queryPerformTypeOptions: [], // 性能事件选项
      queryDeviceType: '',
      queryDeviceModel: '',
      queryDeviceList: '',
      queryPerformType: '',
      querySubnet: '',
      num: 20,
      check: null,
      showFlag: false,
      tableLabel: [],
      headList: [
        'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'
      ],

      // 双向绑定展示数据
      showList: [],
      performList: [],
      subnetList: [],
      // 查询条件List
      selectList: [],
      deviceList: [],
      deviceList1: [], // 设备列表
      deviceTypeList: [],
      deviceModelList: [],
      deviceModelList1: [],

      // 多选分页控制
      multipleSelection: [],
      beginItem: 1,
      endItem: 100,
      total: 0,
      currentPage: 1,
      pageSize: 100
    }
  },
  methods: {
    /**
     * @Description  : deviceTypeChange
     * @author       : ls
     * @date         : 2020/11/17 14:57
     * @param        :
     * @return       :
     */
    deviceTypeChange: function () {
      var a = HelperUtil.deviceTypeChange(this.deviceModelList, this.queryDeviceType, this.queryDeviceModel)
      this.deviceModelList1 = a[0]
      this.queryDeviceModel = a[1]
    },
    /**
     * @Description  : deviceModelChange
     * @author       : ls
     * @date         : 2020/11/11 12:06
     * @param        :
     * @return       :
     */
    deviceModelChange: function () {
      this.deviceModelList1 = this.deviceModelList
    },
    /***
       * @Description  : 检测时间合法
       * @author       : zf
       * @date         : 2019/1/21 13:37
       */
    // 设置禁止选择当前日期之后的时间，且开始时间小于结束时间
    beginDate: function () {
      let self = this
      return {
        disabledDate (time) {
          return time.getTime() > self.endTimestamp.getTime() || time.getTime() > Date.now()
        }
      }
    },
    // 结束时间必须大于开始时间
    endDate: function () {
      let self = this
      return {
        disabledDate (time) {
          return time.getTime() < (self.beginTimestamp.getTime() - 1000 * 3600 * 24) || time.getTime() > Date.now()
        }
      }
    },
    // 开始时间被清空后重新赋值
    beginDateChange: function () {
      const setTimes = new Date()
      if (this.beginTimestamp === null) {
        setTimes.setTime(this.endTimestamp.getTime() - (60 * 60 * 1000))
        this.beginTimestamp = setTimes
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.START_TIME_EMPTY_CODE))
      }
      if (this.beginTimestamp > this.endTimestamp) {
        setTimes.setTime(this.endTimestamp.getTime() - (60 * 60 * 1000))
        this.beginTimestamp = setTimes
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.START_END_TIME_CODE))
      }
      // if ((this.endTimestamp.getTime() - this.beginTimestamp.getTime()) > 24 * 60 * 60 * 1000) {
      //   setTimes.setTime(this.beginTimestamp.getTime() + (24 * 60 * 60 * 1000));
      //   this.endTimestamp = setTimes;
      //   this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.PERIOD_TIME_CODE))
      // }
    },
    // 结束时间被清空后重新赋值
    endDateChange: function () {
      const setTimes = new Date()
      const curTimes = new Date()
      if (this.endTimestamp === null) {
        if ((this.beginTimestamp.getTime() + (60 * 60 * 1000)) > curTimes.getTime()) {
          this.endTimestamp = curTimes
        } else {
          setTimes.setTime(this.beginTimestamp.getTime() + (60 * 60 * 1000))
          this.endTimestamp = setTimes
        }
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.END_TIME_EMPTY_CODE))
      }
      if (this.endTimestamp < this.beginTimestamp) {
        if ((this.beginTimestamp.getTime() + (60 * 60 * 1000)) > curTimes.getTime()) {
          this.endTimestamp = curTimes
        } else {
          setTimes.setTime(this.beginTimestamp.getTime() + (60 * 60 * 1000))
          this.endTimestamp = setTimes
        }
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.START_END_TIME_CODE))
      }
      if (this.endTimestamp > curTimes) {
        if ((this.beginTimestamp.getTime() + (60 * 60 * 1000)) > curTimes.getTime()) {
          this.endTimestamp = curTimes
        } else {
          setTimes.setTime(this.beginTimestamp.getTime() + (60 * 60 * 1000))
          this.endTimestamp = setTimes
        }
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.END_TIME_CURRENT_CODE))
      }
      // if ((this.endTimestamp.getTime() - this.beginTimestamp.getTime()) >  24 * 3600 * 1000) {
      //   setTimes.setTime(this.endTimestamp.getTime() - (24 * 60 * 60 * 1000));
      //   this.beginTimestamp = setTimes;
      //   this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.PERIOD_TIME_CODE))
      // }
    },
    /**
     * @Description  : 格式化时间
     * @author       : ls
     * @date         : 2020/6/25 9:40
     * @param        :
     * @return       :
     */
    formatDate: function (row) {
      return HelperUtil.timeTran(row.timestamp)
    },

    /***
       * @Description  : 网元类型下拉列表切换时联动网元名称和性能事件
       * @author       : zyh
       * @date         : 2020/1/6
       */
    changeNodeType1: function () {
      this.queryDeviceList = ''
      this.queryPerformType = ''
      this.queryDeviceOptions = []

      let DevMgr = DeviceManager(this.deviceCollection)
      this.queryDeviceOptions = Object.values(DevMgr.getInUsingDeviceList())
      this.queryDeviceShow = false

      this.deviceList1 = []
      this.performTypeList1 = []
      for (var i = 0; i < this.queryDeviceOptions.length; i++) {
        if (this.queryDeviceType === this.queryDeviceOptions[i]['deviceTypeKey']) {
          this.deviceList1.push(this.queryDeviceOptions[i])
        }
        if (this.queryDeviceType === null || this.queryDeviceType === '') {
          this.deviceList1.push(this.queryDeviceOptions[i])
        }
      }
      for (var j = 0; j < this.performTypeList.length; j++) {
        if (this.queryDeviceType === this.performTypeList[j]['deviceTypeKey']) {
          this.performTypeList1.push(this.performTypeList[j])
        }
      }
    },
    /***
       * @Description  : 获取默认时间
       * @author       : zf
       * @date         : 2019/1/4 11:32
       */
    setDefaultDateTime: function () {
      const start = new Date()
      const end = new Date()
      start.setTime(start.getTime() - 3600 * 1000)
      this.beginTimestamp = start
      this.endTimestamp = end
    },
    /**
     * @description   : 获取网元类型
     * @author        : ls
     * @date          : 2020/7/4 15:11
     * @param         :
     * @return        :
     **/
    getAllDeviceType: function () {
      let _this = this
      DeviceService.getAllDeviceTypeCollection().then(result => {
        _this.deviceTypeList = Object.values(result)
      }).catch(err => {
        _this.InfoTip.errorTip(_this, err)
      })
    },
    /**
       * @description   : 获取子网
       * @author        : ls
       * @date          : 2020/6/22 20:52
       * @param         :
       * @return        :
       **/
    getAllSubnetInit: function () {
      let _this = this
      let loadingInstance = loading.openLoading()
      SubnetService.getAllSubnetCollection().then(result => {
        _this.subnetList = Object.values(result)
        loadingInstance.close()
      }).catch(err => {
        this.InfoTip.errorTip(this, err)
        loadingInstance.close()
      })
    },
    /***
       * @Description  : 设备/服务器下拉列表
       * @author       : zf
       * @date         : 2018/12/24 11:29
       */
    getAllDevice: function () {
      let _this = this
      this.deviceList1 = []
      DeviceService.getAllDeviceCollection().then(result => {
        // 成功
        _this.deviceCollection = result
        _this.deviceList = Object.values(result) // 新加字段，用于formatter查询数据表格
        let DevMgr = DeviceManager(_this.deviceCollection)
        _this.queryDeviceOptions = Object.values(DevMgr.getInUsingDeviceList())
        _this.deviceList1 = Object.values(DevMgr.getInUsingDeviceList())
      }).catch(err => {
        // 失败
        _this.InfoTip.errorTip(_this, err)
      })
    },

    /***
       * @Description  : 获取全部性能事件
       * @author       : zf
       * @date         : 2019/03/29 23:09
       */
    getAllPerformType: function () {
      let _this = this
      PerformanceMonitorService.getAllPerformanceTypeCollection().then(result => {
        // 成功
        _this.performTypeList = Object.values(result)
      }).catch(err => {
        // 失败
        _this.InfoTip.errorTip(_this, err)
      })
    },
    /**
     * @Description  : 获取型号
     * @author       : ls
     * @date         : 2020/6/24 14:49
     * @param        :
     * @return       :
     */
    getAllDeviceModel: function () {
      let _this = this
      DeviceService.getAllDeviceModelCollection().then(result => {
        _this.deviceModelList = Object.values(result)
      }).catch(err => {
        _this.InfoTip.errorTip(_this, err)
      })
    },

    /* ---------------------------查询功能实现--------------------------- */

    /***
       * @Description  : 获取查询条件列表
       * @author       : zf
       * @date         : 2019/1/4 11:29
       */
    setQuerySelectList: function () {
      this.selectList = []
      if (this.beginTimestamp !== '' && this.beginTimestamp !== null) {
        this.selectList.push({
          quaryAttribute: 'timestamp',
          compareSymbol: '>=',
          compareValue: HelperUtil.getTimeInit(this.beginTimestamp) + this.addBeginTimestamp
        })
      }
      if (this.endTimestamp !== '' && this.endTimestamp !== null) {
        this.selectList.push({
          quaryAttribute: 'timestamp',
          compareSymbol: '<=',
          compareValue: HelperUtil.getTimeInit(this.endTimestamp) + this.addEndTimestamp
        })
      }
      if (this.queryPerformType !== '' && this.queryPerformType !== null) {
        this.selectList.push({
          quaryAttribute: 'deviceParam',
          compareSymbol: 'in',
          compareValue: this.queryPerformType
        })
      }
      if (this.queryDeviceModel !== '' && this.queryDeviceModel !== null) {
        this.selectList.push({
          quaryAttribute: 'deviceModel',
          compareSymbol: '=',
          compareValue: this.queryDeviceModel
        })
      }
      if (this.queryDeviceType !== '' && this.queryDeviceType !== null) {
        this.selectList.push({
          quaryAttribute: 'deviceTypeKey',
          compareSymbol: '=',
          compareValue: this.queryDeviceType
        })
      }
      if (this.querySubnet !== '' && this.querySubnet !== null) {
        this.selectList.push({
          quaryAttribute: 'subnetKey',
          compareSymbol: '=',
          compareValue: this.querySubnet
        })
      }
    },
    /**
     * @Description  : 性能校验
     * @author       : ls
     * @date         : 2020/6/29 10:05
     * @param        :
     * @return       :
     */
    performTypeCheck: function () {
      var result = this.check.textNullCheck(this.queryPerformType)
      if (!result) {
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.TEXT_NULL_CODE), this.$t('Performance.performanceEvent'))
        return false
      }
      return true
    },
    /**
     * @Description  : 网元类型
     * @author       : ls
     * @date         : 2020/6/29 10:10
     * @param        :
     * @return       :
     */
    deviceTypeCheck: function () {
      var result = this.check.textNullCheck(this.queryDeviceType)
      if (!result) {
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.TEXT_NULL_CODE), this.$t('Performance.networkElementType'))
        return false
      }
      return true
    },
    /**
     * @Description  : topNum校验
     * @author       : ls
     * @date         : 2020/6/29 10:13
     * @param        :
     * @return       :
     */
    topNNumCheck: function () {
      if (this.num === undefined) {
        this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.TEXT_NULL_CODE), this.$t('Performance.TopNum'))
        return false
      }
      return true
    },
    /**
     * @Description  : 校验
     * @author       : ls
     * @date         : 2020/6/29 10:04
     * @param        :
     * @return       :
     */
    totalCheck: function () {
      if (!this.performTypeCheck()) {
        return false
      }
      if (!this.deviceTypeCheck()) {
        return false
      }
      if (!this.topNNumCheck()) {
        return false
      }
      return true
    },
    /***
       * @Description  : 当前页面变化获取新的性能List
       * @author       : zf
       * @date         : 2018/12/20 20:12
       */
    handleCurrentChange (val) {
      this.currentPage = val
      this.beginItem = ((val - 1) * 100) + 1
      this.endItem = this.beginItem + 99
      if (this.endItem > this.total) {
        this.endItem = this.total
      }
      this.queryPerformDataByConditionCurrentPage()
    },
    /**
     * @Description  : 条件查询
     * @author       : ls
     * @date         : 2020/6/29 10:37
     * @param        :
     * @return       :
     */
    queryPerformDataByCondition: function () {
      if (!this.totalCheck()) {
        return
      }
      let _this = this
      _this.setQuerySelectList()
      let loadingInstance = _this.Loading.openLoading()
      PerformanceDataQuaryService.queryPerformDataNumber(this.num, this.selectList).then(result => {
        if (result.length === 0) {
          _this.showFlag = false
          _this.performList = []
          _this.tableLabel = []
          _this.InfoTip.warningTip_alarm(_this, HelperUtil.getCheckStatusCodeObjectByCode(_this.successCode.QUERY_NULL_CODE))
        } else {
          _this.showFlag = true
          _this.showList = result
          _this.handleTableLabelInit()
          _this.handleShowList()
          _this.InfoTip.successTip(_this, HelperUtil.getStatusCodeObjectByCode(_this.successCode.QUERY_CODE))
        }
        _this.Loading.closeLoading(loadingInstance)
      }).catch(err => {
        _this.Loading.closeLoading(loadingInstance)
        _this.InfoTip.errorTip(_this, err)
      })
    },
    /**
     * @Description  : 数据处理
     * @author       : ls
     * @date         : 2020/6/30 15:05
     * @param        :
     * @return       :
     */
    handleShowList: function () {
      this.performList = []
      for (let i = 0; i < this.showList.length; i++) {
        var obj1 = {}
        var obj2 = {}
        var flag = false
        for (let j = 0; j < this.showList[0].length; j++) {
          var obj = {}
          obj[this.headList[j * 3]] = this.showList[i][j].deviceName
          obj[this.headList[j * 3 + 1]] = HelperUtil.timeTran(this.showList[i][j].timestamp)
          obj[this.headList[j * 3 + 2]] = this.showList[i][j].value
          obj2 = Object.assign(obj2, obj)
          if (j === (this.showList[0].length - 1)) {
            flag = true
          }
        }
        obj1 = Object.assign(obj1, obj2)
        if (flag) {
          this.performList.push(obj1)
        }
      }
    },
    /**
     * @Description  : 初始化
     * @author       : ls
     * @date         : 2020/6/30 12:02
     * @param        :
     * @return       :
     */
    handleTableLabelInit: function () {
      let showHeadInit = this.showList[0]
      this.tableLabel = []
      for (let i = 0; i < showHeadInit.length * 3; i++) {
        if (i % 3 === 0) {
          this.tableLabel.push(
            {
              prop: this.headList[i],
              width: '',
              label: this.$t('Performance.networkElementName')
            }
          )
        } else if (i % 3 === 1) {
          this.tableLabel.push(
            {
              prop: this.headList[i],
              width: '',
              label: this.$t('Performance.acquisitionTime')
            }
          )
        } else {
          this.tableLabel.push(
            {
              prop: this.headList[i],
              width: '',
              label: showHeadInit[(i + 1) / 3 - 1].deviceParam
            }
          )
        }
      }
    },
    /**
     * @Description  : 条件查询
     * @author       : ls
     * @date         : 2020/6/29 10:03
     * @param        :
     * @return       :
     */
    queryPerformDataByCondition1: function () {
      if (!this.totalCheck()) {
        return
      }
      this.beginItem = 1
      this.performList = []
      // this.nodeTypeDefineTable();
      this.setQuerySelectList()
      this.queryPerformDataTotalNumber()
    },

    /***
       * @Description  : 按条件查询性能数据总条数
       * @author       : zf
       * @date         : 2018/12/13 16:37
       */
    queryPerformDataTotalNumber: function () {
      let _this = this
      let loadingInstance = _this.Loading.openLoading()
      PerformanceDataQuaryService.queryTopNPerformDataTotalNumber(this.num, this.selectList).then(result => {
        // 成功
        _this.Loading.closeLoading(loadingInstance)
        _this.total = result
        if (_this.total === 0 || _this.total < 0) {
          _this.InfoTip.warningTip_alarm(this, HelperUtil.getCheckStatusCodeObjectByCode(this.successCode.QUERY_NULL_CODE))
        } else {
          if (_this.total < 100 && _this.total > 0) {
            _this.endItem = _this.total
          } else {
            _this.endItem = 100
          }
        }
        _this.queryPerformDataByConditionCurrentPage()
      }).catch(err => {
        // 失败
        _this.endItem = 100
        _this.Loading.closeLoading(loadingInstance)
        _this.InfoTip.errorTip(_this, err)
      })
    },

    /***
       * @Description  : 获取当前分页性能列表
       * @author       : zf
       * @date         : 2018/12/20 20:17
       */
    queryPerformDataByConditionCurrentPage: function () {
      let _this = this
      let loadingInstance = _this.Loading.openLoading()
      PerformanceDataQuaryService.queryTopNPerformDataSplitNumber(this.beginItem, this.endItem, this.selectList).then(result => {
        // 成功
        _this.performList = Object.values(result)
        _this.Loading.closeLoading(loadingInstance)
      }).catch(err => {
        // 失败
        _this.Loading.closeLoading(loadingInstance)
        _this.InfoTip.errorTip(_this, err)
      })
    },

    /* ---------------------------导出功能实现--------------------------- */

    /**
       * @Description  ：导出文件
       */
    exportToExcelInit: function () {
      this.setQuerySelectList()
      let _this = this
      let loadingInstance = _this.Loading.openLoading()
      PerformanceDataQuaryService.topNExportToExcel(this.selectList).then(result => {
        // 成功
        _this.Loading.closeLoading(loadingInstance)
      }).catch(err => {
        // 失败
        _this.Loading.closeLoading(loadingInstance)
        _this.InfoTip.errorTip(_this, err)
      })
    },

    /* ---------------------------留用--------------------------- */

    /***
       * @Description  : 多选框变化：未用
       * @author       : zf
       * @date         : 2019/1/4 11:33
       */
    handleSelectionChange (val) {
      this.multipleSelection = val
    }
  },

  computed: {},

  watch: {
    '$i18n.locale' () {

    }
  }
}
</script>

<style scoped>
</style>
