石广澎
2023-11-29 20913c80c3f5fc8e533cb92b90e6f20bcd68e032
admin-web/src/views/systemManger/server/user/editRole.vue
@@ -21,6 +21,7 @@
import myButton from '@/components/myButton/myButton'
import * as role from "@/api/system/role";
import * as user from "@/api/user";
export default {
  components: { win, myButton },
  props: {
@@ -76,15 +77,21 @@
    // 获取所有角色
    getAllRole() {
      const user = this.$store.getters.userInfo
      if (user.lv == 1) {
        this.data_scope = 1
      }
      if (user.lv == 2) {
        this.data_scope = 2
      }
      if (user.lv == 3) {
        this.data_scope = 3
      }
      // debugger
      // if (user == undefined){
      //   this.data_scope = 1
      // } else {
      //   if (user.lv==null|| user.lv== 1) {
      //     this.data_scope = 1
      //   }
      //   if (user.lv && user.lv== 2) {
      //     this.data_scope = 2
      //   }
      //   if (user.lv && user.lv== 3) {
      //     this.data_scope = 3
      //   }
      // }
      this.data_scope = 1
      role.listRoleByDataScope({dataScope: this.data_scope}).then(response => {
            if (response) {
              this.roleOptions = response;