综合演练添加车站值班员

This commit is contained in:
fan 2021-05-18 10:04:03 +08:00
parent 1ca70a08b8
commit 7af49deb90
6 changed files with 92 additions and 24 deletions

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
BASE_API = 'http://192.168.3.120:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -35,7 +35,7 @@
:user-role="userRole"
:is-admin="isAdmin"
:show-station="showStation"
:station-list="stationList"
:station-list="centralizedstationList"
:device-code="deviceCode"
:show-select-station="showSelectStation"
:data-error="dataError"
@ -48,7 +48,7 @@
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
<members-manage ref="membersManage" :is-admin="isAdmin" @addSimulationMember="addSimulationMember" /> <!-- 成员管理 -->
<add-member ref="addMember" />
<add-member ref="addMember" :station-list="stationList" />
<Jl3d-Device
v-if="deviceif"
v-show="deviceShow"
@ -120,7 +120,7 @@ export default {
panelShow: true,
ibpPart: '',
showStation: '',
stationList: [],
centralizedstationList: [],
showSelectStation: false, // 线
mapViewLoadedOver: false,
dataError: false,
@ -136,7 +136,8 @@ export default {
]),
...mapGetters('map', [
'map',
'bigScreenConfig'
'bigScreenConfig',
'stationList'
]),
width() {
return this.$store.state.app.width;
@ -209,7 +210,7 @@ export default {
},
'$store.state.map.map': function (map) {
if (map) {
this.setStationList(map); //
this.setCentralizedstationList(map); //
}
},
'$store.state.socket.simulationRoleList':function(list) {
@ -572,19 +573,19 @@ export default {
this.$jlmap.setCenter(showStation);
}
},
setStationList(map) {
this.stationList = [];
setCentralizedstationList(map) {
this.centralizedstationList = [];
(map.stationList || []).forEach(item => {
if (item.centralized) {
this.stationList.push({value: item.code, name: item.name});
this.centralizedstationList.push({value: item.code, name: item.name});
this.centralizedStationMap[item.code] = item.code;
item.chargeStationCodeList && item.chargeStationCodeList.length && item.chargeStationCodeList.forEach(ele => {
this.centralizedStationMap[ele] = item.code;
});
}
});
if (this.stationList.length && !this.showStation) {
this.showStation = this.stationList[0].value;
if (this.centralizedstationList.length && !this.showStation) {
this.showStation = this.centralizedstationList[0].value;
}
},
setBigScreenMode() {

View File

@ -19,6 +19,16 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="formModel.type === 'STATION_SUPERVISOR'" label="值班车站:" prop="deviceCode">
<el-select v-model="formModel.deviceCode" placeholder="请选择" size="small">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="仿真成员名称:" prop="name">
<el-input v-model="formModel.name" size="small" placeholder="请输入成员名称" />
</el-form-item>
@ -34,19 +44,34 @@
import { addSimulationMember } from '@/api/jointSimulation';
export default {
name: 'AddMember',
props: {
stationList: {
type: Array,
required: true
}
},
data() {
return {
dialogVisible: false,
formModel: {
type: '',
name: ''
name: '',
deviceCode: ''
},
filterStationList: [],
rules: {
type: [
{ required: true, message: '请选择显示位置', trigger: 'change' }
],
deviceCode: [
{ required: true, message: '请选择值班车站', trigger: 'change' }
]
},
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
typeList: [
{label: '行调', value: 'DISPATCHER'},
{label: '通号', value: 'MAINTAINER'},
{label: '车站值班员', value: 'STATION_SUPERVISOR'}
]
};
},
computed: {
@ -56,7 +81,12 @@ export default {
},
methods: {
initData(row) {
this.filterStationList = [];
this.stationList.forEach(item => {
if (!item.depot) {
this.filterStationList.push(item);
}
});
},
doShow(row) {
this.initData(row);
@ -64,6 +94,7 @@ export default {
},
doSave() {
this.$refs.form.validate(() => {
if (this.formModel.type !== 'STATION_SUPERVISOR') { delete this.formModel.deviceCode; }
addSimulationMember(this.formModel, this.$route.query.group).then(() => {
this.$message.success('添加仿真角色成员成功!');
this.handleClose();
@ -75,7 +106,9 @@ export default {
handleClose() {
this.dialogVisible = false;
this.formModel = {
type: ''
type: '',
name: '',
deviceCode: ''
};
this.$refs.form.resetFields();
}

View File

@ -162,7 +162,7 @@ export default {
depotDispatcherList.push(this.memberData[item.id]);
break;
case 'STATION_SUPERVISOR':
this.memberData[item.id].labelName = '值班员-' + device.name;
this.memberData[item.id].labelName = '值班员-' + (item.name || device.name);
stationSupervisorList.push(this.memberData[item.id]);
break;
case 'DRIVER':

View File

@ -20,6 +20,16 @@
/>
</el-select>
</el-form-item>
<el-form-item v-if="formModel.type === 'STATION_SUPERVISOR'" label="值班车站:" prop="deviceCode">
<el-select v-model="formModel.deviceCode" placeholder="请选择" size="small">
<el-option
v-for="item in filterStationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="仿真成员名称:" prop="name">
<el-input v-model="formModel.name" placeholder="请输入成员名称" />
</el-form-item>
@ -35,23 +45,35 @@
import { addSimulationMember } from '@/api/jointSimulation';
export default {
name: 'AddMember',
props: {
stationList: {
type: Array,
required: true
}
},
data() {
return {
dialogVisible: false,
lodaing:false,
formModel: {
type: '',
name:''
name:'',
deviceCode: ''
},
filterStationList: [],
rules: {
type: [
{ required: true, message: '请选择成员类型', trigger: 'change' }
],
deviceCode: [
{ required: true, message: '请选择值班车站', trigger: 'change' }
]
// name:[
// { required: true, message: '', trigger: 'blur' }
// ]
},
typeList: [{label: '行调', value: 'DISPATCHER'}, {label: '通号', value: 'MAINTAINER'}]
typeList: [
{label: '行调', value: 'DISPATCHER'},
{label: '通号', value: 'MAINTAINER'},
{label: '车站值班员', value: 'STATION_SUPERVISOR'}
]
};
},
computed: {
@ -61,12 +83,19 @@ export default {
},
methods: {
doShow(row) {
this.filterStationList = [];
this.stationList.forEach(item => {
if (!item.depot) {
this.filterStationList.push(item);
}
});
this.dialogVisible = true;
},
doSave() {
this.$refs.form.validate((valid) => {
if (valid) {
this.lodaing = true;
if (this.formModel.type !== 'STATION_SUPERVISOR') { delete this.formModel.deviceCode; }
addSimulationMember(this.formModel, this.$route.query.group).then((res) => {
this.$message.success('添加仿真角色成员成功!');
this.$emit('addScriptMember', res.data);
@ -83,7 +112,8 @@ export default {
this.dialogVisible = false;
this.formModel = {
type: '',
name:''
name:'',
deviceCode: ''
};
this.$refs.form.resetFields();
}

View File

@ -78,7 +78,7 @@
</div>
</el-dialog>
</div>
<add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" />
<add-script-member ref="addScriptMember" :station-list="stationList" @addScriptMember="addScriptMember" />
<condition-manage ref="conditionManage" @clearConditionActionId="clearConditionActionId" />
</div>
</template>
@ -92,6 +92,7 @@ import {covertMemberData} from '@/views/newMap/displayNew/utils';
import GetActionNew from './getAction';
import AllScriptRole from './allScriptRole';
import { getToken } from '@/utils/auth';
import { mapGetters } from 'vuex';
import ConditionManage from './conditionManage';
import {executeScriptNew, dumpScriptDataNew, saveScriptDataNew, saveScriptScenesNew, updateMapLocationNew, simulationPause, startReplaceBg, confirmReplaceBg, cancelReplaceBg} from '@/api/simulation';
export default {
@ -141,6 +142,9 @@ export default {
};
},
computed:{
...mapGetters('map', [
'stationList'
]),
memberId() {
return this.$store.state.scriptRecord.updateRoleId;
},