/**version-1.0*/
import Vue from "vue";
import Cookies from "js-cookie";
import "normalize.css/normalize.css"; // a modern alternative to CSS resets
import Element from "element-ui";
import "@/styles/element-variables.scss";
import "@/styles/index.scss"; // global css

import App from "@base/App";
import store from "@base/store";
import router from "@base/router";

import "@/icons"; // icon
import "@base/permission"; // permission control

import * as filters from "@base/filters"; // global filters

// main.js 文件添加以下代码

import BaseKeepAlive from "@base/utils/keepAlive.js";

Vue.component("BaseKeepAlive", BaseKeepAlive);

import VXETable from "vxe-table";
import "vxe-table/lib/style.css";

// 引入扩展插件
import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js";
import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css";

/* // 设置授权信息
VXETable.setup({
  // showAuthLog: true, // 是否在控制台显示授权信息，专业版支持关闭
  // authId: 'gbeumewkoyt2rhf9', // 获取授权后在官网登录后进入“用户中心”查看
  authId: 'gbeumewkoyt2rhft', // 获取授权后在官网登录后进入“用户中心”查看
  // onAuth (e) {
  //   // 打印授权状态
  //   console.log(e)
  // }
}) */

import Vab from "@base/utils/vab";

Vue.use(Vab);

Vue.use(VXETable);

/* import tablePluns from "@/mixins/table/index.js"
VXETable.use(tablePluns) */

import "@base/components/table/index.js";

import drag from "@base/directive/el-drag-dialog/index.js";

Vue.use(drag.install);

import elDialogCenter from "@base/directive/el-dialog-center/index.js";

Vue.use(elDialogCenter.install);

import ErroreBox from "@base/components/errorMsg/index.js";

Vue.use(ErroreBox);

import ExcelExport from "@base/components/excelExport/index.js";

Vue.use(ExcelExport);

import ExcelImport from "@base/components/excelImport/index.js";

Vue.use(ExcelImport);

import ConfirmDialog from "@base/components/confirmDialog/index.js";

Vue.use(ConfirmDialog);

import baseAlert from "@base/components/baseAlert/index.js";

Vue.use(baseAlert);

import permission from "@base/directive/permission";

Vue.use(permission);

import VabUpload from "@base/components/VabUpload/index.js";

Vue.use(VabUpload);

Vue.component("baseUpload", () =>
  import("@base/components/VabUpload/view.vue")
);

import baseAttachment from "@base/components/baseAttachment/install";

Vue.use(baseAttachment);
Vue.component("attachmentShowList", () =>
  import("@base/components/baseAttachment/showList")
);

import "@base/resources/js/base/common.js";

import vxeFilter from "@base/components/table/vxeFilter/index.js";

Vue.use(vxeFilter);

import baseTableExport from "@base/components/excelExport/button.vue";

Vue.component(baseTableExport.name, baseTableExport);

/* Vue.component('extendedProperties', () => import('@base/components/extendedProperties/view.vue')); */

import LimitNumber from "@base/directive/LimitNumber/index.js";

Vue.use(LimitNumber);

import baseInputNumber from "@base/components/baseInputNumber/index.vue";

Vue.component(baseInputNumber.name, baseInputNumber);

import elReadonly from "@base/directive/el-readonly/index.js";

Vue.use(elReadonly);

/*import cnPrint from "@base/components/cnPrint/index.js"

Vue.use(cnPrint);*/

/* Vue.component('oplogTable', () => import('@base/components/oplogTable/index.vue')); */
import oplogTable from "@base/components/oplogTable/index.vue";

Vue.component(oplogTable.name, oplogTable);

import baseInputBatch from "@base/components/baseInputBatch/index.vue";

Vue.component(baseInputBatch.name, baseInputBatch);

import baseArea from "@base/components/baseArea/index.vue";

Vue.component(baseArea.name, baseArea);

Vue.component("baseInputExport", () =>
  import("@base/components/baseInputExport/index.vue")
);

Vue.component("advancedSearchDialog", () =>
  import("@base/components/advancedSearchDialog/index.vue")
);

import baseTabs from "@base/components/baseTabs/index.vue";

Vue.component(baseTabs.name, baseTabs);

import baseTabPane from "@base/components/baseTabs/baseTabPane.vue";

Vue.component(baseTabPane.name, baseTabPane);

import vb_tabs from "@base/components/vb-tabs/index.vue";
import vb_tab_pane from "@base/components/vb-tabs/tab-pane.vue";
import xTabs from "@base/components/vb-tabs/x-tabs.vue";

Vue.component(vb_tabs.name, vb_tabs);
Vue.component(vb_tab_pane.name, vb_tab_pane);
Vue.component(xTabs.name, xTabs);

Vue.component("status-tag", () =>
  import("@base/components/statusTag/index.vue")
);

Vue.component("CodeEditor", () =>
  import("@base/components/code-editor/index.vue")
);

Vue.component("scriptDescriptionButton", () =>
  import("@base/components/scriptDescription/button")
);

Vue.component("scriptTestButton", () =>
  import("@base/components/scriptTest/button")
);

import baseTextarea from "@base/components/base-textarea/index.vue";

Vue.component(baseTextarea.name, baseTextarea);

import jsonImport from "@base/components/jsonImport/index.js";

Vue.use(jsonImport);

import langImport from "@base/components/langImport/index.js";

Vue.use(langImport);

//vform
// import '@base/components/xform/utils/directive'

import i18n from "@base/lang/index.js";

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
if (process.env.NODE_ENV === "production") {
  /* const { mockXHR } = require('../mock')
  mockXHR() */
}

Vue.use(Element, {
  size: Cookies.get("size") || "medium", // set element-ui default size
  // locale: enLang // 如果使用中文，无需设置，请删除
});

// register global utility filters
Object.keys(filters).forEach((key) => {
  Vue.filter(key, filters[key]);
});

Vue.config.productionTip = false;

let vue = new Vue({
  el: "#app",
  router,
  store,
  i18n,
  render: (h) => h(App),
});
window.$vueRoot = vue;
