Commit 2de0756e authored by wanghao's avatar wanghao

4 培训管理-上传视频优化

parent 406deb9d
......@@ -31,9 +31,9 @@ spring:
servlet:
multipart:
# 单个文件大小
max-file-size: 20MB
max-file-size: 500MB
# 设置总上传的文件大小
max-request-size: 100MB
max-request-size: 500MB
# 服务模块
devtools:
restart:
......
......@@ -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 = 500 * 1024 * 1024;
/**
* 默认的文件名最大长度 100
......
......@@ -168,6 +168,7 @@
},
removeVideo(index){
this.$emit("remove", index);
this.totalNum--;
},
handleFileClick(file, fileList) {
this.dialogImageUrl = file.response ? file.response.url : file.url;
......
......@@ -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">
<FileUpload
<VideoUpload
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.videoUrl? [
{
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) {
......
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