Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
9be8cbdd
Commit
9be8cbdd
authored
Aug 04, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缓存动态删除和添加
parent
c7731fcb
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
313 additions
and
103 deletions
+313
-103
src/components/AddVideoPlay.vue
+23
-0
src/hooks/useScript.ts
+53
-42
src/layouts/components/Content.vue
+46
-4
src/layouts/components/ToolBar.vue
+12
-3
src/pages/ImageCustomization/index.vue
+15
-1
src/pages/OnlyVideoLive/index.vue
+41
-25
src/pages/VocalCustomization/index.vue
+13
-1
src/pages/createInteract/index.vue
+13
-1
src/pages/createLive/components/ChoseDigitalPerson.vue
+4
-0
src/pages/createLive/components/scripts.vue
+22
-23
src/pages/createLive/index.vue
+11
-0
src/store/modules/navbar.ts
+55
-0
src/utils/audio.ts
+2
-0
src/utils/request.ts
+2
-2
vite.config.ts
+1
-1
No files found.
src/components/AddVideoPlay.vue
View file @
9be8cbdd
...
...
@@ -52,9 +52,11 @@ const props = withDefaults(
mainIndex
?:
number
|
null
;
totalTime
:
number
;
liveDetail
:
any
;
eplay
?:
number
;
}
>
(),
{
mainIndex
:
null
,
eplay
:
0
,
},
);
...
...
@@ -86,7 +88,14 @@ const videoFirstPlay = ref(true);
// 第二个视频是否首次播放
const
videoSecondFirstPlay
=
ref
(
true
);
/**
* element
*/
// 主视频
const
videoFirst
=
ref
<
HTMLVideoElement
>
();
// 下一个主视频,加载完成才显示--两个主视频标签相互替换
const
videoFirstAckup
=
ref
<
HTMLVideoElement
>
();
// 互动视频
const
videoSecond
=
ref
<
HTMLVideoElement
>
();
// 初始音量
...
...
@@ -130,6 +139,7 @@ const confirm = () => {
const
canplay
=
()
=>
{
// 获取视频总时长
total
.
value
=
videoFirst
.
value
.
duration
;
console
.
log
(
'本次主视频总时长'
,
total
.
value
);
emit
(
'update:totalTime'
,
total
.
value
);
if
(
!
videoFirstPlay
.
value
)
{
//
...
...
@@ -193,13 +203,26 @@ watch(
},
);
// 主视频重新播放
watch
(
()
=>
props
.
eplay
,
(
v
)
=>
{
videoFirst
.
value
.
currentTime
=
0
;
// 播放video
videoFirst
.
value
.
play
();
},
);
// 判断是否洗稿
watch
(
()
=>
props
.
liveDetail
,
(
v
)
=>
{
if
(
v
&&
v
.
is_disorganize
===
0
)
{
// 不洗稿,开启循环播放
console
.
log
(
'不洗稿,开启循环播放'
);
loop
.
value
=
true
;
}
else
{
console
.
log
(
'需要洗稿,loop设置false'
);
}
},
);
...
...
src/hooks/useScript.ts
View file @
9be8cbdd
...
...
@@ -2,7 +2,7 @@ import { computed, onBeforeUnmount, ref, watch } from 'vue';
import
{
useStore
}
from
'vuex'
;
import
{
createLiveKeys
,
scriptTypeText
}
from
'@/service/CreateLive'
;
import
{
getLiveTtsCallback
,
createLiveTask
,
liveTts
,
liveTaskRegenerate
}
from
'@/utils/api/userApi'
;
import
{
alyOssUpload
,
dimensionalConvert
,
isDev
,
show_message
}
from
'@/utils/tool'
;
import
{
DataType
,
alyOssUpload
,
dimensionalConvert
,
isDev
,
show_message
}
from
'@/utils/tool'
;
import
{
audioMerge
,
splitAudio
}
from
'@/utils/audio'
;
import
{
useLiveInfoSubmit
}
from
'@/hooks/useStoreCommit'
;
import
{
getUploadConfig
,
onUpdateLiveTask
}
from
'@/service/Common'
;
...
...
@@ -21,6 +21,9 @@ export const processTextCallback = () => {
const
router
=
useRouter
();
const
route
=
useRoute
();
// 提交后的直播id
const
live_task_id
=
ref
(
0
);
//
const
loading
=
ref
(
false
);
...
...
@@ -147,6 +150,7 @@ export const processTextCallback = () => {
try
{
let
res
:
any
=
await
createLiveTask
(
filterFiled
());
if
(
res
.
code
==
0
)
{
live_task_id
.
value
=
res
.
data
.
id
;
return
true
;
}
return
false
;
...
...
@@ -290,7 +294,7 @@ export const processTextCallback = () => {
try
{
let
params
=
filterFiled
();
params
.
type_content
=
list
;
let
res
:
any
=
await
liveTaskRegenerate
(
route
.
query
.
id
,
params
);
let
res
:
any
=
await
liveTaskRegenerate
(
live_task_id
.
value
,
params
);
if
(
res
.
code
==
0
)
{
if
(
successCallback
)
{
submitSuccessed
();
...
...
@@ -338,53 +342,60 @@ export const processTextCallback = () => {
res
.
data
.
push
(
params
);
}
}
if
(
res
.
data
.
length
>=
createLiveInfo
.
value
[
createLiveKeys
.
textScriptList
].
length
)
{
if
(
res
.
data
.
length
)
{
console
.
log
(
'音频任务回调成功'
);
console
.
log
(
res
.
data
);
// 关闭定时器
closeInterval
();
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
createLiveInfo
.
value
[
createLiveKeys
.
textScriptList
]));
let
audio_list
=
[];
// 本次任务不是洗稿任务才修改store
if
(
!
isConfuse
)
{
res
.
data
.
forEach
((
item
:
any
)
=>
{
// 根据task_id更新数组对象
let
data
=
item
.
data
;
if
(
data
&&
data
.
audio_address
&&
(
typeof
data
.
task_id
===
'string'
||
typeof
data
.
task_id
===
'number'
)
)
{
audio_list
.
push
(
data
.
audio_address
);
let
index
=
list
.
findIndex
((
it
:
any
)
=>
it
.
task_id
==
data
.
task_id
);
if
(
index
!==
-
1
)
{
list
[
index
].
audio_address
=
data
.
audio_address
;
commitInfo
({
[
createLiveKeys
.
textScriptList
]:
list
,
});
}
}
else
{
show_message
(
'缺少音频或id'
);
}
});
if
(
res
.
data
.
length
>=
createLiveInfo
.
value
[
createLiveKeys
.
textScriptList
].
length
)
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
createLiveInfo
.
value
[
createLiveKeys
.
textScriptList
]));
let
audio_list
=
[];
// 本次任务不是洗稿任务才修改store
if
(
!
isConfuse
)
{
res
.
data
.
forEach
((
item
:
any
)
=>
{
// 根据task_id更新数组对象
let
data
=
item
.
data
;
if
(
data
&&
data
.
audio_address
&&
(
typeof
data
.
task_id
===
'string'
||
typeof
data
.
task_id
===
'number'
)
)
{
audio_list
.
push
(
data
.
audio_address
);
let
index
=
list
.
findIndex
((
it
:
any
)
=>
it
.
task_id
==
data
.
task_id
);
if
(
index
!==
-
1
)
{
list
[
index
].
audio_address
=
data
.
audio_address
;
commitInfo
({
[
createLiveKeys
.
textScriptList
]:
list
,
});
}
}
else
{
show_message
(
'缺少音频或id'
);
}
});
if
(
!
audio_list
.
length
)
{
throw
new
CustomException
(
'没有要处理的音频'
);
}
if
(
!
audio_list
.
length
)
{
throw
new
CustomException
(
'没有要处理的音频'
);
}
let
resultList
=
await
audioStart
(
audio_list
,
false
);
// 修改store的type_content
commitInfo
({
[
createLiveKeys
.
textScriptValue
]:
resultList
,
});
// 提交
await
submit
(
type
);
// 需要洗稿
if
(
createLiveInfo
.
value
[
createLiveKeys
.
isDisorganize
])
{
await
startConfuse
();
}
else
{
loading
.
value
=
false
;
submitSuccessed
();
let
resultList
=
await
audioStart
(
audio_list
,
false
);
// 修改store的type_content
commitInfo
({
[
createLiveKeys
.
textScriptValue
]:
resultList
,
});
// 提交
await
submit
(
type
);
// 需要洗稿
if
(
createLiveInfo
.
value
[
createLiveKeys
.
isDisorganize
])
{
await
startConfuse
();
}
else
{
loading
.
value
=
false
;
submitSuccessed
();
}
}
}
}
else
{
let
audio_list
=
[];
// 洗稿任务
res
.
data
.
forEach
((
item
:
any
)
=>
{
let
data
=
item
.
data
;
...
...
src/layouts/components/Content.vue
View file @
9be8cbdd
...
...
@@ -7,22 +7,64 @@
</keep-alive>
</router-view>
-->
<router-view
v-slot=
"
{ Component }">
<keep-alive>
<component
:is=
"Component"
:key=
"getKey()"
v-if=
"route.meta.keepAlive"
/>
<!--
<component
:is=
"Component"
:key=
"getKey()"
v-if=
"route.meta.keepAlive && routeCache()"
/>
-->
<keep-alive
:include=
"currentCacheList"
>
<component
:is=
"Component"
/>
</keep-alive>
<
component
:is=
"Component"
v-if=
"!route.meta.keepAlive"
/
>
<
!--
<component
:is=
"Component"
v-if=
"!routeCache()"
/>
--
>
</router-view>
</
template
>
<
script
lang=
"ts"
setup
>
import
allRouter
from
'@/router
'
;
import
{
computed
,
ref
,
watch
}
from
'vue
'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useStore
}
from
'vuex'
;
const
store
=
useStore
();
// keep-alive路由
const
keepAliveList
=
computed
(()
=>
store
.
getters
[
'navbar/getCacheList'
]);
const
route
=
useRoute
();
// 获取缓存的路由
const
getCacheList
=
()
=>
{
let
list
=
[];
keepAliveList
.
value
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
cache
)
{
list
.
push
(
item
.
name
);
}
});
return
list
;
};
const
currentCacheList
=
ref
(
getCacheList
());
watch
(
()
=>
keepAliveList
.
value
,
(
v
)
=>
{
console
.
log
(
'监听改变了'
);
currentCacheList
.
value
=
getCacheList
();
console
.
log
(
currentCacheList
.
value
);
},
{
deep
:
true
,
immediate
:
true
,
},
);
const
getKey
=
()
=>
{
return
route
.
name
;
};
// 当前路由是否缓存
const
routeCache
=
()
=>
{
let
path
=
route
.
path
;
let
index
=
keepAliveList
.
value
.
findIndex
((
item
:
any
)
=>
item
.
path
==
path
);
if
(
index
!==
-
1
&&
keepAliveList
.
value
[
index
].
cache
)
{
return
true
;
}
return
false
;
};
</
script
>
<
style
lang=
"less"
>
...
...
src/layouts/components/ToolBar.vue
View file @
9be8cbdd
...
...
@@ -8,21 +8,22 @@
<span
class=
"label"
>
{{
item
.
label
}}
</span>
<
!--
<div
class=
"close-icon
"
>
<
div
class=
"close-icon"
@
click=
"clearNavbar(item)
"
>
<img
:src=
"imgs.close"
alt=
""
/>
</div>
-->
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
routerConfig
from
'@/router/tool'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useRoute
,
useRoute
r
}
from
'vue-router'
;
import
{
createLiveRouteKey
}
from
'@/constants/token'
;
import
{
useStore
}
from
'vuex'
;
import
{
computed
}
from
'vue'
;
const
store
=
useStore
();
const
route
=
useRoute
();
const
router
=
useRouter
();
const
navbarList
=
computed
(()
=>
store
.
getters
[
'navbar/getNavbar'
]);
...
...
@@ -79,6 +80,14 @@ const jump = (item: any) => {
query
:
params
,
});
};
// 删除当前导航
const
clearNavbar
=
(
item
:
any
)
=>
{
store
.
commit
(
'navbar/deleteNavbar'
,
{
path
:
item
.
path
,
currentPath
:
route
.
path
,
});
};
</
script
>
<
style
lang=
"less"
>
...
...
src/pages/ImageCustomization/index.vue
View file @
9be8cbdd
...
...
@@ -20,6 +20,12 @@
</div>
</
template
>
<
script
lang=
"tsx"
>
export
default
{
name
:
routerConfig
.
ImageCustomization
.
name
,
};
</
script
>
<
script
lang=
"tsx"
setup
>
import
Record
from
'./components/Record.vue'
;
import
MyDigitalPerson
from
'./components/MyDigitalPerson.vue'
;
...
...
@@ -27,7 +33,7 @@ import CustomTabs from '@/components/CustomTabs';
import
CustomTabPanel
from
'@/components/CustomTabPanel'
;
import
Customizable
from
'@/components/Customizable'
;
import
PersonSvg
from
'@/assets/svg/custom/person.svg'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
on
Activated
,
on
Mounted
,
ref
}
from
'vue'
;
import
{
customizedImageSubmission
}
from
'@/utils/api/userApi'
;
import
{
show_message
}
from
'@/utils/tool'
;
import
routerConfig
from
'@/router/tool'
;
...
...
@@ -73,6 +79,14 @@ const submit = async (params: any) => {
};
onMounted
(()
=>
{
// 添加导航
store
.
commit
(
'navbar/setNavbar'
,
{
path
:
routerConfig
.
ImageCustomization
.
path
,
});
});
onActivated
(()
=>
{
// 添加导航
store
.
commit
(
'navbar/setNavbar'
,
{
path
:
routerConfig
.
ImageCustomization
.
path
,
});
...
...
src/pages/OnlyVideoLive/index.vue
View file @
9be8cbdd
...
...
@@ -9,6 +9,7 @@
:video1=
"getCurrentMainVideo"
:liveDetail=
"liveDetail"
:video2=
"addVideo"
:eplay=
"eplay"
@
playEnd=
"playEnd"
@
mainVideoPlayEnd=
"mainVideoPlayEnd"
@
mainVideoStartPlay=
"mainVideoStartPlay"
...
...
@@ -23,7 +24,7 @@ import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
import
AddVideoPlay
from
'@/components/AddVideoPlay.vue'
;
import
{
getLiveDetail
}
from
'@/utils/api/userApi'
;
import
{
useRoute
,
useRouter
}
from
'vue-router'
;
import
{
show_message
,
isDev
}
from
'@/utils/tool'
;
import
{
show_message
,
isDev
,
DataType
}
from
'@/utils/tool'
;
import
{
callPyjsInWindow
,
injectWindow
}
from
'@/utils/pyqt'
;
import
{
getliveTaskReply
,
getUserCookie
,
liveTts
,
getLiveTaskInfo
,
liveTaskRegenerate
}
from
'@/utils/api/userApi'
;
import
routerConfig
from
'@/router/tool'
;
...
...
@@ -41,6 +42,7 @@ const router = useRouter();
const
routeQuery
=
route
.
query
;
const
progress
=
ref
(
0
);
const
eplay
=
ref
(
0
);
// 剩余多少时长时开始洗稿并获取下一个视频
const
esidueTime
=
60
*
10
;
...
...
@@ -79,11 +81,6 @@ const addVideoList = ref([]);
// 互动视频当前播放id
const
addVideoId
=
ref
(
''
);
// 音调id
const
phoneticTimbresId
=
ref
();
// 音色id
const
toneId
=
ref
();
// 直播详情
const
liveDetail
=
ref
({});
...
...
@@ -91,9 +88,9 @@ const submitAudioTask = async (list: any[]) => {
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
params
=
{
// 音色
phonetic_timbres_id
:
phoneticTimbresId
.
value
,
phonetic_timbres_id
:
liveDetail
.
value
.
phonetic_timbres_id
,
// 音调
tone_id
:
toneId
.
value
,
tone_id
:
liveDetail
.
value
.
tone_id
,
content
:
list
[
i
].
content
,
uuid
:
currentConfuseId
.
value
,
};
...
...
@@ -132,13 +129,14 @@ const submitConfuse = async () => {
try
{
currentConfuseId
.
value
=
v4
();
let
content
=
''
;
let
contentList
=
realVideoList
.
value
[
mainVideoIndex
.
value
]
.
type_content
;
let
contentList
=
liveDetail
.
value
.
type_content
;
// 记录本次洗稿id
confuseIndex
.
value
=
mainVideoIndex
.
value
;
if
(
contentList
.
length
)
{
contentList
.
forEach
((
item
:
any
)
=>
{
content
+=
item
.
content
;
});
console
.
log
(
'提交洗稿任务'
);
// 提交洗稿任务
currentStartConfuse
({
content
:
content
,
...
...
@@ -161,13 +159,13 @@ const currentTimeChange = (value: number) => {
if
(
currentEsidueTime
<
esidueTime
&&
currentVideoRow
.
confuse
===
CONFUSE_STATUS
.
CONFUSE_STATUS_WAIT
&&
realVideoList
.
value
[
mainVideoIndex
.
value
]
.
type_content
.
length
&&
typeof
phoneticTimbresId
.
value
===
'number'
&&
typeof
toneId
.
value
===
'number'
&&
liveDetail
.
value
.
type_content
.
length
&&
typeof
liveDetail
.
value
.
phonetic_timbres_id
===
'number'
&&
typeof
liveDetail
.
value
.
tone_id
===
'number'
&&
liveDetail
.
value
.
is_disorganize
)
{
currentVideoRow
.
confuse
=
CONFUSE_STATUS
.
CONFUSE_STATUS_PROGRESS
;
console
.
log
(
'开始洗稿'
);
console
.
log
(
'
直播
开始洗稿'
);
// 开始洗稿
submitConfuse
();
}
...
...
@@ -180,6 +178,7 @@ const mainVideoStartPlay = (index: number) => {
// 主视频播放完毕
const
mainVideoPlayEnd
=
(
index
:
number
)
=>
{
console
.
log
(
'主视频播放完毕'
);
realVideoList
.
value
[
index
].
status
=
true
;
// 找下一个
takeMainVideo
();
...
...
@@ -269,14 +268,15 @@ const regenerate = async (list: any[]) => {
let
params
=
{
digital_man_id
:
liveDetail
.
value
.
digital_man_id
,
name
:
liveDetail
.
value
.
name
,
phonetic_timbres_id
:
phoneticTimbresId
.
value
,
tone_id
:
toneId
.
value
,
phonetic_timbres_id
:
liveDetail
.
value
.
phonetic_timbres_id
,
tone_id
:
liveDetail
.
value
.
tone_id
,
type
:
liveDetail
.
value
.
type
,
};
params
.
type_content
=
list
;
let
res
:
any
=
await
liveTaskRegenerate
(
route
.
query
.
id
,
params
);
let
res
:
any
=
await
liveTaskRegenerate
(
liveDetail
.
value
.
id
,
params
);
if
(
res
.
code
==
0
)
{
//
console
.
log
(
'重新生成直播,已提交'
);
}
}
catch
(
e
)
{
console
.
log
(
e
);
...
...
@@ -320,7 +320,7 @@ const getDetail = async (type: string = '') => {
},
];
}
if
(
res
.
data
.
url
.
length
)
{
if
(
DataType
(
res
.
data
,
'object'
)
&&
res
.
data
.
url
&&
res
.
data
.
url
.
length
)
{
if
(
typeof
confuseIndex
.
value
===
'number'
)
{
// 本次是洗稿回调
}
...
...
@@ -341,7 +341,6 @@ const getDetail = async (type: string = '') => {
confuse
:
CONFUSE_STATUS
.
CONFUSE_STATUS_WAIT
,
// 洗稿任务的uuid
uuid
:
v4
(),
type_content
:
res
.
data
.
type_content
?
res
.
data
.
type_content
:
[],
});
if
(
isDev
())
{
...
...
@@ -368,6 +367,8 @@ const getDetail = async (type: string = '') => {
},
});
}
}
else
{
console
.
log
(
'直播没有返回值'
);
}
}
}
catch
(
e
)
{
...
...
@@ -379,15 +380,17 @@ const getDetail = async (type: string = '') => {
const
submitVideo
=
()
=>
{
try
{
if
(
window
.
pyjs
)
{
console
.
log
(
route
.
query
.
window_index
,
'窗口下标'
);
if
(
window
.
pyjs
.
run
)
{
// 未取走且未提交过的视频
let
index
=
realVideoList
.
value
.
findIndex
((
item
:
any
)
=>
!
item
.
remove
&&
!
item
.
submit
);
if
(
index
!==
-
1
)
{
realVideoList
.
value
[
index
].
submit
=
true
;
window
.
pyjs
.
run
(
realVideoList
.
value
[
index
].
url
,
routeQuery
.
id
,
route
.
query
.
window_index
,
index
);
console
.
log
(
`本次提交-
${
index
}
`
);
console
.
log
(
realVideoList
.
value
);
}
else
{
console
.
log
(
'没有要提交的任务'
);
}
console
.
log
(
'执行了run方法'
);
}
else
{
console
.
log
(
'没有run方法'
);
}
...
...
@@ -404,22 +407,37 @@ const takeMainVideo = () => {
let
index
=
realVideoList
.
value
.
findIndex
((
item
:
any
)
=>
!
item
.
remove
&&
item
.
result
&&
!
item
.
status
);
if
(
index
!==
-
1
)
{
realVideoList
.
value
[
index
].
remove
=
true
;
if
(
typeof
mainVideoIndex
.
value
===
'number'
&&
realVideoList
.
value
[
index
].
result
==
realVideoList
.
value
[
mainVideoIndex
.
value
].
result
)
{
console
.
log
(
'本次获取到的视频与上次一致,重新播放'
);
eplay
.
value
+=
1
;
}
mainVideoIndex
.
value
=
index
;
}
else
{
console
.
log
(
'
没有要播放的
视频'
);
console
.
log
(
'
重新播放当前
视频'
);
// 手动重新开始播放
eplay
.
value
+=
1
;
}
};
// python 回调
const
mergeCallback
=
(
params
:
any
)
=>
{
try
{
if
(
typeof
params
.
index
===
'number'
&&
params
.
video
)
{
console
.
log
(
'python回调'
);
console
.
log
(
params
);
let
index
=
params
.
index
;
if
(
index
)
{
index
=
parseInt
(
index
+
''
);
}
if
(
typeof
index
===
'number'
&&
params
.
video
)
{
// 当前视频的返回结果
realVideoList
.
value
[
params
.
index
].
result
=
params
.
video
;
realVideoList
.
value
[
index
].
result
=
params
.
video
;
// 首次播放
let
list
=
realVideoList
.
value
.
filter
((
item
:
any
)
=>
item
.
remove
===
true
);
if
(
!
list
.
length
)
{
console
.
log
(
'首次播放'
);
takeMainVideo
();
}
}
else
{
...
...
@@ -435,8 +453,6 @@ const getTone = async () => {
try
{
let
res
=
await
getLiveTaskInfo
(
route
.
query
.
id
);
if
(
res
.
code
==
0
)
{
phoneticTimbresId
.
value
=
res
.
data
.
phonetic_timbres_id
;
toneId
.
value
=
res
.
data
.
tone_id
;
liveDetail
.
value
=
res
.
data
;
}
}
catch
(
e
)
{
...
...
src/pages/VocalCustomization/index.vue
View file @
9be8cbdd
...
...
@@ -21,13 +21,19 @@
</div>
</
template
>
<
script
lang=
"tsx"
>
export
default
{
name
:
routerConfig
.
VocalCustomization
.
name
,
};
</
script
>
<
script
lang=
"tsx"
setup
>
import
Record
from
'./components/Record.vue'
;
import
MyDigitalPerson
from
'./components/MyDigitalPerson.vue'
;
import
CustomTabs
from
'@/components/CustomTabs'
;
import
CustomTabPanel
from
'@/components/CustomTabPanel'
;
import
Customizable
from
'@/components/Customizable'
;
import
{
ref
,
onMounted
}
from
'vue'
;
import
{
ref
,
onMounted
,
onActivated
}
from
'vue'
;
import
{
customizedPhoneticSubmission
}
from
'@/utils/api/userApi'
;
import
{
show_message
}
from
'@/utils/tool'
;
import
{
useStore
}
from
'vuex'
;
...
...
@@ -77,6 +83,12 @@ onMounted(() => {
path
:
routerConfig
.
VocalCustomization
.
path
,
});
});
onActivated
(()
=>
{
store
.
commit
(
'navbar/setNavbar'
,
{
path
:
routerConfig
.
VocalCustomization
.
path
,
});
});
</
script
>
<
style
lang=
"less"
></
style
>
src/pages/createInteract/index.vue
View file @
9be8cbdd
...
...
@@ -84,6 +84,12 @@
</div>
</template>
<
script
lang=
"ts"
>
export
default
{
name
:
routerConfig
.
createInteract
.
name
,
};
</
script
>
<
script
lang=
"ts"
setup
>
import
Loading
from
'@/components/loading.vue'
;
import
ConfirmDialog
from
'@/components/ConfirmDialog.vue'
;
...
...
@@ -93,7 +99,7 @@ import Popup from '@/components/Popup.vue';
import
MessageSvg
from
'@/assets/svg/interact/message.svg'
;
import
Button
from
'@/components/Button.vue'
;
import
{
getElBounding
,
getWindowClient
,
show_message
}
from
'@/utils/tool'
;
import
{
onMounted
,
reactive
,
ref
}
from
'vue'
;
import
{
on
Activated
,
on
Mounted
,
reactive
,
ref
}
from
'vue'
;
import
InteractTable
from
'./components/InteractTable.vue'
;
import
Input
from
'@/components/input/index.vue'
;
import
YesSvg
from
'@/assets/svg/home/yes.svg'
;
...
...
@@ -268,6 +274,12 @@ onMounted(() => {
path
:
routerConfig
.
createInteract
.
path
,
});
});
onActivated
(()
=>
{
store
.
commit
(
'navbar/setNavbar'
,
{
path
:
routerConfig
.
createInteract
.
path
,
});
});
</
script
>
<
style
lang=
"less"
>
...
...
src/pages/createLive/components/ChoseDigitalPerson.vue
View file @
9be8cbdd
...
...
@@ -229,6 +229,10 @@ const getList = async () => {
}
};
onMounted
(()
=>
{
getList
();
});
onActivated
(()
=>
{
// 获取数字人列表
getList
();
...
...
src/pages/createLive/components/scripts.vue
View file @
9be8cbdd
...
...
@@ -117,33 +117,28 @@
ref=
"scriptSettingText"
v-show=
"currentOption === scriptTypeText"
>
<
template
v-if=
"isDev()"
>
<template
v-for=
"(item, index) in textScriptList"
:key=
"index"
>
<ScriptTemplate
@
edit=
"editTextScript(item, index)"
@
delete=
"deleteTextScript(index)"
>
<div
class=
"script-template-body__text"
>
<div
class=
"title-box"
>
<div
class=
"label"
>
标题:
</div>
<div
class=
"value"
>
{{
item
.
title
}}
</div>
</div>
<div
class=
"content-box"
>
<div
class=
"label"
>
内容:
</div>
<div
class=
"value narrow-scrollbar"
>
{{
item
.
content
}}
</div>
<
template
v-for=
"(item, index) in textScriptList"
:key=
"index"
>
<ScriptTemplate
@
edit=
"editTextScript(item, index)"
@
delete=
"deleteTextScript(index)"
>
<div
class=
"script-template-body__text"
>
<div
class=
"title-box"
>
<div
class=
"label"
>
标题:
</div>
<div
class=
"value"
>
{{
item
.
title
}}
</div>
</div>
<div
class=
"content-box"
>
<div
class=
"label"
>
内容:
</div>
<div
class=
"value narrow-scrollbar"
>
{{
item
.
content
}}
</div>
</div>
</ScriptTemplate>
</
template
>
<ScriptTemplate
:showTool=
"false"
>
<div
class=
"script-template-body__text-add"
@
click=
"addTextScript"
>
<img
:src=
"imgs.add"
alt=
""
/>
<div
class=
"label"
>
添加脚本
</div>
</div>
</ScriptTemplate>
</
template
>
<
template
v-else
>
<Textarea
v-model=
"textareaValue"
@
change=
"textareaChange"
></Textarea>
</
template
>
<ScriptTemplate
:showTool=
"false"
>
<div
class=
"script-template-body__text-add"
@
click=
"addTextScript"
>
<img
:src=
"imgs.add"
alt=
""
/>
<div
class=
"label"
>
添加脚本
</div>
</div>
</ScriptTemplate>
</div>
<div
class=
"script-setting-upload flex1 narrow-scrollbar"
v-show=
"currentOption === scriptTypePhonetics"
>
<!-- edit -->
...
...
@@ -194,7 +189,7 @@
</template>
<
script
lang=
"tsx"
setup
>
import
{
computed
,
onActivated
,
onMounted
,
reactive
,
ref
,
watch
}
from
'vue'
;
import
{
computed
,
onActivated
,
on
BeforeMount
,
on
Mounted
,
reactive
,
ref
,
watch
}
from
'vue'
;
import
Button
from
'@/components/Button.vue'
;
import
MultipleUpload
from
'@/components/MultipleUpload'
;
import
CheckBox
from
'@/components/CheckBox.vue'
;
...
...
@@ -618,6 +613,10 @@ onMounted(async () => {
// 获取音色音调列表
getList
();
commitInfo
({
// 文本脚本的uuid
[
createLiveKeys
.
scriptUuid
]:
getUuid
(),
});
});
onActivated
(()
=>
{
...
...
src/pages/createLive/index.vue
View file @
9be8cbdd
...
...
@@ -54,6 +54,12 @@
</div>
</template>
<
script
lang=
"tsx"
>
export
default
{
name
:
routerConfig
.
createLive
.
name
,
};
</
script
>
<
script
lang=
"tsx"
setup
>
import
Drag2
from
'@/components/Drag2.vue'
;
import
Loading
from
'@/components/loading.vue'
;
...
...
@@ -450,6 +456,11 @@ const initPage = () => {
onBeforeMount
(()
=>
{
initPage
();
let
newQuery
=
JSON
.
parse
(
JSON
.
stringify
(
route
.
query
));
store
.
commit
(
'navbar/setNavbar'
,
{
path
:
routerConfig
.
createLive
.
path
,
query
:
newQuery
,
});
});
const
enterPageEvent
=
()
=>
{
...
...
src/store/modules/navbar.ts
View file @
9be8cbdd
import
routerConfig
from
'@/router/tool'
;
import
{
createLiveRouteKey
}
from
'@/constants/token'
;
import
{
getSiteRouter
}
from
'@/config/site'
;
import
router
from
'@/router'
;
const
imgs
=
{
home
:
new
URL
(
'../../assets/svg/home/home.svg'
,
import
.
meta
.
url
).
href
,
...
...
@@ -9,9 +11,29 @@ const imgs = {
interaction
:
new
URL
(
'../../assets/svg/home/interaction.svg'
,
import
.
meta
.
url
).
href
,
};
const
filterKeepAlive
=
()
=>
{
let
list
=
[];
const
routes
=
getSiteRouter
();
for
(
let
i
=
0
;
i
<
routes
.
length
;
i
++
)
{
let
items
=
routes
[
i
].
children
;
for
(
let
j
=
0
;
j
<
items
.
length
;
j
++
)
{
let
child
=
items
[
j
];
if
(
child
.
meta
&&
child
.
meta
.
keepAlive
)
{
list
.
push
({
name
:
child
.
name
,
path
:
child
.
path
,
cache
:
true
,
});
}
}
}
return
list
;
};
const
state
=
{
version
:
'v1'
,
navbarList
:
[],
keepAliveList
:
filterKeepAlive
(),
};
type
StateType
=
typeof
state
;
...
...
@@ -48,6 +70,36 @@ const mutations = {
// 记录创建直播的参数
window
.
localStorage
.
setItem
(
createLiveRouteKey
,
JSON
.
stringify
(
info
.
query
));
}
// 添加缓存
let
cacheIndex
=
state
.
keepAliveList
.
findIndex
((
item
:
any
)
=>
item
.
path
==
info
.
path
);
if
(
cacheIndex
!==
-
1
)
{
state
.
keepAliveList
[
cacheIndex
].
cache
=
true
;
}
console
.
log
(
state
.
navbarList
);
},
deleteNavbar
(
state
:
StateType
,
info
:
any
)
{
if
(
info
.
path
)
{
let
index
=
state
.
navbarList
.
findIndex
((
item
:
any
)
=>
item
.
path
==
info
.
path
);
if
(
index
!==
-
1
)
{
// 删除导航
state
.
navbarList
.
splice
(
index
,
1
);
// 清除当前页缓存
let
cacheIndex
=
state
.
keepAliveList
.
findIndex
((
item
:
any
)
=>
item
.
path
==
info
.
path
);
if
(
cacheIndex
!==
-
1
)
{
state
.
keepAliveList
[
cacheIndex
].
cache
=
false
;
}
if
(
info
.
currentPath
==
info
.
path
)
{
// 返回首页
setTimeout
(()
=>
{
router
.
replace
({
path
:
routerConfig
.
home
.
path
,
name
:
routerConfig
.
home
.
name
,
});
},
0
);
}
}
}
},
};
...
...
@@ -55,6 +107,9 @@ const getters = {
getNavbar
:
(
state
:
StateType
)
=>
{
return
state
.
navbarList
;
},
getCacheList
:
(
state
:
StateType
)
=>
{
return
state
.
keepAliveList
;
},
};
const
actions
=
{};
...
...
src/utils/audio.ts
View file @
9be8cbdd
...
...
@@ -24,6 +24,8 @@ export async function decodeAudio(blob: Blob) {
}
// 合并音频文件
export
async
function
audioMerge
(
filePaths
)
{
console
.
log
(
'要合并的文件'
);
console
.
log
(
filePaths
);
try
{
// 创建一个新的音频上下文
const
audioContext
=
createAudioContext
();
...
...
src/utils/request.ts
View file @
9be8cbdd
...
...
@@ -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
({
...
...
vite.config.ts
View file @
9be8cbdd
...
...
@@ -77,7 +77,7 @@ export default defineConfig(({ command, mode }) => {
terserOptions
:
{
compress
:
{
//生产环境时移除console
drop_console
:
true
,
//
drop_console: true,
// drop_debugger: true,
},
output
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment