<template>
  <div class="business-main-com">
    <div class="business-main-com_expend __hover" :class="{'business-main-com_expend-not': !expend}" @click="expend = !expend"></div>
    <div class="business-main-com_content __box-shadow __background-grid" v-show="expend">
      <div class="business-main-com_content-head">
        {{title}}
        <div class="close __hover">
          <SvgIcon name="close_2" size="18" @click="$router.push('/gis/index')"/>
        </div>
      </div>
      <slot/>
    </div>
  </div>
</template>

<script lang="ts">
import {
  defineComponent,
  computed,
  onMounted,
  ref,
  reactive,
  watch,
  getCurrentInstance,
  ComponentInternalInstance,
  toRefs,
  nextTick
} from 'vue'
import {useStore} from 'vuex'
import {useRouter, useRoute} from 'vue-router'
import {ElMessage, ElMessageBox} from "element-plus";

export default defineComponent({
  name: '',
  components: {},
  props: {
    title: {}
  },
  setup(props, {emit}) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
    const state = reactive({
      expend: true
    })
    onMounted(() => {
    })
    return {
      ...toRefs(state),
    }
  },
})
</script>

<style scoped lang="scss">
.business-main-com {
  position: fixed;
  left: 10px;
  top: 10px;
  width: auto;
  height: calc(100% - 20px);
  .business-main-com_expend {
    width: 20px;
    height: 116px;
    background-image: url("@/assets/images/gis-business/business-main_expend.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    position: absolute;
    top: calc((100% - 116px) / 2);
    right: -19px;
    &.business-main-com_expend-not {
      position: fixed;
      left: 0;
    }
  }
  .business-main-com_content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    .business-main-com_content-head {
      height: 54px;
      width: 100%;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      color: #0096FF;
      &:after {
        content: '';
        width: 387px;
        height: 32px;
        background-image: url("@/assets/images/gis-business/business-main_head.png");
        background-repeat: no-repeat;
        background-size: 100% 100%;
        position: absolute;
        bottom: 0;
      }
      .close {
        position: absolute;
        right: 15px;
        top: 13px;
        z-index: 2;
        width: 18px;
        height: 18px;
        display: flex;
      }
    }
  }
}


</style>
