| | |
| | | .user span { |
| | | font-size: 14px; |
| | | } |
| | | .el-dropdown{ |
| | | display: flex; |
| | | align-items: center; |
| | | color: #000; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .left { |
| | | height: calc(100vh - 48px - 40px); |
| | |
| | | cursor: auto !important; |
| | | margin: 8px 12px; |
| | | } |
| | | |
| | | .search_thing { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 50px; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 90px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 120px); |
| | | } |
| | | </style> |
| | | <style></style> |
| | | <template> |
| | |
| | | </div> |
| | | <div class="label">LIMS实验室管理系统</div> |
| | | <div class="user"> |
| | | <el-avatar :size="26">{{ userName.substring(0, 1) }}</el-avatar> |
| | | <span>{{ userName }}</span> |
| | | <el-dropdown trigger="click" @command="handleCommand"> |
| | | <el-avatar :size="26">{{ userName.substring(0, 1) }}</el-avatar> |
| | | <span>{{ userName }}</span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item>修改密码</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | <img src="../../static/img/退出.png" @click="out" title="退出账号" /> |
| | | </div> |
| | | </div> |
| | |
| | | </el-card> |
| | | </el-col> |
| | | </div> |
| | | <el-dialog |
| | | title="修改密码" |
| | | :visible.sync="editVisible" |
| | | width="400px" |
| | | :before-close="handleClose"> |
| | | <el-row> |
| | | <el-col class="search_thing" :span="24"> |
| | | <div class="search_label"><span class="required-span">* </span>旧密码:</div> |
| | | <div class="search_input"> |
| | | <el-input v-model="query.oldPassword" size="small" clearable show-password></el-input> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col class="search_thing" :span="24"> |
| | | <div class="search_label"><span class="required-span">* </span>新密码:</div> |
| | | <div class="search_input"> |
| | | <el-input v-model="query.newPassWord" size="small" clearable show-password></el-input> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="handleClose">取 消</el-button> |
| | | <el-button type="primary" @click="handleEdit">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | tabs: [], |
| | | upIndex: 0, |
| | | activeIndex: 0, |
| | | power: [] |
| | | power: [], |
| | | editVisible:false, |
| | | query:{} |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | if (count > 4) return 8 |
| | | if (count > 1) return 12 |
| | | if (count == 1) return 24 |
| | | } |
| | | }, |
| | | // 修改密码-打开弹窗 |
| | | handleCommand(e){ |
| | | this.editVisible = true; |
| | | }, |
| | | handleEdit(){ |
| | | if (!this.query.oldPassword) { |
| | | this.$message.error('请填写旧密码') |
| | | return |
| | | } |
| | | if (!this.query.newPassWord) { |
| | | this.$message.error('请填写旧密码') |
| | | return |
| | | } |
| | | this.$axios.post(this.$api.user.upUserPassword, {...this.query}).then(res => { |
| | | if (res.code == 201) { |
| | | this.$message.error('修改失败') |
| | | return |
| | | } |
| | | this.$message.success('修改成功') |
| | | this.editVisible = false |
| | | this.query = {} |
| | | this.out(); |
| | | }) |
| | | }, |
| | | handleClose(){ |
| | | this.editVisible = false |
| | | this.query = {} |
| | | } |
| | | } |
| | | }; |
| | | </script> |