Commit c00044ec by haojie

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

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