1、eldialog优化

Former-commit-id: 3d47b8b278a3ccd74516e82d073b722f9e16d39f
master
wangbing 5 years ago
parent 7f19e06631
commit 27d2dfe293

@ -229,7 +229,7 @@
var mixin = {
data: {
activeIndex: 'home',
contextPath: '${context?default("")}',
context: '${context?default("")}',
homePath: '${home?default("")}',
isSubmit: false,
result: [],
@ -402,6 +402,8 @@
data: {
loadingTip: '',
loadingBar: '',
context: '${context?default("")}',
homePath: '${home?default("")}'
},
methods: {
tipShow: function (msg) {
@ -500,23 +502,21 @@
toOpen: function (url) {
this.tipShow();
var url = url.substring(0, 1) == "/" ? url.substring(1) : url;
$("body").append($("<a id='wb-open' href='" + this.contextPath + "/" + url + "' target='_self' style='dispaly:none;'></a>"))
$("body").append($("<a id='wb-open' href='" + this.context + "/" + url + "' target='_self' style='dispaly:none;'></a>"))
document.getElementById("wb-open").click();
$("#wb-open").remove();
},
toOpenNew: function (url) {
var url = url.substring(0, 1) == "/" ? url.substring(1) : url;
$("body").append($("<a id='wb-open' href='" + this.contextPath + "/" + url + "' target='_blank' style='dispaly:none;'></a>"))
$("body").append($("<a id='wb-open' href='" + this.context + "/" + url + "' target='_blank' style='dispaly:none;'></a>"))
document.getElementById("wb-open").click();
$("#wb-open").remove();
},
toHome: function () {
this.tipShow();
location.href = this.contextPath + "/"
location.href = this.context + "/"
},
/**
* 滚动屏蔽至顶部
*/
// 滚动屏蔽至顶部
scrollToTop: function () {
var distance = document.documentElement.scrollTop || document.body.scrollTop;
var step = distance / 10;
@ -529,10 +529,7 @@
}
})();
},
/**
* 控制任一目标滚动到顶部
* select jquery对象
*/
// 控制任一目标滚动到顶部
scrollToTop: function (select) {
var distance = $(select).scrollTop();
var step = distance / 10;
@ -576,6 +573,27 @@
wscript.SendKeys("{F11}");
}
}
},
setCookie:function (name, value, expiretime) {
var exdate = new Date();
exdate.setDate(exdate.getTime() + expiretime);
document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + exdate.toGMTString() + ";path=/";
},
getCookie:function (name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(name + "=")
if (c_start != -1){
c_start = c_start + name.length + 1
c_end = document.cookie.indexOf(";", c_start)
if (c_end == -1)
c_end = document.cookie.length
return decodeURIComponent(document.cookie.substring(c_start, c_end))
}
}
return ""
},
clearCookie:function (name) {
this.setCookie(name, "", -1);
}
}
});

@ -54,13 +54,6 @@
<div class="menu">
<ul>
<li>
<el-input
size="mini"
placeholder="请输入搜索内容">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input>
</li>
<li>
<el-link :underline="false" icon="el-icon-full-screen" @click="switchFullScreen">全屏</el-link>
</li>
@ -72,7 +65,7 @@
<el-dropdown>
<el-link :underline="false" @click="onHome" icon="el-icon-user-solid">账户信息</el-link>
<el-dropdown-menu slot="dropdown">
<el-dropdown-menu slot="dropdown" @command="onCommand">
<el-dropdown-item>个人信息</el-dropdown-item>
<el-dropdown-item>修改密码</el-dropdown-item>
</el-dropdown-menu>
@ -82,11 +75,11 @@
<el-link :underline="false" @click="onHome" icon="el-icon-warning-outline">系统版本</el-link>
</li>
<li>
<el-dropdown>
<el-dropdown @command="onCommand">
<el-link :underline="false" icon="el-icon-switch-button"></el-link>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>注销</el-dropdown-item>
<el-dropdown-item :command="'logout'">注销</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</li>
@ -317,6 +310,17 @@
return tab.name !== tabName
})
},
onCommand: function (cmd) {
switch (cmd) {
case "logout":
nav.clearCookie("token");
nav.toOpen("/login.htm");
break;
default:
nav.w("未找到对应的命令");
break;
}
},
switchFullScreen:function(){
this.prop.full = !this.prop.full;
if (this.prop.full) {

@ -1,37 +1,18 @@
<div id="app" v-cloak>
<div class="frame">
<div class="wrapper">
<div class="login-box">
<div class="login-title">系统登录</div>
<div class="title">系统登录</div>
<el-form :model="form" :rules="rules" ref="form" class="loginForm">
<el-form class="content" :model="form" :rules="rules" ref="form">
<el-form-item prop="username">
<el-row>
<el-col :span="2" :offset="2">
<i size="mini" class="icon iconfont el-icon-user"></i>
</el-col>
<el-col :span="18">
<el-input placeholder="用户名" size="mini" v-model="form.username"></el-input>
</el-col>
</el-row>
<el-input placeholder="用户名" v-model="form.username" size="small" prefix-icon="el-icon-user"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-row>
<el-col :span="2" :offset="2">
<i class="icon iconfont el-icon-lock"></i>
</el-col>
<el-col :span="18">
<el-input placeholder="密码" size="mini" v-model="form.password" type="password"></el-input>
</el-col>
</el-row>
<el-input placeholder="密码" v-model="form.password" size="small" type="password" prefix-icon="el-icon-lock"></el-input>
</el-form-item>
<el-form-item>
<el-col :span="18" :offset="4">
<el-button type="primary" size="mini" style="width: 100%" :loading="isSubmit" :disabled="isSubmit"
@click="submitForm('form')">登录
</el-button>
</el-col>
<el-button type="primary" style="width: 100%" size="small" :loading="isSubmit" :disabled="isSubmit" @click="submitForm('form')">登录</el-button>
</el-form-item>
</el-form>
@ -52,9 +33,9 @@
align-items: center;
}
.frame {
width: 350px;
height: 320px;
.wrapper {
width: 450px;
height: 400px;
background: #42424263;
border-radius: 10px;
display: flex;
@ -63,41 +44,42 @@
box-shadow: 0 0 10px 0 #afafaf52;
}
.login-box {
.wrapper .login-box {
display: inline-block;
background: #fff;
border-radius: 5px;
text-align: left;
}
.login-box .login-title {
line-height: 40px;
.wrapper .login-box .title {
line-height: 50px;
border-bottom: 1px solid #e8e8e8;
font-weight: bold;
text-align: left;
padding-left: 20px;
font-size: 14px;
height: 40px;
font-size: 15px;
height: 50px;
color: #757575;
}
.login-box .loginForm {
width: 220px;
margin-top: 10px;
margin-left: 10px;
margin-right: 10px;
.wrapper .login-box .content {
width: 250px;
margin-top: 20px;
margin-left: 20px;
margin-right: 20px;
}
.login-box .loginForm .el-form-item{
margin-bottom: 5px;
.wrapper .login-box .el-form-item{
margin-bottom: 15px;
}
.login-box .tip {
.wrapper .login-box .tip {
padding: 5px;
display: inline-block;
text-align: center;
color: #b7b7b7;
width: 100%;
margin-bottom: 10px;
}
</style>
@ -113,10 +95,10 @@
},
rules: {
username: [
{required: true, message: ' ', trigger: 'blur'}
{required: true, message: '请输入用户名', trigger: 'blur'}
],
password: [
{required: true, message: ' ', trigger: 'change'}
{required: true, message: '请输入密码', trigger: 'change'}
],
}
},

Loading…
Cancel
Save

Powered by TurnKey Linux.