1 parent
0ce91bd0e5
commit
4c6f21ef78
4 files changed
+57
-14
No files matched your search
@@ -26,6 +26,7 @@ const totalPages = ref(1)
|
||||
const serverItems = ref<Issue[]>([])
|
||||
|
||||
const text = ref<string | null>(null)
|
||||
const assigneeId = ref<string | null>(null)
|
||||
const selected = ref<[string] | []>([])
|
||||
const batch = ref<number[]>([])
|
||||
const deleting = ref(false)
|
||||
@@ -35,6 +36,7 @@ async function fetch() {
|
||||
page: page.value,
|
||||
limit: itemsPerPage.value,
|
||||
text: text.value,
|
||||
assigneeId: assigneeId.value,
|
||||
projectId: currentProjectId.value,
|
||||
})
|
||||
|
||||
@@ -52,6 +54,7 @@ function syncQuery() {
|
||||
const query: Record<string, string> = { page: String(page.value) }
|
||||
|
||||
if (text.value) query.text = text.value
|
||||
if (assigneeId.value) query.assignee = assigneeId.value
|
||||
if (selected.value.length) query.selected_issue = selected.value[0]
|
||||
|
||||
router.replace({ query })
|
||||
@@ -62,6 +65,7 @@ watch(
|
||||
(query) => {
|
||||
page.value = query.page ? Number(query.page) : 1
|
||||
text.value = query.text ? String(query.text) : null
|
||||
assigneeId.value = query.assignee ? String(query.assignee) : null
|
||||
selected.value = query.selected_issue ? [String(query.selected_issue)] : []
|
||||
},
|
||||
{ immediate: true },
|
||||
@@ -92,6 +96,20 @@ async function onTextChanged(value: string | null) {
|
||||
await load()
|
||||
}
|
||||
|
||||
async function onAssigneeChanged(value: string | null) {
|
||||
assigneeId.value = value
|
||||
page.value = 1
|
||||
await load()
|
||||
}
|
||||
|
||||
async function onClear() {
|
||||
text.value = null
|
||||
assigneeId.value = null
|
||||
page.value = 1
|
||||
|
||||
await load()
|
||||
}
|
||||
|
||||
function close() {
|
||||
selected.value = []
|
||||
}
|
||||
@@ -153,7 +171,14 @@ async function onDeleteBatch() {
|
||||
<div class="d-flex flex-column ga-2">
|
||||
<div class="u-grid ga-1">
|
||||
<div class="u-height">
|
||||
<issue-filter class="mb-2" :text="text" @update:text="onTextChanged" />
|
||||
<issue-filter
|
||||
class="mb-2"
|
||||
:text="text"
|
||||
:assignee-id="assigneeId"
|
||||
@update:text="onTextChanged"
|
||||
@update:assignee-id="onAssigneeChanged"
|
||||
@update:clear="onClear"
|
||||
/>
|
||||
<v-list class="pa-0" density="compact" v-model:selected="selected" mandatory>
|
||||
<v-list-item>
|
||||
<template #prepend>
|
||||
|
||||
Reference in new issue
Block a user