2021-03-03 15:06:52 +08:00
|
|
|
|
import Vue from 'vue'
|
|
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
import '@/styles/index.scss' // global css
|
|
|
|
|
import ElementUI from 'element-ui'
|
|
|
|
|
import Fit2CloudUI from 'fit2cloud-ui'
|
2021-07-01 10:51:44 +08:00
|
|
|
|
// import axios from 'axios'
|
|
|
|
|
// import VueAxios from 'vue-axios'
|
2021-03-16 17:53:43 +08:00
|
|
|
|
import i18n from './lang' // internationalization
|
2021-03-03 15:06:52 +08:00
|
|
|
|
import App from './App'
|
|
|
|
|
import store from './store'
|
|
|
|
|
import router from './router'
|
2021-03-17 18:50:29 +08:00
|
|
|
|
import message from './utils/message'
|
2021-03-03 15:06:52 +08:00
|
|
|
|
import '@/icons' // icon
|
|
|
|
|
import '@/permission' // permission control
|
|
|
|
|
import api from '@/api/index.js'
|
|
|
|
|
import filter from '@/filter/filter'
|
2021-03-05 16:07:44 +08:00
|
|
|
|
import directives from './directive'
|
2021-03-25 19:19:21 +08:00
|
|
|
|
import VueClipboard from 'vue-clipboard2'
|
2021-03-29 21:24:33 +08:00
|
|
|
|
import widgets from '@/components/widget'
|
2021-05-31 14:07:12 +08:00
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
2021-05-07 11:04:50 +08:00
|
|
|
|
import './utils/dialog'
|
2021-06-16 18:03:59 +08:00
|
|
|
|
import DeComplexInput from '@/components/business/condition-table/DeComplexInput'
|
2021-08-18 15:20:30 +08:00
|
|
|
|
import DeComplexSelect from '@/components/business/condition-table/DeComplexSelect'
|
2021-03-30 15:38:32 +08:00
|
|
|
|
import '@/components/canvas/custom-component' // 注册自定义组件
|
2021-03-25 19:16:32 +08:00
|
|
|
|
Vue.config.productionTip = false
|
2021-03-25 19:19:21 +08:00
|
|
|
|
Vue.use(VueClipboard)
|
2021-03-29 21:24:33 +08:00
|
|
|
|
Vue.use(widgets)
|
2021-03-03 15:06:52 +08:00
|
|
|
|
Vue.prototype.$api = api
|
|
|
|
|
|
2021-03-03 21:08:39 +08:00
|
|
|
|
import * as echarts from 'echarts'
|
2021-03-03 18:35:51 +08:00
|
|
|
|
|
|
|
|
|
Vue.prototype.$echarts = echarts
|
|
|
|
|
|
2021-03-15 12:25:11 +08:00
|
|
|
|
import UmyUi from 'umy-ui'
|
|
|
|
|
Vue.use(UmyUi)
|
|
|
|
|
|
2021-03-22 13:44:07 +08:00
|
|
|
|
import vcolorpicker from 'vcolorpicker'
|
|
|
|
|
Vue.use(vcolorpicker)
|
|
|
|
|
|
2021-06-04 11:19:50 +08:00
|
|
|
|
// 全屏插件
|
|
|
|
|
import fullscreen from 'vue-fullscreen'
|
|
|
|
|
Vue.use(fullscreen)
|
|
|
|
|
|
2021-07-01 12:12:43 +08:00
|
|
|
|
// import TEditor from '@/components/Tinymce/index.vue'
|
|
|
|
|
// Vue.component('TEditor', TEditor)
|
|
|
|
|
|
2021-03-03 15:06:52 +08:00
|
|
|
|
/**
|
|
|
|
|
* 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') {
|
2021-06-10 10:53:19 +08:00
|
|
|
|
// const { mockXHR } = require('../mock')
|
|
|
|
|
// mockXHR()
|
2021-03-03 15:06:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set ElementUI lang to EN
|
|
|
|
|
// Vue.use(ElementUI, { locale })
|
|
|
|
|
// 如果想要中文版 element-ui,按如下方式声明
|
|
|
|
|
Vue.use(ElementUI, {
|
|
|
|
|
size: Cookies.get('size') || 'medium', // set element-ui default size
|
|
|
|
|
i18n: (key, value) => i18n.t(key, value)
|
|
|
|
|
})
|
|
|
|
|
Vue.use(Fit2CloudUI, {
|
|
|
|
|
i18n: (key, value) => i18n.t(key, value)
|
|
|
|
|
})
|
2021-07-01 10:51:44 +08:00
|
|
|
|
// Vue.use(VueAxios, axios)
|
2021-03-03 15:06:52 +08:00
|
|
|
|
Vue.use(filter)
|
2021-03-05 16:07:44 +08:00
|
|
|
|
Vue.use(directives)
|
2021-03-17 18:50:29 +08:00
|
|
|
|
Vue.use(message)
|
2021-05-31 14:07:12 +08:00
|
|
|
|
Vue.component('Treeselect', Treeselect)
|
2021-06-16 18:03:59 +08:00
|
|
|
|
Vue.component('DeComplexInput', DeComplexInput)
|
2021-08-18 15:20:30 +08:00
|
|
|
|
Vue.component('DeComplexSelect', DeComplexSelect)
|
2021-03-03 15:06:52 +08:00
|
|
|
|
Vue.config.productionTip = false
|
2021-03-05 16:07:44 +08:00
|
|
|
|
|
2021-09-02 18:59:21 +08:00
|
|
|
|
import vueToPdf from 'vue-to-pdf'
|
|
|
|
|
Vue.use(vueToPdf)
|
|
|
|
|
|
2021-05-18 16:07:19 +08:00
|
|
|
|
Vue.prototype.hasDataPermission = function(pTarget, pSource) {
|
2021-06-11 14:04:30 +08:00
|
|
|
|
if (this.$store.state.user.user.isAdmin) {
|
|
|
|
|
return true
|
|
|
|
|
}
|
2021-05-18 16:07:19 +08:00
|
|
|
|
if (pSource && pTarget) {
|
|
|
|
|
return pSource.indexOf(pTarget) > -1
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
2021-05-31 14:07:12 +08:00
|
|
|
|
|
|
|
|
|
Vue.prototype.checkPermission = function(pers) {
|
|
|
|
|
const permissions = store.getters.permissions
|
|
|
|
|
const hasPermission = pers.every(needP => {
|
|
|
|
|
const result = permissions.includes(needP)
|
|
|
|
|
return result
|
|
|
|
|
})
|
|
|
|
|
return hasPermission
|
|
|
|
|
}
|
2021-03-03 15:06:52 +08:00
|
|
|
|
new Vue({
|
2021-03-31 18:23:43 +08:00
|
|
|
|
|
2021-03-03 15:06:52 +08:00
|
|
|
|
router,
|
|
|
|
|
store,
|
|
|
|
|
i18n,
|
|
|
|
|
render: h => h(App)
|
2021-03-31 18:23:43 +08:00
|
|
|
|
}).$mount('#app')
|