diff --git a/src/api/task/task.ts b/src/api/task/task.ts index 501a26f..5087c50 100644 --- a/src/api/task/task.ts +++ b/src/api/task/task.ts @@ -15,7 +15,7 @@ export async function getApprovalList(page: any) { pageSize: page.pageSize, currPage: page.pageNo, keyword: page.keyword, - userSearchId:page.userSearchId + userSearchId: page.userSearchId, }, }) @@ -94,26 +94,36 @@ export async function getSimilarityList(params: any) { params, }) - const { data: { records, pages, total } } = res - // 精简一下数据 - const list = records.map((item) => { + const { data } = res + if (data) { + const { records, pages, total } = data + // 精简一下数据 + const list = records.map((item) => { + return { + id: item.id, + taskId: item.taskId, + taskname: item.fromtaskname, + assignee: item.assignee, + pictureid: item.pictureid, + imgurl: item.imgUrl, + thumburl: item.imgUrl, + iztrueorfalse: item.iztrueorfalse, + states: item.states, + } + }) + return { - id: item.id, - taskId: item.taskId, - taskname: item.fromtaskname, - assignee: item.assignee, - pictureid: item.pictureid, - imgurl: item.imgUrl, - thumburl: item.imgUrl, - iztrueorfalse: item.iztrueorfalse, - states: item.states, + pageCount: pages, + data: records, + total, + } + } + else { + return { + pageCount: 0, + data: [], + total: 0, } - }) - - return { - pageCount: pages, - data: records, - total, } } diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index 5a9539a..2d31538 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -74,7 +74,9 @@ function goPath(item, id) { const desiredObject = item.data.find((item) => { return item.id === id }) - storage.set('isSearch', true) + if (!storage.get('isSearch')) + storage.set('isSearch', true, Date.now() + 30 * 60 * 1000) + router.push({ name: item.path, query: { id, searchContent: desiredObject.name } }) emit('close') } diff --git a/src/layout/index.vue b/src/layout/index.vue index 6e39d10..b1d0c0b 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,5 +1,5 @@