<template>
  <n-drawer v-bind="getDrawerOptions" @update:show="handleDrawerColse">
    <n-drawer-content closable title="疑似问题核实">
      <QuestionPage :data="getMission" />
    </n-drawer-content>
  </n-drawer>
</template>

<script>
import QuestionPage from '@/views/task-manage/question/index.vue'
import { defineComponent, computed } from 'vue'

export default defineComponent({
  name: 'LiveDrawer',
  components: { QuestionPage },
  props: {
    /* 可见 */
    visible: {
      type: Boolean,
      default: false
    },
    /* 选中的数据 */
    data: {
      type: Object,
      default: () => {}
    }
  },
  emits: {
    'update:visible': null
  },
  setup(props, { emit }) {
    /* 获取抽屉的信息 */
    const getDrawerOptions = computed(() => {
      return {
        show: props.visible,
        width: '100%',
        placement: 'right'
      }
    })
    /* 获取选中的数据 */
    const getMission = computed(() => {
      return props.data
    })
    function handleDrawerColse() {
      emit('update:visible', false)
    }

    return {
      getDrawerOptions,
      getMission,
      handleDrawerColse
    }
  }
})
</script>

<style scoped lang='scss'>
.n-button+.n-button{
  margin-left: 30px;
}
</style>
