index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="drawer">
  3. <a-drawer
  4. :placement="placement"
  5. :closable="false"
  6. :visible="visible"
  7. class="bottomListed"
  8. height="406px"
  9. >
  10. <!-- 摘牌是top 挂牌是bottom 期货交易是tradeDialog -->
  11. <div class="collapse" @click="cancel">
  12. <DoubleRightOutlined />
  13. </div>
  14. <div class="collapseCont">
  15. <div class="title">{{ title }}</div>
  16. <div class="content highContent">
  17. <!-- <Listed></Listed> -->
  18. <!-- <Delisting></Delisting> -->
  19. <slot></slot>
  20. <!-- <Trade></Trade> -->
  21. </div>
  22. </div>
  23. </a-drawer>
  24. </div>
  25. </template>
  26. <script lang="ts">
  27. import { defineComponent, ref, PropType } from 'vue';
  28. import { closeModal, ModalName } from '@/common/setup/modal/index';
  29. import Listed from '@/views/market/warehouseTrade/components/listed/index.vue';
  30. import Delisting from '@/views/market/warehouseTrade/components/delisting/index.vue';
  31. import Trade from '@/views/market/warehouseTrade/components/trade/index.vue';
  32. import { _closeModal } from '@/common/setup/modal/modal';
  33. import { DoubleRightOutlined } from '@ant-design/icons-vue';
  34. interface Key {
  35. [propName: string]: string;
  36. }
  37. export default defineComponent({
  38. name: 'drawer',
  39. emits: ['cancel'],
  40. props: {
  41. modalName: {
  42. default: 'drawer',
  43. type: String as PropType<keyof ModalName>,
  44. },
  45. title: {
  46. default: '',
  47. type: String,
  48. },
  49. placement: {
  50. // 需要绑定的值得 key
  51. default: 'right',
  52. type: String,
  53. },
  54. },
  55. components: {
  56. Listed,
  57. Delisting,
  58. Trade,
  59. DoubleRightOutlined,
  60. },
  61. setup(props, context) {
  62. const { visible, cancel } = _closeModal(context);
  63. // const { visible, cancel } = closeModal(props.modalName);
  64. return {
  65. visible,
  66. cancel,
  67. };
  68. },
  69. });
  70. </script>
  71. <style lang="less">
  72. .bottom {
  73. .position(fixed, auto, 0, -2px, auto);
  74. width: 586px;
  75. height: 330px;
  76. background: transparent;
  77. z-index: 10;
  78. .ant-drawer-content-wrapper {
  79. width: 586px !important;
  80. }
  81. }
  82. .top {
  83. .position(fixed, 116px, 0, auto, auto);
  84. width: 446px;
  85. height: 350px;
  86. background: transparent;
  87. z-index: 10;
  88. .ant-drawer-content-wrapper {
  89. width: 446px !important;
  90. }
  91. }
  92. .tradeDialog {
  93. .position(fixed, 116px, 0, auto, auto);
  94. width: 467px;
  95. height: 310px;
  96. background: transparent;
  97. z-index: 10;
  98. .ant-drawer-content-wrapper {
  99. width: 467px !important;
  100. }
  101. }
  102. .collapse {
  103. width: 52px;
  104. height: 38px;
  105. cursor: pointer;
  106. .position(absolute, 0, auto, auto, 0);
  107. z-index: 11;
  108. text-align: center;
  109. line-height: 38px;
  110. .anticon {
  111. color: @m-blue10;
  112. font-weight: bold;
  113. }
  114. }
  115. .ant-drawer.ant-drawer-open {
  116. .ant-drawer-mask {
  117. background: transparent;
  118. }
  119. .ant-drawer-content-wrapper {
  120. box-shadow: none;
  121. .ant-drawer-content {
  122. background: transparent;
  123. .ant-drawer-wrapper-body {
  124. overflow: hidden;
  125. .ant-drawer-body {
  126. width: 100%;
  127. height: 100%;
  128. padding: 0;
  129. .inlineflex;
  130. .collapseCont {
  131. flex: 1;
  132. height: 100%;
  133. // border: 8px solid @m-blue5;
  134. // border-right: 0;
  135. .flex;
  136. flex-direction: column;
  137. .title {
  138. width: 100%;
  139. height: 38px;
  140. line-height: 38px;
  141. text-align: center;
  142. background: linear-gradient(0deg, @m-blue4, @m-blue5);
  143. font-size: 16px;
  144. color: @m-white1;
  145. // border-bottom: 2px solid @m-blue0;
  146. .rounded-corners(5px, 5px, 0, 0);
  147. }
  148. .content {
  149. flex: 1;
  150. width: 100%;
  151. max-height: calc(100% - 36px);
  152. overflow-y: auto;
  153. overflow-x: hidden;
  154. background: @m-grey11;
  155. border: 8px solid @m-blue5;
  156. border-top: 0;
  157. }
  158. .highContent {
  159. max-height: 100%;
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. }
  167. .ant-form.inlineForm .ant-row.ant-form-item .ant-form-item-label label {
  168. width: 90px;
  169. }
  170. .ant-drawer.ant-drawer-bottom.ant-drawer-open.bottomListed {
  171. .position(fixed, auto, 0, 0, auto);
  172. width: 566px;
  173. height: 406px !important;
  174. background: transparent;
  175. z-index: 10;
  176. .ant-drawer-content-wrapper {
  177. width: 566px !important;
  178. }
  179. }
  180. </style>