diff --git a/README.md b/README.md index f0682ee..be7d10e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Rigel Automation Platform === - @version v0.7.0 + @version v0.8.0 @author Bosn(霍雍), wangjeaf(思竹) @weibo http://weibo.com/bosn, http://github.com/wangjeaf @mail bosn@outlook.com, wangjeaf@gmail.com diff --git a/UPDATELOG.md b/UPDATELOG.md index 9c4cb86..e56730d 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -1,4 +1,5 @@ ### rap v0.8 ### +* [功能] 增加新建项目默认模块、请求和参数 2014-02-12 * [功能] 增加jQuery/Kissy插件,更好的使用RAP MOCK 2014-01-14 * [BUG] 修复JSON导入最外层为数组时失效的问题 2014-01-14 * [重构] 修复JSHint提出的N多个rap.js中的编码规范问题 2014-01-14 diff --git a/WebContent/stat/js/core/rap.js b/WebContent/stat/js/core/rap.js index 7ac905f..2f90e00 100644 --- a/WebContent/stat/js/core/rap.js +++ b/WebContent/stat/js/core/rap.js @@ -1004,6 +1004,9 @@ var rap = rap || {}; return _data.moduleList.length === 0; }; + + p.generateId = generateId; + /** * reset parameter id recursively * including child parameters @@ -1239,7 +1242,11 @@ var rap = rap || {}; }; ws._getData = function() { - return _data; + return p.getData(); + }; + + ws.generateId = function() { + return p.generateId(); }; /** @@ -1922,6 +1929,9 @@ var rap = rap || {}; var obj = JSON.parse(response); if (obj.isOk) { storeViewState(); + if (obj.projectData.moduleList.length === 0) { + obj.projectData.moduleList = [{"id":ws.generateId(),"name":"某模块","introduction":"","pageList":[{"moduleId":ws.generateId(),"name":"某页面","introduction":"","id":ws.generateId(),"isIdGenerated":true,"actionList":[{"pageId":ws.generateId(),"name":"某请求","requestType":"1","requestUrl":"","responseTemplate":"","description":"","id":ws.generateId(),"requestParameterList":[{"id":ws.generateId(),"identifier":"reqParam","name":"某请求参数","remark":"","validator":"","dataType":"number","parameterList":[]}],"responseParameterList":[{"id":ws.generateId(),"identifier":"resParam","name":"某响应参数","remark":"","validator":"","dataType":"number","parameterList":[]}]}]}]}]; + } p.init(obj.projectData); _data.projectDataOriginal = b.object.clone(obj.projectData); setButtonsViewState(CONST.EDIT); diff --git a/WebContent/tcom/const.inc.vm b/WebContent/tcom/const.inc.vm index 9bccfe5..2afa0fa 100644 --- a/WebContent/tcom/const.inc.vm +++ b/WebContent/tcom/const.inc.vm @@ -14,7 +14,7 @@ #set($dateFormat = 'yyyy-MM-dd') ## 时间戳 -#set($timeStamp = '20140115.v0.7') +#set($timeStamp = '20140212.v0.8') ##----------------------页面请求action地址------------------------------- ## 配置工程的上下文路径 diff --git a/WebContent/tcom/template.rap.vm b/WebContent/tcom/template.rap.vm index ea4a6d0..8d3c7c8 100644 --- a/WebContent/tcom/template.rap.vm +++ b/WebContent/tcom/template.rap.vm @@ -5,7 +5,7 @@