Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2023-03-10 09:37:53 +08:00
commit 8ec88a84a2
34 changed files with 1356 additions and 245 deletions

View File

@ -8,7 +8,7 @@
<img :src="loadingImg" style="width: 100%; height: 100%;">
</div>
<div
v-if="!$store.state.user.baseUrl"
v-if="!$store.state.user.baseUrl && needLoading"
v-loading="!$store.state.user.baseUrl"
element-loading-text="拼命加载中"
element-loading-background="rgba(0, 0, 0, 0)"
@ -31,6 +31,7 @@ import { openIndexedDB } from '@/utils/indexedDb';
import Favicon from '@/assets/icon/favicon.png';
import DeomonList from '@/views/demonstration/deomonList/index';
import Qcode from '@/layout/components/Qcode.vue';
import {removeToken} from './utils/auth';
export default {
name: 'App',
@ -50,6 +51,11 @@ export default {
jlFavicon: Favicon
};
},
computed: {
needLoading() {
return this.$route.path !== '/authorization';
}
},
watch: {
'$store.state.socket.beLogoutCount': async function(val) {
if (this.$store.state.socket.loggedOutMsg.token === getToken()) {
@ -57,6 +63,7 @@ export default {
this.$alert(this.$t('tip.logoutTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
callback: action => {
removeToken();
this.$store.dispatch('exit').then(resp => {
this.$router.push({path: loginInfo[getSessionStorage('project')].loginPath});
});
@ -80,8 +87,9 @@ export default {
},
created() {
this.project = getSessionStorage('project');
if (this.project) {
document.querySelector("link[rel*='icon']").href = loginInfo[this.project].linkIcon || ProjectIcon[this.project];
const linkIcon = loginInfo[this.project] ? loginInfo[this.project].linkIcon : (ProjectIcon[this.project] || '');
if (this.project && linkIcon) {
document.querySelector("link[rel*='icon']").href = linkIcon;
}
},
mounted() {

View File

@ -146,3 +146,50 @@ export function updateMapFunctionSubset(data) {
data
});
}
/** 根据模板生成地图功能 */
export function generateMapFunctionByTemplate(data) {
return request({
url: `/api/mapFunction/generate/from/template`,
method: 'post',
data
});
}
/** 创建模板线路功能 */
export function createTemplateMapFunction(data) {
return request({
url: `/api/mapFunction/template`,
method: 'post',
data
});
}
/** 修改模板线路功能 */
export function updateTemplateMapFunction(data) {
return request({
url: `/api/mapFunction/template/${data.id}`,
method: 'put',
data
});
}
/** 删除模板线路功能 */
export function deleteTemplateMapFunction(id) {
return request({
url: `/api/mapFunction/template/${id}`,
method: 'delete'
});
}
/** 查询模板线路功能列表 */
export function queryTemplateMapFunctionList(params) {
return request({
url: `/api/mapFunction/template/list`,
method: 'get',
params
});
}
/** 分页查询模板线路功能列表 */
export function queryTemplateMapFunPaged(params) {
return request({
url: `/api/mapFunction/template/paged`,
method: 'get',
params
});
}

View File

@ -18,5 +18,7 @@ export default {
getLoginQrCode: 'Failed to get login qr code, please refresh and try again',
language: 'Language',
clickSwitchLanguage: 'Click switch language',
accountName: 'Account name'
accountName: 'Account name',
registerAccount: 'Register account',
forgetPassword: 'Forget password?'
};

View File

@ -18,5 +18,7 @@ export default {
getLoginQrCode: '获取登录二维码失败,请刷新重试',
language: '语言',
clickSwitchLanguage: '点击切换语言',
accountName: '账户名'
accountName: '账户名',
registerAccount: '注册账号',
forgetPassword: '忘记密码?'
};

View File

@ -169,7 +169,7 @@ export default class Station extends Group {
return item.includes('lineCode=16');
});
const pic = store.state.map.picture;
if ((queryCtc && model.createControlMode) || (pic == 'trafficTerminal' && queryCtcLineCode)) {
if ((queryCtc || (pic == 'trafficTerminal' && queryCtcLineCode)) && model.createControlMode) {
this.createCtcControlMode();
} else if (this.style.Station.StationControl.special) {
if (model.visible && model.createControlMode) { // model.createControlMode 控制模式

View File

@ -74,6 +74,16 @@ export const menuOperate = {
// 添加备用车 (大铁线路 车次号 非车组号)
operation: OperationEvent.Section.addSpareTrain.menu.operation,
cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN
},
defectiveShunting:{
// 分路不良
operation: OperationEvent.Section.defectiveShunting.menu.operation,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING
},
cancelDefectiveShunting:{
// 取消分路不良
operation: OperationEvent.Section.cancelDefectiveShunting.menu.operation,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING
}
},
Signal:{

View File

@ -33,6 +33,7 @@
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'DefectivePasswordBox',
components: {
@ -60,13 +61,16 @@ export default {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Switch.defectiveShunting.twoConfirm.domId : '';
const domId = OperationHandler.getDomIdByOperation(this.operation);
return this.dialogShow ? domId : '';
}
},
methods:{
doShow(operate) {
this.operation = operate.operation;
if (operate.operation == OperationEvent.Switch.cancelDefectiveShunting.menu.operation) {
if (operate.operation == OperationEvent.Section.cancelDefectiveShunting.menu.operation) {
this.name = '取消分路不良';
} else if (operate.operation == OperationEvent.Switch.cancelDefectiveShunting.menu.operation) {
this.name = '取消分路不良';
} else {
this.name = '分路不良';

View File

@ -63,7 +63,9 @@ export default {
doShow(operate, selected) {
this.selected = selected;
this.operation = operate.operation;
if (operate.operation == OperationEvent.Switch.cancelDefectiveShunting.menu.operation) {
if (operate.operation == OperationEvent.Section.cancelDefectiveShunting.menu.operation) {
this.title = '取消分路不良';
} else if (operate.operation == OperationEvent.Switch.cancelDefectiveShunting.menu.operation) {
this.title = '取消分路不良';
} else {
this.title = '分路不良';
@ -118,6 +120,10 @@ export default {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING;
break;
}
case OperationEvent.Section.cancelDefectiveShunting.menu.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING;
break;
}
case OperationEvent.Switch.cancelDefectiveShunting.menu.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_CANCEL_DEFECTIVE_SHUNTING;
break;

View File

@ -319,6 +319,7 @@ export default {
}
},
beforeDestroy() {
this.$store.dispatch('menuOperation/setButtonOperation', null);
this.routeDataMap = null;
this.routeButtonCodeList = [];
},

View File

@ -6,6 +6,7 @@
<set-fault ref="setFault" pop-class="datie-02__systerm" />
<add-spare-train ref="addSpareTrain" />
<draw-select ref="drawSelect" />
<fork-directive ref="forkDirective" />
</div>
</template>
@ -20,6 +21,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import AddSpareTrain from './dialog/addSpareTrain';
import DrawSelect from './dialog/drawSelect';
import ForkDirective from './dialog/forkDirective';
export default {
name: 'SectionMenu',
@ -29,7 +31,8 @@ export default {
TrainAddPlan,
SetFault,
AddSpareTrain,
DrawSelect
DrawSelect,
ForkDirective
},
props: {
selected: {
@ -50,11 +53,25 @@ export default {
menu: [],
menuNormal: [
{
label: ' 增加车次',
label: '增加车次',
handler: this.addSpare,
cmdType: CMD.Section.CMD_TRAIN_LOAD_TRIP_NUMBER_TRAIN,
isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork',
isShow: (section, work) => ['01', '02', '03'].includes(section.type)
},
{
label: '分路不良',
handler: this.forkDirective,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork',
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'ctcWork'
},
{
label: '空闲',
handler: this.cancleForkDirective,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING,
isDisabled: (section, station, work) => station.controlMode === 'Interlock' && work === 'ctcWork',
isShow: (section, work) => ['01', '02', '03'].includes(section.type) && work === 'ctcWork'
}
],
menuForce: [
@ -138,6 +155,22 @@ export default {
}
});
},
//
forkDirective() {
commitOperate(menuOperate.Section.defectiveShunting, {sectionCode:this.selected.code, shuntingTypeList: ['SECTION_SHUNTING']}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
});
},
//
cancleForkDirective() {
commitOperate(menuOperate.Section.cancelDefectiveShunting, {sectionCode:this.selected.code, shuntingTypeList: []}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
});
},
//
setStoppage() {
commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{

View File

@ -3,9 +3,9 @@
ref="keMenu"
class="navbar"
router
background-color="#00172E"
:default-active="activePath"
mode="horizontal"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
@select="handleSelect"
@ -35,7 +35,7 @@
</el-menu-item>
</template>
</template>
<el-submenu v-else :key="idx" :index="item.path" :show-timeout="100">
<el-submenu v-else :key="idx" :index="item.path" popper-append-to-body :show-timeout="100">
<template slot="title">
<span v-if="item.meta" slot="title">{{ $t(item.meta.i18n) }}</span>
</template>
@ -222,9 +222,39 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
<style lang="scss" scoped>
$height: 61px;
.el-menu.el-menu--horizontal{
border-bottom: solid 1px #01468B;
}
.el-menu {
background: linear-gradient(to bottom, #01468B, #00172E);
}
.el-menu-item{
background: linear-gradient(to bottom, #01468B, #00172E);
&:hover{
background-color: #00172E;
}
&:focus{
background-color: #00172E;
}
}
/deep/ {
.el-submenu {
&:hover{
background: #00172E;
}
}
.el-submenu__title{
background: linear-gradient(to bottom, #01468B, #00172E);
&:hover{
background: #00172E;
}
}
.el-menu-item.is-active{
background: #00172E;
}
}
.rightGroup{
display: inline-block;
padding: 0 20px;
@ -280,9 +310,11 @@ export default {
line-height: 36px;
color: #fff;
font-size: 14px;
}
.targetDiv :hover {
background-color: #434A50;
background: linear-gradient(to bottom, #01468B, #00172E);
&:hover {
background: #00172E;
}
}
.helpDiv {
height: 60px;

View File

@ -72,10 +72,10 @@ export default {
return this.$store.state.app.dialogMessage;
},
companyInfo() {
return loginInfo[getSessionStorage('project')].bottomColumn;
return loginInfo[getSessionStorage('project')] ? loginInfo[getSessionStorage('project')].bottomColumn : '';
},
bottomIcon() {
return loginInfo[getSessionStorage('project')].bottomIcon;
return loginInfo[getSessionStorage('project')] ? loginInfo[getSessionStorage('project')].bottomIcon : '';
}
},
watch:{

View File

@ -1,33 +1,20 @@
import Vue from 'vue';
import store from '@/store/index';
import router from './router/index';
// 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 { setToken, getToken, getSessionStorage, setSessionStorage } from '@/utils/auth';
import localStore from 'storejs';
import { handlerUrl } from '@/utils/baseUrl';
import { getFrontProjectConfigByLogin} from '@/api/projectConfig';
const whiteList = ['/login', '/design/login', '/loginNew', '/gzzbxy/relay', '/authorization', '/AUSline', '/AUStool', '/demo', '/thirdLogin']; // 不重定向白名单
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);
// }
// }
let frontConfigMark = '';
// 登录路径判断获取
function getRouteInfo(to, markKey) {
let loginPath = '';
const toRoutePath = to.redirectedFrom || to.path;
// const current_session = getSessionStorage('project');
if (loginList.includes(toRoutePath)) { // 登陆页面清空 token
removeToken();
}
// // const current_session = getSessionStorage('project');
// 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;
@ -94,25 +81,8 @@ router.beforeEach( async (to, from, next) => {
// 登陆成功页面
project = getSessionStorage('project') || 'login';
}
// 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) {
if (frontConfigMark !== project && to.path !== '/authorization') {
const response = await getFrontProjectConfigByLogin(project);
const {browserTitle, loginProLogo, baseApiUrl, baseSite, caseShow, helpShow, ossUrl, homeTitle, homeProLogoWidth} = response.data.viewSetting;
if (!store.state.user.baseUrl && project) {
const urlData = handlerUrl();
@ -121,6 +91,7 @@ router.beforeEach( async (to, from, next) => {
store.dispatch('setOssUrl', ossUrl || urlData.OSS_URL);
subscribe();
}
frontConfigMark = response.data.markKey;
document.title = browserTitle;
const url = loginProLogo ? store.state.user.ossUrl + '/logo/' + loginProLogo : '';
document.querySelector("link[rel*='icon']").href = url;
@ -130,32 +101,32 @@ router.beforeEach( async (to, from, next) => {
store.dispatch('setLoginProLogo', url);
store.dispatch('setHomeTitle', homeTitle);
NProgress.start();
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);
store.commit('SET_TOKEN', token);
store.commit('SUBSCRIBE', { header, type: '' });
}
const loginPath = getRouteInfo(to, frontConfigMark);
const token = to.query.token;
if (/demoTraining/.test(to.path) && token) {
const header = { group: to.query.group, 'X-Token': token };
setToken(token);
store.commit('SET_TOKEN', token);
store.commit('SUBSCRIBE', { header, type: '' });
next();
} else if (getToken()) {
if (to.path === loginPath || to.path === '/authorization') {
// 登录页面不拦截
next();
} else if (getToken()) {
if (to.path === loginPath) {
// 登录页面不拦截
next();
} else {
// 进入系统重新计算路由
handleRoute(to, next, loginPath);
}
} else {
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next();
} else if (to.path.substr(0, 13) == whiteList[2]) {
next();
} else {
// 否则全部重定向到登录页
next(loginPath);
}
// 进入系统重新计算路由
handleRoute(to, next, loginPath);
}
} else {
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next();
} else if (to.path.substr(0, 13) == whiteList[2]) {
next();
} else {
// 否则全部重定向到登录页
next(loginPath);
}
}
});

View File

@ -126,6 +126,7 @@ const SimulationPlatform = () => import('@/views/trainingPlatform/simulation');
const PublishMap = () => import('@/views/publish/publishMap/index');
const SubsystemManage = () => import('@/views/publish/publishMap/subsystem');
const MapFunTemManage = () => import('@/views/publish/publishMap/mapFunctionTemplate/index');
const SystemSubsetManage = () => import('@/views/publish/publishMap/systemSubset');
const IscsDataManage = () => import('@/views/publish/publishMap/iscsDataManage/index');
const PublishMapDetail = () => import('@/views/publish/publishMap/list'); // 发布历史
@ -269,6 +270,10 @@ export const constantRoutes = [
// hidden: true
// },
// 实训平台登录
{
path: '/',
redirect: '/login'
},
{
path: '/login',
component: Login,
@ -1776,6 +1781,20 @@ export const asyncRouter = [
path: 'orgDetail',
component: OrgDetail,
hidden: true
},
{// 授权码申请
path: 'authorApply',
component: AuthorApply,
meta: {
i18n: 'router.authorApply'
}
},
{// 授权码列表
path: 'AuthorList',
component: AuthorList,
meta: {
i18n: 'router.AuthorList'
}
}
]
},
@ -1875,6 +1894,11 @@ export const asyncRouter = [
component: SubsystemManage,
hidden: true
},
{
path: 'mapFunTem',
component: MapFunTemManage,
hidden: true
},
{
path: 'systemSubset',
component: SystemSubsetManage,

View File

@ -2482,6 +2482,13 @@ export const OperationEvent = {
// operation: '428',
// domId: '_Tips-Section-Defective-Shunting-MenuButton'
// },
},
// 取消分路不良 大铁线路
cancelDefectiveShunting:{
menu: {
operation: '429',
domId: '_Tips-Section-CancelDefectiveShunting-Menu{TOP}'
}
}
},

View File

@ -179,7 +179,6 @@ const user = {
commit('SET_TOKEN', '');
commit('SET_ID', '');
commit('SET_ROLES', []);
removeToken();
},
// 登出系统
@ -191,6 +190,7 @@ const user = {
dispatch('disconnect').then(()=>{
dispatch('FedLogOut').then(resp => {
logout(token).then(() => {
removeToken();
resolve();
}).catch(error => {
reject(error);
@ -215,6 +215,7 @@ const user = {
return new Promise((resolve, reject) => {
dispatch('FedLogOut').then(resp => {
logout(token).then(() => {
removeToken();
resolve();
}).catch(error => {
reject(error);
@ -234,7 +235,6 @@ const user = {
},
disconnect({commit}, params) {
commit('Disconnect', params);
removeToken();
},
setBaseUrl ({commit}, baseUrl) {
commit('setBaseUrl', baseUrl);

View File

@ -59,7 +59,8 @@ export function handlerUrl() {
OSS_URL = 'https://joylink.club/oss-rtss';
}
// VOICE_API, UPLOAD_API, BASE_SITE, PROD_API
return {BASE_API, BASE_SITE, OSS_URL};
const PROD_API = 'https://joylink.club/jlcloud';
return {BASE_API, BASE_SITE, OSS_URL, PROD_API};
}
// export function handlerUrl(data) {

View File

@ -9,6 +9,7 @@ import { EventBus } from '@/scripts/event-bus';
import ConstConfig from '@/scripts/ConstConfig';
import Vue from 'vue';
import router from '../router/index';
import {removeToken} from './auth';
const urlData = handlerUrl();
@ -22,6 +23,7 @@ const service = axios.create({
// request拦截器108
service.interceptors.request.use(config => {
if (getToken()) {
config.headers['Authorization'] = `Bearer ${getToken()}`; // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['X-Token'] = getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
}
@ -34,9 +36,9 @@ service.interceptors.request.use(config => {
// if (config.upload) {
// config.baseURL = urlData.UPLOAD_API;
// }
// if (config.production) {
// config.baseURL = urlData.PROD_API;
// }
if (config.production) {
config.baseURL = urlData.PROD_API;
}
if (config.time) {
config.timeout = config.time; // 让每个请求携带自定义token 请根据实际情况自行修改
@ -72,6 +74,7 @@ service.interceptors.response.use(
EventBus.$emit('clearCheckLogin');
// 断开连接
store.dispatch('disconnect');
removeToken();
MessageBox.confirm(i18n.t('tip.logoutTips'), i18n.t('tip.hint'), {
confirmButtonText: i18n.t('tip.confirmLogin'),
showCancelButton: false,

View File

@ -3,6 +3,7 @@ import { checkLoginLine } from '@/api/login';
import { MessageBox } from 'element-ui';
import store from '@/store/index';
import Stomp from 'stompjs';
import {removeToken} from './auth';
const isDev = process.env.NODE_ENV === 'development';
const isTest = process.env.NODE_ENV === 'test';
@ -74,6 +75,7 @@ StompClient.prototype = {
showCancelButton: false,
type: 'warning'
}).then(() => {
removeToken();
store.dispatch('FedLogOut').then(() => {
location.reload();// 为了重新实例化vue-router对象 避免bug
});

View File

@ -61,7 +61,7 @@ import bgIscsImg from '@/assets/bg_iscs.jpg';
import bgCctvImg from '@/assets/bg_cctv.jpg';
import bgLswImg from '@/assets/bg_lsw.jpg';
import bgPsdImg from '@/assets/bg_psd.png';
import { getLoginWmurl, checkLoginStatus, getLoginInfo, selectOrgnization } from '@/api/login';
import { getLoginWmurl, checkLoginStatus, getLoginInfo } from '@/api/login';
import { getToken} from '@/utils/auth';
import { assignUsersPlayRoles } from '@/api/jointSimulation';
import { getBackProjectConfigByCode } from '@/api/projectConfig';
@ -143,6 +143,8 @@ export default {
setSessionStorage('project', this.project);
if (this.syncLogin) {
this.deviceRelatedLogin();
// } else if (getToken()) {
// this.$refs.normalLogin.handleLoginSucessRoute(this.backProject);
}
}
}).catch(() => {
@ -223,14 +225,13 @@ export default {
this.checkLogin = setTimeout(() => {
checkLoginStatus(self.sessionId)
.then(response => {
//
self.$store
.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: 'class' })
.then(() => {
//
self.clearTimer(self.checkLogin);
this.checkOrgnizationInfo();
this.handleLoginSucessRoute();
});
}).catch(error => {
@ -242,25 +243,6 @@ export default {
});
}, 3000);
},
//
checkOrgnizationInfo() {
this.handleLoginSucessRoute();
// 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.showOrgList(orgList);
// }
// }).catch((error)=>{
// this.$message.error(error.message);
// });
},
//
handleLoginSucessRoute() {
getBackProjectConfigByCode(this.project).then(res=>{

View File

@ -61,7 +61,7 @@
</div>
</el-popover> -->
<div class="popover_box active" @click="registerUser">
注册账号
{{ $t('login.registerAccount') }}
</div>
</div>
<el-form-item>
@ -71,7 +71,7 @@
</el-form-item>
<div v-if="!localProject" style="display: inline-block;width: 100%;">
<div class="popover_box active" style="bottom: 50px;" @click="forgetPassword">
忘记密码
{{ $t('login.forgetPassword') }}
</div>
</div>
</el-form>
@ -220,7 +220,7 @@ export default {
selectOrgnization(orgId);
},
//
handleLoginSucessRoute() {
handleLoginSucessRoute(project) {
this.loading = false;
this.tipsMsg = '';
let path = '';
@ -229,15 +229,15 @@ export default {
projectDevice:this.$route.query.projectDevice,
type: this.$route.query.type
};
this.judgeOtherPage(params);
this.judgeOtherPage(params, project);
} else {
path = '/simulation/simulationIndex';
this.$router.push({ path: path });
}
},
judgeOtherPage(params) {
judgeOtherPage(params, project) {
// itemMap: {DEFAULT_MEMBER: '1'}type: "METRO"
getBackProjectConfigByCode(this.project).then(res=>{
getBackProjectConfigByCode(this.project || project).then(res=>{
if (res.data) {
const {mapId, functionId} = res.data;
if (functionId && mapId) {

View File

@ -4,7 +4,6 @@
<el-menu
:default-active="defaultIndex"
class="el-menu-vertical-demo lessonManageMenu"
background-color="#545c64"
text-color="#fff"
router
active-text-color="#ffd04b"
@ -86,7 +85,15 @@ export default {
};
</script>
<style scoped>
<style scoped lang="scss">
.el-menu {
background: linear-gradient(to bottom, #01468B, #00172E);
}
.el-menu-item{
&:hover{
background: #00172E;
}
}
.teachMenu{width: 18px;height: 18px;margin-right: 8px;}
.lessonIcon{font-size: 16px;}
.lessonManageOther{

View File

@ -37,20 +37,21 @@
</el-col>
<el-col :span="12">
<el-form-item label="背景:" prop="bgUrl">
<div style="display: flex;align-items: flex-start;">
<el-select v-model="ruleForm.bgUrl" size="mini" clearable>
<el-option
v-for="item in bgUrlList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<img :src="ossUrl+ruleForm.bgUrl" style="width: 200px;margin-left: 15px;">
<div class="eachButton uploadLogo">
<img v-if="ruleForm.bgUrl" :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>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="分组:" prop="subset">
<el-input v-model="ruleForm.subset" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
<el-card style="padding: 10px;">
<el-table
:data="endTableData"
@ -131,7 +132,7 @@ import { queryPaperList } from '@/api/management/exam';
import { getTrainingDetailNew } from '@/api/jmap/training';
import ChooseTraining from './chooseTraining';
import { ClientList, TrainingTypeList } from '@/scripts/ConstDic';
import { getUploadUrl } from '@/api/projectConfig';
export default {
name: 'EditSubsystem',
components: {
@ -143,6 +144,7 @@ export default {
title: '',
trainingName: '',
mapSystemId: '',
loginProLogoImg: '',
memberList: [],
examList: [],
lpfDataList: [],
@ -179,29 +181,17 @@ export default {
name: '',
type: '',
desc: '',
bgUrl: ''
bgUrl: '',
subset: ''
},
memberMetroList: [],
memberRailwayList: [],
memberEmergencyList: [],
bgUrlList: [
{ label: '运行图编制', value: '/logo/chartPreparation.png' },
{ label: '调度仿真', value: '/logo/dispatchingPlan.png' },
{ label: '考试', value: '/logo/exam.png' },
{ label: '综合演练', value: '/logo/joinRoom.png' },
{ label: '场景实训', value: '/logo/sceneTraining.png' },
{ label: '派班', value: '/logo/schedulingSimulation.png' },
{ label: '单操仿真', value: '/logo/singleTraining.png' },
{ label: '车站仿真', value: '/logo/stationSimulation.png' },
{ label: '车辆段', value: '/logo/trainDepot.png' },
{ label: '实训设计', value: '/logo/trainingDesign.png' },
{ label: '模拟驾驶', value: '/logo/simulatedDriving.png' }
]
memberEmergencyList: []
};
},
computed: {
ossUrl() {
return this.$store.state.user.ossUrl;
computedLoginLogo() {
return this.loginProLogoImg ? this.$store.state.user.ossUrl + this.loginProLogoImg : '';
}
},
async mounted() {
@ -259,6 +249,8 @@ export default {
this.ruleForm.name = row.name;
this.ruleForm.desc = row.desc || '';
this.ruleForm.bgUrl = row.bgUrl || '';
this.loginProLogoImg = row.bgUrl || '';
this.ruleForm.subset = row.subset || '';
this.ruleForm.type = row.paramVO.type;
this.typeChange(this.ruleForm.type);
this.frontTableData.forEach(item => {
@ -378,7 +370,8 @@ export default {
name: '',
type: '',
desc: '',
bgUrl: ''
bgUrl: '',
subset: ''
};
this.frontTableData = [
{ key: 'singleMember', label: '是否单角色', value: false, type: 'checkbox' },
@ -425,6 +418,7 @@ export default {
name: this.ruleForm.name,
desc: this.ruleForm.desc,
bgUrl: this.ruleForm.bgUrl,
subset: this.ruleForm.subset,
paramVO: {
type: this.ruleForm.type,
itemMap:itemMap,
@ -461,13 +455,99 @@ export default {
this.trainingName = data.name;
const training = this.endTableData.find(item => item.type === 'trainingChoose');
training.value = data.id;
},
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:'funBg',
fileName:'favicon_' + this.ruleForm.name + Math.ceil(Math.random() * 1000) + '.' + 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.ruleForm.bgUrl = '/funBg/' + params.fileName;
that.loginProLogoImg = '/funBg/' + params.fileName + '?' + Math.random() * 1000;
} else if (xhr.status != 200) {
that.$message.error('上传失败,请稍后再试');
}
};
}
});
}
}
};
</script>
<style scoped>
<style scoped lang="scss">
.dialog-footer {
text-align: center;
}
.loginLogo{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.el-icon-other{
width: 100%;
text-align: center;
height: 100%;
line-height: 98px;
font-size: 16px;
position: absolute;
color: #000;
}
.eachButton{
margin-left:10px;
width:200px;
height:100px;
border:1px #ccc dashed;
margin-bottom: 10px;
}
.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;
}
}
</style>

View File

@ -66,7 +66,7 @@ export default {
queryForm: {
labelWidth: '80px',
reset: true,
leftSpan: 17,
leftSpan: 15,
queryObject: {
name: {
type: 'text',
@ -223,7 +223,8 @@ export default {
{ text: '地图排序', handler: this.mapSort },
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.includes(superAdmin); }},
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.includes(superAdmin); }},
{ text: '一键校验', handler: this.allCheck }
{ text: '一键校验', handler: this.allCheck },
{ text: '线路功能模板', handler: this.templateLineFunctionShow }
]
},
@ -416,6 +417,9 @@ export default {
this.$message.error('一键校验地图数据失败:' + e.message);
});
},
templateLineFunctionShow() {
this.$router.push({path:'/systemManagement/lineDataManage/mapFunTem'});
},
localExport() {
this.$refs['localMap'].doShow();
},

View File

@ -0,0 +1,438 @@
<template>
<el-dialog
:title="title"
:before-close="close"
:visible.sync="visible"
center
fullscreen
>
<div style="padding: 0 150px">
<el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="120px" size="small">
<el-row>
<el-col :span="12">
<el-form-item label="模板名称:" prop="templateName">
<el-input v-model="ruleForm.templateName" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="线路功能名称:" prop="name">
<el-input v-model="ruleForm.name" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="系统:" prop="type">
<el-select v-model="ruleForm.type" placeholder="请选择类型">
<el-option label="地铁CBTC" value="METRO" />
<el-option label="大铁CTC" value="RAILWAY" />
<el-option label="应急调度" value="EMERGENCY" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="默认成员类型:" prop="defaultMemberType">
<el-select v-model="ruleForm.defaultMemberType" size="mini" clearable>
<el-option
v-for="item in memberTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="描述:" prop="desc">
<el-input
v-model="ruleForm.desc"
type="textarea"
:rows="4"
placeholder="请输入内容"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="背景:" prop="bgUrl">
<div class="eachButton uploadLogo">
<img v-if="ruleForm.bgUrl" :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>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="分组:" prop="subset">
<el-input v-model="ruleForm.subset" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
<el-card style="padding: 10px;">
<el-table
:data="endTableData"
border
size="mini"
style="width: 100%;margin-top: 10px;max-height: 300px;overflow: scroll;"
>
<el-table-column
prop="label"
label="后端配置项"
/>
<el-table-column
prop="value"
label="value"
>
<template slot-scope="scope">
<el-checkbox v-if="scope.row.type === 'checkbox'" v-model="scope.row.value" />
<el-select
v-else-if="scope.row.type === 'select'"
v-model="scope.row.value"
size="mini"
clearable
>
<el-option
v-for="item in scope.row.optionList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card style="padding: 10px;margin-top: 20px;">
<el-table
:data="frontTableData"
border
size="mini"
style="width: 100%;margin-top: 10px;max-height: 300px;overflow: scroll;"
>
<el-table-column
prop="label"
label="前端配置项"
/>
<el-table-column
prop="value"
label="value"
>
<template slot-scope="scope">
<el-checkbox v-if="scope.row.type === 'checkbox'" v-model="scope.row.value" />
<el-select
v-else-if="scope.row.type === 'select'"
v-model="scope.row.value"
size="mini"
clearable
>
<el-option
v-for="item in scope.row.optionList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
</el-table>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="commit"> </el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import { createTemplateMapFunction, updateTemplateMapFunction } from '@/api/trainingPlatform';
import { ClientList, TrainingTypeList } from '@/scripts/ConstDic';
import ConstConfig from '@/scripts/ConstConfig';
import { getUploadUrl } from '@/api/projectConfig';
export default {
name: 'EditSubsystem',
data() {
return {
visible: false,
title: '',
loginProLogoImg: '',
memberTypeList: ConstConfig.ConstSelect.roleTypeList,
frontTableData: [
{ key: 'singleMember', label: '是否单角色', value: false, type: 'checkbox' },
{ key: 'singleClient', label: '是否单客户端', value: false, type: 'checkbox' },
{ key: 'client', label: '初始客户端', value: '', type: 'select', optionList: ClientList},
{ key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'},
{ key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList },
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },
{ key: 'hasMemberManage', label: '是否有成员管理', value: false, type: 'checkbox' }
],
endTableData: [
// { key: 'DEFAULT_MEMBER', label: '仿', value: '', type: 'select', optionList: [] },
// { key: 'LPF', label: '', value: '', type: 'select', optionList: [] },
{ key: 'REAL_DEVICE', label: '真实设备', value: '', type: 'checkbox' }
// { key: 'TRAINING', label: '', value: '', type: 'trainingChoose' },
// { key: 'EXAM', label: '', value: '', type: 'select', optionList: [] }
],
rules: {
templateName: [
{ required: true, message: '请输入模板线路功能名称', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入线路功能名称', trigger: 'blur' }
],
type: [
{ required: true, message: '请选择线路功能类型', trigger: 'change' }
]
},
ruleForm: {
templateName: '',
templateId: '',
defaultMemberType: '',
name: '',
type: '',
desc: '',
bgUrl: '',
subset: ''
}
};
},
computed: {
computedLoginLogo() {
return this.loginProLogoImg ? this.$store.state.user.ossUrl + this.loginProLogoImg : '';
}
},
methods: {
doShow(row) {
if (row && row.id) {
this.ruleForm.templateId = row.id;
this.ruleForm.templateName = row.name;
this.ruleForm.defaultMemberType = row.assistantParam.defaultMemberType;
this.loginProLogoImg = row.mapFunctionParam.bgUrl;
this.ruleForm.name = row.mapFunctionParam.name;
this.ruleForm.desc = row.mapFunctionParam.desc || '';
this.ruleForm.bgUrl = row.mapFunctionParam.bgUrl || '';
this.ruleForm.subset = row.mapFunctionParam.subset || '';
this.ruleForm.type = row.mapFunctionParam.paramVO.type;
this.frontTableData.forEach(item => {
item.value = row.mapFunctionParam.paramVO.domConfig[item.key];
});
this.endTableData.forEach(item => {
if (row.mapFunctionParam.paramVO.itemMap && row.mapFunctionParam.paramVO.itemMap[item.key]) {
if (row.mapFunctionParam.paramVO.itemMap[item.key] === 'true') {
item.value = true;
} else if (row.mapFunctionParam.paramVO.itemMap[item.key] === 'false') {
item.value = false;
} else {
item.value = row.mapFunctionParam.paramVO.itemMap[item.key] === null ? '' : row.mapFunctionParam.paramVO.itemMap[item.key];
}
}
});
this.title = '修改模板线路功能';
} else {
this.title = '创建模板线路功能';
}
this.visible = true;
},
close() {
this.ruleForm = {
templateId: '',
templateName: '',
defaultMemberType: '',
name: '',
type: '',
desc: '',
bgUrl: '',
subset: ''
};
this.loginProLogoImg = '';
this.frontTableData = [
{ key: 'singleMember', label: '是否单角色', value: false, type: 'checkbox' },
{ key: 'singleClient', label: '是否单客户端', value: false, type: 'checkbox' },
{ key: 'client', label: '初始客户端', value: '', type: 'select', optionList: ClientList},
{ key: 'hasTraining', label: '是否有实训', value: false, type: 'checkbox'},
{ key: 'trainingType', label: '实训类型', value: '', type: 'select', optionList: TrainingTypeList },
{ key: 'hasExam', label: '是否有考试', value: false, type: 'checkbox' },
{ key: 'trainingDesign', label: '是否实训设计', value: false, type: 'checkbox' },
{ key: 'hasLpf', label: '是否有大客流', value: false, type: 'checkbox' },
{ key: 'hasVoice', label: '是否有语音指令', value: false, type: 'checkbox' },
{ key: 'joint', label: '是否综合演练', value: false, type: 'checkbox' },
{ key: 'hasDeviceManage', label: '是否有设备管理', value: false, type: 'checkbox' },
{ key: 'hasMemberManage', label: '是否有成员管理', value: false, type: 'checkbox' }
];
this.endTableData = [
// { key: 'DEFAULT_MEMBER', label: '仿', value: '', type: 'select', optionList: [] },
// { key: 'LPF', label: '', value: '', type: 'select', optionList: this.lpfDataList },
{ key: 'REAL_DEVICE', label: '真实设备', value: '', type: 'checkbox' }
// { key: 'TRAINING', label: '', value: '', type: 'trainingChoose' },
// { key: 'EXAM', label: '', value: '', type: 'select', optionList: this.examList }
];
this.visible = false;
this.$refs.ruleForm.resetFields();
},
commit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
const itemMap = {
DEFAULT_MEMBER: '',
LPF: '',
TRAINING: '',
EXAM: ''
};
this.endTableData.forEach(item => {
itemMap[item.key] = item.value === '' ? null : item.value;
});
const domConfig = {};
this.frontTableData.forEach(item => {
domConfig[item.key] = item.value;
});
if (!domConfig.trainingType) {
delete domConfig.trainingType;
}
const data = {
name: this.ruleForm.templateName,
assistantParam: {
defaultMemberType: this.ruleForm.defaultMemberType
},
mapFunctionParam: {
name: this.ruleForm.name,
desc: this.ruleForm.desc,
bgUrl: this.ruleForm.bgUrl,
subset: this.ruleForm.subset,
paramVO: {
type: this.ruleForm.type,
itemMap:itemMap,
domConfig: domConfig
}
}
};
if (this.title === '创建模板线路功能') {
createTemplateMapFunction(data).then(resp => {
this.visible = false;
this.$emit('tableReload');
this.$message.success('创建模板线路功能成功!');
this.close();
}).catch(() => {
this.$message.error('创建模板线路功能失败!');
});
} else {
data.id = this.ruleForm.templateId;
updateTemplateMapFunction(data).then(resp => {
this.visible = false;
this.$emit('tableReload');
this.close();
this.$message.success('修改模板线路功能成功!');
}).catch(() => {
this.$message.error('修改模板线路功能失败!');
});
}
}
});
},
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:'funBg',
fileName:'favicon_' + this.ruleForm.templateName + '.' + 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.ruleForm.bgUrl = '/funBg/' + params.fileName;
that.loginProLogoImg = '/funBg/' + params.fileName + '?' + Math.random() * 1000;
} else if (xhr.status != 200) {
that.$message.error('上传失败,请稍后再试');
}
};
}
});
// directoryMINIO
// fileName
// method
}
}
};
</script>
<style scoped lang="scss">
.dialog-footer {
text-align: center;
}
.loginLogo{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
}
.el-icon-other{
width: 100%;
text-align: center;
height: 100%;
line-height: 98px;
font-size: 16px;
position: absolute;
color: #000;
}
.eachButton{
margin-left:10px;
width:200px;
height:100px;
border:1px #ccc dashed;
margin-bottom: 10px;
}
.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;
}
}
</style>

View File

@ -0,0 +1,153 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-subsystem ref="editSubsystem" @tableReload="reloadTable" />
</div>
</template>
<script>
import { queryTemplateMapFunPaged, deleteTemplateMapFunction } from '@/api/trainingPlatform';
import EditSubsystem from './edit';
import ConstConfig from '@/scripts/ConstConfig';
const simTypeMap = {
METRO: '地铁CBTC',
RAILWAY: '大铁CTC',
EMERGENCY: '应急调度'
};
export default {
name: 'PublishMap',
components: {
EditSubsystem
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
leftSpan: 16,
queryObject: {
name: {
type: 'text',
label: '名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '模板名称',
prop: 'name'
},
{
title: '线路功能名称',
prop: 'name',
type: 'tag',
columnValue: (row) => { return row.mapFunctionParam.name; },
tagType: () => { return 'success'; }
},
{
title: '分组',
prop: 'subset',
type: 'tag',
columnValue: (row) => { return row.mapFunctionParam.subset; },
tagType: () => { return 'success'; }
},
{
title: '系统',
prop: 'simType',
type: 'tag',
columnValue: (row) => { return simTypeMap[row.mapFunctionParam.paramVO.type]; },
tagType: () => { return 'success'; }
},
{
title: '默认扮演成员类型',
prop: 'DEFAULT_MEMBER',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.assistantParam ? row.assistantParam.defaultMemberType : '', ConstConfig.ConstSelect.roleTypeList, ['value', 'label']); },
tagType: () => { return 'success'; }
},
{
title: '真实设备',
prop: 'REAL_DEVICE',
type: 'tag',
columnValue: (row) => { return row.mapFunctionParam.paramVO && row.mapFunctionParam.paramVO.itemMap && row.mapFunctionParam.paramVO.itemMap.REAL_DEVICE ? '是' : '否'; },
tagType: () => { return 'success'; }
},
{
title: '描述',
prop: 'desc',
type: 'tag',
columnValue: (row) => { return row.mapFunctionParam.desc; },
tagType: () => { return 'success'; }
},
{
type: 'button',
title: '操作',
width: '300',
buttons: [
{
name: '更新',
handleClick: this.updateRow
},
{
name: '删除',
handleClick: this.deleteRow
}
]
}
],
actions: [
{ text: '新建', handler: this.handleAddSubsystem },
{ text: '返回', handler: this.goBack }
]
}
};
},
methods: {
queryFunction(params) {
params['detail'] = true;
return queryTemplateMapFunPaged(params);
},
deleteRow(index, row) {
this.$confirm('删除线路功能,是否继续?', '提 示', {
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
deleteTemplateMapFunction(row.id).then(resp => {
this.reloadTable();
}).catch(error => {
this.$message.error(`删除模板线路功能失败:${error.message}`);
});
}).catch( () => { });
},
updateRow(index, row) {
this.$refs.editSubsystem.doShow(row);
},
handleAddSubsystem() {
this.$refs.editSubsystem.doShow();
},
reloadTable() {
this.queryList.reload();
},
goBack() {
this.$router.go(-1);
}
}
};
</script>
<style lang="scss" scoped>
/deep/
.el-button+.el-button{
margin-top: 5px;
margin-left: 5px;
}
</style>

View File

@ -10,13 +10,19 @@
center
>
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="120px">
<el-form-item label="系统:" prop="simTypes">
<el-select v-model="form.simTypes" multiple placeholder="请选择生成仿真类型">
<el-option label="地铁CBTC" value="METRO" />
<el-option label="大铁CTC" value="RAILWAY" />
<el-option label="应急调度" value="EMERGENCY" />
<el-form-item label="功能模板:" prop="templateIds">
<el-select v-model="form.templateIds" multiple clearable placeholder="请选择生成功能模板">
<el-option
v-for="item in templateList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="同名覆写:" prop="overwrite">
<el-checkbox v-model="form.overwrite" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doCloseGenerate"> </el-button>
@ -27,7 +33,7 @@
</template>
<script>
import { queryMapFunctionPaged, deleteMapFunction, generateMapFunctionNew, deleteAllMapFunction } from '@/api/trainingPlatform';
import { queryMapFunctionPaged, deleteMapFunction, deleteAllMapFunction, queryTemplateMapFunctionList, generateMapFunctionByTemplate } from '@/api/trainingPlatform';
import { getPublishMapListOnline } from '@/api/jmap/map';
import EditSubsystem from './editSubsystem';
const simTypeMap = {
@ -35,25 +41,6 @@ const simTypeMap = {
RAILWAY: '大铁CTC',
EMERGENCY: '应急调度'
};
// const clientMap = {
// C_ATS: 'ATS',
// C_ATS_BS: 'ATS',
// C_PA: 'PA',
// C_CCTV: '',
// L_ATS: 'ATS',
// LCW: '',
// L_CCTV: '',
// L_PA: 'PA',
// GPC: '',
// IPC: '',
// STPC: '',
// DMP: '',
// ISCS: 'ISCS',
// IBP: 'IBP',
// PSL: 'PSL',
// RUN_PLAN_DESIGN: '',
// DRIVE: ''
// };
export default {
name: 'PublishMap',
components: {
@ -61,20 +48,21 @@ export default {
},
data() {
return {
dialogVisible: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
title: '一键生成线路功能',
visible: false,
templateList: [],
rules: {
type: [
{ required: true, message: '请选择生成仿真系统类型', trigger: 'change' }
templateIds: [
{ required: true, message: '请选择模板线路功能', trigger: 'change' }
]
},
form: {
simTypes: []
templateIds: [],
overwrite: false
},
queryForm: {
labelWidth: '80px',
@ -185,11 +173,6 @@ export default {
}
};
},
computed: {
isShow() {
return this.$store.getters['roles'].indexOf('05');
}
},
created() {
this.mapList = [];
getPublishMapListOnline().then(resp => {
@ -213,6 +196,7 @@ export default {
},
queryFunction(params) {
params['mapId'] = this.$route.query.mapId;
params['detail'] = true;
return queryMapFunctionPaged(params);
},
deleteRow(index, row) {
@ -229,19 +213,30 @@ export default {
}).catch( () => { });
},
generateMapSystem() {
if (!this.templateList.length) {
queryTemplateMapFunctionList({detail: false}).then(resp => {
this.templateList = resp.data || [];
}).catch(() => {
this.$message.error('获取模板线路功能列表失败!');
});
}
this.visible = true;
},
systemSubset() {
this.$router.push({ path:'/systemManagement/lineDataManage/systemSubset', query:{ mapId: this.$route.query.mapId, lineCode: this.$route.query.lineCode }});
},
doCloseGenerate() {
this.form.simTypes = [];
this.form = {
templateIds: [],
overwrite: false
};
this.visible = false;
},
generateCommit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
generateMapFunctionNew(this.$route.query.mapId, this.form).then(resp => {
const data = { templateIds: this.form.templateIds, mapIds: [this.$route.query.mapId], overwrite: this.form.overwrite };
generateMapFunctionByTemplate(data).then(resp => {
if (resp.data && resp.data.length) {
let message = '';
resp.data.forEach(item => {

View File

@ -66,7 +66,7 @@ export default {
};
},
mounted() {
queryMapFunctionList({mapId: this.$route.query.mapId}).then(resp => {
queryMapFunctionList({mapId: this.$route.query.mapId, detail: false}).then(resp => {
this.functionList = resp.data;
this.functionList.forEach(item => {
if (item.subset && this.subsetList.includes(item.subset)) {

View File

@ -0,0 +1,193 @@
<template>
<el-dialog title="权限分发到指定用户" append-to-body :visible.sync="dialogVisible" width="1400px" :before-close="doClose" center :close-on-click-modal="false">
<QueryListPage ref="queryListPage1" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { getUserList } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
export default {
name:'SelectUser',
data() {
return {
dialogVisible:false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
companyMap: {},
companyList: [],
countTypeList:[
{label:'个人账户', value:'1'},
{label:'企业账户', value:'2'},
{label:'企业账户下子账户', value:'3'}
],
queryForm: {
labelWidth: '80px',
leftSpan: 20,
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('system.name')
},
id: {
type: 'text',
label: 'id'
},
account:{
type: 'text',
label: '账号'
},
parentAccount:{
type: 'text',
label: '父账号'
},
roles: {
type: 'select',
label: this.$t('system.roles'),
config: {
data: this.$ConstSelect.roleList
}
},
nickname: {
type: 'text',
label: '昵称'
},
mobile: {
type: 'text',
label: '手机号'
},
email: {
type: 'text',
label: '邮箱'
},
companyId: {
type: 'select',
label: '组织',
config: {
data: []
}
},
type:{
type: 'select',
label: '类型',
config: {
data: []
}
}
}
},
queryList: {
query: getUserList,
selectCheckShow: false,
height: '420',
indexShow: true,
columns: [
{
title: 'id',
prop: 'id',
width: 80
},
{
title: '账号',
prop: 'account',
width: 80
},
{
title: '父账号',
prop: 'parentAccount',
width: 80
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.nickname'),
prop: 'nickname'
},
{
title: '类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.getCountType(row.type); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('global.mobile'),
prop: 'mobile'
},
{
title: this.$t('global.email'),
prop: 'email'
},
{
title: '组织',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.companyId); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.roles'),
prop: 'roles',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '90',
buttons: [
{
name: '选择',
handleClick: this.selectUser
}
]
}
]
}
};
},
created() {
this.companyMap = {};
this.companyList = [];
getCompanyList().then(resp => {
if (resp && resp.data && resp.data.length) {
resp.data.forEach(item => {
this.companyMap[item.id] = item.name;
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
this.queryForm.queryObject.companyId.config.data = this.companyList;
this.queryForm.queryObject.type.config.data = this.countTypeList;
}
}).catch((error) => {
console.error(error);
});
},
methods:{
doShow() {
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
getCountType(type) {
const countType = this.countTypeList.find(each=>{ return each.value == type; });
return countType ? countType.label : '';
},
getCompanyName(companyId) {
return this.companyMap[companyId];
},
selectUser(index, row) {
this.$emit('setUserInfo', row);
this.doClose();
}
}
};
</script>

View File

@ -1,67 +1,70 @@
<template>
<el-dialog v-dialogDrag title="绑定组织成员" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<el-form ref="form" :model="formModel" :rules="rules" label-width="100px;">
<el-form-item label="组织" prop="orgName">
<el-input v-model="formModel.orgName" disabled style="width: 200px" />
</el-form-item>
<el-form-item label="用户" prop="uid">
<el-input v-model="allName" placeholder="请添加" disabled style="width: 200px">
<el-button slot="append" type="primary" icon="el-icon-search" @click="searchUser" />
</el-input>
</el-form-item>
<el-form-item label="角色" prop="role">
<el-select v-model="formModel.role" placeholder="请选择">
<el-option
v-for="item in schoolRoleList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doConfirm">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
<select-user ref="selectUser" @setUserInfo="setUserInfo" />
</el-dialog>
</template>
<script>
import { getBindUserRoles, getManageUserList } from '@/api/management/user';
import { getBindUserRoles } from '@/api/management/user';
import ConstConfig from '@/scripts/ConstConfig';
import SelectUser from './selectUser';
export default {
name:'SelectUserRole',
components: {
SelectUser
},
props: {
},
data() {
return {
dialogVisible: false,
userList: [],
schoolRoleList: ConstConfig.ConstSelect.schoolRoleList,
userInfo: {},
formModel: {
keyId: '',
orgName: '',
orgId: '',
uid: '',
role:''
}
};
},
computed: {
form() {
const form = {
labelWidth: '150px',
items: [
{ prop: 'orgName', label: '组织', type: 'text', disabled:true, rightWidth:true },
{ prop: 'uid', label: '用户', type: 'select', options: this.userList},
{ prop: 'role', label: '角色', type: 'select', options: ConstConfig.ConstSelect.schoolRoleList}
]
};
return form;
},
rules() {
const crules = {
},
rules: {
uid: [
{ required: true, message: '请选择用户', trigger: 'change' }
],
role: [
{ required: true, message: '请选择角色', trigger: 'change' }
]
};
return crules;
}
},
created() {
getManageUserList().then(resp => {
if (resp && resp.data && resp.data.length) {
resp.data.forEach(item => {
this.userList.push({label: item.name, value: item.id});
});
}
}).catch((error) => {
console.error(error);
});
};
},
computed: {
allName() {
return this.formModel.uid ? this.userInfo.nickname + '(' + this.userInfo.name + ')' : '';
}
},
methods:{
doShow(row) {
@ -74,6 +77,7 @@ export default {
},
doClose() {
this.dialogVisible = false;
this.userInfo = {};
this.formModel = {
keyId: '',
orgName: '',
@ -81,25 +85,20 @@ export default {
uid: '',
role:''
};
},
getUserName(id) {
let name = '';
const findItem = this.userList.find(item => {
return item.value == id;
});
if (findItem) {
name = findItem.label;
}
return name;
this.$refs.form.resetFields();
},
doConfirm() {
this.$refs.dataform.validateForm(() => {
const formModel = Object.assign({}, this.formModel);
delete formModel.orgName;
getBindUserRoles(formModel).then(res=>{
this.$refs.form.validate(() => {
const data = {
keyId: this.formModel.keyId,
orgId: this.formModel.orgId,
uid: this.formModel.uid,
role: this.formModel.role
};
getBindUserRoles(data).then(res => {
const nodeData = {
keyId: this.formModel.keyId + 'USER' + this.formModel.uid,
name: this.getUserName(this.formModel.uid),
name: this.userInfo.nickname + '(' + this.userInfo.name + ')',
orgRole: this.formModel.role,
type: 'USER',
userId: this.formModel.uid
@ -110,8 +109,23 @@ export default {
this.$message.error('绑定组织成员失败: ' + error.message);
});
});
},
setUserInfo(user) {
this.userInfo = user;
this.formModel.uid = user.id;
},
searchUser() {
this.$refs.selectUser.doShow();
}
}
};
</script>
<style lang="scss" scoped>
.el-input-group__append button.el-button{
border-bottom-left-radius: 0;
border-top-left-radius: 0;
background: #409EFF;
color: #fff;
}
</style>

View File

@ -112,7 +112,7 @@ export default {
}
},
getRelatedFunctionList(mapId) {
queryMapFunctionList({mapId: mapId}).then(resp => {
queryMapFunctionList({mapId: mapId, detail: true}).then(resp => {
this.functionList = resp.data;
console.log(resp);
}).catch(() => {

View File

@ -12,7 +12,6 @@
<el-menu
:default-active="defaultIndex"
class="el-menu-vertical-demo"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
>
@ -86,16 +85,27 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.el-menu{
background-color: transparent;
}
.el-menu-item{
&:hover{
background: #00172E;
}
&:focus{
background-color: #00172E;
}
}
.mapListName{
padding: 10px 0 10px 17px;
color: #fff;
background: #545c64;
background: #01468B;
display: flex;
justify-content: left;
align-items: center;
position: sticky;
position: -webkit-sticky;
border-bottom: 3px solid #8c8a89;
border-bottom: 1px solid #00172E;
top: 0;
z-index: 9;
}
@ -103,16 +113,27 @@ export default {
width: 100%;
height: 100%;
flex: 1;
overflow: scroll;
overflow-y: scroll;
padding-bottom: 10px;
background: #545c64;
background: linear-gradient(to bottom, #01468B, #00172E);
&::-webkit-scrollbar{
background: #06284a;
}
&::-webkit-scrollbar-thumb{
background: #0c0909;
}
&::-webkit-scrollbar-track{
background: #06284a;
}
}
.map-list-main{
height: 100%;
display:flex;
flex-direction:column;
}
/deep/.el-menu{
border-right-width: 0;
/deep/{
.el-menu{
border-right-width: 0;
}
}
</style>

View File

@ -62,5 +62,6 @@ export default {
left:0;
top:0;
height: 100%;
background: #00172E;
}
</style>

View File

@ -1,7 +1,7 @@
<template>
<div style="height: 100%;width: 100%;padding-bottom: 20px;">
<div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;">{{ mapName }}</div>
<el-tabs v-model="activeName" style="height: calc(100% - 30px);margin: 0 10px;overflow-y: auto;" type="border-card">
<div class="sim-box">
<div style="height: 50px;text-align: center;line-height: 50px;font-size: 26px;font-weight: bolder;color: #fff;">{{ mapName }}</div>
<el-tabs v-model="activeName" class="tabs-box" type="border-card">
<el-tab-pane label="功能" name="first" style="height: 100%;">
<el-collapse v-model="collapse" accordion>
<template v-for="item in subsetList">
@ -248,7 +248,7 @@ export default {
this.$refs.selectRole.doShow(row.id);
},
initMapSystem() {
queryMapFunctionList({mapId: this.$route.params.mapId}).then(resp => {
queryMapFunctionList({mapId: this.$route.params.mapId, detail: true}).then(resp => {
this.systemList = resp.data;
this.systemList.forEach(item => {
if (item.subset && this.subsetList.includes(item.subset)) {
@ -343,6 +343,72 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/{
.el-collapse-item__header {
background: #00172E;
color: #fff;
}
.el-collapse-item__content{
background: #00172E;
}
.el-tabs__nav-scroll{
background: #00172E;
}
.el-tabs--border-card>.el-tabs__header .el-tabs__item{
color: #fff;
border: solid 1px #01468B;
}
.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{
background: #01468B;
}
.el-form-item__label {
color: #fff;
}
.el-tabs--border-card{
border: solid 1px #01468B;
}
.el-collapse-item__header{
border-bottom: solid 1px #01468B;
}
.el-collapse{
border-top: solid 1px #01468B;
border-bottom: solid 1px #01468B;
}
.el-collapse-item__wrap{
border-bottom: solid 1px #01468B;
}
.el-table th.el-table__cell{
background-color: #01468B;
color: #fff;
}
.el-table--border, .el-table--group{
border-width: 0;
}
}
.el-card{
border: solid 1px #01468B;
}
.tabs-box{
height: calc(100% - 30px);
margin: 0 10px;
overflow-y: auto;
background: transparent;
&::-webkit-scrollbar{
background: #06284a;
}
&::-webkit-scrollbar-thumb{
background: #0c0909;
}
&::-webkit-scrollbar-track{
background: #06284a;
}
}
.sim-box{
height: 100%;
width: 100%;
padding-bottom: 20px;
background: #00172E;
}
.box-card {
width: 30%;
height: 220px;
@ -350,10 +416,12 @@ export default {
position: relative;
cursor: pointer;
user-select: none;
background: transparent;
}
.bg-img-box {
padding: 10px;
height: 220px;
background-color: #fff;
background-size: 100% 100%;
background-repeat:no-repeat;
}
@ -371,6 +439,7 @@ export default {
position: relative;
left: 45%;
height: 60px;
background: transparent;
}
.card-box-title {
text-align: center;
@ -386,6 +455,7 @@ export default {
display:-webkit-box;
-webkit-line-clamp:3;
-webkit-box-orient:vertical;
background: transparent;
}
.box-card .el-tooltip__popper {
width: 300px;