Commit c00044ec by haojie

解决第二次创建直播没有uuid的问题

parent 7227ad85
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
const props = withDefaults( withDefaults(
defineProps<{ defineProps<{
theme?: string; theme?: string;
size?: string; size?: string;
......
...@@ -312,9 +312,11 @@ export const processTextCallback = () => { ...@@ -312,9 +312,11 @@ export const processTextCallback = () => {
return uuid; return uuid;
} }
if (isConfuse) { if (isConfuse) {
console.log('洗稿任务uuid', currentConfuseId.value);
// 是洗稿任务 // 是洗稿任务
return currentConfuseId.value; return currentConfuseId.value;
} }
console.log('store uuid', createLiveInfo.value[createLiveKeys.scriptUuid]);
return createLiveInfo.value[createLiveKeys.scriptUuid]; return createLiveInfo.value[createLiveKeys.scriptUuid];
}; };
......
...@@ -42,7 +42,7 @@ const liveNameEvent = async (value: string) => { ...@@ -42,7 +42,7 @@ const liveNameEvent = async (value: string) => {
path: routerConfig.createLive.path, path: routerConfig.createLive.path,
name: routerConfig.createLive.name, name: routerConfig.createLive.name,
query: { query: {
id: route.query.id, ...route.query,
title: value, title: value,
}, },
}); });
......
...@@ -37,29 +37,6 @@ const imgs = { ...@@ -37,29 +37,6 @@ const imgs = {
close: new URL('../../assets/svg/home/close.svg', import.meta.url).href, close: new URL('../../assets/svg/home/close.svg', import.meta.url).href,
}; };
// const navigatorList = [
// {
// icon: imgs.live,
// label: '直播创建',
// path: routerConfig.createLive.path,
// },
// {
// icon: imgs.person,
// label: '形象定制',
// path: routerConfig.ImageCustomization.path,
// },
// {
// icon: imgs.speak,
// label: '声音定制',
// path: routerConfig.VocalCustomization.path,
// },
// {
// icon: imgs.interaction,
// label: '互动回答',
// path: routerConfig.createInteract.path,
// },
// ];
const goHome = () => { const goHome = () => {
router.push({ router.push({
path: routerConfig.home.path, path: routerConfig.home.path,
...@@ -77,7 +54,9 @@ const jump = (item: any) => { ...@@ -77,7 +54,9 @@ const jump = (item: any) => {
} }
router.push({ router.push({
path: item.path, path: item.path,
query: params, query: {
...params,
},
}); });
}; };
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import AddVideoPlay from '@/components/AddVideoPlay.vue'; import AddVideoPlay from '@/components/AddVideoPlay.vue';
import { getLiveDetail } from '@/utils/api/userApi'; import { getLiveDetail, closeLiveTask } from '@/utils/api/userApi';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { show_message, isDev, DataType } from '@/utils/tool'; import { show_message, isDev, DataType } from '@/utils/tool';
import { callPyjsInWindow, injectWindow } from '@/utils/pyqt'; import { callPyjsInWindow, injectWindow } from '@/utils/pyqt';
...@@ -519,9 +519,23 @@ const getTone = async () => { ...@@ -519,9 +519,23 @@ const getTone = async () => {
} }
}; };
//
const closeLive = async () => {
try {
let res: any = await closeLiveTask(route.query.id);
if (res.code == 0) {
// 通知python刷新所有首页的直播列表
callPyjsInWindow('reloadLiveTaskList');
}
} catch (e) {
console.log(e);
}
};
onMounted(async () => { onMounted(async () => {
// 将通知方法注入window // 将通知方法注入window
injectWindow('mergeCallback', mergeCallback); injectWindow('mergeCallback', mergeCallback);
injectWindow('closeLive', closeLive);
// 传递用户token // 传递用户token
try { try {
window.pyjs.setToken(getUserCookie()); window.pyjs.setToken(getUserCookie());
......
...@@ -333,9 +333,7 @@ watch( ...@@ -333,9 +333,7 @@ watch(
watch( watch(
() => props.info, () => props.info,
(v) => { (v) => {
if (v) { if (v && Object.keys(v).length) {
console.log(v);
if (Object.keys(v).length) {
questionValue.value = v.problem; questionValue.value = v.problem;
switchStatus.value = v.status == 1 ? true : false; switchStatus.value = v.status == 1 ? true : false;
// 根据type赋值 // 根据type赋值
...@@ -344,6 +342,11 @@ watch( ...@@ -344,6 +342,11 @@ watch(
// 音频回复类型 // 音频回复类型
tonesValue.value = v.phonetic_timbres_id; tonesValue.value = v.phonetic_timbres_id;
tonesFile.value = v.reply_content; tonesFile.value = v.reply_content;
// 选择后的音色
let soundColorObj = lists.soundColor.find((item: any) => item.id == v.phonetic_timbres_id);
if (soundColorObj) {
tonesInfo.value = soundColorObj;
}
} else { } else {
currentTab.value = '2'; currentTab.value = '2';
// 文字 // 文字
...@@ -361,9 +364,6 @@ watch( ...@@ -361,9 +364,6 @@ watch(
soundColorInfo.value = soundColorObj; soundColorInfo.value = soundColorObj;
} }
} }
} else {
//
}
} }
}, },
); );
...@@ -498,6 +498,7 @@ onMounted(() => { ...@@ -498,6 +498,7 @@ onMounted(() => {
} }
.my-tones-active { .my-tones-active {
width: 100px; width: 100px;
height: 38px;
border-radius: 6px; border-radius: 6px;
border: 1px solid #04ae8a; border: 1px solid #04ae8a;
display: flex; display: flex;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<Dialog v-model="visible" @confirm="confirm"> <Dialog v-model="visible" @confirm="confirm">
<template #body> <template #body>
<div class="custom-add-interact-lib-dialog-body"> <div class="custom-add-interact-lib-dialog-body">
<span class="input-label">请输入互动库标题:</span> <span class="input-label">互动库标题:</span>
<CustomInput v-model="inputValue" align="left"></CustomInput> <CustomInput v-model="inputValue" align="left" placeholder="请输入互动库标题"></CustomInput>
</div> </div>
</template> </template>
</Dialog> </Dialog>
......
...@@ -149,7 +149,7 @@ const columns = [ ...@@ -149,7 +149,7 @@ const columns = [
{ {
title: '操作', title: '操作',
colKey: 'get3', colKey: 'get3',
cell: (h, { col, row }) => ( cell: (h, { row }) => (
<div class="edit-box"> <div class="edit-box">
<span class="edit-icon" onClick={rowChange.bind(this, row)}> <span class="edit-icon" onClick={rowChange.bind(this, row)}>
<EditSvg></EditSvg> <EditSvg></EditSvg>
......
...@@ -618,14 +618,6 @@ const getList = async () => { ...@@ -618,14 +618,6 @@ const getList = async () => {
updateTonesInfo(tonesValue.value, soundColorValue.value); updateTonesInfo(tonesValue.value, soundColorValue.value);
}; };
// 获取uuid
const getUuid = () => {
if (isDev()) {
return 'e6e973a5-ccdd-4779-a09a-be1658ecbea2';
}
return v4();
};
onMounted(async () => { onMounted(async () => {
// 获取上传配置 // 获取上传配置
ossConfig.value = await getUploadConfig(); ossConfig.value = await getUploadConfig();
...@@ -637,17 +629,6 @@ onMounted(async () => { ...@@ -637,17 +629,6 @@ onMounted(async () => {
// 获取音色音调列表 // 获取音色音调列表
getList(); getList();
commitInfo({
// 文本脚本的uuid
[createLiveKeys.scriptUuid]: getUuid(),
});
});
onActivated(() => {
commitInfo({
// 文本脚本的uuid
[createLiveKeys.scriptUuid]: getUuid(),
});
}); });
</script> </script>
......
...@@ -73,7 +73,7 @@ import HomeSvg from '@/assets/svg/createLive/home.svg'; ...@@ -73,7 +73,7 @@ import HomeSvg from '@/assets/svg/createLive/home.svg';
import InteractSvg from '@/assets/svg/createLive/interact.svg'; import InteractSvg from '@/assets/svg/createLive/interact.svg';
import ScriptsSvg from '@/assets/svg/createLive/scripts.svg'; import ScriptsSvg from '@/assets/svg/createLive/scripts.svg';
import { computed, onMounted, onBeforeMount, ref, onBeforeUnmount, onActivated, onDeactivated } from 'vue'; import { computed, onMounted, onBeforeMount, ref, onBeforeUnmount, onActivated, onDeactivated } from 'vue';
import { getElBounding, show_message, DataType, dimensionalConvert } from '@/utils/tool'; import { getElBounding, show_message, isDev, DataType, dimensionalConvert } from '@/utils/tool';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import { createLiveKeys, scriptTypeText, scriptTypePhonetics } from '@/service/CreateLive'; import { createLiveKeys, scriptTypeText, scriptTypePhonetics } from '@/service/CreateLive';
import { createLiveTask, getLiveTaskInfo, createDrafts, getDraftsDetail, liveTts } from '@/utils/api/userApi'; import { createLiveTask, getLiveTaskInfo, createDrafts, getDraftsDetail, liveTts } from '@/utils/api/userApi';
...@@ -84,6 +84,7 @@ import { callPyjsInWindow } from '@/utils/pyqt'; ...@@ -84,6 +84,7 @@ import { callPyjsInWindow } from '@/utils/pyqt';
import { useLiveInfoSubmit } from '@/hooks/useStoreCommit'; import { useLiveInfoSubmit } from '@/hooks/useStoreCommit';
import { processTextCallback } from '@/hooks/useScript'; import { processTextCallback } from '@/hooks/useScript';
import CustomException from '@/utils/error'; import CustomException from '@/utils/error';
import { v4 } from 'uuid';
const { loading, initNum, currentSetp, openInterval, filterFiled, backHome, submitSuccessed, submit, initCreateStore } = const { loading, initNum, currentSetp, openInterval, filterFiled, backHome, submitSuccessed, submit, initCreateStore } =
processTextCallback(); processTextCallback();
const [commitInfo] = useLiveInfoSubmit(); const [commitInfo] = useLiveInfoSubmit();
...@@ -454,14 +455,13 @@ const initPage = () => { ...@@ -454,14 +455,13 @@ const initPage = () => {
} }
}; };
onBeforeMount(() => { // 获取uuid
initPage(); const getUuid = () => {
let newQuery = JSON.parse(JSON.stringify(route.query)); if (isDev()) {
store.commit('navbar/setNavbar', { return 'e6e973a5-ccdd-4779-a09a-be1658ecbea2';
path: routerConfig.createLive.path, }
query: newQuery, return v4();
}); };
});
const enterPageEvent = () => { const enterPageEvent = () => {
initPage(); initPage();
...@@ -482,24 +482,30 @@ const enterPageEvent = () => { ...@@ -482,24 +482,30 @@ const enterPageEvent = () => {
path: routerConfig.createLive.path, path: routerConfig.createLive.path,
query: newQuery, query: newQuery,
}); });
// 创建uuid
commitInfo({
// 文本脚本的uuid
[createLiveKeys.scriptUuid]: getUuid(),
});
}; };
onBeforeMount(() => {
initPage();
let newQuery = JSON.parse(JSON.stringify(route.query));
store.commit('navbar/setNavbar', {
path: routerConfig.createLive.path,
query: newQuery,
});
});
// 缓存进入 // 缓存进入
onActivated(() => { onActivated(() => {
// 初始化页面的参数
if (currentQuery.value.type === 'new' && route.query.type === 'edit') {
submitSuccessed('', false);
}
enterPageEvent(); enterPageEvent();
}); });
// 路由离开前保存query // 路由离开前保存query
onBeforeRouteLeave(() => { onBeforeRouteLeave(() => {
currentQuery.value = route.query; currentQuery.value = route.query;
let type = currentQuery.value.type;
if (type === 'edit' || type === 'edit_drafts') {
submitSuccessed('', false);
}
}); });
// 缓存离开 // 缓存离开
......
...@@ -80,6 +80,7 @@ import { useRouter } from 'vue-router'; ...@@ -80,6 +80,7 @@ import { useRouter } from 'vue-router';
import { getDigitalPeopleList } from '@/service/Common'; import { getDigitalPeopleList } from '@/service/Common';
import Button from '@/components/Button.vue'; import Button from '@/components/Button.vue';
import { callPyjsInWindow } from '@/utils/pyqt'; import { callPyjsInWindow } from '@/utils/pyqt';
import { jumpToCreateLivePage } from '@/router/jump';
const router = useRouter(); const router = useRouter();
...@@ -152,15 +153,14 @@ const cardClick = (id: string | number) => { ...@@ -152,15 +153,14 @@ const cardClick = (id: string | number) => {
// 弹窗确认 // 弹窗确认
const dialogConfirm = () => { const dialogConfirm = () => {
dialogVisible.value = false; dialogVisible.value = false;
router.push({ jumpToCreateLivePage(
path: routerConfig.createLive.path, {
name: routerConfig.createLive.name,
query: {
id: currentCard.value, id: currentCard.value,
title: liveName.value, title: liveName.value,
type: 'new', type: 'new',
}, },
}); true,
);
}; };
const getList = async () => { const getList = async () => {
......
import router from '@/router';
import routerConfig from '@/router/tool';
// 跳转到创建直播页面
export const jumpToCreateLivePage = (query: any, clearCache: boolean = false) => {
router.push({
path: routerConfig.createLive.path,
name: routerConfig.createLive.name,
query: {
...query,
clearCache: clearCache,
},
});
};
...@@ -5,8 +5,6 @@ import { ...@@ -5,8 +5,6 @@ import {
updateLiveTask, updateLiveTask,
getGroupsInteraction, getGroupsInteraction,
updateDrafts, updateDrafts,
liveContentRegenerate,
liveContentRegenerateCallback,
} from '@/utils/api/userApi'; } from '@/utils/api/userApi';
import { typeTones, typeSoundColor } from '@/service/CreateLive'; import { typeTones, typeSoundColor } from '@/service/CreateLive';
import { show_message } from '@/utils/tool'; import { show_message } from '@/utils/tool';
......
...@@ -11,8 +11,8 @@ const getBaseUrl = () => { ...@@ -11,8 +11,8 @@ const getBaseUrl = () => {
// return 'http://156.247.11.21:92/'; // return 'http://156.247.11.21:92/';
return ''; return '';
} }
// return 'http://video-assistant.test'; return 'http://video-assistant.test';
return 'http://156.247.11.21:92/'; // return 'http://156.247.11.21:92/';
}; };
const instance = axios.create({ const instance = axios.create({
......
...@@ -26,9 +26,9 @@ export default defineConfig(({ command, mode }) => { ...@@ -26,9 +26,9 @@ export default defineConfig(({ command, mode }) => {
plugins: [ plugins: [
createVuePlugin(), createVuePlugin(),
vueJsx(), vueJsx(),
// eslintPlugin({ eslintPlugin({
// include: ['src/**/*.ts', 'src/**/*.vue', 'src/*.ts', 'src/*.vue'], include: ['src/**/*.ts', 'src/**/*.vue', 'src/*.ts', 'src/*.vue'],
// }), }),
viteMockServe({ viteMockServe({
mockPath: 'mock', mockPath: 'mock',
localEnabled: true, localEnabled: true,
......
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