index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <div class="drawer">
  3. <a-drawer :placement="placement"
  4. :closable="false"
  5. :visible="visible"
  6. class="top"> <!-- 摘牌是top 挂牌是bottom -->
  7. <div class="collapse"
  8. @click="cancel"></div>
  9. <div class="collapseCont">
  10. <div class="title">{{ title }}</div>
  11. <div class="content">
  12. <!-- <Listed></Listed> -->
  13. <Delisting></Delisting>
  14. </div>
  15. </div>
  16. </a-drawer>
  17. </div>
  18. </template>
  19. <script lang="ts">
  20. import { defineComponent, ref, PropType } from 'vue';
  21. import { closeModal, ModalName } from '@/setup/controlModal/index';
  22. import Listed from '@/views/market/warehouseTrade/components/listed/index.vue';
  23. import Delisting from '@/views/market/warehouseTrade/components/delisting/index.vue';
  24. interface Key {
  25. [propName: string]: string;
  26. }
  27. export default defineComponent({
  28. name: 'drawer',
  29. props: {
  30. modalName: {
  31. default: 'drawer',
  32. type: String as PropType<keyof ModalName>,
  33. },
  34. title: {
  35. default: '',
  36. type: String,
  37. },
  38. placement: {
  39. // 需要绑定的值得 key
  40. default: 'right',
  41. type: String,
  42. },
  43. },
  44. components: {
  45. Listed,
  46. Delisting
  47. },
  48. setup(props, context) {
  49. const { visible, cancel, handleOk } = closeModal(props.modalName);
  50. return {
  51. visible,
  52. cancel,
  53. };
  54. },
  55. });
  56. </script>
  57. <style lang="less">
  58. .bottom {
  59. .position(fixed, auto, 0, -2px, auto);
  60. width: 586px;
  61. height: 330px;
  62. background: transparent;
  63. }
  64. .top {
  65. .position(fixed, 116px, 0, auto, auto);
  66. width: 446px;
  67. height: 350px;
  68. background: transparent;
  69. }
  70. .ant-drawer.ant-drawer-open {
  71. .ant-drawer-mask {
  72. background: transparent;
  73. }
  74. .ant-drawer-content-wrapper {
  75. width: 586px !important;
  76. box-shadow: none;
  77. .ant-drawer-content {
  78. background: transparent;
  79. .ant-drawer-wrapper-body {
  80. overflow: hidden;
  81. .ant-drawer-body {
  82. width: 100%;
  83. height: 100%;
  84. padding: 0;
  85. .inlineflex;
  86. .collapse {
  87. width: 26px;
  88. height: 66px;
  89. margin-top: 15px;
  90. background: url(../../assets/images/dialogClose.png) center center no-repeat;
  91. background-size: cover;
  92. }
  93. .collapseCont {
  94. flex: 1;
  95. height: 100%;
  96. border: 2px solid @m-blue0;
  97. border-right: 0;
  98. .flex;
  99. flex-direction: column;
  100. .title {
  101. width: 100%;
  102. height: 36px;
  103. line-height: 36px;
  104. text-align: center;
  105. background: linear-gradient(0deg, @m-blue4, @m-blue5);
  106. font-size: 16px;
  107. color: @m-white1;
  108. border-bottom: 2px solid @m-blue0;
  109. }
  110. .content {
  111. flex: 1;
  112. width: 100%;
  113. max-height: calc(100% - 36px);
  114. overflow-y: auto;
  115. background: @m-grey11;
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122. }
  123. </style>;