| | |
| | | |
| | | <div class="change-pw" v-if="inAccountDetail && isChangePw"> |
| | | <div class="title">修改密码</div> |
| | | |
| | | <el-form |
| | | :model="passwordForm" |
| | | :rules="pwRules" |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="btns"> |
| | | <div class="cancel" @click="cancelChangePassword">取消</div> |
| | | <div class="cancel" @click="cancelPassword">取消</div> |
| | | <div class="ok" @click="SaveNewPassword('passwordForm')">保存</div> |
| | | </div> |
| | | </div> |
| | |
| | | placeholder="必填" |
| | | v-model="addForm.userName" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item prop="roleId"> |
| | | <div class="p-title">角色:</div> |
| | | <el-select |
| | | v-model="addForm.roleId" |
| | | placeholder="请选择角色" |
| | | > |
| | | <el-option v-for="(item,i) in roleList" :key="i" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item prop="nickName"> |
| | | <div class="p-title">昵称:</div> |
| | |
| | | </div> |
| | | |
| | | <div class="btns"> |
| | | <div class="cancel" @click="cancelChangePassword">取消</div> |
| | | <div class="cancel" @click="cancelPassword">取消</div> |
| | | <div class="ok" @click="submitClock">保存</div> |
| | | </div> |
| | | </div> |
| | |
| | | deleteUser, |
| | | getUserMenus, |
| | | defHeadPics, |
| | | getRoles, |
| | | } from "@/api/user"; |
| | | import switchBar from "../components/switchBar"; |
| | | import ipInput from "@/components/subComponents/IPInput"; |
| | |
| | | syncType: "1", |
| | | equipmentTime: "", |
| | | equipmentDate: "", |
| | | roleList: [], |
| | | ntpTestLoading: false, |
| | | settime: "", |
| | | weekday: "", |
| | |
| | | password: "", |
| | | headpic: "", |
| | | confirmPassword: "", |
| | | roleId:"" |
| | | }, |
| | | rules: { |
| | | userName: [ |
| | |
| | | }, |
| | | ], |
| | | password: [ |
| | | { required: true, message: '请输入密码', trigger: 'blur' }, |
| | | { min: 6, message: '长度至少为 6 位', trigger: 'blur' } |
| | | ], |
| | | { required: true, message: "请输入密码", trigger: "blur" }, |
| | | { min: 6, message: "长度至少为 6 位", trigger: "blur" }, |
| | | ], |
| | | confirmPassword: [{ validator: validatePass2, trigger: "blur" }], |
| | | }, |
| | | pwRules: { |
| | | // pw: [{ validator: validatePass3, trigger: "blur" }], |
| | | curPassword: [ |
| | | { required: true, message: '请输入密码', trigger: 'blur' }, |
| | | { min: 6, message: '长度至少为 6 位', trigger: 'blur' } |
| | | ], |
| | | curPassword: [ |
| | | { required: true, message: "请输入密码", trigger: "blur" }, |
| | | { min: 6, message: "长度至少为 6 位", trigger: "blur" }, |
| | | ], |
| | | newPassword: [ |
| | | { required: true, message: '请输入密码', trigger: 'blur' }, |
| | | { min: 6, message: '长度至少为 6 位', trigger: 'blur' } |
| | | ], |
| | | { required: true, message: "请输入密码", trigger: "blur" }, |
| | | { min: 6, message: "长度至少为 6 位", trigger: "blur" }, |
| | | ], |
| | | confirmPassword: [{ validator: validatePass4, trigger: "blur" }], |
| | | }, |
| | | }; |
| | |
| | | methods: { |
| | | fetchDefHeadPic() { |
| | | defHeadPics().then((res) => { |
| | | res.data.slice(0, 5).forEach((x, i) => { |
| | | res.data.forEach((x, i) => { |
| | | this.jpgArr[i] = x; |
| | | }); |
| | | }); |
| | |
| | | this.accountArr = res.data; |
| | | if (this.accountArr.length) { |
| | | this.activeAccountItem = this.accountArr[0]; |
| | | this.activeAccountIndex = 0 |
| | | } |
| | | if (showLast) { |
| | | this.cancelAdd(); |
| | | const lastIdx = this.accountArr.length - 1; |
| | | this.openAccount(this.accountArr[lastIdx], lastIdx); |
| | | |
| | | } |
| | | }); |
| | | }, |
| | |
| | | this.activeAccountItem = item; |
| | | this.activeAccountIndex = i; |
| | | this.inAccountDetail = false; |
| | | this.cancelSet(); |
| | | this.fetchMenu(); |
| | | }, |
| | | minusOne(typ) { |
| | | this.isSyncBrowser = false; |
| | |
| | | }, |
| | | fatherChange(item) { |
| | | item.children.forEach((x) => { |
| | | x.selected = false; |
| | | x.selected = item.selected; |
| | | }); |
| | | }, |
| | | childrenChange(item) { |
| | | let isAllSelected = item.children.every((x) => x.selected == true); |
| | | let isAllNotSelected = item.children.every((x) => x.selected == false); |
| | | if (isAllSelected) item.selected = true; |
| | | if (isAllNotSelected) item.selected = false; |
| | | item.selected = isAllSelected |
| | | }, |
| | | getMaxDay() { |
| | | const maxDay = new Date(+this.syncYrs, +this.syncMonth, 0).getDate(); |
| | |
| | | id: this.activeAccountItem.id, |
| | | menuIds: arr, |
| | | }).then((res) => { |
| | | res.data; |
| | | if (res.success) { |
| | | this.$message.success(res.msg) |
| | | this.cancelSet() |
| | | } |
| | | }); |
| | | }, |
| | | formatTime(number, format) { |
| | |
| | | uploadHeadPic(param).then((res) => { |
| | | let index = this.jpgArr.findIndex((x) => x == ""); |
| | | this.$set(this.jpgArr, index, res.data); |
| | | this.loadedPic= res.data |
| | | }); |
| | | }, |
| | | initClockConf(ntpTest = false) { |
| | |
| | | showAddAccount() { |
| | | this.inAccountDetail = false; |
| | | this.isAddAccount = true; |
| | | getRoles().then((res) => { |
| | | if (res.success) { |
| | | this.roleList= res.data |
| | | } |
| | | }); |
| | | }, |
| | | cancelAdd() { |
| | | this.inAccountDetail = false; |
| | | this.isAddAccount = false; |
| | | this.$refs["addForm"].resetFields(); |
| | | }, |
| | | cancelChangePassword() { |
| | | cancelPassword() { |
| | | this.isChangePw = false; |
| | | this.inAccountDetail = false; |
| | | this.$refs['passwordForm'].resetFields() |
| | | this.$refs["passwordForm"].resetFields(); |
| | | }, |
| | | SaveNewPassword(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | |
| | | newPwd: this.passwordForm.newPassword, |
| | | }).then( |
| | | (res) => { |
| | | this.$message.success(res.data); |
| | | if(res.success) { |
| | | this.$message.success(res.msg); |
| | | this.cancelPassword() |
| | | } |
| | | }, |
| | | (err) => { |
| | | this.$message.warning("保存失败," + err.msg); |
| | |
| | | cancelSet() { |
| | | this.isSetPermission = false; |
| | | this.inAccountDetail = false; |
| | | this.sysMenus = []; |
| | | }, |
| | | showChangePassword() { |
| | | this.isChangePw = true; |
| | |
| | | openPermission() { |
| | | this.inAccountDetail = true; |
| | | this.isSetPermission = true; |
| | | this.fetchMenu(); |
| | | if (this.sysMenus.length==0) { |
| | | this.fetchMenu() |
| | | } |
| | | }, |
| | | parseTime() { |
| | | debugger; |
| | | [this.syncYrs, this.syncMonth, this.syncDay] = this.equipmentDate.split( |
| | | "-" |
| | | ); |
| | |
| | | .account-left { |
| | | .add-account { |
| | | color: rgba(61, 104, 225, 1); |
| | | margin-top: 50px; |
| | | |
| | | margin-top: 30px; |
| | | .iconfont { |
| | | cursor: pointer; |
| | | font-size: 32px; |
| | |
| | | margin: 5px 15px; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | width: 90px; |
| | | // width: 90px; |
| | | text-align: left; |
| | | font-size: 15px; |
| | | display: flex; |
| | |
| | | } |
| | | .user-role { |
| | | margin: 5px 0 0 15px; |
| | | font-size: 14px; |
| | | font-size: 14px; color: darkseagreen; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | .add-account-page { |
| | | .upload-group { |
| | | height: 130px; |
| | | height: 120px; |
| | | width: 360px; |
| | | margin: 0 auto; |
| | | overflow: hidden; |
| | |
| | | width: 46px; |
| | | float: left; |
| | | margin: 0 10px; |
| | | margin-bottom: 20px; |
| | | margin-bottom: 10px; |
| | | background-color: rgba(242, 242, 242, 1); |
| | | border: 3px solid transparent; |
| | | border-radius: 50%; |
| | |
| | | display: flex; |
| | | background-color: rgba(242, 242, 242, 1); |
| | | margin: 0 10px; |
| | | margin-bottom: 20px; |
| | | margin-bottom: 10px; |
| | | border-radius: 25px; |
| | | justify-content: center; |
| | | align-items: center; |
| | |
| | | } |
| | | .fill-group { |
| | | .p-title { |
| | | height: 34px; |
| | | text-align: left; |
| | | } |
| | | .el-form-item{ |
| | | .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |