From be5351fe3cc2714756ae43ab272cf8813cb0fe98 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期三, 13 九月 2023 14:47:40 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes --- CanadaMes-ui/src/views/user/index.vue | 152 +++++++++++++++++++++++++------------------------- 1 files changed, 76 insertions(+), 76 deletions(-) diff --git a/CanadaMes-ui/src/views/user/index.vue b/CanadaMes-ui/src/views/user/index.vue index ccff3f2..93aea7e 100644 --- a/CanadaMes-ui/src/views/user/index.vue +++ b/CanadaMes-ui/src/views/user/index.vue @@ -40,7 +40,7 @@ </el-switch> </template> </el-table-column> - <el-table-column label="鎿嶄綔"> + <el-table-column :label="$t('langOperation')"> <template slot-scope="scope"> <el-button type="primary" icon="el-icon-refresh" @click="resetPassword(scope.row)"> @@ -241,84 +241,84 @@ }); }, resetPassword (info) { - this.$confirm('纭閲嶇疆瀵嗙爜涓洪粯璁ゅ�煎悧锛�', '閲嶇疆瀵嗙爜', { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - type: 'warning', - }) - .then(() => { - resetPass(info).then(() => { - this.$message.success('瀵嗙爜宸查噸缃负榛樿鍊�'); - }); - }) - .catch(() => { - // 鐢ㄦ埛鍙栨秷閲嶇疆瀵嗙爜鎿嶄綔 - }); - }, - showEditDialog (id) { - getById({ id: id }).then(res => { - this.editUserForm = res.data; - this.editDialogVisible = true; + this.$confirm(this.$t('confirmResetPassword'), this.$t('resetPassword'), { + confirmButtonText: this.$t('confirm'), + cancelButtonText: this.$t('cancel'), + type: 'warning', + }) + .then(() => { + resetPass(info).then(() => { + this.$message.success(this.$t('passwordResetSuccess')); }); + }) + .catch(() => { + // 鐢ㄦ埛鍙栨秷閲嶇疆瀵嗙爜鎿嶄綔 + }); +}, +showEditDialog (id) { + getById({ id: id }).then(res => { + this.editUserForm = res.data; + this.editDialogVisible = true; + }); + select().then(res => { + this.roleList = res.data; + }); +}, +removeUserById (user) { + // 寮规璇㈤棶鐢ㄦ埛鏄惁鍒犻櫎鍒嗙被 + this.$confirm(this.$t('confirmDeleteCategory'), this.$t('prompt'), { + confirmButtonText: this.$t('confirm'), + cancelButtonText: this.$t('cancel'), + type: 'warning' + }).then(() => { + removeById({ id: user.id }).then(() => { + // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃 + this.getUserList(); + this.$message.success(this.$t('userDeleteSuccess')); + }); + }).catch(() => { + this.$message.info(this.$t('deleteCanceled')); + }); +}, +handleSizeChange (newSize) { + this.queryInfo.pageSize = newSize; + this.getUserList() +}, +handleCurrentChange (newPage) { + this.queryInfo.pageNum = newPage; + this.getUserList() +}, +addDialogClosed () { + this.$refs['addUserRef'].resetFields(); +}, +addUser () { + this.$refs.addUserRef.validate(async valid => { + if (!valid) return; + saveOrUpdate(this.addUserForm).then(() => { + const successMessage = this.$t('addUserSuccess'); + this.$message.success(successMessage); + // 闅愯棌娣诲姞鍒嗙被瀵硅瘽妗� + this.addDialogVisible = false; + // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃 + this.getUserList(); + }); + }) +}, +editUserInfo () { + this.$refs.addCategoryRef.validate(async valid => { + if (!valid) return; - select().then(res => { - this.roleList = res.data; - }); - }, - removeUserById (user) { - // 寮规璇㈤棶鐢ㄦ埛鏄惁鍒犻櫎鍒嗙被 - this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ュ垎绫�, 鏄惁缁х画?', '鎻愮ず', { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - type: 'warning' - }).then(() => { - removeById({ id: user.id }).then(() => { - // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃 - this.getUserList(); - this.$message.success("鍒犻櫎鐢ㄦ埛鎴愬姛"); - }); - }).catch(() => { - this.$message.info('宸插彇娑堝垹闄�'); - }); - }, - handleSizeChange (newSize) { - this.queryInfo.pageSize = newSize; - this.getUserList() - }, - handleCurrentChange (newPage) { - this.queryInfo.pageNum = newPage; - this.getUserList() - }, - addDialogClosed () { - this.$refs['addUserRef'].resetFields(); - }, - addUser () { - this.$refs.addUserRef.validate(async valid => { - if (!valid) return; - saveOrUpdate(this.addUserForm).then(() => { - this.$message.success("娣诲姞鐢ㄦ埛鎴愬姛"); - // 闅愯棌娣诲姞鍒嗙被瀵硅瘽妗� - this.addDialogVisible = false; - // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃 - this.getUserList(); - }); - }) - }, - editUserInfo () { - this.$refs.addCategoryRef.validate(async valid => { - if (!valid) return; - - saveOrUpdate(this.editUserForm).then(() => { - const 淇敼鐢ㄦ埛鎴愬姛 = this.$t('淇敼鐢ㄦ埛鎴愬姛'); - this.$message.success(淇敼鐢ㄦ埛鎴愬姛); - // 闅愯棌娣诲姞鍒嗙被瀵硅瘽妗� - this.editDialogVisible = false; - // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃 - this.getUserList(); - }); - }) - } + saveOrUpdate(this.editUserForm).then(() => { + const successMessage = this.$t('editUserSuccess'); + this.$message.success(successMessage); + // 闅愯棌娣诲姞鍒嗙被瀵硅瘽妗� + this.editDialogVisible = false; + // 閲嶆柊鑾峰彇鍒嗙被鍒楄〃 + this.getUserList(); + }); + }) +} } } </script> -- Gitblit v1.8.0