Compare commits

..

No commits in common. '8df512b42906b5357c158c4aa3c6984f725a4411' and '22467928391b383ab38ad32eb0559e5bfcf8cd03' have entirely different histories.

@ -15,7 +15,7 @@ export async function getApprovalList(page: any) {
pageSize: page.pageSize, pageSize: page.pageSize,
currPage: page.pageNo, currPage: page.pageNo,
keyword: page.keyword, keyword: page.keyword,
userSearchId: page.userSearchId, userSearchId:page.userSearchId
}, },
}) })
@ -94,36 +94,26 @@ export async function getSimilarityList(params: any) {
params, params,
}) })
const { data } = res const { data: { records, pages, total } } = res
if (data) { // 精简一下数据
const { records, pages, total } = data const list = records.map((item) => {
// 精简一下数据
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 {
pageCount: pages,
data: records,
total,
}
}
else {
return { return {
pageCount: 0, id: item.id,
data: [], taskId: item.taskId,
total: 0, taskname: item.fromtaskname,
assignee: item.assignee,
pictureid: item.pictureid,
imgurl: item.imgUrl,
thumburl: item.imgUrl,
iztrueorfalse: item.iztrueorfalse,
states: item.states,
} }
})
return {
pageCount: pages,
data: records,
total,
} }
} }

@ -74,9 +74,7 @@ function goPath(item, id) {
const desiredObject = item.data.find((item) => { const desiredObject = item.data.find((item) => {
return item.id === id return item.id === id
}) })
if (!storage.get('isSearch')) storage.set('isSearch', true)
storage.set('isSearch', true, Date.now() + 30 * 60 * 1000)
router.push({ name: item.path, query: { id, searchContent: desiredObject.name } }) router.push({ name: item.path, query: { id, searchContent: desiredObject.name } })
emit('close') emit('close')
} }

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeMount, onMounted, unref } from 'vue' import { computed, onBeforeMount, unref } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { Logo } from './components/Logo' import { Logo } from './components/Logo'
import { MainView } from './components/Main' import { MainView } from './components/Main'
@ -10,7 +10,7 @@ import { storage } from '@/utils/Storage'
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
onMounted(() => { onBeforeMount(() => {
/** /**
* 如果刷新则去掉筛选条件 * 如果刷新则去掉筛选条件
* 1. 如果当前页面路由与上一个页面路由相同时则为刷新 * 1. 如果当前页面路由与上一个页面路由相同时则为刷新
@ -20,13 +20,14 @@ onMounted(() => {
* 4. 搜索点击->存storage->跳转页面->onMounted * 4. 搜索点击->存storage->跳转页面->onMounted
* ->如果storage为true则不replace 并将storage置false * ->如果storage为true则不replace 并将storage置false
*/ */
if (storage.get('isSearch')) { if (
storage.remove('isSearch') history.state.back == route.path
&& JSON.stringify(route.query).trim() != '{}'
&& storage.get('isSearch')
) {
storage.set('isSearch', false)
router.replace(route.path) router.replace(route.path)
return
} }
if (history.state.back == route.path && JSON.stringify(route.query).trim() != '{}')
router.replace(route.path)
}) })
const { menuSetting } = useProjectSetting() const { menuSetting } = useProjectSetting()

Loading…
Cancel
Save