소스 검색

feat:修改场景总数切换得bug

xzh 4 년 전
부모
커밋
b6c3155ba2
2개의 변경된 파일16개의 추가작업 그리고 13개의 파일을 삭제
  1. 12 8
      pc/src/components/toast/cooperation.vue
  2. 4 5
      pc/src/page/manage/temp/scene.vue

+ 12 - 8
pc/src/components/toast/cooperation.vue

@@ -11,19 +11,19 @@
       </div>
       <div class="binding-con" :style="{height:(Math.ceil(auth.length/4)*30 + 140)+'px'}">
         <div class="binding-body cooperation">
-          <template v-if="!cooName">
+          <template >
             <div class="toclient">{{lang==='en'?'Collaborator':`协作用户`}}</div>
             <div class="b-input" >
               <input v-model="userName" :placeholder="lang==='en'?'User name':'请输入用户账号'" type="text">
             </div>
           </template>
 
-          <template v-else>
+          <!-- <template v-else>
             <div class="toclient">{{lang==='en'?'Collaborator':`协作用户`}}</div>
             <div class="b-input" >
               {{cooName}}
             </div>
-          </template>
+          </template> -->
 
           <div class="toclient"><span>{{lang==='en'?'Permission':'协作权限'}}</span><div @click="handleSelectAll" v-if="!cooName"><span :class="{check_active:selectAll}" class="fdcheck">{{lang==='en'?'All':'全选'}}</span></div></div>
           <ul class="auth-list">
@@ -40,6 +40,7 @@
 
         <template v-else>
           <span class="default" @click="unbind">{{lang==='en'?'Cancel collaborator':'取消协作'}}</span>
+          <span @click="addCooperation">{{lang==='en'?'OK':'确定'}}</span>
         </template>
       </div>
 
@@ -82,11 +83,14 @@ export default {
         this.selectAll = !this.cooName
         this.getResoureList()
       }
-      this.userName = ''
+      this.userName = this.cooName || ''
       this.lang = localStorage.getItem('language')
       this.toastCode = this.lang === 'en' ? toastEN : toastZH
     }
   },
+  mounted () {
+    
+  },
   methods: {
     async unbind () {
       let token = localStorage.getItem('token')
@@ -123,10 +127,10 @@ export default {
       this.selectAll = !this.selectAll
     },
     selectItem (item, i) {
-      if (this.cooName) {
-        // this.userName = this.cooName
-        return
-      }
+      // if (this.cooName) {
+      //   this.userName = this.cooName
+      //   return
+      // }
       item.hasAuth = !item.hasAuth
       this.$set(this.auth, i, item)
       this.lock = true

+ 4 - 5
pc/src/page/manage/temp/scene.vue

@@ -485,11 +485,10 @@ export default {
       }
       this.pageSize = this.myscene.pageSize
       this.total = this.myscene.total || 0
-      this.allTotal = this.total
-      // if (!this.lock && !this.allTotal) {
-      //   this.lock = true
-      //   this.allTotal = this.total
-      // }
+      if (this.tabActive === 1) {
+        this.lock = true
+        this.allTotal = this.total
+      }
     },
     copyTextToClipboard (text) {
       var textArea = document.createElement('textarea')