<template>
  <el-dialog title="一键导入" :visible="visible" width="1000px" top="85px" :show-close="false" @close="dialogClose">
    <el-input v-model="text" type="textarea" resize="none" placeholder="输入内容" />
    <template slot="footer">
      <el-button size="medium" @click="dialogClose">取消</el-button>
      <el-button type="primary" size="medium" @click="confirm">确定</el-button>
    </template>
  </el-dialog>
</template>

<script>
export default {
  name: 'ImportPage',
  props: {
    visible: {
      type: Boolean,
      required: true,
    },
  },
  data() {
    return {
      text: '',
    };
  },
  methods: {
    dialogClose() {
      this.$emit('update:visible', false);
    },
    confirm() {
      this.$emit('update:visible', false);
      this.$emit('oneKeyImport', this.text);
    },
  },
};
</script>

<style lang="scss" scoped>
.el-dialog__wrapper {
  :deep .el-dialog {
    display: flex;
    flex-direction: column;
    height: 756px;

    &__header {
      padding: 24px 16px 0;
    }

    &__body {
      flex: 1;
      padding: 16px;

      .el-textarea {
        height: 100%;

        textarea {
          height: 100%;
          color: #000;
        }
      }
    }
  }
}
</style>
