bottom.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <section class="layout-bottom">
  3. <CapitalInfo class="capital-info-container"></CapitalInfo>
  4. <main>
  5. <div class="conditionIcon icon iconfont icon-shouqi"></div>
  6. <firstMenu :list="list" :value="'value'" @selectMenu="selectMenu" />
  7. <quoteTable :columns="columns" :dataSource="data" />
  8. <thirdMenu></thirdMenu>
  9. </main>
  10. </section>
  11. </template>
  12. <script lang="ts">
  13. import { defineComponent } from 'vue';
  14. import CapitalInfo from '@/common/components/capitalInfo/index.vue';
  15. import firstMenu from '@/common/components/firstMenu/index.vue';
  16. import thirdMenu from '@/common/components/thirdMenu/index.vue';
  17. import quoteTable from '@/common/components/quoteTable/index.vue';
  18. import { MenuItem } from '@/common/components/contextMenu/interface';
  19. const columns = [
  20. { title: '序号', width: 100, dataIndex: 'name', key: 'name', fixed: 'left', align: 'center' },
  21. { title: '品种', width: 100, dataIndex: 'age', key: 'age', fixed: 'left', align: 'center' },
  22. { title: '种类', dataIndex: 'address', key: '1', width: 200, align: 'center' },
  23. { title: '品牌', dataIndex: 'address', key: '2', width: 200, align: 'center' },
  24. { title: '数量', dataIndex: 'address', key: '3', width: 200, align: 'center' },
  25. { title: '价格', dataIndex: 'address', key: '4', width: 200, align: 'center' },
  26. { title: '仓库', dataIndex: 'address', key: '5', width: 200, align: 'center' },
  27. { title: '所在地', dataIndex: 'address', key: '6', width: 200, align: 'center' },
  28. { title: '挂牌方', dataIndex: 'address', key: '7', width: 'auto', align: 'center' },
  29. // {
  30. // title: 'Action',
  31. // key: 'operation',
  32. // fixed: 'right',
  33. // align: 'center',
  34. // width: 100,
  35. // slots: { customRender: 'action' },
  36. // },
  37. ];
  38. interface DataItem {
  39. key: number;
  40. name: string;
  41. age: number;
  42. address: string;
  43. }
  44. const data: DataItem[] = [];
  45. for (let i = 0; i < 100; i++) {
  46. data.push({
  47. key: i,
  48. name: `Edrward ${i}`,
  49. age: 32,
  50. address: `London Park no. ${i}`,
  51. });
  52. }
  53. function handleMenu() {
  54. const list = [
  55. { key: '1', value: '仓单贸易' },
  56. { key: '2', value: '拍卖' },
  57. ];
  58. function selectMenu(item: any) {}
  59. return { list, selectMenu };
  60. }
  61. export default defineComponent({
  62. name: 'layout-top',
  63. components: {
  64. CapitalInfo,
  65. firstMenu,
  66. quoteTable,
  67. thirdMenu,
  68. },
  69. setup() {
  70. const { list, selectMenu } = handleMenu();
  71. return {
  72. columns,
  73. data,
  74. list,
  75. selectMenu,
  76. };
  77. },
  78. });
  79. </script>
  80. <style lang="less">
  81. .layout-bottom {
  82. display: flex;
  83. width: 100%;
  84. height: 330px;
  85. overflow: hidden;
  86. .capital-info-container {
  87. width: 180px;
  88. }
  89. main {
  90. max-width: calc(100% - 180px);
  91. flex: 1;
  92. .flex;
  93. flex-direction: column;
  94. background: rgb(14, 14, 15);
  95. position: relative;
  96. .conditionIcon {
  97. font-size: 16px;
  98. color: @m-grey1;
  99. width: 16px;
  100. height: 16px;
  101. line-height: 16px;
  102. cursor: pointer;
  103. .position(absolute, 8px, 14px, auto, auto);
  104. z-index: 2;
  105. &:hover {
  106. color: rgba(@m-grey1, 0.8);
  107. }
  108. }
  109. }
  110. }
  111. </style>