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
964a42af
Commit
964a42af
authored
Sep 08, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增图片和视频上传后的显示
parent
daf04614
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
129 additions
and
47 deletions
+129
-47
src/App.vue
+1
-3
src/components/CustomizationStatus/index.less
+3
-0
src/components/CustomizationStatus/index.tsx
+2
-1
src/components/upload/index.less
+7
-0
src/components/upload/index.tsx
+39
-22
src/pages/faceTransplant/components/header.vue
+26
-1
src/pages/faceTransplant/components/record.vue
+26
-9
src/pages/faceTransplant/index.vue
+11
-3
src/pages/home/components/myDigtalPeople.vue
+2
-8
src/utils/pyqt.ts
+12
-0
No files found.
src/App.vue
View file @
964a42af
...
@@ -29,15 +29,13 @@ const mode = computed(() => {
...
@@ -29,15 +29,13 @@ const mode = computed(() => {
// };
// };
const
onMessage
=
(
params
:
string
)
=>
{
const
onMessage
=
(
params
:
string
)
=>
{
console
.
log
(
'接收到值了'
);
console
.
log
(
params
);
if
(
typeof
params
===
'string'
)
{
if
(
typeof
params
===
'string'
)
{
params
=
JSON
.
parse
(
params
);
params
=
JSON
.
parse
(
params
);
}
}
if
(
Object
.
keys
(
params
).
length
)
{
if
(
Object
.
keys
(
params
).
length
)
{
show_message
(
params
.
value
,
params
.
type
);
show_message
(
params
.
value
,
params
.
type
);
}
else
{
}
else
{
console
.
log
(
'没有数据'
);
console
.
log
(
'没有
onMessage
数据'
);
}
}
};
};
...
...
src/components/CustomizationStatus/index.less
View file @
964a42af
...
@@ -8,5 +8,8 @@
...
@@ -8,5 +8,8 @@
flex-direction: column;
flex-direction: column;
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
& > * {
margin: 4px 0;
}
}
}
}
}
src/components/CustomizationStatus/index.tsx
View file @
964a42af
...
@@ -9,7 +9,7 @@ export default defineComponent({
...
@@ -9,7 +9,7 @@ export default defineComponent({
default
:
1
,
default
:
1
,
},
},
},
},
setup
(
props
,
ctx
)
{
setup
(
props
,
{
slots
}
)
{
const
imgs
=
{
const
imgs
=
{
underReview
:
new
URL
(
'../../assets/svg/custom/underReview.svg'
,
import
.
meta
.
url
).
href
,
underReview
:
new
URL
(
'../../assets/svg/custom/underReview.svg'
,
import
.
meta
.
url
).
href
,
auditFailure
:
new
URL
(
'../../assets/svg/custom/auditFailure.svg'
,
import
.
meta
.
url
).
href
,
auditFailure
:
new
URL
(
'../../assets/svg/custom/auditFailure.svg'
,
import
.
meta
.
url
).
href
,
...
@@ -37,6 +37,7 @@ export default defineComponent({
...
@@ -37,6 +37,7 @@ export default defineComponent({
<
div
class=
"status"
>
<
div
class=
"status"
>
<
img
src=
{
imgs
.
progress
}
/>
<
img
src=
{
imgs
.
progress
}
/>
<
div
>
进行中
</
div
>
<
div
>
进行中
</
div
>
{
slots
.
progressTip
?.()
}
</
div
>
</
div
>
);
);
case
LIVE_AUDIT_STATUS
.
LIVE_AUDIT_STATUS_FINISH
:
case
LIVE_AUDIT_STATUS
.
LIVE_AUDIT_STATUS_FINISH
:
...
...
src/components/upload/index.less
View file @
964a42af
...
@@ -87,12 +87,19 @@
...
@@ -87,12 +87,19 @@
flex-direction: column;
flex-direction: column;
width: 100%;
width: 100%;
height: 100%;
height: 100%;
& > * {
margin: 4px;
}
.icon {
.icon {
img {
img {
width: 100px;
width: 100px;
height: 100px;
height: 100px;
}
}
}
}
.image-file {
width: 200px;
height: 200px;
}
.file-name {
.file-name {
font-size: @size-16;
font-size: @size-16;
color: #888fa1;
color: #888fa1;
...
...
src/components/upload/index.tsx
View file @
964a42af
...
@@ -11,7 +11,7 @@ import {
...
@@ -11,7 +11,7 @@ import {
}
from
'tdesign-vue-next'
;
}
from
'tdesign-vue-next'
;
import
{
getUserCookie
}
from
'@/utils/api/userApi'
;
import
{
getUserCookie
}
from
'@/utils/api/userApi'
;
import
request
from
'@/utils/otherRequest'
;
import
request
from
'@/utils/otherRequest'
;
import
{
getFileSuffix
,
isDev
,
show_message
}
from
'@/utils/tool'
;
import
{
getFileSuffix
,
show_message
,
getFirstFrameOfVideo
}
from
'@/utils/tool'
;
import
{
v4
}
from
'uuid'
;
import
{
v4
}
from
'uuid'
;
import
Button
from
'../Button.vue'
;
import
Button
from
'../Button.vue'
;
...
@@ -44,6 +44,14 @@ export default defineComponent({
...
@@ -44,6 +44,14 @@ export default defineComponent({
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
,
},
},
showImage
:
{
type
:
Boolean
,
default
:
false
,
},
showFirstFrame
:
{
type
:
Boolean
,
default
:
false
,
},
oldName
:
{
oldName
:
{
type
:
String
,
type
:
String
,
default
:
''
,
default
:
''
,
...
@@ -53,10 +61,11 @@ export default defineComponent({
...
@@ -53,10 +61,11 @@ export default defineComponent({
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
const
files
=
ref
([]);
const
files
=
ref
([]);
// 文件地址
// 文件地址
const
C
urfile
=
reactive
({
const
c
urfile
=
reactive
({
url
:
props
.
modelValue
,
url
:
props
.
modelValue
,
status
:
0
,
status
:
0
,
oldName
:
''
,
oldName
:
''
,
firstFrame
:
''
,
});
});
const
actionUrl
=
ref
(
''
);
const
actionUrl
=
ref
(
''
);
// 上传进度条
// 上传进度条
...
@@ -79,13 +88,14 @@ export default defineComponent({
...
@@ -79,13 +88,14 @@ export default defineComponent({
// 修改上传状态
// 修改上传状态
const
changeUploadStatus
=
(
type
:
'success'
|
'wait'
|
'progress'
=
'success'
)
=>
{
const
changeUploadStatus
=
(
type
:
'success'
|
'wait'
|
'progress'
=
'success'
)
=>
{
if
(
type
==
'success'
)
{
if
(
type
==
'success'
)
{
C
urfile
.
url
=
props
.
modelValue
;
c
urfile
.
url
=
props
.
modelValue
;
C
urfile
.
status
=
2
;
c
urfile
.
status
=
2
;
}
else
if
(
type
==
'progress'
)
{
}
else
if
(
type
==
'progress'
)
{
C
urfile
.
status
=
1
;
c
urfile
.
status
=
1
;
}
else
{
}
else
{
Curfile
.
url
=
''
;
curfile
.
url
=
''
;
Curfile
.
status
=
0
;
curfile
.
status
=
0
;
curfile
.
firstFrame
=
''
;
files
.
value
=
[];
files
.
value
=
[];
}
}
};
};
...
@@ -93,7 +103,7 @@ export default defineComponent({
...
@@ -93,7 +103,7 @@ export default defineComponent({
// 提交url
// 提交url
const
submitUrl
=
(
url
:
string
)
=>
{
const
submitUrl
=
(
url
:
string
)
=>
{
emit
(
'update:modelValue'
,
url
);
emit
(
'update:modelValue'
,
url
);
emit
(
'change'
,
url
,
props
.
id
,
C
urfile
.
oldName
);
emit
(
'change'
,
url
,
props
.
id
,
c
urfile
.
oldName
);
};
};
// 获取文件尺寸
// 获取文件尺寸
...
@@ -146,20 +156,24 @@ export default defineComponent({
...
@@ -146,20 +156,24 @@ export default defineComponent({
MessagePlugin
.
error
(
`文件
${
file
.
name
}
上传失败`
);
MessagePlugin
.
error
(
`文件
${
file
.
name
}
上传失败`
);
};
};
// 上传成功回调
// 上传成功回调
const
UploadSuccessCallback
=
(
uuid
:
any
,
url
:
any
)
=>
{
const
UploadSuccessCallback
=
async
(
uuid
:
any
,
url
:
any
)
=>
{
if
(
props
.
showFirstFrame
)
{
let
first
=
await
getFirstFrameOfVideo
(
url
);
curfile
.
firstFrame
=
URL
.
createObjectURL
(
first
);
}
// 关闭定时器
// 关闭定时器
window
.
clearInterval
(
percentageInterval
);
window
.
clearInterval
(
percentageInterval
);
MessagePlugin
.
success
(
'上传成功'
);
MessagePlugin
.
success
(
'上传成功'
);
// 将将完整url传给父组件
// 将将完整url传给父组件
C
urfile
.
url
=
url
;
c
urfile
.
url
=
url
;
submitUrl
(
C
urfile
.
url
);
submitUrl
(
c
urfile
.
url
);
changeUploadStatus
(
'success'
);
changeUploadStatus
(
'success'
);
};
};
// 上传失败回调
// 上传失败回调
const
UploadErrorCallback
=
()
=>
{
const
UploadErrorCallback
=
()
=>
{
// 关闭定时器
// 关闭定时器
window
.
clearInterval
(
percentageInterval
);
window
.
clearInterval
(
percentageInterval
);
submitUrl
(
C
urfile
.
url
);
submitUrl
(
c
urfile
.
url
);
MessagePlugin
.
warning
(
'上传失败'
);
MessagePlugin
.
warning
(
'上传失败'
);
changeUploadStatus
(
'wait'
);
changeUploadStatus
(
'wait'
);
};
};
...
@@ -167,10 +181,10 @@ export default defineComponent({
...
@@ -167,10 +181,10 @@ export default defineComponent({
const
ExtranetUpload
=
(
file
:
any
)
=>
{
const
ExtranetUpload
=
(
file
:
any
)
=>
{
openpercentage
();
openpercentage
();
// 上传中状态
// 上传中状态
C
urfile
.
status
=
1
;
c
urfile
.
status
=
1
;
return
new
Promise
<
RequestMethodResponse
>
((
resolve
)
=>
{
return
new
Promise
<
RequestMethodResponse
>
((
resolve
)
=>
{
if
(
props
.
showOldName
)
{
if
(
props
.
showOldName
)
{
C
urfile
.
oldName
=
file
.
name
;
c
urfile
.
oldName
=
file
.
name
;
}
}
const
uuid
=
v4
();
const
uuid
=
v4
();
let
url
=
''
;
let
url
=
''
;
...
@@ -205,7 +219,7 @@ export default defineComponent({
...
@@ -205,7 +219,7 @@ export default defineComponent({
UploadSuccessCallback
(
uuid
,
url
);
UploadSuccessCallback
(
uuid
,
url
);
resolve
({
resolve
({
status
:
'success'
,
status
:
'success'
,
response
:
{
url
:
C
urfile
.
url
},
response
:
{
url
:
c
urfile
.
url
},
});
});
}
else
{
}
else
{
UploadErrorCallback
();
UploadErrorCallback
();
...
@@ -232,7 +246,7 @@ export default defineComponent({
...
@@ -232,7 +246,7 @@ export default defineComponent({
(
v
)
=>
{
(
v
)
=>
{
if
(
v
)
{
if
(
v
)
{
// 状态成功
// 状态成功
C
urfile
.
url
=
v
;
c
urfile
.
url
=
v
;
changeUploadStatus
(
'success'
);
changeUploadStatus
(
'success'
);
}
else
{
}
else
{
changeUploadStatus
(
'wait'
);
changeUploadStatus
(
'wait'
);
...
@@ -298,7 +312,10 @@ export default defineComponent({
...
@@ -298,7 +312,10 @@ export default defineComponent({
<
div
class=
"icon"
>
<
div
class=
"icon"
>
{
props
.
uploadInfo
.
successIcon
?
<
img
src=
{
props
.
uploadInfo
.
successIcon
}
alt=
""
/>
:
''
}
{
props
.
uploadInfo
.
successIcon
?
<
img
src=
{
props
.
uploadInfo
.
successIcon
}
alt=
""
/>
:
''
}
</
div
>
</
div
>
<
div
class=
"file-name"
>
{
Curfile
.
oldName
?
Curfile
.
oldName
:
props
.
oldName
}
</
div
>
{
props
.
showFirstFrame
?
<
img
class=
"image-file"
src=
{
curfile
.
firstFrame
}
alt=
""
/>
:
''
}
{
props
.
showImage
?
<
img
class=
"image-file"
src=
{
curfile
.
url
}
alt=
""
/>
:
''
}
<
div
class=
"file-name"
>
{
curfile
.
oldName
?
curfile
.
oldName
:
props
.
oldName
}
</
div
>
<
Button
class=
"reset-submit"
theme=
"green"
onClick=
{
reStart
}
>
<
Button
class=
"reset-submit"
theme=
"green"
onClick=
{
reStart
}
>
{
props
.
uploadInfo
.
successButtonLabel
??
'重新上传'
}
{
props
.
uploadInfo
.
successButtonLabel
??
'重新上传'
}
</
Button
>
</
Button
>
...
@@ -307,9 +324,9 @@ export default defineComponent({
...
@@ -307,9 +324,9 @@ export default defineComponent({
};
};
// 获取当前上传状态
// 获取当前上传状态
const
currentUploadStatus
=
()
=>
{
const
currentUploadStatus
=
()
=>
{
if
(
C
urfile
.
status
==
0
)
{
if
(
c
urfile
.
status
==
0
)
{
return
notUploadHtml
();
return
notUploadHtml
();
}
else
if
(
C
urfile
.
status
==
1
)
{
}
else
if
(
c
urfile
.
status
==
1
)
{
// 上传中
// 上传中
return
UploadingHtml
();
return
UploadingHtml
();
}
else
{
}
else
{
...
@@ -322,13 +339,13 @@ export default defineComponent({
...
@@ -322,13 +339,13 @@ export default defineComponent({
<
div
class=
"custom-real-upload"
>
<
div
class=
"custom-real-upload"
>
<
div
class=
"real-upload-content"
>
<
div
class=
"real-upload-content"
>
{
/* <div class="custom-real-upload-component">{currentUploadStatus()}</div> */
}
{
/* <div class="custom-real-upload-component">{currentUploadStatus()}</div> */
}
<
div
class=
"custom-real-upload-component"
v
-
show=
{
C
urfile
.
status
==
0
}
>
<
div
class=
"custom-real-upload-component"
v
-
show=
{
c
urfile
.
status
==
0
}
>
{
notUploadHtml
()
}
{
notUploadHtml
()
}
</
div
>
</
div
>
<
div
class=
"custom-real-upload-component"
v
-
show=
{
C
urfile
.
status
==
1
}
>
<
div
class=
"custom-real-upload-component"
v
-
show=
{
c
urfile
.
status
==
1
}
>
{
UploadingHtml
()
}
{
UploadingHtml
()
}
</
div
>
</
div
>
<
div
class=
"custom-real-upload-component"
v
-
show=
{
C
urfile
.
status
==
2
}
>
<
div
class=
"custom-real-upload-component"
v
-
show=
{
c
urfile
.
status
==
2
}
>
{
UploadSuccess
()
}
{
UploadSuccess
()
}
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/pages/faceTransplant/components/header.vue
View file @
964a42af
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<Upload
<Upload
class=
"face-transplant-reset-upload"
class=
"face-transplant-reset-upload"
v-model=
"videoFile"
v-model=
"videoFile"
:showFirstFrame=
"true"
:config=
"ossConfig"
:config=
"ossConfig"
:accept=
"videoAccept"
:accept=
"videoAccept"
:uploadInfo=
"videoUploadInfo"
:uploadInfo=
"videoUploadInfo"
...
@@ -15,6 +16,8 @@
...
@@ -15,6 +16,8 @@
<Upload
<Upload
class=
"face-transplant-reset-upload"
class=
"face-transplant-reset-upload"
v-model=
"imageFile"
v-model=
"imageFile"
:showImage=
"true"
:showOldName=
"true"
:config=
"ossConfig"
:config=
"ossConfig"
:accept=
"imageAccept"
:accept=
"imageAccept"
:uploadInfo=
"imageUploadInfo"
:uploadInfo=
"imageUploadInfo"
...
@@ -22,7 +25,7 @@
...
@@ -22,7 +25,7 @@
</div>
</div>
</div>
</div>
<div
class=
"face-transplant-footer"
>
<div
class=
"face-transplant-footer"
>
<Button
theme=
"opacity"
class=
"face-transplant-footer-reset"
>
重置
</Button>
<Button
theme=
"opacity"
class=
"face-transplant-footer-reset"
@
click=
"onReset"
>
重置
</Button>
<Button
theme=
"green"
class=
"face-transplant-create"
@
click=
"openDialog"
>
生成
</Button>
<Button
theme=
"green"
class=
"face-transplant-create"
@
click=
"openDialog"
>
生成
</Button>
</div>
</div>
<ConfirmDialog
v-model=
"confirmDialogVisible"
title=
"确定生成吗?"
@
confirm=
"confirm"
></ConfirmDialog>
<ConfirmDialog
v-model=
"confirmDialogVisible"
title=
"确定生成吗?"
@
confirm=
"confirm"
></ConfirmDialog>
...
@@ -70,6 +73,12 @@ const openDialog = () => {
...
@@ -70,6 +73,12 @@ const openDialog = () => {
confirmDialogVisible
.
value
=
true
;
confirmDialogVisible
.
value
=
true
;
};
};
// 重置
const
onReset
=
()
=>
{
videoFile
.
value
=
''
;
imageFile
.
value
=
''
;
};
// 确定生成
// 确定生成
const
confirm
=
async
()
=>
{
const
confirm
=
async
()
=>
{
try
{
try
{
...
@@ -111,6 +120,22 @@ onMounted(() => {
...
@@ -111,6 +120,22 @@ onMounted(() => {
background-color
:
transparent
;
background-color
:
transparent
;
border
:
2px
dashed
#9f9f9f
;
border
:
2px
dashed
#9f9f9f
;
height
:
500px
;
height
:
500px
;
.real-upload-content
{
height
:
300px
;
.custom-real-upload-component
{
height
:
100%
;
.t-upload__dragger
{
height
:
100%
;
}
.t-upload__trigger
{
height
:
100%
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
}
}
}
}
}
}
}
}
...
...
src/pages/faceTransplant/components/record.vue
View file @
964a42af
<
template
>
<
template
>
<div
class=
"face-transplant-record"
>
<div
class=
"face-transplant-record"
>
<template
v-if=
"list.length"
>
<div
class=
"record-items"
v-for=
"item in list"
:key=
"item.id"
>
<div
class=
"record-items"
v-for=
"item in list"
:key=
"item.id"
>
<div
class=
"left"
>
<div
class=
"left"
>
<img
:src=
"item.cover_url"
alt=
""
/>
<img
:src=
"item.cover_url"
alt=
""
/>
...
@@ -22,19 +23,21 @@
...
@@ -22,19 +23,21 @@
>
>
</div>
</div>
</div>
</div>
<CustomizationStatus
:status=
"item.audit_status"
></CustomizationStatus>
<CustomizationStatus
:status=
"item.audit_status"
>
<template
#
progressTip
>
<div
class=
"progress-tips"
>
该过程需要10~24小时
</div>
</
template
>
</CustomizationStatus>
</div>
</div>
</template>
<
template
v-else
>
<div
class=
"record-empty"
>
没有生成记录
</div>
</
template
>
</div>
</div>
</template>
</template>
<
script
lang=
"tsx"
setup
>
<
script
lang=
"tsx"
setup
>
import
CustomizationStatus
from
'@/components/CustomizationStatus'
;
import
CustomizationStatus
from
'@/components/CustomizationStatus'
;
import
Button
from
'@/components/Button.vue'
;
import
Button
from
'@/components/Button.vue'
;
import
{
callPyjsInWindow
}
from
'@/utils/pyqt'
;
import
{
pyDownloadVideo
}
from
'@/utils/pyqt'
;
import
{
downloadMp4
}
from
'@/utils/tool'
;
// import useNotify from '@/hooks/useNotify';
// const { showNotifyPlugin } = useNotify();
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
...
@@ -54,19 +57,33 @@ const onDownloadVideo = (item: any) => {
...
@@ -54,19 +57,33 @@ const onDownloadVideo = (item: any) => {
// 通知python下载视频
// 通知python下载视频
let
url
=
let
url
=
'http://yunyi-live.oss-cn-hangzhou.aliyuncs.com/upload/1/2023-08-22c130e428-cab2-4e1e-8904-88054d84bc1b.mp4'
;
'http://yunyi-live.oss-cn-hangzhou.aliyuncs.com/upload/1/2023-08-22c130e428-cab2-4e1e-8904-88054d84bc1b.mp4'
;
callPyjsInWindow
(
'downloadVideo'
,
url
);
pyDownloadVideo
({
downloadMp4
(
url
);
list
:
[
url
],
id
:
`change_face_
${
item
.
id
}
`
,
});
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
@import
'@/style/variables.less'
;
@import
'@/style/variables.less'
;
.face-transplant-record
{
.face-transplant-record
{
height
:
100%
;
border-radius
:
0px
6px
0px
0px
;
border-radius
:
0px
6px
0px
0px
;
background
:
#303030
;
background
:
#303030
;
box-shadow
:
0px
0px
8px
0px
rgba
(
0
,
0
,
0
,
0.04
);
box-shadow
:
0px
0px
8px
0px
rgba
(
0
,
0
,
0
,
0.04
);
min-height
:
200px
;
padding
:
20px
;
padding
:
20px
;
.record-empty
{
height
:
100%
;
display
:
flex
;
justify-content
:
center
;
font-weight
:
bold
;
font-size
:
@
size-18
;
color
:
white
;
align-items
:
center
;
}
.progress-tips
{
font-size
:
@
size-16
;
}
&
>
:not
(
:first-child
)
{
&
>
:not
(
:first-child
)
{
margin-top
:
12px
;
margin-top
:
12px
;
}
}
...
...
src/pages/faceTransplant/index.vue
View file @
964a42af
<
template
>
<
template
>
<div
class=
""
>
<Customizable
<Customizable
class=
"face-transplant-izable"
:video=
"true"
:video=
"true"
:submit=
"submit"
:submit=
"submit"
:icon=
"getIcon()"
:icon=
"getIcon()"
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
</CustomTabPanel>
</CustomTabPanel>
</CustomTabs>
</CustomTabs>
</Customizable>
</Customizable>
</div>
</template>
</template>
<
script
lang=
"tsx"
>
<
script
lang=
"tsx"
>
...
@@ -105,4 +104,13 @@ onMounted(() => {
...
@@ -105,4 +104,13 @@ onMounted(() => {
});
});
</
script
>
</
script
>
<
style
lang=
"less"
></
style
>
<
style
lang=
"less"
>
.face-transplant-izable
{
.izable-page-tabs
{
overflow
:
unset
!important
;
.custom-tab-panel
{
height
:
100%
;
}
}
}
</
style
>
src/pages/home/components/myDigtalPeople.vue
View file @
964a42af
...
@@ -63,7 +63,7 @@ import routerConfig from '@/router/tool';
...
@@ -63,7 +63,7 @@ import routerConfig from '@/router/tool';
import
{
onUpdateLiveTask
}
from
'@/service/Common'
;
import
{
onUpdateLiveTask
}
from
'@/service/Common'
;
import
{
getLiveTask
,
deleteLiveTask
,
liveVideoDownload
}
from
'@/utils/api/userApi'
;
import
{
getLiveTask
,
deleteLiveTask
,
liveVideoDownload
}
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
,
pyDownloadVideo
}
from
'@/utils/pyqt'
;
import
{
jumpToCreateLivePage
}
from
'@/router/jump'
;
import
{
jumpToCreateLivePage
}
from
'@/router/jump'
;
const
props
=
withDefaults
(
const
props
=
withDefaults
(
...
@@ -126,16 +126,10 @@ const getVideoList = async (id: any) => {
...
@@ -126,16 +126,10 @@ const getVideoList = async (id: any) => {
// 下载数字人视频
// 下载数字人视频
const
downLoadVideo
=
async
(
item
:
any
)
=>
{
const
downLoadVideo
=
async
(
item
:
any
)
=>
{
let
list
=
await
getVideoList
(
item
.
id
);
let
list
=
await
getVideoList
(
item
.
id
);
if
(
list
)
{
pyDownloadVideo
({
// 通知python合并视频并
callPyjsInWindow
(
'downLoadVideoToLocal'
,
{
list
:
list
,
list
:
list
,
id
:
item
.
id
,
id
:
item
.
id
,
});
});
show_message
(
'正在下载中,请等待'
,
'info'
);
}
else
{
show_message
(
'没有视频'
);
}
};
};
const
startLive
=
(
item
:
any
)
=>
{
const
startLive
=
(
item
:
any
)
=>
{
...
...
src/utils/pyqt.ts
View file @
964a42af
import
{
show_message
}
from
'./tool'
;
export
const
initPyqtToWindow
=
(
key
:
string
=
''
)
=>
{
export
const
initPyqtToWindow
=
(
key
:
string
=
''
)
=>
{
if
(
key
)
{
if
(
key
)
{
window
[
key
]
=
{};
window
[
key
]
=
{};
...
@@ -70,3 +72,13 @@ export const writeLog = (value: any) => {
...
@@ -70,3 +72,13 @@ export const writeLog = (value: any) => {
window
.
pyjs
[
'writeLog'
](
JSON
.
stringify
(
value
));
window
.
pyjs
[
'writeLog'
](
JSON
.
stringify
(
value
));
}
}
};
};
// 下载视频
export
const
pyDownloadVideo
=
(
value
:
{
list
:
string
[];
id
:
string
|
number
})
=>
{
if
(
!
value
.
list
||
!
value
.
list
.
length
)
{
show_message
(
'没有要下载的文件'
);
return
;
}
callPyjsInWindow
(
'downLoadVideoToLocal'
,
value
);
show_message
(
'正在下载中,请等待'
,
'info'
);
};
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