From b4e16be6e634811476bde441fb4e5138f831fc2b Mon Sep 17 00:00:00 2001 From: zyronon Date: Tue, 11 Jun 2024 02:33:47 +0800 Subject: [PATCH] save --- src/pages/pc/components/BaseTable.vue | 38 +++--- src/pages/pc/components/WordItem.vue | 151 ++++++++++++++++++++++ src/pages/pc/components/list/WordList.vue | 1 - src/pages/pc/word/EditWordDict.vue | 56 +++++--- src/stores/base.ts | 3 + src/types.ts | 1 - 6 files changed, 206 insertions(+), 44 deletions(-) create mode 100644 src/pages/pc/components/WordItem.vue diff --git a/src/pages/pc/components/BaseTable.vue b/src/pages/pc/components/BaseTable.vue index 4aa87c12..e2f6e594 100644 --- a/src/pages/pc/components/BaseTable.vue +++ b/src/pages/pc/components/BaseTable.vue @@ -17,11 +17,17 @@ const props = withDefaults(defineProps<{ activeId?: string, isActive?: boolean showBorder?: boolean + del?: Function + batchDel?: Function + add?: Function }>(), { activeIndex: -1, activeId: '', isActive: false, showBorder: false, + del: () => void 0, + add: () => void 0, + batchDel: () => void 0 }) const emit = defineEmits<{ @@ -105,8 +111,13 @@ function sort(type: Sort) { } } +function handleBatchDel() { + props.batchDel(selectIds) + selectIds = [] +} + const s = useSlots() -console.log('s', s) + defineRender( () => { const d = (item) => { selectIds.length ? : null } -
-
- {s.default({checkbox: d, item})} -
-
- {item.word} - {item.phonetic0} - -
-
-
-
-
-
- - -
-
+ {s.default({checkbox: d, item})} ) }) diff --git a/src/pages/pc/components/WordItem.vue b/src/pages/pc/components/WordItem.vue new file mode 100644 index 00000000..73513933 --- /dev/null +++ b/src/pages/pc/components/WordItem.vue @@ -0,0 +1,151 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/pc/components/list/WordList.vue b/src/pages/pc/components/list/WordList.vue index 6e0bec7b..f1e77e49 100644 --- a/src/pages/pc/components/list/WordList.vue +++ b/src/pages/pc/components/list/WordList.vue @@ -1,6 +1,5 @@