From bbb6565e8a5989a2ba16c4f051c92659cd964dfa Mon Sep 17 00:00:00 2001 From: liuguocan <527956374@qq.com> Date: 星期二, 14 三月 2023 14:18:22 +0800 Subject: [PATCH] 登录配置校验 --- src/views/system/user/index.vue | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index a3f4872..63b646b 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -425,7 +425,7 @@ // 鏌ヨ鍙傛暟 queryParams: { pageNum: 1, - pageSize: 10, + pageSize: 15, userName: undefined, phonenumber: undefined, status: undefined, @@ -498,10 +498,18 @@ ); }, /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ - getTreeselect() { - treeselect(this.queryParams.deptId).then(response => { + getTreeselect(deptId) { + // treeselect(this.queryParams.deptId).then(response => { + // this.deptOptions = response.data; + // }); + if(deptId == undefined || deptId == ""){ + this.$modal.alert("璇烽�夋嫨涓�涓儴闂�"); + return false; + } + treeselect(deptId).then(response => { this.deptOptions = response.data; }); + return true; }, // 2022-12-08锛屽姞杞介《绾ф満鏋勬爲鍒楄〃 @@ -594,7 +602,9 @@ // this.$modal.msgSuccess("璇峰厛閫夋嫨涓�涓《绾ф満鏋�"); // return; // } - this.getTreeselect(); + if(!this.getTreeselect(this.queryParams.deptId)){ + return; + } // getUser().then(response => { getNewUserRoles(this.queryParams.deptId).then(response => { // this.postOptions = response.posts; @@ -603,11 +613,12 @@ this.title = "娣诲姞鐢ㄦ埛"; this.form.password = this.initPassword; }); + }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.reset(); - this.getTreeselect(); + // this.getTreeselect(); // const userId = row.id || this.ids; const userId = row.id; getUser(userId).then(response => { @@ -619,6 +630,7 @@ this.open = true; this.title = "淇敼鐢ㄦ埛"; this.form.password = ""; + this.getTreeselect(this.form.dept_id); }); }, /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */ @@ -678,7 +690,7 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - this.download('system/user/export', { + this.$download('system/user/export', { ...this.queryParams }, `user_${new Date().getTime()}.xlsx`) }, @@ -690,7 +702,7 @@ /** 涓嬭浇妯℃澘鎿嶄綔 */ importTemplate() { // this.download('system/user/select/downloadTemplate', {}, `user_template_${new Date().getTime()}.xlsx`); - this.download('system/user/select/downloadTemplate', {}, `user_template.xlsx`); + this.$download('system/user/select/downloadTemplate', {}, `user_template.xlsx`); }, // 鏂囦欢涓婁紶涓鐞� handleFileUploadProgress(event, file, fileList) { -- Gitblit v1.9.1