|
@@ -274,6 +274,13 @@
|
|
@click="handleUpdateOutTime(scope.row)"
|
|
@click="handleUpdateOutTime(scope.row)"
|
|
>修改时间/评级/大小转
|
|
>修改时间/评级/大小转
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ v-if="scope.row.filterMode == 2"
|
|
|
|
+ @click="handleSendMsg(scope.row)"
|
|
|
|
+ >一键发群
|
|
|
|
+ </el-button>
|
|
<el-button
|
|
<el-button
|
|
v-if="scope.row.status == 1 "
|
|
v-if="scope.row.status == 1 "
|
|
size="mini"
|
|
size="mini"
|
|
@@ -601,33 +608,215 @@
|
|
<sopLogsDetails ref="sopLogsDetails" :rowDetailFrom="sopLogsDialog.sopLogsForm"></sopLogsDetails>
|
|
<sopLogsDetails ref="sopLogsDetails" :rowDetailFrom="sopLogsDialog.sopLogsForm"></sopLogsDetails>
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <el-dialog :title="sendMsgOpen.title" :visible.sync="sendMsgOpen.open" width="1000px" append-to-body>
|
|
|
|
+ <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
|
|
|
|
+ <el-form-item label="群">
|
|
|
|
+ <el-select v-model="msgForm.chatIds" placeholder="请选择群" size="mini" multiple>
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="chatId in sendMsgOpen.row && sendMsgOpen.row.chatId ? sendMsgOpen.row.chatId.split(',') : []"
|
|
|
|
+ :key="chatId"
|
|
|
|
+ :label="chatList.filter(e => e.chatId == chatId) ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
|
|
|
|
+ :value="chatId"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="选择课程">
|
|
|
|
+ <el-select v-model="msgForm.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" @change="courseChange()">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in courseList"
|
|
|
|
+ :key="dict.dictValue"
|
|
|
|
+ :label="dict.dictLabel"
|
|
|
|
+ :value="parseInt(dict.dictValue)"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-select v-model="msgForm.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange()" >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in videoList"
|
|
|
|
+ :key="dict.dictValue"
|
|
|
|
+ :label="dict.dictLabel"
|
|
|
|
+ :value="parseInt(dict.dictValue)"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-select v-model="msgForm.courseType" placeholder="请选择消息类型" size="mini" style=" margin-right: 10px;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in sysFsSopWatchStatus"
|
|
|
|
+ :key="dict.dictValue"
|
|
|
|
+ :label="dict.dictLabel"
|
|
|
|
+ :value="parseInt(dict.dictValue)"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="规则" prop="setting" >
|
|
|
|
+ <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="22">
|
|
|
|
+ <el-form :model="item" label-width="70px">
|
|
|
|
+ <el-form-item label="内容类别" style="margin: 2%">
|
|
|
|
+ <el-radio-group v-model="item.contentType">
|
|
|
|
+ <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType" @change="handleContentTypeChange()">{{item.dictLabel}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="内容" style="margin-bottom: 2%" >
|
|
|
|
+ <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3" placeholder="内容" style="width: 90%;margin-top: 10px;"/>
|
|
|
|
+
|
|
|
|
+ <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150" :height="150" />
|
|
|
|
+
|
|
|
|
+ <div v-if="item.contentType == 3 ">
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
+ <el-form-item label="链接标题:" label-width="100px">
|
|
|
|
+ <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="链接描述:" label-width="100px" >
|
|
|
|
+ <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述" style="width: 90%;margin-top: 1%;"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="链接封面:" label-width="100px">
|
|
|
|
+ <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150" :height="150" style="margin-top: 1%;" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="链接地址:" label-width="100px" >
|
|
|
|
+ <el-tag type="warning" v-model="item.isBindUrl=1">选择的课程小节 即为卡片链接地址</el-tag>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-card>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.contentType == 4">
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.contentType == 5 ">
|
|
|
|
+
|
|
|
|
+ <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
|
|
|
|
+ <el-upload
|
|
|
|
+ v-model="item.fileUrl"
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
+ :action="uploadUrl"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
|
|
|
|
+ :before-upload="beforeAvatarUploadFile">
|
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
|
|
|
|
+ {{item.fileUrl}}
|
|
|
|
+ </el-link>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div v-if="item.contentType == 6 ">
|
|
|
|
+ <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
|
|
|
|
+ <el-upload
|
|
|
|
+ v-model="item.videoUrl"
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
+ :action="uploadUrl"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
|
|
|
|
+ :before-upload="beforeAvatarUploadVideo">
|
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <video v-if="item.videoUrl"
|
|
|
|
+ :src="item.videoUrl"
|
|
|
|
+ controls style="width: 200px;height: 100px">
|
|
|
|
+ </video>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="item.contentType == 7 ">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="item.value"
|
|
|
|
+ type="textarea" :rows="3" maxlength="66" show-word-limit
|
|
|
|
+ placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
|
|
|
|
+ @input="handleInputVideoText(item.value,item)"/>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div v-if="item.contentType == 10 ">
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
+ <el-form-item label="链接标题:" label-width="100px">
|
|
|
|
+ <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="链接描述:" label-width="100px" >
|
|
|
|
+ <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述" style="width: 90%;margin-top: 1%;"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="链接封面:" label-width="100px">
|
|
|
|
+ <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150" :height="150" style="margin-top: 1%;" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="链接地址:" label-width="100px" >
|
|
|
|
+ <el-tag type="warning" >链接地址自动生成</el-tag>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-card>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="添加短链" v-if="item.contentType == 1 " >
|
|
|
|
+ <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark" :disabled="!!msgForm.videoId">
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model="item.isBindUrl"
|
|
|
|
+ :disabled="!msgForm.videoId"
|
|
|
|
+ active-color="#13ce66"
|
|
|
|
+ inactive-color="#DCDFE6"
|
|
|
|
+ active-value="1"
|
|
|
|
+ inactive-value="2">
|
|
|
|
+ </el-switch>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+
|
|
|
|
+ <span v-if="item.isBindUrl == '1'" style="margin-left: 10px; color: #13ce66">添加URL</span>
|
|
|
|
+ <span v-if="item.isBindUrl == '2'" style="margin-left: 10px; color: #b1b4ba">不加URL</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="课节过期时间" v-if="item.isBindUrl == '1'
|
|
|
|
+ && item.contentType != 2
|
|
|
|
+ && item.contentType != 5
|
|
|
|
+ && item.contentType != 6
|
|
|
|
+ && item.contentType != 8
|
|
|
|
+ && item.contentType != 9
|
|
|
|
+ && item.contentType != 10"
|
|
|
|
+ style="margin-top: 1%" label-width="100px">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-input-number v-model="item.expiresDays" :min="1" :max="100" ></el-input-number>
|
|
|
|
+ (天)
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1" :offset="1">
|
|
|
|
+ <i class="el-icon-delete" @click="delSetList(index)" style="margin-top: 20px;" v-if="setting.length>1"></i>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+ <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList()' >添加内容</el-link>
|
|
|
|
+
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitMsgForm">确 定</el-button>
|
|
|
|
+ <el-button @click="cancelMsgForm">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
- listSop,
|
|
|
|
- getSop,
|
|
|
|
- delSop,
|
|
|
|
addSop,
|
|
addSop,
|
|
- updateSop,
|
|
|
|
- exportSop,
|
|
|
|
courseList,
|
|
courseList,
|
|
- videoList,
|
|
|
|
- executeSop,
|
|
|
|
|
|
+ delSop,
|
|
|
|
+ exportSop,
|
|
getSopVoiceList,
|
|
getSopVoiceList,
|
|
- updateStatus, updateAutoSopTime, updateSopStatus
|
|
|
|
|
|
+ listSop,
|
|
|
|
+ updateAutoSopTime,
|
|
|
|
+ updateSop,
|
|
|
|
+ updateSopStatus,
|
|
|
|
+ updateStatus,
|
|
|
|
+ videoList
|
|
} from "@/api/qw/sop";
|
|
} from "@/api/qw/sop";
|
|
-import {listSopTemp, getSopTemp, delSopTemp, addSopTemp, updateSopTemp, exportSopTemp} from "@/api/qw/sopTemp";
|
|
|
|
-import {getQwAllUserList, listUser, qwList} from '@/api/company/companyUser'
|
|
|
|
|
|
+import {sendMsgSop} from "@/api/qw/sopUserLogsInfo";
|
|
|
|
+import {listSopTemp} from "@/api/qw/sopTemp";
|
|
|
|
+import {getQwAllUserList, listUser} from '@/api/company/companyUser'
|
|
import qwUserList from '@/views/qw/user/qwUserList.vue'
|
|
import qwUserList from '@/views/qw/user/qwUserList.vue'
|
|
import ImageUpload from "@/views/qw/sop/ImageUpload";
|
|
import ImageUpload from "@/views/qw/sop/ImageUpload";
|
|
import CustomerGroupDetails from '@/views/qw/groupMsg/customerGroupDetails.vue'
|
|
import CustomerGroupDetails from '@/views/qw/groupMsg/customerGroupDetails.vue'
|
|
import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
|
|
import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
|
|
-import {listTag, getTag,} from "@/api/qw/tag";
|
|
|
|
-import {getMyQwUserList, getMyQwCompanyList} from "@/api/qw/user";
|
|
|
|
-import source from "echarts/src/data/Source";
|
|
|
|
-import {updateTags} from "@/api/qw/autoTags";
|
|
|
|
|
|
+import {listTag,} from "@/api/qw/tag";
|
|
|
|
+import {getMyQwCompanyList} from "@/api/qw/user";
|
|
import {allList} from "@/api/qw/groupChat";
|
|
import {allList} from "@/api/qw/groupChat";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -639,10 +828,14 @@ export default {
|
|
expandedRows: {},
|
|
expandedRows: {},
|
|
//模板查询
|
|
//模板查询
|
|
tempListLoading: false,
|
|
tempListLoading: false,
|
|
|
|
+ voiceLoading :false,
|
|
|
|
+ uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
|
|
|
|
+ uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: false,
|
|
loading: false,
|
|
// 导出遮罩层
|
|
// 导出遮罩层
|
|
exportLoading: false,
|
|
exportLoading: false,
|
|
|
|
+ videoList:[],
|
|
// 选中数组
|
|
// 选中数组
|
|
ids: [],
|
|
ids: [],
|
|
//选中的map
|
|
//选中的map
|
|
@@ -652,6 +845,12 @@ export default {
|
|
companyUserLists: [],
|
|
companyUserLists: [],
|
|
chatList: [],
|
|
chatList: [],
|
|
courseList: [],
|
|
courseList: [],
|
|
|
|
+ sendMsgOpen:{
|
|
|
|
+ title:'一键批量群发',
|
|
|
|
+ open:false,
|
|
|
|
+ row: {},
|
|
|
|
+ ids:null,
|
|
|
|
+ },
|
|
// videoList:[],
|
|
// videoList:[],
|
|
tags: null,
|
|
tags: null,
|
|
excludeTags: null,
|
|
excludeTags: null,
|
|
@@ -666,6 +865,18 @@ export default {
|
|
showSearch: true,
|
|
showSearch: true,
|
|
// 总条数
|
|
// 总条数
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ msgForm:{
|
|
|
|
+ videoId:null,
|
|
|
|
+ courseId:null,
|
|
|
|
+ courseType:null,
|
|
|
|
+ userIdParam:null,
|
|
|
|
+ setting:null,
|
|
|
|
+ ids:null,
|
|
|
|
+ sopId: null,
|
|
|
|
+ startTime: null,
|
|
|
|
+ chatIds: [],
|
|
|
|
+ isRegister:2
|
|
|
|
+ },
|
|
// 企微sop表格数据
|
|
// 企微sop表格数据
|
|
sopList: [],
|
|
sopList: [],
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
@@ -705,6 +916,7 @@ export default {
|
|
|
|
|
|
//企微SOP发送类型
|
|
//企微SOP发送类型
|
|
sysQwSopType: [],
|
|
sysQwSopType: [],
|
|
|
|
+ sysQwSopAiContentType: [],
|
|
|
|
|
|
//SOP课程观看状态
|
|
//SOP课程观看状态
|
|
sysFsSopWatchStatus: [],
|
|
sysFsSopWatchStatus: [],
|
|
@@ -738,6 +950,7 @@ export default {
|
|
title: "",
|
|
title: "",
|
|
open: false
|
|
open: false
|
|
},
|
|
},
|
|
|
|
+ msgRules:{},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
name: [{required: true, message: "名称不能为空", trigger: "submit"}],
|
|
name: [{required: true, message: "名称不能为空", trigger: "submit"}],
|
|
@@ -777,6 +990,12 @@ export default {
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
+ this.getDicts("sys_qwSopAi_contentType").then(response => {
|
|
|
|
+ this.sysQwSopAiContentType = response.data;
|
|
|
|
+ });
|
|
|
|
+ this.getDicts("sys_fs_sop_watch_status").then(response => {
|
|
|
|
+ this.sysFsSopWatchStatus = response.data;
|
|
|
|
+ });
|
|
listUser().then(res => {
|
|
listUser().then(res => {
|
|
this.companyUserLists = res.rows;
|
|
this.companyUserLists = res.rows;
|
|
}
|
|
}
|
|
@@ -1063,6 +1282,59 @@ export default {
|
|
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ addSetList(){
|
|
|
|
+ const newSetting = {
|
|
|
|
+ contentType:'1',
|
|
|
|
+ value: '',
|
|
|
|
+ };
|
|
|
|
+ // 将新设置项添加到 content.setting 数组中
|
|
|
|
+ this.setting.push(newSetting);
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleContentTypeChange() {
|
|
|
|
+
|
|
|
|
+ //如果是链接的才上
|
|
|
|
+ if (this.msgForm.courseId != null ) {
|
|
|
|
+ const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
+ //响应式直接给链接的标题/封面上值
|
|
|
|
+ if (selectedCourse && this.setting[i].contentType == 3 && this.msgForm.courseId != null) {
|
|
|
|
+ this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
|
|
|
|
+ this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (this.msgForm.videoId != null ) {
|
|
|
|
+ // 查找选中的课节对应的 label
|
|
|
|
+ const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
+ //响应式直接给链接的描述上值
|
|
|
|
+ if (selectedVideo && this.setting[i].contentType == 3 && this.msgForm.videoId != null) {
|
|
|
|
+ this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ videoIdChange() {
|
|
|
|
+ if (this.msgForm.videoId != null ) {
|
|
|
|
+ // 查找选中的课节对应的 label
|
|
|
|
+ const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
+ //响应式直接给链接的描述上值
|
|
|
|
+ if (selectedVideo && this.setting[i].contentType == 3 && this.msgForm.videoId != null) {
|
|
|
|
+ this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
this.open = false;
|
|
this.open = false;
|
|
@@ -1157,6 +1429,64 @@ export default {
|
|
this.sopLogsDialog.sopLogsForm = row;
|
|
this.sopLogsDialog.sopLogsForm = row;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ handleAvatarSuccessFile(res, file, item) {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ // 使用 $set 确保响应式更新
|
|
|
|
+ this.$set(item, 'fileUrl', res.url);
|
|
|
|
+ } else {
|
|
|
|
+ this.msgError(res.msg);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeAvatarUploadFile(file){
|
|
|
|
+ const isLt1M = file.size / 1024 / 1024 < 10;
|
|
|
|
+ if (!isLt1M) {
|
|
|
|
+ this.$message.error('上传大小不能超过 10MB!');
|
|
|
|
+ }
|
|
|
|
+ return isLt1M;
|
|
|
|
+ },
|
|
|
|
+ //下载文件
|
|
|
|
+ downloadUrl(materialUrl) {
|
|
|
|
+ // 直接返回文件 URL
|
|
|
|
+ return materialUrl;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleAvatarSuccessVideo(res, file, item) {
|
|
|
|
+ if(res.code==200){
|
|
|
|
+ // 使用 $set 确保响应式更新
|
|
|
|
+ this.$set(item, 'videoUrl', res.url);
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ this.msgError(res.msg);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ beforeAvatarUploadVideo(file){
|
|
|
|
+ const isLt30M = file.size / 1024 / 1024 < 10;
|
|
|
|
+ const isMP4 = file.type === 'video/mp4';
|
|
|
|
+
|
|
|
|
+ if (!isMP4) {
|
|
|
|
+ this.$message.error('仅支持上传 MP4 格式的视频文件!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!isLt30M) {
|
|
|
|
+ this.$message.error('上传大小不能超过 10MB!');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleInputVideoText(value,content){
|
|
|
|
+ // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
|
|
|
|
+ const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
|
|
|
|
+
|
|
|
|
+ // 删除不符合条件的字符
|
|
|
|
+ const filteredValue = value.split('').filter(char => regex.test(char)).join('');
|
|
|
|
+
|
|
|
|
+ this.$set(content, 'value', filteredValue);
|
|
|
|
+
|
|
|
|
+ },
|
|
/**
|
|
/**
|
|
* 查看模板
|
|
* 查看模板
|
|
*/
|
|
*/
|
|
@@ -1314,7 +1644,117 @@ export default {
|
|
this.exportLoading = false;
|
|
this.exportLoading = false;
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 一键群发
|
|
|
|
+ */
|
|
|
|
+ handleSendMsg(row){
|
|
|
|
+ this.sendMsgOpen.open = true;
|
|
|
|
+ this.sendMsgOpen.id = row.id;
|
|
|
|
+ this.sendMsgOpen.row = row;
|
|
|
|
+ },
|
|
|
|
+ submitMsgForm(){
|
|
|
|
+ this.$refs["msgForm"].validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ this.msgForm.setting=JSON.stringify(this.setting)
|
|
|
|
+ this.msgForm.sopId=this.sendMsgOpen.row.id;
|
|
|
|
+ this.msgForm.filterMode=this.sendMsgOpen.row.filterMode;
|
|
|
|
+
|
|
|
|
+ if (this.setting.length <= 0) {
|
|
|
|
+ return this.$message.error("请添加规则")
|
|
|
|
+ }
|
|
|
|
+ if (this.msgForm.courseId===null || this.msgForm.courseId===''){
|
|
|
|
+ return this.$message.error("课程不能为空")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.msgForm.videoId===null || this.msgForm.videoId===''){
|
|
|
|
+ return this.$message.error("课节不能为空")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.msgForm.courseType===null || this.msgForm.courseType===''){
|
|
|
|
+ return this.$message.error("消息类型不能为空")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
+ if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
|
+ return this.$message.error("内容不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
|
|
|
|
+ return this.$message.error("图片不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 3 && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
|
|
|
|
+ return this.$message.error("链接标题不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 3 && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
|
|
|
|
+ return this.$message.error("链接描述不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 3 && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
|
|
|
|
+ return this.$message.error("链接图片不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 3 && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
|
|
|
|
+ return this.$message.error("链接地址不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
|
|
|
|
+ return this.$message.error("文件不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
|
|
|
|
+ return this.$message.error("视频不能为空")
|
|
|
|
+ }
|
|
|
|
+ if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
|
+ return this.$message.error("语音不能为空")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.sendMsgOpen.open = false;
|
|
|
|
+
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '正在执行中请稍后~~请不要刷新页面!!',
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ sendMsgSop(this.msgForm).then(response => {
|
|
|
|
+ this.msgSuccess("一键群发成功");
|
|
|
|
+ loading.close();
|
|
|
|
+ this.setting=[];
|
|
|
|
+ this.msgForm = {
|
|
|
|
+ videoId:null,
|
|
|
|
+ courseId:null,
|
|
|
|
+ courseType:null,
|
|
|
|
+ setting:null,
|
|
|
|
+ isRegister:2,
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.getList();
|
|
|
|
+ }).finally(()=>{
|
|
|
|
+ loading.close();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ courseChange() {
|
|
|
|
+ if (this.msgForm.courseId != null ) {
|
|
|
|
+ const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
|
|
|
|
+ for (let i = 0; i < this.setting.length; i++) {
|
|
|
|
+ //响应式直接给链接的标题/封面上值
|
|
|
|
+ if (selectedCourse && this.setting[i].contentType == 3 && this.msgForm.courseId != null) {
|
|
|
|
+ this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
|
|
|
|
+ this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ videoList(this.msgForm.courseId).then(response => {
|
|
|
|
+ this.videoList=response.list;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ cancelMsgForm(){
|
|
|
|
+ this.sendMsgOpen.open = false;
|
|
|
|
+ this.resetSendMsgSop();
|
|
|
|
+ },
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|