Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1
This commit is contained in:
commit
62adae7f00
@ -1,188 +0,0 @@
|
||||
<template>
|
||||
<div class="qrcode-main">
|
||||
<div class="login-code-box" @click="loginRefresh">
|
||||
<qrcode-vue
|
||||
v-loading="loadingCode"
|
||||
:value="loginUrl"
|
||||
:class-name="qrcodeClassName"
|
||||
:size="150"
|
||||
:element-loading-text="this.$t('login.clickRefresh')"
|
||||
element-loading-spinner="el-icon-refresh"
|
||||
element-loading-background="rgba(255, 255, 255, 0.9)"
|
||||
/>
|
||||
</div>
|
||||
<div class="login-tip">
|
||||
<span class="sub-title">{{ $t('login.scanCodeLogin') }}</span>
|
||||
</div>
|
||||
<div class="tip-info">
|
||||
<fieldset>
|
||||
<legend>
|
||||
{{ $t('login.recommendedConfiguration') }}
|
||||
</legend>
|
||||
<span>{{ $t('login.browser') }}
|
||||
<a href="https://www.google.cn/chrome/" target="_blank" style="text-decoration: underline;">{{
|
||||
$t('login.googleChrome')
|
||||
}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<span>{{ $t('login.screenResolution') + '1920*1080' }}</span>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// , gtLoginInfo, getOrgList, selectOrgnization
|
||||
import QrcodeVue from 'qrcode.vue';
|
||||
import { getLoginWmurl, checkLoginStatus} from '@/api/login';
|
||||
import { LoginParams } from '@/utils/login';
|
||||
export default {
|
||||
name:'WeChatLogin',
|
||||
components: { QrcodeVue },
|
||||
props: {
|
||||
project: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
syncLogin:{
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadingCode: false,
|
||||
loginUrl: '',
|
||||
sessionId: '',
|
||||
checkLogin: null,
|
||||
qrcodeClassName: 'login-qrcode',
|
||||
loginClient:'LianKeTang'
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'project': function(val) {
|
||||
this.loginRefresh();
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
loginRefresh() {
|
||||
// this.loadingCode = true;
|
||||
const params = LoginParams[this.loginClient];
|
||||
params.project = this.project;
|
||||
if (this.$route.query.projectDevice) {
|
||||
params.deviceCode = this.$route.query.projectDevice;
|
||||
}
|
||||
const self = this;
|
||||
getLoginWmurl(params)
|
||||
.then(response => {
|
||||
self.sessionId = response.data.sessionId;
|
||||
self.loginUrl = response.data.url;
|
||||
self.loadingCode = false;
|
||||
self.checkLoginStatus();
|
||||
})
|
||||
.catch(() => {
|
||||
if (self.syncLogin) {
|
||||
setTimeout(() => {
|
||||
self.loginRefresh();
|
||||
}, 3000);
|
||||
} else {
|
||||
self.loadingCode = false;
|
||||
self.$messageBox(this.$t('login.getLoginQrCode'));
|
||||
}
|
||||
});
|
||||
},
|
||||
checkLoginStatus() {
|
||||
// 销毁则不再定时
|
||||
if (this && this._isDestroyed) {
|
||||
return;
|
||||
}
|
||||
// 清空已存在的定时器
|
||||
this.clearTimer(this.checkLogin);
|
||||
// 设置定时器检测
|
||||
const self = this;
|
||||
self.checkLogin = setTimeout(() => {
|
||||
checkLoginStatus(self.sessionId)
|
||||
.then(response => {
|
||||
// 设置扫码登录
|
||||
debugger;
|
||||
self.$store
|
||||
.dispatch('QrLoginSetting', { key: 'SET_TOKEN', value: response.data.token, type: 'class' })
|
||||
.then(() => {
|
||||
// 清除定时器,设置路由
|
||||
self.clearTimer(self.checkLogin);
|
||||
// this.handleLoginSucessRoute();
|
||||
self.checkOrgnizationInfo();
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
if ((error.data && error.data.status === 'EXPIRE') || error.code != 200) {
|
||||
if (self.syncLogin) {
|
||||
self.loginRefresh();
|
||||
} else {
|
||||
self.loadingCode = true;
|
||||
self.loginUrl = '';
|
||||
}
|
||||
} else {
|
||||
self.checkLoginStatus();
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
},
|
||||
clearTimer(timer) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
$qrbg: #fff;
|
||||
.qrcode-main {
|
||||
width:300px;
|
||||
background-color: $qrbg;
|
||||
text-align: center;
|
||||
border-right: 1px solid #ececec;
|
||||
.tip-info {
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
color: green;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.login-code-box {
|
||||
width: 150px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.system-type {
|
||||
margin: 5px 0;
|
||||
display: block;
|
||||
}
|
||||
.sub-title {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #353535;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
.el-loading-spinner i {
|
||||
font-size: 100px;
|
||||
}
|
||||
.el-loading-spinner .el-loading-text {
|
||||
font-size: 24px;
|
||||
}
|
||||
.login-code-box {
|
||||
.el-loading-spinner i {
|
||||
font-size: 14px;
|
||||
}
|
||||
.el-loading-spinner .el-loading-text {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,86 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="550px" :before-close="doClose">
|
||||
<el-form ref="form" label-width="120px" :model="formModel" :rules="rules">
|
||||
<el-form-item :label="$t('display.setTime.systemTime')" prop="time">
|
||||
<el-time-picker
|
||||
v-model="formModel.time"
|
||||
:picker-options="pickerOptions"
|
||||
:placeholder="$t('display.setTime.anyTime')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="show = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="status" @click="handleSure">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { modifySystemTime } from '@/api/simulation';
|
||||
import { prefixIntrger } from '@/utils/date';
|
||||
|
||||
// 修改系统时间
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
formModel: {
|
||||
time: new Date()
|
||||
},
|
||||
maxNumber: 1,
|
||||
pickerOptions: { selectableRange: '00:00:00 - 23:59:59' },
|
||||
status: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '修改系统时间';
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
time: [
|
||||
{ required: true, message: this.$t('display.setTime.selectSystemTime'), trigger: 'change' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
// this.formModel.time = new Date(this.$store.state.training.initTime || null);
|
||||
this.show = true;
|
||||
},
|
||||
doClose() {
|
||||
this.status = false;
|
||||
this.show = false;
|
||||
},
|
||||
formatTime(time) {
|
||||
const hh = prefixIntrger(time.getHours(), 2);
|
||||
const mm = prefixIntrger(time.getMinutes(), 2);
|
||||
const ss = prefixIntrger(time.getSeconds(), 2);
|
||||
return `${hh}:${mm}:${ss}`;
|
||||
},
|
||||
handleSure() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.status = true;
|
||||
const model = {
|
||||
time: this.formatTime(this.formModel.time)
|
||||
};
|
||||
modifySystemTime(model, this.group).then(resp => {
|
||||
this.status = false;
|
||||
this.$message.success('修改系统时间成功!');
|
||||
}).catch(() => {
|
||||
this.status = false;
|
||||
this.$messageBox('修改系统时间失败,请稍后再试');
|
||||
});
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -50,7 +50,7 @@ export default {
|
||||
queryList:{
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
// paginationHiden: true,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
@ -168,8 +168,8 @@ export default {
|
||||
return this.$route.path.includes('/teachingDataManage/');
|
||||
},
|
||||
queryFunction(param) {
|
||||
delete param.pageSize;
|
||||
delete param.pageNum;
|
||||
// delete param.pageSize;
|
||||
// delete param.pageNum;
|
||||
if (this.hasTeachingDataManage()) {
|
||||
return getAllPublishTrainingList(param);
|
||||
} else {
|
||||
|
@ -13,9 +13,6 @@
|
||||
<el-form-item label="显示背景图片:" prop="showBackPic" class="inlineBlock">
|
||||
<el-switch v-model="formModel.showBackPic" />
|
||||
</el-form-item>
|
||||
<el-form-item label="微信登录:" prop="wechatLogin" class="inlineBlock">
|
||||
<el-switch v-model="formModel.wechatLogin" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系方式:" prop="loginContectInformation" class="inlineBlock">
|
||||
<el-switch v-model="formModel.loginContectInformation" />
|
||||
</el-form-item>
|
||||
@ -88,7 +85,6 @@ export default {
|
||||
baseDevelopment:false, // 是否显示基于系统开发
|
||||
aboutSystem:'', // 登录页 右下角关于系统
|
||||
showBackPic:true, // 登录页 是否显示背景图片
|
||||
wechatLogin:true, // 登录页 是否可以微信登录
|
||||
loginContectInformation:false, // 登录页 是否显示联系方式
|
||||
loginProLogo:'', // 登录页 logo
|
||||
loginProLogoWidth:0, // 登录页 logo 宽度
|
||||
@ -144,7 +140,6 @@ export default {
|
||||
this.formModel.baseDevelopment = viewSetting.baseDevelopment || false;
|
||||
this.formModel.aboutSystem = viewSetting.aboutSystem || '';
|
||||
this.formModel.showBackPic = viewSetting.showBackPic || false;
|
||||
this.formModel.wechatLogin = viewSetting.wechatLogin || false;
|
||||
this.formModel.loginContectInformation = viewSetting.loginContectInformation || false;
|
||||
|
||||
this.formModel.loginProLogo = viewSetting.loginProLogo || '';
|
||||
@ -174,7 +169,6 @@ export default {
|
||||
baseDevelopment:false, // 是否显示基于系统开发
|
||||
aboutSystem:'', // 登录页 右下角关于系统
|
||||
showBackPic:true, // 登录页 是否显示背景图片
|
||||
wechatLogin:true, // 登录页 是否可以微信登录
|
||||
loginContectInformation:false, // 登录页 是否显示联系方式
|
||||
loginProLogo:'', // 登录页 logo
|
||||
loginProLogoWidth:'', // 登录页 logo 宽度
|
||||
|
Loading…
Reference in New Issue
Block a user