<template>
  <MDialog ref="menuDialog" title="数据权限编辑" @sure="handleSave">
    <MForm ref="menuForm">
      <el-form-item label="角色名称">
        <el-tag>{{ item.roleName }}</el-tag>
      </el-form-item>
    </MForm>
  </MDialog>
</template>

<script>
import { saveDataPermission } from '@/api/menu'
export default {
  name: 'role-data',
  data () {
    return {
      item: {}
    }
  },
  methods: {
    open (item) {
      this.item = item
      this.$refs.menuDialog.open()
    },
    async handleSave () {
      try {
        await saveDataPermission({
          roleId: this.item.id
          // menuIds: menuIds.join(',')
        })
        this.$message.success('保存成功')
        this.$emit('refresh')
      } catch (error) {
        this.$message.error(error)
      }
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
