소스 검색

im发送直播卡片

yuhongqi 2 시간 전
부모
커밋
3005adbbf9

+ 64 - 2
src/views/qw/sopTemp/updateSopTemp.vue

@@ -395,6 +395,10 @@
                                           </div>
                                         </el-form-item>
                                         <el-form-item label="内容">
+                                          <div v-if="setList.contentType == 1 || setList.contentType == 15" style="color: #999;font-size: 14px;display: flex;align-items: center;">
+                                            <i class="el-icon-info"></i>
+                                            多语句分割符:|&| 例如:'语句1|&|语句2'
+                                          </div>
                                           <el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-if="setList.contentType == 1 || setList.contentType == 15"
                                                     v-model="setList.value"
                                                     type="textarea" :rows="3" placeholder="内容"
@@ -420,6 +424,16 @@
                                               @click="toggleUserNameCall(index, contentIndex, setIndex)">
                                               {{ setList.isUserNameCallAdded ? '移除#客户称呼#' : '添加#客户称呼#' }}
                                             </el-button>
+                                            <el-link
+                                              v-if="setList.contentType == 1 || setList.contentType == 15"
+                                              type="primary"
+                                              style="margin-top: 10px;margin-left:10px"
+                                              @click="showOpenContent(index, contentIndex, setIndex)">查看分割内容</el-link>
+                                            <el-link
+                                              v-if="setList.contentType == 1 || setList.contentType == 15"
+                                              type="primary"
+                                              style="margin-top: 10px;margin-left:10px"
+                                              @click="cppySpliter()">复制分隔符</el-link>
                                           </div>
 
                                           <div v-if="setList.contentType == 2">
@@ -876,6 +890,20 @@
         <el-button type="primary" @click="saveSortsRules" icon="el-icon-check">保存</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog title="查看分割后内容" :visible.sync="openShowContent" width="800px" append-to-body>
+      <el-table stripe :data="contentListData" style="width: 100%">
+        <el-table-column type="index" label="序号" width="50"/>
+        <el-table-column prop="content" label="内容" width="700">
+          <template #default="{ row }">
+            <div v-html="row.content.replace(/\n/g, '<br>')"></div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div style="float: right;">
+        <el-button type="primary" @click="comfirmContent">确定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -1836,6 +1864,9 @@ export default {
       voiceLoading: false,
       openSort: false,
       openSort2: false,
+      openShowContent: false,
+      contentList: [],
+      contentListData: [],
       // 遮罩层
       loading: false,
       loading2: false,
@@ -2449,7 +2480,7 @@ export default {
 
           if (data.content[j].type != 4 && data.content[j].type != 5) {
             for (let k = 0; k < data.content[j].setting.length; k++) {
-              if (data.content[j].setting[k].contentType == 1 && (data.content[j].setting[k].value == null || data.content[j].setting[k].value == "")) {
+              if ((data.content[j].setting[k].contentType == 1 || data.content[j].setting[k].contentType == 15) && (data.content[j].setting[k].value == null || data.content[j].setting[k].value == "")) {
                 this.$message.error("内容不能为空")
                 return false;
               }
@@ -2524,7 +2555,7 @@ export default {
                 this.$message.error("客服时间不能为空");
                 return false;
               }
-              if (set.contentType == 1 && (set.value == null || set.value == "")) {
+              if ((set.contentType == 1 || set.contentType == 15) && (set.value == null || set.value == "")) {
                 this.$message.error("内容不能为空")
                 return false;
               }
@@ -3277,6 +3308,37 @@ export default {
           this.$set(list.content[index].setting[0], fieldName, newVal);
         }
       }
+    },
+    comfirmContent() {
+      this.openShowContent = false;
+    },
+    showOpenContent(itemIndex, contentIndex, setIndex) {
+      const setItem = this.setting[itemIndex].content[contentIndex].setting[setIndex];
+      const refKey = `textarea-${itemIndex}-${contentIndex}-${setIndex}`;
+      const textarea = this.$refs[refKey][0]?.$refs?.textarea;
+      if (!textarea) return;
+      this.openShowContent = true;
+      this.contentList = [];
+      this.contentListData = [];
+      const str = setItem.value;
+      this.contentList = str.split('|&|');
+      let idx = 1;
+      this.contentList.forEach(a => {
+        this.contentListData.push({ index: idx++, content: a });
+      });
+    },
+    cppySpliter() {
+      navigator.clipboard.writeText('|&|').then(() => {
+        this.$message({
+          message: '复制成功',
+          type: 'success'
+        });
+      }).catch(() => {
+        this.$message({
+          message: '复制失败',
+          type: 'warning'
+        });
+      });
     }
   }
 };

+ 1 - 1
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -1057,7 +1057,7 @@ export default {
             }
 
             for (let i = 0; i < this.setting.length; i++) {
-              if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
+              if ((this.setting[i].contentType == 1 || this.setting[i].contentType == 15) && (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 == "")) {

+ 1 - 1
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -1539,7 +1539,7 @@ export default {
           }
 
           for (let i = 0; i < this.setting.length; i++) {
-            if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
+            if ((this.setting[i].contentType == 1 || this.setting[i].contentType == 15) && (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 == "")) {