Skip to content

Commit cb152fc

Browse files
committed
Optimize some functions.
1 parent 48a4ab5 commit cb152fc

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

docs/TableDemo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ const layouts = [{
8080
}, {
8181
name: 'realEndTime',
8282
}],
83-
quickSearch: {
84-
placeholder: '请输入姓名',
85-
},
8683
aggs: { name: AggregateKind.MIN },
8784
}]
8885
@@ -517,6 +514,9 @@ const tableProps: Ref<TableProps> = ref({
517514
columns,
518515
layouts,
519516
events,
517+
quickSearch: {
518+
placeholder: '请输入姓名',
519+
},
520520
defaultSlice: {
521521
offsetNumber: 0,
522522
fetchNumber: 10,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@idealworld/task-table",
33
"type": "module",
4-
"version": "0.0.1-alpha.1",
4+
"version": "0.0.1-alpha.2",
55
"description": "Table component to support task management",
66
"authors": [{
77
"name": "gudaoxuri",

src/Skeleton.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ const tableBasicConf = reactive<TableBasicConf>(_tableBasicConf)
2121
const tableLayoutsConf = reactive<TableLayoutConf[]>(_tableLayoutsConf)
2222
const currentLayoutId = ref<string>(tableLayoutsConf[0].id)
2323
24-
watch(tableLayoutsConf, () => {
24+
watch(tableLayoutsConf, (newConf, oldConf) => {
25+
// TODO
26+
// if (newConf.length !== oldConf.length) {
2527
// Reset the current layout after the layout is deleted
26-
currentLayoutId.value = tableLayoutsConf[tableLayoutsConf.length - 1] && tableLayoutsConf[tableLayoutsConf.length - 1].id
27-
setHeight()
28+
currentLayoutId.value = tableLayoutsConf[tableLayoutsConf.length - 1] && tableLayoutsConf[tableLayoutsConf.length - 1].id
29+
setHeight()
30+
// }
2831
})
2932
3033
Event.init(tableBasicConf, tableLayoutsConf, currentLayoutId, props.events)

src/components/eventbus.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ export async function modifyStyles(changedStyles: TableStyleConf): Promise<boole
264264

265265
export async function setQuickSearchContent(quickSearchContent: string): Promise<boolean> {
266266
tableBasicConf.quickSearchContent = quickSearchContent
267-
await loadData()
267+
tableLayoutsConf.forEach((layout) => {
268+
loadData(undefined, undefined, layout.id)
269+
})
268270
return true
269271
}
270272

src/components/function/QuickSearch.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import { ref } from 'vue'
3-
import * as eb from '../eventbus'
4-
import * as iconSvg from '../../assets/icon'
2+
import { ref } from 'vue';
3+
import * as iconSvg from '../../assets/icon';
4+
import * as eb from '../eventbus';
55
66
const props = defineProps<{
77
placeholder: string

0 commit comments

Comments
 (0)