Merge branch 'main' of http://192.168.0.56:3000/bonus/bonus-ui
This commit is contained in:
		
						commit
						cb0e01e961
					
				| 
						 | 
				
			
			@ -127,7 +127,7 @@
 | 
			
		|||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
          <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
 | 
			
		||||
            <template slot-scope="scope" v-if="scope.row.userId !== 1 &&  scope.row.isBuiltIn !== '0'">
 | 
			
		||||
            <template slot-scope="scope" v-if="!hasSystemOrAuditrRole(scope.row.roles) && scope.row.userId !== 1 &&  scope.row.isBuiltIn !== '0'">
 | 
			
		||||
              <el-button size="mini" type="text" icon="el-icon-edit" @click="confirmPassword(scope.row)"
 | 
			
		||||
                         v-hasPermi="['system:user:edit']"
 | 
			
		||||
              >修改
 | 
			
		||||
| 
						 | 
				
			
			@ -788,15 +788,24 @@ export default {
 | 
			
		|||
    submitFileForm() {
 | 
			
		||||
      this.$refs.upload.submit()
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    hasSystemOrAuditrRole(roles) {
 | 
			
		||||
      if (!roles || !Array.isArray(roles)) {
 | 
			
		||||
        return false; // 如果 roles 为空或不是数组,返回 false
 | 
			
		||||
      }
 | 
			
		||||
      return roles.some(role => role.roleKey === 'systemAdmin' || role.roleKey === 'audit'); // 检查是否存在 roleKey 为 admin 的角色
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    // 检查行是否可选
 | 
			
		||||
    checkSelectable(row) {
 | 
			
		||||
      return !(row.userId === 1 || row.isBuiltIn === '0');
 | 
			
		||||
      return !(row.userId === 1 || row.isBuiltIn === '0' || this.hasSystemOrAuditrRole(row.roles));
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    getRowClassName(row) {
 | 
			
		||||
      return !this.checkSelectable(row) ? 'disabled-row' : '';
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue