|
@@ -46,6 +46,20 @@
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="选择直播间" v-if="msgForm.draftStrategy==1">
|
|
|
|
|
+ <el-select v-model="msgForm.liveId"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ placeholder="请选择直播间" size="mini"
|
|
|
|
|
+ style="margin-right: 10px;"
|
|
|
|
|
+ @change="liveChangemsgForm(msgForm.liveId)" clearable>
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in liveList"
|
|
|
|
|
+ :key="dict.liveId"
|
|
|
|
|
+ :label="dict.liveName"
|
|
|
|
|
+ :value="dict.liveId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="规则" prop="setting" v-if="msgForm.draftStrategy==1" >
|
|
<el-form-item label="规则" prop="setting" v-if="msgForm.draftStrategy==1" >
|
|
|
<div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
|
|
<div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
|
|
|
<el-row>
|
|
<el-row>
|
|
@@ -204,13 +218,13 @@
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19 || item.contentType == 24">
|
|
|
|
|
|
|
+ <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19 || item.contentType == 24 || item.contentType == 25">
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
|
<el-form-item label="直播间" >
|
|
<el-form-item label="直播间" >
|
|
|
<el-select v-model="item.liveId"
|
|
<el-select v-model="item.liveId"
|
|
|
filterable
|
|
filterable
|
|
|
placeholder="请选择直播间" size="mini"
|
|
placeholder="请选择直播间" size="mini"
|
|
|
- @change="liveChange(item)" >
|
|
|
|
|
|
|
+ @change="liveChange(item)" :disabled="liveDisabled()">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in liveList"
|
|
v-for="dict in liveList"
|
|
|
:key="dict.liveId"
|
|
:key="dict.liveId"
|
|
@@ -429,6 +443,7 @@ export default {
|
|
|
startTime: null,
|
|
startTime: null,
|
|
|
sendTime: null,
|
|
sendTime: null,
|
|
|
draftStrategy:1,
|
|
draftStrategy:1,
|
|
|
|
|
+ liveId: null,
|
|
|
},
|
|
},
|
|
|
// 表单校验
|
|
// 表单校验
|
|
|
rules: {},
|
|
rules: {},
|
|
@@ -522,7 +537,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
|
- || this.setting[i].contentType == 23){//新增APP 看课 跳转短链回填封面
|
|
|
|
|
|
|
+ || this.setting[i].contentType == 23 || this.setting[i].contentType == 24 || this.setting[i].contentType == 25){
|
|
|
this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
|
|
this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -553,7 +568,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17
|
|
|
- || this.setting[i].contentType == 23){//新增APP 看课 跳转短链回填标题
|
|
|
|
|
|
|
+ || this.setting[i].contentType == 23 || this.setting[i].contentType == 24 || this.setting[i].contentType == 25){
|
|
|
this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
|
|
this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
|
|
|
|
|
|
|
|
if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
|
|
if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
|
|
@@ -834,9 +849,21 @@ export default {
|
|
|
setting:null,
|
|
setting:null,
|
|
|
sendTime:null,
|
|
sendTime:null,
|
|
|
draftStrategy:1,
|
|
draftStrategy:1,
|
|
|
|
|
+ liveId: null,
|
|
|
};
|
|
};
|
|
|
this.resetForm("msgForm");
|
|
this.resetForm("msgForm");
|
|
|
},
|
|
},
|
|
|
|
|
+ liveChangemsgForm(liveId) {
|
|
|
|
|
+ if (liveId) {
|
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
|
+ this.$set(this.setting[i], 'liveId', liveId);
|
|
|
|
|
+ this.liveChange(this.setting[i]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ liveDisabled() {
|
|
|
|
|
+ return !!this.msgForm && !!this.msgForm.liveId;
|
|
|
|
|
+ },
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
this.ids = selection.map(item => item.id)
|
|
@@ -856,7 +883,10 @@ export default {
|
|
|
let hasLiveSetting = false;
|
|
let hasLiveSetting = false;
|
|
|
let count = 0;
|
|
let count = 0;
|
|
|
for (let index = 0; index < jsonSetting.length; index++) {
|
|
for (let index = 0; index < jsonSetting.length; index++) {
|
|
|
- if (jsonSetting[index] && [12, 18, 19, 24].includes(Number(jsonSetting[index].contentType))) {
|
|
|
|
|
|
|
+ if (jsonSetting[index] && [12, 18, 19, 24, 25].includes(Number(jsonSetting[index].contentType))) {
|
|
|
|
|
+ if (hasLiveSetting) {
|
|
|
|
|
+ return this.$message.error("发送直播间只能一次只能发送一条");
|
|
|
|
|
+ }
|
|
|
hasLiveSetting = true;
|
|
hasLiveSetting = true;
|
|
|
count++;
|
|
count++;
|
|
|
}
|
|
}
|
|
@@ -875,11 +905,11 @@ export default {
|
|
|
if (this.setting.length <= 0) {
|
|
if (this.setting.length <= 0) {
|
|
|
return this.$message.error("请添加规则")
|
|
return this.$message.error("请添加规则")
|
|
|
}
|
|
}
|
|
|
- if (!hasLiveSetting && !this.msgForm.courseId){
|
|
|
|
|
|
|
+ if (!hasLiveSetting && !this.msgForm.courseId && this.msgForm.liveId === null) {
|
|
|
return this.$message.error("课程不能为空")
|
|
return this.$message.error("课程不能为空")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!hasLiveSetting && !this.msgForm.videoId){
|
|
|
|
|
|
|
+ if (!hasLiveSetting && !this.msgForm.videoId && this.msgForm.liveId === null) {
|
|
|
return this.$message.error("课节不能为空")
|
|
return this.$message.error("课节不能为空")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -907,10 +937,10 @@ export default {
|
|
|
return this.$message.error("链接地址不能为空")
|
|
return this.$message.error("链接地址不能为空")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if ([4, 10, 17, 23, 24].includes(Number(this.setting[i].contentType)) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
|
|
|
|
|
|
|
+ if ([4, 10, 17, 23, 24, 25].includes(Number(this.setting[i].contentType)) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
|
|
|
return this.$message.error("小程序消息标题不能为空")
|
|
return this.$message.error("小程序消息标题不能为空")
|
|
|
}
|
|
}
|
|
|
- if ([4, 10, 17, 23, 24].includes(Number(this.setting[i].contentType)) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
|
|
|
|
|
|
|
+ if ([4, 10, 17, 23, 24, 25].includes(Number(this.setting[i].contentType)) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
|
|
|
return this.$message.error("小程序封面地址不能为空")
|
|
return this.$message.error("小程序封面地址不能为空")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -931,10 +961,19 @@ export default {
|
|
|
if (this.setting[i].contentType == 14 && (this.setting[i].luckyBagId == null || this.setting[i].luckyBagId === "")) {
|
|
if (this.setting[i].contentType == 14 && (this.setting[i].luckyBagId == null || this.setting[i].luckyBagId === "")) {
|
|
|
return this.$message.error("福袋不能为空")
|
|
return this.$message.error("福袋不能为空")
|
|
|
}
|
|
}
|
|
|
- if ((this.setting[i].contentType == 12 || this.setting[i].contentType == 24) && (this.setting[i].liveId == null || this.setting[i].liveId == "")) {
|
|
|
|
|
|
|
+ if ((this.setting[i].contentType == 12 || this.setting[i].contentType == 24 || this.setting[i].contentType == 25) && (this.setting[i].liveId == null || this.setting[i].liveId == "")) {
|
|
|
return this.$message.error("直播间不能为空");
|
|
return this.$message.error("直播间不能为空");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (hasLiveSetting) {
|
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
|
+ if ([12, 18, 19, 24, 25].includes(Number(this.setting[i].contentType)) && this.setting[i].liveId) {
|
|
|
|
|
+ this.msgForm.liveId = this.setting[i].liveId;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|