[返回主目录](/doc)

<a name="menu">目录</a>
1. [添加](#addOrg)
1. [更新（暂不提供）](#updOrg)
1. [删除](#delOrg)
1. [列表(条件)](#listOrg)
1. [明细](#queryById)
1. [根据PID查询子目录](#byPid)
1. [结构树](#tree)

## **<a name="addOrg"> 添加</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/addOrg]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

{
	"orgname":"sun", //组织结构的名称 必传
	"pid":1,         //父结点   必传  默认值：0
	"saas_id":3      //saasId  必传
}

```

#### 返回结果
```javascript
{
  "status": 0,
  "msg": "操作成功",
  "data": {
      "is_leaf": true,    //是否叶子结点
      "version": 0,   
      "id": 3,            //ID
      "orgname": "sun",   //组织结构的名称
      "pid": 1,           //父结点
      "saas_id": 3,       //saasID  
      "path": "/root/sun",//路径
      "updated_at": "2019-11-29T03:03:36.800Z",
      "created_at": "2019-11-29T03:03:36.800Z"
  },
  "bizmsg": "empty",
  "requestid": "faf3871bc6a040d9b098ffa33d5a180a"
}

```


## **<a name="updOrg"> 更新（暂不提供）</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/updOrg]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
    }

```

## **<a name="delOrg"> 删除</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/delOrg]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
      "id": 1,  //记录ID  必传   
    }

```


## **<a name="listOrg"> 列表</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/listOrg]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

  {}

```

#### 返回结果
```javascript
{
    "status": 0,
    "msg": "操作成功",
    "data": {
        "count": 2,
        "rows": [
            {
                "is_leaf": true,    //是否叶子结点
                "id": 3,            //ID
                "orgname": "sun",   //组织结构的名称
                "pid": 1,           //父结点
                "saas_id": 3,       //saasID  
                "path": "/root/sun",//路径
                "created_at": "2019-11-28T08:24:40.000Z",
                "updated_at": "2019-11-28T08:24:40.000Z",
                "deleted_at": null,
                "version": 0
            },
            {
                "id": 3,
                "orgname": "sun",
                "path": "/root/sun",
                "pid": 1,
                "saas_id": "3",
                "is_leaf": 1,
                "created_at": "2019-11-29T03:03:36.000Z",
                "updated_at": "2019-11-29T03:03:36.000Z",
                "deleted_at": null,
                "version": 0
            }
        ]
    },
    "bizmsg": "empty",
    "requestid": "e0584277b1d0490ba2c575ac79a1a813"
}

```

## **<a name="queryById"> 明细</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/queryById]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
      "id": 1,  //记录ID  必传   
    }

```

#### 返回结果
```javascript
{
  "status": 0,
  "msg": "操作成功",
  "data": {
      "is_leaf": true,    //是否叶子结点
      "id": 3,            //ID
      "orgname": "sun",   //组织结构的名称
      "pid": 1,           //父结点
      "saas_id": 3,       //saasID  
      "path": "/root/sun",//路径
      "created_at": "2019-11-28T08:24:40.000Z",
      "updated_at": "2019-11-28T08:24:40.000Z",
      "deleted_at": null,
      "version": 0
  },
  "bizmsg": "empty",
  "requestid": "488de0d85b1b425c94166cb3a653b86c"
}

```


## **<a name="byPid"> 根据PID查询子目录</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/byPid]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
      "pid": 1,  //记录ID  必传   
    }

```

#### 返回结果
```javascript
{
  "status": 0,
  "msg": "操作成功",
  "data": [
      {
          "is_leaf": true,    //是否叶子结点
          "id": 3,            //ID
          "orgname": "sun",   //组织结构的名称
          "pid": 1,           //父结点
          "saas_id": 3,       //saasID  
          "path": "/root/sun",//路径
          "created_at": "2019-11-29T03:03:36.000Z",
          "updated_at": "2019-11-29T03:03:36.000Z",
          "deleted_at": null,
          "version": 0
      }
  ],
  "bizmsg": "empty",
  "requestid": "34791671e8584672b302f0f5acda16fa"
}

```

## **<a name="tree"> 结构树</a>**
[返回到目录](#menu)
##### URL
[/web/uc/orgCtl/tree]
#### 参数格式  `JSON`
#### HTTP请求方式 `POST`

``` javascript

    {
      "pid": 1,  //记录ID  必传   
    }

```

#### 返回结果
```javascript
{
    "status": 0,
    "msg": "操作成功",
    "data": [
        {
            "id": 1,
            "orgname": "root",
            "path": "/root",
            "pid": 0,
            "is_leaf": 1,
            "saas_id": "2",
            "created_at": "2019-11-28T08:24:40.000Z",
            "updated_at": "2019-11-28T08:24:40.000Z",
            "deleted_at": null,
            "version": 0,
            "childs": [
                {
                    "id": 3,
                    "orgname": "sun",
                    "path": "/root/sun",
                    "pid": 1,
                    "is_leaf": 1,
                    "saas_id": "3",
                    "created_at": "2019-11-29T03:03:36.000Z",
                    "updated_at": "2019-11-29T03:03:36.000Z",
                    "deleted_at": null,
                    "version": 0,
                    "childs": []
                }
            ]
        }
    ],
    "bizmsg": "empty",
    "requestid": "72619d7a99cc437894b5880564b2847c"
}
```