Просмотр исходного кода

feat:增加分配协作的id传入

xzh 4 лет назад
Родитель
Сommit
8b489aa5cc

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

@@ -56,7 +56,7 @@ import temp from '../../page/navs/temp.vue'
 import { i18n } from '@/lang'
 export default {
   components: { temp },
-  props: ['sceneNum', 'ids', 'cooName', 'visible', 'cooType'],
+  props: ['sceneNum', 'ids', 'cooName', 'visible', 'cooType', 'getListData'],
   data () {
     return {
       i18n,
@@ -157,7 +157,6 @@ export default {
         return
       }
       let data = res.data.data || []
-
       setTimeout(() => {
         let arr = data.map(sub => sub.id)
         let tmp = this.auth.map(item => {
@@ -173,18 +172,22 @@ export default {
     },
     async getResoureList () {
       let token = localStorage.getItem('token')
-
       let res = await this.$http({
         method: 'post',
         headers: {
           token
         },
-        url: '/user/scene/cooperation/sceneResourceList'
+        url: '/user/scene/cooperation/sceneResourceList',
+        data: this.getListData || {}
       })
+      
       if (res.data.code !== 0) {
         return this.handleClick()
       }
-      let tmp = res.data.data.map(item => {
+      let { include, exclude } = res.data.data
+      let filterKeyWords = exclude.map(item => item.keyWord)
+      let list = include.filter(item => filterKeyWords.indexOf(item.keyWord) === -1)
+      let tmp = list.map(item => {
         item.hasAuth = true
         return item
       })

+ 3 - 2
pc/src/components/toast/index.vue

@@ -5,7 +5,7 @@
     <editInvoice :edititem=editItem :visible='editVisible' @closePoint="invoicehandle"/>
     <showInvoice :showitem=showItem :visible='showVisible' @closePoint="()=>{showVisible = false}"/>
     <binding :btype="bindingType" :visible='bindingVisible' @closePoint="()=>{bindingVisible = false,emitCallback()}"/>
-    <cooperation :sceneNum="sceneNum" :cooName="cooName" :ids="ids" :cooType="cooType" :visible='cooperationVisible' @closePoint="handleCooClose"/>
+    <cooperation :sceneNum="sceneNum" :cooName="cooName" :ids="ids" :cooType="cooType" :getListData="getListData" :visible='cooperationVisible' @closePoint="handleCooClose"/>
 
     <div
       class="toast-layout"
@@ -106,7 +106,8 @@ export default {
       isLoaing: false,
       comfirmtxt: localStorage.getItem('language') === 'en' ? 'OK' : '确定',
       img: this.$cdn + 'images/icon/warn.png',
-      lang: localStorage.getItem('language')
+      lang: localStorage.getItem('language'),
+      getListData: {}
     }
   },
   computed: {

+ 1 - 1
pc/src/components/toast/toast.js

@@ -73,7 +73,7 @@ Toast.install = function (Vue) {
     showCooperation: (item, callback) => {
       instance.sceneNum = item.num || ''
       instance.cooName = item.cooName || ''
-
+      instance.getListData = item.getListData || {}
       instance.ids = item.ids
       instance.cooType = item.type || 'scene'
 

+ 4 - 1
pc/src/page/manage/temp/device.vue

@@ -232,7 +232,10 @@ export default {
       this.$toast.showCooperation({
         num: item.id,
         cooName: item.cooperationUserName,
-        type: 'device'
+        type: 'device',
+        getListData: {
+          id: item.id
+        }
       }, () => {
         this.getList()
       })

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

@@ -339,7 +339,10 @@ export default {
       this.$toast.showCooperation({
         num: item.num,
         cooName: item.cooperationUserName,
-        type: 'scene'
+        type: 'scene',
+        getListData: {
+          cameraId: item.cameraId
+        }
       }, () => {
         this.getList()
       })