-
-
-
+ -->
+
+
+
{{ item.processNames }}
关联流程
+ 删除视频
@@ -883,6 +917,7 @@ export default {
components: { Tinymce },
data() {
return {
+ loadingAudio:false,
baseUrl,
loading: true,
queryParams: {
@@ -987,37 +1022,88 @@ export default {
// this.queryFindList();
},
methods: {
+ //音频校验
+ uploadAudio(file){
+ console.log(file);
+ if (
+ [
+ "audio/mpeg",
+ // "video/ogg",
+ // "video/flv",
+ // "video/avi",
+ // "video/rmvb",
+ // "video/mkv",
+ // "video/x-matroska"
+ ].indexOf(file.type) == -1
+ ) {
+ this.$message.error(
+ "上传视频只能是 mp3格式!"
+ );
+ return false;
+ }
+ const isLt2G = file.size / 1024 / 1024 < 2000000;
+ if (!isLt2G) {
+ this.$message.error("上传文件大小不能超过 2GB!");
+ }
+ return isLt2G;
+ },
+ //视频上传格式校验
+ uploadVideo(file) {
+ if (
+ [
+ "video/mp4",
+ "video/ogg",
+ "video/flv",
+ "video/avi",
+ "video/rmvb",
+ "video/mkv",
+ "video/x-matroska"
+ ].indexOf(file.type) == -1
+ ) {
+ this.$message.error(
+ "上传视频只能是 mp4、ogg、flv、avi、rmvb 、x-matroska格式!"
+ );
+ return false;
+ }
+ const isLt2G = file.size / 1024 / 1024 < 2000000;
+ if (!isLt2G) {
+ this.$message.error("上传文件大小不能超过 2GB!");
+ }
+ return isLt2G;
+ },
//新增剧本流程数据
openDialog(){
- //随机生成4位数函数
- function rand(min,max) {
- return Math.floor(Math.random()*(max-min))+min;
+ if(this.dialog.title == "新增剧本"){
+ //随机生成4位数函数
+ function rand(min,max) {
+ return Math.floor(Math.random()*(max-min))+min;
+ }
+ this.queryFindList();
+ this.ruleForm.processesList.push(
+ {
+ title: "开场", //标题
+ // code: 1233, //随机4位数
+ code: rand(1000,9999), //随机4位数
+ introduction: "开场", //介绍
+ sort: "1", //排序
+ type: '1', //类型
+ },
+ {
+ title: "选角",
+ code: rand(1000,9999),
+ introduction: "选角",
+ sort: "2",
+ type: '2',
+ },
+ {
+ title: "复盘",
+ code: rand(1000,9999),
+ introduction: "复盘",
+ sort: "3",
+ type: '9',
+ },
+ )
}
- this.queryFindList();
- this.ruleForm.processesList.push(
- {
- title: "开场", //标题
- // code: 1233, //随机4位数
- code: rand(1000,9999), //随机4位数
- introduction: "开场", //介绍
- sort: "1", //排序
- type: '1', //类型
- },
- {
- title: "选角",
- code: rand(1000,9999),
- introduction: "选角",
- sort: "2",
- type: '2',
- },
- {
- title: "复盘",
- code: rand(1000,9999),
- introduction: "复盘",
- sort: "3",
- type: '9',
- },
- )
},
mapForChannel(e) {
for (var i = 0; i < this.lcData.length; i++) {
@@ -1693,6 +1779,7 @@ export default {
});
},
labeluploadmusic({ file }) {
+ this.loadingAudio = true;
const formdata = new FormData();
formdata.append("file", file);
formdata.append("type", "product");
@@ -1704,10 +1791,12 @@ export default {
mediaType: 1,
sourceType: 2
});
+ this.loadingAudio = false;
this.musicType = true;
});
},
labeluploadvideo({ file }) {
+ this.loading = true;
const formdata = new FormData();
formdata.append("file", file);
formdata.append("type", "product");
@@ -1719,33 +1808,64 @@ export default {
mediaType: 1,
sourceType: 3
});
+ this.loading = false; //取消加载
this.radioType = true;
this.findvideocover(res.data.wjUrl,file)
});
},
delDataImg(item, index) {
- this.dataImg.splice(index, 1);
- delFile({ wjUrl: item }).then(res => {
- if (res.code == 200) {
- this.$message.success("删除成功");
- }
- });
+ this.$confirm("此操作将永久删除图片,是否继续?", "提示", {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ this.dataImg.splice(index, 1);
+ delFile({ wjUrl: item }).then(res => {
+ if (res.code == 200) {
+ this.$message.success("删除成功");
+ }
+ });
+ this.$message({
+ type: 'success',
+ message: '删除成功!'
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'error',
+ message: '已取消删除'
+ });
+ });
},
// 图片删除
deldialogimg(item, index, type) {
- if (type == "img") {
- this.imgData.splice(index, 1);
- }
- if (type == "music") {
- this.musicData.splice(index, 1);
- }
- if (type == "video") {
- this.videoData.splice(index, 1);
- }
- delFile({ wjUrl: item.url }).then(res => {
- if (res.code == 200) {
- this.$message.success("删除成功");
- }
+ this.$confirm("此您确定要删除吗,是否继续?", "提示", {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ switch (type) {
+ case 'img':
+ this.imgData.splice(index, 1);
+ break;
+ case 'music':
+ this.musicData.splice(index, 1);
+ break;
+ case 'video':
+ this.videoData.splice(index, 1);
+ break;
+ default:
+ break;
+ }
+ delFile({ wjUrl: item.url }).then(res => {
+ if (res.code == 200) {
+ this.$message.success("删除成功");
+ }
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'error',
+ message: '已取消删除'
+ });
});
},
//关联流程
@@ -1916,5 +2036,30 @@ export default {
.imgdata:hover .imgdialog {
display: flex !important;
+}
+
+.audioUpload{
+ .el-form-item__content{
+ display: flex;
+ flex-direction: column-reverse;
+ .imgdata{
+ margin-top: 20px;
+ }
+ }
+}
+
+
+.videoUpload{
+ .el-form-item__content{
+ margin-left: 100px;
+ display: flex;
+ flex-direction: column-reverse;
+ .imgdata{
+ margin-top: 20px;
+ display: block !important;
+ }
+}
+
+
}