// import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/iconfonts/iconfont.css'
import './assets/iconfonts/expand/iconfont.css'
import './assets/index.less'
// import 'normalize.css'
import './permission' // permission control 

if(process.env.hiui_debug){
  //这样多次引用element
  //hiui调试时用
  Vue.use(ELEMENT)   
}

//設置script引入全局的ELEMENT 配置
Vue.prototype.$ELEMENT = { size: 'mini', zIndex: 3000 };

import GeminiScrollbar from 'vue-gemini-scrollbar'
Vue.use(GeminiScrollbar) 
import Message from './components/vue-m-message'
Vue.use(Message) // will mount `Vue.prototype.$message`
/*任务中心*/
import 'zhc-flowchart/lib/zhc-flowchart.css'
import  zhcflowchart from "zhc-flowchart";
Vue.use(zhcflowchart) 
Vue.config.productionTip = false

import Package from '../../package.json'
console.log(
    '%c hi-vui-template  %c v'.concat(Package.version, ' '),
    'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #5584ff; font-weight: bold;',
    'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;',
);

Vue.directive('add2Body', {
  // 当被绑定的元素插入到 DOM 中时……
  inserted: function (el) {
    document.body.appendChild(el);
  }
});

let hiSetting = HIVUI_SETTING;
Vue.prototype.$HI = {
  projectName: hiSetting.projectName,
  request: hiSetting.request,
  queryOperate: hiSetting.queryOperate,
  pageSize: 20,
  saveUrl: hiSetting.saveUrl,
  queryUrl: hiSetting.queryUrl,
  datasetUrl: hiSetting.datasetUrl,
  policyUrl: hiSetting.policyUrl,
  upload: hiSetting.upload,
  download: hiSetting.download,
  review: hiSetting.review,
  getFlowInfo: hiSetting.getFlowInfo,
  getApprovalInfo: hiSetting.getApprovalInfo,
  processFlow: hiSetting.processFlow,
  queryTask: hiSetting.queryTask,
  withdrawtask: hiSetting.withdrawtask,
  taskDiagram: hiSetting.taskDiagram,
  openOrdernumber: hiSetting.openOrdernumber,
  editorImgServer :hiSetting.review+"?relativePath="
};
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
