You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.7 KiB

2 years ago
import Vue from 'vue'
2 years ago
import { getQueryParam } from '@/utils'
2 years ago
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import '@/icons' // icon
import '@/permission' // permission control
/**
* 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()
}
// set ElementUI lang to EN
2 years ago
//Vue.use(ElementUI, { locale })
2 years ago
// 如果想要中文版 element-ui按如下方式声明
2 years ago
Vue.use(ElementUI)
1 year ago
// vxe-table
import { VxeUI, VxeUpload } from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
Vue.use(VxeUpload)
2 years ago
import VxeTable from 'vxe-table'
2 years ago
import "vxe-table/styles/index.scss"
1 year ago
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import ExcelJS from 'exceljs'
VxeTable.use(VXETablePluginExportXLSX, {
ExcelJS
})
2 years ago
Vue.use(VxeTable)
2 years ago
Vue.config.productionTip = false
2 years ago
//vant
import Vant from 'vant'
2 years ago
import 'vant/lib/index.css';
2 years ago
Vue.use(Vant)
2 years ago
import domZIndex from 'dom-zindex'
domZIndex.setCurrent(2000)
2 years ago
2 years ago
// treeselect
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
Vue.component('Treeselect', Treeselect)
2 years ago
import CardContainer from '@/layout/CardContainer.vue'
Vue.component('CardContainer', CardContainer)
2 years ago
//moment
import moment from 'moment'
2 years ago
moment.locale('zh-cn')
2 years ago
Vue.prototype.$moment = moment;
2 years ago
import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)
2 years ago
import { setToken,getToken } from "@/utils/auth"
2 years ago
if(window.top !== window.self) {
// 当前页面在iframe中
window._IN_IFRAME = true;
}
2 years ago
if (window.__POWERED_BY_WUJIE__) {
let instance;
window.__WUJIE_MOUNT = () => {
instance = new Vue({
router,
store,
2 years ago
render: h => h(App),
beforeCreate() {
Vue.prototype.$bus = this
}
2 years ago
}).$mount("#app")
window.MODULE_NAME = window.$wujie?.props?.module_name;
2 years ago
console.log('token-wujie',window.MODULE_NAME)
2 years ago
setToken(window.$wujie?.props?.auth_token)
router.push('/')
};
window.__WUJIE_UNMOUNT = () => {
instance.$destroy();
};
2 years ago
} else {
2 years ago
window.MODULE_NAME = getQueryParam('module_name')
new Vue({
router,
store,
2 years ago
render: h => h(App),
beforeCreate() {
Vue.prototype.$bus = this
}
2 years ago
}).$mount("#app")
2 years ago
}
2 years ago