import Vue from 'vue'
import singleSpaVue from 'single-spa-vue';
// import 'babel-polyfill'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import store from './store'
import './utils/G_websign.js'
// import  './utils/Loadwebsign.js'
import { WebSeal, GetSealData, GetWebObj, SetSealDataEx, SetSealData, ShowSeal } from '@/utils/websign_main.js'
import './utils/G_websign.css'
import 'element-ui/lib/theme-chalk/index.css'
// import './style/font/iconfont.css'
import './style/style.css'
// import './style/font/style.css'
// import './style/style.scss'
import 'font-awesome/css/font-awesome.min.css'
import VueQuillEditor from 'vue-quill-editor'
import Print from '@/utils/print.js'

// require styles 引入样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
Vue.use(Print);
import '@/permission-portal'
import * as echarts from "echarts"
import "echarts-gl"

Vue.prototype.$echarts = echarts
//1.引入时间处理函数
import utils from './utils/index'
//2.将时间处理函数方法绑定到全局
Vue.prototype.$utils = utils
Vue.prototype.$WebSeal = WebSeal
Vue.prototype.$GetSealData = GetSealData
Vue.prototype.$GetWebObj = GetWebObj
Vue.prototype.$SetSealDataEx = SetSealDataEx
Vue.prototype.$SetSealData = SetSealData
Vue.prototype.$ShowSeal = ShowSeal

Vue.use(ElementUI)

Vue.config.productionTip = false
const vueLifecycles = singleSpaVue({
    Vue,
    appOptions: {
        el: '#publicfunction',
        router,
        store,
        render: h => h(App)
    }
});

export const bootstrap = [
    vueLifecycles.bootstrap,
];

export function mount(props) {
    createDomElement();
    return vueLifecycles.mount(props);
}

export const unmount = [
    vueLifecycles.unmount,
];

function createDomElement() {
    // Make sure there is a div for us to render into
    let el = document.getElementById('publicfunction');

    if (!el) {
        let content = document.getElementById('content');
        el = document.createElement('div');
        el.id = 'publicfunction';
        content.appendChild(el);
    }
    return el;
}
