business-main.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="business-main-com">
  3. <div class="business-main-com_expend __hover" :class="{'business-main-com_expend-not': !expend}" @click="expend = !expend"></div>
  4. <div class="business-main-com_content __box-shadow __background-grid" v-show="expend">
  5. <div class="business-main-com_content-head">
  6. {{title}}
  7. <div class="close __hover">
  8. <SvgIcon name="close_2" size="18" @click="$router.push('/gis/index')"/>
  9. </div>
  10. </div>
  11. <slot/>
  12. </div>
  13. </div>
  14. </template>
  15. <script lang="ts">
  16. import {
  17. defineComponent,
  18. computed,
  19. onMounted,
  20. ref,
  21. reactive,
  22. watch,
  23. getCurrentInstance,
  24. ComponentInternalInstance,
  25. toRefs,
  26. nextTick
  27. } from 'vue'
  28. import {useStore} from 'vuex'
  29. import {useRouter, useRoute} from 'vue-router'
  30. import {ElMessage, ElMessageBox} from "element-plus";
  31. export default defineComponent({
  32. name: '',
  33. components: {},
  34. props: {
  35. title: {}
  36. },
  37. setup(props, {emit}) {
  38. const store = useStore();
  39. const router = useRouter();
  40. const route = useRoute();
  41. const that = (getCurrentInstance() as ComponentInternalInstance).appContext.config.globalProperties
  42. const state = reactive({
  43. expend: true
  44. })
  45. onMounted(() => {
  46. })
  47. return {
  48. ...toRefs(state),
  49. }
  50. },
  51. })
  52. </script>
  53. <style scoped lang="scss">
  54. .business-main-com {
  55. position: fixed;
  56. left: 10px;
  57. top: 10px;
  58. width: auto;
  59. height: calc(100% - 20px);
  60. .business-main-com_expend {
  61. width: 20px;
  62. height: 116px;
  63. background-image: url("@/assets/images/gis-business/business-main_expend.png");
  64. background-repeat: no-repeat;
  65. background-size: 100% 100%;
  66. position: absolute;
  67. top: calc((100% - 116px) / 2);
  68. right: -19px;
  69. &.business-main-com_expend-not {
  70. position: fixed;
  71. left: 0;
  72. }
  73. }
  74. .business-main-com_content {
  75. width: 100%;
  76. height: 100%;
  77. display: flex;
  78. flex-direction: column;
  79. .business-main-com_content-head {
  80. height: 54px;
  81. width: 100%;
  82. position: relative;
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. font-size: 24px;
  87. font-family: Microsoft YaHei;
  88. font-weight: bold;
  89. color: #0096FF;
  90. &:after {
  91. content: '';
  92. width: 387px;
  93. height: 32px;
  94. background-image: url("@/assets/images/gis-business/business-main_head.png");
  95. background-repeat: no-repeat;
  96. background-size: 100% 100%;
  97. position: absolute;
  98. bottom: 0;
  99. }
  100. .close {
  101. position: absolute;
  102. right: 15px;
  103. top: 13px;
  104. z-index: 2;
  105. width: 18px;
  106. height: 18px;
  107. display: flex;
  108. }
  109. }
  110. }
  111. }
  112. </style>