/*
 * @Author: your name
 * @Date: 2021-12-24 11:36:07
 * @LastEditTime: 2022-01-06 16:38:25
 * @LastEditors: Please set LastEditors
 * @Description: 权限公用
 * @FilePath: \Foshan4A2.0\src\views\authorityManagement\minixs\roleData.js
 */
import { organpop } from '@/api/postInterface'
import { GetGroupByOrgan } from '@/api/authGroupApi'
export default {
  data () {
    return {
      arrs: []
    }
  },
  methods: {
    // 根据组织获取角色
    async getRoleByOrgan (id) {
      try {
        const res = await organpop({
          OrganId: id
        })
        if (res.code === 0) {
          const arr = res.returnData
          this.arrs = arr
        } else {
          this.$message.error(res.message)
        }
      } catch (error) {
        console.log('出错了', error)
      }
    },
    // 根据组织获取角色
    async getGroupByOrgan (id) {
      try {
        const res = await GetGroupByOrgan({
          OrganId: id
        })
        if (res.code === 0) {
          const arr = res.returnData
          this.arrs = arr
        } else {
          this.$message.error(res.message)
        }
      } catch (error) {
        console.log('出错了', error)
      }
    },
  }
}
