147 lines
4.3 KiB
JavaScript
147 lines
4.3 KiB
JavaScript
import '@babel/polyfill'
|
|
import Es6Promise from 'es6-promise'
|
|
require('es6-promise').polyfill();
|
|
require('es6-promise/auto');
|
|
import Vue from 'vue'
|
|
import App from './App'
|
|
import ElementUI from 'element-ui'
|
|
import 'element-ui/lib/theme-chalk/index.css'
|
|
// jQuery
|
|
import $ from 'jquery'
|
|
// vuex
|
|
import store from './store'
|
|
// 复制
|
|
import VueClipboard from 'vue-clipboard2'
|
|
// 全局样式文件
|
|
import '@/assets/styles/common.less'
|
|
// 样式重置
|
|
import '@/assets/styles/reset.css'
|
|
// iconfont字体库
|
|
import '@/assets/styles/iconfont.css'
|
|
import '@/assets/styles/shangqi-iconfont/iconfont.css'
|
|
import '@/assets/styles/shangqi-iconfont-replace/iconfont.css' // 可直接替换此文件夹
|
|
import '@/assets/styles/shangqi-iconfont-2021/iconfont.css'
|
|
// axios
|
|
import axios from 'axios'
|
|
import $axios from '@/common/axios'
|
|
// 自定义全局组件
|
|
import components from '@/components'
|
|
// 自定义插件
|
|
import common from '@/common'
|
|
// 自定义按钮显示指令
|
|
import btnPermission from '@/common/btnPermission' // eslint-disable-line
|
|
import VueI18n from 'vue-i18n' // 国际化
|
|
// import * as echarts from 'echarts'
|
|
import { simpleUploadPath } from '@/sysConfig'
|
|
// 时间转换
|
|
import moment from 'moment'
|
|
moment.suppressDeprecationWarnings = true;
|
|
// 右键菜单
|
|
import Contextmenu from 'vue-contextmenujs'
|
|
|
|
import animate from 'animate.css'
|
|
|
|
// 引入路由器
|
|
import router from './router'
|
|
// 路由解析器
|
|
import Re from 'path-to-regexp'
|
|
|
|
import { get_verify_by_instance } from 'api/process'
|
|
|
|
|
|
// 路由拦截
|
|
router.beforeEach(function (to, from, next) {
|
|
let path = to.path;
|
|
console.log("auth : to =>", to);
|
|
console.log("auth : path =>" + path);
|
|
let taskId = to.query.taskIds;
|
|
let prcId = to.query.prcId;
|
|
let prcNum = to.query.prcNum;
|
|
let prcName = to.query.prcName;
|
|
let prcType = to.query.prcType;
|
|
if(taskId !== undefined && taskId !== null && prcId !== undefined && prcId !== null){
|
|
get_verify_by_instance({
|
|
taskId: taskId, // 任务id
|
|
pId: prcId // 流程实例
|
|
}).then(res => {
|
|
if(res && res > 0){
|
|
let param = "?taskIds="+taskId+"&prcId="+prcId
|
|
+"&prcNum="+prcNum+"&prcName="+prcName+"&prcType="+prcType;
|
|
// 根据type判断跳转具体流程页面
|
|
if (prcType === '1') {
|
|
// 标准入库流程数据
|
|
next({path:"bzrkStep5"+param})
|
|
}else if(prcType === '4'){
|
|
//标准清单发布流程数据
|
|
next({path:"bzqdfbStep1-4"+param})
|
|
}else if (prcType === '5'){
|
|
//标准项目合规评估 标准维度
|
|
if(path === "/xmpgStep2" || path === "/xmpgStep1" || path === "/xmpgStep1-2"){
|
|
next({path:"xmpgStep1-2"+param})
|
|
}else {
|
|
next({path:"xmpgStep1-7"+param})
|
|
}
|
|
}else if(prcType === '6'){
|
|
//标准项目合规评估 项目维度
|
|
if(path === "/xmpg2Step1" || path === "/xmpg2Step2" || path === "/xmpg2Step1-2"){
|
|
next({path:"xmpg2Step1-2"+param})
|
|
}else {
|
|
next({path:"xmpg2Step1-12"+param})
|
|
}
|
|
} else if (prcType === '8') {
|
|
// 未符合项整改
|
|
next({path:"wfhxzgStep5-1"+param})
|
|
} else if(prcType === '9'){
|
|
next({path:"bzjdStep1-6"+param})
|
|
//标准调研流程
|
|
}else if(prcType === '2'){
|
|
next({path:"bzdyStep1-9"+param})
|
|
}else if(prcType === '3'){
|
|
//标准征求意见
|
|
next({path:"bzzqyjStep1-9"+param})
|
|
}else if(prcType === '10'){
|
|
//项目清单确认
|
|
next({path:"xmqdqrStep1-3"+param})
|
|
}
|
|
}
|
|
console.log("res : res =>", res);
|
|
})
|
|
}
|
|
next()
|
|
})
|
|
|
|
|
|
Vue.config.productionTip = false
|
|
// jquery
|
|
Vue.prototype.$ = $
|
|
Vue.use(ElementUI)
|
|
Vue.use(common)
|
|
Vue.use(components)
|
|
Vue.use(VueI18n)
|
|
Vue.use(VueClipboard)
|
|
Vue.use(Contextmenu)
|
|
Vue.use(animate)
|
|
|
|
// Vue.prototype.$echarts = echarts
|
|
// 原生axios
|
|
Vue.prototype.axios = axios
|
|
// 封装后的axios
|
|
Vue.prototype.$http = $axios
|
|
Vue.prototype.simpleUploadPath = simpleUploadPath
|
|
Vue.prototype.$moment = moment
|
|
// 国际化
|
|
const i18n = new VueI18n({
|
|
locale: store.getters.getLanguage || 'cn', // 定义默认语言为中文
|
|
messages: {
|
|
cn: require('@/assets/languages/cn'),
|
|
en: require('@/assets/languages/en')
|
|
}
|
|
})
|
|
/* eslint-disable no-new */
|
|
window.vm = new Vue({
|
|
router,
|
|
store,
|
|
i18n,
|
|
render: h => h(App)
|
|
}).$mount('#app')
|