Skip to content

Commit 2da5b04

Browse files
committed
Restructuring the project (ongoing).
1 parent a401570 commit 2da5b04

File tree

14 files changed

+717
-622
lines changed

14 files changed

+717
-622
lines changed

components.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ declare module 'vue' {
1919
LayoutSetting: typeof import('./src/components/function/LayoutSetting.vue')['default']
2020
List: typeof import('./src/components/layout/list/List.vue')['default']
2121
ListColumnAgg: typeof import('./src/components/layout/list/ListColumnAgg.vue')['default']
22-
ListColumnAggs: typeof import('./src/components/layout/list/ListColumnAggs.vue')['default']
2322
ListColumnFixed: typeof import('./src/components/layout/list/ListColumnFixed.vue')['default']
2423
ListColumnWrap: typeof import('./src/components/layout/list/ListColumnWrap.vue')['default']
2524
ListHeader: typeof import('./src/components/layout/list/ListHeader.vue')['default']

docs/TableDemo.vue

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ const events: IwProps.TableEventProps = {
138138
return d.pno === null
139139
})
140140
}
141-
if (byGroupValue && group) {
141+
if (byGroupValue && group && group.item) {
142142
// 只获取当前分组的数据
143143
data = data.filter(d => d[group.item!.columnName] === byGroupValue)
144144
}
145-
if (group && !byGroupValue) {
145+
if (group && group.item && !byGroupValue) {
146146
let dataGroup: { [key: string]: any[] } = IwUtils.groupBy(data, (d) => { return d[group.item!.columnName] })
147-
if (group.item!.hideEmptyRecord) {
147+
if (group.item.hideEmptyRecord) {
148148
dataGroup = Object.fromEntries(Object.entries(dataGroup).filter(([_, value]) => value.length > 0))
149149
}
150150
const groupTotalNumber = Object.fromEntries(Object.entries(dataGroup).map(([key, value]) => {
@@ -157,7 +157,7 @@ const events: IwProps.TableEventProps = {
157157
}),
158158
)
159159
}
160-
if (group.item!.orderDesc) {
160+
if (group.item.orderDesc) {
161161
dataGroup = Object.fromEntries(
162162
Object.entries(dataGroup).sort((a, b) => b[0].localeCompare(a[0])),
163163
)
@@ -383,16 +383,10 @@ const events: IwProps.TableEventProps = {
383383
if (changedLayoutProps.agg) {
384384
currLayout.agg = changedLayoutProps.agg
385385
}
386-
if (changedLayoutProps.newColumn) {
387-
currLayout.columns.push(changedLayoutProps.newColumn)
388-
}
389386
if (changedLayoutProps.changedColumn) {
390387
const col = currLayout.columns.find((col) => { return col.name === changedLayoutProps.changedColumn!.name })!
391388
Object.assign(col, changedLayoutProps.changedColumn)
392389
}
393-
if (changedLayoutProps.deletedColumnName) {
394-
currLayout.columns.splice(currLayout.columns.findIndex((col) => { return col.name === changedLayoutProps.deletedColumnName }), 1)
395-
}
396390
return true
397391
},
398392
@@ -520,80 +514,84 @@ const columns: IwProps.SimpleTableColumnProps[] = [
520514
{ name: 'actualEndTime', title: '实际结束时间', dataKind: IwProps.DataKind.DATETIME, sortable: true },
521515
]
522516
523-
const layouts: IwProps.SimpleLayoutProps[] = [{
524-
id: 'hi1',
525-
title: 'gantt demo',
526-
layoutKind: IwProps.LayoutKind.GANTT,
527-
columns: [{
528-
name: 'name',
529-
}, {
530-
name: 'creator',
531-
}, {
532-
name: 'no',
533-
}, {
534-
name: 'planStartTime',
535-
}, {
536-
name: 'planEndTime',
537-
}, {
538-
name: 'actualStartTime',
539-
}, {
540-
name: 'actualEndTime',
541-
}],
542-
}, {
543-
id: 'hi2',
544-
title: 'list demo',
545-
layoutKind: IwProps.LayoutKind.LIST,
546-
columns: [{
547-
name: 'name',
548-
}, {
549-
name: 'stats',
550-
}, {
551-
name: 'creator',
552-
}, {
553-
name: 'no',
554-
}, {
555-
name: 'planStartTime',
556-
}, {
557-
name: 'planEndTime',
558-
}, {
559-
name: 'actualStartTime',
560-
}, {
561-
name: 'actualEndTime',
562-
}],
563-
agg: {
564-
items: [
565-
{ columnName: 'name', aggKind: IwProps.AggregateKind.MIN },
566-
],
567-
},
568-
}, {
569-
id: 'hi3',
570-
title: 'multiple header demo',
571-
layoutKind: IwProps.LayoutKind.LIST,
572-
columns: [{
573-
name: 'name',
574-
}, {
575-
name: 'creator',
576-
}, {
577-
name: 'stats',
578-
}, {
579-
name: 'no',
580-
}, {
581-
name: 'planStartTime',
582-
categoryTitle: 'Time',
583-
}, {
584-
name: 'planEndTime',
585-
categoryTitle: 'Time',
586-
}, {
587-
name: 'actualStartTime',
588-
}, {
589-
name: 'actualEndTime',
590-
}],
591-
agg: {
592-
items: [
593-
{ columnName: 'name', aggKind: IwProps.AggregateKind.MIN },
594-
],
517+
const layouts: IwProps.SimpleLayoutProps[] = [
518+
// {
519+
// id: 'hi1',
520+
// title: 'gantt demo',
521+
// layoutKind: IwProps.LayoutKind.GANTT,
522+
// columns: [{
523+
// name: 'name',
524+
// }, {
525+
// name: 'creator',
526+
// }, {
527+
// name: 'no',
528+
// }, {
529+
// name: 'planStartTime',
530+
// }, {
531+
// name: 'planEndTime',
532+
// }, {
533+
// name: 'actualStartTime',
534+
// }, {
535+
// name: 'actualEndTime',
536+
// }],
537+
// },
538+
{
539+
id: 'hi2',
540+
title: 'list demo',
541+
layoutKind: IwProps.LayoutKind.LIST,
542+
columns: [{
543+
name: 'name',
544+
}, {
545+
name: 'stats',
546+
}, {
547+
name: 'creator',
548+
}, {
549+
name: 'no',
550+
}, {
551+
name: 'planStartTime',
552+
}, {
553+
name: 'planEndTime',
554+
}, {
555+
name: 'actualStartTime',
556+
}, {
557+
name: 'actualEndTime',
558+
}],
559+
agg: {
560+
items: [
561+
{ columnName: 'name', aggKind: IwProps.AggregateKind.MIN },
562+
],
563+
},
595564
},
596-
}]
565+
// {
566+
// id: 'hi3',
567+
// title: 'multiple header demo',
568+
// layoutKind: IwProps.LayoutKind.LIST,
569+
// columns: [{
570+
// name: 'name',
571+
// }, {
572+
// name: 'creator',
573+
// }, {
574+
// name: 'stats',
575+
// }, {
576+
// name: 'no',
577+
// }, {
578+
// name: 'planStartTime',
579+
// categoryTitle: 'Time',
580+
// }, {
581+
// name: 'planEndTime',
582+
// categoryTitle: 'Time',
583+
// }, {
584+
// name: 'actualStartTime',
585+
// }, {
586+
// name: 'actualEndTime',
587+
// }],
588+
// agg: {
589+
// items: [
590+
// { columnName: 'name', aggKind: IwProps.AggregateKind.MIN },
591+
// ],
592+
// },
593+
// }
594+
]
597595
598596
const _tableProps: IwProps.SimpleTableProps = {
599597
pkColumnName: 'no',
@@ -605,7 +603,6 @@ const _tableProps: IwProps.SimpleTableProps = {
605603
placeholder: '请输入姓名',
606604
},
607605
slice: {
608-
offsetNumber: 0,
609606
fetchNumber: 10,
610607
fetchNumbers: [5, 10, 20, 30, 50],
611608
},
@@ -626,7 +623,10 @@ const _tableProps: IwProps.SimpleTableProps = {
626623
actualStartTimeColumnName: 'actualStartTime',
627624
actualEndTimeColumnName: 'actualEndTime',
628625
},
629-
626+
filter: {},
627+
group: {},
628+
sort: {},
629+
edit: {},
630630
}
631631
632632
const tableProps: Ref<IwProps.SimpleTableProps> = ref(_tableProps)

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"peerDependencies": {
5252
"dayjs": "^1.11.11",
5353
"sortablejs": "^1.15.2",
54-
"vue": "^3.4.27",
54+
"vue": "^3.4.29",
5555
"vue-i18n": "^9.13.1"
5656
},
5757
"devDependencies": {
@@ -62,7 +62,7 @@
6262
"@vitest/ui": "^1.6.0",
6363
"autoprefixer": "^10.4.19",
6464
"daisyui": "^4.12.2",
65-
"eslint": "^9.4.0",
65+
"eslint": "^9.5.0",
6666
"octicons-css": "^19.8.0",
6767
"postcss": "^8.4.38",
6868
"postcss-import": "^16.1.0",
@@ -75,7 +75,7 @@
7575
"typedoc-vitepress-theme": "^1.0.0",
7676
"typescript": "^5.4.5",
7777
"unplugin-vue-components": "^0.27.0",
78-
"vite": "^5.2.13",
78+
"vite": "^5.3.1",
7979
"vitepress": "^1.2.3",
8080
"vitest": "^1.6.0",
8181
"vue-tsc": "^2.0.21"

0 commit comments

Comments
 (0)