代码调整

This commit is contained in:
joylink_cuiweidong 2022-10-13 17:50:57 +08:00
parent 9a5ba71218
commit 8ceca6ba90
3 changed files with 19 additions and 8 deletions

View File

@ -1,14 +1,17 @@
<template> <template>
<div> <div>
<!-- 设备登陆 -->
<div v-if="syncLogin"> <div v-if="syncLogin">
{{}} {{}}
</div> </div>
<div v-else v-show="loadedConfig" class="login-container" :style="{ 'background-image': showBackPic?'url(' + bgImg + ')':'none' }"> <div v-else v-show="loadedConfig" class="login-container" :style="{ 'background-image': showBackPic?'url(' + bgImg + ')':'none' }">
<!-- 中英文切换 -->
<div class="language_box"> <div class="language_box">
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end"> <el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button> <el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
<!-- logo和名称 -->
<div class="left-logo-box"> <div class="left-logo-box">
<img class="logo" :src="loginProLogo" :style="{ width: loginProLogoWidth+'px'}"> <img class="logo" :src="loginProLogo" :style="{ width: loginProLogoWidth+'px'}">
<span>{{ loginOrgTitle }}</span> <span>{{ loginOrgTitle }}</span>
@ -20,12 +23,16 @@
<!-- 默认登陆 --> <!-- 默认登陆 -->
<normal-login ref="normalLogin" :project="backProject" :local-project="localProject" @forgetPassword="forgetPassword" @showOrgList="showOrgList" /> <normal-login ref="normalLogin" :project="backProject" :local-project="localProject" @forgetPassword="forgetPassword" @showOrgList="showOrgList" />
</div> </div>
<!-- 基于系统开发 -->
<base-development v-if="baseDevelopment" ref="baseDevelopment" /> <base-development v-if="baseDevelopment" ref="baseDevelopment" />
<!-- 关于系统 -->
<div class="bottomInfo"> <div class="bottomInfo">
<span>{{ aboutSystem }}</span> <span>{{ aboutSystem }}</span>
</div> </div>
</div> </div>
<!-- 忘记密码 -->
<forget-password ref="forgetPassword" /> <forget-password ref="forgetPassword" />
<!-- 选择组织 -->
<OrgSelect ref="orgSelect" @select="selectOrgnization" /> <OrgSelect ref="orgSelect" @select="selectOrgnization" />
</div> </div>
</template> </template>
@ -41,6 +48,8 @@ import ForgetPassword from './forgetPassword';
import OrgSelect from './orgSelect'; import OrgSelect from './orgSelect';
export default { export default {
name:'LoginNew', name:'LoginNew',
// components: { Register },
// export const RegisterCodeList = ['cgy', 'designcgy'];
components: { WechatLogin, NormalLogin, BaseDevelopment, ForgetPassword, OrgSelect }, components: { WechatLogin, NormalLogin, BaseDevelopment, ForgetPassword, OrgSelect },
data() { data() {
return { return {

View File

@ -77,7 +77,6 @@
</el-form> </el-form>
</template> </template>
<script> <script>
// export const RegisterCodeList = ['cgy', 'designcgy'];
import QCode from '@/assets/erCode.jpg'; import QCode from '@/assets/erCode.jpg';
import md5 from 'js-md5'; import md5 from 'js-md5';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
@ -85,8 +84,6 @@ import Cookies from 'js-cookie';
import { getOrgList, selectOrgnization } from '@/api/login'; import { getOrgList, selectOrgnization } from '@/api/login';
export default { export default {
name:'NormalLogin', name:'NormalLogin',
// Register,
// components: { ForgetPassword },
props: { props: {
project: { project: {
type: String, type: String,
@ -142,8 +139,6 @@ export default {
} }
}; };
}, },
// created() {
// },
watch: { watch: {
'project': function(val) { 'project': function(val) {
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) { if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
@ -158,6 +153,7 @@ export default {
} }
}, },
methods:{ methods:{
//
showPwd() { showPwd() {
if (this.pwdType === 'password') { if (this.pwdType === 'password') {
this.pwdDisplay = false; this.pwdDisplay = false;
@ -167,12 +163,12 @@ export default {
this.pwdDisplay = true; this.pwdDisplay = true;
} }
}, },
//
loginAction(model) { loginAction(model) {
this.$store this.$store
.dispatch('Login', model) .dispatch('Login', model)
.then(() => { .then(() => {
this.$store.dispatch('SetAccount', model.username); this.$store.dispatch('SetAccount', model.username);
// this.handleLoginSucessRoute();
this.checkOrgnizationInfo(); this.checkOrgnizationInfo();
}) })
.catch(error => { .catch(error => {
@ -193,6 +189,7 @@ export default {
}, 5000); }, 5000);
}); });
}, },
//
checkOrgnizationInfo() { checkOrgnizationInfo() {
getOrgList().then(resp => { getOrgList().then(resp => {
const orgList = resp.data; const orgList = resp.data;
@ -205,16 +202,17 @@ export default {
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
} else { } else {
this.$emit('showOrgList', orgList); this.$emit('showOrgList', orgList);
// this.showOrgSelect(orgList).then(this.handleLoginSucessRoute());
} }
}).catch(()=>{ }).catch(()=>{
this.loading = false; this.loading = false;
}); });
}, },
//
selectOrg(orgId) { selectOrg(orgId) {
this.handleLoginSucessRoute(); this.handleLoginSucessRoute();
selectOrgnization(orgId); selectOrgnization(orgId);
}, },
//
handleLoginSucessRoute() { handleLoginSucessRoute() {
this.loading = false; this.loading = false;
this.tipsMsg = ''; this.tipsMsg = '';
@ -243,6 +241,7 @@ export default {
} }
}); });
}, },
//
forgetPassword() { forgetPassword() {
this.$emit('forgetPassword'); this.$emit('forgetPassword');
} }

View File

@ -12,6 +12,7 @@
<dispatch-cmd v-if="datie" ref="dispatchCmd" @close="close" /> <dispatch-cmd v-if="datie" ref="dispatchCmd" @close="close" />
<dispatcher-loger v-if="datie" ref="dispatcherLoger" @close="close" /> <dispatcher-loger v-if="datie" ref="dispatcherLoger" @close="close" />
<terminal-menu v-if="menuShow" ref="terminalMenu" @pictureChange="pictureChange" @popupTerminalShow="popupTerminalShow" @loadingChange="loadingChange" /> <terminal-menu v-if="menuShow" ref="terminalMenu" @pictureChange="pictureChange" @popupTerminalShow="popupTerminalShow" @loadingChange="loadingChange" />
<iscs-system v-else-if="picture === 'iscs'" ref="IscsSystem" />
</div> </div>
</template> </template>
@ -32,6 +33,7 @@ import DigitalStand from '@/views/jlmap3d/simulation/jl3dsimulation';
import IbpPlate from '@/views/ibp/ibpsystem/index'; import IbpPlate from '@/views/ibp/ibpsystem/index';
import TrafficTerminalWork from './trafficTerminalWork'; import TrafficTerminalWork from './trafficTerminalWork';
import BigTrainRunplanManage from '@/views/bigTrainRunplanManage/index'; import BigTrainRunplanManage from '@/views/bigTrainRunplanManage/index';
import IscsSystem from '@/views/iscs/iscsSystem/index';
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
@ -46,7 +48,8 @@ export default {
IbpPlate, IbpPlate,
TrafficTerminalWork, TrafficTerminalWork,
DigitalStand, DigitalStand,
BigTrainRunplanManage BigTrainRunplanManage,
IscsSystem
}, },
data() { data() {
return { return {