ZengTao
2024-01-18 ea46f28356e2acb3bc7cc69b9af3c52fab38c0b0
CanadaMes-ui/src/views/user/index.vue
@@ -123,6 +123,9 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('ElectricalPassword')" prop="dianqimima"  v-if="editUserForm.username === 'admin'">
        <el-input   v-model="editUserForm.dianqimima"></el-input>
      </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editDialogVisible = false">{{ $t('langCancel') }}</el-button>
@@ -134,7 +137,7 @@
<script>
import { getById, removeById, saveOrUpdate, selectPage, resetPass } from "../../api/user";
import { getById, removeById, saveOrUpdate, selectPage, resetPass,currentUsername } from "../../api/user";
import { select } from "../../api/role";
import LanguageMixin from '../../lang/LanguageMixin'
@@ -174,11 +177,8 @@
        password: [
          { required: true, message: '请输入密码', trigger: 'blur' },
          { min: 5, max: 15, message: '长度在 5 到 15 个字符', trigger: 'blur' }
        ],
        email: [
          { required: true, message: '请输入邮箱', trigger: 'blur' },
          { type: 'email', message: '请输入正确格式的邮箱地址', trigger: 'blur' }
        ]
      },
      // 控制添加用户弹框的显示和隐藏
      addDialogVisible: false,
@@ -193,6 +193,8 @@
  },
  created () {
    this.getUserList();
    this.getyonghu();
  },
  methods: {
    getUserList () {
@@ -239,6 +241,7 @@
        const successMessage = this.$t('updateSuccessMessage');
        this.$message.success(successMessage);
      });
    },
    resetPassword (info) {
  this.$confirm(this.$t('confirmResetPassword'), this.$t('resetPassword'), {
@@ -265,6 +268,14 @@
    this.roleList = res.data;
  });
},
getyonghu () {
  currentUsername().then(res => {
   console.log(res)
  });
},
removeUserById (user) {
  // 弹框询问用户是否删除分类
  this.$confirm(this.$t('confirmDeleteCategory'), this.$t('prompt'), {