This commit is contained in:
joylink_cuiweidong 2021-01-26 11:10:38 +08:00
commit ebcd6b9bd9
4 changed files with 32 additions and 27 deletions

View File

@ -5,11 +5,10 @@
<el-col :span="2">
<div class="nav-border login">
<el-row>
<el-button v-if="isLogin" style="width: 100px;line-height: 19px;" plain @click="login">{{ loginText }}</el-button>
<div v-else class="loginClass" style="width: 100px;height:20px;text-align:center;border:1px #ccc solid">{{ loginText }}</div>
<el-button style="width: 100px;line-height: 19px;" plain @click="login">{{ loginText }}</el-button>
</el-row>
<el-row>
<input v-model="inputStr" :type="modelType" style="width: 100px;height:20px;" :disabled="isLogin" @keyup.enter="validateData">
<input v-model="inputStr" :type="modelType" style="width: 100px;height:20px;" :disabled="isLogin||this.loginText == '登录'" @keyup.enter="validateData">
</el-row>
</div>
</el-col>
@ -389,7 +388,11 @@ export default {
this.$refs.logDetail.doShow();
},
login() {
this.loginText = this.loginText == '退出' ? '登录': '用户';
const mapText = {
'注销': '登录',
'登录': '名称',
}
this.loginText = mapText[this.loginText]||this.loginText;
this.inputStr = '';
this.$emit('login', '');
},
@ -405,7 +408,7 @@ export default {
this.station = station;
}
} else if (this.keydownTimes === 1 && this.inputStr == '123456') {
this.loginText = '退出';
this.loginText = '注销';
this.keydownTimes = 0;
this.modelType = 'text';
this.inputStr = this.station.jp;

View File

@ -327,9 +327,6 @@ export default {
cr2ConfirmId() {
return OperationEvent.Command.commandHaerbin.confrimCr2.domId;
},
centerStation() {
return this.getCentralizedStationByInputStr(this.inputStr) || {};
},
stationContorl() {
return this.getStationControl(this.selected || {}) || this.getStationControl({_type: 'Station', code: this.$store.state.map.showCentralizedStationCode}) || {};
},
@ -337,16 +334,13 @@ export default {
return this.$store.state.training.prdType == '01';
},
isLogin() {
return this.isLocal ? this.loginActive && this.centerStation.code == this.stationContorl.code : true;
return this.isLocal ? this.loginActive && this.checkBelongCentralizedStationByInputStr(this.inputStr, this.stationContorl) : true;
},
menuPosition() {
return this.$store.state.menuOperation.menuPosition;
}
},
watch: {
'$store.state.menuOperation.setMenuChangeCount': function (val) {
},
'$store.state.training.prdType': function (val) {
this.trainOperationShow = false;
this.initMenus();
@ -391,9 +385,9 @@ export default {
}
},
'$store.state.map.showCentralizedStationCode': function(val) {
this.cancle();
if (!this.oldSelected) {
this.handleBasicMenu();
this.cancle();
}
},
'$store.state.map.mapStationStateUpdateCount': function() {
@ -407,10 +401,10 @@ export default {
this.handleBasicMenu();
},
methods: {
getCentralizedStationByInputStr(inputStr) {
const station = this.stationList.find(el => el.depot ? false : el.jp == this.inputStr );
if (station) {
return this.getStationControl(station);
checkBelongCentralizedStationByInputStr(inputStr, station) {
const child= this.stationList.find(el => el.depot ? false : el.jp == inputStr );
if (child && station) {
return station.code == child.code || station.chargeStationCodeList && station.chargeStationCodeList.includes(child.code);
}
},
interceptLogin(cb) {

View File

@ -65,11 +65,11 @@ class Handler {
}
getCommand(operation) {
let command = null;
let command = null;
if (operation.cmdType) {
const cmdType = operation.cmdType;
const wholeParam = this.getWholeParam();
command = CommandHandler.getCommand(cmdType, wholeParam);
command = CommandHandler.getCommand(cmdType, wholeParam);
if (command && command.isError) {
this.operations.pop();
command = null;

View File

@ -208,10 +208,11 @@ export default {
}, 3000);
});
},
async prdChoose(queryData) {
this.trainingTypeMap = {};
const lineCode = this.$route.query.lineCode;
const res = await getCmdList(lineCode, {prdType:queryData.prdType});
async prdChoose(form) {
this.trainingTypeMap = {};
const lineCode = this.$route.query.lineCode;
const res = await getCmdList(lineCode, {prdType:form.prdType});
const trainingOperateList = [];
const trainingOperateConfigList = [];
const operateTypeMap = {
@ -224,7 +225,13 @@ export default {
LimitControl: [],
TrainWindow: [],
Driver: []
};
};
form.type = '';
form.operateType = '';
this.queryForm.queryObject.type.config.data = [];
this.queryForm.queryObject.operateType.config.data = [];
if (res && res.code === 200) {
res.data.forEach(item => {
if (this.trainingOperateTypeMap[item.operateObject]) {
@ -240,8 +247,9 @@ export default {
trainingOperateConfigList.push({value: item.operateObject, label: Cookies.get('user_lang') == 'en' ? objectLabel.enlabel : objectLabel.label});
}
});
this.queryForm.queryObject.type.config.data = trainingOperateConfigList;
this.trainingTypeList = trainingOperateConfigList;
this.queryForm.queryObject.type.config.data = trainingOperateConfigList;
this.trainingTypeList = trainingOperateConfigList;
this.trainingTypeMap = operateTypeMap;
} else {
this.$message.error(this.$t('error.failedToObtainTrainingType'));
@ -249,7 +257,7 @@ export default {
},
typeChoose(form) {
this.queryForm.queryObject.operateType.config.data = [];
form.operateType = '';
form.operateType = '';
if (form && form.type && this.trainingTypeMap[form.type]) {
this.trainingTypeMap[form.type].forEach(elem => {
this.queryForm.queryObject.operateType.config.data.push({ value: elem.value, label: elem.label });