From 6b1864b079a0e80f8c2c11d858baa919501504bd Mon Sep 17 00:00:00 2001 From: zhufu <17863654727@163.com> Date: Mon, 24 Feb 2025 10:14:31 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=98=AF=E5=90=A6=E5=8F=91=E5=B8=83=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectItemsList/hooks/useData.hook.ts | 11 +++++++++ .../components/ProjectItemsList/index.vue | 24 +++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) 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 @@