Browse Source

修改:会话管理影响bug处理

zhangfu 3 years ago
parent
commit
0aa76be44c

+ 1 - 1
src/App.vue

@@ -28,7 +28,7 @@ export default {
         from.meta.parentNode &&
         from.meta.parentNode.indexOf(to.name) > -1
       ) {
-        console.log()
+        // console.log()
       } else {
         if (from.meta.parentNode) {
           let index = this.include.indexOf(from.meta.parentNode)

+ 1 - 1
src/common.js

@@ -79,7 +79,7 @@ function WSocket(group, onMessage, openedMsg) {
 
 	this.websock = new WebSocket(url);
 	this.websock.onopen = (e) => {
-		console.log("WSocket onopened,e=", e);
+		// console.log("WSocket onopened,e=", e);
 		if (openedMsg)
 			this.websock.send(openedMsg);
 	};

+ 0 - 2
src/components/pagination.vue

@@ -36,11 +36,9 @@ export default {
   mounted() {},
   methods: {
     handleSizeChange(val) {
-      // console.log(`每页 ${val} 条`);
       this.$emit('changePageSize', val)
     },
     currentChange(val) {
-      // console.log(`当前页: ${val}`);
       this.$emit('changePage', val)
     },
     prevClick(val) {

+ 1 - 1
src/layout/components/AppMain.vue

@@ -38,7 +38,7 @@ export default {
         from.meta.parentNode &&
         from.meta.parentNode.indexOf(to.name) > -1
       ) {
-        console.log()
+        // console.log()
       } else {
         if (from.meta.parentNode) {
           let index = this.include.indexOf(from.meta.parentNode)

+ 1 - 1
src/layout/index.vue

@@ -47,7 +47,7 @@ export default {
         from.meta.parentNode &&
         from.meta.parentNode.indexOf(to.name) > -1
       ) {
-        console.log()
+        // console.log()
       } else {
         if (from.meta.parentNode) {
           let index = this.include.indexOf(from.meta.parentNode)

+ 20 - 16
src/pages/classification/edit.vue

@@ -100,7 +100,7 @@ export default {
         name: '',
         status: 1,
         role: [{ value: '' }],
-        conversationList: [],
+        conversationList: []
       },
       conversationList: [],
       rules: {
@@ -152,9 +152,11 @@ export default {
             this.form.role = [{ value: '' }]
           }
           let conversationList = []
-          this.form.conversationList.forEach(item=>{
-            conversationList.push(item.openConversationId)
-          })
+          if (this.form.conversationList) {
+            this.form.conversationList.forEach(item => {
+              conversationList.push(item.openConversationId)
+            })
+          }
           this.form.conversationList = conversationList
         }
       })
@@ -189,18 +191,20 @@ export default {
             }
           }
           let conversationList = []
-          this.conversationList.forEach(item => {
-            if (
-              this.form.conversationList.find(
-                ltem => item.openConversationId == ltem
-              )
-            ) {
-              conversationList.push({
-                chatId: item.chatId,
-                openConversationId: item.openConversationId
-              })
-            }
-          })
+          if (this.conversationList) {
+            this.conversationList.forEach(item => {
+              if (
+                this.form.conversationList.find(
+                  ltem => item.openConversationId == ltem
+                )
+              ) {
+                conversationList.push({
+                  chatId: item.chatId,
+                  openConversationId: item.openConversationId
+                })
+              }
+            })
+          }
           let code = {
             linkUrl: '',
             name: this.form.name,

+ 1 - 1
src/pages/fileManagement/detail.vue

@@ -94,7 +94,7 @@ export default {
             const blobObject = new Blob([res.data])
             window.navigator.msSaveBlob(blobObject, `${val.name}.pdf`)
           } catch (e) {
-            console.log(e)
+            // console.log(e)
           }
         } else {
           //  其他浏览器

+ 19 - 15
src/pages/fileManagement/edit.vue

@@ -210,9 +210,11 @@ export default {
             this.form.role = [{ value: '' }]
           }
           let conversationList = []
-          this.form.conversationList.forEach(item => {
-            conversationList.push(item.openConversationId)
-          })
+          if (this.form.conversationList) {
+            this.form.conversationList.forEach(item => {
+              conversationList.push(item.openConversationId)
+            })
+          }
           this.form.conversationList = conversationList
           this.fileList = [{ name: this.form.name, url: this.form.docUrl }]
         }
@@ -348,18 +350,20 @@ export default {
             }
           }
           let conversationList = []
-          this.conversationList.forEach(item => {
-            if (
-              this.form.conversationList.find(
-                ltem => item.openConversationId == ltem
-              )
-            ) {
-              conversationList.push({
-                chatId: item.chatId,
-                openConversationId: item.openConversationId
-              })
-            }
-          })
+          if (this.conversationList) {
+            this.conversationList.forEach(item => {
+              if (
+                this.form.conversationList.find(
+                  ltem => item.openConversationId == ltem
+                )
+              ) {
+                conversationList.push({
+                  chatId: item.chatId,
+                  openConversationId: item.openConversationId
+                })
+              }
+            })
+          }
           let code = {
             docUrl: this.form.docUrl,
             linkUrl: this.form.linkUrl,

+ 2 - 2
src/pages/sessionManagement/detail.vue

@@ -21,7 +21,7 @@
     </template>
     <el-form>
       <el-form-item>
-        <div style="margin-right:-20px">
+        <div style="margin-right: -20px">
           <div
             v-for="(item, index) in form.userRelList"
             :key="index"
@@ -35,7 +35,7 @@
               <div v-if="item.avatar">
                 <div class="sessionManagement_icon_titleimg">
                   <img
-                    style="width: 50px; height: 50px;border-radius:4px"
+                    style="width: 50px; height: 50px; border-radius: 4px"
                     :src="item.avatar"
                     alt=""
                   />

+ 17 - 5
src/pages/sessionManagement/edit.vue

@@ -13,14 +13,16 @@
     <el-form label-position="left" ref="form" :rules="rules" :model="form">
       <el-form-item label="群名称:" prop="conversationName" label-width="80px">
         <el-input
-          placeholder="请输入"
+          placeholder="请输入群名称"
           v-model.trim="form.conversationName"
           clearable
+          maxlength="20"
+          show-word-limit
         ></el-input>
       </el-form-item>
       <el-form-item label="群 主:" prop="ownerMobile" label-width="80px">
         <el-input
-          placeholder="请输入"
+          placeholder="请输入手机号"
           v-model.trim="form.ownerMobile"
           v-onlyInt
           clearable
@@ -28,13 +30,12 @@
         ></el-input>
       </el-form-item>
       <el-form-item
-        required
         label-width="80px"
         style="margin-bottom: 20px"
         label
+         v-for="(item, index) in form.mobileList"
         :prop="'mobileList.' + index + '.value'"
         :rules="rules.value"
-        v-for="(item, index) in form.mobileList"
         :key="index"
       >
         <template v-if="index == 0" slot="label">
@@ -111,7 +112,7 @@ export default {
           { required: true, message: '请输入群名称', trigger: 'blur' }
         ],
         ownerMobile: [
-          { required: true, message: '请输入群主', trigger: 'blur' }
+          { required: true, message: '请输入群主手机号', trigger: 'blur' }
         ],
         value: [
           { required: true, message: '请输入群成员手机号', trigger: 'blur' }
@@ -136,6 +137,17 @@ export default {
       this.dialogVisible = false
       this.fullscreenLoading = false
       this.$parent.search()
+       this.form = {
+        chatBannedType: 0,
+        conversationName: '',
+        managementType: 0,
+        mentionAllAuthority: 0,
+        mobileList: [{ value: '' }],
+        ownerMobile: '',
+        searchable: 0,
+        showHistoryType: 0,
+        validationType: 0
+      }
     },
     // 打开弹框
     openClose() {

+ 4 - 3
src/pages/sessionManagement/index.vue

@@ -75,7 +75,7 @@
           <template slot-scope="scope">
             <div>
               <el-button type="text" @click="detail(scope.row)">查看</el-button>
-              <el-button type="text" @click="resetPasswords(scope.row)"
+              <el-button type="text" @click="synchronous(scope.row)"
                 >同步会话</el-button
               >
             </div>
@@ -228,8 +228,8 @@ export default {
       }
       this.$refs.detailDialogRefs.openClose(code)
     },
-    // 重置密码
-    resetPasswords(val) {
+    // 同步
+    synchronous(val) {
       this.tableDataheight = this.$refs.editTable.bodyWrapper.scrollTop
       sessionStorage.setItem('sessionManagement', this.form.pageNum)
       this.$confirm('此操作将同步会话信息, 是否继续?', '提示', {
@@ -241,6 +241,7 @@ export default {
           api.PUT(`conversation/${val.chatId}`).then(res => {
             if (res.code == 0) {
               this.$message.success(res.message)
+              this.search()
             }
           })
         })