<template>
  <div class="panel">
    <div class="left">
      <div class="title">插入笔记</div>
      <div class="left-content">
        <InsertNote
          ref="InsertNote"
          @insertText="handleInsertText"
          @handleOpenAddUpdateDialog="handleOpenAddUpdateDialog"
        />
      </div>
    </div>
    <div class="close">
      <i class="el-icon-close"></i>
    </div>
  </div>
</template>

<script>
import InsertNote from "./insertNote.vue";
export default {
  name: "rightPanel",
  components: {
    InsertNote,
  },
  data() {
    return {
    };
  },
  methods: {
    // 获取笔记
    loadNoteData() {
      this.$refs.InsertNote.loadData();
    },
    //插入文字
    handleInsertText(value) {
      this.$emit("handleInsertText", value);
    },
    // 打开编辑笔记对话框
    handleOpenAddUpdateDialog(item) {
      this.$emit("handleOpenAddUpdateDialog", item);
    },
  },
};
</script>

<style lang="scss" scoped>
.panel {
  display: flex;
  padding: 20px 0;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  .left {
    padding-right: 16px;
    width: 100%;
    .title {
      font-weight: bold;
      display: flex;
      justify-content: center;
      margin-bottom: 16px;
    }
    .left-content {
    }
  }
  .right {
    margin-top: 20px;
    width: 66px;
    .tabs {
      .tab-item {
        text-align: center;
        padding: 14px;
        background-color: #eee;
        color: #666;
        cursor: pointer;
        transition: all ease 0.3s;
        &:hover {
          background-color: $theme-blue;
          color: #fff;
        }
      }
      .active {
        background-color: $theme-blue;
        color: #fff;
      }
    }
  }
  .close {
    position: absolute;
    right: 20px;
    top: 20px;
    i {
      font-size: 24px;
    }
  }
}
</style>
