bottom.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. console.log(item);
  60. }
  61. return { list, selectMenu };
  62. }
  63. export default defineComponent({
  64. name: 'layout-top',
  65. components: {
  66. CapitalInfo,
  67. firstMenu,
  68. quoteTable,
  69. thirdMenu,
  70. },
  71. setup() {
  72. const { list, selectMenu } = handleMenu();
  73. return {
  74. columns,
  75. data,
  76. list,
  77. selectMenu,
  78. };
  79. },
  80. });
  81. </script>
  82. <style lang="less">
  83. .layout-bottom {
  84. display: flex;
  85. width: 100%;
  86. overflow: hidden;
  87. .capital-info-container {
  88. width: 180px;
  89. }
  90. main {
  91. max-width: calc(100% - 180px);
  92. flex: 1;
  93. .flex;
  94. flex-direction: column;
  95. background: rgb(14, 14, 15);
  96. position: relative;
  97. .conditionIcon {
  98. font-size: 16px;
  99. color: @m-grey1;
  100. width: 16px;
  101. height: 16px;
  102. line-height: 16px;
  103. cursor: pointer;
  104. .position(absolute, 8px, 14px, auto, auto);
  105. z-index: 2;
  106. &:hover {
  107. color: rgba(@m-grey1, 0.8);
  108. }
  109. }
  110. }
  111. }
  112. </style>