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

This commit is contained in:
fan 2022-12-29 14:26:34 +08:00
commit 80d1de6bd3
18 changed files with 248 additions and 70 deletions

View File

@ -2,7 +2,7 @@
<div class="chengdou-01__system request_box">
<div :id="domIdRequestBar" class="title-box">
<div class="title-name">操作请求堆栈</div>
<div class="icon" :class="{'is-active': unfold}" @click="unflodDiv">
<div :id="unfold ? domIdConfirm : ''" class="icon" :class="{'is-active': unfold}" @click="unflodDiv">
<i class="el-icon-arrow-down" />
</div>
</div>
@ -21,7 +21,7 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="8" class="button-bottom-left">
<el-button :id="domIdConfirm" size="mini" style="float: left;" :loading="loading" :disabled="commitDisabled" @click="commit">发送请求</el-button>
<el-button :id="unfold ? '' : domIdConfirm" size="mini" style="float: left;" :loading="loading" :disabled="commitDisabled" @click="commit">发送请求</el-button>
</el-col>
<el-col :span="8" :offset="8" class="button-bottom-right">
<el-button :id="domIdCancel" size="mini" style="float: right;" @click="cancel">取消请求</el-button>
@ -90,10 +90,9 @@ export default {
methods: {
unflodDiv() {
this.unfold = !this.unfold;
const operate = {
operation: OperationEvent.Command.commandChengDu1.requestBar.operation
};
this.$store.dispatch('trainingNew/next', operate);
setTimeout(() => {
this.$store.dispatch('training/emitTipFresh');
}, 300);
},
clickEvent(row, event, column) {
this.row = row;

View File

@ -129,9 +129,9 @@ export default {
operation: item.operate.operation
};
this.$emit('active', index);
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$emit('active', index);
this.$store.dispatch('menuOperation/changeMenuBar', index);
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}

View File

@ -20,7 +20,7 @@
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="12">
<el-button @click="confirm">确定</el-button>
<el-button :id="confirmId" @click="confirm">确定</el-button>
</el-col>
<el-col :span="12">
<el-button @click="doClose">关闭</el-button>
@ -54,7 +54,7 @@ export default {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
confirmId() {
return this.operation.domId;
return this.operation === OperationEvent.Station.setPreReset.confirm.operation ? OperationEvent.Station.setPreReset.confirm.domId : OperationEvent.Station.cancelPreReset.confirm.domId;
}
},
mounted() {

View File

@ -77,7 +77,7 @@ export default {
},
{
title: '站遥控',
operate: OperationEvent.Command.mBar.remoteControl,
operate: OperationEvent.MixinCommand.remoteControl.mbar,
click: this.stationRemoteControl
},
{

View File

@ -113,7 +113,7 @@ export default {
},
setCenterControl() {
//
commitOperate(menuOperate.StationControl.requestCentralControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.StationControl.requestCentralControl, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'button'}).then(({valid, operate})=>{
if (valid) {
this.$refs.stationControl.doShow(operate, this.selected);
}
@ -121,7 +121,7 @@ export default {
},
setStationControl() {
//
commitOperate(menuOperate.StationControl.requestStationControl, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.StationControl.requestStationControl, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'button'}).then(({valid, operate})=>{
if (valid) {
this.$refs.stationControl.doShow(operate, this.selected);
}
@ -129,7 +129,7 @@ export default {
},
setEmergencyControl() {
//
commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCode: this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.StationControl.emergencyStationControl, {stationCode: this.selected.code}, 0, {code: this.selected.code, subType: 'button'}).then(({valid, operate})=>{
if (valid) {
this.$refs.stationControl.doShow(operate, this.selected);
}

View File

@ -116,7 +116,7 @@ export default {
},
setPreReset() {
//
commitOperate(menuOperate.Station.setPreReset, {stationCode:this.selected.code}, 0).then(({valid, operate})=>{
commitOperate(menuOperate.Station.setPreReset, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'preReset'}).then(({valid, operate})=>{
if (valid) {
const nextOperate = {
operation: OperationEvent.Station.setPreReset.confirm.operation
@ -127,7 +127,7 @@ export default {
},
cancelPreReset() {
//
commitOperate(menuOperate.Station.cancelPreReset.operation, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'light'}).then(({valid, operate})=>{
commitOperate(menuOperate.Station.cancelPreReset.operation, {stationCode:this.selected.code}, 0, {code: this.selected.code, subType: 'preReset'}).then(({valid, operate})=>{
if (valid) {
const nextOperate = {
operation: OperationEvent.Station.cancelPreReset.confirm.operation

View File

@ -6,7 +6,7 @@
<!--<div class="jumpStopStatus">S</div>-->
<!--</div>-->
<menu-system-time ref="menuSystemTime" />
<station-control-convert ref="stationControlConvert" :work="work"/>
<station-control-convert ref="stationControlConvert" :work="work" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" />
<view-name ref="viewName" />
@ -152,7 +152,7 @@ export default {
},
{
title: this.$t('menu.menuBar.controlModeSwitch'),
operate: OperationEvent.Command.mBar.remoteControl,
operate: OperationEvent.MixinCommand.remoteControl.mbar,
children: [
{
title: this.$t('menu.menuBar.toStationControl'),

View File

@ -6,7 +6,7 @@
<!--<div class="jumpStopStatus">S</div>-->
<!--</div>-->
<menu-system-time ref="menuSystemTime" />
<station-control-convert ref="stationControlConvert" :work="work"/>
<station-control-convert ref="stationControlConvert" :work="work" />
<password-box ref="passwordBox" @setLoginResult="getLoginResult" />
<view-train-id ref="viewTrainId" />
<view-name ref="viewName" />
@ -124,7 +124,7 @@ export default {
},
{
title: this.$t('menu.menuBar.controlModeSwitch'),
operate: OperationEvent.Command.mBar.remoteControl,
operate: OperationEvent.MixinCommand.remoteControl.mbar,
children: [
{
title: this.$t('menu.menuBar.toStationControl'),

View File

@ -215,9 +215,27 @@ export default {
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Signal) && !this.buttonOperation) {
this.doShow(this.$store.state.menuOperation.menuPosition);
const operate = {
code: `${this.selected.code}`,
userOperationType: 'rightClick',
operation: OperationEvent.Command.commandRight.right.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doShow(this.$store.state.menuOperation.menuPosition);
}
});
} else if (this.selected && this.selected._type === 'Signal' && this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Enabled) && !this.buttonOperation) {
this.doEnabledShow(this.$store.state.menuOperation.menuPosition);
const operate = {
code: `${this.selected.code}`,
userOperationType: 'rightClick',
operation: OperationEvent.Command.commandRight.right.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doEnabledShow(this.$store.state.menuOperation.menuPosition);
}
});
} else {
this.doClose();
}
@ -346,8 +364,6 @@ export default {
param: step.param
});
}
} else {
this.$refs.noticeInfo.doShow();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();

View File

@ -332,28 +332,132 @@ export default {
{label: '长兴技校', value: 'RICHOR_CXJS'},
{label: '京津冀联盟', value: 'JJJLM'}
],
clientList: [
{ label: '中心ATS工作站', value: 'dispatchWork' },
{ label: '中心ATS大屏', value: 'bigScreen' },
{ label: '现地ATS工作站', value: 'localWork' },
{ label: 'ISCS', value: 'iscsView' },
{ label: 'IBP', value: 'ibp' },
{ label: 'PSL', value: 'psl' },
{ label: 'PIS', value: 'pis' },
{ label: '列车驾驶', value: 'drivingPlan' },
{ label: 'CCTV', value: 'cctvView' },
{ label: '设备视图', value: 'jl3dModle' },
{ label: '数字沙盘', value: 'digitalStand' },
{ label: '车务终端', value: 'trafficTerminal' },
{ label: '车务管理终端', value: 'trafficManageTerminal' },
{ label: '调度命令', value: 'dispatchingCommand' },
{ label: '调度计划', value: 'schedulingPlan' },
{ label: '大客流策略', value: 'largePassengerStrategy' },
{ label: '大客流视图', value: 'largePassengerView' },
{ label: '行调台', value: 'dispatcherManage' },
{ label: '派班工作站', value: 'scheduleWork' },
{ label: '应急调度', value: 'emergency' },
{ label: '联锁工作站', value: 'interlockWork' }
]
clientMap:{
'RAILWAY':{
'DISPATCHER':[
{ label: '中心ATS工作站', value: 'dispatchWork' },
{ label: '行调台', value: 'dispatcherManage' },
{ label: '调度计划', value: 'schedulingPlan' },
{ label: '调度命令', value: 'dispatchingCommand' }
],
'STATION_SUPERVISOR':[
{ label: '现地ATS工作站', value: 'localWork' },
{ label: '车务管理终端', value: 'trafficManageTerminal' },
{ label: '车务终端', value: 'trafficTerminal' }
],
'DEPOT_DISPATCHER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_ASSISTANT':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_MASTER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_SIGNALER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_PASSENGER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_SWITCH_MAN':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_FACILITATOR':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_WORKER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'DEVICE_MANAGER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'TRAIN_MASTER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'SIGNAL_BUILDING':[
{ label: '现地ATS工作站', value: 'localWork' }
]
},
'METRO':{
'DISPATCHER':[
{ label: '中心ATS工作站', value: 'dispatchWork' },
{ label: 'ISCS', value: 'iscsView' },
{ label: '中心ATS大屏', value: 'bigScreen' },
{ label: 'CCTV', value: 'cctvView' },
{ label: '数字沙盘', value: 'digitalStand' },
{ label: '大客流策略', value: 'largePassengerStrategy' },
{ label: '大客流视图', value: 'largePassengerView' }
],
'STATION_SUPERVISOR':[
{ label: '现地ATS工作站', value: 'localWork' },
{ label: 'ISCS', value: 'iscsView' },
{ label: 'IBP', value: 'ibp' },
{ label: '数字沙盘', value: 'digitalStand' },
{ label: 'CCTV', value: 'cctvView' },
{ label: 'PSL', value: 'psl' }
],
'DRIVER':[
{ label: '列车驾驶', value: 'drivingPlan' }
],
'DEPOT_DISPATCHER':[
{ label: '派班工作站', value: 'scheduleWork' },
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_ASSISTANT':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_MASTER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_SIGNALER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_PASSENGER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_SWITCH_MAN':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_FACILITATOR':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'STATION_WORKER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'DEVICE_MANAGER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'TRAIN_MASTER':[
{ label: '现地ATS工作站', value: 'localWork' }
],
'SIGNAL_BUILDING':[
{ label: '现地ATS工作站', value: 'localWork' }
]
}
}
// clientList: [
// { label: '中心ATS工作站', value: 'dispatchWork' },
// { label: '中心ATS大屏', value: 'bigScreen' },
// { label: '现地ATS工作站', value: 'localWork' },
// { label: 'ISCS', value: 'iscsView' },
// { label: 'IBP', value: 'ibp' },
// { label: 'PSL', value: 'psl' },
// { label: 'PIS', value: 'pis' },------------
// { label: '列车驾驶', value: 'drivingPlan' },
// { label: 'CCTV', value: 'cctvView' },
// { label: '数字沙盘', value: 'digitalStand' },
// { label: '车务终端', value: 'trafficTerminal' },
// { label: '车务管理终端', value: 'trafficManageTerminal' },
// { label: '调度命令', value: 'dispatchingCommand' },
// { label: '调度计划', value: 'schedulingPlan' },
// { label: '行调台', value: 'dispatcherManage' },
// { label: '大客流策略', value: 'largePassengerStrategy' },
// { label: '大客流视图', value: 'largePassengerView' },
// { label: '设备视图', value: 'jl3dModle' },
// { label: '应急调度', value: 'emergency' }, ------
// { label: '联锁工作站', value: 'interlockWork' } ------
// ]
}
};

View File

@ -10,7 +10,8 @@ const ibp = {
ibp: null, // 数据
updateDeviceData: {}, // 修改的数据
rightClickCount: 0, // 右键点击设备
ibpBgDevice: {} // ibp背景设备
ibpBgDevice: {}, // ibp背景设备
moreScreen: false // 切换按钮是否显示
},
getters: {
@ -42,6 +43,9 @@ const ibp = {
setIbpData: (state, ibp) => {
state.ibp = ibp;
},
setMoreScreen: (state, moreScreen) => {
state.moreScreen = moreScreen;
},
setUpdateDeviceData: (state, model) => {
state.rightClickCount++;
state.updateDeviceData = model;
@ -58,6 +62,9 @@ const ibp = {
setIbpData: ({ commit }, ibp) => {
commit('setIbpData', ibp);
},
setMoreScreen: ({ commit }, moreScreen) => {
commit('setMoreScreen', moreScreen);
},
updateIbpDevices: ({ commit }, models) => {
return new Promise((resolve) => {
if (!(models instanceof Array)) {

View File

@ -1,11 +1,11 @@
<template>
<div>
<div :id="ibpId" v-loading="loading" :style="{ width: canvasWidth+'px', height: canvasHeight +'px',background:'#000' }" class="ibp-canvas" />
<el-button-group class="ibp-button">
<el-button v-if="moreScreen" type="primary" @click="switchOffset">切换</el-button>
<!-- <el-button v-if="showBackButton" type="primary" @click="back">{{ $t('global.back') }}</el-button>-->
<!-- <el-button v-if="$route.query.noPreLogout" type="primary" @click="quit">退出</el-button>-->
</el-button-group>
<!-- <el-button-group class="ibp-button"> -->
<!-- <el-button v-if="moreScreen" type="primary" @click="switchOffset">切换</el-button> -->
<!-- <el-button v-if="showBackButton" type="primary" @click="back">{{ $t('global.back') }}</el-button>-->
<!-- <el-button v-if="$route.query.noPreLogout" type="primary" @click="quit">退出</el-button>-->
<!-- </el-button-group> -->
<template v-for="alarm in alarmList">
<audio :id="`buzzer_${alarm.code}`" :key="alarm.code" controls loop="loop">
@ -28,6 +28,7 @@ import { getIbpInfoByStation } from '@/api/ibp';
import { getSimulationInfoNew, getIbpInitialState } from '@/api/simulation';
import BuzzerAudio from '@/assets/buzzer.mp3';
import { getStationList } from '@/api/runplan';
import { EventBus } from '@/scripts/event-bus';
const pressedKeys = new Set();
export default {
@ -112,6 +113,7 @@ export default {
await this.setMoveInit(false);
this.showBackButton = false;
}
EventBus.$on('switchOffset', this.switchOffset);
},
beforeDestroy() {
if (this.$route.query.noPreLogout) {
@ -119,6 +121,8 @@ export default {
this.$ibp.setClockStart(false);
}
this.ibpDestroy();
this.$store.dispatch('ibp/setMoreScreen', false);
EventBus.$off('switchOffset');
},
preResetBtn: null,
methods: {
@ -192,6 +196,7 @@ export default {
const data = parser(ibpDatas, {width: this.canvasWidth, height: this.canvasHeight}); // ibp
this.initIbp(this.offsetX);
this.moreScreen = ibpDatas.background && ibpDatas.background.width > 1920;
this.$store.dispatch('ibp/setMoreScreen', this.moreScreen);
this.setIbp(data, ibpDatas);
this.$store.dispatch('ibp/setIbpData', ibpDatas);
this.handleBanOpenScreenDoorStatus();

View File

@ -271,10 +271,11 @@ export default {
const group = resp.data;
getLoginInfo(getToken()).then(resp => {
const deviceVO = resp.data.deviceVO;
const accountVO = resp.data.accountVO;
if (deviceVO) {
const config = JSON.parse(deviceVO.config || '{}');
if (config && config.roleCode) {
const params = [{userId: res.id, memberId:config.roleCode}];
const params = [{userId: accountVO.id, memberId:config.roleCode}];
assignUsersPlayRoles(params, group).then(() => {
this.enterSimulation(group, mapId, config);
}).catch(res=>{

View File

@ -34,6 +34,7 @@ import DeviceManage from './deviceManage';
import QrCode from '@/components/QrCode';
import { SimulationUserType } from '@/scripts/ConstDic';
import { destroySimulationByAdmin, ranAsPlan} from '@/api/simulation';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'SimulationMenu',
@ -56,6 +57,7 @@ export default {
deviceif: false,
deviceShow: true,
allMenuList: [
{ label: '切换', name: 'switchOffset', click: this.switchOffset, isDisabled: () => { return false; }, isShow: () => { return this.$store.state.ibp.moreScreen; } },
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isDisabled: () => { return false; }, isShow: () => { return true; } },
{ label: '设备管理', name: 'deviceManage', click: this.deviceManage, isDisabled: () => { return false; }, isShow: () => { return (this.$store.state.training.domConfig.hasDeviceManage && this.$store.state.training.simulationUserType === SimulationUserType.TEACHER) || (this.$route.query.client === 'interlockWork' && this.$route.query.projectDevice === 'ILW'); } },
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isDisabled: () => { return false; }, isShow: () => { return true; } },
@ -84,6 +86,9 @@ export default {
}
},
watch: {
'$store.state.ibp.moreScreen': function (val) {
this.handleMenuShow();
},
'$store.state.training.simulationUserType': function (val) {
this.handleMenuShow();
},
@ -105,6 +110,9 @@ export default {
window.removeEventListener('click', this.hideMenuList);
},
methods: {
switchOffset() {
EventBus.$emit('switchOffset');
},
generateQrCode() {
this.hideMenuList();
getSimulationQrcode(this.$route.query.group).then(resp => {

View File

@ -158,7 +158,9 @@ export default {
this.initMemberUserInfo();
this.setCentralizedStationList(map); //
if (this.$route.query.client) {
this.pictureChange(this.$route.query.client);
setTimeout(() => {
this.pictureChange(this.$route.query.client);
}, 200);
}
}
} catch (error) {

View File

@ -59,7 +59,7 @@ export default {
operationType: val.cmdType ? val.cmdType.value : '',
params: val.param || {}
};
if (['trainSetButton', 'light'].includes(val.subType)) {
if (['trainSetButton', 'light', 'button', 'preReset'].includes(val.subType)) {
data.subType = val.subType;
}
this.stepDetail.operations.push(data);

View File

@ -22,7 +22,7 @@
</el-select>
</el-form-item>
<el-form-item label="关联角色:" prop="roleCode">
<el-select v-model="formIbp.roleCode" placeholder="请选择" size="small">
<el-select v-model="formIbp.roleCode" placeholder="请选择" size="small" @change="changeRoleIBP">
<el-option
v-for="item in roleList"
:key="item.value"
@ -44,7 +44,7 @@
</el-form>
<el-form v-show="['IM','CW','DRIVE','DEPOT'].includes(data.type)" ref="formIm" :model="formIm" label-width="100px" :rules="rulesIm">
<el-form-item label="关联角色:" prop="roleCode">
<el-select v-model="formIm.roleCode" placeholder="请选择" size="small">
<el-select v-model="formIm.roleCode" placeholder="请选择" size="small" @change="changeRoleIM">
<el-option
v-for="item in roleList"
:key="item.value"
@ -76,7 +76,7 @@
</el-select>
</el-form-item>
<el-form-item label="关联角色:" prop="roleCode">
<el-select v-model="formLw.roleCode" placeholder="请选择" size="small">
<el-select v-model="formLw.roleCode" placeholder="请选择" size="small" @change="changeRoleLW">
<el-option
v-for="item in roleList"
:key="item.value"
@ -128,7 +128,7 @@
</el-select>
</el-form-item>
<el-form-item label="关联角色:" prop="roleCode">
<el-select v-model="formIscs.roleCode" placeholder="请选择" size="small">
<el-select v-model="formIscs.roleCode" placeholder="请选择" size="small" @change="changeRoleIscs">
<el-option
v-for="item in roleList"
:key="item.value"
@ -167,7 +167,7 @@ export default {
return {
dialogVisible: false,
data: {},
mapList: [],
clientListMap:{},
roleList:[],
lwList: [],
formIm:{
@ -192,7 +192,7 @@ export default {
roleCode:'',
client:''
},
clientList: ConstConfig.ConstSelect.clientList,
clientList: [],
pictureList: [
{ label: '广播系统', value: 'paMain' },
{ label: '乘客信息', value: 'pidsMain' }
@ -276,9 +276,7 @@ export default {
},
doShow(row) {
this.initData(row);
this.data = row;
this.mapList = [];
this.stationList = [];
if (['VR_IBP', 'ISCS_LW'].includes(this.data.type)) {
getDevicesByType(row.project, 'LW').then(res => {
@ -402,12 +400,18 @@ export default {
getMapFunctioById(functionId).then(response=>{
if (resp.data) {
const roleList = resp.data[response.data.simType];
const clientListMapIn = ConstConfig.ConstSelect.clientMap;
this.clientListMap = clientListMapIn[response.data.simType];
const covertRoleList = [];
roleList.forEach(member => {
const data = this.handleMember(member, this.stationList);
covertRoleList.push(data);
});
this.clientList = [];
this.roleList = covertRoleList;
const roleCode = this.formIbp.roleCode || this.formIm.roleCode || this.formLw.roleCode || this.formIscs.roleCode;
const role = this.roleList.find(each=>{ return each.value == roleCode; });
if (role) { this.clientList = this.clientListMap[role.memberType] || []; }
}
});
}
@ -419,6 +423,26 @@ export default {
this.stationList = [];
}
},
changeRoleIBP(role) {
this.formIbp.client = '';
this.changeRole(role);
},
changeRoleIM(role) {
this.formIm.client = '';
this.changeRole(role);
},
changeRoleLW(role) {
this.formLw.client = '';
this.changeRole(role);
},
changeRoleIscs(role) {
this.formIscs.client = '';
this.changeRole(role);
},
changeRole(role) {
const roleMember = this.roleList.find(each=>{ return each.value == role; });
this.clientList = this.clientListMap[roleMember.memberType] || [];
},
handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {};

View File

@ -21,7 +21,7 @@ export default {
return {
dialogVisible: false,
data: {},
clientList: ConstConfig.ConstSelect.clientList,
clientList:[],
screenList: [
{ label: '第一屏', value: 1 },
{ label: '第二屏', value: 2 },
@ -70,7 +70,8 @@ export default {
stationList: [],
standList: [],
psdList: [],
roleList:[]
roleList:[],
clientListMap:{}
};
},
computed: {
@ -96,7 +97,7 @@ export default {
{ prop: 'stationCode', label: '关联车站:', type: 'select', options: this.stationList, optionLabel: 'name', optionValue: 'code', deviceChange: this.stationCodeChange},
{ prop: 'standCode', label: '关联站台:', type: 'select', options: this.standList, optionLabel: 'name', optionValue: 'code', deviceChange: this.standCodeChange},
{ prop: 'psdCode', label: '关联屏蔽门:', type: 'select', options: this.psdList, optionLabel: 'code', optionValue: 'code' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
]
};
@ -106,7 +107,7 @@ export default {
items: [
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' },
{ prop: 'quadrant', label: '屏幕配置:', type: 'select', options: this.screenList, optionLabel: 'label', optionValue: 'value'},
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
]
};
@ -115,7 +116,7 @@ export default {
labelWidth: '150px',
items: [
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
]
};
@ -124,7 +125,7 @@ export default {
labelWidth: '150px',
items: [
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'},
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
]
};
@ -133,7 +134,7 @@ export default {
labelWidth: '150px',
items: [
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'},
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
]
};
@ -199,12 +200,18 @@ export default {
getMapFunctioById(functionId).then(response=>{
if (resp.data) {
const roleList = resp.data[response.data.simType];
const clientListMapIn = ConstConfig.ConstSelect.clientMap;
this.clientListMap = clientListMapIn[response.data.simType];
const covertRoleList = [];
roleList.forEach(member => {
const data = self.handleMember(member, self.stationList);
covertRoleList.push(data);
});
this.clientList = [];
self.roleList = covertRoleList;
const roleCode = this.formData.roleCode;
const role = this.roleList.find(each=>{ return each.value == roleCode; });
if (role) { this.clientList = this.clientListMap[role.memberType] || []; }
}
});
}
@ -216,6 +223,11 @@ export default {
});
}
},
roleChange(role) {
this.formData.client = '';
const roleMember = this.roleList.find(each=>{ return each.value == role; });
if (roleMember) { this.clientList = this.clientListMap[roleMember.memberType] || []; }
},
handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {};