<template>
  <el-dialog v-model="visible" width="1200" align-center>
    <template #header="{ close, titleId, titleClass }">
      <div class="flex-align-center justify-between gap-8 mb-10">
        <span class="fs-18">{{ title }}</span>
        <el-button type="primary">确认{{ modalType === 1 ? '角色' : modalType === 2 ? '场景' : '道具' }}</el-button>
      </div>
    </template>
    <div class="pb-10">
      <div class="mb-10 fs-12">当前主图</div>
      <div class="rounded-10 h-400 flex-center" style="background-color: #f9fafb;">
        <img src="https://res.volccdn.com/obj/volc-console-fe/dramart/static/image/PIC3.22e42366.png"
          class="h-b100 img rounded-10" alt="">
      </div>
      <div class="mt-20 editbox pt-20 h-200">
        <RichTextEditor style="width: 768px;" class="mx-auto"/>
      </div>
    </div>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import RichTextEditor from './RichTextEditor.vue'

const props = defineProps({
  title: {
    type: String,
    default: '新增',
  },
})

const visible = ref(false)
const imageUrl = ref('')
const modalType = ref(1) // 1:角色 2:场景 3:道具
const open = (val: number) => {
  modalType.value = val
  visible.value = true
}
const close = () => {
  visible.value = false
}
defineExpose({ open })
</script>
<style lang="scss" scoped>
.cirir {
  border: 1px solid #ccc;
}

.avatar-uploader {
  width: 100%;

  :deep(.el-upload) {
    border: 2px dashed #ddd;
    width: 100%;
    height: 240px;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;

    &:hover {
      border-color: #c5c5c5;
    }
  }
}

.editbox {
  border-top: 1px solid #ddd;
}
</style>