设备登录 教研机登录 代码调整

This commit is contained in:
joylink_cuiweidong 2022-11-23 16:57:15 +08:00
parent 879719ed4b
commit e5ff37427d
4 changed files with 56 additions and 33 deletions

View File

@ -3,7 +3,8 @@ const user = {
homeProLogoWidth:0,
loginProLogo:'',
homeTitle:'',
caseShow:true
caseShow:true,
deviceRelated:{}
},
mutations: {
setHomeProLogoWidth: (state, homeProLogoWidth) => {
@ -17,6 +18,9 @@ const user = {
},
setCaseShow: (state, caseShow) => {
state.caseShow = caseShow;
},
setDeviceRelated: (state, deviceRelated) => {
state.deviceRelated = deviceRelated;
}
},
actions: {
@ -31,6 +35,9 @@ const user = {
},
setCaseShow({ commit }, caseShow) {
commit('setCaseShow', caseShow);
},
setDeviceRelated({ commit }, deviceRelated) {
commit('setDeviceRelated', deviceRelated);
}
}

View File

@ -90,7 +90,9 @@ export default {
if (response.data) {
this.backProject = response.data.project;
// loginProLogoHeight
const {showBackPic, wechatLogin, aboutSystem, baseDevelopment, browserTitle, homeTitle, caseShow, loginProtitle, loginProLogoWidth, loginOrgTitle, localProject, homeProLogoWidth, loginProLogo} = response.data.viewSetting;
const {showBackPic, wechatLogin, aboutSystem, baseDevelopment, browserTitle, homeTitle, caseShow,
containDevice, deviceRelatedMap, deviceRelatedFunction,
loginProtitle, loginProLogoWidth, loginOrgTitle, localProject, homeProLogoWidth, loginProLogo} = response.data.viewSetting;
this.showBackPic = showBackPic;
this.wechatLogin = wechatLogin;
this.loginProtitle = loginProtitle;
@ -107,6 +109,8 @@ export default {
this.$store.dispatch('setLoginProLogo', this.loginProLogo);
this.$store.dispatch('setHomeTitle', homeTitle);
this.$store.dispatch('setCaseShow', caseShow);
this.$store.dispatch('setDeviceRelated', {containDevice:containDevice, deviceRelatedMap:deviceRelatedMap, deviceRelatedFunction:deviceRelatedFunction});
// this.$store.dispatch('setCaseShow', caseShow);
this.loadedConfig = true;
// helpShow
// loginContectInformation false

View File

@ -80,10 +80,9 @@
import QCode from '@/assets/erCode.jpg';
import md5 from 'js-md5';
import Cookies from 'js-cookie';
import { getToken } from '@/utils/auth';
// getLoginWmurl, checkLoginStatus,
import { getOrgList, selectOrgnization, getLoginInfo } from '@/api/login';
import { createSimulation } from '@/api/simulation';
import { getOrgList, selectOrgnization } from '@/api/login';
import { createSimulation, getSimulationInfoNew } from '@/api/simulation';
export default {
name:'NormalLogin',
props: {
@ -234,35 +233,44 @@ export default {
}
},
judgeOtherPage(params) {
// containDevice:false, //
// deviceRelatedMap:'', //
// deviceRelatedFunction:'' //
// itemMap: {DEFAULT_MEMBER: '1'}type: "METRO"
getLoginInfo(getToken()).then(res => {
debugger;
createSimulation().then(resp => {
let query = {
group: res.data.group,
mapId: resp.data.map.id,
lineCode: resp.data.map.lineCode,
project: this.project
};
query = Object.assign(query, params);
this.$router.push({ path: `/display/demon`, query: query });
const {containDevice, deviceRelatedMap, deviceRelatedFunction} = this.$store.state.projectConfig.deviceRelated;
if (containDevice && deviceRelatedMap && deviceRelatedFunction) {
createSimulation(deviceRelatedFunction).then(res => {
getSimulationInfoNew(res.data).then(resp => {
const paramVO = resp.data.paramVO;
const query = {
lineCode: resp.data.map.lineCode,
group: res.data,
mapId: resp.data.map.id,
project: this.project,
projectDevice:params.projectDevice,
type:params.type
};
if (paramVO && paramVO.domConfig && paramVO.domConfig.client) {
query.client = paramVO.domConfig.client;
}
if (paramVO && paramVO.domConfig && paramVO.domConfig.singleClient) {
query.singleClient = paramVO.domConfig.singleClient;
}
// if (this.loadingProjectList.includes(this.project)) {
// this.$store.dispatch('app/transitionAnimations');
// }
this.$router.push({ path: `/display/demon`, query: query });
});
}).catch(error=>{
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
});
// lineCode: resp.data.map.lineCode,
// group: res.data.group,
// prdType: resp.data.prodType,
// mapId: resp.data.map.id,
// goodsId: '',
// try: '0',
// project: this.project
// const query = {
// group: resp.data.group,
// mapId: resp.data.map.id,
// lineCode: resp.data.map.lineCode,
// projectDevice: this.$route.query.projectDevice,
// type: this.$route.query.type
// };
// path = '';
});
} else {
this.$message.error('请先配置项目设备登录信息');
}
},
//
handleLogin() {

View File

@ -221,7 +221,11 @@ export default {
judgeRoute:'', //
baseApiUrl:'', // api
baseSite:'', //
ossUrl:'' // oss
ossUrl:'', // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
};
this.$refs.ruleForm.resetFields();