Skip to content

Commit 5a9a07c

Browse files
committed
fix: Doc status filter
1 parent 2b71e1b commit 5a9a07c

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

ui/src/views/document/index.vue

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,74 @@
202202
:label="$t('views.document.fileStatus.label')"
203203
width="120"
204204
>
205+
<template #header>
206+
<div>
207+
<span>{{ $t('views.document.fileStatus.label') }}</span>
208+
<el-dropdown trigger="click" @command="dropdownHandle">
209+
<el-button
210+
style="margin-top: 1px"
211+
link
212+
:type="filterMethod['status'] ? 'primary' : ''"
213+
>
214+
<el-icon>
215+
<Filter />
216+
</el-icon>
217+
</el-button>
218+
<template #dropdown>
219+
<el-dropdown-menu style="width: 100px">
220+
<el-dropdown-item
221+
:class="filterMethod['status'] ? '' : 'is-active'"
222+
:command="beforeCommand('status', '')"
223+
class="justify-center"
224+
>{{ $t('common.status.all') }}
225+
</el-dropdown-item>
226+
<el-dropdown-item
227+
:class="filterMethod['status'] === State.SUCCESS ? 'is-active' : ''"
228+
class="justify-center"
229+
:command="beforeCommand('status', State.SUCCESS)"
230+
>{{ $t('common.status.success') }}
231+
</el-dropdown-item>
232+
<el-dropdown-item
233+
:class="filterMethod['status'] === State.FAILURE ? 'is-active' : ''"
234+
class="justify-center"
235+
:command="beforeCommand('status', State.FAILURE)"
236+
>{{ $t('common.status.fail') }}
237+
</el-dropdown-item>
238+
<el-dropdown-item
239+
:class="
240+
filterMethod['status'] === State.STARTED &&
241+
filterMethod['task_type'] == TaskType.EMBEDDING
242+
? 'is-active'
243+
: ''
244+
"
245+
class="justify-center"
246+
:command="beforeCommand('status', State.STARTED, TaskType.EMBEDDING)"
247+
>{{ $t('views.document.fileStatus.EMBEDDING') }}
248+
</el-dropdown-item>
249+
<el-dropdown-item
250+
:class="filterMethod['status'] === State.PENDING ? 'is-active' : ''"
251+
class="justify-center"
252+
:command="beforeCommand('status', State.PENDING)"
253+
>{{ $t('views.document.fileStatus.PENDING') }}
254+
</el-dropdown-item>
255+
<el-dropdown-item
256+
:class="
257+
filterMethod['status'] === State.STARTED &&
258+
filterMethod['task_type'] === TaskType.GENERATE_PROBLEM
259+
? 'is-active'
260+
: ''
261+
"
262+
class="justify-center"
263+
:command="
264+
beforeCommand('status', State.STARTED, TaskType.GENERATE_PROBLEM)
265+
"
266+
>{{ $t('views.document.fileStatus.GENERATE') }}
267+
</el-dropdown-item>
268+
</el-dropdown-menu>
269+
</template>
270+
</el-dropdown>
271+
</div>
272+
</template>
205273
<template #default="{ row }">
206274
<StatusValue :status="row.status" :status-meta="row.status_meta"></StatusValue>
207275
</template>

0 commit comments

Comments
 (0)