| | |
| | | v-if="inAccountDetail == false && isAddAccount == false" |
| | | > |
| | | <div class="content-top"> |
| | | <div class="touxiang-big"> |
| | | <div |
| | | class="touxiang-big" |
| | | @mouseenter="showChangePic = true" |
| | | @mouseleave="onLeave" |
| | | > |
| | | <img |
| | | v-if="activeAccountItem.headpic" |
| | | :src="`data:image/png;base64,${activeAccountItem.headpic}`" |
| | | alt="" |
| | | /> |
| | | <div class="touxiang-mask" v-if="showChangePic==true"> |
| | | <span class="enable">修改头像</span> |
| | | <div class="touxiang-mask" v-show="showChangePic"> |
| | | <span |
| | | class="enable" |
| | | v-if="!showJPGArr" |
| | | @click="showJPGArr = true" |
| | | >修改头像</span |
| | | > |
| | | <span |
| | | class="enable" |
| | | v-if="addForm.headpic" |
| | | @click="confirmChangePic" |
| | | >确认选择</span |
| | | > |
| | | <span class="enable" v-if="showJPGArr" @click="cacelChoosePic"> |
| | | 取消</span |
| | | > |
| | | </div> |
| | | </div> |
| | | <div class="user-desc"> |
| | |
| | | > |
| | | <span>{{ activeAccountItem.username }}</span> |
| | | </div> |
| | | <div class="nickname"> |
| | | <span>昵称:</span> |
| | | <div class="nick-name"> |
| | | <span class="nick-text">昵称:</span> |
| | | <span v-show="!showInputNickName">{{ |
| | | activeAccountItem.nickname |
| | | }}</span> |
| | | <input |
| | | <!-- <input |
| | | type="text" |
| | | class="input-nick" |
| | | ref="input-nick" |
| | |
| | | v-model="inputNickName" |
| | | @blur="hideInputNick" |
| | | @keydown.enter="blurInputNick" |
| | | /> |
| | | <span class="icon iconfont" @click="editNickName" |
| | | ></span |
| | | /> --> |
| | | <el-input |
| | | size="mini" |
| | | v-model="inputNickName" |
| | | v-if="showInputNickName" |
| | | ></el-input> |
| | | <span v-show="!showInputNickName" class="icon iconfont" @click="editNickName" |
| | | ></span |
| | | > |
| | | </div> |
| | | <div class="user-role"> |
| | | {{ |
| | | activeAccountItem.sysRoles.length |
| | | ? activeAccountItem.sysRoles[0].name |
| | | : "" |
| | | }} |
| | | {{ activeUserRole }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="chang-pic-arr"> |
| | | <div class="chang-pic-arr" v-if="showJPGArr"> |
| | | <div class="upload-group"> |
| | | <div |
| | | class="upload-jpg" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="list-btn" v-if="isChangePic == false"> |
| | | <div class="list-btn" v-if="showJPGArr == false"> |
| | | <div class="item-btn" @click="showChangePassword">修改密码</div> |
| | | <div class="item-btn" @click="deleteAccount">删除账户</div> |
| | | <div |
| | | class="item-btn" |
| | | v-if=" |
| | | activeUserRole !== '超级管理员' || |
| | | (curUserRole == '管理员' && activeUserRole == '普通用户') |
| | | " |
| | | @click="deleteAccount" |
| | | > |
| | | 删除账户 |
| | | </div> |
| | | <div class="item-btn" @click="openPermission">权限设置</div> |
| | | </div> |
| | | </div> |
| | |
| | | }; |
| | | return { |
| | | showAccount: true, |
| | | showChangePic:false, |
| | | showChangePic: false, |
| | | syncYrs: "", |
| | | activeAccountItem: {}, |
| | | syncMonth: "", |
| | |
| | | equipmentDate: "", |
| | | roleList: [], |
| | | ntpTestLoading: false, |
| | | showJPGArr: false, |
| | | settime: "", |
| | | weekday: "", |
| | | menuArr: [ |
| | |
| | | confirmPassword: "", |
| | | roleId: "", |
| | | }, |
| | | isChangePic: true, |
| | | rules: { |
| | | userName: [ |
| | | { required: true, message: "请输入用户名", trigger: "blur" }, |
| | |
| | | getUsers().then((res) => { |
| | | this.accountArr = res.data; |
| | | if (this.accountArr.length) { |
| | | this.activeAccountItem = this.accountArr[0]; |
| | | this.activeAccountIndex = 0; |
| | | this.activeAccountItem = this.accountArr[this.activeAccountIndex]; |
| | | } |
| | | if (showLast) { |
| | | this.cancelAdd(); |
| | |
| | | blurInputNick() { |
| | | this.$refs["input-nick"].blur(); |
| | | }, |
| | | confirmChangePic() { |
| | | updateUser({ |
| | | id: this.activeAccountItem.id, |
| | | headpic: this.addForm.headpic, |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.msg); |
| | | this.fetchUserList(); |
| | | this.cacelChoosePic(); |
| | | } |
| | | }); |
| | | }, |
| | | editNickName() { |
| | | this.showInputNickName = true; |
| | | this.inputNickName = this.activeAccountItem.nickname; |
| | |
| | | }, |
| | | hideInputNick() { |
| | | this.showInputNickName = false; |
| | | if (this.inputNickName == this.activeAccountItem.nickname) { |
| | | return; |
| | | } |
| | | updateUser({ |
| | | id: this.activeAccountItem.id, |
| | | nickname: this.inputNickName, |
| | |
| | | this.activeAccountIndex = i; |
| | | this.inAccountDetail = false; |
| | | this.cancelSet(); |
| | | this.cacelChoosePic(); |
| | | this.fetchMenu(); |
| | | this.showInputNickName = false; |
| | | }, |
| | | minusOne(typ) { |
| | | this.isSyncBrowser = false; |
| | |
| | | this[`show${typ}Input`] = false; |
| | | this[`input${typ}`] = ""; |
| | | }, |
| | | onLeave() { |
| | | if (this.showJPGArr) { |
| | | return; |
| | | } |
| | | this.showChangePic = false; |
| | | }, |
| | | syncBrowser(enable) { |
| | | this.isSyncBrowser = enable; |
| | | if (!enable) { |
| | |
| | | showAddAccount() { |
| | | this.inAccountDetail = false; |
| | | this.isAddAccount = true; |
| | | this.selectedPic = 0; |
| | | this.addForm.headpic = this.jpgArr[0]; |
| | | getRoles().then((res) => { |
| | | if (res.success) { |
| | | this.roleList = res.data.slice(0, 2); |
| | |
| | | this.isChangePw = false; |
| | | this.inAccountDetail = false; |
| | | this.$refs["passwordForm"].resetFields(); |
| | | }, |
| | | cacelChoosePic() { |
| | | this.addForm.headpic = ""; |
| | | this.showChangePic = false; |
| | | this.selectedPic = null; |
| | | this.showJPGArr = false; |
| | | }, |
| | | SaveNewPassword(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | |
| | | }); |
| | | }, |
| | | saveAddAccount(formName) { |
| | | debugger; |
| | | this.$refs[formName].validate((valid) => { |
| | | debugger; |
| | | if (valid) { |
| | | let data = { |
| | | username: this.addForm.userName, |
| | |
| | | }); |
| | | }, |
| | | pickHeadDefPic(item, i) { |
| | | if (this.selectedPic == i) { |
| | | this.selectedPic = null; |
| | | this.addForm.headpic = ""; |
| | | return; |
| | | } |
| | | this.addForm.headpic = item.path; |
| | | this.selectedPic = i; |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | computed: { |
| | | isShowAddAccount() { |
| | | activeUserRole() { |
| | | return this.activeAccountItem.sysRoles[0].name; |
| | | }, |
| | | curUserRole() { |
| | | const info = JSON.parse(sessionStorage.getItem("userInfo")); |
| | | return true; |
| | | return info.roleName; |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | top: 0; |
| | | width: 100px; |
| | | height: 100px; |
| | | background-color: rgba(0, 0, 0, 0.2); |
| | | background-color: rgba(0, 0, 0, 0.25); |
| | | color: white; |
| | | cursor: pointer; |
| | | border-radius: 50%; |
| | | display: flex; |
| | | justify-content: center; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | .enable { |
| | | cursor: pointer; |
| | | margin: 2px 0; |
| | | padding: 1px 2px; |
| | | border-radius: 3px; |
| | | border: 1px solid transparent; |
| | | font-size: 14px; |
| | | } |
| | | .enable:hover { |
| | | color: orangered; |
| | | font-size: 15px; |
| | | transition: all 0.2s; |
| | | } |
| | | .selected { |
| | | font-size: 20px; |
| | | } |
| | |
| | | align-items: baseline; |
| | | min-width: 200px; |
| | | .username { |
| | | margin: 5px 15px; |
| | | margin: 4px 15px; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | // width: 90px; |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .nickname { |
| | | .nick-name { |
| | | margin: 5px 15px; |
| | | font-size: 14px; |
| | | display: flex; |
| | | align-items: center; |
| | | .nick-text { |
| | | width: fit-content; |
| | | text-align: left; |
| | | } |
| | | .input-nick { |
| | | width: 50px; |
| | | width: 80px; |
| | | margin-right: 5px; |
| | | } |
| | | .iconfont { |
| | |
| | | margin-left: 5px; |
| | | cursor: pointer; |
| | | } |
| | | .el-input--mini { |
| | | font-size: 14px; |
| | | width: 100px; |
| | | .el-input__inner { |
| | | padding: 0 10px; |
| | | } |
| | | } |
| | | } |
| | | .user-role { |
| | | margin: 5px 0 0 15px; |