| | |
| | | <template> |
| | | <div class="logLog_box"> |
| | | <div class="userInfo_box"> |
| | | <My-bread |
| | | :list="[ |
| | | `${$t('userManage.userManage')}`, |
| | |
| | | :placeholder="$t('operatManage.ELM.usernameInfo')" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item |
| | | :label="$t('userManage.userInfoObj.userStatus')" |
| | | prop="userStatus" |
| | | > |
| | | <el-select |
| | | v-model="form.userStatus" |
| | | :placeholder="$t('userManage.userInfoObj.userStatus')" |
| | | > |
| | | <el-option :label="$t('userManage.userInfoObj.all')" value="all" /> |
| | | <el-option |
| | | :label="$t('userManage.userInfoObj.normal')" |
| | | value="normal" |
| | | /> |
| | | <el-option |
| | | :label="$t('userManage.userInfoObj.disable')" |
| | | value="disable" |
| | | /> |
| | | <el-option |
| | | :label="$t('userManage.userInfoObj.delete')" |
| | | value="delete" |
| | | /> |
| | | <el-option |
| | | :label="$t('userManage.userInfoObj.apply')" |
| | | value="apply" |
| | | /> |
| | | <el-option |
| | | :label="$t('userManage.userInfoObj.rejection')" |
| | | value="rejection" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <el-form-item |
| | | :label="$t('userManage.userInfoObj.depName')" |
| | | prop="depName" |
| | |
| | | <el-input |
| | | v-model="form.depName" |
| | | :placeholder="$t('common.pleaseInput')" |
| | | /> |
| | | /> </el-form-item |
| | | ><el-form-item> |
| | | <el-button @click="onSubmit" |
| | | ><i class="el-icon-search"></i> {{ |
| | | $t("operatManage.ELM.search") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="resetForm('ruleForm')" |
| | | ><i class="el-icon-delete"></i> {{ |
| | | $t("operatManage.ELM.reset") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <br /> |
| | | <el-form-item> |
| | |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item style="margin-left: 60%"> |
| | | <el-button @click="onSubmit" size="mini" |
| | | ><i class="el-icon-search"></i> {{ |
| | | $t("operatManage.ELM.search") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="resetForm('ruleForm')" size="mini" |
| | | <el-button type="danger" size="small" @click="showAddDialog" |
| | | ><i class="el-icon-delete"></i> {{ |
| | | $t("operatManage.ELM.reset") |
| | | $t("common.delete") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | |
| | | stripe |
| | | border |
| | | style="width: 100%" |
| | | max-height="99%" |
| | | height="99%" |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | | type="index" |
| | | :label="$t('common.index')" |
| | | width="70px" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="uname" |
| | | width="150px" |
| | | :label="$t('userManage.userInfoObj.uname')" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="pwd" |
| | | :label="$t('userManage.userInfoObj.pwd')" |
| | | /> |
| | | |
| | | <el-table-column |
| | | align="center" |
| | | prop="sex" |
| | | width="80px" |
| | | :label="$t('userManage.userInfoObj.sex')" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | <el-table-column |
| | | align="center" |
| | | prop="natives" |
| | | width="100px" |
| | | :label="$t('userManage.userInfoObj.natives')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="depName" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.depName')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="idcard" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.idcard')" |
| | | /><el-table-column |
| | | align="center" |
| | | prop="job" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.job')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="edu" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.edu')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="addr" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.addr')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="email" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.email')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="contact" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.contact')" |
| | | /> |
| | | |
| | |
| | | <el-table-column |
| | | align="center" |
| | | prop="bak" |
| | | width="200px" |
| | | :label="$t('userManage.userInfoObj.bak')" |
| | | /> |
| | | <el-table-column :label="$t('common.operate')" fixed="right"> |
| | | <template #default> |
| | | <el-table-column |
| | | :label="$t('common.operate')" |
| | | width="200px" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <!-- <el-button type="primary" size="small">修改</el-button> --> |
| | | |
| | | <el-button type="warning" size="mini">{{ |
| | | $t("common.edit") |
| | | }}</el-button> |
| | | <el-button type="danger" size="mini">{{ |
| | | $t("common.delete") |
| | | }}</el-button> |
| | | <el-button |
| | | type="warning" |
| | | @click="editInfo(scope.row)" |
| | | size="mini" |
| | | >{{ $t("common.edit") }}</el-button |
| | | > |
| | | <el-button type="danger" @click="editPwd(scope.row)" size="mini"> |
| | | 重置密码 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div style="margin-top: 40px" class="pagination_box"> |
| | | <div style="margin-top: 25px" class="pagination_box"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="10" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="1" |
| | | :total="count" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | width="500px" |
| | | top="7vh" |
| | | title="修改信息" |
| | | :visible.sync="dialogFormVisible" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-form :model="ruleForm" ref="ruleForm" :rules="rules"> |
| | | <el-form-item prop="name" label="用户名" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.uname" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="性别" :label-width="formLabelWidth"> |
| | | <!-- <el-input v-model="ruleForm.sex" autocomplete="off"></el-input> --> |
| | | <el-select v-model="ruleForm.sex" clearable placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in sexOpt" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="籍贯" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.natives" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="单位名称" :label-width="formLabelWidth"> |
| | | <el-input |
| | | v-model="ruleForm.depName" |
| | | disabled |
| | | autocomplete="off" |
| | | ></el-input> |
| | | |
| | | <el-button type="primary" size="mini" @click="showDep" |
| | | >选择</el-button |
| | | > |
| | | <el-card v-if="showDepTree" shadow="hover" class="box-card"> |
| | | <div slot="header" class="clearfix"> |
| | | <span>请选择部门</span> |
| | | <el-button |
| | | style="float: right; padding: 3px 0" |
| | | type="text" |
| | | @click="sendNode" |
| | | >确定</el-button |
| | | > |
| | | </div> |
| | | <div class="depTreeBox"> |
| | | <el-tree |
| | | ref="tree" |
| | | :props="defaultProps" |
| | | node-key="id" |
| | | :data="depList" |
| | | :expand-on-click-node="false" |
| | | :default-expand-all="true" |
| | | @node-click="handleNodeClick" |
| | | > |
| | | <span class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <span>{{ node.label }}</span> |
| | | </span> |
| | | </el-tree> |
| | | </div> |
| | | </el-card> |
| | | </el-form-item> |
| | | <el-form-item label="证件号" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.idcard" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="工作" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.job" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="教育" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.edu" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="地址" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.addr" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="电子邮件" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.email" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系方式" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.contact" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="状态" :label-width="formLabelWidth"> |
| | | <el-select v-model="ruleForm.status" clearable placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in statusOpt" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.bak" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button size="medium" @click="cancelEdit('ruleForm')" |
| | | >取消</el-button |
| | | > |
| | | <el-button |
| | | size="medium" |
| | | type="primary" |
| | | @click="sendEdit('ruleForm')" |
| | | v-loading.fullscreen.lock="fullscreenLoading" |
| | | >提交</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import { queryPageUser } from "../../api/api"; |
| | | import { |
| | | queryDepTree, |
| | | queryPageUser, |
| | | insertUser, |
| | | deleteUser, |
| | | updateUser, |
| | | updateUserPwd, |
| | | } from "../../api/api"; |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | | components: { |
| | |
| | | }, |
| | | data() { |
| | | let validName = (rule, value, callback) => { |
| | | if (value === "") { |
| | | return callback(new Error("目录名称不能为空")); |
| | | if (value === "" || value === null || value === undefined) { |
| | | return callback(new Error("名称不能为空")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | return { |
| | | currentPage: 1, |
| | | defaultProps: { |
| | | children: "children", |
| | | label: "name", |
| | | }, |
| | | form: { |
| | | username: "", |
| | | userStatus: "all", |
| | | requestIp: "", |
| | | // userStatus: "all", |
| | | depName: "", |
| | | }, |
| | | showDepTree: true, |
| | | tableData: [], |
| | | fullscreenLoading: false, |
| | | itemdetail: {}, |
| | | formLabelWidth: "170px", |
| | | newDep: { |
| | | name: "", |
| | | id: null, |
| | | }, |
| | | count: 0, |
| | | formLabelWidth: "100px", |
| | | dialogFormVisible: false, |
| | | ruleForm: { |
| | | level: null, |
| | | orderNum: null, |
| | | pid: null, |
| | | name: "", |
| | | descr: "", |
| | | uname: "", |
| | | pwd: "", |
| | | sex: "", |
| | | natives: "", |
| | | depName: "", |
| | | idcard: "", |
| | | job: "", |
| | | edu: "", |
| | | addr: "", |
| | | email: "", |
| | | contact: "", |
| | | status: "", |
| | | bak: "", |
| | | depid: null, |
| | | }, |
| | | statusOpt: [ |
| | | { |
| | | value: 0, |
| | | label: "正常", |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "禁用", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "删除", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "申请", |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: "拒批", |
| | | }, |
| | | ], |
| | | depList: [], |
| | | sexOpt: [ |
| | | { |
| | | value: 0, |
| | | label: "女", |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: "男", |
| | | }, |
| | | { |
| | | value: -1, |
| | | label: "未知", |
| | | }, |
| | | ], |
| | | rules: { |
| | | name: [{ validator: validName, trigger: "blur" }], |
| | | }, |
| | |
| | | // queryMaxId().then((res) => { |
| | | // this.id = res.data; |
| | | // }); |
| | | queryDepTree().then((res) => { |
| | | if (res.code == 200) { |
| | | this.depList = this.treeData(res.result); |
| | | } else { |
| | | this.$notify.error({ |
| | | title: res.code, |
| | | message: "无法获取单位列表", |
| | | }); |
| | | } |
| | | }); |
| | | queryPageUser({ |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.tableData = res.result; |
| | | this.count = res.count; |
| | | } else { |
| | | console.log("接口报错"); |
| | | } |
| | | }); |
| | | }, |
| | | // getUserInfo() { |
| | | // //获取目录树最大ID,新建节点使用 |
| | | // // queryMaxId().then((res) => { |
| | | // // this.id = res.data; |
| | | // // }); |
| | | // queryDepTree().then((res) => { |
| | | // if (res.status == 200) { |
| | | // this.depList = this.treeData(res.data.result); |
| | | // this.oriData = res.data.result; |
| | | // this.newData = res.data.result; |
| | | // } else { |
| | | // console.log("接口报错"); |
| | | // } |
| | | // }); |
| | | // }, |
| | | |
| | | treeData(source) { |
| | | let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆 |
| | | return cloneData.filter((father) => { |
| | | // 循环所有项 |
| | | let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据 |
| | | branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值 |
| | | return father.pid == 0; // 返回一级菜单 |
| | | }); |
| | | }, |
| | | showDep() { |
| | | this.showDepTree = true; |
| | | }, |
| | | handleNodeClick(data) { |
| | | this.newDep.name = data.name; |
| | | this.newDep.id = data.id; |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | | }, |
| | |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | editInfo(row) { |
| | | delete row.updateTime; |
| | | delete row.updateUser; |
| | | this.ruleForm = row; |
| | | this.dialogFormVisible = true; |
| | | }, |
| | | editPwd(row) { |
| | | console.log(row.id + "---" + row.pwd); |
| | | }, |
| | | sendNode() { |
| | | this.showDepTree = false; |
| | | this.ruleForm.depName = this.newDep.name; |
| | | this.ruleForm.depid = this.newDep.id; |
| | | }, |
| | | handleClose(done) { |
| | | this.$confirm("确认关闭?") |
| | | .then((_) => { |
| | | done(); |
| | | }) |
| | | .catch((_) => {}); |
| | | }, |
| | | sendEdit(){ |
| | | |
| | | }, |
| | | showAddDialog() { |
| | | this.dialogTableVisible = true; |
| | |
| | | </style> |
| | | <style lang="less" scoped> |
| | | //@import url(); 引入公共css类 |
| | | .logLog_box { |
| | | .userInfo_box { |
| | | background: rgb(240, 242, 245); |
| | | border-radius: 10px; |
| | | height: 100%; |
| | |
| | | } |
| | | } |
| | | .table_box { |
| | | height: 65%; |
| | | height: 70%; |
| | | padding: 10px; |
| | | background: #fff; |
| | | border-radius: 5px; |
| | | border: 1px solid rgb(202, 201, 204); |
| | | } |
| | | .text-center { |
| | | text-align: center; |
| | | .el-dialog { |
| | | .el-form-item { |
| | | margin-bottom: 12px; |
| | | width: 100%; |
| | | } |
| | | .box-card { |
| | | position: absolute; |
| | | z-index: 100; |
| | | top: -243px; |
| | | left: 450px; |
| | | height: 800px; |
| | | width: 350px; |
| | | /deep/ .el-card__body { |
| | | height: 85%; |
| | | overflow: auto; |
| | | } |
| | | |
| | | // background-color: #bfa; |
| | | } |
| | | .depTreeBox { |
| | | overflow: hidden; |
| | | |
| | | .el-tree { |
| | | background: transparent; |
| | | font-size: 15px; |
| | | font-family: Microsoft YaHei; |
| | | font-weight: 400; |
| | | color: #000000; |
| | | /deep/ .el-tree-node { |
| | | padding-top: 10px; |
| | | // padding-bottom: 10px; |
| | | } |
| | | /deep/ .el-tree-node:focus > .el-tree-node__content { |
| | | background-color: #b9b9b9; |
| | | } |
| | | /deep/ .el-tree-node__content:hover { |
| | | background-color: rgb(153, 153, 153); |
| | | } |
| | | .btnBox { |
| | | margin: 0 10px 0 5px; |
| | | .el-button + .el-button { |
| | | margin-left: 5px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .select { |
| | | width: 300px; |
| | | /deep/ .el-dialog__body { |
| | | padding: 30px 0 0 0; |
| | | } |
| | | } |
| | | /deep/ .el-card__header { |
| | | padding: 10px 10px !important; |
| | | } |
| | | /deep/ .el-dialog { |
| | | margin-top: 2vh !important; |
| | | } |
| | | /deep/ .el-dialog__wrapper { |
| | | overflow: hidden !important; |
| | | } |
| | | |
| | | // /deep/ .el-card__header { |
| | | // padding: 10px 10px !important; |
| | | // } |
| | | // /deep/ .el-dialog { |
| | | // margin-top: 2vh !important; |
| | | // } |
| | | // /deep/ .el-dialog__wrapper { |
| | | // overflow: hidden !important; |
| | | // } |
| | | </style> |