check-list1.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <hc-card>
  3. <template #header>
  4. 111
  5. </template>
  6. <template #extra>
  7. 222
  8. </template>
  9. <div class="relative h-full flex">
  10. <div :id="`hc_tree_card_${uuid}`">
  11. <hc-card-item scrollbar>
  12. <hc-lazy-tree :h-props="treeProps" @load="treeLoadNode" />
  13. </hc-card-item>
  14. </div>
  15. <div :id="`hc_table_card_${uuid}`" class="flex-1">
  16. <hc-card-item>
  17. <template #header>
  18. <div class="font-400 text-orange">收方总金额:0元</div>
  19. </template>
  20. <template #extra>
  21. <el-button hc-btn color="#626aef">
  22. <HcIcon name="sort-desc" :line="false" />
  23. <span>按部位排序</span>
  24. </el-button>
  25. <el-button hc-btn color="#626aef">
  26. <HcIcon name="sort-desc" :line="false" />
  27. <span>按录入时间排序</span>
  28. </el-button>
  29. </template>
  30. <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check @selection-change="tableCheckChange">
  31. <template #action="{ row }">
  32. <el-link type="primary" @click="giveTaskModalClick(row)">下达</el-link>
  33. <el-link type="success">修改</el-link>
  34. <el-link type="danger">删除</el-link>
  35. </template>
  36. </hc-table>
  37. <template #action>
  38. <hc-pages :pages="searchForm" @change="pageChange" />
  39. </template>
  40. </hc-card-item>
  41. </div>
  42. </div>
  43. </hc-card>
  44. </template>
  45. <script setup>
  46. import { nextTick, onMounted, ref } from 'vue'
  47. import { getRandom } from 'js-fast-way'
  48. defineOptions({
  49. name: 'DebitPayAdminApply',
  50. })
  51. const uuid = getRandom(4)
  52. //渲染完成
  53. onMounted(() => {
  54. setSplitRef()
  55. })
  56. //初始化设置拖动分割线
  57. const setSplitRef = () => {
  58. //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
  59. nextTick(() => {
  60. window.$split(['#hc_tree_card_' + uuid, '#hc_table_card_' + uuid], {
  61. sizes: [20, 80],
  62. snapOffset: 0,
  63. minSize: [50, 500],
  64. })
  65. })
  66. }
  67. //搜索表单
  68. const searchForm = ref({
  69. key1: null, current: 1, size: 10, total: 0,
  70. })
  71. //数据格式
  72. const treeProps = {
  73. label: 'name',
  74. children: 'children',
  75. isLeaf: 'leaf',
  76. }
  77. //懒加载的数据
  78. const treeLoadNode = ({ level }, resolve) => {
  79. if (level === 0) {
  80. return resolve([{ name: 'region' }])
  81. }
  82. if (level > 3) {
  83. return resolve([])
  84. }
  85. setTimeout(() => {
  86. resolve([
  87. { name: 'leaf', leaf: true },
  88. { name: 'zone' },
  89. ])
  90. }, 500)
  91. }
  92. //分页
  93. const pageChange = ({ current, size }) => {
  94. searchForm.value.current = current
  95. searchForm.value.size = size
  96. }
  97. //表格数据
  98. const tableLoading = ref(false)
  99. const tableColumn = ref([
  100. { key: 'key1', name: '收方单编号' },
  101. { key: 'key2', name: '收方期' },
  102. { key: 'key3', name: '工程划分部位' },
  103. { key: 'key4', name: '收方金额' },
  104. { key: 'key5', name: '业务日期' },
  105. { key: 'key6', name: '审核状态' },
  106. { key: 'action', name: '操作', width: 200, align: 'center' },
  107. ])
  108. const tableData = ref([
  109. { key1: '1111' },
  110. ])
  111. //表格选择
  112. const tableCheckChange = () => {
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. </style>