index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <bs-table v-bind="tableOptions">
  3. <template #toolbarTop>
  4. <div class="tool-bar-top">
  5. <bs-tab-bar :tab-list="tabList" mode="capsule" v-model:active-key="activeKey"/>
  6. <a-button type="primary">
  7. <template #icon>
  8. <PlusSquareOutlined />
  9. </template>
  10. <span>添加竞争对手</span>
  11. </a-button>
  12. </div>
  13. </template>
  14. </bs-table>
  15. </template>
  16. <script setup lang="jsx">
  17. import { useBsTable, BsTable, BsTabBar } from '/@/components/BsUi/index.js';
  18. import { h, onMounted, ref } from 'vue';
  19. import { message } from 'ant-design-vue';
  20. import { BorderOuterOutlined, SearchOutlined, PlusSquareOutlined } from '@ant-design/icons-vue';
  21. import { DISPLAY_STATE } from '/@/components/BsUi/constant.js';
  22. const activeKey = ref("tab1");
  23. const tabList = ref([
  24. {
  25. label: '客户投资',
  26. key: 'tab1',
  27. },
  28. {
  29. label: '竞争对手',
  30. key: 'tab2',
  31. },
  32. {
  33. label: '历史项目报价',
  34. key: 'tab3',
  35. },
  36. ]);
  37. const {
  38. tableOptions,
  39. setTablePropsValue: setValue,
  40. getTablePropsValue: getValue,
  41. } = useBsTable({
  42. tableOptions: {
  43. toolbarTopConfig: {
  44. enable: true,
  45. },
  46. gridOptions: {
  47. loading: false,
  48. columns: [
  49. {
  50. type: 'seq',
  51. width: 80,
  52. },
  53. {
  54. title: "竞争对手",
  55. field: "name1",
  56. width: 150,
  57. },
  58. {
  59. title: "报价管理",
  60. field: "name2",
  61. width: 150,
  62. },
  63. {
  64. title: "单位类型",
  65. field: "name3",
  66. width: 150,
  67. },
  68. {
  69. title: "注册资本(元)",
  70. field: "name4",
  71. width: 150,
  72. },
  73. {
  74. title: "注册日期",
  75. field: "name5",
  76. width: 150,
  77. },
  78. {
  79. title: "员工人数",
  80. field: "name6",
  81. width: 150,
  82. },
  83. {
  84. title: "资源管理",
  85. field: "name7",
  86. width: 150,
  87. },
  88. {
  89. title: "优势分析",
  90. field: "name8",
  91. width: 150,
  92. },
  93. {
  94. title: "劣势分析",
  95. field: "name8",
  96. width: 150,
  97. },
  98. {
  99. title: "备注说明",
  100. field: "name9",
  101. width: 150,
  102. },
  103. {
  104. title: "添加人",
  105. field: "name10",
  106. width: 150,
  107. },
  108. {
  109. title: "添加时间",
  110. field: "name11",
  111. width: 150,
  112. },
  113. {
  114. // fixed: 'right',
  115. cellRender: {
  116. name: 'CellOption',
  117. extraProps: {
  118. buttons: [
  119. {
  120. title: '编辑',
  121. code: 'edit',
  122. display: ({ row }) => {
  123. return DISPLAY_STATE.VISIBLE;
  124. },
  125. disabled({ row }) {
  126. return false;
  127. },
  128. onClick({ row }) {},
  129. extraProps: {},
  130. },
  131. {
  132. title: '删除',
  133. code: 'delete',
  134. display: ({ row }) => {
  135. return DISPLAY_STATE.VISIBLE;
  136. },
  137. disabled({ row }) {
  138. return false;
  139. },
  140. onClick({ row }) {},
  141. extraProps: {},
  142. },
  143. ],
  144. },
  145. },
  146. },
  147. ],
  148. data: [], // 模拟数据源
  149. },
  150. searchConfig: {
  151. enable: false,
  152. },
  153. pagerConfig: {
  154. enable: false,
  155. },
  156. toolbarConfig: {
  157. enable: false,
  158. },
  159. },
  160. });
  161. </script>
  162. <style scoped lang="scss">
  163. .tool-bar-top {
  164. width: 100%;
  165. display: flex;
  166. align-items: center;
  167. justify-content: space-between;
  168. }
  169. </style>