Commit 526de358 by haojie

重新进入创建直播页面会初始化页面的问题

parent c00044ec
...@@ -21,6 +21,7 @@ import { useRoute, useRouter } from 'vue-router'; ...@@ -21,6 +21,7 @@ import { useRoute, useRouter } from 'vue-router';
import { createLiveRouteKey } from '@/constants/token'; import { createLiveRouteKey } from '@/constants/token';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { computed } from 'vue'; import { computed } from 'vue';
import { jumpToCreateLivePage } from '@/router/jump';
const store = useStore(); const store = useStore();
const route = useRoute(); const route = useRoute();
...@@ -50,14 +51,16 @@ const jump = (item: any) => { ...@@ -50,14 +51,16 @@ const jump = (item: any) => {
let query = window.localStorage.getItem(createLiveRouteKey); let query = window.localStorage.getItem(createLiveRouteKey);
if (query) { if (query) {
params = JSON.parse(query); params = JSON.parse(query);
jumpToCreateLivePage(params, false);
} }
} } else {
router.push({ router.push({
path: item.path, path: item.path,
query: { query: {
...params, ...params,
}, },
}); });
}
}; };
// 删除当前导航 // 删除当前导航
......
...@@ -58,6 +58,7 @@ import { useRouter } from 'vue-router'; ...@@ -58,6 +58,7 @@ import { useRouter } from 'vue-router';
import routerConfig from '@/router/tool'; import routerConfig from '@/router/tool';
import { getDigitalPeopleList } from '@/service/Common'; import { getDigitalPeopleList } from '@/service/Common';
import { LIVE_AUDIT_STATUS } from '@/service/Live'; import { LIVE_AUDIT_STATUS } from '@/service/Live';
import { jumpToCreateLivePage } from '@/router/jump';
const router = useRouter(); const router = useRouter();
const personList = reactive({ const personList = reactive({
...@@ -89,14 +90,13 @@ const getList = async () => { ...@@ -89,14 +90,13 @@ const getList = async () => {
loading.value = false; loading.value = false;
}; };
const startLive = (item: any) => { const startLive = (item: any) => {
router.push({ jumpToCreateLivePage(
path: routerConfig.createLive.path, {
name: routerConfig.createLive.name,
query: {
id: item.id, id: item.id,
title: '', title: '',
}, },
}); true,
);
}; };
onMounted(() => { onMounted(() => {
......
...@@ -450,7 +450,7 @@ const confirm = async () => { ...@@ -450,7 +450,7 @@ const confirm = async () => {
const initPage = () => { const initPage = () => {
let type = route.query.type; let type = route.query.type;
// 清空缓存数据 // 清空缓存数据
if (type === 'new') { if (route.query.clearCache === 'true') {
submitSuccessed('', false); submitSuccessed('', false);
} }
}; };
......
...@@ -52,6 +52,7 @@ import Dialog from '@/components/Dialog.vue'; ...@@ -52,6 +52,7 @@ import Dialog from '@/components/Dialog.vue';
import { ref, watch } from 'vue'; import { ref, watch } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import routerConfig from '@/router/tool'; import routerConfig from '@/router/tool';
import { jumpToCreateLivePage } from '@/router/jump';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -92,15 +93,7 @@ const changeBtn = (item: any) => { ...@@ -92,15 +93,7 @@ const changeBtn = (item: any) => {
// 确认 // 确认
const confirm = () => { const confirm = () => {
visible.value = false; visible.value = false;
router.push({ jumpToCreateLivePage({ id: currentCard.value, title: '', type: 'new' }, true);
path: routerConfig.createLive.path,
name: routerConfig.createLive.name,
query: {
id: currentCard.value,
title: '',
type: 'new',
},
});
}; };
watch( watch(
......
...@@ -37,6 +37,7 @@ import { onUpdateDrafts } from '@/service/Common'; ...@@ -37,6 +37,7 @@ import { onUpdateDrafts } from '@/service/Common';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import routerConfig from '@/router/tool'; import routerConfig from '@/router/tool';
import { show_message } from '@/utils/tool'; import { show_message } from '@/utils/tool';
import { jumpToCreateLivePage } from '@/router/jump';
const router = useRouter(); const router = useRouter();
...@@ -95,15 +96,14 @@ const nameChange = async (id: any, value: string) => { ...@@ -95,15 +96,14 @@ const nameChange = async (id: any, value: string) => {
}; };
const onEdit = (item: any) => { const onEdit = (item: any) => {
router.push({ jumpToCreateLivePage(
path: routerConfig.createLive.path, {
name: routerConfig.createLive.name,
query: {
id: item.id, id: item.id,
title: item.name, title: item.name,
type: 'edit_drafts', type: 'edit_drafts',
}, },
}); true,
);
}; };
onMounted(() => { onMounted(() => {
......
...@@ -69,6 +69,7 @@ import { onUpdateLiveTask } from '@/service/Common'; ...@@ -69,6 +69,7 @@ import { onUpdateLiveTask } from '@/service/Common';
import { getLiveTask, deleteLiveTask } from '@/utils/api/userApi'; import { getLiveTask, deleteLiveTask } from '@/utils/api/userApi';
import { isDev, show_message } from '@/utils/tool'; import { isDev, show_message } from '@/utils/tool';
import { callPyjsInWindow, injectWindow } from '@/utils/pyqt'; import { callPyjsInWindow, injectWindow } from '@/utils/pyqt';
import { jumpToCreateLivePage } from '@/router/jump';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -172,15 +173,14 @@ const onEdit = (item: any) => { ...@@ -172,15 +173,14 @@ const onEdit = (item: any) => {
show_message('直播中的禁止编辑'); show_message('直播中的禁止编辑');
return; return;
} }
router.push({ jumpToCreateLivePage(
path: routerConfig.createLive.path, {
name: routerConfig.createLive.name,
query: {
id: item.id, id: item.id,
status: item.status, status: item.status,
type: 'edit', type: 'edit',
}, },
}); true,
);
}; };
const onDelete = (item: any) => { const onDelete = (item: any) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment