Parcourir la source

添加:不允许给系统消息帐号发消息限制

liling il y a 2 ans
Parent
commit
77a5425cf4
1 fichiers modifiés avec 13 ajouts et 4 suppressions
  1. 13 4
      src/views/liveChat/index.vue

+ 13 - 4
src/views/liveChat/index.vue

@@ -203,9 +203,10 @@ const delClick = (toId) => {
       return delMsg(toId);
     })
     .then(() => {
-      chatRecords.data=[]
-      headerName.value=''
-      clickPersonId.value=0
+      chatRecords.data    = []
+      headerName.value    = ''
+      clickPersonId.value = 0
+      sendCont.data.toId  = 0
       getMsgList();
       proxy.$modal.msgSuccess("删除成功");
     });
@@ -273,6 +274,10 @@ const msgSendClick = (event) => {
   }
 };
 const msgSendClick2 = (event,icon) => {
+  if(sendCont.data.toId==null||sendCont.data.toId==0){
+    return ElMessage({ message: "请添加或者会话人员", type: "error" });
+    return
+  }
   if ((!event.shiftKey && event.keyCode == 13 && !event.ctrlKey)||icon) {
   event.preventDefault();
   noMes.value = false;
@@ -293,6 +298,10 @@ const msgSendClick2 = (event,icon) => {
 }
 //发送文件确认按钮
 const fileChangeMsg = async (val) => {
+  if(sendCont.data.toId==null||sendCont.data.toId==0){
+    return ElMessage({ message: "请添加或者会话人员", type: "error" });
+    return
+  }
   const message = {
     content: val.id,
     msgType: "1",
@@ -779,7 +788,7 @@ onMounted(() => {
             </div>
           </el-main>
           <!-- 底部 -->
-          <el-footer height="112px" class="right-footer">
+          <el-footer height="112px" class="right-footer" v-if="sendCont.data.toId>0">
             <!-- 发送文件 -->
             <img
               :src="sendFile"