>[warning] 使用前請務必在js頁面引入**fselector.js imgpreview.js**
#### 高拍儀上傳組件
>[info] selectHardware: function (callback,options) {}
* callback:文件上傳后的回調函數
* options:初始化參數
>[success]回調函數
上傳成功后的回調函數主要讀取ret中的數據,ret返回數據格式如下:
```php
{
"code":1,
"msg":"上傳成功",
"data":
{
"fileId":"1",
"title":"1dcc5e90f603738d8a0c27ddbd1bb051fa19ecdc",
"url":"\/uploads\/20190708\/3e72e1066f353e8da7caf7aeabfbb4f0.gif",
"path":"\/uploads\/20190708\/3e72e1066f353e8da7caf7aeabfbb4f0.gif",
"thumbPath":"\/uploads\/20190708\/3e72e1066f353e8da7caf7aeabfbb4f0.gif",
"fullPath":"http:\/\/www.yun.com:8091\/uploads\/20190708\/3e72e1066f353e8da7caf7aeabfbb4f0.gif",
"hash":"4ba48c37508019cdca6cf935f38cbac8ac59fdd0",
"size":20971520,
"type":"gif"
},
"url":"",
"wait":3
}
}
```
>[success]示例代碼
表單頁面代碼【說明:在高拍儀按鈕中需要在class中添加uploadHardware data-list-box-id必須為imgpreview。同時需要添加一個顯示文件內容的div,其id為imgpreview,class添加imgpreview_edit】
```html
<div class="form-group">
<label class="col-xs-12 col-sm-2 control-label">相關附件:</label>
<div class="col-xs-12 col-sm-8">
<button type="button" id="btnUploaderWare" data-filetype="file" data-list-box-id="imgpreview"
class="btn btn-info uploadHardware"><i class="fa fa-upload"></i> 高拍儀</button>
</div>
</div>
<div class="form-group">
<ul class="col-xs-10 col-xs-offset-2 imgpreview_edit" id="imgpreview">
</ul>
</div>
```
js頁面代碼
```js
Selector.api.selectHardware(function (data) {
var listBoxId = $this.data('list-box-id');
var listBox = $('#' + listBoxId);
listBox.data('imgview').add(data);
},{});
```
- 空白目錄
- 簡介
- 前端
- 組件
- 文件上傳
- 用戶選擇
- 組織機構選擇
- 角色崗位選擇
- 崗位選擇
- 用戶組選擇
- 高拍儀上傳
- 公共類庫
- 組織機構
- bindToOrg
- bindusertoremote
- getAncestors
- getAllChildIds
- getByOrgId
- getByThirdAppPkId
- getChilds
- getChildsCount
- getMasterOrg
- getOrgUserById
- getOrgUser
- getOrgRoleData
- getOrgRoleQuota
- getOrgRoleUserCount
- getParents
- getPosteritys
- getTreeArray
- getUserOrgs
- getUserOrgCount
- getUserOrgRoleInfo
- hasChild
- hasMasterOrg
- hasBind
- isOrgUser
- updateOrg
- 用戶管理
- getAuthorInfo
- getByDuty
- getByGroup
- getByMobile
- getByOrg
- getByUserId
- getByUserName
- getByRole
- getByToken
- getByThirdUserId
- getUserOrgs
- getUserRoles
- getUserList
- 統一待辦
- createTodo
- createHandle
- createRead
- removeTodo
- getTodoList
- setReaded