邹畅 4 years ago
parent
commit
005a1bb85c
1 changed files with 141 additions and 110 deletions
  1. 251
      src/views/sce/sceInfo/index.vue

251
src/views/sce/sceInfo/index.vue

@ -95,7 +95,7 @@
</div> </div>
<!-- 新增表单 --> <!-- 新增表单 -->
<el-dialog <el-dialog
@open='openDialog'
@open="openDialog"
:title="dialog.title" :title="dialog.title"
:visible.sync="dialog.Visible" :visible.sync="dialog.Visible"
width="1000px" width="1000px"
@ -240,7 +240,14 @@
:height="400" :height="400"
:width="700" :width="700"
/> --> /> -->
<el-input type="textarea" v-if="type == 'add' || type == 'edit'" style="width:700px" rows="10" placeholder="请输入内容" v-model="ruleForm.introduction"></el-input>
<el-input
type="textarea"
v-if="type == 'add' || type == 'edit'"
style="width:700px"
rows="10"
placeholder="请输入内容"
v-model="ruleForm.introduction"
></el-input>
</el-form-item> </el-form-item>
<h3 class="form-title">开本流程</h3> <h3 class="form-title">开本流程</h3>
<div v-if="type == 'add' || type == 'edit'"> <div v-if="type == 'add' || type == 'edit'">
@ -370,7 +377,12 @@
<el-radio :label="2">网易云地址</el-radio> <el-radio :label="2">网易云地址</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<el-form-item label="图片" prop="imgUrls" style="width: 100%;" v-if="radioImg == 1">
<el-form-item
label="图片"
prop="imgUrls"
style="width: 100%;"
v-if="radioImg == 1"
>
<div v-for="(item, s) in imgData" :key="s" class="imgdata"> <div v-for="(item, s) in imgData" :key="s" class="imgdata">
<el-image <el-image
style="width: 146px; height: 146px" style="width: 146px; height: 146px"
@ -517,7 +529,11 @@
<el-radio :label="2">网易云地址</el-radio> <el-radio :label="2">网易云地址</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item style="margin-left: 100px;" class="audioUpload" v-if="radioMusic == 1">
<el-form-item
style="margin-left: 100px;"
class="audioUpload"
v-if="radioMusic == 1"
>
<div v-for="(item, i) in musicData" :key="i" class="imgdata"> <div v-for="(item, i) in musicData" :key="i" class="imgdata">
<!-- <el-image <!-- <el-image
style="width: 146px; height: 146px" style="width: 146px; height: 146px"
@ -525,13 +541,13 @@
fit="fill" fit="fill"
> >
</el-image> --> </el-image> -->
<audio
:src="item.url"
width="178px"
height="178px"
controls="controls"
v-if="musicData.length > 0 "
></audio>
<audio
:src="item.url"
width="178px"
height="178px"
controls="controls"
v-if="musicData.length > 0"
></audio>
<!-- <audio <!-- <audio
style="width: 146px; height: 146px" style="width: 146px; height: 146px"
:src="item.url" :src="item.url"
@ -698,7 +714,13 @@
<el-radio :label="2">网易云地址</el-radio> <el-radio :label="2">网易云地址</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> --> </el-form-item> -->
<el-form-item label="视频" prop="imgUrls" style="width: 100%;" class="videoUpload" v-if="radioVideo == 1">
<el-form-item
label="视频"
prop="imgUrls"
style="width: 100%;"
class="videoUpload"
v-if="radioVideo == 1"
>
<div v-for="(item, idx) in videoData" :key="idx" class="imgdata"> <div v-for="(item, idx) in videoData" :key="idx" class="imgdata">
<!-- <el-image <!-- <el-image
style="width: 146px; height: 146px" style="width: 146px; height: 146px"
@ -707,12 +729,12 @@
> >
</el-image> --> </el-image> -->
<video <video
:src="item.url"
width="178px"
height="178px"
controls="controls"
v-if="videoData.length > 0 "
></video>
:src="item.url"
width="178px"
height="178px"
controls="controls"
v-if="videoData.length > 0"
></video>
<!-- <div class="imgdialog"> <!-- <div class="imgdialog">
<p> <p>
<i class="el-icon-zoom-in" @click="handleView(item,idx)" style="font-size: 20px"></i> <i class="el-icon-zoom-in" @click="handleView(item,idx)" style="font-size: 20px"></i>
@ -723,7 +745,10 @@
></i> ></i>
</p> </p>
</div> --> </div> -->
<div class="sz_container" style="width:178px; text-align:center;margin-right:20px;">
<div
class="sz_container"
style="width:178px; text-align:center;margin-right:20px;"
>
<span>{{ item.processNames }}</span> <span>{{ item.processNames }}</span>
</div> </div>
<div <div
@ -732,13 +757,18 @@
style="width:178px" style="width:178px"
> >
<el-button <el-button
style="margin-right:60px;"
style="margin-right:60px;"
size="mini" size="mini"
type="text" type="text"
@click="setLc(item, idx, 'video')" @click="setLc(item, idx, 'video')"
>关联流程</el-button >关联流程</el-button
> >
<el-button size="mini" type="text" @click="deldialogimg(item, idx, 'video')">删除视频</el-button>
<el-button
size="mini"
type="text"
@click="deldialogimg(item, idx, 'video')"
>删除视频</el-button
>
</div> </div>
</div> </div>
<el-upload <el-upload
@ -755,9 +785,7 @@
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVideo">
</el-dialog>
<el-dialog :visible.sync="dialogVideo"> </el-dialog>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="radioVideo == 2" v-if="radioVideo == 2"
@ -917,7 +945,7 @@ export default {
components: { Tinymce }, components: { Tinymce },
data() { data() {
return { return {
loadingAudio:false,
loadingAudio: false,
baseUrl, baseUrl,
loading: true, loading: true,
queryParams: { queryParams: {
@ -948,10 +976,10 @@ export default {
// processesList: [], // processesList: [],
processesList: [ processesList: [
{ {
title:'测试',
title: "测试"
}, },
{ {
title:'测试',
title: "测试"
} }
// { // {
// title: "", // // title: "", //
@ -1013,21 +1041,21 @@ export default {
dataList: {}, dataList: {},
disabled: false, disabled: false,
disabledButton: false, disabledButton: false,
dialogVideo:false
dialogVideo: false
}; };
}, },
mounted() { mounted() {
this.queryList(); this.queryList();
// this.queryFindList(); // this.queryFindList();
}, },
methods: { methods: {
// //
uploadAudio(file){
uploadAudio(file) {
console.log(file); console.log(file);
if ( if (
[ [
"audio/mpeg",
"audio/mpeg"
// "video/ogg", // "video/ogg",
// "video/flv", // "video/flv",
// "video/avi", // "video/avi",
@ -1036,9 +1064,7 @@ export default {
// "video/x-matroska" // "video/x-matroska"
].indexOf(file.type) == -1 ].indexOf(file.type) == -1
) { ) {
this.$message.error(
"上传视频只能是 mp3格式!"
);
this.$message.error("上传视频只能是 mp3格式!");
return false; return false;
} }
const isLt2G = file.size / 1024 / 1024 < 2000000; const isLt2G = file.size / 1024 / 1024 < 2000000;
@ -1071,38 +1097,38 @@ export default {
} }
return isLt2G; return isLt2G;
}, },
//
openDialog(){
if(this.dialog.title == "新增剧本"){
//
openDialog() {
if (this.dialog.title == "新增剧本") {
//4 //4
function rand(min,max) {
return Math.floor(Math.random()*(max-min))+min;
function rand(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
} }
this.queryFindList(); this.queryFindList();
this.ruleForm.processesList.push( this.ruleForm.processesList.push(
{ {
title: "开场", // title: "开场", //
// code: 1233, //4 // code: 1233, //4
code: rand(1000,9999), //4
code: rand(1000, 9999), //4
introduction: "开场", // introduction: "开场", //
sort: "1", // sort: "1", //
type: '1', //
type: "1" //
}, },
{ {
title: "选角", title: "选角",
code: rand(1000,9999),
code: rand(1000, 9999),
introduction: "选角", introduction: "选角",
sort: "2", sort: "2",
type: '2',
type: "2"
}, },
{ {
title: "复盘", title: "复盘",
code: rand(1000,9999),
code: rand(1000, 9999),
introduction: "复盘", introduction: "复盘",
sort: "3", sort: "3",
type: '9',
},
)
type: "9"
}
);
} }
}, },
mapForChannel(e) { mapForChannel(e) {
@ -1128,7 +1154,7 @@ export default {
this.$confirm("确认关闭?") this.$confirm("确认关闭?")
.then(_ => { .then(_ => {
done(); done();
this.type = ''
this.type = "";
}) })
.catch(_ => {}); .catch(_ => {});
}, },
@ -1527,7 +1553,7 @@ export default {
} catch (err) {} } catch (err) {}
}, },
subEsc() { subEsc() {
this.type = ''
this.type = "";
this.ruleForm = { this.ruleForm = {
studioName: "", studioName: "",
title: "", title: "",
@ -1638,7 +1664,7 @@ export default {
// //
handleAddK() { handleAddK() {
// //
if(!this.ruleForm.processesList.includes(false)){
if (!this.ruleForm.processesList.includes(false)) {
this.disabledButton = true; this.disabledButton = true;
} }
this.ruleForm.processesList.push({ this.ruleForm.processesList.push({
@ -1646,26 +1672,28 @@ export default {
code: "", code: "",
introduction: "", introduction: "",
sort: "", sort: "",
type: '5',
type: "5"
}); });
}, },
// //
Del(index) { Del(index) {
this.$confirm("此操作将永久删除该剧本流程,是否继续?", "提示", { this.$confirm("此操作将永久删除该剧本流程,是否继续?", "提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.ruleForm.processesList.splice(index, 1), this.ruleForm.processesList.splice(index, 1),
this.$message({
type: "success",
message: "删除成功!"
});
})
.catch(() => {
this.$message({ this.$message({
type: 'success',
message: '删除成功!'
type: "error",
message: "已取消删除"
}); });
}).catch(() => {
this.$message({
type: 'error',
message: '已取消删除'
});
}); });
}, },
// //
@ -1789,14 +1817,14 @@ export default {
processNames: "", processNames: "",
title: res.data.wjDx, title: res.data.wjDx,
mediaType: 2, mediaType: 2,
sourceType: 1,
sourceType: 1
}); });
this.loadingAudio = false; this.loadingAudio = false;
this.musicType = true; this.musicType = true;
}); });
}, },
labeluploadvideo({ file }) { labeluploadvideo({ file }) {
this.loading = true;
this.loading = true;
const formdata = new FormData(); const formdata = new FormData();
formdata.append("file", file); formdata.append("file", file);
formdata.append("type", "product"); formdata.append("type", "product");
@ -1810,15 +1838,16 @@ export default {
}); });
this.loading = false; // this.loading = false; //
this.radioType = true; this.radioType = true;
this.findvideocover(res.data.wjUrl,file)
this.findvideocover(res.data.wjUrl, file);
}); });
}, },
delDataImg(item, index) { delDataImg(item, index) {
this.$confirm("此操作将永久删除图片,是否继续?", "提示", { this.$confirm("此操作将永久删除图片,是否继续?", "提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.dataImg.splice(index, 1); this.dataImg.splice(index, 1);
delFile({ wjUrl: item }).then(res => { delFile({ wjUrl: item }).then(res => {
if (res.code == 200) { if (res.code == 200) {
@ -1826,47 +1855,50 @@ export default {
} }
}); });
this.$message({ this.$message({
type: 'success',
message: '删除成功!'
type: "success",
message: "删除成功!"
}); });
}).catch(() => {
})
.catch(() => {
this.$message({ this.$message({
type: 'error',
message: '已取消删除'
});
type: "error",
message: "已取消删除"
});
}); });
}, },
// //
deldialogimg(item, index, type) { deldialogimg(item, index, type) {
this.$confirm("此您确定要删除吗,是否继续?", "提示", { this.$confirm("此您确定要删除吗,是否继续?", "提示", {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
switch (type) { switch (type) {
case 'img':
case "img":
this.imgData.splice(index, 1); this.imgData.splice(index, 1);
break; break;
case 'music':
case "music":
this.musicData.splice(index, 1); this.musicData.splice(index, 1);
break; break;
case 'video':
this.videoData.splice(index, 1);
case "video":
this.videoData.splice(index, 1);
break; break;
default: default:
break; break;
} }
delFile({ wjUrl: item.url }).then(res => { delFile({ wjUrl: item.url }).then(res => {
if (res.code == 200) {
this.$message.success("删除成功");
if (res.code == 200) {
this.$message.success("删除成功");
} }
}); });
}).catch(() => {
})
.catch(() => {
this.$message({ this.$message({
type: 'error',
message: '已取消删除'
});
});
type: "error",
message: "已取消删除"
});
});
}, },
// //
setLc(item, i, type) { setLc(item, i, type) {
@ -1945,10 +1977,9 @@ export default {
} }
}, },
// //
handleView(item){
console.log(item,'视频地址')
},
handleView(item) {
console.log(item, "视频地址");
}
} }
}; };
</script> </script>
@ -2038,28 +2069,28 @@ export default {
display: flex !important; display: flex !important;
} }
.audioUpload{
.el-form-item__content{
display: flex;
flex-direction: column-reverse;
.imgdata{
.audioUpload {
.el-form-item__content {
display: flex;
// flex-direction: column-reverse;
flex-wrap: wrap;
.imgdata {
margin-top: 20px; margin-top: 20px;
} }
} }
} }
.videoUpload{
.el-form-item__content{
.videoUpload {
.el-form-item__content {
margin-left: 100px; margin-left: 100px;
display: flex;
flex-direction: column-reverse;
.imgdata{
margin-top: 20px;
display: block !important;
display: flex;
// flex-direction: column-reverse;
flex-wrap: wrap;
.imgdata {
margin-top: 20px;
display: block !important;
flex-wrap: nowrap;
}
} }
} }
}
</style> </style>
Loading…
Cancel
Save