# cloud-role **Repository Path**: cq-soft/cloud-role ## Basic Information - **Project Name**: cloud-role - **Description**: uni-admin 树形权限管理 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-03 - **Last Updated**: 2021-01-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 基于 uni-app,uniCloud 的 admin 权限角色管理,在原有基础上,权限增加``parent_id``,使用ly-tree组件,结合unicloud的getree功能,快速实现树形结构,操作更简单 #### 主要代码 展示数据 ``` ``` 直接查询出树形结构data ``` uniCloud.database().collection(dbCollectionName) .field("permission_id,permission_name,parent_id,comment,create_date") .orderBy("create_date asc") .get({ getTree: true }) .then((res) => { that.treeData = res.result.data console.log("treeData", that.treeData); }).catch((err) => { uni.showModal({ content: err.message || '请求服务失败', showCancel: false }) }).finally(() => { that.ready = true // 关闭tree控件的等待loading }) ```