From e942423c943c44a72724d4fa83d242af9a3f804c Mon Sep 17 00:00:00 2001 From: dailer Date: Sun, 7 Apr 2019 15:20:38 +0800 Subject: [PATCH] update --- API/jsdocbash.js | 34 +++++++++++++++++++++++ API/utils.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++- 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 API/jsdocbash.js create mode 100644 API/utils.md diff --git a/API/jsdocbash.js b/API/jsdocbash.js new file mode 100644 index 0000000..0b270d2 --- /dev/null +++ b/API/jsdocbash.js @@ -0,0 +1,34 @@ +const jsdoc2md = require('jsdoc-to-markdown'); +const fs = require('fs'); +const path = require('path'); + + +const options = { + "files": [ + "src/modules/workbench/utils.js" + ] +}; + +const templateData = jsdoc2md.getTemplateDataSync(options); + + +const utils = []; +let entryName = "" + +templateData.forEach((item, index) => { + if (item.name === "Dec.Utils") { + utils.push(item); + entryName = item.customTags.find((value, index) => { + return value.tag === "entryname"; + }) + } + if (item.memberof === "module:Dec.Utils") { + utils.push(item); + } +}) + + +const outputDir = __dirname; + +const output = jsdoc2md.renderSync({ data: utils }); +fs.writeFileSync(path.resolve(outputDir, `${entryName.value}.md`), output); diff --git a/API/utils.md b/API/utils.md new file mode 100644 index 0000000..54c4ed6 --- /dev/null +++ b/API/utils.md @@ -0,0 +1,72 @@ + + +## Dec.Utils +平台workbench utils方法 + + +* [Dec.Utils](#module_Dec.Utils) + * [~getWorkbenchSubDirectoryById(pId, callback)](#module_Dec.Utils..getWorkbenchSubDirectoryById) + * [~getCompleteDirectoryTree(callback)](#module_Dec.Utils..getCompleteDirectoryTree) + * [~searchWorkbenchSubDirectory(keyword, callback)](#module_Dec.Utils..searchWorkbenchSubDirectory) + * [~handlerCollect(id, isFavorite, callback)](#module_Dec.Utils..handlerCollect) + * [~getFavoritesList(callback)](#module_Dec.Utils..getFavoritesList) + + + +### Dec.Utils~getWorkbenchSubDirectoryById(pId, callback) +根据父级id获取下一层子目录,根级id为 decision-directory-root + +**Kind**: inner method of [Dec.Utils](#module_Dec.Utils) + +| Param | Description | +| --- | --- | +| pId | 父级id | +| callback | | + + + +### Dec.Utils~getCompleteDirectoryTree(callback) +获取完整的目录树数据 + +**Kind**: inner method of [Dec.Utils](#module_Dec.Utils) + +| Param | +| --- | +| callback | + + + +### Dec.Utils~searchWorkbenchSubDirectory(keyword, callback) +搜索目录树 + +**Kind**: inner method of [Dec.Utils](#module_Dec.Utils) + +| Param | +| --- | +| keyword | +| callback | + + + +### Dec.Utils~handlerCollect(id, isFavorite, callback) +收藏或者取消收藏目录 + +**Kind**: inner method of [Dec.Utils](#module_Dec.Utils) + +| Param | Type | Description | +| --- | --- | --- | +| id | | | +| isFavorite | boolean | 是否收藏 | +| callback | | | + + + +### Dec.Utils~getFavoritesList(callback) +获取收藏列表 + +**Kind**: inner method of [Dec.Utils](#module_Dec.Utils) + +| Param | +| --- | +| callback | + diff --git a/README.md b/README.md index 6d0975a..3f0b363 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,6 @@ FineUI的精华之一就在于我们可以基于布局组件随心所遇的搭 首先先看一个组件化的demo [如何定义一个FineUI组件](./basic/如何定义一个FineUI组件.md) 1. [一个图标+文字的组件](./basic/一个图标_文字的组件.md) -2. [常用表单,文字标签+输入框](./basic/文字标签_输入框.md) \ No newline at end of file +2. [常用表单,文字标签+输入框](./basic/文字标签_输入框.md) + +## Stage3: 根据API自定义复杂的业务功能