代码整合调整

This commit is contained in:
fan 2019-10-17 10:13:08 +08:00
parent 0118f94e6c
commit 11190ef66f
6 changed files with 262 additions and 255 deletions

View File

@ -114,7 +114,6 @@ import runPlanApproval from '@/views/approval/runPlan/index';
import { loginTitle } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth';
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
@ -176,36 +175,36 @@ export const UrlConfig = {
plan: {
prefix: '/plan',
tool: '/plan/tool',
usertool: '/plan/usertool',
usertool: '/plan/usertool',
detail: '/plan/detail',
pay: '/plan/pay'
},
design: {
prefix: '/design/home',
// tool: '/design/tool',
// detail: '/plan/detail',
// pay: '/plan/pay'
mapDraw: '/design/map/draw',
lessonEdit: '/design/lesson/edit',
lessonHome: '/design/lesson/home',
lessonManage: '/design/lesson/manage',
taskManage: '/design/lesson/taskManage',
trainingRule: '/design/lesson/trainingRule',
trainingRuleDetail: '/design/lesson/trainingRule/detail',
trainingManage: '/design/lesson/trainingManage',
lessonTraining: '/design/lesson/training',
trainingRecord: '/design/lesson/training',
runPlan: '/design/runPlan/detail',
scriptHome: '/design/script/home',
display: '/design/display'
},
designUser: {
prefix: '/design/userlist/home',
scriptHome: '/design/userlist/script/home',
mapDraw: '/design/userlist/map/draw',
lessonHome: '/design/userlist/lesson/home',
runPlan: '/design/userlist/runPlan/detail'
},
design: {
prefix: '/design/home',
// tool: '/design/tool',
// detail: '/plan/detail',
// pay: '/plan/pay'
mapDraw: '/design/map/draw',
lessonEdit: '/design/lesson/edit',
lessonHome: '/design/lesson/home',
lessonManage: '/design/lesson/manage',
taskManage: '/design/lesson/taskManage',
trainingRule: '/design/lesson/trainingRule',
trainingRuleDetail: '/design/lesson/trainingRule/detail',
trainingManage: '/design/lesson/trainingManage',
lessonTraining: '/design/lesson/training',
trainingRecord: '/design/lesson/training',
runPlan: '/design/runPlan/detail',
scriptHome: '/design/script/home',
display: '/design/display'
},
designUser: {
prefix: '/design/userlist/home',
scriptHome: '/design/userlist/script/home',
mapDraw: '/design/userlist/map/draw',
lessonHome: '/design/userlist/lesson/home',
runPlan: '/design/userlist/runPlan/detail'
},
replay: {
prefix: '/replay'
},
@ -293,12 +292,12 @@ export const constantRoutes = [
component: LoginPlan,
hidden: true
},
// 密码登录
{
path: '/design/login1',
component: LoginDesign,
hidden: true
},
// 密码登录
{
path: '/design/login1',
component: LoginDesign,
hidden: true
},
{
path: '/jlmap3d/edit',
component: Jlmap3dedit,
@ -319,151 +318,151 @@ export const constantRoutes = [
];
export const asyncRouter = [
{
path: '/design',
component: Layout,
redirect: '/design/home',
meta: {
roles: [admin, user, userDesign]
},
children: [
{
path: '',
redirect: '/design/home',
component: DesignPlatform,
meta: {
i18n: 'router.designhomePage',
icon: 'design'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
meta: {
}
},
{
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{
path: 'lesson/home/:mapId/:skinCode',
component: LessonHome,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
},
{
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{
path: 'lesson/trainingManage/:skinCode',
component: Trainingmanage,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
]
},
{
path: '/design/userlist',
redirect: '/design/userlist/home',
component: Layout,
meta: {
roles: [admin, user, userDesign]
},
children: [
{
path: '',
redirect: '/design/userlist/home',
component: DesignPlatformUser,
meta: {
i18n: 'router.designUserPage',
icon: 'design'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
meta: {
}
},
{
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{
path: 'lesson/home/:mapId',
component: LessonHome,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
]
},
{
path: '/design',
component: Layout,
redirect: '/design/home',
meta: {
roles: [admin, user, userDesign]
},
children: [
{
path: '',
redirect: '/design/home',
component: DesignPlatform,
meta: {
i18n: 'router.designhomePage',
icon: 'design'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
meta: {
}
},
{
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{
path: 'lesson/home/:mapId/:skinCode',
component: LessonHome,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
},
{
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{
path: 'lesson/trainingManage/:skinCode',
component: Trainingmanage,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
]
},
{
path: '/design/userlist',
redirect: '/design/userlist/home',
component: Layout,
meta: {
roles: [admin, user, userDesign]
},
children: [
{
path: '',
redirect: '/design/userlist/home',
component: DesignPlatformUser,
meta: {
i18n: 'router.designUserPage',
icon: 'design'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
meta: {
}
},
{
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{
path: 'lesson/home/:mapId',
component: LessonHome,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
]
},
{
path: '/display/:mode',
component: Display,
@ -471,13 +470,13 @@ export const asyncRouter = [
},
hidden: true
},
{
path: '/design/display/:mode',
component: Display,
meta: {
},
hidden: true
},
{
path: '/design/display/:mode',
component: Display,
meta: {
},
hidden: true
},
{
path: '/scriptDisplay/:mode',
component: ScriptDisplay,
@ -510,10 +509,10 @@ export const asyncRouter = [
i18n: 'router.mapManage',
roles: [admin, mapCreater, userDesign]
},
hidden: true,
hidden: true,
component: Layout,
children: [
{
{
path: 'draw',
redirect: '/map/draw/0/draft',
component: Mapdraft,
@ -553,7 +552,7 @@ export const asyncRouter = [
{
path: '/lesson',
component: Layout,
hidden: true,
hidden: true,
meta: {
i18n: 'router.lessaonManage',
roles: [admin, lessonCreater, userDesign]
@ -691,7 +690,7 @@ export const asyncRouter = [
},
{
path: '/dp',
hidden: true,
hidden: true,
redirect: '/dp/home',
component: ScreenMonitor,
meta: {
@ -719,13 +718,13 @@ export const asyncRouter = [
]
},
{
path: '/plan/usertool',
component: PlanMonitorEditUserTool,
meta: {
},
hidden: true
},
{
path: '/plan/usertool',
component: PlanMonitorEditUserTool,
meta: {
},
hidden: true
},
{
path: '/plan/tool',
component: PlanMonitorEditTool,
meta: {
@ -736,7 +735,7 @@ export const asyncRouter = [
path: '/plan',
redirect: '/plan/home',
component: PlanMonitor,
hidden: true,
hidden: true,
meta: {
roles: [admin, user, userDesign]
},
@ -764,7 +763,7 @@ export const asyncRouter = [
{
path: '/replay',
component: Layout,
hidden: true,
hidden: true,
meta: {
roles: [admin, userDesign]
},
@ -970,25 +969,25 @@ export const asyncRouter = [
},
children: [
{
path: 'skinCode',
component: SkinCode,
meta: {
i18n: 'router.skinManage'
}
},
{
path: 'skinCode/draft/:mode/:skinCodeId',
hidden: true,
component: SkinCodeDraft
},
{
path: 'ibp/edit',
component: IbpEdit,
meta: {
i18n: 'router.ibpDraw'
}
},
{
path: 'skinCode',
component: SkinCode,
meta: {
i18n: 'router.skinManage'
}
},
{
path: 'skinCode/draft/:mode/:skinCodeId',
hidden: true,
component: SkinCodeDraft
},
{
path: 'ibp/edit',
component: IbpEdit,
meta: {
i18n: 'router.ibpDraw'
}
},
{
path: 'dictionary',
component: Dictionary,
meta: {
@ -1046,37 +1045,37 @@ export const asyncRouter = [
}
}
]
},
{
path: '/apply',
component: Layout,
meta: {
i18n: 'router.releaseApplication',
roles: [admin, userDesign]
},
children: [
{
path: 'lesson',
component: LessonApproval,
meta: {
i18n: 'router.courseApplication'
}
},
{
path: 'script',
component: ScriptApproval,
meta: {
i18n: 'router.scriptReleaseApplication'
}
},
{
path: 'runGraph',
component: runPlanApproval,
meta: {
i18n: 'router.runGraphReleaseApplication'
}
}
]
},
{
path: '/apply',
component: Layout,
meta: {
i18n: 'router.releaseApplication',
roles: [admin, userDesign]
},
children: [
{
path: 'lesson',
component: LessonApproval,
meta: {
i18n: 'router.courseApplication'
}
},
{
path: 'script',
component: ScriptApproval,
meta: {
i18n: 'router.scriptReleaseApplication'
}
},
{
path: 'runGraph',
component: runPlanApproval,
meta: {
i18n: 'router.runGraphReleaseApplication'
}
}
]
}
];

View File

@ -67,9 +67,9 @@ export function handleToken() {
const path = window.location.href;
if (path.includes('/dp/') || path.includes('/display/dp')) {
return getScreenToken();
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/plan') || path.includes('/display/manage') || path.includes('/apply/')) {
} else if (path.includes('/design') || path.includes('/scriptDisplay') || path.includes('/publish') || path.includes('/orderauthor') || path.includes('/system') || path.includes('/display/manage') || path.includes('/apply/')) {
return getDesignToken();
} else if (path.includes('/plan')) {
} else if (path.includes('/plan') || path.includes('/display/plan')) {
return getDesignToken() || getToken();
} else {
return getToken();

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -196,7 +196,7 @@ export default {
this.loading = false;
},
statusMessage(val) {
this.$ibp.setDeviceStatus(val);
this.$ibp && this.$ibp.setDeviceStatus(val);
}
}
};

View File

@ -278,7 +278,7 @@ export default {
}else{
this.isNotUser=true;
}
},
computed: {
...mapGetters('training', [

View File

@ -27,11 +27,19 @@ export default {
name: 'PlanStatusBar',
data() {
return {
isNotUser:true
};
},
watch: {
},
created(){
if(/^\/plan\/usertool/.test(this.$route.fullPath)){
this.isNotUser=false;
}else{
this.isNotUser=true;
}
},
methods: {
showTrain() {
this.$emit('showTrain');