|
|
@ -377,6 +377,7 @@ |
|
|
|
<el-radio :label="2">网易云地址</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> --> |
|
|
|
|
|
|
|
<el-form-item |
|
|
|
label="图片" |
|
|
|
prop="imgUrls" |
|
|
@ -403,15 +404,14 @@ |
|
|
|
<div class="sz_container" style="text-align:center"> |
|
|
|
<span>{{ item.processNames }}</span> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-if="type == 'add' || type == 'edit'" |
|
|
|
class="sz_container" |
|
|
|
style="text-align:center" |
|
|
|
> |
|
|
|
<el-button size="mini" type="text" @click="setLc(item, s, 'img')" |
|
|
|
>关联流程</el-button |
|
|
|
<div v-if="type == 'add' || type == 'edit'" class="sz_container" style="text-align:center" > |
|
|
|
<el-button size="mini" type="text" @click="setLc(item, s, 'img')">关联流程</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div style="display:flex;width:130px"> |
|
|
|
<div style="flex:1;">标题:</div> |
|
|
|
<el-input v-model="imgData[s].title" placeholder="请输入图片标题" style="flex:2;" @change="changeTitle(item, s, 'img')"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-upload |
|
|
|
v-if="type == 'add' || type == 'edit'" |
|
|
@ -430,6 +430,9 @@ |
|
|
|
<img width="100%" :src="dialogImageUrl" alt="" /> |
|
|
|
</el-dialog> |
|
|
|
</el-form-item> |
|
|
|
<el-progress :percentage="jinduImgNum" v-if="jinduShowImg" status="success"></el-progress> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item |
|
|
|
v-if="radioImg == 2" |
|
|
|
style="width: 100%;" |
|
|
@ -587,6 +590,10 @@ |
|
|
|
>删除音频</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div style="display:flex;width:280px"> |
|
|
|
<div style="width:70px;">标题:</div> |
|
|
|
<el-input v-model="audioTitle" placeholder="请输入标题"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-upload |
|
|
|
v-if="type == 'add' || type == 'edit'" |
|
|
@ -606,6 +613,7 @@ |
|
|
|
<img width="100%" :src="dialogImageUrl" alt="" /> |
|
|
|
</el-dialog> |
|
|
|
</el-form-item> |
|
|
|
<el-progress :percentage="jinduAudioNum" v-if="jinduShowAudio" status="success"></el-progress> |
|
|
|
<el-form-item |
|
|
|
v-if="radioMusic == 2" |
|
|
|
style="width: 100%;" |
|
|
@ -772,6 +780,10 @@ |
|
|
|
@click="deldialogimg(item, idx, 'video')" |
|
|
|
>删除视频</el-button |
|
|
|
> |
|
|
|
<div style="display:flex;width:170px"> |
|
|
|
<div style="flex:1;">标题:</div> |
|
|
|
<el-input v-model="videoTitle" placeholder="请输入标题" style="flex:2;"></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-upload |
|
|
@ -783,13 +795,15 @@ |
|
|
|
:show-file-list="false" |
|
|
|
:before-upload="uploadVideo" |
|
|
|
:http-request="labeluploadvideo" |
|
|
|
:on-success="successVideo" |
|
|
|
element-loading-text="正在上传..." |
|
|
|
v-loading="loading" |
|
|
|
> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
</el-upload> |
|
|
|
<el-dialog :visible.sync="dialogVideo"> </el-dialog> |
|
|
|
<!-- <el-dialog :visible.sync="dialogVideo"> </el-dialog> --> |
|
|
|
</el-form-item> |
|
|
|
<el-progress :percentage="jinduVideoNum" v-if="jinduShowVideo" status="success"></el-progress> |
|
|
|
<el-form-item |
|
|
|
v-if="radioVideo == 2" |
|
|
|
style="width: 100%;" |
|
|
@ -948,7 +962,21 @@ const baseUrl = process.env.VUE_APP_BASE_API; |
|
|
|
export default { |
|
|
|
components: { Tinymce }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
imgTitle:"",//上传的图片标题 |
|
|
|
audioTitle:'',//上传音频标题 |
|
|
|
videoTitle:'',//上传音频标题 |
|
|
|
jindu:0, |
|
|
|
jinduImgNum:0, |
|
|
|
jinduAudioNum:0, |
|
|
|
jinduVideoNum:0, |
|
|
|
jinduShowImg:false, |
|
|
|
jinduShowAudio:false, |
|
|
|
jinduShowVideo:false, |
|
|
|
imgTime:null, |
|
|
|
audioTime:null, |
|
|
|
videoTime:null, |
|
|
|
|
|
|
|
liuChengLeixingType:'', |
|
|
|
loadingAudio: false, |
|
|
|
loadingImg:false, |
|
|
@ -1308,6 +1336,7 @@ export default { |
|
|
|
) { |
|
|
|
this.radioMusic = 1; |
|
|
|
music.push(res.data.resourcesList[i]); |
|
|
|
console.log('music',res.data.resourcesList[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.radioMusic == 1) { |
|
|
@ -1657,10 +1686,25 @@ export default { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
//随机生成4位数函数 |
|
|
|
// let thit = this; |
|
|
|
function rand(min, max) { |
|
|
|
// thit.ruleForm.processesList.forEach(item=>{ |
|
|
|
// let num = Math.floor(Math.random() * (max - min)) + min; |
|
|
|
// console.log(num); |
|
|
|
// if(item.code == num){ |
|
|
|
// rand(1000,9999); |
|
|
|
// } |
|
|
|
// if(item.code != num){ |
|
|
|
// return num; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
return Math.floor(Math.random() * (max - min)) + min; |
|
|
|
} |
|
|
|
|
|
|
|
this.ruleForm.processesList.push({ |
|
|
|
title: "", |
|
|
|
code: "", |
|
|
|
code: rand(1000,9999), |
|
|
|
introduction: "", |
|
|
|
sort: "", |
|
|
|
type: "5" |
|
|
@ -1668,6 +1712,7 @@ export default { |
|
|
|
}, |
|
|
|
//同步流程 |
|
|
|
tongbuliuchen(){ |
|
|
|
try{ |
|
|
|
//删除图片 |
|
|
|
this.imgData.forEach((item,index)=>{ |
|
|
|
let imgProcessId=this.imgData[index].processId?this.imgData[index].processId.split(","):[] |
|
|
@ -1680,8 +1725,7 @@ export default { |
|
|
|
console.log('else'); |
|
|
|
for(let x=0;x<this.ruleForm.processesList.length;x++){ //遍历table有数据 |
|
|
|
for(let y=0;y<imgProcessId.length;y++){ //遍历图片关联流程数据 |
|
|
|
// if(this.ruleForm.processesList[x].code.indexOf(imgProcessId[y])>-1 ){ //如果table上的code在图片的关联数据上,就把图片的关联放到data中 |
|
|
|
if(this.ruleForm.processesList[x].code.includes(imgProcessId[y]) ){ //如果table上的code在图片的关联数据上,就把图片的关联放到data中 |
|
|
|
if(this.ruleForm.processesList[x].code.indexOf(imgProcessId[y])>-1 ){ //如果table上的code在图片的关联数据上,就把图片的关联放到data中 |
|
|
|
data.push(imgProcessId[y]) |
|
|
|
console.log(data); |
|
|
|
}; |
|
|
@ -1689,7 +1733,6 @@ export default { |
|
|
|
name.push(this.ruleForm.processesList[x].title) |
|
|
|
console.log(name); |
|
|
|
} |
|
|
|
// debugger |
|
|
|
} |
|
|
|
} |
|
|
|
this.imgData[index].processId=data.join(","); //把data上的数据变成字符串赋值到当前图片的下拉框上 |
|
|
@ -1697,52 +1740,53 @@ export default { |
|
|
|
console.log(this.imgData); |
|
|
|
} |
|
|
|
}) |
|
|
|
// //删除音频 |
|
|
|
// this.musicData.forEach((item,index)=>{ |
|
|
|
// let musicProcessId=this.musicData[index].processId?this.musicData[index].processId.split(","):[] |
|
|
|
// let data=[] |
|
|
|
// let name=[] |
|
|
|
// if(this.ruleForm.processesList.length<1){ |
|
|
|
// this.musicData[index].processId=null |
|
|
|
// this.musicData[index].processNames=null |
|
|
|
// }else{ |
|
|
|
// for(let x=0;x<this.ruleForm.processesList.length;x++){ |
|
|
|
// for(let y=0;y<musicProcessId.length;y++){ |
|
|
|
// if(this.ruleForm.processesList[x].code.indexOf(musicProcessId[y])>-1 ){ |
|
|
|
// data.push(musicProcessId[y]) |
|
|
|
// } |
|
|
|
// if(this.ruleForm.processesList[x].code==musicProcessId[y]){ |
|
|
|
// name.push(this.ruleForm.processesList[x].title) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.musicData[index].processId=data.join(",") |
|
|
|
// this.musicData[index].processNames=name.join(",") |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// //删除视频 |
|
|
|
// this.videoData.forEach((item,index)=>{ |
|
|
|
// let videoProcessId=this.videoData[index].processId?this.videoData[index].processId.split(","):[] |
|
|
|
// let data=[] |
|
|
|
// let name=[] |
|
|
|
// if(this.ruleForm.processesList.length<1){ |
|
|
|
// this.videoData[index].processId=null |
|
|
|
// this.videoData[index].processNames=null |
|
|
|
// }else{ |
|
|
|
// for(let x=0;x<this.ruleForm.processesList.length;x++){ |
|
|
|
// for(let y=0;y<videoProcessId.length;y++){ |
|
|
|
// if(this.ruleForm.processesList[x].code.indexOf(videoProcessId[y])>-1 ){ |
|
|
|
// data.push(videoProcessId[y]) |
|
|
|
// } |
|
|
|
// if(this.ruleForm.processesList[x].code==videoProcessId[y]){ |
|
|
|
// name.push(this.ruleForm.processesList[x].title) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.videoData[index].processId=data.join(",") |
|
|
|
// this.videoData[index].processNames=name.join(",") |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
//删除音频 |
|
|
|
this.musicData.forEach((item,index)=>{ |
|
|
|
let musicProcessId=this.musicData[index].processId?this.musicData[index].processId.split(","):[] |
|
|
|
let data=[] |
|
|
|
let name=[] |
|
|
|
if(this.ruleForm.processesList.length<1){ |
|
|
|
this.musicData[index].processId=null |
|
|
|
this.musicData[index].processNames=null |
|
|
|
}else{ |
|
|
|
for(let x=0;x<this.ruleForm.processesList.length;x++){ |
|
|
|
for(let y=0;y<musicProcessId.length;y++){ |
|
|
|
if(this.ruleForm.processesList[x].code.indexOf(musicProcessId[y])>-1 ){ |
|
|
|
data.push(musicProcessId[y]) |
|
|
|
} |
|
|
|
if(this.ruleForm.processesList[x].code==musicProcessId[y]){ |
|
|
|
name.push(this.ruleForm.processesList[x].title) |
|
|
|
} |
|
|
|
} |
|
|
|
this.musicData[index].processId=data.join(",") |
|
|
|
this.musicData[index].processNames=name.join(",") |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
//删除视频 |
|
|
|
this.videoData.forEach((item,index)=>{ |
|
|
|
let videoProcessId=this.videoData[index].processId?this.videoData[index].processId.split(","):[] |
|
|
|
let data=[] |
|
|
|
let name=[] |
|
|
|
if(this.ruleForm.processesList.length<1){ |
|
|
|
this.videoData[index].processId=null |
|
|
|
this.videoData[index].processNames=null |
|
|
|
}else{ |
|
|
|
for(let x=0;x<this.ruleForm.processesList.length;x++){ |
|
|
|
for(let y=0;y<videoProcessId.length;y++){ |
|
|
|
if(this.ruleForm.processesList[x].code.indexOf(videoProcessId[y])>-1 ){ |
|
|
|
data.push(videoProcessId[y]) |
|
|
|
} |
|
|
|
if(this.ruleForm.processesList[x].code==videoProcessId[y]){ |
|
|
|
name.push(this.ruleForm.processesList[x].title) |
|
|
|
} |
|
|
|
} |
|
|
|
this.videoData[index].processId=data.join(",") |
|
|
|
this.videoData[index].processNames=name.join(",") |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}catch(err){} |
|
|
|
}, |
|
|
|
// 开本流程删除 |
|
|
|
Del(index) { |
|
|
@ -1861,14 +1905,19 @@ export default { |
|
|
|
this.$refs.video.data = this.ruleForm.radioVideo; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 上传资源蹄片 |
|
|
|
// 上传资源图片 |
|
|
|
labeluploadimg({ file }) { |
|
|
|
console.log(file); |
|
|
|
const formdata = new FormData(); |
|
|
|
formdata.append("file", file); |
|
|
|
formdata.append("type", "product"); |
|
|
|
this.loadingImg = true; |
|
|
|
this.jinduShowImg = true; |
|
|
|
this.jinduImgNum = 0; |
|
|
|
this.radioImg = 1; |
|
|
|
uploadFile(formdata).then(res => { |
|
|
|
this.imgData.push({ |
|
|
|
name:res.data.wjCsmc, |
|
|
|
url: res.data.wjUrl, |
|
|
|
processNames: "", |
|
|
|
title: res.data.wjDx, |
|
|
@ -1877,10 +1926,30 @@ export default { |
|
|
|
}); |
|
|
|
this.imgType = true; |
|
|
|
this.loadingImg = false; |
|
|
|
this.jinduImgNum = 100; |
|
|
|
this.jinduShowImg = false; |
|
|
|
clearInterval(this.videoTime); |
|
|
|
this.videoTime = null; |
|
|
|
this.successVideo('img'); |
|
|
|
}); |
|
|
|
let videoJindu1 = setTimeout(() => { |
|
|
|
this.jinduImgNum = 30; |
|
|
|
}, 500); |
|
|
|
let videoJindu2 = setTimeout(() => { |
|
|
|
videoJindu1 |
|
|
|
this.jinduImgNum = 80; |
|
|
|
}, 1000); |
|
|
|
this.videoTime = setTimeout(() => { |
|
|
|
videoJindu2 |
|
|
|
this.jinduImgNum = 99; |
|
|
|
}, 1500); |
|
|
|
}, |
|
|
|
//音频 |
|
|
|
labeluploadmusic({ file }) { |
|
|
|
this.radioMusic = 1; |
|
|
|
this.loadingAudio = true; |
|
|
|
this.jinduShowAudio = true; |
|
|
|
this.jinduAudioNum = 0; |
|
|
|
const formdata = new FormData(); |
|
|
|
formdata.append("file", file); |
|
|
|
formdata.append("type", "product"); |
|
|
@ -1894,10 +1963,31 @@ export default { |
|
|
|
}); |
|
|
|
this.loadingAudio = false; |
|
|
|
this.musicType = true; |
|
|
|
this.jinduAudioNum = 100; |
|
|
|
this.jinduShowAudio = false; |
|
|
|
clearInterval(this.videoTime); |
|
|
|
this.videoTime = null; |
|
|
|
this.successVideo('audio'); |
|
|
|
}); |
|
|
|
let videoJindu1 = setTimeout(() => { |
|
|
|
this.jinduAudioNum = 30; |
|
|
|
}, 500); |
|
|
|
let videoJindu2 = setTimeout(() => { |
|
|
|
videoJindu1 |
|
|
|
this.jinduAudioNum = 80; |
|
|
|
}, 1000); |
|
|
|
this.videoTime = setTimeout(() => { |
|
|
|
videoJindu2 |
|
|
|
this.jinduAudioNum = 98; |
|
|
|
}, 1500); |
|
|
|
}, |
|
|
|
//视频 |
|
|
|
labeluploadvideo({ file }) { |
|
|
|
this.videoTime |
|
|
|
this.loading = true; |
|
|
|
this.radioVideo = 1; |
|
|
|
this.jinduShowVideo = true; |
|
|
|
this.jinduVideoNum = 0; |
|
|
|
const formdata = new FormData(); |
|
|
|
formdata.append("file", file); |
|
|
|
formdata.append("type", "product"); |
|
|
@ -1911,8 +2001,51 @@ export default { |
|
|
|
}); |
|
|
|
this.loading = false; //取消加载 |
|
|
|
this.radioType = true; |
|
|
|
this.findvideocover(res.data.wjUrl, file); |
|
|
|
// this.jinduVideoNum = 100; |
|
|
|
// this.jinduShowVideo = false; |
|
|
|
clearInterval(this.videoTime); |
|
|
|
this.videoTime = null; |
|
|
|
this.successVideo('video'); |
|
|
|
// this.findvideocover(res.data.wjUrl, file); |
|
|
|
}); |
|
|
|
let videoJindu1 = setTimeout(() => { |
|
|
|
this.jinduVideoNum = 30; |
|
|
|
}, 500); |
|
|
|
let videoJindu2 = setTimeout(() => { |
|
|
|
videoJindu1 |
|
|
|
this.jinduVideoNum = 80; |
|
|
|
}, 1000); |
|
|
|
this.videoTime = setTimeout(() => { |
|
|
|
videoJindu2 |
|
|
|
this.jinduVideoNum = 90; |
|
|
|
}, 1500); |
|
|
|
}, |
|
|
|
successVideo(type){ |
|
|
|
console.log('上传成功'); |
|
|
|
switch (type) { |
|
|
|
case 'img': |
|
|
|
this.jinduImgNum = 100; |
|
|
|
setTimeout(() => { |
|
|
|
this.jinduShowImg = false; |
|
|
|
}, 1200); |
|
|
|
break; |
|
|
|
case 'audio': |
|
|
|
console.log('音频'); |
|
|
|
this.jinduAudioNum = 100; |
|
|
|
setTimeout(() => { |
|
|
|
this.jinduShowAudio = false; |
|
|
|
}, 1200); |
|
|
|
break; |
|
|
|
case 'video': |
|
|
|
this.jinduVideoNum = 100; |
|
|
|
setTimeout(() => { |
|
|
|
this.jinduShowVideo = false; |
|
|
|
}, 1200); |
|
|
|
break; |
|
|
|
} |
|
|
|
// setTimeout(() => { |
|
|
|
// this.jinduShowVideo = false; |
|
|
|
// }, 800); |
|
|
|
}, |
|
|
|
delDataImg(item, index) { |
|
|
|
this.$confirm("此操作将永久删除图片,是否继续?", "提示", { |
|
|
@ -1973,6 +2106,10 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
changeTitle(item, i, type,e){ |
|
|
|
console.log(item,i,type,e); |
|
|
|
|
|
|
|
}, |
|
|
|
//关联流程 |
|
|
|
setLc(item, i, type) { |
|
|
|
if (this.ruleForm.processesList.length == 0) { |
|
|
@ -2058,6 +2195,7 @@ export default { |
|
|
|
this.imgData[this.imgIndex].processId = this.processId.join(','); |
|
|
|
this.imgData[this.imgIndex].mediaType = 1; |
|
|
|
this.imgData[this.imgIndex].sourceType = this.radioImg; |
|
|
|
this.imgData[this.imgIndex].title = this.imgTitle; |
|
|
|
} |
|
|
|
if (this.typeUrl == "music") { |
|
|
|
this.musicType = false; |
|
|
@ -2073,6 +2211,8 @@ export default { |
|
|
|
this.musicData[this.musicIndex].processId = this.processId.join(','); |
|
|
|
this.musicData[this.musicIndex].mediaType = 2; |
|
|
|
this.musicData[this.musicIndex].sourceType = this.radioMusic; |
|
|
|
this.musicData[this.musicIndex].title = this.audioTitle; |
|
|
|
|
|
|
|
} |
|
|
|
if (this.typeUrl == "video") { |
|
|
|
this.videoType = false; |
|
|
@ -2088,6 +2228,7 @@ export default { |
|
|
|
this.videoData[this.videoIndex].processId = this.processId.join(','); |
|
|
|
this.videoData[this.videoIndex].mediaType = 3; |
|
|
|
this.videoData[this.videoIndex].sourceType = this.radioVideo; |
|
|
|
this.videoData[this.videoIndex].title = this.videoTitle; |
|
|
|
} |
|
|
|
}, |
|
|
|
prevent(e) { |
|
|
|