vue2server7 7.0.109 → 7.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="base-table-wrapper">
|
|
3
|
+
<!-- 工具栏区域 -->
|
|
4
|
+
<div class="table-toolbar" v-if="showToolbar">
|
|
5
|
+
<slot name="toolbar">
|
|
6
|
+
<!-- 列配置按钮 -->
|
|
7
|
+
<TableColumnSettings
|
|
8
|
+
:columns="columnSettings"
|
|
9
|
+
:selected-keys="selectedKeys"
|
|
10
|
+
:storage-key="storageKey"
|
|
11
|
+
@confirm="onColumnConfirm"
|
|
12
|
+
/>
|
|
13
|
+
</slot>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<!-- 表格主体 -->
|
|
17
|
+
<el-table
|
|
18
|
+
ref="tableRef"
|
|
19
|
+
:key="tableKey"
|
|
20
|
+
v-bind="$attrs"
|
|
21
|
+
:data="data"
|
|
22
|
+
border
|
|
23
|
+
stripe
|
|
24
|
+
size="small"
|
|
25
|
+
style="width: 100%"
|
|
26
|
+
v-on="$listeners"
|
|
27
|
+
>
|
|
28
|
+
<!-- 序号列(可选) -->
|
|
29
|
+
<el-table-column
|
|
30
|
+
v-if="showIndex"
|
|
31
|
+
type="index"
|
|
32
|
+
label="序号"
|
|
33
|
+
width="60"
|
|
34
|
+
align="center"
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
<!-- 动态列渲染 -->
|
|
38
|
+
<el-table-column
|
|
39
|
+
v-for="col in visibleColumns"
|
|
40
|
+
:key="col.prop"
|
|
41
|
+
:prop="col.prop"
|
|
42
|
+
:label="col.label"
|
|
43
|
+
:width="col.width"
|
|
44
|
+
:min-width="col.minWidth"
|
|
45
|
+
:align="col.align || 'left'"
|
|
46
|
+
:header-align="col.headerAlign || col.align || 'left'"
|
|
47
|
+
:sortable="col.sortable || false"
|
|
48
|
+
:fixed="col.fixed || false"
|
|
49
|
+
>
|
|
50
|
+
<!-- 自定义列插槽(格式为 column-xxx,xxx 是列的 prop) -->
|
|
51
|
+
<template #default="scope">
|
|
52
|
+
<slot :name="'column-' + col.prop" v-bind="scope">
|
|
53
|
+
{{ scope.row[col.prop] }}
|
|
54
|
+
</slot>
|
|
55
|
+
</template>
|
|
56
|
+
</el-table-column>
|
|
57
|
+
|
|
58
|
+
<!-- 操作列(插槽) -->
|
|
59
|
+
<slot name="action-column" />
|
|
60
|
+
</el-table>
|
|
61
|
+
|
|
62
|
+
<!-- 分页区域(可选) -->
|
|
63
|
+
<div class="table-pagination" v-if="showPagination && total > 0">
|
|
64
|
+
<el-pagination
|
|
65
|
+
layout="total, prev, pager, next"
|
|
66
|
+
:current-page="currentPage"
|
|
67
|
+
:page-size="pageSize"
|
|
68
|
+
:total="total"
|
|
69
|
+
@current-change="onPageChange"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script setup lang="ts">
|
|
76
|
+
import { ref, computed, onMounted, useAttrs } from 'vue'
|
|
77
|
+
import TableColumnSettings from './TableColumnSettings.vue'
|
|
78
|
+
|
|
79
|
+
// 列配置接口
|
|
80
|
+
interface ColumnConfig {
|
|
81
|
+
prop: string // 列唯一标识(必填)
|
|
82
|
+
label: string // 列显示名称(必填)
|
|
83
|
+
width?: number // 列宽
|
|
84
|
+
minWidth?: number // 最小列宽
|
|
85
|
+
align?: 'left' | 'center' | 'right' // 对齐方式
|
|
86
|
+
headerAlign?: 'left' | 'center' | 'right' // 表头对齐
|
|
87
|
+
sortable?: boolean | 'custom' // 是否可排序
|
|
88
|
+
fixed?: boolean | 'left' | 'right' // 是否固定
|
|
89
|
+
disabled?: boolean // 是否禁用(禁用的列始终显示,不可取消)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 组件 Props 定义
|
|
93
|
+
const props = defineProps({
|
|
94
|
+
/**
|
|
95
|
+
* 表格数据
|
|
96
|
+
*/
|
|
97
|
+
data: {
|
|
98
|
+
type: Array,
|
|
99
|
+
default: () => []
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* 列配置数组
|
|
103
|
+
*/
|
|
104
|
+
columns: {
|
|
105
|
+
type: Array as () => ColumnConfig[],
|
|
106
|
+
default: () => []
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* 是否显示序号列
|
|
110
|
+
*/
|
|
111
|
+
showIndex: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: true
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* 是否显示工具栏
|
|
117
|
+
*/
|
|
118
|
+
showToolbar: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: true
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* 是否显示分页
|
|
124
|
+
*/
|
|
125
|
+
showPagination: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: true
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* 当前页码
|
|
131
|
+
*/
|
|
132
|
+
currentPage: {
|
|
133
|
+
type: Number,
|
|
134
|
+
default: 1
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* 每页条数
|
|
138
|
+
*/
|
|
139
|
+
pageSize: {
|
|
140
|
+
type: Number,
|
|
141
|
+
default: 10
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* 总条数
|
|
145
|
+
*/
|
|
146
|
+
total: {
|
|
147
|
+
type: Number,
|
|
148
|
+
default: 0
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* localStorage 存储键名
|
|
152
|
+
* 用于持久化用户的列配置
|
|
153
|
+
* 不设置则不持久化
|
|
154
|
+
*/
|
|
155
|
+
storageKey: {
|
|
156
|
+
type: String,
|
|
157
|
+
default: ''
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
// 组件 Events 定义
|
|
162
|
+
const emit = defineEmits<{
|
|
163
|
+
(e: 'update:currentPage', page: number): void
|
|
164
|
+
(e: 'pageChange', page: number): void
|
|
165
|
+
}>()
|
|
166
|
+
|
|
167
|
+
// ==================== 响应式状态 ====================
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* el-table 实例引用
|
|
171
|
+
* 可以通过 ref 调用 Element Plus 表格的原生方法
|
|
172
|
+
*/
|
|
173
|
+
const tableRef = ref()
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* 表格 key,用于强制刷新表格
|
|
177
|
+
* 列配置变更后更新此值,触发表格重新渲染
|
|
178
|
+
*/
|
|
179
|
+
const tableKey = ref(0)
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 当前选中的列 key 数组
|
|
183
|
+
* 存储用户选择显示的列 prop
|
|
184
|
+
*/
|
|
185
|
+
const selectedKeys = ref<string[]>([])
|
|
186
|
+
|
|
187
|
+
// ==================== 计算属性 ====================
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* 列配置组件需要的数据格式
|
|
191
|
+
* 只提取列配置组件需要的三个字段
|
|
192
|
+
*/
|
|
193
|
+
const columnSettings = computed(() => {
|
|
194
|
+
return props.columns.map(col => ({
|
|
195
|
+
prop: col.prop,
|
|
196
|
+
label: col.label,
|
|
197
|
+
disabled: col.disabled || false
|
|
198
|
+
}))
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* 当前可见的列
|
|
203
|
+
* 根据 selectedKeys 过滤出用户选择显示的列
|
|
204
|
+
*/
|
|
205
|
+
const visibleColumns = computed(() => {
|
|
206
|
+
return props.columns.filter(col => selectedKeys.value.includes(col.prop))
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
// ==================== 方法 ====================
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* 列配置确认回调
|
|
213
|
+
* @param keys - 用户选中的列 prop 数组
|
|
214
|
+
*
|
|
215
|
+
* 逻辑:
|
|
216
|
+
* 1. 更新选中的列
|
|
217
|
+
* 2. 更新 tableKey 强制表格重新渲染
|
|
218
|
+
*/
|
|
219
|
+
const onColumnConfirm = (keys: string[]) => {
|
|
220
|
+
selectedKeys.value = keys
|
|
221
|
+
tableKey.value += 1 // 强制刷新表格
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* 分页切换回调
|
|
226
|
+
* @param page - 目标页码
|
|
227
|
+
*
|
|
228
|
+
* 触发两个事件:
|
|
229
|
+
* 1. update:currentPage - 支持 v-model:currentPage
|
|
230
|
+
* 2. pageChange - 普通分页变更事件
|
|
231
|
+
*/
|
|
232
|
+
const onPageChange = (page: number) => {
|
|
233
|
+
emit('update:currentPage', page)
|
|
234
|
+
emit('pageChange', page)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ==================== 生命周期 ====================
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* 组件挂载时初始化
|
|
241
|
+
*
|
|
242
|
+
* 逻辑:
|
|
243
|
+
* 1. 如果设置了 storageKey,从 localStorage 读取保存的配置
|
|
244
|
+
* 2. 读取失败或没有存储,则默认显示所有列
|
|
245
|
+
*/
|
|
246
|
+
onMounted(() => {
|
|
247
|
+
if (props.storageKey) {
|
|
248
|
+
const stored = localStorage.getItem(props.storageKey)
|
|
249
|
+
if (stored) {
|
|
250
|
+
try {
|
|
251
|
+
selectedKeys.value = JSON.parse(stored)
|
|
252
|
+
} catch {
|
|
253
|
+
// 解析失败,默认显示所有列
|
|
254
|
+
selectedKeys.value = props.columns.map(col => col.prop)
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
// 没有存储,默认显示所有列
|
|
258
|
+
selectedKeys.value = props.columns.map(col => col.prop)
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
// 没有设置 storageKey,默认显示所有列
|
|
262
|
+
selectedKeys.value = props.columns.map(col => col.prop)
|
|
263
|
+
}
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
// 暴露 el-table 实例给父组件,方便调用原生方法
|
|
267
|
+
defineExpose({
|
|
268
|
+
tableRef
|
|
269
|
+
})
|
|
270
|
+
</script>
|
|
271
|
+
|
|
272
|
+
<style scoped>
|
|
273
|
+
/**
|
|
274
|
+
* 表格外层容器
|
|
275
|
+
*/
|
|
276
|
+
.base-table-wrapper {
|
|
277
|
+
width: 100%;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* 工具栏样式
|
|
282
|
+
* 位于表格上方,包含操作按钮等
|
|
283
|
+
*/
|
|
284
|
+
.table-toolbar {
|
|
285
|
+
margin-bottom: 12px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* 分页容器样式
|
|
290
|
+
* 位于表格下方,右对齐
|
|
291
|
+
*/
|
|
292
|
+
.table-pagination {
|
|
293
|
+
margin-top: 12px;
|
|
294
|
+
text-align: right;
|
|
295
|
+
}
|
|
296
|
+
</style>
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="page base-table-demo-page">
|
|
3
|
+
<h1 class="title">封装表格组件演示</h1>
|
|
4
|
+
|
|
5
|
+
<!-- 查询工具栏 -->
|
|
6
|
+
<div class="search-toolbar">
|
|
7
|
+
<el-input v-model="searchForm.keyword" placeholder="关键词搜索" clearable style="width: 200px" />
|
|
8
|
+
<el-select v-model="searchForm.department" placeholder="选择部门" clearable style="width: 140px; margin-left: 12px">
|
|
9
|
+
<el-option label="技术部" value="技术部" />
|
|
10
|
+
<el-option label="产品部" value="产品部" />
|
|
11
|
+
<el-option label="运营部" value="运营部" />
|
|
12
|
+
<el-option label="市场部" value="市场部" />
|
|
13
|
+
</el-select>
|
|
14
|
+
<el-button type="primary" @click="onSearch" style="margin-left: 12px">查询</el-button>
|
|
15
|
+
<el-button @click="onReset">重置</el-button>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<!-- 使用封装的 BaseTable 组件 -->
|
|
19
|
+
<BaseTable
|
|
20
|
+
ref="baseTableRef"
|
|
21
|
+
:data="tableData"
|
|
22
|
+
:columns="columns"
|
|
23
|
+
:show-index="true"
|
|
24
|
+
:show-toolbar="true"
|
|
25
|
+
:show-pagination="true"
|
|
26
|
+
v-model:current-page="page"
|
|
27
|
+
:page-size="pageSize"
|
|
28
|
+
:total="total"
|
|
29
|
+
storage-key="base-table-demo"
|
|
30
|
+
@page-change="onPageChange"
|
|
31
|
+
>
|
|
32
|
+
<!-- 自定义工具栏插槽(可选,不填则显示默认的列配置按钮) -->
|
|
33
|
+
<!-- <template #toolbar>
|
|
34
|
+
<el-button type="success">导出</el-button>
|
|
35
|
+
<TableColumnSettings
|
|
36
|
+
:columns="columns.map(c => ({ prop: c.prop, label: c.label, disabled: c.disabled }))"
|
|
37
|
+
:selected-keys="selectedKeys"
|
|
38
|
+
storage-key="base-table-demo"
|
|
39
|
+
@confirm="onColumnConfirm"
|
|
40
|
+
/>
|
|
41
|
+
</template> -->
|
|
42
|
+
|
|
43
|
+
<!-- 自定义姓名列 -->
|
|
44
|
+
<template #column-name="{ row }">
|
|
45
|
+
<el-tag type="primary" size="small">{{ row.name }}</el-tag>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<!-- 自定义状态列 -->
|
|
49
|
+
<template #column-status="{ row }">
|
|
50
|
+
<el-tag :type="getStatusType(row.status)" size="small">
|
|
51
|
+
{{ row.status }}
|
|
52
|
+
</el-tag>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<!-- 操作列(通过插槽添加) -->
|
|
56
|
+
<template #action-column>
|
|
57
|
+
<el-table-column label="操作" width="180" align="center" fixed="right">
|
|
58
|
+
<template #default="{ row }">
|
|
59
|
+
<el-button type="primary" link size="small" @click="onView(row)">查看</el-button>
|
|
60
|
+
<el-button type="primary" link size="small" @click="onEdit(row)">编辑</el-button>
|
|
61
|
+
<el-button type="danger" link size="small" @click="onDelete(row)">删除</el-button>
|
|
62
|
+
</template>
|
|
63
|
+
</el-table-column>
|
|
64
|
+
</template>
|
|
65
|
+
</BaseTable>
|
|
66
|
+
</section>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script setup lang="ts">
|
|
70
|
+
import { ref, reactive, onMounted } from 'vue'
|
|
71
|
+
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
72
|
+
import BaseTable from '../components/BaseTable.vue'
|
|
73
|
+
|
|
74
|
+
// 表格行数据接口
|
|
75
|
+
interface TableRow {
|
|
76
|
+
id: number
|
|
77
|
+
name: string
|
|
78
|
+
department: string
|
|
79
|
+
position: string
|
|
80
|
+
phone: string
|
|
81
|
+
email: string
|
|
82
|
+
joinDate: string
|
|
83
|
+
status: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 搜索表单
|
|
87
|
+
interface SearchForm {
|
|
88
|
+
keyword: string
|
|
89
|
+
department: string
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ==================== 响应式状态 ====================
|
|
93
|
+
|
|
94
|
+
const baseTableRef = ref()
|
|
95
|
+
|
|
96
|
+
// 搜索表单
|
|
97
|
+
const searchForm = reactive<SearchForm>({
|
|
98
|
+
keyword: '',
|
|
99
|
+
department: ''
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
// 表格数据
|
|
103
|
+
const tableData = ref<TableRow[]>([])
|
|
104
|
+
|
|
105
|
+
// 分页
|
|
106
|
+
const page = ref(1)
|
|
107
|
+
const pageSize = ref(10)
|
|
108
|
+
const total = ref(50)
|
|
109
|
+
|
|
110
|
+
// 列配置
|
|
111
|
+
const columns = [
|
|
112
|
+
{ prop: 'name', label: '姓名', width: 120, disabled: true }, // 禁用 = 强制显示,不可取消
|
|
113
|
+
{ prop: 'department', label: '部门', width: 120 },
|
|
114
|
+
{ prop: 'position', label: '职位', width: 140 },
|
|
115
|
+
{ prop: 'phone', label: '电话', width: 140 },
|
|
116
|
+
{ prop: 'email', label: '邮箱', minWidth: 180 },
|
|
117
|
+
{ prop: 'joinDate', label: '入职日期', width: 120, align: 'center' },
|
|
118
|
+
{ prop: 'status', label: '状态', width: 100, align: 'center' }
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
// ==================== 方法 ====================
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 根据状态返回对应的 tag 类型
|
|
125
|
+
*/
|
|
126
|
+
const getStatusType = (status: string) => {
|
|
127
|
+
const map: Record<string, string> = {
|
|
128
|
+
'在职': 'success',
|
|
129
|
+
'离职': 'info',
|
|
130
|
+
'休假': 'warning'
|
|
131
|
+
}
|
|
132
|
+
return map[status] || 'info'
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 查询
|
|
137
|
+
*/
|
|
138
|
+
const onSearch = () => {
|
|
139
|
+
page.value = 1
|
|
140
|
+
loadData()
|
|
141
|
+
ElMessage.success('查询成功')
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 重置
|
|
146
|
+
*/
|
|
147
|
+
const onReset = () => {
|
|
148
|
+
searchForm.keyword = ''
|
|
149
|
+
searchForm.department = ''
|
|
150
|
+
page.value = 1
|
|
151
|
+
loadData()
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 分页切换
|
|
156
|
+
*/
|
|
157
|
+
const onPageChange = (p: number) => {
|
|
158
|
+
page.value = p
|
|
159
|
+
loadData()
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 查看
|
|
164
|
+
*/
|
|
165
|
+
const onView = (row: TableRow) => {
|
|
166
|
+
ElMessageBox.alert(
|
|
167
|
+
`员工信息:\n姓名:${row.name}\n部门:${row.department}\n职位:${row.position}`,
|
|
168
|
+
'查看详情',
|
|
169
|
+
{ confirmButtonText: '确定' }
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 编辑
|
|
175
|
+
*/
|
|
176
|
+
const onEdit = (row: TableRow) => {
|
|
177
|
+
ElMessage.info(`编辑员工:${row.name}`)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* 删除
|
|
182
|
+
*/
|
|
183
|
+
const onDelete = (row: TableRow) => {
|
|
184
|
+
ElMessageBox.confirm(
|
|
185
|
+
`确定删除员工「${row.name}」吗?`,
|
|
186
|
+
'提示',
|
|
187
|
+
{
|
|
188
|
+
confirmButtonText: '确定',
|
|
189
|
+
cancelButtonText: '取消',
|
|
190
|
+
type: 'warning'
|
|
191
|
+
}
|
|
192
|
+
).then(() => {
|
|
193
|
+
ElMessage.success('删除成功')
|
|
194
|
+
}).catch(() => {})
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* 加载模拟数据
|
|
199
|
+
*/
|
|
200
|
+
const loadData = () => {
|
|
201
|
+
const data: TableRow[] = []
|
|
202
|
+
for (let i = 0; i < pageSize.value; i++) {
|
|
203
|
+
const index = (page.value - 1) * pageSize.value + i + 1
|
|
204
|
+
data.push({
|
|
205
|
+
id: index,
|
|
206
|
+
name: `员工${index}`,
|
|
207
|
+
department: ['技术部', '产品部', '运营部', '市场部'][index % 4],
|
|
208
|
+
position: ['开发工程师', '产品经理', '运营专员', '市场专员'][index % 4],
|
|
209
|
+
phone: `138${String(index).padStart(8, '0')}`,
|
|
210
|
+
email: `employee${index}@example.com`,
|
|
211
|
+
joinDate: `2024-${String((index % 12) + 1).padStart(2, '0')}-${String((index % 28) + 1).padStart(2, '0')}`,
|
|
212
|
+
status: ['在职', '离职', '休假'][index % 3]
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
tableData.value = data
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// ==================== 生命周期 ====================
|
|
219
|
+
|
|
220
|
+
onMounted(() => {
|
|
221
|
+
loadData()
|
|
222
|
+
})
|
|
223
|
+
</script>
|
|
224
|
+
|
|
225
|
+
<style scoped>
|
|
226
|
+
.page.base-table-demo-page {
|
|
227
|
+
padding: 16px;
|
|
228
|
+
}
|
|
229
|
+
.title {
|
|
230
|
+
font-size: 18px;
|
|
231
|
+
margin-bottom: 12px;
|
|
232
|
+
}
|
|
233
|
+
.search-toolbar {
|
|
234
|
+
margin-bottom: 12px;
|
|
235
|
+
}
|
|
236
|
+
</style>
|
|
@@ -7,6 +7,7 @@ import DateRangePage from '../pages/DateRangePage.vue'
|
|
|
7
7
|
import OrgTreeSelectPage from '../pages/OrgTreeSelectPage.vue'
|
|
8
8
|
import MoneyInputPage from '../pages/MoneyInputPage.vue'
|
|
9
9
|
import ColumnConfigDemoPage from '../pages/ColumnConfigDemoPage.vue'
|
|
10
|
+
import BaseTableDemoPage from '../pages/BaseTableDemoPage.vue'
|
|
10
11
|
|
|
11
12
|
export const routes = [
|
|
12
13
|
{
|
|
@@ -93,5 +94,14 @@ export const routes = [
|
|
|
93
94
|
title: '表格列配置演示',
|
|
94
95
|
showInMenu: true
|
|
95
96
|
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
path: '/base-table-demo',
|
|
100
|
+
name: 'BaseTableDemo',
|
|
101
|
+
component: BaseTableDemoPage,
|
|
102
|
+
meta: {
|
|
103
|
+
title: '封装表格组件演示',
|
|
104
|
+
showInMenu: true
|
|
105
|
+
}
|
|
96
106
|
}
|
|
97
107
|
]
|