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
e1567184
Commit
e1567184
authored
Aug 17, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动作提交去掉文件后缀
parent
b6739667
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
33 deletions
+51
-33
src/components/CustomTabs/index.tsx
+9
-6
src/components/MultipleUpload/index.less
+2
-2
src/components/digitalPeopleDiaog.vue
+5
-4
src/pages/createAction/components/record/index.less
+1
-0
src/pages/createAction/components/record/index.tsx
+1
-1
src/pages/createAction/index.tsx
+9
-4
src/pages/createLive/components/audioScriptDialog.vue
+8
-0
src/pages/createLive/index.vue
+3
-0
src/utils/tool.ts
+13
-16
No files found.
src/components/CustomTabs/index.tsx
View file @
e1567184
...
@@ -13,7 +13,7 @@ export default defineComponent({
...
@@ -13,7 +13,7 @@ export default defineComponent({
default
:
0
,
default
:
0
,
},
},
},
},
emits
:
[
'update:modelValue'
],
emits
:
[
'update:modelValue'
,
'change'
],
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
const
{
slots
,
emit
}
=
context
;
const
{
slots
,
emit
}
=
context
;
const
use_slots
=
useSlots
();
const
use_slots
=
useSlots
();
...
@@ -92,11 +92,13 @@ export default defineComponent({
...
@@ -92,11 +92,13 @@ export default defineComponent({
watch
(
watch
(
()
=>
props
.
modelValue
,
()
=>
props
.
modelValue
,
(
v
)
=>
{
(
v
)
=>
{
// 找到对应的下标
if
(
currentTab
.
value
!=
v
)
{
let
index
=
titles
.
value
.
findIndex
((
item
:
any
)
=>
item
.
name
==
v
);
// 找到对应的下标
if
(
index
!==
-
1
)
{
let
index
=
titles
.
value
.
findIndex
((
item
:
any
)
=>
item
.
name
==
v
);
// 更新tab_bar的位置
if
(
index
!==
-
1
)
{
onChange
(
titles
.
value
[
index
].
name
,
titles
.
value
[
index
].
index
);
// 更新tab_bar的位置
onChange
(
titles
.
value
[
index
].
name
,
titles
.
value
[
index
].
index
);
}
}
}
},
},
);
);
...
@@ -105,6 +107,7 @@ export default defineComponent({
...
@@ -105,6 +107,7 @@ export default defineComponent({
const
onChange
=
(
name
:
string
,
index
:
number
)
=>
{
const
onChange
=
(
name
:
string
,
index
:
number
)
=>
{
currentTab
.
value
=
name
;
currentTab
.
value
=
name
;
emit
(
'update:modelValue'
,
name
);
emit
(
'update:modelValue'
,
name
);
emit
(
'change'
,
name
);
navIndex
.
value
=
index
;
navIndex
.
value
=
index
;
// 重新计算tab的宽度
// 重新计算tab的宽度
getTabBarWidth
();
getTabBarWidth
();
...
...
src/components/MultipleUpload/index.less
View file @
e1567184
...
@@ -104,8 +104,8 @@
...
@@ -104,8 +104,8 @@
font-size: @size-14;
font-size: @size-14;
font-weight: 700;
font-weight: 700;
white-space: nowrap;
white-space: nowrap;
overflow: hidden;
//
overflow: hidden;
text-overflow: ellipsis;
//
text-overflow: ellipsis;
.dja();
.dja();
}
}
& > * {
& > * {
...
...
src/components/digitalPeopleDiaog.vue
View file @
e1567184
...
@@ -110,6 +110,7 @@ watch(
...
@@ -110,6 +110,7 @@ watch(
}
}
}
}
.chose-person-dialog-body
{
.chose-person-dialog-body
{
overflow
:
hidden
;
.header
{
.header
{
text-align
:
center
;
text-align
:
center
;
color
:
#fff
;
color
:
#fff
;
...
@@ -122,11 +123,11 @@ watch(
...
@@ -122,11 +123,11 @@ watch(
font-size
:
@
size-13
;
font-size
:
@
size-13
;
}
}
.btn-active
{
.btn-active
{
border
:
1px
solid
#04ae8a
;
border
:
1px
solid
#04ae8a
!important
;
background
:
#04ae8a
;
background
:
#04ae8a
!important
;
&:hover
{
&:hover
{
border
:
1px
solid
#04ae8a
;
border
:
1px
solid
#04ae8a
!important
;
background
:
#04ae8a
;
background
:
#04ae8a
!important
;
}
}
}
}
}
}
...
...
src/pages/createAction/components/record/index.less
View file @
e1567184
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
border-radius: 8px;
border-radius: 8px;
width: 200px;
width: 200px;
height: 100%;
height: 100%;
object-fit: contain;
}
}
}
}
.center {
.center {
...
...
src/pages/createAction/components/record/index.tsx
View file @
e1567184
...
@@ -15,7 +15,7 @@ export default defineComponent({
...
@@ -15,7 +15,7 @@ export default defineComponent({
{
props
.
list
.
map
((
item
:
any
)
=>
(
{
props
.
list
.
map
((
item
:
any
)
=>
(
<
div
class=
"record-items"
key=
{
item
.
id
}
>
<
div
class=
"record-items"
key=
{
item
.
id
}
>
<
div
class=
"left"
>
<
div
class=
"left"
>
<
img
src=
{
item
.
cover
_url
}
alt=
""
/>
<
img
src=
{
item
.
cover
}
alt=
""
/>
</
div
>
</
div
>
<
div
class=
"center"
>
<
div
class=
"center"
>
<
div
class=
"name"
>
<
div
class=
"name"
>
...
...
src/pages/createAction/index.tsx
View file @
e1567184
...
@@ -8,7 +8,7 @@ import { useStore } from 'vuex';
...
@@ -8,7 +8,7 @@ import { useStore } from 'vuex';
import
routerConfig
from
'@/router/tool'
;
import
routerConfig
from
'@/router/tool'
;
import
ChoseDigitalPeople
from
'./components/choseDigitalPeople'
;
import
ChoseDigitalPeople
from
'./components/choseDigitalPeople'
;
import
Loading
from
'@/components/loading.vue'
;
import
Loading
from
'@/components/loading.vue'
;
import
{
alyOssUpload
,
show_message
}
from
'@/utils/tool'
;
import
{
alyOssUpload
,
removeFileSuffix
,
show_message
}
from
'@/utils/tool'
;
import
{
createLiveMovement
,
updateLiveMovement
}
from
'@/utils/api/userApi'
;
import
{
createLiveMovement
,
updateLiveMovement
}
from
'@/utils/api/userApi'
;
import
ConfirmDialog
from
'@/components/ConfirmDialog.vue'
;
import
ConfirmDialog
from
'@/components/ConfirmDialog.vue'
;
import
CustomTabs
from
'@/components/CustomTabs'
;
import
CustomTabs
from
'@/components/CustomTabs'
;
...
@@ -73,12 +73,13 @@ export default defineComponent({
...
@@ -73,12 +73,13 @@ export default defineComponent({
// 弹窗确认
// 弹窗确认
const
onConfirm
=
async
()
=>
{
const
onConfirm
=
async
()
=>
{
try
{
try
{
globalLoading
.
value
=
true
;
// 成功回调
// 成功回调
// 先把所有的封面上传到阿里云
// 先把所有的封面上传到阿里云
let
list
=
await
Promise
.
all
(
let
list
=
await
Promise
.
all
(
files
.
value
.
map
(
async
(
item
:
any
)
=>
{
files
.
value
.
map
(
async
(
item
:
any
)
=>
{
let
params
:
any
=
{
let
params
:
any
=
{
name
:
item
.
file
.
name
,
name
:
removeFileSuffix
(
item
.
file
.
name
)
,
url
:
item
.
url
,
url
:
item
.
url
,
digital_man_id
:
currentCard
.
value
,
digital_man_id
:
currentCard
.
value
,
};
};
...
@@ -98,7 +99,6 @@ export default defineComponent({
...
@@ -98,7 +99,6 @@ export default defineComponent({
}),
}),
);
);
// 上传
// 上传
globalLoading
.
value
=
true
;
if
(
route
.
query
.
type
==
'edit'
)
{
if
(
route
.
query
.
type
==
'edit'
)
{
// 更新
// 更新
let
res
:
any
=
await
updateLiveMovement
(
route
.
query
.
id
,
list
[
0
]);
let
res
:
any
=
await
updateLiveMovement
(
route
.
query
.
id
,
list
[
0
]);
...
@@ -170,6 +170,11 @@ export default defineComponent({
...
@@ -170,6 +170,11 @@ export default defineComponent({
];
];
};
};
const
tabsChange
=
()
=>
{
// 刷新列表
getMovement
();
};
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
// 是否限制
// 是否限制
if
(
route
.
query
.
type
==
'edit'
)
{
if
(
route
.
query
.
type
==
'edit'
)
{
...
@@ -232,7 +237,7 @@ export default defineComponent({
...
@@ -232,7 +237,7 @@ export default defineComponent({
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class=
"izable-page-tabs"
>
<
div
class=
"izable-page-tabs"
>
<
CustomTabs
v
-
model=
{
currentTab
.
value
}
theme=
"dark2"
>
<
CustomTabs
v
-
model=
{
currentTab
.
value
}
theme=
"dark2"
onChange=
{
tabsChange
}
>
<
CustomTabPanel
<
CustomTabPanel
name=
"1"
name=
"1"
label=
"已创建"
label=
"已创建"
...
...
src/pages/createLive/components/audioScriptDialog.vue
View file @
e1567184
...
@@ -97,6 +97,14 @@ const confirm = () => {
...
@@ -97,6 +97,14 @@ const confirm = () => {
show_message
(
'音频至少上传一个'
);
show_message
(
'音频至少上传一个'
);
return
;
return
;
}
}
if
(
currentSelect
.
value
&&
!
currentRadio
.
value
)
{
show_message
(
'您已选择动作,插入类型必填'
);
return
;
}
if
(
!
currentSelect
.
value
&&
currentRadio
.
value
)
{
show_message
(
'您已选择插入类型,动作必选'
);
return
;
}
let
movement_name
=
''
;
let
movement_name
=
''
;
let
movement_url
=
''
;
let
movement_url
=
''
;
if
(
currentSelect
.
value
)
{
if
(
currentSelect
.
value
)
{
...
...
src/pages/createLive/index.vue
View file @
e1567184
...
@@ -656,6 +656,9 @@ const audioSplitV2 = async (type: string) => {
...
@@ -656,6 +656,9 @@ const audioSplitV2 = async (type: string) => {
}
}
if
(
audioSplitTaskTotal
.
value
===
0
)
{
if
(
audioSplitTaskTotal
.
value
===
0
)
{
console
.
log
(
'没有要切割的,直接提交'
);
console
.
log
(
'没有要切割的,直接提交'
);
callPyjsInWindow
(
'deleteTemporaryAudio'
,
{
id
:
route
.
query
.
id
,
});
// 没有要切割的,直接提交
// 没有要切割的,直接提交
if
(
type
==
'create'
)
{
if
(
type
==
'create'
)
{
// 创建
// 创建
...
...
src/utils/tool.ts
View file @
e1567184
...
@@ -477,7 +477,7 @@ export const mergedArray = (arr: any[], key: string = 'uuid', first: string = 'i
...
@@ -477,7 +477,7 @@ export const mergedArray = (arr: any[], key: string = 'uuid', first: string = 'i
// 获取视频第一帧
// 获取视频第一帧
export
const
getFirstFrameOfVideo
=
(
url
:
string
)
=>
{
export
const
getFirstFrameOfVideo
=
(
url
:
string
)
=>
{
return
new
Promise
<
Blob
>
((
resolve
,
reject
)
=>
{
return
new
Promise
<
Blob
>
((
resolve
,
reject
)
=>
{
let
imgbase64
=
null
;
//
let imgbase64 = null;
let
video
=
document
.
createElement
(
'video'
);
let
video
=
document
.
createElement
(
'video'
);
video
.
setAttribute
(
'crossOrigin'
,
'Anonymous'
);
video
.
setAttribute
(
'crossOrigin'
,
'Anonymous'
);
video
.
setAttribute
(
'src'
,
url
);
video
.
setAttribute
(
'src'
,
url
);
...
@@ -489,21 +489,9 @@ export const getFirstFrameOfVideo = (url: string) => {
...
@@ -489,21 +489,9 @@ export const getFirstFrameOfVideo = (url: string) => {
let
canvas
=
document
.
createElement
(
'canvas'
);
let
canvas
=
document
.
createElement
(
'canvas'
);
let
vWidth
=
video
.
videoWidth
;
let
vWidth
=
video
.
videoWidth
;
let
vHeight
=
video
.
videoHeight
;
let
vHeight
=
video
.
videoHeight
;
let
widthBg
=
512
;
canvas
.
width
=
vWidth
;
let
heightBg
;
canvas
.
height
=
vHeight
;
let
splitHeight
=
0
;
canvas
.
getContext
(
'2d'
).
drawImage
(
video
,
0
,
0
,
vWidth
,
vHeight
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
if
(
vWidth
<
vHeight
)
{
heightBg
=
300
;
// heightBg = vHeight * 512 / vWidth;
splitHeight
=
vHeight
/
2
-
150
;
}
else
{
heightBg
=
vHeight
;
}
//设置倍数是rate,倍数越大画图的图片越大,加载速度越慢
let
rate
=
1
;
canvas
.
width
=
widthBg
*
rate
;
canvas
.
height
=
300
;
canvas
.
getContext
(
'2d'
).
drawImage
(
video
,
0
,
splitHeight
,
vWidth
,
heightBg
,
0
,
0
,
canvas
.
width
,
canvas
.
height
);
// imgbase64 = canvas.toDataURL('image/png');
// imgbase64 = canvas.toDataURL('image/png');
// 转blob
// 转blob
canvas
.
toBlob
(
function
(
blob
)
{
canvas
.
toBlob
(
function
(
blob
)
{
...
@@ -512,3 +500,12 @@ export const getFirstFrameOfVideo = (url: string) => {
...
@@ -512,3 +500,12 @@ export const getFirstFrameOfVideo = (url: string) => {
});
});
});
});
};
};
// 去除文件后缀
export
const
removeFileSuffix
=
(
name
:
string
)
=>
{
let
index
=
name
.
lastIndexOf
(
'.'
);
if
(
index
!==
-
1
)
{
return
name
.
slice
(
0
,
index
);
}
return
name
;
};
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