diff --git a/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts b/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts index cf337a0..091dbf7 100644 --- a/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts +++ b/src/views/project/items/components/ProjectItemsList/hooks/useData.hook.ts @@ -18,6 +18,7 @@ export const useDataListInit = () => { count: 10, }); + const state = ref('0') const list = ref([]); // const list = ref([ // { @@ -58,6 +59,7 @@ export const useDataListInit = () => { const res = await projectListApi({ page: paginat.page, limit: paginat.limit, + state: state.value == '0'? '': state.value, }); if (res && res.items) { const { total } = res as any; // 这里的count与data平级,不在Response结构中 @@ -87,6 +89,13 @@ export const useDataListInit = () => { fetchList(); }; + // 修改筛选条件 + const changeState = (value) => { + console.log(111,value) + state.value = value + fetchList(); + } + // 修改大小 const changeSize = (_size: number) => { paginat.limit = _size; @@ -147,10 +156,12 @@ export const useDataListInit = () => { loading, paginat, list, + state, fetchList, releaseHandle, changeSize, changePage, deleteHandle, + changeState, }; }; diff --git a/src/views/project/items/components/ProjectItemsList/index.vue b/src/views/project/items/components/ProjectItemsList/index.vue index 76edf9d..a43a629 100644 --- a/src/views/project/items/components/ProjectItemsList/index.vue +++ b/src/views/project/items/components/ProjectItemsList/index.vue @@ -1,12 +1,23 @@