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

This commit is contained in:
joylink_cuiweidong 2022-12-12 13:18:05 +08:00
commit 8db9f95ade
9 changed files with 67 additions and 33 deletions

View File

@ -13,6 +13,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { DeviceMenu, OperateMode, TrainingMode } from '@/scripts/ConstDic';
// import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { judgeStationControl } from '@/jmapNew/theme/components/utils/menuJudge.js';
export default {
name: 'MenuLimit',
@ -41,12 +42,18 @@ export default {
{
label: '设置自动折返',
handler: this.handlerTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK,
isDisabled: (selected, work) => {
return selected.setUp === 1;
}
},
{
label: '取消自动折返',
handler: this.cancelTurnBack,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK,
isDisabled: (selected, work) => {
return selected.setUp === 0;
}
}
]
};
@ -75,6 +82,11 @@ export default {
// this.menu = MenuContextHandler.covert(this.menuNormal);
this.menu = [];
this.menuNormal.forEach(menuItem => {
let status = judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work);
if (menuItem.roleDisabled) {
status = true;
}
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) || !status : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});

View File

@ -89,11 +89,17 @@ export default {
{
label: '设置自动通过进路',
handler: this.singalPassModel,
isDisabled: (signal, work) => {
return signal.fleetMode === 1;
},
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
},
{
label: '取消自动通过进路',
handler: this.singalCancelPassModel,
isDisabled: (signal, work) => {
return signal.fleetMode !== 1;
},
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
},
{
@ -109,12 +115,18 @@ export default {
label: '封锁',
handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
isDisabled: (signal, work) => {
return signal.blockade !== 0;
},
isShow: (selected, work) => work == 'localWork'
},
{
label: '解封',
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
isDisabled: (signal, work) => {
return signal.blockade !== 1;
},
isShow: (selected, work) => work == 'localWork'
},
{

View File

@ -43,7 +43,6 @@ export default {
handler: this.setEmergencyControl,
cmdType: CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL,
isDisabled: (selected, work) => {
console.log('🚀 ~ file: menuStationControl.vue:50 ~ data ~ selected', selected.controlMode);
return selected.controlMode == 'Emergency';
}
},

View File

@ -82,24 +82,36 @@ export default {
label: '道岔单锁',
handler: this.lock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK,
isDisabled: (station, work) => {
return station.singleLock === 1;
},
isShow: (selected, work) => work == 'localWork'
},
{
label: '道岔单解',
handler: this.unlock,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK,
isDisabled: (station, work) => {
return station.singleLock !== 1;
},
isShow: (selected, work) => work == 'localWork'
},
{
label: '道岔封锁',
handler: this.block,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK,
isDisabled: (station, work) => {
return station.blockade === 1;
},
isShow: (selected, work) => work == 'localWork'
},
{
label: '道岔解封',
handler: this.unblock,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK,
isDisabled: (station, work) => {
return station.blockade !== 1;
},
isShow: (selected, work) => work == 'localWork'
},
{

View File

@ -27,7 +27,7 @@ export function handlerUrl() {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://114.116.51.125/jlcloud';
BASE_API = 'http://192.168.3.90:9000'; // 周寅
// BASE_API = 'http://192.168.3.90:9000'; // 周寅
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬

View File

@ -229,6 +229,7 @@ export default {
this.picture = val;
if (this.picture === 'dispatchWork' && this.lineCode === '14') {
this.picture = 'basidi';
this.$store.dispatch('app/animationsClose');
}
this.$store.dispatch('map/setPicture', this.picture);
if (val === 'ibp') {
@ -268,11 +269,7 @@ export default {
//
mapViewLoaded(loading) {
this.loading = loading;
if (loading) {
this.$store.dispatch('app/animationsClose');
} else {
this.$store.dispatch('app/animationsClose');
}
this.$store.dispatch('app/animationsClose');
}
}
};

View File

@ -195,14 +195,12 @@ export default {
},
watch: {
'$store.state.training.roles': function (val) {
console.log('watch', val);
this.initTerminalList();
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
if (this.isFirst && this.$route.query.client) {
this.isFirst = false;
} else {
if (trainingDetail && trainingDetail.client) {
console.log(trainingDetail.client, '-----------ee-');
this.changePictureShow(trainingDetail.client);
} else {
this.initPictureShow();
@ -230,18 +228,14 @@ export default {
});
},
noEvent(code) {
console.log(code, 'noEvent');
this.$emit('pictureChange', code);
},
initPictureShow() {
console.log(this.roles, '-----------');
const localWorkRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', 'STATION_PASSENGER', 'STATION_SWITCH_MAN',
'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER', 'TRAIN_MASTER', 'DEPOT_DISPATCHER'];
if (localWorkRoleList.includes(this.roles)) {
console.log('00000000000000');
this.changePictureShow('localWork');
} else if (this.roles === 'DISPATCHER') {
console.log('00000001111');
this.changePictureShow('dispatchWork');
} else if (this.roles === 'MAINTAINER') {
//
@ -251,7 +245,6 @@ export default {
}
},
changePictureShow(code) {
console.log(code, '111111');
this.$emit('loadingChange');
setTimeout(() => {
this.$emit('pictureChange', code);

View File

@ -7,7 +7,13 @@
<el-button size="small" type="text" @click="doClose">返回</el-button>
</div>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<el-form ref="form" :model="tagForm" label-width="60px">
<el-form ref="form" :model="tagForm" size="small" label-width="90px" :rules="formRules">
<el-form-item v-if="formModel.type === 'SINGLE'" label="客户端" prop="client">
<el-select v-model="tagForm.client" placeholder="请选择客户端">
<el-option label="行调客户端" value="dispatchWork" />
<el-option label="现地客户端" value="localWork" />
</el-select>
</el-form-item>
<el-form-item label="标签">
<el-tag
v-for="tag in tagForm.dynamicTags"
@ -53,6 +59,7 @@ export default {
inputVisible: false,
inputValue: '',
tagForm: {
client: '',
dynamicTags: []
}
};
@ -67,7 +74,7 @@ export default {
},
form() {
const form = {
labelWidth: '60px',
labelWidth: '90px',
items: [
{ prop: 'name', label: '名称', type: 'text' },
{ prop: 'description', label: '描述', type: 'textarea' },
@ -89,6 +96,11 @@ export default {
]
};
return crules;
},
formRules() {
return {
client: [{ required: true, message: '请选择客户端', trigger: 'blur' }]
};
}
},
methods: {
@ -133,6 +145,7 @@ export default {
this.formModel[key] = data[key];
});
this.tagForm.dynamicTags = data.labelJson ? JSON.parse(data.labelJson) : [];
this.tagForm.client = data.client;
} else {
this.isCreate = true;
this.formModel = {
@ -148,7 +161,9 @@ export default {
doCreate() {
this.$refs.dataform.validateForm(() => {
const cpData = Object.assign({}, this.formModel);
cpData.client = this.tagForm.client;
cpData.labelJson = JSON.stringify(this.tagForm.dynamicTags);
console.log(cpData, '----------');
let api = updateTraining;
let mes = '编辑';
if (this.isCreate) {

View File

@ -84,6 +84,7 @@
<el-option
v-for="item in roleList"
:key="item.id"
:disabled="computedRoleDisabled(item)"
:label="item.label"
:value="item.id"
/>
@ -112,7 +113,7 @@
</template>
<script>
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, clearDesignTraining, updateTraining} from '@/api/trainingManage';
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, clearDesignTraining} from '@/api/trainingManage';
import { assignUsersPlayRoles } from '@/api/jointSimulation';
import Vue from 'vue';
import {covertMemberData} from '@/views/newMap/displayNew/utils';
@ -190,6 +191,13 @@ export default {
}
},
methods: {
computedRoleDisabled(role) {
if (!this.editData.client) {
return false;
} else {
return (this.editData.client === 'dispatchWork' && role.type !== '行调') || (this.editData.client === 'localWork' && role.type !== '行值');
}
},
getRoleList() {
const memberData = this.$store.state.training.memberData;
let activeTrainList = [];
@ -304,10 +312,6 @@ export default {
minisize() {
this.dialogVisible = !this.dialogVisible;
},
backStep() {
this.dialogVisible = true;
this.activeName = 'stepList';
},
doShow(data) {
this.dialogVisible = true;
},
@ -321,16 +325,6 @@ export default {
delete obj.isEdit;
list.push(obj);
});
const trainingData = {
id: this.editData.id,
name: this.editData.name,
mapId: this.editData.mapId,
description: this.editData.description,
labelJson: this.editData.label,
type: this.editData.type,
client: this.editData.type === 'SINGLE' ? this.$store.state.map.picture : ''
};
await updateTraining(trainingData);
await updateTrainingStep(this.group, this.editData.id, list);
this.$message.success('保存实训成功!');
} catch {