Commit bc340830 authored by qzhxx's avatar qzhxx

账号新增

parent 2f1b578e
......@@ -163,7 +163,7 @@ export default {
permanent: true,
date: "",
roleList: [],
type: 1,
type: 2,
};
},
// 提交
......
<template>
<el-upload
class="upload-demo"
ref="upload"
action="http://192.168.110.67/mall/file/audio/upload"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:on-success="handleAvatarSuccess"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">(支持上传多个视频及视频文件夹,视频语言支持汉语、蒙语、藏语、维吾尔语、英语,视频命名规定:视频名称+语言)</div>
</el-upload>
</template>
<script>
export default {
data() {
return {
fileList: []
};
},
methods: {
handleAvatarSuccess(res, file) {
console.log(res)
console.log(res.data.fileList)
const data = res.data.fileList
let newArray = data.map((item) => {
return item.id;
})
this.$emit('audioList', newArray)
},
submitUpload() {
this.$refs.upload.submit();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<el-upload
class="upload-demo"
ref="upload"
action="http://192.168.110.67/mall/file/datum/upload"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:on-success="handleAvatarSuccess"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">(支持上传多个视频及视频文件夹,视频语言支持汉语、蒙语、藏语、维吾尔语、英语,视频命名规定:视频名称+语言)</div>
</el-upload>
</template>
<script>
export default {
data() {
return {
fileList: []
};
},
methods: {
handleAvatarSuccess(res, file) {
console.log(res)
// console.log(res.url)
const data = res.data.fileList
let newArray = data.map((item) => {
return item.id;
})
this.$emit('datumList', newArray)
},
submitUpload() {
this.$refs.upload.submit();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<el-upload
class="upload-demo"
ref="upload"
action="http://192.168.110.67/mall/file/video/content/upload"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:on-success="handleAvatarSuccess"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
<div slot="tip" class="el-upload__tip">(支持上传多个视频及视频文件夹,视频语言支持汉语、蒙语、藏语、维吾尔语、英语,视频命名规定:视频名称+语言)</div>
</el-upload>
</template>
<script>
export default {
data() {
return {
fileList: []
};
},
methods: {
handleAvatarSuccess(res, file) {
const data = res.data.fileList
let newArray = data.map((item) => {
return item.id;
})
this.$emit('videoList', newArray)
// console.log(newArray,'----idArray')
},
submitUpload() {
this.$refs.upload.submit();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
}
}
}
</script>
<style>
</style>
\ No newline at end of file
......@@ -23,6 +23,12 @@
<script>
export default {
props:{
fileList:{
type:Array,
default:[]
},
},
data() {
return {
filedata:[],
......@@ -52,13 +58,22 @@ export default {
console.log(res)
if (resData.resultCode == "200") {
console.log(resData.data.fileList)
const data = resData.data.fileList
console.log(data)
let newArray = data.map((item) => {
return item.id;
})
this.$emit('videoList', newArray)
// console.log(resData.data.fileList)
// const data = resData.data.fileList
// console.log(data)
// let newArray = data.map((item) => {
// return item.id;
// })
// this.$emit('videoList', newArray)
const data = resData.data.fileList;
let newArray = data.map((item) => item.id);
let editArray =[]
if(this.fileList.length){
editArray = this.fileList.map(item=>item.id)
}
this.$emit("videoList", [...newArray,...editArray]);
} else {
_this.$message.error(resData.msg || resData.message);
......@@ -80,44 +95,6 @@ export default {
this.$message.error("上传文件大小不能超过 10GB!");
}
return isLt10G;
},
handleRequest(file) {
// let formData = new FormData();
// this.fileArr.push(file.file)
// console.log(this.fileArr,'文件数组')
// formData.append("file", this.fileArr);
let formData = new FormData();
if (Array.isArray(file)) {
file.forEach(item => {
formData.append("file", item.file);
});
} else {
formData.append("file", file.file);
}
let _this = this;
_this
.$https(
{
method: "post",
url: "file/video/content/upload",
authType: this.backToken
},
formData
)
.then(res => {
let resData = res.data;
if (resData.resultCode == 200) {
// _this.getOrgTree();
} else {
_this.$message.error(resData.msg || resData.message);
}
})
.catch(err => {
console.log(err);
_this.$message.error(err.msg || err.message);
});
}
}
};
......
......@@ -80,11 +80,11 @@
</el-select>
</el-form-item>
<el-form-item label="视频缩略图" required>
<upload-img @imgUrl="imgUrl"></upload-img>
<upload-img :fileList="ruleForm.imageList" @imgUrl="imgUrl"></upload-img>
</el-form-item>
<el-form-item label="上传视频" required>
<p style="color:red">(支持上传多个视频及视频文件夹,视频语言支持汉语、蒙语、藏语、维吾尔语、英语,视频命名规定:视频名称+语言)</p>
<upload-file @videoList="videoList"></upload-file>
<upload-file :fileList="ruleForm.videoList" @videoList="videoList"></upload-file>
</el-form-item>
</el-form>
<!--新增弹框-->
......@@ -265,6 +265,8 @@ export default {
this.ruleForm.videoContentCatId = data.videoContentCatId
this.ruleForm.thumbnail = data.thumbnail
this.ruleForm.videoFileIdList = data.videoFileIdList
this.ruleForm.imageList=[{url:data.thumbnail}]
this.ruleForm.videoList=data.videoFileList.map(item=>{return {id:item.id,name:item.fileName,url:item.fileUrl}})
}).catch(function(err) {
console.log(err);
});
......
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