>[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