From 2ba8ac607e54aba569d9133e9dc916c5062a6fc8 Mon Sep 17 00:00:00 2001 From: huangchengfa <171504222@qq.com> Date: Thu, 18 Dec 2025 20:08:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JudgmentHome/strategicResearch/index.vue | 21 ++++++++++++------- .../JudgmentHome/tacticalResearch/index.vue | 21 ++++++++++++------- src/views/home/model/tacticalYp.vue | 8 +++++-- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue b/src/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue index a3771ad..bfd81f0 100644 --- a/src/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue +++ b/src/views/backOfficeSystem/JudgmentHome/strategicResearch/index.vue @@ -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', { - id: route.query.id - }); - return + nextTick(() => { + addForm.value && addForm.value.init('edit', { + id: route.query.id + }); + 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) => { diff --git a/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue b/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue index 9fb6238..1174200 100644 --- a/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue +++ b/src/views/backOfficeSystem/JudgmentHome/tacticalResearch/index.vue @@ -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', { - id: route.query.id - }); - return + nextTick(() => { + addForm.value && addForm.value.init('edit', { + id: route.query.id + }); + router.replace({ path: '/tacticalResearch' })// 移除id 避免刷新一直带参数 + }) } getList() }); @@ -123,7 +128,7 @@ const changeSize = (val) => { // 获取列表 const getList = () => { pageData.tableConfiger.loading = true; - // bglx 报告类型(01 战术研判 02 战略研判) + // bglx 报告类型(01 战术研判 02 战略研判) let data = { ...pageData.pageConfiger, ...queryFrom.value, bglx: '01' }; tacticalGet(data).then(res => { pageData.tableData = res.records || []; @@ -140,7 +145,7 @@ const tabHeightFn = () => { tabHeightFn(); }; }; -const route = useRoute() +// const route = useRoute() const addForm = ref(null) const getDataById = (type, row) => { diff --git a/src/views/home/model/tacticalYp.vue b/src/views/home/model/tacticalYp.vue index ed9124a..b00cd80 100644 --- a/src/views/home/model/tacticalYp.vue +++ b/src/views/home/model/tacticalYp.vue @@ -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 }) }; // 生命周期