<script lang="ts">
export default { name: 'AppMain' }
</script>

<script setup lang="ts">
import PreviewFiles from '@/components/base/PreviewFiles.vue'
import AppBreadcrumb from './Breadcrumb.vue'
withDefaults(defineProps<{ hasBreadcrumb?: boolean }>(), {
  hasBreadcrumb: true
})

const dialogVisible = ref(false)
</script>

<template>
  <section class="app-main">
    <div class="app-main-inner">
      <div class="app-main-header">
        <app-breadcrumb v-if="hasBreadcrumb"></app-breadcrumb>
      </div>
      <div class="app-main-container">
        <router-view></router-view>
      </div>
    </div>
  </section>
  <div class="manual-btn" @click="dialogVisible = true">
    <img src="/center_resource/course.png" />
  </div>
  <el-dialog v-model="dialogVisible" title="使用手册" width="852px">
    <PreviewFiles url="/center_resource/使用手册.doc"></PreviewFiles>
  </el-dialog>
</template>

<style>
.manual-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 50%;
  right: 0;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 1px 3px 12px rgba(0, 0, 0, 0.11);
  border-radius: 50%;
  z-index: 999999;
}
.app-main {
  position: relative;
  flex: 1;
  padding: 20px;
  overflow: hidden;
}
.app-main-inner {
  margin: 0 auto;
}
.app-main-container::after {
  content: '';
  display: table;
  clear: both;
}
.el-form--label-top .el-form-item__label {
  padding-bottom: 0;
}
</style>
