Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

 Conflicts:
	src/utils/baseUrl.js
This commit is contained in:
fan 2022-10-11 09:56:28 +08:00
commit a51d2348a4
20 changed files with 1708 additions and 567 deletions

View File

@ -2,6 +2,8 @@
<div id="app">
<router-view />
<deomon-topic ref="deomonTopic" />
<deomon-list ref="deomonList" @enterQcode="qcodeEntry" />
<qcode ref="qcode" />
<img v-show="loading" :src="loadingImg" class="AppAll">
<div
v-if="!$store.state.user.baseUrl"
@ -25,11 +27,15 @@ import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import LoadingImg from '@/assets/loading.gif';
import AppLoading from '@/assets/appLoading.png';
import { openIndexedDB } from '@/utils/indexedDb';
import DeomonList from '@/views/demonstration/deomonList/index';
import Qcode from '@/layout/components/Qcode.vue';
export default {
name: 'App',
components: {
DeomonTopic
DeomonTopic,
DeomonList,
Qcode
},
mixins: [
WindowResizeHandler
@ -67,6 +73,11 @@ export default {
},
'$store.state.app.animationsCloseCount': function(val) {
this.loading = false;
},
'$route': function(val) {
if (val.path == '/trainingPlatform/multiplayerSimulation') {
this.quickEntry();
}
}
},
created() {
@ -100,6 +111,12 @@ export default {
this.$store.dispatch('subscribe_un', {});
},
methods: {
quickEntry() {
this.$refs.deomonList.doShow();
},
qcodeEntry() {
this.$refs.qcode.doShow();
},
resizeHandler() {
this.$store.dispatch('app/resize', { width: this._clientWidth, height: this._clientHeight });
},

View File

@ -93,3 +93,23 @@ export function getLoginInfo(token) {
}
});
}
/**
* 获取用户所属组织列表
*/
export function getOrgList() {
return request({
url: '/api/org/list',
method: 'get'
})
}
/**
* 登入组织
*/
export function selectOrgnization(orgId) {
return request({
url: `/api/org/signIn/${orgId}`,
method: 'put'
})
}

View File

@ -143,3 +143,11 @@ export function checkFrontProjectExist(params) {
params
});
}
//
export function getUploadUrl(params) {
return request({
url: `/api/minio/preSignedUrl`,
method: 'get',
params
});
}

View File

@ -29,6 +29,7 @@ import systemGenerate from './systemGenerate';
import login from './login';
import designPlatform from './designPlatform';
import trainingManage from './trainingManage';
import newRouter from './newRouter';
export default {
enLocale,
@ -61,5 +62,6 @@ export default {
systemGenerate,
login,
designPlatform,
trainingManage
trainingManage,
newRouter
};

View File

@ -0,0 +1,44 @@
export default {
simulation: 'simulation',
multiplayerSimulation: 'Many simulation',
regulationSimulation: 'Regulation of the simulation',
teachingManagement: 'teaching management',
classroom: 'classroom management',
student: 'student management',
theory: 'The theory of management',
training: 'Practical teaching management',
exam: 'examination management',
lineDesign: 'track design',
case: 'case',
SystemManagement: 'System management',
SystemDataManagement: 'System data management',
dataDictionary: 'Data dictionary',
SystemAccountManagement: 'System Account Management',
ThirdPartyAccounts: 'Configuring Third-Party Accounts',
OnlineInformationManagement: 'Online information management',
loginUser: 'Online users',
cacheDataManage: 'Cache data management',
simulationManage: 'simulation management',
companyUserManage: 'Organization User Management',
companyManage: 'Company manage',
lineDataManage: 'Line data management',
lineTypeManage: 'Line type management',
linePacketManage: 'Line packet management',
teachingDataManage: 'Teaching data management',
theoryData: 'Theoretical topic data management',
trainingDataManage: 'Training data management',
examData: 'Examination data management',
userTrainingDataManage: 'User training data management',
userExamData: 'User test data management',
projectDataManage: 'Project data management',
projectManage: 'Project Manage',
projectConfig: 'Project client configuration',
projectDeviceManage: 'Project equipment management',
permissionDataManage: 'Permission Data Management',
permissionManage: 'Permission',
authorityTransferManage: 'Privilege distribution management',
userRulesManage: 'User Rights Statistics',
fileManage: 'File Manage',
frontResourceManage: 'Front-end Resource Management',
iscsPrerecordManage: 'ISCS Advance record management'
};

View File

@ -29,6 +29,7 @@ import systemGenerate from './systemGenerate';
import login from './login';
import designPlatform from './designPlatform';
import trainingManage from './trainingManage';
import newRouter from './newRouter';
export default {
cnLocale,
@ -61,5 +62,6 @@ export default {
systemGenerate,
login,
designPlatform,
trainingManage
trainingManage,
newRouter
};

View File

@ -0,0 +1,44 @@
export default {
simulation: '仿真',
multiplayerSimulation: '多人仿真',
regulationSimulation: '监管仿真',
teachingManagement: '教学管理',
classroom: '班级管理',
student: '学生管理',
theory: '理论题目管理',
training: '实训教学管理',
exam: '考试管理',
lineDesign: '线路设计',
case: '案例管理',
SystemManagement: '系统管理',
SystemDataManagement: '系统数据管理',
dataDictionary: '数据字典',
SystemAccountManagement: '系统账户管理',
ThirdPartyAccounts: '第三方账户配置',
OnlineInformationManagement: '在线信息管理',
loginUser: '在线用户',
cacheDataManage: '缓存数据管理',
simulationManage: '仿真管理',
companyUserManage: '组织用户管理',
companyManage: '组织管理',
lineDataManage: '线路数据管理',
lineTypeManage: '线路类型管理',
linePacketManage: '线路分组管理',
teachingDataManage: '教学数据管理',
theoryData: '理论题数据管理',
trainingDataManage: '实训数据管理',
examData: '考试数据管理',
userTrainingDataManage: '用户实训数据管理',
userExamData: '用户考试数据管理',
projectDataManage: '项目数据管理',
projectManage: '项目管理',
projectConfig: '项目客户端配置',
projectDeviceManage: '项目设备管理',
permissionDataManage: '权限数据管理',
permissionManage: '权限管理',
authorityTransferManage: '权限分发管理',
userRulesManage: '用户权限管理',
fileManage: '文件管理',
frontResourceManage: '前端资源管理',
iscsPrerecordManage: 'ISCS预录管理'
};

View File

@ -11,6 +11,7 @@
@select="handleSelect"
>
<system-title />
<div class="centerNullMenu" />
<template v-for="(item, idx) in routers">
<template v-if="!item.hidden&&item.children">
<template v-if="hasOneScreenShowingChildren(item.children) &&!item.alwaysShow">
@ -41,13 +42,13 @@
<template v-for="(child,cdx) in item.children">
<template v-if="!child.hidden">
<template v-if="child.children&&child.children.length>0&&hasShowingChildren(child.children)">
<el-submenu :key="cdx" :index="child.path" :show-timeout="100">
<el-submenu :key="cdx" :index="child.path" :show-timeout="100" popper-class="grandChildClass">
<template slot="title">
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</template>
<template v-for="(grandchild,gdx) in child.children">
<template v-if="!grandchild.hidden">
<template :to="child.path+'/'+grandchild.path">
<template v-if="!grandchild.children" :to="child.path+'/'+grandchild.path">
<el-menu-item :key="gdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path)">
<span
v-if="grandchild.meta"
@ -55,11 +56,25 @@
>{{ $t(grandchild.meta.i18n) }}</span>
</el-menu-item>
</template>
<template v-else :to="child.path+'/'+grandchild.path">
<el-submenu v-for="(mgChild,mgdx) in grandchild.children" :key="mgdx" :index="mgChild.path" :show-timeout="100">
<template slot="title">
<span v-if="mgChild.meta" slot="title">{{ $t(mgChild.meta.i18n) }}</span>
</template>
<el-menu-item :key="mgdx" :index="item.redirect ? item.redirect : (child.path+'/'+grandchild.path + '/' + mgChild.path)">
<span
v-if="mgChild.meta"
slot="title"
>{{ $t(mgChild.meta.i18n) }}</span>
</el-menu-item>
</el-submenu>
</template>
</template>
</template>
</el-submenu>
</template>
<template v-else :to="item.path+'/'+child.path">
<!-- <el-menu-item :key="cdx" :index="item.redirect ? item.redirect : (item.path+'/'+child.path)" :route="(child.route && child.route()) ? child.route() : null"> -->
<el-menu-item :key="cdx" :index="item.redirect ? item.redirect : (item.path+'/'+child.path)">
<span v-if="child.meta" slot="title">{{ $t(child.meta.i18n) }}</span>
</el-menu-item>
@ -70,7 +85,7 @@
</template>
</template>
<div v-if="!thirdLogin" class="rightGroup">
<quick-entry ref="quickEntry" />
<!-- <quick-entry ref="quickEntry" /> -->
<user-logout ref="userLogout" />
</div>
</el-menu>
@ -171,9 +186,10 @@ export default {
$height: 61px;
.rightGroup{
position: absolute;
right: 35px;
// position: absolute;
// right: 35px;
display: inline-block;
padding: 0 35px;
}
.navbar {
@ -181,7 +197,11 @@ export default {
line-height: $height;
padding-left: 30px;
border-radius: 0px !important;
display: flex;
.centerNullMenu {
display: flex;
flex: 1;
}
.image-container {
line-height: $height;
height: $height;
@ -214,4 +234,7 @@ export default {
margin-right:20px;
font-size:14px;
}
/deep/ .grandChildClass {
left: -210px !important;
}
</style>

View File

@ -1,34 +1,36 @@
import Vue from 'vue';
import store from '@/store/index';
import router from './router/index';
import {loginInfo, ProjectCode, localPackageProject} from '@/scripts/ProjectConfig';
// import {loginInfo, ProjectCode, localPackageProject} from '@/scripts/ProjectConfig';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { setToken, getToken, removeToken, getSessionStorage, setSessionStorage } from '@/utils/auth';
import { getBaseUrlByProject } from '@/api/projectServer';
// import { getBaseUrlByProject } from '@/api/projectServer';
import localStore from 'storejs';
import { handlerUrl } from '@/utils/baseUrl';
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
const whiteList = ['/login', '/design/login', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
const whiteList = ['/login', '/design/login', '/loginNew', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
const loginList = ['/login', '/design/login']; // 登陆页面
const loginList = ['/login', '/design/login', '/loginNew']; // 登陆页面
for (const val in loginInfo) {
if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) {
whiteList.push(loginInfo[val].loginPath);
}
}
// for (const val in loginInfo) {
// if (loginInfo[val].loginPath && !whiteList.includes(loginInfo[val].loginPath)) {
// whiteList.push(loginInfo[val].loginPath);
// }
// }
// 登录路径判断获取
function getRouteInfo(to) {
function getRouteInfo(to, markKey) {
let loginPath = '';
const toRoutePath = to.redirectedFrom || to.path;
const current_session = getSessionStorage('project');
// const current_session = getSessionStorage('project');
if (loginList.includes(toRoutePath)) { // 登陆页面清空 token
removeToken();
}
const localLogin = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl';
loginPath = loginInfo[current_session] && !localLogin ? loginInfo[current_session].loginPath : whiteList[0];
// const localLogin = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl';
// loginPath = loginInfo[current_session] && !localLogin ? loginInfo[current_session].loginPath : whiteList[0];
loginPath = markKey == 'login' ? '/login' : '/login?project=' + markKey;
if (to.query.projectDevice && to.query.type && loginPath.includes('?')) {
loginPath = `${loginPath}&projectDevice=${to.query.projectDevice}&type=${to.query.type}`;
} else if (to.query.projectDevice && to.query.type) {
@ -76,48 +78,54 @@ function subscribe() {
}
}
router.beforeEach( async (to, from, next) => {
// 判断第三方登陆
if (to.query.thirdJump) {
setToken(to.query.key);
setSessionStorage('project', to.query.project);
}
let project = '';
let project;
// 登陆页面
if (to.path.includes('login')) {
project = to.query.project;
const split = to.path.split('/')[1];
if (process.env.VUE_APP_PRO && process.env.VUE_APP_PRO !== 'local-test') {
project = localPackageProject[process.env.VUE_APP_PRO + split];
} else if (split == 'design') {
project = project ? split + project : split;
} else if (split == 'login') {
project = project || 'login';
} else {
project = split;
}
project = to.query.project || 'login';
} else if (to.path.includes('thirdLogin')) {
// 第三方登陆页面
project = to.query.project;
} else {
project = getSessionStorage('project');
// 登陆成功页面
project = getSessionStorage('project') || 'login';
}
if (!store.state.user.baseUrl && project && loginInfo[project]) {
try {
const resp = await getBaseUrlByProject(ProjectCode[project]);
const urlData = handlerUrl(resp.data);
store.dispatch('setBaseUrl', urlData.BASE_API);
store.dispatch('setResourcesUrl', urlData.VOICE_API);
store.dispatch('setUploadUrl', urlData.UPLOAD_API);
store.dispatch('setBaseSite', urlData.BASE_SITE);
subscribe();
} catch (e) {
// if (to.path.includes('login')) {
// project = to.query.project;
// const split = to.path.split('/')[1];
// if (process.env.VUE_APP_PRO && process.env.VUE_APP_PRO !== 'local-test') {
// project = localPackageProject[process.env.VUE_APP_PRO + split];
// } else if (split == 'design') {
// project = project ? split + project : split;
// } else if (split == 'login') {
// project = project || 'login';
// } else {
// project = split;
// }
// } else if (to.path.includes('thirdLogin')) {
// project = to.query.project;
// } else {
// project = getSessionStorage('project');
// }
const response = await getFrontProjectConfigByLogin(project);
if (response.data) {
const {browserTitle, loginProLogo, baseApiUrl, baseSite, ossUrl} = response.data.viewSetting;
if (!store.state.user.baseUrl && project) {
const urlData = handlerUrl();
store.dispatch('setBaseUrl', urlData.BASE_API);
console.error(e);
store.dispatch('setBaseUrl', baseApiUrl || urlData.BASE_API);
store.dispatch('setBaseSite', baseSite || urlData.BASE_SITE);
store.dispatch('setOssUrl', ossUrl || urlData.OSS_URL);
subscribe();
}
}
document.title = loginInfo[project || 'login'] ? loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title : '';
document.title = browserTitle;
document.querySelector("link[rel*='icon']").href = loginProLogo ? '/oss-rtss/logo/' + loginProLogo : '';
NProgress.start();
const loginPath = getRouteInfo(to);
const loginPath = getRouteInfo(to, response.data.markKey);
const token = to.query.token;
if (/demoTraining/.test(to.path) && token) {
const header = { group: to.query.group, 'X-Token': token };
setToken(token);
@ -143,6 +151,7 @@ router.beforeEach( async (to, from, next) => {
next(loginPath);
}
}
}
});
NProgress.configure({

View File

@ -7,6 +7,8 @@ Vue.use(Router);
/* Layout */
const Layout = () => import('@/layout');
const Login = () => import('@/views/login/index');
const LoginNew = () => import('@/views/login_new/index');
const Authorization = () => import('@/views/authorization/index');
const AuthorApply = () => import('@/views/authorization/apply');
const AuthorList = () => import('@/views/authorization/list');
@ -214,7 +216,10 @@ const FrontProjectConfigManage = () => import('@/views/system/frontProjectConfig
const IscsDeviceManage = () => import('@/views/system/iscsDeviceManage');
const IscsResourcesManage = () => import('@/views/system/iscsResourcesManage');
const PisScreen = () => import('@/views/pis/index')
const PisScreen = () => import('@/views/pis/index');
const Case = () => import('@/views/case/index');
const TransitionIndex = () => import('@/views/temporary/transitionIndex');
const Temporary = () => import('@/views/temporary/index');
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth';
@ -288,6 +293,12 @@ export const constantRoutes = [
component: Login,
hidden: true
},
// 新版平台登录页面
{
path: '/loginNew',
component: LoginNew,
hidden: true
},
// 设计平台登录
{
path: '/design',
@ -1531,6 +1542,214 @@ export const asyncRouter = [
hidden: true
}
]
},
{ // 新路由-仿真菜单
path: '/trainingPlatform',
component: Layout,
meta: {
i18n: 'newRouter.simulation',
roles: [admin, user, userTrainingPlatform]
},
children: [
{
path: '',
component: TrainingPlatform,
// route: { path: '/simulation/trainingPlatform/detail' },
meta: {
i18n: 'newRouter.simulation'
},
children: [
{
path: 'detail/:subSystem',
component: DemonstrationDetail,
meta: {},
hidden: true
}
]
},
{
path: 'multiplayerSimulation',
// component: multiplayerSimulation,
meta: {
i18n: 'newRouter.multiplayerSimulation'
}
},
{
path: 'regulationSimulation',
component: Temporary,
meta: {
i18n: 'newRouter.regulationSimulation'
}
}
]
},
{ // 新路由-教学管理菜单
path: '/teachingManagement',
component: Layout,
meta: {
i18n: 'newRouter.teachingManagement',
roles: [admin, user, userTrainingPlatform]
},
children: [
{
path: 'classroom',
// component: Classroom,
meta: {
i18n: 'newRouter.classroom'
}
},
{
path: 'student',
// component: Student,
meta: {
i18n: 'newRouter.student'
}
},
{
path: 'theory',
// component: Theory,
meta: {
i18n: 'newRouter.theory'
}
},
{
path: 'training',
// component: Training,
meta: {
i18n: 'newRouter.training'
}
},
{
path: 'exam',
// component: Exam,
meta: {
i18n: 'newRouter.exam'
}
}
]
},
{ // 新路由-线路设计
path: '/design',
component: Layout,
meta: {
i18n: 'newRouter.lineDesign',
roles: [admin, user, userTrainingPlatform]
},
children: [
{
path: 'usermap',
redirect: '/design/usermap/home',
component: NewDesignPlatformUser,
meta: {
i18n: 'newRouter.lineDesign'
},
children: [
{
path: 'home',
component: DesignPlatformHome,
hidden: true,
meta: {
}
}
]
}
]
},
{ // 新路由-案例
path: '/case',
component: Layout,
meta: {
i18n: 'newRouter.case',
roles: [admin, user, userTrainingPlatform]
},
children: [
{
path: 'index',
component: Case,
meta: {
i18n: 'newRouter.case'
}
}
]
},
{ // 新路由-系统管理
path: '/system',
component: Layout,
meta: {
i18n: 'newRouter.SystemManagement',
roles: [admin, userTrainingPlatform]
},
children: [
{
path: '/systemDataManagement',
component: TransitionIndex,
meta: {
i18n: 'newRouter.SystemDataManagement'
},
children: [
{
path: 'dictionary',
component: Dictionary,
meta: {
i18n: 'newRouter.dataDictionary'
}
},
{
path: 'userManage',
component: UserControl,
meta: {
i18n: 'newRouter.SystemAccountManagement'
}
},
{
path: 'ThirdPartyAccounts',
component: Temporary,
meta: {
i18n: 'newRouter.ThirdPartyAccounts'
}
}
]
},
{
path: '/OnlineInformationManagement',
component: TransitionIndex,
meta: {
i18n: 'newRouter.OnlineInformationManagement'
},
children: [
{
path: 'loginUserManage',
component: LoginUserControl,
meta: {
i18n: 'newRouter.loginUser'
}
},
{
path: 'CacheControl',
component: CacheControl,
meta: {
i18n: 'newRouter.cacheDataManage'
}
},
{
path: 'existingSimulation',
component: ExistingSimulation,
meta: {
i18n: 'newRouter.simulationManage'
}
}
]
},
{
path: 'companyUserManage',
component: DeviceManage,
meta: {
i18n: 'newRouter.companyUserManage'
}
}
]
}
];
/* merge 是否再路由处理中与asyncRouter进行合并 mergeIndex合并进入asyncRouter【mergeIndex】 慎重调整asyncRouter顺序 */

View File

@ -23,8 +23,9 @@ const user = {
companyName: '',
companyProjectList: [],
baseUrl:'',
resourcesUrl: '',
uploadUrl: '',
// resourcesUrl: '',
// uploadUrl: '',
ossUrl:'',
baseSite: ''
},
@ -86,11 +87,14 @@ const user = {
setBaseUrl: (state, baseUrl) => {
state.baseUrl = baseUrl;
},
setResourcesUrl: (state, resourcesUrl) => {
state.resourcesUrl = resourcesUrl;
},
setUploadUrl: (state, uploadUrl) => {
state.uploadUrl = uploadUrl;
// setResourcesUrl: (state, resourcesUrl) => {
// state.resourcesUrl = resourcesUrl;
// },
// setUploadUrl: (state, uploadUrl) => {
// state.uploadUrl = uploadUrl;
// },
setOssUrl: (state, ossUrl) => {
state.ossUrl = ossUrl;
},
setBaseSite: (state, baseSite) => {
state.baseSite = baseSite;
@ -226,11 +230,14 @@ const user = {
setBaseUrl ({commit}, baseUrl) {
commit('setBaseUrl', baseUrl);
},
setResourcesUrl({commit}, resourcesUrl) {
commit('setResourcesUrl', resourcesUrl);
},
setUploadUrl({commit}, uploadUrl) {
commit('setUploadUrl', uploadUrl);
// setResourcesUrl({commit}, resourcesUrl) {
// commit('setResourcesUrl', resourcesUrl);
// },
// setUploadUrl({commit}, uploadUrl) {
// commit('setUploadUrl', uploadUrl);
// },
setOssUrl({commit}, ossUrl) {
commit('setOssUrl', ossUrl);
},
setBaseSite({commit}, baseSite) {
commit('setBaseSite', baseSite);

View File

@ -16,56 +16,102 @@
// }
// return BASE_API;
// }
export function handlerUrl(data) {
export function handlerUrl() {
let BASE_API;
let VOICE_API;
let UPLOAD_API;
let BASE_SITE;
let OSS_URL;
if (process.env.NODE_ENV === 'development') {
// const data = null;
// 开发分支
BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.3.90:9100'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
// BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
// BASE_API = data && data.domainName ? 'https://' + data.domainName : BASE_API;
BASE_API = data && data.domainName ? 'http://' + data.domainName : BASE_API;
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
UPLOAD_API = 'http://joylink.club/jlfile';
BASE_SITE = 'https://test.joylink.club/cbtc';
OSS_URL = 'https://192.168.3.233/oss-rtss';
} else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') {
BASE_API = 'https://192.168.3.233/rtss-server';
VOICE_API = 'https://192.168.3.233/oss/joylink';
UPLOAD_API = 'https://192.168.3.233';
BASE_SITE = '/cbtc';
// 本地打包测试分支
BASE_API = 'https://192.168.3.233/rtss-server'; // api地址
BASE_SITE = 'https://192.168.3.233/cbtc'; // 前端项目地址
OSS_URL = 'https://192.168.3.233/oss-rtss'; // 资源地址
} else if (process.env.NODE_ENV === 'test') {
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud';
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
UPLOAD_API = 'http://joylink.club/jlfile';
// 测试分支
BASE_API = 'https://test.joylink.club/jlcloud';
BASE_SITE = 'https://test.joylink.club/cbtc';
OSS_URL = 'https://joylink.club/oss-rtss'; // 资源地址
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') {
// 本地打包分支
BASE_API = 'http://160.20.60.15:9000';
VOICE_API = 'http://160.20.60.15/oss/joylink';
UPLOAD_API = 'http://160.20.60.15';
BASE_SITE = 'http://160.20.60.15';
} else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'ntyl') {
BASE_API = 'https://joylink.club/jlcloud';
VOICE_API = 'https://joylink.club/oss/joylink';
UPLOAD_API = 'http://joylink.club/jlfile';
BASE_SITE = 'https://joylink.club/cbtc';
OSS_URL = 'https://joylink.club/oss-rtss';
} else if (process.env.NODE_ENV === 'production') {
BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://joylink.club/jlcloud';
VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
UPLOAD_API = 'http://joylink.club/jlfile';
// 远程发布分支
BASE_API = 'https://joylink.club/jlcloud';
BASE_SITE = 'https://joylink.club/cbtc';
OSS_URL = 'https://joylink.club/oss-rtss';
}
const PROD_API = 'https://joylink.club/jlcloud';
return {BASE_API, VOICE_API, UPLOAD_API, BASE_SITE, PROD_API};
// VOICE_API, UPLOAD_API, BASE_SITE, PROD_API
return {BASE_API, BASE_SITE, OSS_URL};
}
// export function handlerUrl(data) {
// let BASE_API;
// let VOICE_API;
// let UPLOAD_API;
// let BASE_SITE;
// if (process.env.NODE_ENV === 'development') {
// // const data = null;
// // BASE_API = 'https://joylink.club/jlcloud';
// // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.233/rtss-server';
// // BASE_API = 'http://114.116.51.125/jlcloud';
// // BASE_API = 'http://192.168.3.90:9100'; // 周寅
// // BASE_API = 'http://192.168.3.94:9000'; // 旭强
// // BASE_API = 'http://192.168.3.15:9000'; // 张赛
// // BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
// // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// // BASE_API = 'http://b29z135112.zicp.vip';
// // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
// // BASE_API = data && data.domainName ? 'https://' + data.domainName : BASE_API;
// BASE_API = data && data.domainName ? 'http://' + data.domainName : BASE_API;
// VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
// // UPLOAD_API = 'http://joylink.club/jlfile';
// BASE_SITE = 'https://test.joylink.club/cbtc';
// } else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') {
// BASE_API = 'https://192.168.3.233/rtss-server';
// VOICE_API = 'https://192.168.3.233/oss/joylink';
// UPLOAD_API = 'https://192.168.3.233';
// BASE_SITE = '/cbtc';
// } else if (process.env.NODE_ENV === 'test') {
// BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud';
// VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
// UPLOAD_API = 'http://joylink.club/jlfile';
// BASE_SITE = 'https://test.joylink.club/cbtc';
// } else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') {
// BASE_API = 'http://160.20.60.15:9000';
// VOICE_API = 'http://160.20.60.15/oss/joylink';
// UPLOAD_API = 'http://160.20.60.15';
// BASE_SITE = 'http://160.20.60.15';
// } else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'ntyl') {
// BASE_API = 'https://joylink.club/jlcloud';
// VOICE_API = 'https://joylink.club/oss/joylink';
// UPLOAD_API = 'http://joylink.club/jlfile';
// BASE_SITE = 'https://joylink.club/cbtc';
// } else if (process.env.NODE_ENV === 'production') {
// BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://joylink.club/jlcloud';
// VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink';
// UPLOAD_API = 'http://joylink.club/jlfile';
// BASE_SITE = 'https://joylink.club/cbtc';
// }
// const PROD_API = 'https://joylink.club/jlcloud';
// return {BASE_API, VOICE_API, UPLOAD_API, BASE_SITE, PROD_API};
// }

View File

@ -28,13 +28,16 @@ service.interceptors.request.use(config => {
// 用于/demo/index 文件中baseUrl 判断(后端要求不管本地还是正式,都要可以访问实训/临时使用)
if (store.state.user.baseUrl) {
config.baseURL = store.state.user.baseUrl;
} else {
config.baseURL = urlData.BASE_API;
}
if (config.upload) {
config.baseURL = urlData.UPLOAD_API;
}
if (config.production) {
config.baseURL = urlData.PROD_API;
}
// if (config.upload) {
// config.baseURL = urlData.UPLOAD_API;
// }
// if (config.production) {
// config.baseURL = urlData.PROD_API;
// }
if (config.time) {
config.timeout = config.time; // 让每个请求携带自定义token 请根据实际情况自行修改
}

75
src/views/case/index.vue Normal file
View File

@ -0,0 +1,75 @@
<template>
<div class="quick-entry">
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
export default {
name: 'Case',
components: {},
data() {
return {
caseList: [
{
name: '西安铁路职业技术学院',
url: 'https://joylink.club/oss/portal/cases/西安铁路职业技术学院.pdf'
},
{
name: '贵州装备制造职业学院',
url: 'https://joylink.club/oss/portal/cases/贵州装备制造职业学院机电技术专业实训室建设.pdf'
},
{
name: '江苏电子信息职业学院',
url: 'https://joylink.club/oss/portal/cases/江苏电子信息职业学院-城市轨道交通行车组织综合实训室.pdf'
}
],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '100px',
reset: true,
show:false
},
queryList: {
data: [],
selectCheckShow: false,
paginationHiden: true,
indexShow: true,
height: 500,
columns: [
{
title: '案例名称',
prop: 'name'
},
{
title: '描述',
prop: 'description'
},
{
type: 'button',
title: '操作',
width: '150',
buttons: [
{
name: '查看',
handleClick: this.handleClick,
type: 'primary'
}
]
}
]
}
};
},
created() {
this.queryList.data = this.caseList;
},
methods: {
handleClick(index, row) {
window.open(row.url, '_blank');
}
}
};
</script>

View File

@ -3,23 +3,26 @@
<div
v-loading="syncLogin && !loadingCode"
class="login-container"
:style="{'background-image': 'url('+bgImg+')'}"
:style="{ 'background-image': 'url(' + bgImg + ')' }"
element-loading-spinner="el-icon-loading"
:element-loading-text="loadingText"
element-loading-background="rgba(0, 0, 0, 0)"
>
<div v-if="loginTitle && !syncLogin" :class="project.endsWith('heb')||project.endsWith('ntyl')?'text-box':'left-logo-box'">
<img class="logo" :src="logoImg" :style="{width: logoWidth}">
<span>{{ loginTitle==='空串'?'':loginTitle }}</span>
<div
v-if="loginTitle && !syncLogin"
:class="project.endsWith('heb') || project.endsWith('ntyl') ? 'text-box' : 'left-logo-box'"
>
<img class="logo" :src="logoImg" :style="{ width: logoWidth }">
<span>{{ loginTitle === '空串' ? '' : loginTitle }}</span>
</div>
<div v-if="!syncLogin" class="language_box">
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
</el-tooltip>
</div>
<div v-if="!syncLogin" class="content-box" :style="noQrcodeList.includes(project)?'width: 450px;':''">
<div v-if="isProject && !syncLogin" class="text-box" :style="{top: titleDistance}">
<img v-if="!loginTitle" class="logo" :src="logoImg" :style="{width: titleImgWidth}">
<div v-if="!syncLogin" class="content-box" :style="noQrcodeList.includes(project) ? 'width: 450px;' : ''">
<div v-if="isProject && !syncLogin" class="text-box" :style="{ top: titleDistance }">
<img v-if="!loginTitle" class="logo" :src="logoImg" :style="{ width: titleImgWidth }">
<span>{{ title }}</span>
</div>
<div v-if="!noQrcodeList.includes(project)" class="qrcode-main">
@ -39,22 +42,41 @@
</div>
<div class="tip-info">
<fieldset>
<legend>{{ $t('login.recommendedConfiguration') }}</legend>
<legend>
{{ $t('login.recommendedConfiguration') }}
</legend>
<span>{{ $t('login.browser') }}
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">{{ $t('login.googleChrome') }}</a>
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">{{
$t('login.googleChrome')
}}</a>
</span>
<br>
<span>{{ $t('login.screenResolution') + '1920*1080' }}</span>
</fieldset>
</div>
</div>
<el-form ref="loginForm" v-loading="loading" class="login-form" :model="loginForm" :rules="loginRules" label-position="left">
<div v-if="!isProject&&!project.endsWith('heb')" class="title_box">{{ $t('login.welcomeTo') + title }}</div>
<el-form
ref="loginForm"
v-loading="loading"
class="login-form"
:model="loginForm"
:rules="loginRules"
label-position="left"
>
<div v-if="!isProject && !project.endsWith('heb')" class="title_box">
{{ $t('login.welcomeTo') + title }}
</div>
<el-form-item prop="username" class="item_form_box">
<span class="svg-container svg-container_login">
<svg-icon icon-class="user" />
</span>
<el-input v-model="loginForm.username" name="username" type="text" :placeholder="this.$t('login.mobilePhoneNumberOrEmail')" @keyup.enter.native="goToNext" />
<el-input
v-model="loginForm.username"
name="username"
type="text"
:placeholder="this.$t('login.mobilePhoneNumberOrEmail')"
@keyup.enter.native="goToNext"
/>
</el-form-item>
<el-form-item prop="password" class="item_form_box item_form_password">
<span class="svg-container">
@ -89,11 +111,17 @@
>
<div>
<img :src="QCode" alt="" style="width: 100px; height: 100px; display: block; margin:0 auto;">
<div style="margin-top: 10px; word-break: break-word;text-align: center;">{{ $t('login.perfectInformation') }}</div>
<div style="margin-top: 10px; word-break: break-word;text-align: center;">
{{ $t('login.perfectInformation') }}
</div>
</div>
<div slot="reference">
{{ $t('login.unableToLogin') }}
</div>
<div slot="reference">{{ $t('login.unableToLogin') }}</div>
</el-popover>
<div v-if="registerCodeList.includes(project)" class="popover_box active" @click="registerUser">注册账号</div>
<div v-if="registerCodeList.includes(project)" class="popover_box active" @click="registerUser">
注册账号
</div>
</div>
<el-form-item>
<el-button type="primary" style="width:100%;" @click.native.prevent="handleLogin">
@ -101,7 +129,9 @@
</el-button>
</el-form-item>
<div style="display: inline-block;width: 100%;">
<div class="popover_box active" style="bottom: 50px;" @click="forgetPassword">忘记密码</div>
<div class="popover_box active" style="bottom: 50px;" @click="forgetPassword">
忘记密码
</div>
</div>
</el-form>
</div>
@ -112,13 +142,18 @@
<div v-if="project.endsWith('xadt')" style="position: absolute; bottom: 10px;right: 20px; font-size: 14px;">
<span>本产品由西安地铁李乐工作室与北京玖琏科技有限公司联合开发</span>
</div>
<div v-if="project === 'drts'" style="position: absolute; bottom: 50px; font-size: 20px;right: 20px;color:#3D3D3D;width: 370px;">
<div
v-if="project === 'drts'"
style="position: absolute; bottom: 50px; font-size: 20px;right: 20px;color:#3D3D3D;width: 370px;"
>
<el-row>
<el-col :span="6">
<img :src="wchatImg" width="80" height="80">
</el-col>
<el-col :span="18" style="text-align: left">
<div style="margin-top: 10px">服务电话13910989830</div>
<div style="margin-top: 10px">
服务电话13910989830
</div>
<!--<div style="margin-top: 10px">截止日期2020年12月31日</div>-->
</el-col>
</el-row>
@ -132,6 +167,7 @@
</div>
<register ref="register" />
<forget-password ref="forgetPassword" />
<OrgSelect ref="orgSelect" />
</div>
</template>
@ -141,7 +177,7 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
import QrcodeVue from 'qrcode.vue';
import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login';
import { getLoginWmurl, checkLoginStatus, getLoginInfo, getOrgList, selectOrgnization } from '@/api/login';
import { LoginParams } from '@/utils/login';
import bgImg from '@/assets/bg1.jpg';
import bgIbpImg from '@/assets/bg_ibp.png';
@ -152,7 +188,17 @@ import bgPsdImg from '@/assets/bg_psd.png';
import HandRight from '@/assets/hand-o-right.png';
import wchat from '@/assets/wchat.png';
import { UrlConfig } from '@/scripts/ConstDic';
import { loginInfo, ProjectIcon, ProjectLoginStyleList, VersionBaseNoShow, MainBodyNoShow, NoQrcodeList, localPackageProject, RegisterCodeList, RealCctvList} from '@/scripts/ProjectConfig';
import {
loginInfo,
ProjectIcon,
ProjectLoginStyleList,
VersionBaseNoShow,
MainBodyNoShow,
NoQrcodeList,
localPackageProject,
RegisterCodeList,
RealCctvList
} from '@/scripts/ProjectConfig';
import { removeToken, getToken } from '@/utils/auth';
import LangStorage from '@/utils/lang';
import FloatPart from './floatPart';
@ -161,10 +207,11 @@ import { getSimulationInfoByGroup } from '@/api/rtSimulation';
import { getSessionStorage } from '@/utils/auth';
import Register from './register';
import ForgetPassword from './forgetPassword';
import OrgSelect from './orgSelect';
export default {
name: 'Login',
components: { QrcodeVue, FloatPart, Register, ForgetPassword },
components: { QrcodeVue, FloatPart, Register, ForgetPassword, OrgSelect },
data() {
const validateName = (rule, value, callback) => {
if (value) {
@ -234,7 +281,7 @@ export default {
return split;
}
},
loginTitle () {
loginTitle() {
return loginInfo[this.project].loginTitle;
},
title() {
@ -300,12 +347,20 @@ export default {
removeSessionStorage('projectDevice');
this.computedAttribute();
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
const model = {'username': Cookies.get(this.cookiesName), 'password': Cookies.get(this.cookiesToken), 'project':loginInfo[this.project].loginParam};
const model = {
username: Cookies.get(this.cookiesName),
password: Cookies.get(this.cookiesToken),
project: loginInfo[this.project].loginParam
};
model.type = this.modelType;
this.$store.dispatch('Login', model).then(() => {
this.$store
.dispatch('Login', model)
.then(() => {
this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute();
}).catch(error => {
// this.handleLoginSucessRoute();
this.checkOrgnizationInfo();
})
.catch(error => {
if (error.code === '30001') {
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
} else if (error.code == '10001') {
@ -316,7 +371,9 @@ export default {
this.tipsMsg = error.message;
}
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
setTimeout(() => {
this.tipsMsg = '';
}, 5000);
});
}
},
@ -361,14 +418,16 @@ export default {
if (this.$route.query.projectDevice) {
params.deviceCode = this.$route.query.projectDevice;
}
getLoginWmurl(params).then(response => {
getLoginWmurl(params)
.then(response => {
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
this.checkLoginStatus();
}).catch(() => {
})
.catch(() => {
if (this.syncLogin) {
setTimeout(() =>{
setTimeout(() => {
self.loginRefresh();
}, 3000);
} else {
@ -387,14 +446,19 @@ export default {
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId).then(response => {
checkLoginStatus(self.sessionId)
.then(response => {
//
self.$store.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: this.modelType }).then(() => {
self.$store
.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: this.modelType })
.then(() => {
//
self.clearTimer(self.checkLogin);
this.handleLoginSucessRoute();
// this.handleLoginSucessRoute();
this.checkOrgnizationInfo();
});
}).catch(error => {
})
.catch(error => {
if ((error.data && error.data.status === 'EXPIRE') || error.code != 200) {
if (this.syncLogin) {
self.loginRefresh();
@ -435,13 +499,17 @@ export default {
model.teacherLogin = this.teacherLogin;
this.loading = true;
if (this.isAutoLogin) {
Cookies.set(this.cookiesName, model.username, { expires: 2});
Cookies.set(this.cookiesToken, model.password, { expires: 2});
Cookies.set(this.cookiesName, model.username, { expires: 2 });
Cookies.set(this.cookiesToken, model.password, { expires: 2 });
}
this.$store.dispatch('Login', model).then(() => {
this.$store.dispatch('SetAccount', model.username);
this.handleLoginSucessRoute();
}).catch(error => {
this.$store
.dispatch('Login', model)
.then(() => {
// this.$store.dispatch('SetAccount', model.username);
// this.handleLoginSucessRoute();
this.checkOrgnizationInfo();
})
.catch(error => {
if (error.code == '40003') {
this.tipsMsg = this.$t('login.accountOrPasswordIsIncorrect');
} else if (error.code == '10001') {
@ -452,7 +520,9 @@ export default {
this.tipsMsg = error.message;
}
this.loading = false;
setTimeout(() => { this.tipsMsg = ''; }, 5000);
setTimeout(() => {
this.tipsMsg = '';
}, 5000);
});
} else {
console.log('error submit!!');
@ -460,6 +530,29 @@ export default {
}
});
},
checkOrgnizationInfo() {
getOrgList().then(resp => {
const orgList = resp.data;
let orgId = '';
if (orgList.length < 2) {
if (orgList.length === 1) {
orgId = orgList[0].orgId;
selectOrgnization(orgId);
}
this.handleLoginSucessRoute();
} else {
this.showOrgSelect(orgList).then(this.handleLoginSucessRoute());
}
});
},
showOrgSelect(orgList) {
this.$refs.orgSelect.doShow(orgList);
return new Promise(() => {
this.$refs.orgSelect.$once('select', orgId => {
selectOrgnization(orgId);
});
});
},
handleLoginSucessRoute() {
//
this.loading = this.project === 'drts' || this.project === 'hlsdrts' || false;
@ -471,7 +564,7 @@ export default {
const query = {
group: res.data.group,
mapId: resp.data.map.id,
lineCode:resp.data.map.lineCode,
lineCode: resp.data.map.lineCode,
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
};
@ -479,88 +572,113 @@ export default {
if (this.$route.query.type == 'LSW') {
const config = JSON.parse(res.data.deviceVO.config);
if (config.quadrant == '99') {
this.$router.push({ path: `/displayBigScreen/${resp.data.map.id}`, query: {...query, prdType:resp.data.prodType} });
this.$router.push({
path: `/displayBigScreen/${resp.data.map.id}`,
query: { ...query, prdType: resp.data.prodType }
});
} else {
this.$router.push({ path: `/bigSplitScreen/${resp.data.map.id}`, query: {...query, prdType:resp.data.prodType} });
this.$router.push({
path: `/bigSplitScreen/${resp.data.map.id}`,
query: { ...query, prdType: resp.data.prodType }
});
}
} else if (this.$route.query.type === 'ISCS_LW' || this.$route.query.type === 'ISCS_CW') {
const config = JSON.parse(res.data.deviceVO.config);
if (config.picture === 'paMain') {
// displayIscs/system/stationConfig/paMain?stationName=&stationId=Station25166&group=20-120-196-193&mapId=196&lineCode=02
this.$router.push({ path: `displayIscs/system/stationConfig/paMain`, query: {
this.$router.push({
path: `displayIscs/system/stationConfig/paMain`,
query: {
stationId: config.stationCode,
group: res.data.group,
mapId:resp.data.map.id,
mapId: resp.data.map.id,
lineCode: resp.data.map.lineCode,
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
}
});
} else if (config.picture === 'pidsMain') {
this.$router.push({ path: `displayIscs/system/stationConfig/pidsMain`, query: {
this.$router.push({
path: `displayIscs/system/stationConfig/pidsMain`,
query: {
stationId: config.stationCode,
group: res.data.group,
mapId:resp.data.map.id,
mapId: resp.data.map.id,
lineCode: resp.data.map.lineCode,
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
}
});
} else {
this.$router.push({ path: `/displayIscs/system`, query: {
this.$router.push({
path: `/displayIscs/system`,
query: {
group: res.data.group,
lineCode: resp.data.map.lineCode,
mapId:resp.data.map.id,
mapId: resp.data.map.id,
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type} });
type: this.$route.query.type
}
});
}
} else if (this.$route.query.type == 'CCTV') {
if (RealCctvList.includes(this.project)) {
this.$router.push({
path:'/jointTrainingNewCCTV',
query:{
mapid:resp.data.map.id,
group:res.data.group,
path: '/jointTrainingNewCCTV',
query: {
mapid: resp.data.map.id,
group: res.data.group,
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
}
});
} else {
this.$router.push({ path: `/jlmap3d/passengerflow`, query:{
mapid:resp.data.map.id,
group:res.data.group,
this.$router.push({
path: `/jlmap3d/passengerflow`,
query: {
mapid: resp.data.map.id,
group: res.data.group,
lineCode: resp.data.map.lineCode,
project: getSessionStorage('project'),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
} });
}
});
}
} else if (this.$route.query.type === 'SCHEDULING') {
this.$router.push({ path: `/display/demon`, query: {
this.$router.push({
path: `/displayNew/demon`,
query: {
group: res.data.group,
lineCode: resp.data.map.lineCode,
mapId: resp.data.map.id,
prdType: '05',
goodsId:'',
try:'0',
goodsId: '',
try: '0',
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
}});
}
});
} else if (this.$route.query.type === 'DEPOT') {
this.$router.push({ path: `/display/demon`, query: {
this.$router.push({
path: `/displayNew/demon`,
query: {
group: res.data.group,
lineCode: resp.data.map.lineCode,
mapId: resp.data.map.id,
prdType: '09',
goodsId:'',
try:'0',
goodsId: '',
try: '0',
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
}});
}
});
} else if (this.$route.query.type === 'VR_PSD') {
if (res.data.deviceVO && res.data.deviceVO.config) {
query.psdCode = JSON.parse(res.data.deviceVO.config).psdCode;
}
this.$router.push({ path: `/display/joint`, query: query });
this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (this.$route.query.type === 'SANDBOX') {
const sandboxQuery = {
mapid: query.mapId,
@ -572,61 +690,68 @@ export default {
};
this.$router.push({ path: `/jlmap3d/sandbox`, query: sandboxQuery });
} else if (this.$route.query.type === 'ILW') {
this.$router.push({ path: `/display/joint`, query: query });
this.$router.push({ path: `/jointTrainingNew`, query: query });
} else if (this.$route.query.type === 'PIS_STAND' || this.$route.query.type === 'PIS_TRAIN') {
const config = JSON.parse(res.data.deviceVO.config);
this.$router.push({ path: `/pis`, query: {...query, ...config}});
this.$router.push({ path: `/pis`, query: { ...query, ...config } });
} else {
this.$router.push({ path: `/display/joint`, query: query });
this.$router.push({ path: `/jointTrainingNew`, query: query });
}
});
});
} else if (this.project === 'drts' || this.project === 'hlsdrts' || this.project === 'bjd' || this.project === 'wjls') {
getLoginInfo(getToken()).then(res => {
if (this.project === 'wjls') {
getSimulationInfoByGroup(res.data.group).then(resp =>{
// displayCity
this.$router.push({ path: `/display/demon`, query: {
getSimulationInfoByGroup(res.data.group).then(resp => {
this.$router.push({
path: `/displayCity/demon`,
query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,
mapId: resp.data.map.id,
goodsId:'',
try:'0',
newApi:true,
project:this.project
}});
goodsId: '',
try: '0',
newApi: true,
project: this.project
}
});
this.loading = false;
});
} else {
getSimulationInfoNew(res.data.group).then(resp => {
if (this.project === 'drts' || this.project === 'hlsdrts') {
this.$router.push({ path: `/display/demon`, query: {
this.$router.push({
path: `/displayNew/demon`,
query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,
mapId: resp.data.map.id,
goodsId:'',
try:'0',
project:this.project
}});
goodsId: '',
try: '0',
project: this.project
}
});
} else {
this.$store.dispatch('app/transitionAnimations');
// /practiceDisplay
this.$router.push({ path: `/display/demon`, query: {
this.$router.push({
path: `/practiceDisplay`,
query: {
lineCode: resp.data.map.lineCode,
group: res.data.group,
prdType: resp.data.prodType,
mapId: resp.data.map.id,
project:this.project
}});
project: this.project
}
});
}
this.loading = false;
});
}
});
} else if (this.project === 'zzwwtest') {
this.$router.push({ path: '/jlmap3d/zzwwtest', query: {lessonId:'35'} });
this.$router.push({ path: '/jlmap3d/zzwwtest', query: { lessonId: '35' } });
} else if (this.project === 'xzexam') {
this.$router.push({ path: '/jlmap3d/xzexam', query: {} });
} else if (this.project === 'richorlesson3d') {
@ -643,17 +768,6 @@ export default {
this.$i18n.locale = this.lang;
LangStorage.setLang(this.lang);
},
// goCompetitionRules(val) {
// if (val === '1') {
// window.open('https://mp.weixin.qq.com/s?__biz=MzI3NzMwODY3OQ==&mid=2247506304&idx=1&sn=77708ca228404cee2b28e131cdfb9735&chksm=eb6aade8dc1d24fe6eb9f1334aadda239f47dafc79de7d522e0f3f00e2d3ba1dd213dda6764c&xtrack=1&scene=90&subscene=93&sessionid=1598522875&clicktime=1598523062&enterid=1598523062&ascene=56&devicetype=android-29&version=3.0.27.2701&nettype=WIFI&abtest_cookie=AAACAA%3D%3D&lang=zh_CN&exportkey=AQZ2cTPSob%2B5kBDiWnKw0Js%3D&pass_ticket=12Xyhe%2BbZsC9Vuzfs0iYUUn0i%2Br5JlZiOGCxWoExuthBhnIrpkmUyjVRi6bjyA1I&wx_header=1&platform=win', '_blank');
// } else if (val === '2') {
// window.open('https://mp.weixin.qq.com/s?__biz=MzI3NzMwODY3OQ==&mid=2247506789&idx=1&sn=5b5c1e6e0ca7dc54a935f57cee4eb1a2&chksm=eb6aaf0ddc1d261ba2ba7b9bed810b12b3317d45b1a484095d13b3d7e075b091d92fc7b9afb8&mpshare=1&scene=1&srcid=0910Yd3PVFs0WjWZyumLN9Jo&sharer_sharetime=1599740490862&sharer_shareid=98d62529ea7e8d0f6fb2281f854f3ea1&version=3.0.30.2006&platform=win&rd2werd=1#wechat_redirect', '_blank');
// } else if (val === '3') {
// window.open('http://metroskills.camet.org.cn', '_blank');
// } else if (val === '4') {
// window.open('https://mp.weixin.qq.com/s?__biz=MzI3NzMwODY3OQ==&mid=2247510328&idx=1&sn=b9ba74efd9688513ae8c28f297268bd5&chksm=eb6add50dc1d54460f6a965a6b96fb7adb5205327dba5f7b57ec963ee87e1e2694e7b230fd65&xtrack=1&scene=90&subscene=93&sessionid=1607077432&clicktime=1607077443&enterid=1607077443&ascene=56&devicetype=android-29&version=3.0.36.2008&nettype=ctnet&abtest_cookie=AAACAA%3D%3D&lang=zh_CN&exportkey=AX5YNBACCv37GORQdECX6PA%3D&pass_ticket=hZngvACKkOr5GKVNY2vl3nM0vWwylSDF51O5A12K38n8Sok%2FWQv2S8OMQD2sYBA1&wx_header=1&platform=win');
// }
// },
registerUser() {
this.$refs.register.doShow();
},
@ -665,73 +779,73 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss">
$bg:#fff;
$light_gray:#eee;
.drts_title{
$bg: #fff;
$light_gray: #eee;
.drts_title {
position: absolute;
top: 10%;
color:#F00;
color: #f00;
text-align: center;
}
.drts_explain {
}
.drts_explain {
position: absolute;
text-align: center;
font-size: 32px;
color:#F00;
}
@media screen and (max-width:960px){
.drts_title{
color: #f00;
}
@media screen and (max-width: 960px) {
.drts_title {
font-size: 30px;
}
.drts_explain{
.drts_explain {
font-size: 18px;
}
}
@media screen and (min-width:960px) and (max-width:1260px){
.drts_title{
}
@media screen and (min-width: 960px) and (max-width: 1260px) {
.drts_title {
font-size: 36px;
}
.drts_explain{
.drts_explain {
font-size: 20px;
}
}
@media screen and (min-width:1260px) and (max-width:1440px){
.drts_title{
}
@media screen and (min-width: 1260px) and (max-width: 1440px) {
.drts_title {
font-size: 42px;
}
.drts_explain{
.drts_explain {
font-size: 24px;
}
}
@media screen and (min-width:1440px) and (max-width:1600px){
.drts_title{
}
@media screen and (min-width: 1440px) and (max-width: 1600px) {
.drts_title {
font-size: 46px;
}
.drts_explain{
.drts_explain {
font-size: 28px;
}
}
@media screen and (min-width:1600px){
.drts_title{
}
@media screen and (min-width: 1600px) {
.drts_title {
font-size: 50px;
}
.drts_explain{
.drts_explain {
font-size: 32px;
}
}
@media screen and (max-height:900px){
.drts_explain{
}
@media screen and (max-height: 900px) {
.drts_explain {
bottom: 140px;
}
}
@media screen and (min-height:900px){
.drts_explain{
}
@media screen and (min-height: 900px) {
.drts_explain {
bottom: 200px;
}
}
.login-container {
background: #E4EAEA;
.el-form-item{
}
.login-container {
background: #e4eaea;
.el-form-item {
background: #fff !important;
border: 1px solid rgba(0, 0, 0, 0.1) !important;
.el-input {
@ -761,12 +875,12 @@ export default {
color: #454545;
}
.item_form_password{
.item_form_password {
margin-bottom: 10px;
}
.tip-message {
color: #F56C61;
color: #f56c61;
padding: 5px;
font-size: 12px;
height: 23px;
@ -786,47 +900,47 @@ export default {
font-size: 14px;
}
}
}
}
</style>
<style rel="stylesheet/scss" lang="scss" scoped>
$bg:#f0f0f0;
$qrbg:#fff;
$dark_gray:#889aa4;
$light_gray:#eee;
$qrcodeSize: 270px;
.popover_box {
$bg: #f0f0f0;
$qrbg: #fff;
$dark_gray: #889aa4;
$light_gray: #eee;
$qrcodeSize: 270px;
.popover_box {
position: absolute;
right: 80px;
bottom: 124px;
cursor: pointer;
color: #225592;
font-size: 14px;
}
.active:hover{
color: #409EFF;
}
.countdown_box {
}
.active:hover {
color: #409eff;
}
.countdown_box {
display: inline-block;
width: 35px;
margin-right: 5px;
background: #000;
color: #F00;
color: #f00;
text-align: center;
border-radius: 5px;
}
.news-box {
color: #409EFF;
}
.news-box {
color: #409eff;
width: 100%;
border-bottom: dashed 1px #409EFF;
border-bottom: dashed 1px #409eff;
font-size: 14px;
line-height: 30px;
height: 30px;
}
.news-box:hover {
color: #3943CB;
}
.login-container {
}
.news-box:hover {
color: #3943cb;
}
.login-container {
position: fixed;
display: flex;
align-items: center;
@ -836,7 +950,7 @@ export default {
background-repeat: no-repeat;
background-origin: border-box;
background-size: 100% 100%;
.content-box{
.content-box {
width: 740px;
display: flex;
align-items: center;
@ -847,7 +961,7 @@ export default {
box-sizing: border-box;
position: relative;
}
.text-box{
.text-box {
font-size: 39px;
font-weight: bold;
top: 150px;
@ -855,21 +969,21 @@ export default {
text-align: center;
position: absolute;
}
.left-logo-box{
.left-logo-box {
position: absolute;
top: 2%;
font-size: 28px;
font-weight: bold;
left: 2%;
}
.logo{
.logo {
vertical-align: middle;
}
.language_box{
.language_box {
position: absolute;
top: 20px;
right: 40px;
.language_btn{
.language_btn {
/*font-weight: bold;*/
cursor: pointer;
font-size: 18px;
@ -908,9 +1022,9 @@ export default {
cursor: pointer;
user-select: none;
}
}
}
.qrcode-main{
.qrcode-main {
width: 300px;
background-color: $qrbg;
text-align: center;
@ -922,7 +1036,7 @@ export default {
margin: 0 auto;
}
.login-code-box{
.login-code-box {
width: 150px;
margin: 0 auto;
cursor: pointer;
@ -938,5 +1052,5 @@ export default {
color: #353535;
line-height: 30px;
}
}
}
</style>

View File

@ -0,0 +1,174 @@
<template>
<div>
<div v-if="syncLogin">
{{}}
</div>
<div v-else class="login-container" :style="{ 'background-image': showBackPic?'url(' + bgImg + ')':'none' }">
<div class="language_box">
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
</el-tooltip>
</div>
<div class="left-logo-box">
<img class="logo" :src="loginProLogo" :style="{ width: loginProLogoWidth,height:loginProLogoHeight }">
<span>{{ loginOrgTitle }}</span>
</div>
<div class="text-box">{{ loginProtitle }}</div>
<div class="content-box">
<wechat-login ref="wechatLogin" :project="backProject" :sync-login="syncLogin" />
<!-- :style="noQrcodeList.includes(project) ? 'width: 450px;' : ''" -->
<!-- 微信登陆 -->
<!-- v-if="wechatLogin" -->
<!-- 默认登陆 -->
</div>
</div>
</div>
</template>
<script>
import bgImg from '@/assets/bg1.jpg';
import LangStorage from '@/utils/lang';
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
import WechatLogin from './wechatLogin';
export default {
name:'LoginNew',
components: { WechatLogin },
data() {
return {
backProject:'',
language: '中文',
lang: 'zh',
loginProtitle:'',
showBackPic:true,
wechatLogin:true,
loginProLogoWidth:0,
loginProLogoHeight:0,
loginOrgTitle:'',
loginProLogo:''
};
},
computed: {
project() {
return this.$route.query.project || 'login';
},
syncLogin() {
const synchronousLogin = ['VR_IBP', 'LSW', 'CCTV', 'ISCS_LW', 'ISCS_CW', 'VR_PSD', 'SANDBOX', 'ILW', 'PIS_STAND', 'PIS_TRAIN'];
return this.$route.query.type ? synchronousLogin.includes(this.$route.query.type) : false;
},
bgImg() {
return bgImg;
}
},
created() {
const nowLang = LangStorage.getLang('zh');
if (nowLang === 'zh') {
this.lang = 'en';
this.language = 'English';
}
getFrontProjectConfigByLogin(this.project).then(response => {
if (response.data) {
this.backProject = response.data.project;
const {showBackPic, wechatLogin, browserTitle, loginProtitle, loginProLogoWidth, loginProLogoHeight, loginOrgTitle, loginProLogo} = response.data.viewSetting;
this.showBackPic = showBackPic;
this.wechatLogin = wechatLogin;
this.loginProtitle = loginProtitle;
this.loginProLogoWidth = loginProLogoWidth;
this.loginProLogoHeight = loginProLogoHeight;
this.loginOrgTitle = loginOrgTitle;
this.loginProLogo = loginProLogo ? this.$store.state.user.ossUrl + '/logo/' + loginProLogo : '';
document.title = browserTitle;
document.querySelector("link[rel*='icon']").href = this.loginProLogo;
// document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project]
// aboutSystem:" ICP2021039716"
// baseDevelopment
// :
// false
// caseShow
// :
// true
// helpShow
// :
// true
// homeTitle
// :
// ""
// loginContectInformation
// :
// false
// loginOrgTitle
// :
// ""
// loginProLogo
// :
// ""
// loginProLogoHeight
// :
// ""
// loginProLogoWidth
// :
// ""
}
}).catch(() => {
this.$messageBox('无效的登录路径,请查证路径后重试!');
});
},
methods:{
handleLanguage() {
this.$i18n.locale = this.lang;
LangStorage.setLang(this.lang);
}
}
};
</script>
<style lang="scss" scoped>
.login-container {
position: fixed;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
background: #e4eaea;
background-repeat: no-repeat;
background-origin: border-box;
background-size: 100% 100%;
}
.language_box {
position: absolute;
top: 20px;
right: 40px;
.language_btn {
/*font-weight: bold;*/
cursor: pointer;
font-size: 18px;
}
}
.text-box {
font-size: 39px;
font-weight: bold;
top: 150px;
width: 1070px;
text-align: center;
position: absolute;
}
.content-box {
// width: 740px;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
padding: 30px 30px 30px;
margin-bottom: 20px;
box-sizing: border-box;
position: relative;
}
.left-logo-box {
position: absolute;
top: 2%;
font-size: 28px;
font-weight: bold;
left: 2%;
}
</style>

View File

@ -0,0 +1,165 @@
<template>
<div class="qrcode-main">
<div class="login-code-box" @click="loginRefresh">
<qrcode-vue
v-loading="loadingCode"
:value="loginUrl"
:class-name="qrcodeClassName"
:size="150"
:element-loading-text="this.$t('login.clickRefresh')"
element-loading-spinner="el-icon-refresh"
element-loading-background="rgba(255, 255, 255, 0.9)"
/>
</div>
<div class="login-tip">
<span class="sub-title">{{ $t('login.scanCodeLogin') }}</span>
</div>
<div class="tip-info">
<fieldset>
<legend>
{{ $t('login.recommendedConfiguration') }}
</legend>
<span>{{ $t('login.browser') }}
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">{{
$t('login.googleChrome')
}}</a>
</span>
<br>
<span>{{ $t('login.screenResolution') + '1920*1080' }}</span>
</fieldset>
</div>
</div>
</template>
<script>
// , gtLoginInfo, getOrgList, selectOrgnization
import QrcodeVue from 'qrcode.vue';
import { getLoginWmurl, checkLoginStatus} from '@/api/login';
import { LoginParams } from '@/utils/login';
export default {
name:'WeChatLogin',
components: { QrcodeVue },
props: {
project: {
type: String,
default: () => {
return '';
}
},
syncLogin:{
type: Boolean,
default: () => {
return false;
}
}
},
data() {
return {
loadingCode: false,
loginUrl: '',
sessionId: '',
checkLogin: null,
qrcodeClassName: 'login-qrcode',
modelType: 'class',
loginClient:'LianKeTang'
};
},
methods:{
loginRefresh() {
// this.loadingCode = true;
const self = this;
const params = LoginParams[this.loginClient];
params.project = this.project;
if (this.$route.query.projectDevice) {
params.deviceCode = this.$route.query.projectDevice;
}
getLoginWmurl(params)
.then(response => {
// debugger;
this.sessionId = response.data.sessionId;
this.loginUrl = response.data.url;
this.loadingCode = false;
// debugger;
this.checkLoginStatus();
})
.catch(() => {
if (this.syncLogin) {
setTimeout(() => {
self.loginRefresh();
}, 3000);
} else {
this.loadingCode = false;
this.$messageBox(this.$t('login.getLoginQrCode'));
}
});
}
},
checkLoginStatus() {
const self = this;
//
if (this && this._isDestroyed) {
return;
}
//
//
this.clearTimer(this.checkLogin);
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId)
.then(response => {
//
self.$store
.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: this.modelType })
.then(() => {
//
self.clearTimer(self.checkLogin);
// this.handleLoginSucessRoute();
this.checkOrgnizationInfo();
});
})
.catch(error => {
if ((error.data && error.data.status === 'EXPIRE') || error.code != 200) {
if (this.syncLogin) {
self.loginRefresh();
} else {
this.loadingCode = true;
this.loginUrl = '';
}
} else {
self.checkLoginStatus();
}
});
}, 3000);
}
};
</script>
<style lang="scss" scoped>
$qrbg: #fff;
.qrcode-main {
width:300px;
background-color: $qrbg;
text-align: center;
border-right: 1px solid #ececec;
.tip-info {
text-align: left;
display: inline-block;
color: green;
margin: 0 auto;
}
.login-code-box {
width: 150px;
margin: 0 auto;
cursor: pointer;
}
.system-type {
margin: 5px 0;
display: block;
}
.sub-title {
font-size: 16px;
text-align: center;
color: #353535;
line-height: 30px;
}
}
</style>

View File

@ -22,24 +22,43 @@
<el-form-item label="关于系统:" prop="aboutSystem">
<el-input v-model="formModel.aboutSystem" style="width: 400px;" size="small" />
</el-form-item>
<el-form-item label="项目Logo:" prop="loginProLogo">
<div class="eachButton uploadLogo">
<img v-if="formModel.loginProLogo" :src="computedLoginLogo" :alt="computedLoginLogo" class="loginLogo">
<i class="el-icon-plus avatar-uploader-icon el-icon-other" />
<input id="upload_file" ref="files" type="file" class="file_box" accept="image/jpeg,image/png" @change="uploadLogo">
</div>
</el-form-item>
<!-- loginProLogo:'', // logo
loginProLogoWidth:'', // logo
loginProLogoHeight:'', // logo -->
<el-form-item label="页签名称:" prop="browserTitle" class="inlineBlock">
<el-input v-model="formModel.browserTitle" style="width: 210px;" size="small" />
</el-form-item>
<el-form-item label="导航栏名称:" prop="homeTitle" class="inlineBlock" style="margin-left:10px">
<el-input v-model="formModel.homeTitle" style="width: 210px;" size="small" />
</el-form-item>
<!-- navLogoWidth //Logo -->
<!-- navLogoHeight //Logo -->
<el-form-item label="案例展示:" prop="caseShow" class="inlineBlock">
<el-switch v-model="formModel.caseShow" />
</el-form-item>
<el-form-item label="帮助展示:" prop="helpShow" class="inlineBlock">
<el-switch v-model="formModel.helpShow" />
</el-form-item>
<br>
<el-form-item label="登陆后跳转路径:" prop="judgeRoute" class="inlineBlock">
<el-input v-model="formModel.judgeRoute" style="width: 210px;" size="small" />
</el-form-item>
<el-form-item label="接口地址:" prop="baseApiUrl" class="inlineBlock">
<el-input v-model="formModel.baseApiUrl" style="width: 210px;" size="small" />
</el-form-item>
<el-form-item label="当前域名:" prop="baseSite" class="inlineBlock">
<el-input v-model="formModel.baseSite" style="width: 210px;" size="small" />
</el-form-item>
<el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock">
<el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
@ -48,7 +67,7 @@
</el-dialog>
</template>
<script>
import { updateFrontProjectConfig } from '@/api/projectConfig';
import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig';
export default {
name:'FrontProjectConfig',
data() {
@ -70,8 +89,15 @@ export default {
browserTitle:'', //
homeTitle:'', //
navLogoWidth:'', // Logo
navLogoHeight:'', // Logo
caseShow:true, //
helpShow:true //
helpShow:true, //
judgeRoute:'', //
baseApiUrl:'', // api
baseSite:'', //
ossUrl:'' // oss
}
};
@ -91,6 +117,9 @@ export default {
};
return crules;
},
computedLoginLogo() {
return this.formModel.loginProLogo ? this.$store.state.user.ossUrl + '/logo/' + this.formModel.loginProLogo : '';
},
title() {
return '修改前端配置';
}
@ -107,8 +136,8 @@ export default {
this.formModel.loginOrgTitle = viewSetting.loginOrgTitle || '';
this.formModel.baseDevelopment = viewSetting.baseDevelopment || false;
this.formModel.aboutSystem = viewSetting.aboutSystem || '';
this.formModel.showBackPic = viewSetting.showBackPic || true;
this.formModel.wechatLogin = viewSetting.wechatLogin || true;
this.formModel.showBackPic = viewSetting.showBackPic || false;
this.formModel.wechatLogin = viewSetting.wechatLogin || false;
this.formModel.loginContectInformation = viewSetting.loginContectInformation || false;
this.formModel.loginProLogo = viewSetting.loginProLogo || '';
@ -117,9 +146,15 @@ export default {
this.formModel.browserTitle = viewSetting.browserTitle || '';
this.formModel.homeTitle = viewSetting.homeTitle || '';
this.formModel.caseShow = viewSetting.caseShow || true;
this.formModel.helpShow = viewSetting.helpShow || true;
this.formModel.navLogoWidth = viewSetting.navLogoWidth || '';
this.formModel.navLogoHeight = viewSetting.navLogoHeight || '';
this.formModel.caseShow = viewSetting.caseShow || false;
this.formModel.helpShow = viewSetting.helpShow || false;
this.formModel.judgeRoute = viewSetting.judgeRoute || '';
this.formModel.baseApiUrl = viewSetting.baseApiUrl || '';
this.formModel.baseSite = viewSetting.baseSite || '';
this.formModel.ossUrl = viewSetting.ossUrl || '';
}
},
handleClose() {
@ -137,8 +172,15 @@ export default {
browserTitle:'', //
homeTitle:'', //
navLogoWidth:'', // Logo
navLogoHeight:'', // Logo
caseShow:true, //
helpShow:true //
helpShow:true, //
judgeRoute:'', //
baseApiUrl:'', // api
baseSite:'', //
ossUrl:'' // oss
};
this.$refs.ruleForm.resetFields();
@ -162,6 +204,56 @@ export default {
});
}
});
},
uploadLogo() {
const pic = document.getElementById('upload_file');
if (!pic.files || !pic.files[0]) {
return;
}
const file = pic.files[0];
const mineType = file.type;
const fileSize = file.size;
if (mineType != 'image/png' && mineType != 'image/jpeg') {
this.$message.error('仅支持png和jpeg格式的图片');
return;
}
if (fileSize / (1024 * 1024) > 1) {
this.$message.error('图片应该小于1M');
return;
}
const fileArray = file.name.split('.');
const fileType = fileArray[fileArray.length - 1] || '';
if (!fileType) {
return;
}
const params = {
directory:'logo',
fileName:'favicon_' + this.row.markKey + '.' + fileType,
method:'PUT'
};
const that = this;
getUploadUrl(params).then((response) => {
const url = response.data;
if (url) {
// var formData = new FormData();
// formData.append('body', file);
const xhr = new XMLHttpRequest();
xhr.open('PUT', url);
xhr.setRequestHeader('Content-Type', 'multipart/form-data');
xhr.send(file);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status == 200) {
that.formModel.loginProLogo = params.fileName;
} else if (xhr.status != 200) {
that.$message.error('上传失败,请稍后再试');
}
};
}
});
// directoryMINIO
// fileName
// method
}
}
};
@ -170,4 +262,47 @@ export default {
.inlineBlock{
display: inline-block;
}
.eachButton{
margin-left:10px;
width:100px;
height:100px;
border:1px #ccc dashed;
margin-bottom: 10px;
}
.el-icon-other{
width: 100%;
text-align: center;
height: 100%;
line-height: 98px;
font-size: 16px;
position: absolute;
color: #000;
}
// .file_box:hover + .el-icon-other{
// background: rgba(0, 0, 0, 0.5);
// position: absolute;
// color: #000;
// }
.uploadLogo {
position: relative;
overflow: hidden;
// float: right;
margin-right: 3px;
cursor: pointer;
input {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
}
}
.loginLogo{
width: 100%;
position: absolute;
left: 0;
top: 0;
}
</style>

View File

@ -0,0 +1,22 @@
<template>
<div class="temporary">
<span>功能实现中......</span>
</div>
</template>
<script>
export default {
name: 'Temporary',
components: {},
data() {
return {};
}
};
</script>
<style lang="scss" scoped>
.temporary {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
</style>

View File

@ -0,0 +1,12 @@
<template>
<router-view />
</template>
<script>
export default {
name: 'NullIndex',
components: {},
data() {
return {};
}
};
</script>