修复代码bug!
This commit is contained in:
parent
44f10a24bb
commit
0afa218810
@ -13,16 +13,33 @@
|
||||
<div class="page-wrapper">
|
||||
<div class="login-wrapper">
|
||||
<h1>登 录</h1>
|
||||
<ul class="menu-tab">
|
||||
<li
|
||||
v-for="item in ui.tabMenu"
|
||||
:key="item.type"
|
||||
:class="{ 'current': ui.currentMenu === item.type }"
|
||||
@click="onToggleMenu(item.type)"
|
||||
>
|
||||
{{ item.label }}
|
||||
</li>
|
||||
</ul>
|
||||
<el-form ref="loginForm">
|
||||
<el-form-item>
|
||||
<label class="form-label">用户名</label>
|
||||
<el-input
|
||||
v-if="ui.currentMenu === ui.tabMenu[0].type"
|
||||
v-model.trim.lazy="ui.account"
|
||||
type="text"
|
||||
placeholder="请输入P13账号或P09工号"
|
||||
/>
|
||||
<el-input
|
||||
v-else
|
||||
v-model.trim.lazy="ui.account"
|
||||
type="text"
|
||||
placeholder="请输入坐席工号"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-form-item v-show="ui.currentMenu === ui.tabMenu[0].type">
|
||||
<label class="form-label">密码</label>
|
||||
<el-input
|
||||
v-model.trim.lazy="ui.password"
|
||||
@ -41,9 +58,9 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <div>
|
||||
<span>{{ ui.tips }}</span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -67,6 +84,11 @@ export default {
|
||||
tips: "",
|
||||
showNeedAccountTip: false,
|
||||
showAccountErrorTip: false,
|
||||
tabMenu: [
|
||||
{ type: "cpicxim_staff", label: "内勤", },
|
||||
{ type: "tele_saler", label: "坐席", },
|
||||
],
|
||||
currentMenu: "",
|
||||
});
|
||||
|
||||
const savedP13uid = () =>
|
||||
@ -84,7 +106,8 @@ export default {
|
||||
login(info)
|
||||
.then((response) =>
|
||||
{
|
||||
const data = response.data && { success: false, };
|
||||
// debugger;
|
||||
const data = response.data ?? { success: false, };
|
||||
|
||||
if (data.success === true)
|
||||
{
|
||||
@ -96,13 +119,13 @@ export default {
|
||||
});
|
||||
|
||||
const staffInfo = new StaffInfo(
|
||||
data.staff_info.p13uid && "",
|
||||
data.staff_info.code && "",
|
||||
data.staff_info.name && "",
|
||||
data.staff_info.department_code && "",
|
||||
data.staff_info.department_name && "",
|
||||
data.staff_info.section_office_code && "",
|
||||
data.staff_info.p13section_office_nameuid && ""
|
||||
data.staff_info.p13uid ?? "",
|
||||
data.staff_info.code ?? "",
|
||||
data.staff_info.name ?? "",
|
||||
data.staff_info.department_code ?? "",
|
||||
data.staff_info.department_name ?? "",
|
||||
data.staff_info.section_office_code ?? "",
|
||||
data.staff_info.p13section_office_nameuid ?? ""
|
||||
);
|
||||
|
||||
saveStaffInfo(staffInfo);
|
||||
@ -146,12 +169,15 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
// setInterval(() =>
|
||||
// {
|
||||
// window.location.reload();
|
||||
// }, 5000);
|
||||
const onToggleMenu = (type: string) =>
|
||||
{
|
||||
ui.currentMenu = type;
|
||||
};
|
||||
|
||||
return { ui, savedP13uid, onLogin, };
|
||||
// 初始化界面
|
||||
ui.currentMenu = ui.tabMenu[1].type;
|
||||
|
||||
return { ui, savedP13uid, onLogin, onToggleMenu, };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -159,8 +185,10 @@ export default {
|
||||
<style scoped lang="scss">
|
||||
.page-wrapper {
|
||||
box-sizing: border-box;
|
||||
height: calc(100vh - 10mm);
|
||||
width: calc(100vw - 10mm);
|
||||
// height: calc(100vh - 10mm);
|
||||
// width: calc(100vw - 10mm);
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
// border: 1px solid red;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -204,6 +232,28 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.menu-tab {
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 25px;
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
padding: 10px 24px;
|
||||
margin: 0 10px;
|
||||
// background-color: #fff;
|
||||
color: #1d6ddc;
|
||||
font-size: 16px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
|
||||
&.current {
|
||||
background-color: #1d6ddc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
/* color: #fff; */
|
||||
|
Loading…
x
Reference in New Issue
Block a user