Add flag filter dropdown to submissions page
Allows filtering submissions by flag color using a select dropdown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,18 @@
|
|||||||
返回首页
|
返回首页
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-flex align="center">
|
<n-flex align="center">
|
||||||
|
<n-select
|
||||||
|
v-model:value="query.flag"
|
||||||
|
style="width: 100px"
|
||||||
|
clearable
|
||||||
|
placeholder="标记"
|
||||||
|
:options="[
|
||||||
|
{ label: '红旗', value: 'red' },
|
||||||
|
{ label: '蓝旗', value: 'blue' },
|
||||||
|
{ label: '绿旗', value: 'green' },
|
||||||
|
{ label: '黄旗', value: 'yellow' },
|
||||||
|
]"
|
||||||
|
/>
|
||||||
<div>
|
<div>
|
||||||
<n-input
|
<n-input
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
@@ -139,6 +151,7 @@ const count = ref(0)
|
|||||||
const query = reactive({
|
const query = reactive({
|
||||||
page: Number(route.params.page),
|
page: Number(route.params.page),
|
||||||
username: route.query.username ?? "",
|
username: route.query.username ?? "",
|
||||||
|
flag: "" as string,
|
||||||
})
|
})
|
||||||
|
|
||||||
const html = computed(() => submission.value.html)
|
const html = computed(() => submission.value.html)
|
||||||
@@ -372,6 +385,13 @@ watchDebounced(
|
|||||||
},
|
},
|
||||||
{ debounce: 500, maxWait: 1000 },
|
{ debounce: 500, maxWait: 1000 },
|
||||||
)
|
)
|
||||||
|
watch(
|
||||||
|
() => query.flag,
|
||||||
|
() => {
|
||||||
|
query.page = 1
|
||||||
|
init()
|
||||||
|
},
|
||||||
|
)
|
||||||
onMounted(init)
|
onMounted(init)
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
submission.value = {
|
submission.value = {
|
||||||
|
|||||||
Reference in New Issue
Block a user