sendMsgOpenTool.vue 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152
  1. <template>
  2. <div class="app-container">
  3. <el-dialog :title="sendMsgOpen.title" :visible.sync="sendMsgOpen.open" width="1000px" append-to-body>
  4. <el-alert
  5. type="error"
  6. :closable="false"
  7. show-icon>
  8. <template #title>
  9. <span style="font-size: 25px; line-height: 1.5;">
  10. 此功能用于给 选中的 营期 内【所有的】客户发送 消息
  11. </span>
  12. </template>
  13. </el-alert>
  14. <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
  15. <el-form-item label="策略" prop="draftStrategy">
  16. <el-radio-group v-model="msgForm.draftStrategy">
  17. <el-radio :label="1">正常群发</el-radio>
  18. <el-radio :label="2">清除草稿</el-radio>
  19. <el-radio :label="3">发送草稿</el-radio>
  20. </el-radio-group>
  21. </el-form-item>
  22. <el-form-item label="选择课程" v-if="msgForm.draftStrategy==1" >
  23. <el-select v-model="msgForm.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" @change="courseChange()">
  24. <el-option
  25. v-for="dict in courseList"
  26. :key="dict.dictValue"
  27. :label="dict.dictLabel"
  28. :value="parseInt(dict.dictValue)"
  29. />
  30. </el-select>
  31. <el-select v-model="msgForm.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange()" >
  32. <el-option
  33. v-for="dict in videoList"
  34. :key="dict.dictValue"
  35. :label="dict.dictLabel"
  36. :value="parseInt(dict.dictValue)"
  37. />
  38. </el-select>
  39. <el-select v-model="msgForm.courseType" placeholder="请选择消息类型" size="mini" style=" margin-right: 10px;">
  40. <el-option
  41. v-for="dict in sysFsSopWatchStatus"
  42. :key="dict.dictValue"
  43. :label="dict.dictLabel"
  44. :value="parseInt(dict.dictValue)"
  45. />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="选择直播间">
  49. <el-select v-model="msgForm.liveId"
  50. filterable
  51. placeholder="请选择直播间" size="mini"
  52. style=" margin-right: 10px;"
  53. @change="liveChangemsgForm(msgForm.liveId)" clearable >
  54. <el-option
  55. v-for="dict in liveList"
  56. :key="dict.liveId"
  57. :label="dict.liveName"
  58. :value="dict.liveId"
  59. />
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="规则" prop="setting" v-if="msgForm.draftStrategy==1" >
  63. <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
  64. <el-row>
  65. <el-col :span="22">
  66. <el-form :model="item" label-width="70px">
  67. <el-form-item label="内容类别" style="margin: 2%">
  68. <el-radio-group v-model="item.contentType">
  69. <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType" @change="handleContentTypeChange()">{{item.dictLabel}}</el-radio>
  70. </el-radio-group>
  71. </el-form-item>
  72. <!-- <div v-if="item.contentType == 12">
  73. <el-card class="box-card">
  74. <el-form-item label="直播间" >
  75. <el-select v-model="item.liveId"
  76. placeholder="请选择直播间" size="mini"
  77. @change="liveChange(item)" >
  78. <el-option
  79. v-for="dict in liveList"
  80. :key="dict.liveId"
  81. :label="dict.liveName"
  82. :value="dict.liveId"
  83. />
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item label="标题" prop="miniprogramTitle">
  87. <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
  88. type="textarea" />
  89. </el-form-item>
  90. <el-form-item label="封面" prop="miniprogramPicUrl">
  91. <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
  92. </el-form-item>
  93. <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
  94. <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
  95. </el-form-item>
  96. <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px">
  97. <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" disabled />
  98. </el-form-item>
  99. </el-card>
  100. </div> -->
  101. <el-form-item label="内容" style="margin-bottom: 2%" >
  102. <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19">
  103. <el-card class="box-card">
  104. <el-form-item label="直播间" >
  105. <el-select v-model="item.liveId"
  106. filterable
  107. placeholder="请选择直播间" size="mini"
  108. @change="liveChange(item)" :disabled="liveDisabled()">
  109. <el-option
  110. v-for="dict in liveList"
  111. :key="dict.liveId"
  112. :label="dict.liveName"
  113. :value="dict.liveId"
  114. />
  115. </el-select>
  116. </el-form-item>
  117. <el-form-item label="标题" prop="miniprogramTitle">
  118. <el-input :disabled="liveDisabled()" v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
  119. type="textarea" />
  120. </el-form-item>
  121. <el-form-item label="封面" prop="miniprogramPicUrl">
  122. <ImageUpload :disabled="liveDisabled()" v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
  123. </el-form-item>
  124. <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
  125. <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
  126. </el-form-item>
  127. <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px">
  128. <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" disabled />
  129. </el-form-item>
  130. </el-card>
  131. </div>
  132. <el-input
  133. v-if="item.contentType == 1 || item.contentType == 15|| item.contentType == 13"
  134. v-model="item.value"
  135. type="textarea"
  136. :rows="3"
  137. placeholder="内容"
  138. style="width: 90%; margin-top: 10px;"
  139. @keydown.native="handleKeydown($event, index)"
  140. :ref="`textarea-${index}`"
  141. >
  142. </el-input>
  143. <el-link
  144. v-if="item.contentType == 1 || item.contentType == 15|| item.contentType == 13"
  145. type="primary"
  146. @click="toggleSalesCall(index)"
  147. style="margin-top: 10px;"
  148. >
  149. {{ item.isSalesCallAdded ? '移除#销售称呼#' : '添加#销售称呼#' }}
  150. </el-link>
  151. <el-link
  152. v-if="item.contentType == 1 || item.contentType == 15|| item.contentType == 13"
  153. type="primary"
  154. @click="toggleSalesCallCustomer(index)"
  155. style="margin-top: 10px;margin-left: 2%"
  156. >
  157. {{ item.isSalesCallCustomerAdded ? '移除#客户称呼#' : '添加#客户称呼#' }}
  158. </el-link>
  159. <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150" :height="150" />
  160. <div v-if="item.contentType == 3 || item.contentType ==9 ">
  161. <el-card class="box-card">
  162. <el-form-item label="链接标题:" label-width="100px">
  163. <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
  164. </el-form-item>
  165. <el-form-item label="链接描述:" label-width="100px" >
  166. <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述" style="width: 90%;margin-top: 1%;"/>
  167. </el-form-item>
  168. <el-form-item label="链接封面:" label-width="100px">
  169. <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150" :height="150" style="margin-top: 1%;" />
  170. </el-form-item>
  171. <el-form-item label="链接地址:" label-width="100px" >
  172. <el-tag type="warning" v-model="item.isBindUrl=1">选择的课程小节 即为卡片链接地址</el-tag>
  173. </el-form-item>
  174. </el-card>
  175. </div>
  176. <div v-if="item.contentType == 4 || item.contentType == 10 || item.contentType == 17 ">
  177. <el-card class="box-card">
  178. <el-form-item label="标题" prop="miniprogramTitle">
  179. <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
  180. </el-form-item>
  181. <el-form-item label="封面" prop="miniprogramPicUrl">
  182. <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
  183. </el-form-item>
  184. <el-form-item label="appid" prop="miniprogramAppid" v-show="false" >
  185. <el-input v-model="item.miniprogramAppid='wx73f85f8d62769119' " disabled />
  186. </el-form-item>
  187. <el-form-item label="page路径" prop="miniprogramPage" v-show="item.contentType == 10" label-width="100px" style="margin-left: -30px" >
  188. <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" type="textarea" :rows="3" />
  189. </el-form-item>
  190. </el-card>
  191. </div>
  192. <div v-if="item.contentType == 5 ">
  193. <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
  194. <el-upload
  195. v-model="item.fileUrl"
  196. class="avatar-uploader"
  197. :action="uploadUrl"
  198. :show-file-list="false"
  199. :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
  200. :before-upload="beforeAvatarUploadFile">
  201. <i class="el-icon-plus avatar-uploader-icon"></i>
  202. </el-upload>
  203. <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
  204. {{item.fileUrl}}
  205. </el-link>
  206. </el-form-item>
  207. </div>
  208. <div v-if="item.contentType == 6 ">
  209. <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
  210. <el-upload
  211. v-model="item.videoUrl"
  212. class="avatar-uploader"
  213. :action="uploadUrl"
  214. :show-file-list="false"
  215. :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
  216. :before-upload="beforeAvatarUploadVideo">
  217. <i class="el-icon-plus avatar-uploader-icon"></i>
  218. </el-upload>
  219. <video v-if="item.videoUrl"
  220. :src="item.videoUrl"
  221. controls style="width: 200px;height: 100px">
  222. </video>
  223. </el-form-item>
  224. </div>
  225. <div v-if="item.contentType == 7 || item.contentType == 16">
  226. <el-input
  227. v-model="item.value"
  228. type="textarea" :rows="3" maxlength="66" show-word-limit
  229. placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
  230. @input="handleInputVideoText(item.value,item)"/>
  231. </div>
  232. <!-- <div v-if="item.contentType == 12">
  233. <el-card class="box-card">
  234. <el-form-item label="直播间3" >
  235. <el-select v-model="item.liveId"
  236. placeholder="请选择直播间" size="mini"
  237. @change="liveChange(item)" >
  238. <el-option
  239. v-for="dict in liveList"
  240. :key="dict.liveId"
  241. :label="dict.liveName"
  242. :value="dict.liveId"
  243. />
  244. </el-select>
  245. </el-form-item>
  246. <el-form-item label="标题" prop="miniprogramTitle">
  247. <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字节" :rows="2" maxlength="64"
  248. type="textarea" />
  249. </el-form-item>
  250. <el-form-item label="封面" prop="miniprogramPicUrl">
  251. <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
  252. </el-form-item>
  253. <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
  254. <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
  255. </el-form-item>
  256. <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px">
  257. <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" disabled />
  258. </el-form-item>
  259. </el-card>
  260. </div> -->
  261. <div v-if="item.contentType == 8">
  262. <el-button type="primary"
  263. style="margin-bottom: 1%"
  264. @click="hanldeSelectVideoNum(setting,index)">
  265. 选择视频号
  266. </el-button>
  267. <el-card class="box-card" v-if="item.coverUrl">
  268. <el-form-item label="封面标题:" label-width="100px">
  269. <el-input v-model="item.nickname"
  270. style="width: 90%;margin-bottom: 1%" disabled/>
  271. </el-form-item>
  272. <el-form-item label="头像:" label-width="100px">
  273. <el-image
  274. v-if="item.avatar != null"
  275. :src="item.avatar"
  276. :preview-src-list="[item.avatar]"
  277. :style="{ width: '50px', height: '50px' }"
  278. ></el-image>
  279. </el-form-item>
  280. <el-form-item label="封面:" label-width="100px">
  281. <el-image
  282. v-if="item.coverUrl != null"
  283. :src="item.coverUrl"
  284. :preview-src-list="[item.coverUrl]"
  285. :style="{ width: '200px', height: '200px' }"
  286. ></el-image>
  287. </el-form-item>
  288. <el-form-item label="简介:" label-width="100px">
  289. <el-input type="textarea" :rows="3"
  290. v-model="item.desc"
  291. style="width: 90%;margin-top: 1%;" disabled/>
  292. </el-form-item>
  293. <el-form-item label="视频地址:" label-width="100px"
  294. style="margin-top: 1%">
  295. <el-input v-model="item.url"
  296. style="width: 90%;" disabled/>
  297. </el-form-item>
  298. </el-card>
  299. </div>
  300. <div v-if="item.contentType == 14">
  301. <el-card class="box-card">
  302. <el-form-item label="福袋名称" >
  303. <el-select v-model="item.luckyBagId"
  304. placeholder="请选择福袋" size="mini"
  305. @change="getLuckyBagStatus(item)" >
  306. <el-option
  307. v-for="dict in luckyBagList"
  308. :key="dict.id"
  309. :label="dict.name"
  310. :value="dict.id"
  311. />
  312. </el-select>
  313. </el-form-item>
  314. <el-form-item label="福袋状态" >
  315. <el-tag :type="item.luckyBagDataStatus == 1 ? 'success' : 'danger'">
  316. {{ item.luckyBagDataStatus == 1 ? '启用' : '禁用' }}
  317. </el-tag>
  318. </el-form-item>
  319. </el-card>
  320. </div>
  321. <div v-if="item.contentType == 21">
  322. <el-card class="box-card">
  323. <el-form-item label="短信模板" >
  324. <el-select v-model="item.smsTemplateId"
  325. placeholder="请选择短信模板" size="mini"
  326. @change="getSmsTemplateInfo(item)" >
  327. <el-option
  328. v-for="template in smsTemplateList"
  329. :key="template.tempId"
  330. :label="template.title"
  331. :value="template.tempId"
  332. />
  333. </el-select>
  334. </el-form-item>
  335. <el-form-item label="内容预览" v-if="item.smsTemplateContent">
  336. <div style="color: #666; font-size: 12px; padding: 8px; border: 1px solid #eee; border-radius: 4px; background-color: #f9f9f9; max-height: 100px; overflow-y: auto;">
  337. {{ item.smsTemplateContent }}
  338. </div>
  339. </el-form-item>
  340. </el-card>
  341. </div>
  342. </el-form-item>
  343. <el-form-item label="添加短链" v-if="item.contentType == 1 || item.contentType == 15" >
  344. <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark" :disabled="!!msgForm.videoId">
  345. <el-switch
  346. v-model="item.isBindUrl"
  347. :disabled="!msgForm.videoId"
  348. active-color="#13ce66"
  349. inactive-color="#DCDFE6"
  350. active-value="1"
  351. inactive-value="2">
  352. </el-switch>
  353. </el-tooltip>
  354. <span v-if="item.isBindUrl == '1'" style="margin-left: 10px; color: #13ce66">添加URL</span>
  355. <span v-if="item.isBindUrl == '2'" style="margin-left: 10px; color: #b1b4ba">不加URL</span>
  356. </el-form-item>
  357. <el-form-item label="课节过期时间" v-if="item.isBindUrl == '1'
  358. && item.contentType != 2
  359. && item.contentType != 5
  360. && item.contentType != 6
  361. && item.contentType != 8"
  362. style="margin-top: 1%" label-width="100px">
  363. <el-row>
  364. <el-input-number v-model="item.expiresDays" :min="1" :max="100" ></el-input-number>
  365. (天)
  366. </el-row>
  367. <el-row>
  368. <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
  369. </el-row>
  370. </el-form-item>
  371. </el-form>
  372. </el-col>
  373. <el-col :span="1" :offset="1">
  374. <i class="el-icon-delete" @click="delSetList(index)" style="margin-top: 20px;" v-if="setting.length>1"></i>
  375. </el-col>
  376. </el-row>
  377. </div>
  378. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList()' >添加内容</el-link>
  379. </el-form-item>
  380. <el-form-item label="发送时间" prop="sendTime" v-if="msgForm.draftStrategy==1" >
  381. <el-time-picker
  382. class="custom-input"
  383. v-model="msgForm.sendTime"
  384. value-format="HH:mm"
  385. format="HH:mm"
  386. placeholder="时间"
  387. style="width: 100px;height: 20px;">
  388. </el-time-picker>
  389. <span class="tip" style="margin-left: 2%"> 不填时,默认为系统当前时间(立即发送)</span>
  390. </el-form-item>
  391. </el-form>
  392. <div slot="footer" class="dialog-footer">
  393. <el-button type="primary" @click="submitMsgForm">确 定</el-button>
  394. <el-button @click="cancelMsgForm">取 消</el-button>
  395. </div>
  396. </el-dialog>
  397. <el-dialog :title="videoNumOptions.title" :visible.sync="videoNumOptions.open" width="1500px" append-to-body>
  398. <userVideo ref="QwUserVideo" @videoResult="qwUserVideoResult"></userVideo>
  399. </el-dialog>
  400. </div>
  401. </template>
  402. <script>
  403. import { sendMsgSopType,} from "../../../api/qw/sopUserLogsInfo";
  404. import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
  405. import {courseList, videoList} from "@/api/qw/sop";
  406. import userVideo from "@/views/qw/userVideo/userVideo";
  407. import {listToLiveNoEnd} from "@/api/live/live";
  408. import {listReward} from "@/api/qw/luckyBag";
  409. import { getSmsTempList } from "@/api/company/companySmsTemp";
  410. export default {
  411. name: "sendMsgOpenTool",
  412. components: {ImageUpload,userVideo},
  413. data() {
  414. return {
  415. queryParams1: {
  416. pageNum: 1,
  417. pageSize: 10,
  418. dataStatus: '1',
  419. name: null,
  420. type: null
  421. },
  422. luckyBagList: [],
  423. projectFrom:process.env.VUE_APP_PROJECT_FROM,
  424. videoNumOptions: {
  425. title: '选择视频号',
  426. open: false,
  427. content: null,
  428. contentIndex: null,
  429. },
  430. //上传语音的遮罩层
  431. voiceLoading :false,
  432. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  433. uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
  434. // 遮罩层
  435. loading: true,
  436. // 导出遮罩层
  437. exportLoading: false,
  438. // 选中数组
  439. ids: [],
  440. // 非单个禁用
  441. single: true,
  442. // 非多个禁用
  443. multiple: true,
  444. // 显示搜索条件
  445. showSearch: true,
  446. // 总条数
  447. total: 0,
  448. // sopUserLogsInfo表格数据
  449. sopUserLogsInfoList: [],
  450. sysFsSopWatchStatus: [],
  451. isSalesCallAdded:false,
  452. isSalesCallCustomerAdded:false,
  453. tagList:[],
  454. selectTags:[],
  455. // 弹出层标题
  456. title: "",
  457. // 是否显示弹出层
  458. open: false,
  459. updateOpen:false,
  460. // 查询参数
  461. queryParams: {
  462. pageNum: 1,
  463. pageSize: 10,
  464. tagIds:null,
  465. remark:null,
  466. sopId: null,
  467. userLogsId: null,
  468. userIdParam:null,
  469. startTimeParam:null,
  470. externalContactId: null,
  471. qwUserId: null,
  472. corpId: null,
  473. externalId: null,
  474. fsUserId: null,
  475. externalUserName: null,
  476. createTime: null,
  477. },
  478. courseList:[],
  479. videoList:[],
  480. //插件版
  481. sysQwSopAiContentType:[],
  482. sendMsgOpen:{
  483. title:'一键批量群发',
  484. open:false,
  485. ids:null,
  486. },
  487. smsTemplateList: [],
  488. // 表单参数
  489. form: {},
  490. setting:[{contentType:'1', value: '',}],
  491. msgForm:{
  492. liveId:null,
  493. videoId:null,
  494. courseId:null,
  495. courseType:null,
  496. userIdParam:null,
  497. setting:null,
  498. ids:null,
  499. type:null,
  500. corpId:null,
  501. sopId: null,
  502. startTime: null,
  503. sendTime: null,
  504. draftStrategy:1,
  505. },
  506. // 表单校验
  507. rules: {},
  508. batchRules:{
  509. paramTime: [
  510. { required: true, message: '选择的时间不能为空', trigger: 'blur' }
  511. ],
  512. },
  513. msgRules:{},
  514. liveList: [],
  515. };
  516. },
  517. created() {
  518. this.getDicts("sys_qwSopAi_contentType").then(response => {
  519. this.sysQwSopAiContentType = response.data;
  520. });
  521. this.getDicts("sys_fs_sop_watch_status").then(response => {
  522. this.sysFsSopWatchStatus = response.data;
  523. });
  524. courseList().then(response => {
  525. this.courseList = response.list;
  526. });
  527. listToLiveNoEnd().then(response => {
  528. this.liveList = response.rows;
  529. })
  530. listReward(this.queryParams1).then(response => {
  531. this.luckyBagList = response.rows;
  532. });
  533. this.loadSmsTemplates();
  534. },
  535. methods: {
  536. getLuckyBagStatus(content) {
  537. const selectedLuckyBag = this.luckyBagList.find(item => item.id === content.luckyBagId);
  538. if (selectedLuckyBag) {
  539. content.luckyBagDataStatus = selectedLuckyBag.dataStatus; // 自动填充标题
  540. } else {
  541. // 若未找到对应直播间,清空标题和封面(可选)
  542. content.luckyBagDataStatus = null;
  543. }
  544. },
  545. liveChange(content) {
  546. // content.liveId 是选中的直播间 ID(liveId)
  547. const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
  548. if (selectedLive) {
  549. // 从选中的直播间对象中提取标题和封面,赋值给当前内容的对应字段
  550. // 假设直播间对象中标题字段为 liveTitle,封面字段为 coverImg(根据实际接口字段调整)
  551. content.miniprogramTitle = selectedLive.liveName || ''; // 自动填充标题
  552. content.miniprogramPicUrl = selectedLive.liveImgUrl || ''; // 自动填充封面
  553. } else {
  554. // 若未找到对应直播间,清空标题和封面(可选)
  555. content.miniprogramTitle = '';
  556. content.miniprogramPicUrl = '';
  557. }
  558. },
  559. qwUserVideoResult(val) {
  560. // 根据选中的内容,将返回的数据更新到相应的表单项
  561. const content = this.videoNumOptions.content;
  562. const setList = content[this.videoNumOptions.contentIndex];
  563. setList.nickname = val.nickname;
  564. setList.avatar = val.avatar;
  565. setList.coverUrl = val.coverUrl;
  566. setList.thumbUrl = val.thumbUrl;
  567. setList.desc = val.desc;
  568. setList.url = val.url;
  569. setList.extras = val.extras;
  570. setList.videoId = val.id;
  571. console.info(setList)
  572. this.videoNumOptions.open = false;
  573. },
  574. oneClickGroupSending(val,type,corpId){
  575. this.sendMsgOpen.open= true;
  576. this.msgForm.ids = val;
  577. this.msgForm.type = type;
  578. this.msgForm.corpId = corpId;
  579. },
  580. courseChange() {
  581. if (this.msgForm.courseId != null ) {
  582. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
  583. for (let i = 0; i < this.setting.length; i++) {
  584. //响应式直接给链接的标题/封面上值
  585. if (selectedCourse && this.msgForm.courseId != null) {
  586. if ( this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
  587. this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
  588. this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  589. }
  590. if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17 ){
  591. this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  592. }
  593. }
  594. }
  595. }
  596. videoList(this.msgForm.courseId).then(response => {
  597. this.videoList=response.list;
  598. });
  599. this.msgForm.videoId = null
  600. },
  601. videoIdChange() {
  602. if (this.msgForm.videoId != null ) {
  603. // 查找选中的课节对应的 label
  604. const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
  605. for (let i = 0; i < this.setting.length; i++) {
  606. //响应式直接给链接的描述上值
  607. if (selectedVideo && this.msgForm.videoId != null) {
  608. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
  609. this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  610. if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
  611. this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
  612. }
  613. }
  614. if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17 ){
  615. this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
  616. if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
  617. this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
  618. }
  619. }
  620. }
  621. }
  622. }
  623. },
  624. handleAvatarSuccessFile(res, file, item) {
  625. if (res.code === 200) {
  626. // 使用 $set 确保响应式更新
  627. this.$set(item, 'fileUrl', res.url);
  628. } else {
  629. this.msgError(res.msg);
  630. }
  631. },
  632. beforeAvatarUploadFile(file){
  633. const isLt1M = file.size / 1024 / 1024 < 10;
  634. if (!isLt1M) {
  635. this.$message.error('上传大小不能超过 10MB!');
  636. }
  637. return isLt1M;
  638. },
  639. //下载文件
  640. downloadUrl(materialUrl) {
  641. // 直接返回文件 URL
  642. return materialUrl;
  643. },
  644. handleAvatarSuccessVideo(res, file, item) {
  645. if(res.code==200){
  646. // 使用 $set 确保响应式更新
  647. this.$set(item, 'videoUrl', res.url);
  648. }
  649. else{
  650. this.msgError(res.msg);
  651. }
  652. },
  653. beforeAvatarUploadVideo(file){
  654. const isLt30M = file.size / 1024 / 1024 < 10;
  655. const isMP4 = file.type === 'video/mp4';
  656. if (!isMP4) {
  657. this.$message.error('仅支持上传 MP4 格式的视频文件!');
  658. return false;
  659. }
  660. if (!isLt30M) {
  661. this.$message.error('上传大小不能超过 10MB!');
  662. return false;
  663. }
  664. return true;
  665. },
  666. handleInputVideoText(value,content){
  667. // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
  668. const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
  669. // 删除不符合条件的字符
  670. const filteredValue = value.split('').filter(char => regex.test(char)).join('');
  671. this.$set(content, 'value', filteredValue);
  672. },
  673. //选择视频号
  674. hanldeSelectVideoNum(content, index) {
  675. this.videoNumOptions.content = content;
  676. this.videoNumOptions.contentIndex = index;
  677. this.videoNumOptions.open = true;
  678. },
  679. delSetList(index){
  680. this.setting.splice(index,1)
  681. },
  682. addSetList(){
  683. const newSetting = {
  684. contentType:'1',
  685. value: '',
  686. };
  687. // 将新设置项添加到 content.setting 数组中
  688. this.setting.push(newSetting);
  689. },
  690. handleKeydown(event, index) {
  691. const item = this.setting[index];
  692. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  693. const cursorPosition = textarea.selectionStart;
  694. // 检查是否按下了 Backspace 或 Delete 键
  695. if (event.key === 'Backspace' || event.key === 'Delete') {
  696. const tags = ['#销售称呼#', '#客户称呼#']; // 需要检查的标签
  697. const value = item.value;
  698. // 遍历标签,检查是否需要删除
  699. for (const tag of tags) {
  700. let start, end;
  701. if (event.key === 'Backspace') {
  702. // 检查光标前是否是当前标签的一部分
  703. start = cursorPosition - tag.length;
  704. if (start >= 0 && value.slice(start, cursorPosition) === tag) {
  705. // 删除整个标签
  706. item.value = value.slice(0, start) + value.slice(cursorPosition);
  707. // 更新光标位置
  708. this.$nextTick(() => {
  709. textarea.setSelectionRange(start, start);
  710. });
  711. // 更新状态
  712. if (tag === '#销售称呼#') item.isSalesCallAdded = false;
  713. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  714. event.preventDefault(); // 阻止默认删除行为
  715. break; // 找到匹配的标签后退出循环
  716. }
  717. } else if (event.key === 'Delete') {
  718. // 检查光标后是否是当前标签的一部分
  719. end = cursorPosition + tag.length;
  720. if (end <= value.length && value.slice(cursorPosition, end) === tag) {
  721. // 删除整个标签
  722. item.value = value.slice(0, cursorPosition) + value.slice(end);
  723. // 更新状态
  724. if (tag === '#销售称呼#') item.isSalesCallAdded = false;
  725. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  726. event.preventDefault(); // 阻止默认删除行为
  727. break; // 找到匹配的标签后退出循环
  728. }
  729. }
  730. // 检查光标是否位于标签的中间
  731. for (let i = 0; i <= tag.length; i++) {
  732. const tagStart = cursorPosition - i;
  733. const tagEnd = tagStart + tag.length;
  734. if (
  735. tagStart >= 0 &&
  736. tagEnd <= value.length &&
  737. value.slice(tagStart, tagEnd) === tag
  738. ) {
  739. // 删除整个标签
  740. item.value = value.slice(0, tagStart) + value.slice(tagEnd);
  741. // 更新光标位置
  742. this.$nextTick(() => {
  743. textarea.setSelectionRange(tagStart, tagStart);
  744. });
  745. // 更新状态
  746. if (tag === '#销售称呼#') item.isSalesCallAdded = false;
  747. if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
  748. event.preventDefault(); // 阻止默认删除行为
  749. break; // 找到匹配的标签后退出循环
  750. }
  751. }
  752. }
  753. }
  754. },
  755. // 切换添加销售称呼按钮点击事件
  756. toggleSalesCall(index) {
  757. const item = this.setting[index];
  758. const salesCall = '#销售称呼#';
  759. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  760. // 获取当前光标位置
  761. const cursorPosition = textarea.selectionStart;
  762. if (item.isSalesCallAdded) {
  763. // 移除所有的 #销售称呼#
  764. item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
  765. } else {
  766. // 添加 #销售称呼#
  767. item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
  768. }
  769. // 切换状态
  770. item.isSalesCallAdded = !item.isSalesCallAdded;
  771. // 保持光标位置
  772. this.$nextTick(() => {
  773. textarea.setSelectionRange(cursorPosition, cursorPosition);
  774. });
  775. },
  776. toggleSalesCallCustomer(index) {
  777. const item = this.setting[index];
  778. const salesCall = '#客户称呼#';
  779. const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
  780. // 获取当前光标位置
  781. const cursorPosition = textarea.selectionStart;
  782. if (item.isSalesCallCustomerAdded) {
  783. // 移除所有的 #销售称呼#
  784. item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
  785. } else {
  786. // 添加 #客户称呼#
  787. item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
  788. }
  789. // 切换状态
  790. item.isSalesCallCustomerAdded = !item.isSalesCallCustomerAdded;
  791. // 保持光标位置
  792. this.$nextTick(() => {
  793. textarea.setSelectionRange(cursorPosition, cursorPosition);
  794. });
  795. },
  796. handleContentTypeChange() {
  797. //如果是链接的才上
  798. if (this.msgForm.courseId != null ) {
  799. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
  800. for (let i = 0; i < this.setting.length; i++) {
  801. //响应式直接给链接的标题/封面上值
  802. if (selectedCourse && this.msgForm.courseId != null) {
  803. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
  804. this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
  805. this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
  806. }
  807. if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17 ){
  808. this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
  809. }
  810. }
  811. }
  812. }
  813. if (this.msgForm.videoId != null ) {
  814. // 查找选中的课节对应的 label
  815. const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
  816. for (let i = 0; i < this.setting.length; i++) {
  817. //响应式直接给链接的描述上值
  818. if (selectedVideo && this.msgForm.videoId != null) {
  819. if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
  820. this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
  821. if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
  822. this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
  823. }
  824. }
  825. if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
  826. this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
  827. if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
  828. this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
  829. }
  830. }
  831. }
  832. }
  833. }
  834. },
  835. resetSendMsgSop() {
  836. this.msgForm = {
  837. liveId:null,
  838. videoId:null,
  839. courseId:null,
  840. courseType:null,
  841. setting:null,
  842. sendTime:null,
  843. draftStrategy:1,
  844. };
  845. this.resetForm("msgForm");
  846. },
  847. // 获取短信模板信息(类似福袋的处理方式)
  848. getSmsTemplateInfo(content) {
  849. // 如果短信模板列表为空,先加载数据
  850. if (this.smsTemplateList.length === 0) {
  851. getSmsTempList().then(response => {
  852. this.smsTemplateList = response.rows || response.data || [];
  853. // 加载完成后再次调用自身来处理选中项
  854. this.processSelectedSmsTemplate(content);
  855. }).catch(error => {
  856. console.error('加载短信模板失败:', error);
  857. this.$message.error('加载短信模板失败');
  858. });
  859. } else {
  860. // 直接处理选中项
  861. this.processSelectedSmsTemplate(content);
  862. }
  863. },
  864. // 处理选中的短信模板
  865. processSelectedSmsTemplate(content) {
  866. const selectedTemplate = this.smsTemplateList.find(item => item.tempId === content.smsTemplateId);
  867. if (selectedTemplate) {
  868. // 自动填充模板内容预览
  869. this.$set(content, 'smsTemplateContent', selectedTemplate.content || selectedTemplate.templateContent || '');
  870. } else {
  871. // 清空相关内容
  872. this.$set(content, 'smsTemplateContent', '');
  873. }
  874. },
  875. // 加载短信模板列表
  876. loadSmsTemplates() {
  877. if (this.smsTemplateList.length > 0) {
  878. return; // 如果已经有数据,不再重复加载
  879. }
  880. getSmsTempList().then(response => {
  881. this.smsTemplateList = response.rows || response.data || [];
  882. if (this.smsTemplateList.length === 0) {
  883. this.$message.info('暂无可用的短信模板');
  884. }
  885. }).catch(error => {
  886. console.error('加载短信模板失败:', error);
  887. this.$message.error('加载短信模板失败');
  888. });
  889. },
  890. // 多选框选中数据
  891. handleSelectionChange(selection) {
  892. this.ids = selection.map(item => item.id)
  893. this.single = selection.length!==1
  894. this.multiple = !selection.length
  895. },
  896. submitMsgForm(){
  897. this.$refs["msgForm"].validate(valid => {
  898. if (valid) {
  899. if (this.msgForm.draftStrategy==1) {
  900. if (!!hasLiveSetting && (this.msgForm.courseId != null && this.msgForm.courseId != '')) {
  901. return this.$message.error("直播间不能选取课程");
  902. }
  903. if (!!hasLiveSetting && (this.msgForm.videoId != null && this.msgForm.videoId != '')) {
  904. return this.$message.error("直播间不能选取课节");
  905. }
  906. this.msgForm.setting = JSON.stringify(this.setting)
  907. let jsonSetting = JSON.parse(this.msgForm.setting);
  908. let hasLiveSetting = false;
  909. console.log(jsonSetting)
  910. for (let index = 0; index < jsonSetting.length; index++) {
  911. if (!!jsonSetting[index] && (jsonSetting[index].contentType == "12" || jsonSetting[index].contentType == "18" || jsonSetting[index].contentType == "19")) {
  912. if (!!hasLiveSetting) {
  913. return this.$message.error("发送直播间只能一次只能发送一条");
  914. }
  915. hasLiveSetting = true;
  916. }
  917. }
  918. if (this.setting.length <= 0) {
  919. return this.$message.error("请添加规则")
  920. }
  921. if ((this.msgForm.courseId === null || this.msgForm.courseId === '') && !hasLiveSetting && this.msgForm.liveId === null) {
  922. return this.$message.error("课程不能为空")
  923. }
  924. if ((this.msgForm.videoId === null || this.msgForm.videoId === '') && !hasLiveSetting && this.msgForm.liveId === null) {
  925. return this.$message.error("课节不能为空")
  926. }
  927. if (this.msgForm.courseType === null || this.msgForm.courseType === '') {
  928. return this.$message.error("消息类型不能为空")
  929. }
  930. for (let i = 0; i < this.setting.length; i++) {
  931. if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
  932. return this.$message.error("内容不能为空")
  933. }
  934. if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
  935. return this.$message.error("图片不能为空")
  936. }
  937. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
  938. return this.$message.error("链接标题不能为空")
  939. }
  940. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
  941. return this.$message.error("链接描述不能为空")
  942. }
  943. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
  944. return this.$message.error("链接图片不能为空")
  945. }
  946. if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
  947. return this.$message.error("链接地址不能为空")
  948. }
  949. if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
  950. return this.$message.error("小程序消息标题不能为空")
  951. }
  952. if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
  953. return this.$message.error("小程序封面地址不能为空")
  954. }
  955. if (this.setting[i].contentType == 10 && (this.setting[i].miniprogramPage == null || this.setting[i].miniprogramPage == "")) {
  956. return this.$message.error("小程序page地址不能为空")
  957. }
  958. if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
  959. return this.$message.error("文件不能为空")
  960. }
  961. if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
  962. return this.$message.error("视频不能为空")
  963. }
  964. if ((this.setting[i].contentType == 7 || this.setting[i].contentType == 16) && (this.setting[i].value == null || this.setting[i].value == "")) {
  965. return this.$message.error("语音不能为空")
  966. }
  967. // 添加对福袋的验证
  968. if (this.setting[i].contentType == 14 && (this.setting[i].luckyBagId == null || this.setting[i].luckyBagId === "")) {
  969. return this.$message.error("福袋不能为空")
  970. }
  971. if (this.setting[i].contentType == 12 && (this.setting[i].liveId == null || this.setting[i].liveId == "")) {
  972. return this.$message.error("直播间不能为空");
  973. }
  974. // 短信模板验证
  975. if (item.contentType == 21 && (item.smsTemplateId == null || item.smsTemplateId === "")) {
  976. return this.$message.error("短信模板不能为空")
  977. }else {
  978. if (item.contentType == 21 && item.smsTemplateId) {
  979. // 根据选中的短信模板ID查找对应的模板信息
  980. const selectedTemplate = this.smsTemplateList.find(template => template.tempId === item.smsTemplateId);
  981. if (selectedTemplate) {
  982. // 设置短信模板的相关字段
  983. this.$set(item, 'smsTemplateCode', selectedTemplate.tempCode || '');
  984. this.$set(item, 'smsTemplateTitle', selectedTemplate.title || '');
  985. }
  986. }
  987. }
  988. }
  989. // // 短信模板数据映射
  990. // for (let j = 0; j < processedSetting.length; j++) {
  991. // const item = processedSetting[j];
  992. // if (item.contentType == 21 && item.smsTemplateId) {
  993. // // 根据选中的短信模板ID查找对应的模板信息
  994. // const selectedTemplate = this.smsTemplateList.find(template => template.tempId === item.smsTemplateId);
  995. // if (selectedTemplate) {
  996. // // 设置短信模板的相关字段
  997. // this.$set(item, 'smsTemplateCode', selectedTemplate.tempCode || '');
  998. // this.$set(item, 'smsTemplateTitle', selectedTemplate.title || '');
  999. // }
  1000. // }
  1001. // }
  1002. // // 重新序列化处理后的数据
  1003. // this.msgForm.setting = JSON.stringify(processedSetting);
  1004. this.msgForm.setting = JSON.stringify(this.setting)
  1005. this.sendMsgOpen.open = false;
  1006. const loading = this.$loading({
  1007. lock: true,
  1008. text: '正在执行中请稍后~~请不要刷新页面!!',
  1009. spinner: 'el-icon-loading',
  1010. background: 'rgba(0, 0, 0, 0.7)'
  1011. });
  1012. sendMsgSopType(this.msgForm).then(response => {
  1013. this.msgSuccess("一键群发成功");
  1014. loading.close();
  1015. this.setting = [];
  1016. this.resetSendMsgSop();
  1017. }).finally(() => {
  1018. loading.close();
  1019. });
  1020. }
  1021. }
  1022. });
  1023. },
  1024. cancelMsgForm(){
  1025. this.sendMsgOpen.open = false;
  1026. this.resetSendMsgSop();
  1027. },
  1028. liveChangemsgForm(liveId){
  1029. console.log(liveId);
  1030. console.log(this.setting);
  1031. if(!!liveId){
  1032. for(let i =0;i<this.setting.length;i++){
  1033. this.$set(this.setting[i], 'liveId', liveId);
  1034. this.liveChange(this.setting[i]);
  1035. }
  1036. }
  1037. },
  1038. liveDisabled(){
  1039. return !!this.msgForm && !!this.msgForm.liveId ;
  1040. }
  1041. }
  1042. };
  1043. </script>