pengwei
2025-04-27 366612bd8e8b88d02a98edf508f96d7add23ff9f
ÏîÄ¿´úÂë/client/src/views/tts/UserManagement/Usermanagement.vue
@@ -200,7 +200,11 @@
            <template #default="scope">
              <el-switch
                :disabled="
                  scope.row.userName == 'admin' || scope.row.user_Id == '1'
                  userInfo.userName == 'admin' || userInfo.roleId == '1'
                    ? scope.row.userName == 'admin' || scope.row.user_Id == '1'
                    : scope.row.userName == 'admin' ||
                      scope.row.user_Id == '1' ||
                      scope.row.userName != userInfo.userName
                "
                v-model="scope.row.enable"
                :active-value="1"
@@ -221,17 +225,13 @@
                size="small"
                type="text"
                @click="Edit(scope.row)"
                :disabled="
                  scope.row.userName == 'admin' || scope.row.user_Id == '1'
                "
                :disabled="scope.row.isdisabled"
                >编辑</el-button
              >
              <el-button
                size="small"
                type="text"
                :disabled="
                  scope.row.userName == 'admin' || scope.row.user_Id == '1'
                "
                :disabled="scope.row.isdisabled"
                @click="Editpassword(scope.row)"
                >修改密码</el-button
              >
@@ -239,9 +239,7 @@
                size="small"
                type="text"
                @click="deletUser(scope.row)"
                :disabled="
                  scope.row.userName == 'admin' || scope.row.user_Id == '1'
                "
                :disabled="scope.row.isdisabled"
                >删除</el-button
              >
            </template>
@@ -275,7 +273,11 @@
            <template #default="scope">
              <span
                v-if="
                  scope.row.roleName != '超级管理员' || scope.row.roleId != '1'
                  !(userInfo.userName == 'admin' || userInfo.roleId == '1'
                    ? scope.row.userName == 'admin' || scope.row.user_Id == '1'
                    : scope.row.userName == 'admin' ||
                      scope.row.user_Id == '1' ||
                      scope.row.userName != userInfo.userName)
                "
                @click="toDetail(scope.row)"
                style="color: #4386ff; cursor: pointer"
@@ -288,7 +290,7 @@
            <template #default="scope">
              <el-switch
                :disabled="
                  scope.row.roleName == '超级管理员' || scope.row.roleId == '1'
                  !(userInfo.userName == 'admin' || userInfo.roleId == '1')
                "
                v-model="scope.row.enable"
                :active-value="1"
@@ -302,7 +304,11 @@
            <template #default="scope">
              <span
                v-if="
                  scope.row.roleName != '超级管理员' || scope.row.roleId != '1'
                  !(userInfo.userName == 'admin' || userInfo.roleId == '1'
                    ? scope.row.userName == 'admin' || scope.row.user_Id == '1'
                    : scope.row.userName == 'admin' ||
                      scope.row.user_Id == '1' ||
                      scope.row.userName != userInfo.userName)
                "
                style="color: blue; font-size: 0.88rem; cursor: pointer"
                @click="EditRole(scope.row)"
@@ -452,7 +458,7 @@
                size="small"
              >
                <el-option
                  :disabled="item.roleId == 20"
                  :disabled="item.roleId == 1"
                  v-for="item in groupOptions"
                  :key="item.roleId"
                  :label="item.roleName"
@@ -847,7 +853,7 @@
  id: undefined,
  username: "",
  phoneno: "",
  roleid: 21,
  roleid: 2,
  rolename: "",
  enable: 1,
  path: "",
@@ -893,6 +899,7 @@
const dialogVisible = ref(false);
const imgdialogVisible = ref(false);
const dialogImageUrl = ref("");
const userInfo = ref();
//用户信息修改密码弹出框
const dialogVisible1 = ref(false);
//用户角色新建
@@ -979,7 +986,17 @@
    startDate: startTime,
    endDate: endTime,
  }).then((res) => {
    tableData.value = res.data.items;
    tableData.value = res.data.items.map((item) => {
      return {
        ...item,
        isdisabled:
          userInfo.value.userName == "admin" || userInfo.value.roleId == "1"
            ? item.userName == "admin" || item.user_Id == "1"
            : item.userName == "admin" ||
              item.user_Id == "1" ||
              item.userName != userInfo.value.userName,
      };
    });
    pageTotal.value = res.data.totalCount;
  });
};
@@ -1072,7 +1089,7 @@
  formUser.value = {
    username: "",
    phoneno: "",
    roleid: 21,
    roleid: 2,
    rolename: "",
    enable: 1,
    path: "",
@@ -1406,15 +1423,16 @@
const toDetail = (row) => {
  router.push({ name: "permission", state: { info: JSON.stringify(row) } });
};
onMounted(() => {
  initData();
  getRole();
  userInfo.value = JSON.parse(localStorage.getItem("user"));
});
</script>
<style lang="scss" scoped>
.Usermanagement {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  .content {
@@ -1555,6 +1573,7 @@
    text-align: center;
  }
}
:deep(.hide .el-upload--picture-card) {
  display: none;
}