diff --git a/src/components/ty-crud.vue b/src/components/ty-crud.vue index fd5c324..42edc5d 100644 --- a/src/components/ty-crud.vue +++ b/src/components/ty-crud.vue @@ -4,21 +4,29 @@ - +
- 新增{{ entityName }} - +
+ 新增{{ entityName }} + +
+
+ +
- +
+ - + +
(), { @@ -103,6 +114,7 @@ const props = withDefaults( editReadonlyKeys: () => [], actions: () => ['edit', 'delete'], collapseCount: 2, + selection: false, actionsWidth: 220, }, ) @@ -112,6 +124,7 @@ const list = ref[]>([]) const total = ref(0) const page = ref(1) const pageSize = ref(10) +const selectedRows = ref[]>([]) const query = reactive>(buildModel(props.searchSchema)) @@ -223,15 +236,42 @@ function handleCommand(action: CrudActionItem, row: Record): void { action.onClick(row) } +function onSelectionChange(rows: Record[]): void { + selectedRows.value = rows +} + +defineExpose({ reload: fetchList }) + onMounted(fetchList) diff --git a/src/components/ty-table.vue b/src/components/ty-table.vue index 706f03e..65ae36e 100644 --- a/src/components/ty-table.vue +++ b/src/components/ty-table.vue @@ -1,34 +1,43 @@