feat: add status filter
This commit is contained in:
parent
5ac8707f38
commit
d4afc09614
2 changed files with 9 additions and 0 deletions
|
|
@ -96,6 +96,12 @@ async function fetchWorkflowList() {
|
||||||
page: workflowPage.value,
|
page: workflowPage.value,
|
||||||
pageSize: workflowPageSize.value,
|
pageSize: workflowPageSize.value,
|
||||||
query: pageState.inputSearch,
|
query: pageState.inputSearch,
|
||||||
|
status:
|
||||||
|
statusFilter.value === 'all'
|
||||||
|
? undefined
|
||||||
|
: statusFilter.value === 'statusACTIVE'
|
||||||
|
? 'ACTIVE'
|
||||||
|
: 'INACTIVE',
|
||||||
});
|
});
|
||||||
if (res) {
|
if (res) {
|
||||||
workflowData.value = res.result;
|
workflowData.value = res.result;
|
||||||
|
|
@ -109,6 +115,7 @@ onMounted(async () => {
|
||||||
await fetchWorkflowList();
|
await fetchWorkflowList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(statusFilter, fetchWorkflowList);
|
||||||
watch(() => pageState.inputSearch, fetchWorkflowList);
|
watch(() => pageState.inputSearch, fetchWorkflowList);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { defineStore } from 'pinia';
|
||||||
import { api } from 'src/boot/axios';
|
import { api } from 'src/boot/axios';
|
||||||
import { PaginationResult } from 'src/types';
|
import { PaginationResult } from 'src/types';
|
||||||
import { WorkflowTemplate, WorkflowTemplatePayload } from './types';
|
import { WorkflowTemplate, WorkflowTemplatePayload } from './types';
|
||||||
|
import { Status } from '../types';
|
||||||
|
|
||||||
export const useWorkflowTemplate = defineStore('workflow-store', () => {
|
export const useWorkflowTemplate = defineStore('workflow-store', () => {
|
||||||
const data = ref<WorkflowTemplate[]>([]);
|
const data = ref<WorkflowTemplate[]>([]);
|
||||||
|
|
@ -22,6 +23,7 @@ export const useWorkflowTemplate = defineStore('workflow-store', () => {
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
|
status?: Status;
|
||||||
}) {
|
}) {
|
||||||
const res = await api.get<PaginationResult<WorkflowTemplate>>(
|
const res = await api.get<PaginationResult<WorkflowTemplate>>(
|
||||||
'/workflow-template',
|
'/workflow-template',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue