dy
2025-04-14 9f5539e53c94e74b52e4b8fe7029cf5fd39d890d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<template>
    <div class="app-container">
        <el-row>
            <el-col :span="24">
                <div slot="header" class="clearfix">
                    <span><b>表格展示</b></span>
                </div>
                <div style="width: 100%;display: flex;flex-direction: column;align-items: center;">
 
                    <!--查询条件-->
                    <!-- <el-form ref="queryForm" style="width: 100%" inline>
                    <el-form-item label="接口名" style="float: left" class="form_btn ">
                        <el-input v-model="selectItem.name" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item style="float: right" class="form_btn ">
                        <el-button icon="el-icon-search" @click="alert('暂时无法搜索')">搜索</el-button>
                    </el-form-item>
                    </el-form> -->
 
                    <HxlhTable
                        style="width: 100%"
                        :columns="columns"
                        :data="tableData"
                        :loading="loading"
                        :page="page"
                    >
                    </HxlhTable>
            </div>
            </el-col>
        </el-row>
    </div>
</template>
  
<script setup>
    
import { ref, reactive, onMounted } from 'vue';
import HxlhTable from '@/components/HxlhTable'
 
// 搜索使用组件
const selectItem = reactive({
  name: ''
});
 
// 表格 - 项目所有数据
const tableData = ref([
  { code: '111', name: '张三', sex: '男' },
  { code: '222', name: '李四', sex: '男' },
  { code: '333', name: '王五', sex: '男' },
  { code: '444', name: '赵六', sex: '女' }
]);
 
for (let i = 0; i < 1000; i++) {
    tableData.value.push({
      code: `new${i + 1}`,
      name: `新人${i + 1}`,
      sex: '未知'
    });
  }
 
// 表格配置
const columns = ref([
  { type: 'seq', title: '序号', width: 60 },
  {
    title: '编号',
    field: 'code'
  },
  {
    title: '名称',
    field: 'name'
  },
  {
    title: '性别',
    field: 'sex'
  }
]);
 
// 表格缓冲
const loading = ref(false);
 
// 分页属性
const page = reactive({
  total: 1004,
  current: 1,
  size: 10
});
 
// 生命周期钩子,替代 mounted
onMounted(() => {
  // 这里可以放置原来 mounted 钩子中的代码
});
    
</script>
  
<style scoped="scoped">
#view {
    width: 100%;
    height: 100%;
    padding: 0px;
    margin: 0px;
}
 
.box-card {
    width: 480px;
}
</style>