| | |
| | | </template> |
| | | |
| | | <template #menu="{row,index,size}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">编辑</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">删除</el-button> |
| | | <el-button size="small" type="text" @click.stop="stopUserHandler(row)"> |
| | | <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text" |
| | | @click.stop="rowEditHandler(row,index)">编辑 |
| | | </el-button> |
| | | <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text" |
| | | @click.stop="rowDeleteHandler(row)">删除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.stopActionBtn" size="small" type="text" @click.stop="stopUserHandler(row)"> |
| | | <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> 停用</span> |
| | | <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-play"></i> 启用</span> |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">删除</el-button> |
| | | <el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">分配角色</el-button> |
| | | <el-button icon="el-icon-school" plain size="small" type="primary" @click="departmentHandler">分配部门</el-button> |
| | | <el-button icon="el-icon-key" plain size="small" type="success" @click="setPwsHandler">设置密码策略</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">导入人员</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">下载导入模板</el-button> |
| | | <el-button v-if="permissionList.editBtn" icon="el-icon-delete" plain size="small" type="danger" |
| | | @click="allDelHandler">删除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.assigningRolesBtn" icon="el-icon-user" plain size="small" type="primary" |
| | | @click="roleHandler">分配角色 |
| | | </el-button> |
| | | <el-button v-if="permissionList.distributionDepartmentBtn" icon="el-icon-school" plain size="small" |
| | | type="primary" @click="departmentHandler">分配部门 |
| | | </el-button> |
| | | <el-button v-if="permissionList.setPasswordPolicyBtn" icon="el-icon-key" plain size="small" type="success" |
| | | @click="setPwsHandler">设置密码策略 |
| | | </el-button> |
| | | <el-button v-if="permissionList.importPersonnelBtn" icon="el-icon-upload2" plain size="small" type="primary" |
| | | @click="uploadUser">导入人员 |
| | | </el-button> |
| | | <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small" |
| | | type="primary" @click="downloadHandler">下载导入模板 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | |
| | | class="avue-dialog" |
| | | style="margin-top: -15vh !important;" |
| | | title="设置密码策略" |
| | | width="30%" |
| | | width="500px" |
| | | > |
| | | |
| | | <div class="password-strategy-container"> |
| | | <div><i class="el-icon-setting"/>设置密码策略:</div> |
| | | <el-select v-model="pwdValue" placeholder="请选择密码策略"> |
| | | <div style="width:115px;"><i class="el-icon-setting"/>设置密码策略:</div> |
| | | <el-select v-model="pwdValue" placeholder="请选择密码策略" style="width: 330px;"> |
| | | <el-option v-for="(item,index) in pwdList" :key="index" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- 导入人员 --> |
| | | <upload-file ref="upload" :tipList="tipList" :fileType="upFileType" :fileUrl="fileUrl" title="导入人员" @updata="getTableList"></upload-file> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入人员" |
| | | @updata="getTableList"></upload-file> |
| | | |
| | | <!-- 分配部门对话框 --> |
| | | <el-dialog |
| | |
| | | } from '@/api/system/user/api' |
| | | import {column} from "./option" |
| | | import func from '@/util/func' |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "userManage", |
| | | data: function () { |
| | | return { |
| | | departSearchObj:{}, |
| | | departSearchValue:'', |
| | | departSearchObj: {}, |
| | | departSearchValue: '', |
| | | loadKey: 0, |
| | | departStatus: '', // 区分不同方式打开部门对话框 |
| | | departCurrenRow: {}, |
| | | departOption: { |
| | | ...basicOption, |
| | | addBtn:false, |
| | | addBtn: false, |
| | | rowKey: 'oid', |
| | | rowParentKey: 'parentId', |
| | | selection: false, |
| | |
| | | menu: false, |
| | | refreshBtn: false, |
| | | gridBtn: false, |
| | | header:false, |
| | | header: false, |
| | | column: [ |
| | | { |
| | | label: '名称', |
| | | prop: 'name', |
| | | align:'left' |
| | | align: 'left' |
| | | }, |
| | | { |
| | | label: '编号', |
| | |
| | | pwdList: [], |
| | | tableLoading: false, |
| | | tableData: [], |
| | | option: { |
| | | ...basicOption, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | dialogWidth: '50%', |
| | | calcHeight: -60, |
| | | column: column |
| | | }, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | |
| | | leftRoleData: [], // 分配角色穿梭框左侧初始数据 |
| | | rightRoleData: [], // 分配角色穿梭框右侧初始数据 |
| | | transferTitle: ['现有角色', '拥有角色'], |
| | | tipList:["导入模板中标明红色字体的为必输项","部门列上下级关系必须按照反斜杠隔开(/)"], |
| | | lastIndex:null, |
| | | tipList: ["导入模板中标明红色字体的为必输项", "部门列上下级关系必须按照反斜杠隔开(/)"], |
| | | lastIndex: null, |
| | | } |
| | | }, |
| | | created() { |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), |
| | | delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | assigningRolesBtn: this.vaildData(this.permission[this.$route.query.id].assigningRoles, false), |
| | | distributionDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].distributionDepartment, false), |
| | | downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].downloadImportTemplate, false), |
| | | importPersonnelBtn: this.vaildData(this.permission[this.$route.query.id].importPersonnel, false), |
| | | setPasswordPolicyBtn: this.vaildData(this.permission[this.$route.query.id].setPasswordPolicy, false), |
| | | stopActionBtn: this.vaildData(this.permission[this.$route.query.id].stopAction, false), |
| | | }; |
| | | }, |
| | | option() { |
| | | return { |
| | | ...basicOption, |
| | | addBtn: this.permissionList.addBtn, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | dialogWidth: '50%', |
| | | calcHeight: -60, |
| | | column: column |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // 表格请求 |
| | |
| | | this.tableLoading = true; |
| | | getDataUsers(this.page.currentPage, this.page.pageSize, this.searchParams).then(res => { |
| | | const data = res.data.data; |
| | | data.map(item => {item.secretGrade = item.secretGrade.toString()}) |
| | | this.tableData = data; |
| | | this.page.total = res.data.total; |
| | | this.tableLoading = false; |
| | | this.tableLoading = false;s |
| | | }) |
| | | this.departmentQueryOnLoad() |
| | | }, |
| | |
| | | stopUser(params).then(res => { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }); |
| | | }, |
| | | |
| | | // 选择框 |
| | |
| | | row, |
| | | this.$refs.userCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = [row]; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | |
| | | listRoleByUserOid(userOid).then(res => { |
| | | this.rightRoleData = res.data.data.map(item => item.oid); |
| | | }) |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }); |
| | | this.$refs.transfer.visible = true; |
| | | }, |
| | | |
| | |
| | | saveRights(params).then(res => { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }); |
| | | }, |
| | | |
| | | // 设置密码策略 |
| | |
| | | saveUserPasswordStrateg(params).then(res => { |
| | | this.pwdVisible = false; |
| | | this.$message.success(res.data.obj) |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }); |
| | | }, |
| | | |
| | | // 新增 |
| | | rowSaveHandler(row, done,loading) { |
| | | rowSaveHandler(row, done, loading) { |
| | | if (row.password != row.confirmPassword) { |
| | | this.$message.error('请检查两次密码是否输入一致!') |
| | | return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; |
| | |
| | | }, |
| | | |
| | | // 编辑 |
| | | rowUpdateHandler(row, index, done,loading) { |
| | | rowUpdateHandler(row, index, done, loading) { |
| | | if (row.password != row.confirmPassword) { |
| | | this.$message.error('请检查两次密码是否输入一致!') |
| | | return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; |
| | |
| | | departmentQueryController({queryAllLevel: true}).then(res => { |
| | | const data = res.data.treeData; |
| | | this.departData = this.departDtaFormAtter(data); |
| | | this.option.column[7].dicData=[{oid:'ALLDept',name:'所有部门',expand:true,disabled:true,children:this.departData}] |
| | | this.option.column[7].defaultExpandedKeys=['ALLDept']; |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | this.option.column[7].dicData = [{ |
| | | oid: 'ALLDept', |
| | | name: '所有部门', |
| | | expand: true, |
| | | disabled: true, |
| | | children: this.departData |
| | | }] |
| | | this.option.column[7].defaultExpandedKeys = ['ALLDept']; |
| | | }); |
| | | }, |
| | | |
| | | // 分配部门数据转换 |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | .password-strategy-container { |
| | | padding-left: 20px; |
| | | margin-bottom: 20px; |
| | | display: flex; |
| | | //justify-content: center; |
| | | align-items: center; |