| | |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false), |
| | | importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false), |
| | | downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false), |
| | | downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOAD, false), |
| | | viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].VIRTUALVIEW, false), |
| | | }; |
| | | }, |
| | |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false), |
| | | importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false), |
| | | actionTopAddBtn: this.vaildData(this.permission[this.$route.query.id].USE, false), |
| | | actionTopDelBtn: this.vaildData(this.permission[this.$route.query.id].RESET, false), |
| | | actionTopEditBtn: this.vaildData(this.permission[this.$route.query.id].RECYCLE, false), |
| | | actionTopExportBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false), |
| | | actionBottomAddBtn: this.vaildData(this.permission[this.$route.query.id].FREEZE, false), |
| | | actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].BATCHAPPLY, false), |
| | | actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].CODEAPPLY, false), |
| | | actionTopAddBtn: this.vaildData(this.permission[this.$route.query.id].ADD2, false), |
| | | actionTopDelBtn: this.vaildData(this.permission[this.$route.query.id].DELETE2, false), |
| | | actionTopEditBtn: this.vaildData(this.permission[this.$route.query.id].EDIT2, false), |
| | | actionTopExportBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOAD, false), |
| | | actionBottomAddBtn: this.vaildData(this.permission[this.$route.query.id].ADD3, false), |
| | | actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].DELETE3, false), |
| | | actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].EDIT3, false), |
| | | }; |
| | | }, |
| | | treeCrudOption(){ |
| | |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="display: flex"> |
| | | <i v-if="data.oId=='parentNode'" class="iconShow el-icon-s-home"></i> |
| | | <icon-show v-if="data.oId!='parentNode' && data.iconPath && data.iconPath!='undefined'" :name="data.iconPath"></icon-show> |
| | | <icon-show v-if="data.oId!='parentNode' && data.iconPath && data.iconPath!='undefined'" |
| | | :name="data.iconPath"></icon-show> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | |
| | | </el-radio> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-show="basicForm.show=='0' && (basicForm.displayMode=='image'||basicForm.displayMode=='textandimage')"> |
| | | <el-col |
| | | v-show="basicForm.show=='0' && (basicForm.displayMode=='image'||basicForm.displayMode=='textandimage')" |
| | | :span="24"> |
| | | <el-form-item :class="basicForm.displayMode==='image'?'is-required':''" label="图标:" prop="iconPath"> |
| | | <input-icon v-model="basicForm.iconPath" :disabled="disabledBtn"></input-icon> |
| | | </el-form-item> |
| | |
| | | label: '序号', |
| | | prop: 'seq', |
| | | width: 100, |
| | | type:'number', |
| | | type: 'number', |
| | | labelWidth: 110, |
| | | hide: false, |
| | | rules: [ |
| | |
| | | ...mapGetters(["permission"]), |
| | | permissionChildrenList() { |
| | | return { |
| | | UiPageLayoutAddBtn: this.vaildData(this.permission[this.$route.query.id].CLSRIGHT, false), |
| | | UiPageLayoutEditBtn: this.vaildData(this.permission[this.$route.query.id].DATARIGHT, false), |
| | | UiPageLayoutDelBtn: this.vaildData(this.permission[this.$route.query.id].ATTRRIGHT, false), |
| | | UiPageLayoutAddBtn: this.vaildData(this.permission[this.$route.query.id].ADD3, false), |
| | | UiPageLayoutEditBtn: this.vaildData(this.permission[this.$route.query.id].EDIT3, false), |
| | | UiPageLayoutDelBtn: this.vaildData(this.permission[this.$route.query.id].DELETE3, false), |
| | | UiPageLayoutCloneBtn: this.vaildData(this.permission[this.$route.query.id].CLONE, false), |
| | | UiPageLayoutDesignBtn: this.vaildData(this.permission[this.$route.query.id].UPLOAD, false), |
| | | } |
| | |
| | | ...mapGetters(["permission"]), |
| | | permissionChildrenList() { |
| | | return { |
| | | UiTabAddBtn: this.vaildData(this.permission[this.$route.query.id].BATCHAPPLY, false), |
| | | UiTabEditBtn: this.vaildData(this.permission[this.$route.query.id].BATCHUPDATE, false), |
| | | UiTabDelBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false), |
| | | UiTabAddBtn: this.vaildData(this.permission[this.$route.query.id].ADD2, false), |
| | | UiTabEditBtn: this.vaildData(this.permission[this.$route.query.id].EDIT2, false), |
| | | UiTabDelBtn: this.vaildData(this.permission[this.$route.query.id].DELETE2, false), |
| | | UiTabCloneBtn: this.vaildData(this.permission[this.$route.query.id].CLONE, false), |
| | | } |
| | | } |
| | |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].FREEZE, false), |
| | | departmentAddChildrenBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), |
| | | downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false), |
| | | downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOAD, false), |
| | | importDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].MGR, false), |
| | | statisticsBtn: this.vaildData(this.permission[this.$route.query.id].DISCARD, false), |
| | | }; |
| | |
| | | <template> |
| | | <div> |
| | | <basic-container> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="form" |
| | | :option="option" |
| | | @submit="handleSubmit" |
| | | @tab-click="handleTabClick"> |
| | | <template slot="avatar" slot-scope="{disabled,size}"> |
| | | <div> |
| | | <userAvatar :avatar="form.avatar"/> |
| | | </div> |
| | | </template> |
| | | </avue-form> |
| | | <el-tabs v-model="index" @tab-click="handleTabClick"> |
| | | <el-tab-pane label="个人信息" name="0"> |
| | | <el-form ref="userForm" :model="userForm" :rules="userRules" label-width="90px" size="small"> |
| | | <el-form-item label="头像:"> |
| | | <userAvatar :avatar="userForm.avatar"/> |
| | | </el-form-item> |
| | | <el-form-item label="用户名:"> |
| | | <el-input v-model="userForm.userId" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="姓名:" prop="userName"> |
| | | <el-input v-model="userForm.userName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="当前角色:"> |
| | | <el-input v-model="userForm.personName" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱:"> |
| | | <el-input v-model="userForm.email"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="userSubmit">提交</el-button> |
| | | <el-button @click="handleWitch">清空</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="修改密码" name="1"> |
| | | <el-form ref="passWordForm" :model="passWordForm" :rules="rules" label-width="145px" size="small"> |
| | | <el-form-item label="登陆密码:" prop="oldPassword"> |
| | | <el-input v-model="passWordForm.oldPassword"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="新登陆密码:" prop="password"> |
| | | <el-input v-model="passWordForm.password"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="新密码登陆确认:" prop="confirmPassword"> |
| | | <el-input v-model="passWordForm.confirmPassword"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="passWordSubmit">提交</el-button> |
| | | <el-button @click="handleWitch">清空</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </basic-container> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import option from "@/option/user/info"; |
| | | import { updateUser } from "@/api/system/user/api"; |
| | | import {updateUser} from "@/api/system/user/api"; |
| | | import func from "../../../util/func"; |
| | | import {changePassword} from "../../../api/user" |
| | | import userAvatar from "./userAvatar"; |
| | |
| | | components: {userAvatar,}, |
| | | data() { |
| | | return { |
| | | index: 0, |
| | | index: '0', |
| | | option: option, |
| | | form: {} |
| | | userForm: {}, |
| | | passWordForm: {}, |
| | | userRules: { |
| | | userName: [ |
| | | {required: true, message: '请输入密码', trigger: 'blur'}, |
| | | ], |
| | | }, |
| | | rules: { |
| | | oldPassword: [ |
| | | {required: true, message: '请输入密码', trigger: 'blur'}, |
| | | ], |
| | | password: [ |
| | | {required: true, message: '请输入密码', trigger: 'blur'}, |
| | | ], |
| | | confirmPassword: [ |
| | | {required: true, message: '请输入密码', trigger: 'blur'}, |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.handleWitch(); |
| | | }, |
| | | methods: { |
| | | handleSubmit(form, done) { |
| | | if (this.index === 0) { |
| | | updateUser(form).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "修改信息成功!" |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | done(); |
| | | }, error => { |
| | | done(); |
| | | }) |
| | | } else { |
| | | let userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | let params = { |
| | | userName: userInfo.content.userId, |
| | | oldPassword: func.encryptData(form.oldPassword, 'daliantan0v0vcip'), |
| | | password: func.encryptData(form.password, 'daliantan0v0vcip'), |
| | | confirmPassword: func.encryptData(form.confirmPassword, 'daliantan0v0vcip'), |
| | | |
| | | } |
| | | changePassword(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.passwordVisible = false; |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | resetRouter(); |
| | | this.$router.push({path: "/login"}); |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | } |
| | | }, |
| | | handleWitch() { |
| | | if (this.index === 0) { |
| | | this.form = {...this.userInfo}; |
| | | if (this.index === '0') { |
| | | const {avatar, userId, userName, email, personName} = this.userInfo; |
| | | this.userForm = {avatar, userId, userName, email, personName}; |
| | | } else { |
| | | this.passWordForm = {}; |
| | | this.$refs.passWordForm.clearValidate(); |
| | | } |
| | | }, |
| | | handleTabClick(tabs) { |
| | | this.index = func.toInt(tabs.index); |
| | | this.index = tabs.index |
| | | this.handleWitch(); |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | |
| | | userSubmit() { |
| | | console.log('123') |
| | | this.$refs.userForm.validate((valid) => { |
| | | if (valid) { |
| | | const params = { |
| | | id: this.userInfo.userId, |
| | | name: this.userForm.userName, |
| | | email: this.userForm.email |
| | | } |
| | | updateUser(params).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "修改信息成功!" |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | done(); |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | passWordSubmit() { |
| | | this.$refs.passWordForm.validate((valid) => { |
| | | if (valid) { |
| | | let userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | let params = { |
| | | userName: userInfo.content.userId, |
| | | oldPassword: func.encryptData(this.passWordForm.oldPassword, 'daliantan0v0vcip'), |
| | | password: func.encryptData(this.passWordForm.password, 'daliantan0v0vcip'), |
| | | confirmPassword: func.encryptData(this.passWordForm.confirmPassword, 'daliantan0v0vcip'), |
| | | |
| | | } |
| | | changePassword(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | resetRouter(); |
| | | this.$router.push({path: "/login"}); |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |