feat: 优化跳转
This commit is contained in:
@ -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()
|
||||
});
|
||||
/** 是否市情报指挥中心 */
|
||||
@ -140,7 +146,6 @@ const tabHeightFn = () => {
|
||||
tabHeightFn();
|
||||
};
|
||||
};
|
||||
const route = useRoute()
|
||||
|
||||
const addForm = ref(null)
|
||||
const getDataById = (type, row) => {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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 })
|
||||
};
|
||||
|
||||
// 生命周期
|
||||
|
||||
Reference in New Issue
Block a user