|
@@ -52,7 +52,7 @@
|
|
placeholder="内容名称,仅内部可见"/>
|
|
placeholder="内容名称,仅内部可见"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="课程" v-if="form.sendType == 5 && item.content && item.content.length > 0" required>
|
|
<el-form-item label="课程" v-if="form.sendType == 5 && item.content && item.content.length > 0" required>
|
|
- <el-select :disabled="formType == 3 || form.sendType == 5" v-model="item.content[0].courseId"
|
|
|
|
|
|
+ <el-select :disabled="(formType == 3 || form.sendType == 5) && item.id != null" v-model="item.content[0].courseId"
|
|
placeholder="请选择课程" style=" margin-right: 10px;" size="mini" remote
|
|
placeholder="请选择课程" style=" margin-right: 10px;" size="mini" remote
|
|
filterable
|
|
filterable
|
|
@change="courseChangeUpdate(item.content[0], index, 0)">
|
|
@change="courseChangeUpdate(item.content[0], index, 0)">
|
|
@@ -63,7 +63,7 @@
|
|
:value="parseInt(dict.dictValue)"
|
|
:value="parseInt(dict.dictValue)"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-select :disabled="formType == 3 || form.sendType == 5" v-model="item.content[0].videoId"
|
|
|
|
|
|
+ <el-select :disabled="(formType == 3 || form.sendType == 5) && item.id != null" v-model="item.content[0].videoId"
|
|
placeholder="请选择小节" size="mini" style=" margin-right: 10px;" remote
|
|
placeholder="请选择小节" size="mini" style=" margin-right: 10px;" remote
|
|
filterable
|
|
filterable
|
|
@change="videoIdChange(item.content[0],index,0)">
|
|
@change="videoIdChange(item.content[0],index,0)">
|
|
@@ -74,17 +74,6 @@
|
|
:value="parseInt(dict.dictValue)"
|
|
:value="parseInt(dict.dictValue)"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-select :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-model="item.content[0].courseType"
|
|
|
|
- placeholder="请选择消息类型" size="mini"
|
|
|
|
- style=" margin-right: 10px;" v-if="item.content[0].type != 4 ">
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in sysFsSopWatchStatus"
|
|
|
|
- :key="dict.dictValue"
|
|
|
|
- :label="dict.dictLabel"
|
|
|
|
- :value="Number(dict.dictValue)"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
-
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="规则">
|
|
<el-form-item label="规则">
|
|
<div v-for="(content, contentIndex) in item.content" :key="contentIndex"
|
|
<div v-for="(content, contentIndex) in item.content" :key="contentIndex"
|
|
@@ -129,14 +118,24 @@
|
|
inactive-value="0">
|
|
inactive-value="0">
|
|
</el-switch>
|
|
</el-switch>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
|
|
+ <el-form-item label="消息类型" v-if="form.sendType != 4">
|
|
|
|
+ <el-select :disabled="formType == 3" v-model="content.courseType"
|
|
|
|
+ placeholder="请选择消息类型" size="mini"
|
|
|
|
+ style=" margin-right: 10px;" v-if="content.type != 4 ">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in sysFsSopWatchStatus"
|
|
|
|
+ :key="dict.dictValue"
|
|
|
|
+ :label="dict.dictLabel"
|
|
|
|
+ :value="Number(dict.dictValue)"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="消息类别" v-if="form.sendType != 4 && form.sendType != 5">
|
|
<el-form-item label="消息类别" v-if="form.sendType != 4 && form.sendType != 5">
|
|
<el-radio-group v-model="content.type"
|
|
<el-radio-group v-model="content.type"
|
|
:disabled="formType == 3 || content.isOfficial === '1'"
|
|
:disabled="formType == 3 || content.isOfficial === '1'"
|
|
@change="updateHtml(() => content.contentType = '1')">
|
|
@change="updateHtml(() => content.contentType = '1')">
|
|
<el-radio :label="1">普通</el-radio>
|
|
<el-radio :label="1">普通</el-radio>
|
|
<el-radio :label="2">课程</el-radio>
|
|
<el-radio :label="2">课程</el-radio>
|
|
- <el-radio :label="3">订单</el-radio>
|
|
|
|
<el-radio :label="4">AI触达</el-radio>
|
|
<el-radio :label="4">AI触达</el-radio>
|
|
<el-radio :label="5">打标签</el-radio>
|
|
<el-radio :label="5">打标签</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
@@ -261,10 +260,10 @@
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</div>
|
|
</div>
|
|
- <div v-if="form.sendType == 2 || form.sendType == 5">
|
|
|
|
|
|
+ <div v-if="form.sendType == 2">
|
|
<el-radio-group v-model="setList.contentType"
|
|
<el-radio-group v-model="setList.contentType"
|
|
:disabled="formType == 3 || !roles.includes('edit_sop_temp_content')"
|
|
:disabled="formType == 3 || !roles.includes('edit_sop_temp_content')"
|
|
- @change="handleContentTypeChange(content,index,contentIndex,setIndex)">
|
|
|
|
|
|
+ @change="handleContentTypeChange(content,index,contentIndex,setIndex, item, 'contentType', $event)">
|
|
<el-radio
|
|
<el-radio
|
|
:key="item.dictValue"
|
|
:key="item.dictValue"
|
|
:label="item.dictValue"
|
|
:label="item.dictValue"
|
|
@@ -273,6 +272,18 @@
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if="form.sendType == 5">
|
|
|
|
+ <el-radio-group v-model="setList.contentType"
|
|
|
|
+ :disabled="formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0)"
|
|
|
|
+ @change="handleContentTypeChange(content,index,contentIndex,setIndex, item, 'contentType', $event)">
|
|
|
|
+ <el-radio
|
|
|
|
+ :key="item.dictValue"
|
|
|
|
+ :label="item.dictValue"
|
|
|
|
+ :disabled="(content.type!=2 && item.dictValue === '9') || (content.isOfficial==1 && ['5','6','7','8','9'].includes(item.dictValue))"
|
|
|
|
+ v-for="item in sysQwSopAiContentType" v-if="setIndex == 0 ? courseTypeList.includes(item.dictValue) : !courseTypeList.includes(item.dictValue)">{{ item.dictLabel }}
|
|
|
|
+ </el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="内容">
|
|
<el-form-item label="内容">
|
|
<el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-if="setList.contentType == 1 "
|
|
<el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-if="setList.contentType == 1 "
|
|
@@ -301,19 +312,22 @@
|
|
v-if="setList.contentType == 3 || (setList.contentType == 9 && content.type==2 )">
|
|
v-if="setList.contentType == 3 || (setList.contentType == 9 && content.type==2 )">
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
<el-form-item label="链接标题:" label-width="100px" required>
|
|
<el-form-item label="链接标题:" label-width="100px" required>
|
|
- <el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-model="setList.linkTitle"
|
|
|
|
|
|
+ <el-input :disabled="formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0)" v-model="setList.linkTitle"
|
|
|
|
+ @change="updateAll(setIndex, item, 'linkTitle', $event)"
|
|
placeholder="请输入链接标题"
|
|
placeholder="请输入链接标题"
|
|
style="width: 90%;"/>
|
|
style="width: 90%;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="链接描述:" label-width="100px" required>
|
|
<el-form-item label="链接描述:" label-width="100px" required>
|
|
- <el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" type="textarea" :rows="3"
|
|
|
|
|
|
+ <el-input :disabled="formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0)" type="textarea" :rows="3"
|
|
v-model="setList.linkDescribe"
|
|
v-model="setList.linkDescribe"
|
|
|
|
+ @change="updateAll(setIndex, item, 'linkDescribe', $event)"
|
|
placeholder="请输入链接描述"
|
|
placeholder="请输入链接描述"
|
|
style="width: 90%;margin-top: 1%;"/>
|
|
style="width: 90%;margin-top: 1%;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="链接封面:" label-width="100px" required>
|
|
<el-form-item label="链接封面:" label-width="100px" required>
|
|
- <ImageUpload :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-model="setList.linkImageUrl"
|
|
|
|
|
|
+ <ImageUpload :disabled="formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0)" v-model="setList.linkImageUrl"
|
|
type="image" :num="1"
|
|
type="image" :num="1"
|
|
|
|
+ @input="updateAll(setIndex, item, 'linkImageUrl', $event)"
|
|
:file-size="2" :width="150" :height="150"
|
|
:file-size="2" :width="150" :height="150"
|
|
style="margin-top: 1%;"/>
|
|
style="margin-top: 1%;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -338,12 +352,16 @@
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
<el-form-item label="标题" prop="miniprogramTitle">
|
|
<el-form-item label="标题" prop="miniprogramTitle">
|
|
<el-input v-model="setList.miniprogramTitle"
|
|
<el-input v-model="setList.miniprogramTitle"
|
|
|
|
+ :disabled="formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0)"
|
|
|
|
+ @change="updateAll(setIndex, item, 'miniprogramTitle', $event)"
|
|
placeholder="请输入小程序消息标题,最长为64字节" :rows="2"
|
|
placeholder="请输入小程序消息标题,最长为64字节" :rows="2"
|
|
maxlength="64" type="textarea"
|
|
maxlength="64" type="textarea"
|
|
@input="checkByteLength(content,setList.contentType,content.isOfficial)"/>
|
|
@input="checkByteLength(content,setList.contentType,content.isOfficial)"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="封面" prop="miniprogramPicUrl">
|
|
<el-form-item label="封面" prop="miniprogramPicUrl">
|
|
<ImageUpload v-if="content.isOfficial !== '1'"
|
|
<ImageUpload v-if="content.isOfficial !== '1'"
|
|
|
|
+ @change="updateAll(setIndex, item, 'miniprogramPicUrl', $event)"
|
|
|
|
+ :disabled="formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0)"
|
|
v-model="setList.miniprogramPicUrl" type="image" :num="10"
|
|
v-model="setList.miniprogramPicUrl" type="image" :num="10"
|
|
:width="150" :height="150"/>
|
|
:width="150" :height="150"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -481,7 +499,7 @@
|
|
<el-form-item label="添加短链"
|
|
<el-form-item label="添加短链"
|
|
v-if="content.type == 2 && setList.contentType == 1 ">
|
|
v-if="content.type == 2 && setList.contentType == 1 ">
|
|
<el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark"
|
|
<el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark"
|
|
- :disabled="!!content.videoId">
|
|
|
|
|
|
+ :disabled="!content.videoId">
|
|
<el-switch
|
|
<el-switch
|
|
@change="updateHtml"
|
|
@change="updateHtml"
|
|
v-model="setList.isBindUrl"
|
|
v-model="setList.isBindUrl"
|
|
@@ -502,7 +520,8 @@
|
|
v-if="content.type == 2 && setList.isBindUrl == '1' && setList.contentType != 2 && setList.contentType != 5 && setList.contentType != 6 && setList.contentType != 8 && setList.contentType != 9 && setList.contentType != 10 ">
|
|
v-if="content.type == 2 && setList.isBindUrl == '1' && setList.contentType != 2 && setList.contentType != 5 && setList.contentType != 6 && setList.contentType != 8 && setList.contentType != 9 && setList.contentType != 10 ">
|
|
<el-row>
|
|
<el-row>
|
|
<el-input type="number" v-model="setList.expiresDays"
|
|
<el-input type="number" v-model="setList.expiresDays"
|
|
- :disabled="!roles.includes('edit_sop_temp_content')"
|
|
|
|
|
|
+ :disabled="!roles.includes('edit_sop_temp_content') && (formType == 3 || (form.sendType == 5 && contentIndex != 0 && setIndex == 0))"
|
|
|
|
+ @change="updateAll(setIndex, item, 'expiresDays', $event)"
|
|
style="width: 200px">
|
|
style="width: 200px">
|
|
<template slot="append">天</template>
|
|
<template slot="append">天</template>
|
|
</el-input>
|
|
</el-input>
|
|
@@ -548,7 +567,7 @@
|
|
<el-col :span="1" :offset="1">
|
|
<el-col :span="1" :offset="1">
|
|
<i class="el-icon-delete" @click="delSetList(index,contentIndex,setIndex)"
|
|
<i class="el-icon-delete" @click="delSetList(index,contentIndex,setIndex)"
|
|
style="margin-top: 20px;"
|
|
style="margin-top: 20px;"
|
|
- v-if="content.setting.length>1 && (formType != 3) && roles.includes('del_sop_temp_content')"></i>
|
|
|
|
|
|
+ v-if="content.setting.length>1 && (formType != 3) && roles.includes('del_sop_temp_content') && !(form.sendType == 5 && setIndex == 0)"></i>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -715,6 +734,7 @@ export default {
|
|
ruleList: [],
|
|
ruleList: [],
|
|
ids: [],
|
|
ids: [],
|
|
startTimeRange: [],
|
|
startTimeRange: [],
|
|
|
|
+ courseTypeList: ['3', '4', '9'],
|
|
sysFsSopWatchStatus: [],
|
|
sysFsSopWatchStatus: [],
|
|
//消息内容类型 企微版
|
|
//消息内容类型 企微版
|
|
sysQwSopContentType: [],
|
|
sysQwSopContentType: [],
|
|
@@ -1423,7 +1443,7 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- handleContentTypeChange(content, index, countIndex) {
|
|
|
|
|
|
+ handleContentTypeChange(content, index, countIndex, setIndex, item, fieldName, val) {
|
|
//如果是链接的才上
|
|
//如果是链接的才上
|
|
if (content.courseId != null && content.type == 2) {
|
|
if (content.courseId != null && content.type == 2) {
|
|
const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
|
|
const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
|
|
@@ -1461,7 +1481,14 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if(countIndex == 0 && setIndex == 0){
|
|
|
|
+ this.updateAll(setIndex, item, fieldName, val);
|
|
|
|
+ for (let index in item.content) {
|
|
|
|
+ if(index != 0){
|
|
|
|
+ this.handleContentTypeChange(item.content[index], 0, index, 0, item, fieldName, val);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
videoIdChange(content, index, countIndex) {
|
|
videoIdChange(content, index, countIndex) {
|
|
|
|
|
|
@@ -1710,9 +1737,14 @@ export default {
|
|
val || val();
|
|
val || val();
|
|
|
|
|
|
},
|
|
},
|
|
- // updateChange(val) {
|
|
|
|
- // console.log(val)
|
|
|
|
- // }
|
|
|
|
|
|
+ updateAll(setIndex, list, fieldName, newVal) {
|
|
|
|
+ if(this.form.sendType == 5 && setIndex == 0) {
|
|
|
|
+ console.info("更新数据", newVal)
|
|
|
|
+ for (let index in list.content) {
|
|
|
|
+ this.$set(list.content[index].setting[0], fieldName, newVal);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|