From 7af49deb904d8c3af3af533633a0bf92fd617f2c Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 18 May 2021 10:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BD=A6=E7=AB=99=E5=80=BC=E7=8F=AD=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/baseUrl.js | 4 +- src/views/newMap/jointTrainingNew/index.vue | 21 +++++----- .../memberManage/addMember.vue | 41 ++++++++++++++++-- .../memberManage/membersManage.vue | 2 +- src/views/scriptManage/addScriptMember.vue | 42 ++++++++++++++++--- src/views/scriptManage/tipScriptRecord.vue | 6 ++- 6 files changed, 92 insertions(+), 24 deletions(-) diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 11702c286..648fd20ce 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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'; // 杜康 diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 91e1a8e2a..a746650b6 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -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 @@ - + { 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() { diff --git a/src/views/newMap/jointTrainingNew/memberManage/addMember.vue b/src/views/newMap/jointTrainingNew/memberManage/addMember.vue index f35f2449a..2ba8055b7 100644 --- a/src/views/newMap/jointTrainingNew/memberManage/addMember.vue +++ b/src/views/newMap/jointTrainingNew/memberManage/addMember.vue @@ -19,6 +19,16 @@ /> + + + + + @@ -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(); } diff --git a/src/views/newMap/jointTrainingNew/memberManage/membersManage.vue b/src/views/newMap/jointTrainingNew/memberManage/membersManage.vue index edd4afead..918b6bd64 100644 --- a/src/views/newMap/jointTrainingNew/memberManage/membersManage.vue +++ b/src/views/newMap/jointTrainingNew/memberManage/membersManage.vue @@ -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': diff --git a/src/views/scriptManage/addScriptMember.vue b/src/views/scriptManage/addScriptMember.vue index a379025bc..32b3a3a07 100644 --- a/src/views/scriptManage/addScriptMember.vue +++ b/src/views/scriptManage/addScriptMember.vue @@ -20,6 +20,16 @@ /> + + + + + @@ -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(); } diff --git a/src/views/scriptManage/tipScriptRecord.vue b/src/views/scriptManage/tipScriptRecord.vue index 8b9efe21a..43969e27b 100644 --- a/src/views/scriptManage/tipScriptRecord.vue +++ b/src/views/scriptManage/tipScriptRecord.vue @@ -78,7 +78,7 @@ - + @@ -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; },