fix : 修改用户切换样式
This commit is contained in:
@@ -10,8 +10,8 @@
|
|||||||
<el-button @click="getList()">搜索</el-button>
|
<el-button @click="getList()">搜索</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button v-if="isChooseAll" @click="chooseAll">全选</el-button>
|
<!-- <el-button v-if="isChooseAll" @click="chooseAll">全选</el-button>-->
|
||||||
<el-button v-else @click="cancelAll">不全选</el-button>
|
<!-- <el-button v-else @click="cancelAll">不全选</el-button>-->
|
||||||
<!-- <el-checkbox-group v-model="checkBtn" @change="handleChange">-->
|
<!-- <el-checkbox-group v-model="checkBtn" @change="handleChange">-->
|
||||||
<!-- <el-checkbox label="全选" value="1" />-->
|
<!-- <el-checkbox label="全选" value="1" />-->
|
||||||
<!-- <el-checkbox label="Option B" value="Value B" />-->
|
<!-- <el-checkbox label="Option B" value="Value B" />-->
|
||||||
@@ -161,6 +161,11 @@ const show = () => {
|
|||||||
getList()
|
getList()
|
||||||
};
|
};
|
||||||
const handleChange = (data, checked) => {
|
const handleChange = (data, checked) => {
|
||||||
|
if(data.value==-1&&checked){
|
||||||
|
chooseAll()
|
||||||
|
}else if(data.value==-1&&!checked){
|
||||||
|
cancelAll()
|
||||||
|
}
|
||||||
// 左侧有选择框 + 多选
|
// 左侧有选择框 + 多选
|
||||||
if (props.multiple) {
|
if (props.multiple) {
|
||||||
//不添加重复的数据到右边
|
//不添加重复的数据到右边
|
||||||
|
|||||||
@@ -7,16 +7,42 @@
|
|||||||
<div class="user-box">
|
<div class="user-box">
|
||||||
<div>
|
<div>
|
||||||
<!-- <img :src="userInfo.avatar" alt="" @click.stop="handleVisitedP">-->
|
<!-- <img :src="userInfo.avatar" alt="" @click.stop="handleVisitedP">-->
|
||||||
<span @click.stop="handleVisitedP">欢迎回来,{{ userInfo.userName }}</span>
|
<span @click.stop="handleVisitedP">欢迎回来,{{ userInfo.nickName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="person" v-if="visitedP">
|
<div class="person" v-if="visitedP">
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>主次账号切换</li>
|
||||||
<el-select v-model="selectUserId" @change="accountChange">
|
<li class="avatar-li" v-for="item in accountList" @click="accountChange(item.userId)">
|
||||||
<el-option v-for="item in accountList" :label="item.userName" :value="item.userId"/>
|
<el-avatar>{{ item.nickName }}</el-avatar>
|
||||||
</el-select>
|
<div class="right-li">
|
||||||
<li @click="handleToAuth">个人中心</li>
|
<div class="name-line">
|
||||||
<li @click="handleLogout">退出登录</li>
|
<span v-if="item.accountType==='0'" class="zhu">主</span>
|
||||||
|
<span class="nickName">{{ item.nickName }}</span>
|
||||||
|
<span>{{ item.jobActivityDesc }}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span>{{ item.companyName }}/{{ item.departmentName }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-icon color="#3f89dc" size="20" v-if="item.current">
|
||||||
|
<SuccessFilled/>
|
||||||
|
</el-icon>
|
||||||
|
</div>
|
||||||
|
<!-- <li v-for="item in accountList" :label="item.userName" :value="item.userId"/>-->
|
||||||
|
</li>
|
||||||
|
<!-- <li @click="handleToAuth">-->
|
||||||
|
<!-- <el-icon color="gray" size="20" style="margin-right: 5px">-->
|
||||||
|
<!-- <UserFilled/>-->
|
||||||
|
<!-- </el-icon>-->
|
||||||
|
<!-- 个人中心-->
|
||||||
|
<!-- </li>-->
|
||||||
|
<li @click="handleLogout">
|
||||||
|
<el-icon color="gray" size="20" style="margin-right: 5px">
|
||||||
|
<SwitchButton/>
|
||||||
|
</el-icon>
|
||||||
|
退出登录
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,16 +94,15 @@ const handleVisitedP = () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountChange = () => {
|
const accountChange = (userId) => {
|
||||||
switchAccount(selectUserId.value).then(res =>{
|
switchAccount(userId).then(res => {
|
||||||
if (res.code == 1000){
|
if (res.code == 1000) {
|
||||||
visitedP.value = !visitedP.value
|
visitedP.value = !visitedP.value
|
||||||
authStore.userLogout()
|
authStore.userLogout()
|
||||||
permisstionStore.removeMenu()
|
|
||||||
permisstionStore.setIsSuccessReq()
|
|
||||||
tagsViewStore.removeAllTagView()
|
|
||||||
setToken(res.data)
|
setToken(res.data)
|
||||||
router.push('/')
|
router.push('/')
|
||||||
|
location.reload()
|
||||||
|
visitedP.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -137,24 +162,86 @@ const handleLogout = () => {
|
|||||||
|
|
||||||
|
|
||||||
.person {
|
.person {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666666;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 80px;
|
width: 280px;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 300;
|
z-index: 300;
|
||||||
bottom: -70px;
|
top: 46px;
|
||||||
padding: 10px 5px;
|
padding: 5px 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 2px 2px 2px 1px rgb(171, 167, 167);
|
box-shadow: 2px 2px 2px 1px rgb(171, 167, 167);
|
||||||
|
|
||||||
li {
|
.avatar-li {
|
||||||
text-align: center;
|
display: flex;
|
||||||
font-size: 14px;
|
height: 60px;
|
||||||
line-height: 1.5;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
|
.right-li {
|
||||||
|
color: #909090;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.name-line {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
|
||||||
|
.zhu {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
background-color: #fa0;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nickName {
|
||||||
|
color: #4d7ad8;
|
||||||
|
}
|
||||||
|
|
||||||
|
> span {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:last-child {
|
||||||
|
width: 194px;
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-avatar--circle) {
|
||||||
|
margin-right: 10px;
|
||||||
|
background-color: #8a7243;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #79bbff;
|
color: #666666 !important;
|
||||||
|
background-color: #eaeaea;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child:hover {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
padding: 0 10px;
|
||||||
|
height: 28px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
text-align: left;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user