Skip to content

Commit c0762a7

Browse files
fix: Fix jump issues
1 parent 0d1922c commit c0762a7

File tree

6 files changed

+41
-20
lines changed

6 files changed

+41
-20
lines changed

ui/src/components/folder-tree/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ function rebalanceAndInsert(
580580
}
581581
582582
onBeforeRouteLeave((to, from) => {
583+
if (from?.name === 'ToolWorkflow') return
583584
folder.setCurrentFolder({})
584585
})
585586

ui/src/views/application/index.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,14 @@ function batchSelectedHandle(bool: boolean) {
460460
}
461461
462462
const handleCheckAllChange = (val: CheckboxValueType) => {
463-
multipleSelection.value = val ? applicationList.value.map((v) => v.id) : []
464-
checkAll.value = val as boolean
463+
let bool
464+
if (isIndeterminate.value) {
465+
bool = true
466+
} else {
467+
bool = val as boolean
468+
}
469+
multipleSelection.value = bool ? applicationList.value.map((v) => v.id) : []
470+
checkAll.value = bool as boolean
465471
}
466472
const handleCheckedChatChange = (value: CheckboxValueType[]) => {
467473
const checkedCount = value.length
@@ -851,6 +857,7 @@ function folderClickHandle(row: any) {
851857
if (row.id === folder.currentFolder?.id) {
852858
return
853859
}
860+
batchSelectedHandle(false)
854861
folder.setCurrentFolder(row)
855862
paginationConfig.current_page = 1
856863
applicationList.value = []

ui/src/views/knowledge/component/KnowledgeListContainer.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,14 @@ function batchSelectedHandle(bool: boolean) {
537537
}
538538
539539
const handleCheckAllChange = (val: CheckboxValueType) => {
540-
multipleSelection.value = val ? knowledge.knowledgeList.map((v) => v.id) : []
541-
checkAll.value = val as boolean
540+
let bool
541+
if (isIndeterminate.value) {
542+
bool = true
543+
} else {
544+
bool = val as boolean
545+
}
546+
multipleSelection.value = bool ? knowledge.knowledgeList.map((v) => v.id) : []
547+
checkAll.value = bool as boolean
542548
}
543549
const handleCheckedChatChange = (value: CheckboxValueType[]) => {
544550
const checkedCount = value.length
@@ -767,6 +773,7 @@ watch(
767773
() => folder.currentFolder,
768774
(newValue) => {
769775
if (newValue && newValue.id && !isSystemShare.value) {
776+
batchSelectedHandle(false)
770777
paginationConfig.current_page = 1
771778
knowledge.setKnowledgeList([])
772779
getList()
@@ -791,10 +798,6 @@ function getList() {
791798
})
792799
}
793800
794-
function clickFolder(item: any) {
795-
folder.setCurrentFolder(item)
796-
}
797-
798801
function searchHandle() {
799802
paginationConfig.current_page = 1
800803
knowledge.setKnowledgeList([])

ui/src/views/paragraph/index.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,8 @@
192192
{{ $t('common.total') }} {{ paginationConfig.total }}
193193
{{ $t('views.document.items') }}
194194
</span>
195-
<el-button
196-
link
197-
type="primary"
198-
v-if="multipleSelection.length > 0"
199-
@click="multipleSelection = []"
200-
>
201-
{{ $t('common.clear') }}
195+
<el-button link type="primary" @click="batchSelectedHandle(false)">
196+
{{ $t('views.paragraph.setting.cancelSelected') }}
202197
</el-button>
203198
</div>
204199
</div>
@@ -303,8 +298,14 @@ const isIndeterminate = computed(() => {
303298
)
304299
})
305300
const handleCheckAllChange = (val: CheckboxValueType) => {
306-
multipleSelection.value = val ? paragraphDetail.value.map((v) => v.id) : []
307-
checkAll.value = val as boolean
301+
let bool
302+
if(isIndeterminate.value) {
303+
bool = true
304+
} else {
305+
bool = val as boolean
306+
}
307+
multipleSelection.value = bool ? paragraphDetail.value.map((v) => v.id) : []
308+
checkAll.value = bool as boolean
308309
}
309310
310311
function toggleSelect(id: number) {
@@ -374,6 +375,7 @@ function deleteMulParagraph() {
374375
375376
function batchSelectedHandle(bool: boolean) {
376377
isBatch.value = bool
378+
checkAll.value = false
377379
multipleSelection.value = []
378380
}
379381

ui/src/views/tool-workflow/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ import DebugDrawer from './debug-drawer/DebugDrawer.vue'
179179
provide('getResourceDetail', () => detail)
180180
provide('workflowMode', WorkflowMode.Tool)
181181
provide('loopWorkflowMode', WorkflowMode.ToolLoop)
182-
const { theme } = useStore()
182+
const { theme, folder } = useStore()
183183
const router = useRouter()
184184
const route = useRoute()
185185
const {
@@ -512,6 +512,7 @@ const go = () => {
512512
} else if (route.path.includes('shared')) {
513513
return router.push({ path: '/system/shared/tool' })
514514
} else {
515+
folder.setCurrentFolder({ id: folderId })
515516
return router.push({ path: '/tool' })
516517
}
517518
}

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,14 @@ function batchSelectedHandle(bool: boolean) {
635635
}
636636
637637
const handleCheckAllChange = (val: CheckboxValueType) => {
638-
multipleSelection.value = val ? tool.toolList.map((v) => v.id) : []
639-
checkAll.value = val as boolean
638+
let bool
639+
if (isIndeterminate.value) {
640+
bool = true
641+
} else {
642+
bool = val as boolean
643+
}
644+
multipleSelection.value = bool ? tool.toolList.map((v) => v.id) : []
645+
checkAll.value = bool as boolean
640646
}
641647
const handleCheckedChatChange = (value: CheckboxValueType[]) => {
642648
const checkedCount = value.length
@@ -1221,6 +1227,7 @@ watch(
12211227
() => folder.currentFolder,
12221228
(newValue) => {
12231229
if (newValue && newValue.id) {
1230+
batchSelectedHandle(false)
12241231
paginationConfig.current_page = 1
12251232
tool.setToolList([])
12261233
getList()

0 commit comments

Comments
 (0)