rayyy-vue-table-components 1.4.3 → 1.4.5

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.
@@ -8,8 +8,9 @@ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNull
8
8
  readonly "onUpdate:selectRow"?: ((value: T[]) => any) | undefined;
9
9
  readonly "onClick:cell"?: ((column: TableColumn<T>, row: T) => any) | undefined;
10
10
  readonly "onOpen:transfer"?: (() => any) | undefined;
11
+ readonly "onClick:downloadExcelFile"?: (() => any) | undefined;
11
12
  readonly "onClick:columnSort"?: ((data: SortChangValue<T>) => any) | undefined;
12
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick:checkRow" | "onClick:editRow" | "onUpdate:selectRow" | "onClick:cell" | "onOpen:transfer" | "onClick:columnSort"> & {
13
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onClick:checkRow" | "onClick:editRow" | "onUpdate:selectRow" | "onClick:cell" | "onOpen:transfer" | "onClick:downloadExcelFile" | "onClick:columnSort"> & {
13
14
  data: T[];
14
15
  columns: TableColumn<T>[];
15
16
  tableTitle?: string;
@@ -33,6 +34,7 @@ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNull
33
34
  slots: {};
34
35
  emit: {
35
36
  (e: "open:transfer"): void;
37
+ (e: "click:downloadExcelFile"): void;
36
38
  (e: "update:selectRow", value: T[]): void;
37
39
  (e: "click:cell", column: TableColumn<T>, row: T): void;
38
40
  (e: "click:columnSort", data: SortChangValue<T>): void;
@@ -91,6 +91,8 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
91
91
  export interface SortTableEmits<T extends Record<string, unknown> = Record<string, unknown>> {
92
92
  /** 打開轉移對話框事件 */
93
93
  (e: 'open:transfer'): void
94
+ /** 下載表單excel */
95
+ (e: 'click:downloadExcelFile'): void
94
96
  /** 更新選擇行事件 */
95
97
  (e: 'update:selectRow', value: T[]): void
96
98
  /** 單元格點擊事件 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -44,6 +44,13 @@ const changePageSize = (limit: number) => {
44
44
  const onBackClick = () => {
45
45
  emits('click:back')
46
46
  }
47
+ const showPager = computed(() => {
48
+ if (props.showPagination) {
49
+ return props.showPagination
50
+ } else {
51
+ return props.pagination.totalCount > 0
52
+ }
53
+ })
47
54
  </script>
48
55
 
49
56
  <template>
@@ -66,7 +73,7 @@ const onBackClick = () => {
66
73
 
67
74
  <template #footer>
68
75
  <el-pagination
69
- v-if="pagination.totalCount > 0"
76
+ v-if="showPager"
70
77
  layout="jumper, prev, pager, next, total, sizes"
71
78
  :page-sizes="pageSizeList"
72
79
  :current-page="pagination.page"
@@ -24,6 +24,7 @@ defineProps<{
24
24
 
25
25
  const emit = defineEmits<{
26
26
  (e: 'open:transfer'): void
27
+ (e: 'click:downloadExcelFile'): void
27
28
  (e: 'update:selectRow', value: T[]): void
28
29
  (e: 'click:cell', column: TableColumn<T>, row: T): void
29
30
  (e: 'click:columnSort', data: SortChangValue<T>): void
@@ -53,6 +54,9 @@ const handleCheckClick = (row: T) => {
53
54
  const handleEditClick = (row: T) => {
54
55
  emit('click:editRow', row)
55
56
  }
57
+ const handelExcelClick = () => {
58
+ emit('click:downloadExcelFile')
59
+ }
56
60
  const state = reactive({
57
61
  itemOnHover: false,
58
62
  })
@@ -75,6 +79,7 @@ const state = reactive({
75
79
  class="cursor-pointer flex items-center justify-center ml-1"
76
80
  @mouseenter="state.itemOnHover = true"
77
81
  @mouseleave="state.itemOnHover = false"
82
+ @click="handelExcelClick"
78
83
  >
79
84
  <img
80
85
  v-if="!state.itemOnHover"
@@ -92,6 +92,8 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
92
92
  export interface SortTableEmits<T extends Record<string, unknown> = Record<string, unknown>> {
93
93
  /** 打開轉移對話框事件 */
94
94
  (e: 'open:transfer'): void
95
+ /** 下載表單excel */
96
+ (e: 'click:downloadExcelFile'): void
95
97
  /** 更新選擇行事件 */
96
98
  (e: 'update:selectRow', value: T[]): void
97
99
  /** 單元格點擊事件 */