// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Axios from 'axios'
import App from './App'
import router from './router'
import store from './store.js'
import ElementUI from 'element-ui'
import Echarts from 'echarts'
import Vcharts from 'v-charts'
import 'element-ui/lib/theme-chalk/index.css'
import 'jquery'
import '../static/font/iconfont.js'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min'
import VueResource from 'vue-resource'
import 'font-awesome/scss/font-awesome.scss'
// import './assets/css/reset.css'
// import './assets/css/common.css'
import VueScroll from 'vuescroll'
import 'vuescroll/dist/vuescroll.css'
import './directives.js'
import HelperUtil from './utils/HelperUtil'
import InfoTip from './utils/InfoTip'
import Loading from './utils/Loading'
import SystemModeAdapter from './domain/SystemModeAdapter'
import * as constantCollection from './utils/constantCollection'
import {
  PARAM_NOT_NULL,
  SELECT_ONLY_ONE,
  NOT_EQUAL,
  STOP_TASK_CODE,
  START_SELECT_CODE,
  STOP_SELECT_CODE,
  QUERY_CODE,
  ADD_CODE,
  DELETE_CODE,
  MODIFY_CODE,
  OTHERS_CODE,
  IPCHECK_CODE,
  LENGTH_CODE,
  LENGTH_CODE_FOR_CONFFILENAME,
  DIGIT_CODE,
  TEXT_NULL_CODE,
  STRING_NULL_CODE,
  DATE_CODE,
  CYCLE_CODE,
  START_END_TIME_CODE,
  PERIOD_TIME_CODE,
  POSITIVE_NUMBER_CODE,
  PHONE_CODE,
  PASSWORD_CODE,
  PORT_NUMBER_CODE,
  PASSWORD_SAME_CODE,
  LIST_SAME_CODE,
  STRUCTURE_SAME_CODE,
  DELETE_SELECT_CODE,
  COPY_SELECT_CODE,
  // ENABLED_SELECT_CODE,
  // ENABLED_ONLY_ONE_CODE,
  COPY_ONLY_ONE_CODE,
  UPDATE_SELECT_CODE,
  UPDATE_ONLY_ONE_CODE,
  QUERY_NULL_CODE,
  CHOOSE_UPLOADFILE_CODE,
  UPLOADFILE_FORMAT_CODE,
  UPLOADFILE_SIZE_CODE,
  CABINET_BELONG_LOCATION_CODE,
  UNUPDATE_CODE,
  UPDATE_LIMIT_CODE,
  CONFIRM_ONLY_ONE_CODE,
  OLD_PWD_CODE,
  NEW_PWD_CODE,
  DIFFERENT_PWD_CODE,
  RENEW_PWD_CODE,
  START_TIME_EMPTY_CODE,
  END_TIME_CURRENT_CODE,
  PERIOD_SET_CODE,
  LIMITS_SET_CODE,
  PERIOD_AND_LIMITS_SET_CODE,
  END_TIME_EMPTY_CODE,
  STATISTICS_RESULT_EMPTY_CODE,
  COLOR_SAME_CODE,

  UNLOCKED_CODE,
  LOCKED_CODE,
  PLEASE_SELECT_AT_LEASE_ONE_CONFIGURATION_FILE_TO_UPLOAD,
  PLEASE_SELECT_AT_LEASE_ONE_DEVICE_TO_UPDATE_CONFIGURATION,
  PLEASE_SELECT_AT_LEASE_ONE_DEVICE_TO_QUERY_CONFIGURATION_HISTORY,
  PLEASE_SELECT_ONE_RECORD_TO_DOWNLOAD,
  PLEASE_SELECT_AT_LEASE_ONE_DEVICE,
  PLEASE_SELECT_ONLY_ONE_DEVICE,
  PLEASE_SELECT_AT_LEASE_ONE_CONFIGURATION,
  PLEASE_SELECT_ONLY_ONE_CONFIGURATION,
  UPLOAD_FILES_CAN_ONLY_BE_IN_CONF_FORMAT,
  UPLOAD_FILES_CAN_ONLY_BE_IN_BIN_FORMAT,
  PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_CLEAR,
  PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_DELETE,
  PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_CONFIRM,
  SYSTEM_EXIT_CODE,
  DELETE_CONFIRM,
  SAFEDATA_DELETE,
  RECOVER_CONFIRM,
  SNAPSHOT_RECOVER_SUCCESS,
  LINK_PROTOCOL,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_DOWNLOAD,
  PLEASE_SELECT_ONLY_ONE_DEVICE_DATA_TO_UPDATE_THE_CONFIGURATION,
  PLEASE_SELECT_ONLY_ONE_DEVICE_DATA_FOR_CONFIGURATION_HISTORY_QUERY,
  START_DEVICE_PORT_BETWEEN_0_99,
  END_DEVICE_PORT_BETWEEN_0_99,
  PORT_ENTERED_MUST_BE_LESS_THAN_99,
  PLEASE_ENTER_VALID_NUMBER,
  PLEASE_ENTER_VALID_DEVICE_IP_ADDRESS,
  PLEASE_ENTER_VALID_TIME,

  SERVICE_TYPE_NAME_CANNOT_BE_EMPTY,
  SERVICE_TYPE_ID_CANNOT_BE_EMPTY,
  PLEASE_SELECT_ONE_RECORD_TO_MODIFY,
  PLEASE_SELECT_ONE_RECORD_TO_DELETE,
  SERVICE_SUBNET_ID_CANNOT_BE_EMPTY,
  SERVICE_SUBNET_NAME_CANNOT_BE_EMPTY,
  SERVICE_TOPOLOGY_TYPE_CANNOT_BE_EMPTY,
  SERVICE_TYPE_CANNOT_BE_EMPTY,
  ARE_YOU_SURE_TO_DELETE_THIS_RECORD,
  PLEASE_SELECT_AT_LEAST_ONE_DEVICE,
  PLEASE_ENTER_A_VALID_NUMBER,
  PLEASE_ENTER_A_VALID_PORT_ID,
  MODIFICATION_OF_SERVICE_SUBNET,
  DUPLICATE_SERVICE_SUBNET,
  PLEASE_SELECT_A_SCHEDULING_TYPE,
  PLEASE_ENTER_A_VALID_CDP_PROFILE_NAME,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_MODIFY,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_DELETE,
  SELECT_ONE_SUBNET,
  ADD_THE_DEVICE_TO_SUBNET,
  REMOVE_THE_DEVICE_FROM_SUBNET,
  PLEASE_DO_NOT_ENTER_A_DUPLICATE_PORT_ID,
  PLEASE_SELECT_ONE_RECORD_TO_DUPLICATE,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_DUPLICATE,
  PLEASE_ENTER_A_VALID_BANDWIDTH,
  HAVE_NO_AFFILIATD_DEVICE,
  MODIFY_PERSONERLY_INFORMATION,
  CORRECT_IP_ORDER,
  NOT_IN_SAME_INTERVAL, SERVER_CODE, MODIFY_AUTHORITY_TO_LOGIN, MODIFY_PWD_TO_LOGIN, MODIFY_USER_TO_LOGIN,
  DELETE_USER_TO_LOGIN, SAME_USER_TO_LOGIN, SAVE_SELECT_CODE, SAVE_ONLY_ONE_CODE, PLEASE_SELECT_AT_LEAST_ONE_SAVE_OPTIONS,

  PORT_BETWEEN_0_99,
  ENABLE_SELECT_CODE,
  DISABLE_SELECT_CODE,
  ENABLE_CODE,
  DISABLE_CODE,
  ENABLE_CONFIRM,
  DISABLE_CONFIRM,
  DELETE_STATUS_CODE,
  START_DEVICE_PORT_NUM,
  END_DEVICE_PORT_NUM
} from './utils/constantCollection'
// mount with global
import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'
/* 国际化 */
import VueI18n from 'vue-i18n'
import myEnLocale from './assets/lang/en.js'
import myZhLocale from './assets/lang/zh-cn.js'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'

/* pl-table 的引入，解决大数据 table 卡顿的问题*/
import plTable from 'pl-table'
import 'pl-table/themes/index.css' // 引入样式（必须引入)，vuecli3.0不需要配置，cli2.0请查看webpack是否配置了url-loader对woff，ttf文件的引用,不配置会报错哦

import './assets/css/reset.css'
import './assets/css/common.css'
/*引入vue2-svg-icon并且注册组件*/
import Icon from 'vue2-svg-icon/Icon'
Vue.component('icon', Icon)


Vue.use(contentmenu);
Vue.config.productionTip = false;
Vue.config.devtools = true;
Vue.use(ElementUI);
Vue.use(VueResource);
Vue.use(Echarts);
Vue.use(Vcharts);

Vue.use(plTable);


Vue.prototype.InfoTip = InfoTip
Vue.prototype.Loading = Loading
let code = {
  ALARM_DELETE: constantCollection.ALARM_DELETE,
  INDEX_TEMPLATE: constantCollection.INDEX_TEMPLATE,
  DATA_MONITOR: constantCollection.DATA_MONITOR,
  IP_ERROR: constantCollection.IP_ERROR,
  PARAM_NOT_NULL: constantCollection.PARAM_NOT_NULL,
  SELECT_ONLY_ONE: constantCollection.SELECT_ONLY_ONE,
  NOT_EQUAL: constantCollection.NOT_EQUAL,
  STOP_TASK_CODE: constantCollection.STOP_TASK_CODE,
  STOP_REPORT_TASK_CODE: constantCollection.STOP_REPORT_TASK_CODE,
  START_SELECT_CODE: constantCollection.START_SELECT_CODE,
  STOP_SELECT_CODE: constantCollection.STOP_SELECT_CODE,
  QUERY_CODE: constantCollection.QUERY_CODE,
  ADD_CODE: constantCollection.ADD_CODE,
  DELETE_CODE: constantCollection.DELETE_CODE,
  MODIFY_CODE: constantCollection.MODIFY_CODE,
  OTHERS_CODE: constantCollection.OTHERS_CODE,
  UNLOCKED_CODE: constantCollection.UNLOCKED_CODE,
  LOCKED_CODE: constantCollection.LOCKED_CODE,

  IPCHECK_CODE: constantCollection.IPCHECK_CODE,
  LENGTH_CODE: constantCollection.LENGTH_CODE,
  PLEASE_SELECT_AT_LEAST_ONE_SAVE_OPTIONS: constantCollection.PLEASE_SELECT_AT_LEAST_ONE_SAVE_OPTIONS, // ls 2019/09/11/快照备份提示信息
  LINK_PROTOCOL: constantCollection.LINK_PROTOCOL,
  LENGTH_CODE_FOR_CONFFILENAME: constantCollection.LENGTH_CODE_FOR_CONFFILENAME,
  DIGIT_CODE: constantCollection.DIGIT_CODE,
  TEXT_NULL_CODE: constantCollection.TEXT_NULL_CODE,
  STRING_NULL_CODE: constantCollection.STRING_NULL_CODE,
  DATE_CODE: constantCollection.DATE_CODE,
  CYCLE_CODE: constantCollection.CYCLE_CODE,
  START_END_TIME_CODE: constantCollection.START_END_TIME_CODE,
  PERIOD_TIME_CODE: constantCollection.PERIOD_TIME_CODE,
  POSITIVE_NUMBER_CODE: constantCollection.POSITIVE_NUMBER_CODE,
  PHONE_CODE: constantCollection.PHONE_CODE,
  PASSWORD_CODE: constantCollection.PASSWORD_CODE,
  PORT_NUMBER_CODE: constantCollection.PORT_NUMBER_CODE,
  PASSWORD_SAME_CODE: constantCollection.PASSWORD_SAME_CODE,
  LIST_SAME_CODE: constantCollection.LIST_SAME_CODE,
  STRUCTURE_SAME_CODE: constantCollection.STRUCTURE_SAME_CODE,
  DELETE_SELECT_CODE: constantCollection.DELETE_SELECT_CODE,
  COPY_SELECT_CODE: constantCollection.COPY_SELECT_CODE,
  COPY_ONLY_ONE_CODE: constantCollection.COPY_ONLY_ONE_CODE,
  // ENABLED_SELECT_CODE: constantCollection.ENABLED_SELECT_CODE,
  // ENABLED_ONLY_ONE_CODE: constantCollection.ENABLED_ONLY_ONE_CODE,
  UPDATE_SELECT_CODE: constantCollection.UPDATE_SELECT_CODE,
  UPDATE_ONLY_ONE_CODE: constantCollection.UPDATE_ONLY_ONE_CODE,
  SAVE_SELECT_CODE: constantCollection.SAVE_SELECT_CODE,
  SAVE_ONLY_ONE_CODE: constantCollection.SAVE_ONLY_ONE_CODE,
  QUERY_NULL_CODE: constantCollection.QUERY_NULL_CODE,
  CHOOSE_UPLOADFILE_CODE: constantCollection.CHOOSE_UPLOADFILE_CODE,
  UPLOADFILE_FORMAT_CODE: constantCollection.UPLOADFILE_FORMAT_CODE,
  UPLOADFILE_SIZE_CODE: constantCollection.UPLOADFILE_SIZE_CODE,
  CABINET_BELONG_LOCATION_CODE: constantCollection.CABINET_BELONG_LOCATION_CODE,
  UPDATE_LIMIT_CODE: constantCollection.UPDATE_LIMIT_CODE,
  UNUPDATE_CODE: constantCollection.UNUPDATE_CODE,
  CONFIRM_ONLY_ONE_CODE: constantCollection.CONFIRM_ONLY_ONE_CODE,
  OLD_PWD_CODE: constantCollection.OLD_PWD_CODE,
  NEW_PWD_CODE: constantCollection.NEW_PWD_CODE,
  DIFFERENT_PWD_CODE: constantCollection.DIFFERENT_PWD_CODE,
  RENEW_PWD_CODE: constantCollection.RENEW_PWD_CODE,
  START_TIME_EMPTY_CODE: constantCollection.START_TIME_EMPTY_CODE,
  END_TIME_CURRENT_CODE: constantCollection.END_TIME_CURRENT_CODE,
  COLOR_SAME_CODE: constantCollection.COLOR_SAME_CODE,
  PERIOD_SET_CODE: constantCollection.PERIOD_SET_CODE,
  LIMITS_SET_CODE: constantCollection.LIMITS_SET_CODE,
  PERIOD_AND_LIMITS_SET_CODE: constantCollection.PERIOD_AND_LIMITS_SET_CODE,
  END_TIME_EMPTY_CODE: constantCollection.END_TIME_EMPTY_CODE,
  STATISTICS_RESULT_EMPTY_CODE: constantCollection.STATISTICS_RESULT_EMPTY_CODE,

  PLEASE_SELECT_AT_LEASE_ONE_CONFIGURATION_FILE_TO_UPLOAD: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_CONFIGURATION_FILE_TO_UPLOAD,
  PLEASE_SELECT_AT_LEASE_ONE_DEVICE_TO_UPDATE_CONFIGURATION: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_DEVICE_TO_UPDATE_CONFIGURATION,
  PLEASE_SELECT_AT_LEASE_ONE_DEVICE_TO_QUERY_CONFIGURATION_HISTORY: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_DEVICE_TO_QUERY_CONFIGURATION_HISTORY,
  PLEASE_SELECT_ONE_RECORD_TO_DOWNLOAD: constantCollection.PLEASE_SELECT_ONE_RECORD_TO_DOWNLOAD,
  PLEASE_SELECT_AT_LEASE_ONE_DEVICE: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_DEVICE,
  PLEASE_SELECT_ONLY_ONE_DEVICE: constantCollection.PLEASE_SELECT_ONLY_ONE_DEVICE,
  PLEASE_SELECT_AT_LEASE_ONE_CONFIGURATION: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_CONFIGURATION,
  PLEASE_SELECT_ONLY_ONE_CONFIGURATION: constantCollection.PLEASE_SELECT_ONLY_ONE_CONFIGURATION,
  UPLOAD_FILES_CAN_ONLY_BE_IN_CONF_FORMAT: constantCollection.UPLOAD_FILES_CAN_ONLY_BE_IN_CONF_FORMAT,
  UPLOAD_FILES_CAN_ONLY_BE_IN_BIN_FORMAT: constantCollection.UPLOAD_FILES_CAN_ONLY_BE_IN_BIN_FORMAT,
  PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_CLEAR: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_CLEAR,
  PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_DELETE: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_DELETE,
  PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_CONFIRM: constantCollection.PLEASE_SELECT_AT_LEASE_ONE_ALARM_INFORMATION_TO_CONFIRM,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_DOWNLOAD: constantCollection.PLEASE_SELECT_ONLY_ONE_RECORD_TO_DOWNLOAD,
  PLEASE_SELECT_ONLY_ONE_DEVICE_DATA_TO_UPDATE_THE_CONFIGURATION: constantCollection.PLEASE_SELECT_ONLY_ONE_DEVICE_DATA_TO_UPDATE_THE_CONFIGURATION,
  PLEASE_SELECT_ONLY_ONE_DEVICE_DATA_FOR_CONFIGURATION_HISTORY_QUERY: constantCollection.PLEASE_SELECT_ONLY_ONE_DEVICE_DATA_FOR_CONFIGURATION_HISTORY_QUERY,
  START_DEVICE_PORT_BETWEEN_0_99: constantCollection.START_DEVICE_PORT_BETWEEN_0_99,
  END_DEVICE_PORT_BETWEEN_0_99: constantCollection.END_DEVICE_PORT_BETWEEN_0_99,
  START_DEVICE_PORT_NUM: constantCollection.START_DEVICE_PORT_NUM,
  END_DEVICE_PORT_NUM: constantCollection.END_DEVICE_PORT_NUM,
  PORT_ENTERED_MUST_BE_LESS_THAN_99: constantCollection.PORT_ENTERED_MUST_BE_LESS_THAN_99,
  PLEASE_ENTER_VALID_NUMBER: constantCollection.PLEASE_ENTER_VALID_NUMBER,
  PLEASE_ENTER_VALID_DEVICE_IP_ADDRESS: constantCollection.PLEASE_ENTER_VALID_DEVICE_IP_ADDRESS,
  PLEASE_ENTER_VALID_TIME: constantCollection.PLEASE_ENTER_VALID_TIME,

  SERVICE_TYPE_NAME_CANNOT_BE_EMPTY: constantCollection.SERVICE_TYPE_NAME_CANNOT_BE_EMPTY,
  SERVICE_TYPE_ID_CANNOT_BE_EMPTY: constantCollection.SERVICE_TYPE_ID_CANNOT_BE_EMPTY,
  PLEASE_SELECT_ONE_RECORD_TO_MODIFY: constantCollection.PLEASE_SELECT_ONE_RECORD_TO_MODIFY,
  PLEASE_SELECT_ONE_RECORD_TO_DELETE: constantCollection.PLEASE_SELECT_ONE_RECORD_TO_DELETE,
  SERVICE_SUBNET_ID_CANNOT_BE_EMPTY: constantCollection.SERVICE_SUBNET_ID_CANNOT_BE_EMPTY,
  SERVICE_SUBNET_NAME_CANNOT_BE_EMPTY: constantCollection.SERVICE_SUBNET_NAME_CANNOT_BE_EMPTY,
  SERVICE_TOPOLOGY_TYPE_CANNOT_BE_EMPTY: constantCollection.SERVICE_TOPOLOGY_TYPE_CANNOT_BE_EMPTY,
  SERVICE_TYPE_CANNOT_BE_EMPTY: constantCollection.SERVICE_TYPE_CANNOT_BE_EMPTY,
  ARE_YOU_SURE_TO_DELETE_THIS_RECORD: constantCollection.ARE_YOU_SURE_TO_DELETE_THIS_RECORD,
  PLEASE_SELECT_AT_LEAST_ONE_DEVICE: constantCollection.PLEASE_SELECT_AT_LEAST_ONE_DEVICE,
  PLEASE_ENTER_A_VALID_NUMBER: constantCollection.PLEASE_ENTER_A_VALID_NUMBER,
  PLEASE_ENTER_A_VALID_PORT_ID: constantCollection.PLEASE_ENTER_A_VALID_PORT_ID,
  MODIFICATION_OF_SERVICE_SUBNET: constantCollection.MODIFICATION_OF_SERVICE_SUBNET,
  DUPLICATE_SERVICE_SUBNET: constantCollection.DUPLICATE_SERVICE_SUBNET,
  PLEASE_SELECT_A_SCHEDULING_TYPE: constantCollection.PLEASE_SELECT_A_SCHEDULING_TYPE,
  PLEASE_ENTER_A_VALID_CDP_PROFILE_NAME: constantCollection.PLEASE_ENTER_A_VALID_CDP_PROFILE_NAME,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_MODIFY: constantCollection.PLEASE_SELECT_ONLY_ONE_RECORD_TO_MODIFY,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_DELETE: constantCollection.PLEASE_SELECT_ONLY_ONE_RECORD_TO_DELETE,
  PLEASE_DO_NOT_ENTER_A_DUPLICATE_PORT_ID: constantCollection.PLEASE_DO_NOT_ENTER_A_DUPLICATE_PORT_ID,
  PLEASE_SELECT_ONE_RECORD_TO_DUPLICATE: constantCollection.PLEASE_SELECT_ONE_RECORD_TO_DUPLICATE,
  PLEASE_SELECT_ONLY_ONE_RECORD_TO_DUPLICATE: constantCollection.PLEASE_SELECT_ONLY_ONE_RECORD_TO_DUPLICATE,
  PLEASE_ENTER_A_VALID_BANDWIDTH: constantCollection.PLEASE_ENTER_A_VALID_BANDWIDTH,
  HAVE_NO_AFFILIATD_DEVICE: constantCollection.HAVE_NO_AFFILIATD_DEVICE,

  SYSTEM_EXIT_CODE: constantCollection.SYSTEM_EXIT_CODE,
  DELETE_CONFIRM: constantCollection.DELETE_CONFIRM,
  // ========================ls添加开始
  RECOVER_CONFIRM: constantCollection.RECOVER_CONFIRM,
  SNAPSHOT_RECOVER_SUCCESS: constantCollection.SNAPSHOT_RECOVER_SUCCESS,
  SAFEDATA_DELETE: constantCollection.SAFEDATA_DELETE, // 数据安全维护删除
  // ========================ls添加结束

  SELECT_ONE_SUBNET: constantCollection.SELECT_ONE_SUBNET,
  ADD_THE_DEVICE_TO_SUBNET: constantCollection.ADD_THE_DEVICE_TO_SUBNET,
  REMOVE_THE_DEVICE_FROM_SUBNET: constantCollection.REMOVE_THE_DEVICE_FROM_SUBNET,
  MODIFY_PERSONERLY_INFORMATION: constantCollection.MODIFY_PERSONERLY_INFORMATION,
  CORRECT_IP_ORDER: constantCollection.CORRECT_IP_ORDER,
  NOT_IN_SAME_INTERVAL: constantCollection.NOT_IN_SAME_INTERVAL,

  MODIFY_AUTHORITY_TO_LOGIN: constantCollection.MODIFY_AUTHORITY_TO_LOGIN,
  MODIFY_PWD_TO_LOGIN: constantCollection.MODIFY_PWD_TO_LOGIN,
  MODIFY_USER_TO_LOGIN: constantCollection.MODIFY_USER_TO_LOGIN,
  DELETE_USER_TO_LOGIN: constantCollection.DELETE_USER_TO_LOGIN,
  SAME_USER_TO_LOGIN: constantCollection.SAME_USER_TO_LOGIN,

  // ========================zyh添加开始
  PORT_BETWEEN_0_99: constantCollection.PORT_BETWEEN_0_99,
  ENABLE_SELECT_CODE: constantCollection.ENABLE_SELECT_CODE,
  DISABLE_SELECT_CODE: constantCollection.DISABLE_SELECT_CODE,
  ENABLE_CODE: constantCollection.ENABLE_CODE,
  DISABLE_CODE: constantCollection.DISABLE_CODE,
  ENABLE_CONFIRM: constantCollection.ENABLE_CONFIRM,
  DISABLE_CONFIRM: constantCollection.DISABLE_CONFIRM,
  DELETE_STATUS_CODE: constantCollection.DELETE_STATUS_CODE,
  // ========================zyh添加结束

  // ========================weixin添加开始
  DISCOVER_ELEMENT_CODE:constantCollection.DISCOVER_ELEMENT_CODE,
  ELEMENT_REPLACE_CODE: constantCollection.ELEMENT_REPLACE_CODE,
  SAVE_TOPOLOGY: constantCollection.SAVE_TOPOLOGY
  // ========================weixin添加结束
}
Vue.use(contentmenu)
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(VueResource)
Vue.use(Echarts)
Vue.use(Vcharts)
Vue.prototype.InfoTip = InfoTip
Vue.prototype.Loading = Loading
Vue.prototype.successCode = code
Vue.prototype.systemModeAdapter = SystemModeAdapter

Vue.config.performance = true;
/* vue-i18n */
Vue.use(VueI18n)
const messages = {
  en: Object.assign(myEnLocale, enLocale),
  'zh-cn': Object.assign(myZhLocale, zhLocale)
}
const lang = localStorage.getItem('user-language') || 'zh-cn'
export const i18n = new VueI18n({
  locale: lang,
  messages
})
/* element-ui */
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
ElementUI.Dialog.props.closeOnClickModal.default = false
/* vuescroll */
Vue.use(VueScroll, {ops: {bar: {background: '#C0C4CC'}}})

// 配置系统模式
store.commit('setSystemMode', HelperUtil.getSystemMode())
// 请求拦截器
// 添加请求拦截器
Axios.interceptors.request.use(config => {
  if (config.url.indexOf('login') === -1) {
    config.headers['token'] = window.sessionStorage.getItem('token')
    config.headers.language = HelperUtil.obtainLanguage()
  } else {
    if (config.url.indexOf('loginlog') !== -1) {
      config.headers['token'] = window.sessionStorage.getItem('token')
      config.headers.language = HelperUtil.obtainLanguage()
    }
  }
  return config
}, error => {
  let erro = error
})

// 添加响应拦截器
Axios.interceptors.response.use(response => {
  if (response.status === 200) {
    if (response.data.result === false) {
      if (response.data.faultCode === 22011 || response.data.faultCode === 22014) {
        HelperUtil.toLoginPage()
      }
    }
  }
  return response
}, error => {
  let err = null
  if (error && error.response) {
    switch (error.response.status) {
      case 500:
        err = HelperUtil.getStatusCodeObjectByCode(error.response.status)
        break
      case 404:
        err = HelperUtil.getStatusCodeObjectByCode(error.response.status)
        break
      case 405:
        err = HelperUtil.getStatusCodeObjectByCode(error.response.status)
        break
      case 415:
        err = HelperUtil.getStatusCodeObjectByCode(error.response.status)
        break
      default:
    }
  } else {
    // err = {code:undefined,message:error.message};
    err = HelperUtil.getStatusCodeObjectByCode(constantCollection.SERVER_CODE)
  }
  return Promise.reject(err)
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  components: { App },
  template: '<App/>',
  render: h => h(App)
}).$mount('#app')
