feat: 优化跳转

This commit is contained in:
2025-12-18 20:08:37 +08:00
parent 186d1e0d53
commit 2ba8ac607e
3 changed files with 32 additions and 18 deletions

View File

@ -46,22 +46,28 @@ import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { tacticalGet, strategicDelete } from "@/api/huiShangyp/strategicApi.js";
import { reactive, ref, onMounted, getCurrentInstance, watch,computed } from "vue";
import { reactive, ref, onMounted, getCurrentInstance, watch, computed,nextTick } from "vue";
import AddForm from "./addForm.vue";
const { proxy } = getCurrentInstance();
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
const detailDiloag = ref();
const searchBox = ref(); //搜索框
const router = useRouter();
const route = useRoute();
onMounted(() => {
tabHeightFn()
if (route.query.id) {
detailDiloag.value.init('edit', {
nextTick(() => {
addForm.value && addForm.value.init('edit', {
id: route.query.id
});
return
router.replace({ path: '/strategicResearch' })// 移除id 避免刷新一直带参数
})
}
getList()
});
/** 是否市情报指挥中心 */
@ -136,11 +142,10 @@ const getList = () => {
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function () {
window.onresize = function() {
tabHeightFn();
};
};
const route = useRoute()
const addForm = ref(null)
const getDataById = (type, row) => {

View File

@ -46,21 +46,26 @@ import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { tacticalGet, strategicDelete } from "@/api/huiShangyp/tacticalApi.js";
import { reactive, ref, onMounted, getCurrentInstance, watch, computed } from "vue";
import { reactive, ref, onMounted, getCurrentInstance, watch, computed, nextTick } from "vue";
import AddForm from "./addForm.vue";
const { proxy } = getCurrentInstance();
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
const detailDiloag = ref();
const searchBox = ref(); //搜索框
const router = useRouter();
const route = useRoute();
onMounted(() => {
tabHeightFn()
if (route.query.id) {
detailDiloag.value.init('edit', {
nextTick(() => {
addForm.value && addForm.value.init('edit', {
id: route.query.id
});
return
router.replace({ path: '/tacticalResearch' })// 移除id 避免刷新一直带参数
})
}
getList()
});
@ -140,7 +145,7 @@ const tabHeightFn = () => {
tabHeightFn();
};
};
const route = useRoute()
// const route = useRoute()
const addForm = ref(null)
const getDataById = (type, row) => {

View File

@ -116,8 +116,10 @@ const stopAutoScroll = () => {
// 点击项
const chooseItem = (item) => {
stopAutoScroll(); // 点击时停止自动滚动
const path = props.bglx === '01' ? '/tacticalResearch' : '/strategicResearch'
router.push({
path: '/forumPost',
// path: '/forumPost',
path: path,
query: { id: item.id }
})
};
@ -125,7 +127,9 @@ const chooseItem = (item) => {
// 添加跳转
const chooseForumPost = () => {
stopAutoScroll(); // 点击时停止自动滚动
router.push({ path: '/forumPost' })
const path = props.bglx === '01' ? '/tacticalResearch' : '/strategicResearch'
router.push({ path: path })
};
// 生命周期