Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosn committed Dec 11, 2015
2 parents 0b80046 + b223526 commit 3224391
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
10 changes: 10 additions & 0 deletions WebContent/stat/js/core/rap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,16 @@ function deepCopy(o) {
b.g('mockDataPreviewFloater-container').innerHTML = JSON.stringify(Mock.mock(this._mockRuleObj), null, 4);
};

ws.copyToClipboard = function(eleId) {
var ele = b.g(eleId);
ele.select();
try {
document.execCommand('copy');
} catch (err) {
console.log('Oops, unable to copy');
}
};


/********************************************************
* *
Expand Down
19 changes: 12 additions & 7 deletions WebContent/workspace/myWorkspace.vm
Original file line number Diff line number Diff line change
Expand Up @@ -420,26 +420,31 @@
#endFloater

#startFloater("mockDataPreviewFloater" "Mock数据预览" 600 600)
<form name="mockDataPreviewFloater">
<div class="myfloater">
<div>
<h5>Mock规则</h5>
<pre style="width:100%;height:200px;overflow-y:auto;" id="mockRulePreviewFloater-container"></pre>
<h5>Mock规则
<button style="margin-left:5px;" class="btn btn-default btn-xs" onclick="ws.copyToClipboard('mockRulePreviewFloater-container'); return false;">
<i class="glyphicon glyphicon-copy"></i>复制
</button>
</h5>
<textarea style="width:100%;height:200px;overflow-y:auto;" id="mockRulePreviewFloater-container"></textarea>
</div>
<div>
<h5>Mock数据
<button style="margin-left:10px;" class="btn btn-success btn-xs" onclick="ws.refreshMockPreviewData(); return false;">
<button style="margin-left:5px;" class="btn btn-default btn-xs" onclick="ws.copyToClipboard('mockDataPreviewFloater-container'); return false;">
<i class="glyphicon glyphicon-copy"></i>复制
</button>
<button style="margin-left:5px;" class="btn btn-default btn-xs" onclick="ws.refreshMockPreviewData(); return false;">
<i class="glyphicon glyphicon-refresh"></i>刷新
</button>
<i class="glyphicon glyphicon-question-sign" style="color:#000000;" data-toggle="tooltip" data-placement="bottom" style="margin-left:5px;" title="如果您的MOCK规则可能产生变动的数据,例如数组变量名为arr|1-10,表示随机生成1~10组数据,您可通过该按钮刷新随机的数据.我有木有很贴心?有木有~~有木有~~"></i>
<i class="glyphicon glyphicon-question-sign" style="color:#000000;margin-left:3px;" data-toggle="tooltip" data-placement="bottom" title="如果您的MOCK规则可能产生变动的数据,例如数组变量名为arr|1-10,表示随机生成1~10组数据,您可通过该按钮刷新随机的数据.我有木有很贴心?有木有~~有木有~~"></i>
</h5>
<pre style="width:100%;height:200px;overflow-y:auto;" id="mockDataPreviewFloater-container"></pre>
<textarea style="width:100%;height:200px;overflow-y:auto;" id="mockDataPreviewFloater-container"></textarea>
</div>
<div class="div-floater-control">
<input type="button" class="btn btn-default" onclick="ecui.get('mockDataPreviewFloater').hide();" value="关闭" />
</div>
</div>
</form>
#endFloater

#startFloater("actionOpFloater" "文档操作" 600 230)
Expand Down

0 comments on commit 3224391

Please sign in to comment.