| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
|
| | | import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
|
| | | import { getToken } from "@/utils/auth";
|
| | | import { treeselect } from "@/api/system/dept";
|
| | | import Treeselect from "@riophae/vue-treeselect";
|
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
| | |
|
| | |
| | | },
|
| | | created() {
|
| | | this.getList();
|
| | | this.getTreeselect();
|
| | | this.getDeptTree();
|
| | | this.getConfigKey("sys.user.initPassword").then(response => {
|
| | | this.initPassword = response.msg;
|
| | | });
|
| | |
| | | );
|
| | | },
|
| | | /** 查询部门下拉树结构 */
|
| | | getTreeselect() {
|
| | | treeselect().then(response => {
|
| | | getDeptTree() {
|
| | | deptTreeSelect().then(response => {
|
| | | this.deptOptions = response.data;
|
| | | });
|
| | | },
|
| | |
| | | /** 新增按钮操作 */
|
| | | handleAdd() {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | getUser().then(response => {
|
| | | this.postOptions = response.posts;
|
| | | this.roleOptions = response.roles;
|
| | |
| | | /** 修改按钮操作 */
|
| | | handleUpdate(row) {
|
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | const userId = row.userId || this.ids;
|
| | | getUser(userId).then(response => {
|
| | | this.form = response.data;
|