|  | @@ -16,10 +16,20 @@
 | 
	
		
			
				|  |  |            <el-input type="textarea"
 | 
	
		
			
				|  |  |                      v-model.trim="result.roleDesc"></el-input>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item label="搜索">
 | 
	
		
			
				|  |  | +          <el-input style="width:212px"
 | 
	
		
			
				|  |  | +                    v-model.trim="seachRoleValue"></el-input>
 | 
	
		
			
				|  |  | +          <el-button style="margin-left: 10px"
 | 
	
		
			
				|  |  | +                     type="danger"
 | 
	
		
			
				|  |  | +                     @click="seachRoles">搜索</el-button>
 | 
	
		
			
				|  |  | +          <el-button type="primary"
 | 
	
		
			
				|  |  | +                     @click="onReSetRole">重置</el-button>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  |          <el-form-item label="基本权限">
 | 
	
		
			
				|  |  |            <el-checkbox :indeterminate="isIndeterminate"
 | 
	
		
			
				|  |  |                         @change="onCheckAll"
 | 
	
		
			
				|  |  |                         v-model.trim="checkAll">全选</el-checkbox>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |            <el-tree :data="data"
 | 
	
		
			
				|  |  |                     show-checkbox
 | 
	
		
			
				|  |  |                     node-key="id"
 | 
	
	
		
			
				|  | @@ -28,6 +38,7 @@
 | 
	
		
			
				|  |  |                     accordion
 | 
	
		
			
				|  |  |                     highlight-current
 | 
	
		
			
				|  |  |                     :default-checked-keys="result.menuIds"
 | 
	
		
			
				|  |  | +                   :filter-node-method="seachRole"
 | 
	
		
			
				|  |  |                     :props="defaultProps">
 | 
	
		
			
				|  |  |              <div slot-scope="{ node, data }">
 | 
	
		
			
				|  |  |                {{ node.label }}
 | 
	
	
		
			
				|  | @@ -72,7 +83,8 @@ export default {
 | 
	
		
			
				|  |  |        checkAll: false,
 | 
	
		
			
				|  |  |        splice: [],
 | 
	
		
			
				|  |  |        allChildIds: [], // 所有子编号
 | 
	
		
			
				|  |  | -      slideCount: 0
 | 
	
		
			
				|  |  | +      slideCount: 0,
 | 
	
		
			
				|  |  | +      seachRoleValue: '' //权限搜索字段
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted () {
 | 
	
	
		
			
				|  | @@ -133,13 +145,13 @@ export default {
 | 
	
		
			
				|  |  |          tempData = this.setTableData(silderList.data)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          this.data = tempData
 | 
	
		
			
				|  |  | +        console.log(this.data)
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        // console.log(this.pageType)
 | 
	
		
			
				|  |  |        if (this.pageType == 'update') {
 | 
	
		
			
				|  |  |          let roleInfo = await getRoleInfo({ id: this.id })
 | 
	
		
			
				|  |  |          if (roleInfo.code == 200) {
 | 
	
		
			
				|  |  |            let roleData = roleInfo.data
 | 
	
		
			
				|  |  | -          console.log(roleData)
 | 
	
		
			
				|  |  |            // 是否是全部选中
 | 
	
		
			
				|  |  |            this.checkAll = roleData.menuIds.length >= this.slideCount
 | 
	
		
			
				|  |  |            // 是否是半选
 | 
	
	
		
			
				|  | @@ -229,7 +241,16 @@ export default {
 | 
	
		
			
				|  |  |            page: this.$route.query.page
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        })
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    seachRole (value, data) {
 | 
	
		
			
				|  |  | +      // console.log(value, data)
 | 
	
		
			
				|  |  | +      if (!value) return true;
 | 
	
		
			
				|  |  | +      return data.label.indexOf(value) !== -1;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    seachRoles () {
 | 
	
		
			
				|  |  | +      console.log(this.$refs.tree.filter(this.seachRoleValue))
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onReSetRole () { }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 |