Skip to content

Commit

Permalink
download & searchTreeObject
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Feb 18, 2021
1 parent 43c009a commit dbafe75
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 114 deletions.
57 changes: 0 additions & 57 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
<dt><a href="#addEvent">addEvent(element, type, handler)</a></dt>
<dd><p>addEvent()事件委托,支持多次委托</p>
</dd>
<dt><a href="#handleEvent">handleEvent(event)</a> ⇒ <code>Boolean</code></dt>
<dd><p>handleEvent()执行事件</p>
</dd>
<dt><a href="#fixEvent">fixEvent(event)</a> ⇒ <code>Object</code></dt>
<dd><p>为IE的事件对象添加一些“缺失的”函数</p>
</dd>
<dt><a href="#camel2Dash">camel2Dash(string)</a> ⇒ <code>String</code></dt>
<dd><p>camel2Dash
将驼峰字符串转成-间隔且全小写的Dash模式</p>
Expand Down Expand Up @@ -79,9 +73,6 @@ name*exMall-detail-goodsInfoId!params(goodsInfoId)*8866 转成 name=exMall-detai
<dt><a href="#download">download(url, filename, type)</a></dt>
<dd><p>文件下载的几种方式:1. 针对一些浏览器无法识别的文件格式。地址栏输入文件URL、window.location.href = URL、window.open(URL);2. 使用a标签download属性(或者js创建a标签);3. 浏览器可识别的pdf、txt文件,后端兼容处理attachment;4. 在header增加token用于鉴权下载,使用XmlHttpRequest来想后台发起请求</p>
</dd>
<dt><a href="#saveFile">saveFile(data, filename)</a></dt>
<dd><p>保存文件</p>
</dd>
<dt><a href="#encodeBase64">encodeBase64(input)</a> ⇒ <code>String</code></dt>
<dd><p>字符串、数字转base64</p>
</dd>
Expand Down Expand Up @@ -235,29 +226,6 @@ addEvent()事件委托,支持多次委托
| type | <code>String</code> | 事件类型。不需要加on |
| handler | <code>function</code> | 回调方法 |

<a name="handleEvent"></a>

## handleEvent(event) ⇒ <code>Boolean</code>
handleEvent()执行事件

**Kind**: global function

| Param | Type | Description |
| ----- | ------------------- | ----------- |
| event | <code>String</code> | 事件类型 |

<a name="fixEvent"></a>

## fixEvent(event) ⇒ <code>Object</code>
为IE的事件对象添加一些“缺失的”函数

**Kind**: global function
**Returns**: <code>Object</code> - 返回补齐了缺失方法的的event

| Param | Type | Description |
| ----- | ------------------- | ----------- |
| event | <code>String</code> | 事件类型 |

<a name="camel2Dash"></a>

## camel2Dash(string) ⇒ <code>String</code>
Expand Down Expand Up @@ -521,18 +489,6 @@ name*exMall-detail-goodsInfoId!params(goodsInfoId)*8866 转成 name=exMall-detai
| filename | <code>String</code> | | 文件名 |
| type | <code>String</code> | <code>download</code> | 下载类型 'href','open','download','request' |

<a name="saveFile"></a>

## saveFile(data, filename)
保存文件

**Kind**: global function

| Param | Type | Description |
| -------- | ------------------- | ----------- |
| data | <code>Object</code> | 文件数据 |
| filename | <code>String</code> | 文件名 |

<a name="encodeBase64"></a>

## encodeBase64(input) ⇒ <code>String</code>
Expand Down Expand Up @@ -958,19 +914,6 @@ tree对象深度查找
| keySet | <code>object</code> | 选填 默认的子类名称、查询name |
| number | <code>number</code> | 选填 查找个数,不传则查询全部 |

<a name="searchTreeObject..deepSearch"></a>

### searchTreeObject~deepSearch([Object, Array], expression) ⇒ <code>Object</code>
递归查找

**Kind**: inner method of [<code>searchTreeObject</code>](#searchTreeObject)
**Returns**: <code>Object</code> - Nodes

| Param | Type | Description |
| --------------- | ------------------- | ----------- |
| [Object, Array] | | tree 对象 |
| expression | <code>String</code> | 表达式 |

<a name="setCache"></a>

## setCache(name, value, seconds) ⇒
Expand Down
57 changes: 0 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ searchTreeObject, // 对象查找
<dt><a href="#addEvent">addEvent(element, type, handler)</a></dt>
<dd><p>addEvent()事件委托,支持多次委托</p>
</dd>
<dt><a href="#handleEvent">handleEvent(event)</a> ⇒ <code>Boolean</code></dt>
<dd><p>handleEvent()执行事件</p>
</dd>
<dt><a href="#fixEvent">fixEvent(event)</a> ⇒ <code>Object</code></dt>
<dd><p>为IE的事件对象添加一些“缺失的”函数</p>
</dd>
<dt><a href="#camel2Dash">camel2Dash(string)</a> ⇒ <code>String</code></dt>
<dd><p>camel2Dash
将驼峰字符串转成-间隔且全小写的Dash模式</p>
Expand Down Expand Up @@ -279,9 +273,6 @@ name*exMall-detail-goodsInfoId!params(goodsInfoId)*8866 转成 name=exMall-detai
<dt><a href="#download">download(url, filename, type)</a></dt>
<dd><p>文件下载的几种方式:1. 针对一些浏览器无法识别的文件格式。地址栏输入文件URL、window.location.href = URL、window.open(URL);2. 使用a标签download属性(或者js创建a标签);3. 浏览器可识别的pdf、txt文件,后端兼容处理attachment;4. 在header增加token用于鉴权下载,使用XmlHttpRequest来想后台发起请求</p>
</dd>
<dt><a href="#saveFile">saveFile(data, filename)</a></dt>
<dd><p>保存文件</p>
</dd>
<dt><a href="#encodeBase64">encodeBase64(input)</a> ⇒ <code>String</code></dt>
<dd><p>字符串、数字转base64</p>
</dd>
Expand Down Expand Up @@ -435,29 +426,6 @@ addEvent()事件委托,支持多次委托
| type | <code>String</code> | 事件类型。不需要加on |
| handler | <code>function</code> | 回调方法 |

<a name="handleEvent"></a>

## handleEvent(event) ⇒ <code>Boolean</code>
handleEvent()执行事件

**Kind**: global function

| Param | Type | Description |
| ----- | ------------------- | ----------- |
| event | <code>String</code> | 事件类型 |

<a name="fixEvent"></a>

## fixEvent(event) ⇒ <code>Object</code>
为IE的事件对象添加一些“缺失的”函数

**Kind**: global function
**Returns**: <code>Object</code> - 返回补齐了缺失方法的的event

| Param | Type | Description |
| ----- | ------------------- | ----------- |
| event | <code>String</code> | 事件类型 |

<a name="camel2Dash"></a>

## camel2Dash(string) ⇒ <code>String</code>
Expand Down Expand Up @@ -721,18 +689,6 @@ name*exMall-detail-goodsInfoId!params(goodsInfoId)*8866 转成 name=exMall-detai
| filename | <code>String</code> | | 文件名 |
| type | <code>String</code> | <code>download</code> | 下载类型 'href','open','download','request' |

<a name="saveFile"></a>

## saveFile(data, filename)
保存文件

**Kind**: global function

| Param | Type | Description |
| -------- | ------------------- | ----------- |
| data | <code>Object</code> | 文件数据 |
| filename | <code>String</code> | 文件名 |

<a name="encodeBase64"></a>

## encodeBase64(input) ⇒ <code>String</code>
Expand Down Expand Up @@ -1158,19 +1114,6 @@ tree对象深度查找
| keySet | <code>object</code> | 选填 默认的子类名称、查询name |
| number | <code>number</code> | 选填 查找个数,不传则查询全部 |

<a name="searchTreeObject..deepSearch"></a>

### searchTreeObject~deepSearch([Object, Array], expression) ⇒ <code>Object</code>
递归查找

**Kind**: inner method of [<code>searchTreeObject</code>](#searchTreeObject)
**Returns**: <code>Object</code> - Nodes

| Param | Type | Description |
| --------------- | ------------------- | ----------- |
| [Object, Array] | | tree 对象 |
| expression | <code>String</code> | 表达式 |

<a name="setCache"></a>

## setCache(name, value, seconds) ⇒
Expand Down
2 changes: 2 additions & 0 deletions src/addEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ addEvent.guid = 1
/**
* handleEvent()执行事件
*
* @private
* @param {String} event 事件类型
* @returns {Boolean}
*/
Expand All @@ -54,6 +55,7 @@ function handleEvent(event) {

/**
* 为IE的事件对象添加一些“缺失的”函数
* @private
* @param {String} event 事件类型
* @returns {Object} 返回补齐了缺失方法的的event
*/
Expand Down
1 change: 1 addition & 0 deletions src/cutCHSString.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* js截取字符串,中英文都能用
* @private
* @param str:需要截取的字符串
* @param len: 需要截取的长度
*/
Expand Down
1 change: 1 addition & 0 deletions src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function downloadUrlFile(url, filename) {

/**
* @description 保存文件
* @private
* @param {Object} data 文件数据
* @param {String} filename 文件名
*/
Expand Down
1 change: 1 addition & 0 deletions src/searchTreeObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function searchTreeObject(tree, expression, keySet, number = null) {
keySet = { childName: 'child', keyName: 'name', ...keySet }
/**
* @description 递归查找
* @private
* @param [Object, Array] tree 对象
* @param {String} expression 表达式
* @returns {Object} Nodes
Expand Down

0 comments on commit dbafe75

Please sign in to comment.