/** init domain config */
|
import './config'
|
|
import Vue from 'vue'
|
import App from './App.vue'
|
import Storage from 'vue-ls'
|
import router from './router'
|
import store from './store/'
|
import { VueAxios } from "@/utils/request"
|
// 引入 Element UI 组件
|
import element from '@/plugins/element.js'
|
require('@jeecg/antd-online-mini')
|
require('@jeecg/antd-online-mini/dist/OnlineForm.css')
|
|
import Antd, { version } from 'ant-design-vue'
|
console.log('ant-design-vue version:', version)
|
|
import Viser from 'viser-vue'
|
import 'ant-design-vue/dist/antd.less'; // or 'ant-design-vue/dist/antd.less'
|
import 'element-ui/lib/theme-chalk/index.css'
|
|
import '@/permission' // permission control
|
import '@/utils/filter' // base filter
|
import Print from 'vue-print-nb-jeecg'
|
/**
|
* vue-simple-uploader 中文官方文档 https://github.com/simple-uploader/vue-uploader/blob/master/README_zh-CN.md
|
* simple-uploader.js 中文官方文档 https://github.com/simple-uploader/Uploader/blob/develop/README_zh-CN.md
|
*/
|
import uploader from 'vue-simple-uploader'
|
// collapse 展开折叠
|
import CollapseTransition from 'element-ui/lib/transitions/collapse-transition'
|
|
Vue.component(CollapseTransition.name, CollapseTransition)
|
// 引入全局函数
|
import globalFunction from '@/utils/libs/globalFunction/index.js'
|
// 引入文件操作相关插件
|
import fileOperationPlugins from '@views/document/components/fileOperationPlugins.js'
|
/*import '@babel/polyfill'*/
|
import preview from 'vue-photo-preview'
|
import 'vue-photo-preview/dist/skin.css'
|
import SSO from '@/cas/sso.js'
|
import {
|
ACCESS_TOKEN,
|
DEFAULT_COLOR,
|
DEFAULT_THEME,
|
DEFAULT_LAYOUT_MODE,
|
DEFAULT_COLOR_WEAK,
|
SIDEBAR_TYPE,
|
DEFAULT_FIXED_HEADER,
|
DEFAULT_FIXED_HEADER_HIDDEN,
|
DEFAULT_FIXED_SIDEMENU,
|
DEFAULT_CONTENT_WIDTH_TYPE,
|
DEFAULT_MULTI_PAGE
|
} from "@/store/mutation-types"
|
import config from '@/defaultSettings'
|
|
import JDictSelectTag from './components/dict/index.js'
|
import hasPermission from '@/utils/hasPermission'
|
import vueBus from '@/utils/vueBus';
|
import JeecgComponents from '@/components/jeecg/index'
|
import '@/assets/less/JAreaLinkage.less'
|
import VueAreaLinkage from 'vue-area-linkage'
|
import '@/components/jeecg/JVxeTable/install'
|
import '@/components/JVxeCells/install'
|
//表单验证
|
import { rules } from '@/utils/rules'
|
import Contextmenu from "vue-contextmenujs"
|
Vue.use(Contextmenu);
|
|
import * as echarts from 'echarts'
|
Vue.prototype.$echarts = echarts
|
import ZmTreeOrg from '@comp/ZmTreeOrg'
|
Vue.use(ZmTreeOrg);
|
|
|
Vue.prototype.rules = rules
|
Vue.config.productionTip = false
|
Vue.use(Storage, config.storageOptions)
|
Vue.use(Antd)
|
Vue.use(VueAxios, router)
|
Vue.use(Viser)
|
Vue.use(hasPermission)
|
Vue.use(JDictSelectTag)
|
Vue.use(Print)
|
Vue.use(preview)
|
Vue.use(vueBus);
|
Vue.use(JeecgComponents);
|
Vue.use(VueAreaLinkage);
|
Vue.use(uploader)
|
Vue.use(element)
|
|
for (let key in globalFunction) {
|
Vue.prototype[`$${key}`] = globalFunction[key]
|
}
|
for (let key in fileOperationPlugins) {
|
Vue.prototype[`$${key}`] = fileOperationPlugins[key]
|
}
|
Date.prototype.Format = function(fmt)
|
{ //author: meizz
|
var o = {
|
"M+" : this.getMonth()+1, //月份
|
"d+" : this.getDate(), //日
|
"h+" : this.getHours(), //小时
|
"m+" : this.getMinutes(), //分
|
"s+" : this.getSeconds(), //秒
|
"q+" : Math.floor((this.getMonth()+3)/3), //季度
|
"S" : this.getMilliseconds() //毫秒
|
};
|
if(/(y+)/.test(fmt))
|
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
|
for(var k in o)
|
if(new RegExp("("+ k +")").test(fmt))
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
|
return fmt;
|
}
|
|
SSO.init(() => {
|
main()
|
})
|
function main() {
|
new Vue({
|
router,
|
store,
|
mounted () {
|
store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true))
|
store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme))
|
store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout))
|
store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader))
|
store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar))
|
store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth))
|
store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader))
|
store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak))
|
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
|
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
|
store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage))
|
},
|
render: h => h(App)
|
}).$mount('#app')
|
}
|