Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zh-baseversion-project
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王浩
zh-baseversion-project
Commits
2de0756e
Commit
2de0756e
authored
Jul 25, 2024
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4 培训管理-上传视频优化
parent
406deb9d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
21 deletions
+36
-21
application.yml
zh-baseversion-admin/src/main/resources/application.yml
+2
-2
FileUploadUtils.java
...in/java/com/zehong/common/utils/file/FileUploadUtils.java
+2
-1
index.vue
zh-baseversion-web/src/components/VideoUpload/index.vue
+1
-0
index.vue
zh-baseversion-web/src/views/train/trainManage/index.vue
+31
-18
No files found.
zh-baseversion-admin/src/main/resources/application.yml
View file @
2de0756e
...
...
@@ -31,9 +31,9 @@ spring:
servlet
:
multipart
:
# 单个文件大小
max-file-size
:
2
0MB
max-file-size
:
50
0MB
# 设置总上传的文件大小
max-request-size
:
1
00MB
max-request-size
:
5
00MB
# 服务模块
devtools
:
restart
:
...
...
zh-baseversion-common/src/main/java/com/zehong/common/utils/file/FileUploadUtils.java
View file @
2de0756e
...
...
@@ -22,8 +22,9 @@ public class FileUploadUtils
{
/**
* 默认大小 50M
* 20240725 因 培训管理 可上传500M培训视频 所以调整 成 500M
*/
public
static
final
long
DEFAULT_MAX_SIZE
=
50
*
1024
*
1024
;
public
static
final
long
DEFAULT_MAX_SIZE
=
50
0
*
1024
*
1024
;
/**
* 默认的文件名最大长度 100
...
...
zh-baseversion-web/src/components/VideoUpload/index.vue
View file @
2de0756e
...
...
@@ -168,6 +168,7 @@
},
removeVideo
(
index
){
this
.
$emit
(
"remove"
,
index
);
this
.
totalNum
--
;
},
handleFileClick
(
file
,
fileList
)
{
this
.
dialogImageUrl
=
file
.
response
?
file
.
response
.
url
:
file
.
url
;
...
...
zh-baseversion-web/src/views/train/trainManage/index.vue
View file @
2de0756e
...
...
@@ -161,7 +161,7 @@
/>
<!--
添加或修改培训管理对话框
-->
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
width
=
"1000px"
append
-
to
-
body
destroy
-
on
-
close
>
<
el
-
dialog
:
title
=
"title"
:
visible
.
sync
=
"open"
v
-
if
=
"open"
width
=
"1000px"
append
-
to
-
body
destroy
-
on
-
close
>
<
el
-
form
ref
=
"form"
:
model
=
"form"
:
rules
=
"rules"
label
-
width
=
"110px"
>
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
...
...
@@ -218,14 +218,15 @@
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"视频地址"
prop
=
"videoUrl"
>
<
File
Upload
<
Video
Upload
listType
=
"picture"
v
-
if
=
"open"
:
limit
=
"1"
@
resFun
=
"getFileInfoVideo"
@
remove
=
"listRemoveVideo"
:
fileArr
=
"fileListVideo"
:
fileSize
=
"500"
:
fileType
=
"['mp4']"
:
disabled
=
"isView"
/>
<
el
-
input
v
-
show
=
"false"
disabled
v
-
model
=
"form.videoUrl"
><
/el-input
>
<
/el-form-item
>
...
...
@@ -259,12 +260,14 @@ import { listManage, getManage, delManage, addManage, updateManage, exportManage
import
Editor
from
'@/components/Editor'
;
import
FileUpload
from
"@/components/FileUpload"
;
import
uploadfile
from
"@/assets/uploadfile.png"
;
import
VideoUpload
from
"@/components/VideoUpload"
;
import
PeopleChoice
from
"@/components/PeopleChoice"
;
export
default
{
name
:
"Manage"
,
components
:
{
Editor
,
FileUpload
,
VideoUpload
,
PeopleChoice
}
,
data
()
{
...
...
@@ -389,6 +392,8 @@ export default {
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
isView
=
false
;
this
.
fileListFile
=
[];
this
.
open
=
true
;
/*this.$nextTick(() => {
this.$refs.changePaple.changeNameList(undefined);
...
...
@@ -402,12 +407,18 @@ export default {
const
trainManageId
=
row
.
trainManageId
||
this
.
ids
getManage
(
trainManageId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
fileListVideo
=
this
.
form
.
video
?
[
{
name
:
this
.
form
.
lessonName
+
"视频"
,
url
:
uploadfile
,
}
,
]:[];
// this.fileListVideo = this.form.videoUrl? [
//
{
// name: this.form.lessonName + "视频",
// url: uploadfile,
//
}
,
// ]:[];
if
(
this
.
form
.
videoUrl
){
this
.
fileListVideo
=
this
.
form
.
videoUrl
.
split
(
','
);
console
.
log
(
"this.fileListVideo = "
+
this
.
fileListVideo
)
}
this
.
fileListFile
=
this
.
form
.
annexUrl
?[
{
name
:
this
.
form
.
lessonName
+
"附件"
,
...
...
@@ -428,7 +439,7 @@ export default {
const
trainManageId
=
row
.
trainManageId
||
this
.
ids
getManage
(
trainManageId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
fileListVideo
=
this
.
form
.
video
?
[
this
.
fileListVideo
=
this
.
form
.
video
Url
?
[
{
name
:
this
.
form
.
lessonName
+
"视频"
,
url
:
uploadfile
,
...
...
@@ -519,16 +530,18 @@ export default {
}
,
getFileInfoVideo
(
res
)
{
this
.
form
.
videoUrl
=
res
.
url
;
this
.
fileListVideo
=
[
{
name
:
res
.
fileName
,
url
:
uploadfile
,
}
,
];
this
.
fileListVideo
.
push
(
res
.
url
)
// this.fileListVideo = [
//
{
// name: res.fileName,
// url: uploadfile,
//
}
,
// ];
}
,
listRemoveVideo
(
e
)
{
// this.fileListVideo.splice(index,1);
this
.
fileListVideo
=
[];
this
.
form
.
videoUrl
=
""
;
// this.form.videoName = null;
}
,
getFileInfoFile
(
res
)
{
...
...
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