land.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <HcPageLayout>
  3. <template #left>
  4. <div class="hc-layout-tree-box">
  5. <el-scrollbar>
  6. <HcTreeData @nodeTap="treeNodeTap"/>
  7. </el-scrollbar>
  8. </div>
  9. </template>
  10. <HcCard>
  11. <template #header>
  12. <div class="w-52">
  13. <el-input v-model="searchForm.queryValue" clearable placeholder="请输入名称进行查询" size="large"/>
  14. </div>
  15. <div class="ml-4">
  16. <el-button type="primary" @click="searchClick" size="large">
  17. <HcIcon name="search-2"/>
  18. <span>搜索</span>
  19. </el-button>
  20. </div>
  21. </template>
  22. <template #extra>
  23. <el-button size="large" type="primary" hc-btn @click="addRowClick">
  24. <HcIcon name="add"/>
  25. <span>新增</span>
  26. </el-button>
  27. <el-button size="large" type="warning" hc-btn>
  28. <HcIcon name="add"/>
  29. <span>打印</span>
  30. </el-button>
  31. <el-button size="large" type="danger" hc-btn>
  32. <HcIcon name="delete-bin"/>
  33. <span>删除</span>
  34. </el-button>
  35. </template>
  36. <HcTable :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck @selection-change="tableSelectionChange">
  37. <template #action="{row,index}">
  38. <el-button size="small" type="primary" @click="editRowClick(row)">修改</el-button>
  39. <el-button size="small" type="warning">查看</el-button>
  40. <el-button size="small" type="danger">删除</el-button>
  41. </template>
  42. </HcTable>
  43. <template #action>
  44. <HcPages :pages="searchForm" @change="pageChange"/>
  45. </template>
  46. </HcCard>
  47. </HcPageLayout>
  48. </template>
  49. <script setup>
  50. import {ref} from "vue";
  51. import {useRouter} from 'vue-router'
  52. const router = useRouter()
  53. //树节点被点击
  54. const treeNodeTap = ({node, data}) => {
  55. }
  56. //搜索表单
  57. const searchForm = ref({
  58. projectType: null, queryValue: null, startTime: null, endTime: null,
  59. current: 1, size: 20, total: 0
  60. })
  61. //搜索
  62. const searchClick = () => {
  63. searchForm.value.current = 1;
  64. getTableData()
  65. }
  66. //分页被点击
  67. const pageChange = ({current, size}) => {
  68. searchForm.value.current = current
  69. searchForm.value.size = size
  70. getTableData()
  71. }
  72. //获取数据
  73. const tableLoading = ref(false)
  74. const tableColumn = [
  75. {key: 'key1', name: '协议编号'},
  76. {key: 'key2', name: '协议书名称'},
  77. {key: 'key3', name: '地类补偿金额'},
  78. {key: 'key4', name: '青苗及附着物补偿金额'},
  79. {key: 'key5', name: '补偿总金额'},
  80. {key: 'action', name: '操作', width: '190', align: 'center'},
  81. ]
  82. const tableData = ref([
  83. {id: 1, key1: 'xxxx', key2: 'xxxx', key3: '65632'},
  84. {id: 2, key1: 'xxxx', key2: 'xxxx', key3: '65632'},
  85. {id: 3, key1: 'xxxx', key2: 'xxxx', key3: '65632'},
  86. {id: 4, key1: 'xxxx', key2: 'xxxx', key3: '65632'},
  87. ])
  88. const getTableData = () => {
  89. }
  90. //多选事件
  91. const tableSelectionChange = (rows) => {
  92. console.log(rows)
  93. }
  94. //新增
  95. const addRowClick = () => {
  96. router.push({
  97. name: 'lar-agree-land-form'
  98. })
  99. }
  100. //编辑
  101. const editRowClick = (row) => {
  102. router.push({
  103. name: 'lar-agree-land-form'
  104. })
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .hc-layout-tree-box {
  109. position: relative;
  110. height: 100%;
  111. padding: 18px;
  112. }
  113. </style>