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 MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
import Pages from "@/components/aboutTable/Pages.vue";
|
import Pages from "@/components/aboutTable/Pages.vue";
|
||||||
import Search from "@/components/aboutTable/Search.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 { 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";
|
import AddForm from "./addForm.vue";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
|
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
|
||||||
const detailDiloag = ref();
|
const detailDiloag = ref();
|
||||||
const searchBox = ref(); //搜索框
|
const searchBox = ref(); //搜索框
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tabHeightFn()
|
tabHeightFn()
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
detailDiloag.value.init('edit', {
|
nextTick(() => {
|
||||||
|
addForm.value && addForm.value.init('edit', {
|
||||||
id: route.query.id
|
id: route.query.id
|
||||||
});
|
});
|
||||||
return
|
router.replace({ path: '/strategicResearch' })// 移除id 避免刷新一直带参数
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
getList()
|
||||||
});
|
});
|
||||||
/** 是否市情报指挥中心 */
|
/** 是否市情报指挥中心 */
|
||||||
@ -140,7 +146,6 @@ const tabHeightFn = () => {
|
|||||||
tabHeightFn();
|
tabHeightFn();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
const addForm = ref(null)
|
const addForm = ref(null)
|
||||||
const getDataById = (type, row) => {
|
const getDataById = (type, row) => {
|
||||||
|
|||||||
@ -46,21 +46,26 @@ import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
|||||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
import Pages from "@/components/aboutTable/Pages.vue";
|
import Pages from "@/components/aboutTable/Pages.vue";
|
||||||
import Search from "@/components/aboutTable/Search.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 { 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";
|
import AddForm from "./addForm.vue";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
|
const { D_BZ_YPFS, D_BZ_YPLX } = proxy.$dict("D_BZ_YPFS", "D_BZ_YPLX")
|
||||||
const detailDiloag = ref();
|
const detailDiloag = ref();
|
||||||
const searchBox = ref(); //搜索框
|
const searchBox = ref(); //搜索框
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tabHeightFn()
|
tabHeightFn()
|
||||||
if (route.query.id) {
|
if (route.query.id) {
|
||||||
detailDiloag.value.init('edit', {
|
nextTick(() => {
|
||||||
|
addForm.value && addForm.value.init('edit', {
|
||||||
id: route.query.id
|
id: route.query.id
|
||||||
});
|
});
|
||||||
return
|
router.replace({ path: '/tacticalResearch' })// 移除id 避免刷新一直带参数
|
||||||
|
})
|
||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
});
|
});
|
||||||
@ -140,7 +145,7 @@ const tabHeightFn = () => {
|
|||||||
tabHeightFn();
|
tabHeightFn();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const route = useRoute()
|
// const route = useRoute()
|
||||||
|
|
||||||
const addForm = ref(null)
|
const addForm = ref(null)
|
||||||
const getDataById = (type, row) => {
|
const getDataById = (type, row) => {
|
||||||
|
|||||||
@ -116,8 +116,10 @@ const stopAutoScroll = () => {
|
|||||||
// 点击项
|
// 点击项
|
||||||
const chooseItem = (item) => {
|
const chooseItem = (item) => {
|
||||||
stopAutoScroll(); // 点击时停止自动滚动
|
stopAutoScroll(); // 点击时停止自动滚动
|
||||||
|
const path = props.bglx === '01' ? '/tacticalResearch' : '/strategicResearch'
|
||||||
router.push({
|
router.push({
|
||||||
path: '/forumPost',
|
// path: '/forumPost',
|
||||||
|
path: path,
|
||||||
query: { id: item.id }
|
query: { id: item.id }
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@ -125,7 +127,9 @@ const chooseItem = (item) => {
|
|||||||
// 添加跳转
|
// 添加跳转
|
||||||
const chooseForumPost = () => {
|
const chooseForumPost = () => {
|
||||||
stopAutoScroll(); // 点击时停止自动滚动
|
stopAutoScroll(); // 点击时停止自动滚动
|
||||||
router.push({ path: '/forumPost' })
|
const path = props.bglx === '01' ? '/tacticalResearch' : '/strategicResearch'
|
||||||
|
|
||||||
|
router.push({ path: path })
|
||||||
};
|
};
|
||||||
|
|
||||||
// 生命周期
|
// 生命周期
|
||||||
|
|||||||
Reference in New Issue
Block a user