首页所有跳转页面通用方法修改

This commit is contained in:
2026-09-29 17:31:05 +08:00
parent ef7c65be05
commit 7352d5c186
3 changed files with 4 additions and 12 deletions
+3 -6
View File
@@ -38,14 +38,12 @@ const jumpTo = (key: string,qid:number = 0) => {
routerPushByKey(key,{ query: { id: qid.toString() } });
}else if(key==='details_closedoc' && qid){
routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } });
}else if(key==='details_index' && qid){
routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } });
}else{
routerPushByKey(key as any);
}
}
// 打开变更详情
const openDetail = (row: any) => {
routerPushByKey("details_index",{ query: { id: row?.change_id?.toString(),key:'home' } });
};
// 获取当前时间字符串
const getCurrentTimeStr = () => {
@@ -79,7 +77,6 @@ const getData = async () => {
const {data,error} = await homeApi();
if(!error){
homeData.value = data;
console.log(data)
}
loading.value = false;
}
@@ -240,7 +237,7 @@ onUnmounted(() => {
</div>
<div class="flex flex-col gap-3">
<template v-if="homeData?.my_changes_progress?.total > 0">
<div v-for="row in homeData?.my_changes_progress?.items?.slice(0, 3) || []" :key="row.change_id" @click="openDetail(row)"
<div v-for="row in homeData?.my_changes_progress?.items?.slice(0, 3) || []" :key="row.change_id" @click="jumpTo('details_index',row.change_id)"
class="cursor-pointer flex w-full items-center gap-3 border px-3.5 py-2.5 text-left transition hover:border-[var(--hover-border)] hover:bg-[var(--hover-bg)] hover:bg-[#EAF0F9]/40"
:style="{
borderRadius: themeStore.themeRadius + 'px',
+1 -5
View File
@@ -25,11 +25,7 @@ const homeData = ref<any>(null);
// 跳转变更申请页面、变更台账、我的任务、发起变更
const jumpTo = (key: string,qid:number = 0) => {
if(key==='my_initiatechange' && qid){
routerPushByKey(key,{ query: { id: qid.toString() } });
}else if(key==='details_closedoc' && qid){
routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } });
}else if(key==='details_index' && qid){
if(key==='details_index' && qid){
routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } });
}else if(key==='details_approval' && qid){
routerPushByKey(key,{ query: { id: qid.toString(),key:'home' } });
-1
View File
@@ -65,7 +65,6 @@ const getData = async () => {
loading.value = true;
const {data,error} = await homeQualityApi();
if(!error){
console.log(data)
homeData.value = data;
}
loading.value = false;