fix:解决bug
This commit is contained in:
parent
063965287b
commit
66d2716924
@ -7,21 +7,26 @@
|
||||
</div>
|
||||
<div class="login-main">
|
||||
<h3 class="login-title">用户登录</h3>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="handleLogin()" status-icon>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="handleLogin()"
|
||||
status-icon
|
||||
>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="dataForm.username" placeholder="帐号"></el-input>
|
||||
<el-input clearable v-model="dataForm.username" placeholder="帐号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
|
||||
<el-input clearable v-model="dataForm.password" type="password" placeholder="密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captcha">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="14">
|
||||
<el-input v-model="dataForm.captcha" placeholder="验证码">
|
||||
</el-input>
|
||||
<el-input clearable v-model="dataForm.captcha" placeholder="验证码"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" class="login-captcha">
|
||||
<img :src="captchaPath" @click="handleGetImgCaptcha()">
|
||||
<img :src="captchaPath" @click="handleGetImgCaptcha" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
@ -36,125 +41,126 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUUID } from '@/utils'
|
||||
import { apiLogin } from '@/api/api_sys'
|
||||
import { getUUID } from '@/utils'
|
||||
import { apiLogin } from '@/api/api_sys'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
uuid: '',
|
||||
captcha: ''
|
||||
},
|
||||
dataRule: {
|
||||
username: [{ required: true, message: '帐号不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '密码不能为空', trigger: 'blur' }],
|
||||
captcha: [{ required: true, message: '验证码不能为空', trigger: 'blur' }]
|
||||
},
|
||||
captchaPath: '' // 图像验证码请求地址
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.handleGetImgCaptcha()
|
||||
},
|
||||
methods: {
|
||||
// 获取图像验证码
|
||||
handleGetImgCaptcha () {
|
||||
this.dataForm.uuid = getUUID()
|
||||
this.captchaPath = `/lz_management/captcha.jpg?uuid=${this.dataForm.uuid}`
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
uuid: '',
|
||||
captcha: ''
|
||||
},
|
||||
// 登录提交表单
|
||||
handleLogin () {
|
||||
let param = Object.assign(this.dataForm, { 'uuid': this.dataForm.uuid })
|
||||
apiLogin(param).then(res => {
|
||||
if (res && res.code === 0) {
|
||||
this.$cookie.set('token', res.token)
|
||||
this.$router.replace({ name: 'home' })
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
dataRule: {
|
||||
username: [{ required: true, message: '帐号不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '密码不能为空', trigger: 'blur' }],
|
||||
captcha: [{ required: true, message: '验证码不能为空', trigger: 'blur' }]
|
||||
},
|
||||
captchaPath: '' // 图像验证码请求地址
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.handleGetImgCaptcha()
|
||||
},
|
||||
methods: {
|
||||
// 获取图像验证码
|
||||
handleGetImgCaptcha () {
|
||||
this.dataForm.uuid = getUUID()
|
||||
this.captchaPath = `/lz_management/captcha.jpg?uuid=${this.dataForm.uuid}`
|
||||
},
|
||||
// 登录提交表单
|
||||
handleLogin () {
|
||||
let param = Object.assign(this.dataForm, { 'uuid': this.dataForm.uuid })
|
||||
apiLogin(param).then(res => {
|
||||
if (res && res.code === 0) {
|
||||
this.$cookie.set('token', res.token)
|
||||
this.$router.replace({ name: 'home' })
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
this.handleGetImgCaptcha()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.site-wrapper.site-page--login {
|
||||
.site-wrapper.site-page--login {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(38, 50, 56, 0.6);
|
||||
overflow: hidden;
|
||||
&:before {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-image: url(~@/assets/img/login/login_bg.jpg);
|
||||
background-size: cover;
|
||||
}
|
||||
.site-content__wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(38, 50, 56, .6);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background-color: transparent;
|
||||
}
|
||||
.site-content {
|
||||
min-height: 100%;
|
||||
padding: 30px 500px 30px 30px;
|
||||
}
|
||||
.brand-info {
|
||||
margin: 220px 100px 0 90px;
|
||||
color: #fff;
|
||||
}
|
||||
.brand-info__text {
|
||||
margin: 0 0 22px 0;
|
||||
font-size: 48px;
|
||||
font-weight: 400;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.brand-info__intro {
|
||||
margin: 10px 0;
|
||||
font-size: 16px;
|
||||
line-height: 1.58;
|
||||
opacity: 0.6;
|
||||
}
|
||||
.login-main {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 150px 60px 180px;
|
||||
width: 470px;
|
||||
min-height: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.login-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
.login-captcha {
|
||||
overflow: hidden;
|
||||
&:before {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
> img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
content: "";
|
||||
background-image: url(~@/assets/img/login/login_bg.jpg);
|
||||
background-size: cover;
|
||||
}
|
||||
.site-content__wrapper {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
background-color: transparent;
|
||||
}
|
||||
.site-content {
|
||||
min-height: 100%;
|
||||
padding: 30px 500px 30px 30px;
|
||||
}
|
||||
.brand-info {
|
||||
margin: 220px 100px 0 90px;
|
||||
color: #fff;
|
||||
}
|
||||
.brand-info__text {
|
||||
margin: 0 0 22px 0;
|
||||
font-size: 48px;
|
||||
font-weight: 400;
|
||||
text-transform : uppercase;
|
||||
}
|
||||
.brand-info__intro {
|
||||
margin: 10px 0;
|
||||
font-size: 16px;
|
||||
line-height: 1.58;
|
||||
opacity: .6;
|
||||
}
|
||||
.login-main {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 150px 60px 180px;
|
||||
width: 470px;
|
||||
min-height: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.login-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
.login-captcha {
|
||||
overflow: hidden;
|
||||
> img {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.login-btn-submit {
|
||||
width: 100%;
|
||||
margin-top: 38px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.login-btn-submit {
|
||||
width: 100%;
|
||||
margin-top: 38px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -23,12 +23,12 @@
|
||||
<span class="contant-name">{{info.staffStatus==1?"离职":"在职"}}</span>
|
||||
</div>
|
||||
|
||||
<div class="contant" v-if="info.resignationTime">
|
||||
<div class="contant" v-if="info.resignationTime && info.staffStatus===1">
|
||||
<span class="contant-label">离职时间:</span>
|
||||
<span class="contant-name">{{info.resignationTime}}</span>
|
||||
</div>
|
||||
|
||||
<div class="contant" v-if="info.signingCompany">
|
||||
<div class="contant" v-if="info.signingCompany && info.staffStatus===1">
|
||||
<span class="contant-label">离职原因:</span>
|
||||
<span class="contant-name">{{info.signingCompany}}</span>
|
||||
</div>
|
||||
|
||||
@ -14,11 +14,10 @@
|
||||
|
||||
<el-form-item :label="`选择时间段\n(仅对员工数量生效)`">
|
||||
<el-date-picker
|
||||
v-model="formInline.value2"
|
||||
v-model="value2"
|
||||
type="daterange"
|
||||
align="right"
|
||||
value-format="yyyy-mm-dd"
|
||||
unlink-panels
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@ -52,6 +51,7 @@ import { apiOrganizationList } from '@/api/api_staff'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
value2: [],
|
||||
isChooseObj: {},
|
||||
isChoose: false,
|
||||
menuList: [],
|
||||
@ -60,17 +60,10 @@ export default {
|
||||
label: 'name'
|
||||
},
|
||||
formInline: {
|
||||
value2: []
|
||||
},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick (picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick (picker) {
|
||||
const end = new Date()
|
||||
@ -86,6 +79,22 @@ export default {
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近半年',
|
||||
onClick (picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 180)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一年',
|
||||
onClick (picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 360)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
@ -99,8 +108,8 @@ export default {
|
||||
methods: {
|
||||
changeData (data) {
|
||||
console.log('data: ', data)
|
||||
this.formInline.beginDate = data[0]
|
||||
this.formInline.endDate = data[1]
|
||||
// this.formInline.beginDate = data[0]
|
||||
// this.formInline.endDate = data[1]
|
||||
},
|
||||
// 获取侧边架构列表
|
||||
async handleGetMenuList () {
|
||||
|
||||
@ -60,35 +60,6 @@ export default {
|
||||
// 获取页面数据
|
||||
async initData () {
|
||||
this.handleGetEmployeessItuation()
|
||||
|
||||
// const dataInfo = {
|
||||
// beginDate: '2020-03-03',
|
||||
// endDate: '2020-05-16',
|
||||
// departmentName: '技术部',
|
||||
// totalStaffCount: '300',
|
||||
// managementCount: '24',
|
||||
// managementRate: '25%',
|
||||
// newStaffCount: '20',
|
||||
// leaveStaffCount: '2',
|
||||
// leaveRate: '15%',
|
||||
// genderDistribution: {
|
||||
// columns: ['分类', '数量', '占比'],
|
||||
// rows: [{ '分类': '男', '数量': 153, '占比': '60%' }, { '分类': '女', '数量': 100, '占比': '40%' }]
|
||||
// },
|
||||
// ageDistribution: {
|
||||
// columns: ['分类', '数量', '占比'],
|
||||
// rows: [{ '分类': '10-20', '数量': 153, '占比': '60%' }, { '分类': '20-30', '数量': 60, '占比': '40%' }, { '分类': '30-40', '数量': 10, '占比': '40%' }]
|
||||
// },
|
||||
// jobSeniorityDistribution: {
|
||||
// columns: ['分类', '数量', '占比'],
|
||||
// rows: [{ '分类': '男', '数量': 153, '占比': '60%' }, { '分类': '女', '数量': 60, '占比': '40%' }]
|
||||
// },
|
||||
// educationDistribution: {
|
||||
// columns: ['分类', '数量', '占比'],
|
||||
// rows: [{ '分类': '专科', '数量': 13, '占比': '60%' }, { '分类': '本科', '数量': 100, '占比': '40%' }, { '分类': '研究生', '数量': 60, '占比': '40%' }, { '分类': '博士', '数量': 10, '占比': '40%' }]
|
||||
// }
|
||||
// }
|
||||
// this.dataInfo = dataInfo
|
||||
},
|
||||
submit (data) {
|
||||
this.handleGetEmployeessItuation(data)
|
||||
|
||||
@ -64,6 +64,7 @@
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
|
||||
<!-- 弹窗, 新增 / 编辑 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user