Browse Source

修改了些文案,让提示更友好

star7th 9 years ago
parent
commit
44ca4049fd
2 changed files with 9 additions and 9 deletions
  1. 3 3
      Application/Home/View/Page/edit.html
  2. 6 6
      Public/js/page/edit.js

+ 3 - 3
Application/Home/View/Page/edit.html

@@ -59,7 +59,7 @@
     <div class="btns">
     <div class="btns">
         <button id="api-doc" tabindex="4" >插入API接口模板</button>
         <button id="api-doc" tabindex="4" >插入API接口模板</button>
         <button id="database-doc" tabindex="5" >插入数据字典模板</button>
         <button id="database-doc" tabindex="5" >插入数据字典模板</button>
-        <button id="jsons" tabindex="7" >插入JSON</button>
+        <button id="jsons" tabindex="7" >JSON转参数表格</button>
     </div>
     </div>
     <div id="editormd">
     <div id="editormd">
         <textarea id="page_content" style="display:none;" tabindex="6" >{$page.page_content}</textarea>
         <textarea id="page_content" style="display:none;" tabindex="6" >{$page.page_content}</textarea>
@@ -79,11 +79,11 @@
 <div id="json-templ" class="editormd-dialog editormd-preformatted-text-dialog" style="width: 780px; height: 540px;">
 <div id="json-templ" class="editormd-dialog editormd-preformatted-text-dialog" style="width: 780px; height: 540px;">
 
 
     <div style="cursor: move;" class="editormd-dialog-header">
     <div style="cursor: move;" class="editormd-dialog-header">
-        <strong class="editormd-dialog-title">添加JSON</strong>
+        <strong class="editormd-dialog-title">JSON转参数表格</strong>
     </div>
     </div>
     <a class="fa fa-close editormd-dialog-close" href="javascript:closeDiv('#json-templ');"></a>
     <a class="fa fa-close editormd-dialog-close" href="javascript:closeDiv('#json-templ');"></a>
     <div class="editormd-dialog-container">
     <div class="editormd-dialog-container">
-        <textarea id="jsons_add" class="jsons" placeholder="coding now...."></textarea>
+        <textarea id="jsons_add" class="jsons" placeholder="请粘贴一段json,程序将自动将json解析并生成参数表格。此功能适合用于快速编写API文档的返回参数表格"></textarea>
         
         
         <div class="editormd-dialog-footer">
         <div class="editormd-dialog-footer">
             <button class="editormd-btn editormd-enter-btn">确定</button>
             <button class="editormd-btn editormd-enter-btn">确定</button>

+ 6 - 6
Public/js/page/edit.js

@@ -1,7 +1,7 @@
 var editormd;
 var editormd;
 
 
-var json_table_data='|键|值|类型|空|备注|\n'+
-		'|:-------|:-------|:-------|:-------|:-------|\n';
+var json_table_data='|参数名|类型|说明|\n'+
+		'|:-------|:-------|:-------|\n';
 
 
 $(function() {
 $(function() {
   /*加载目录*/
   /*加载目录*/
@@ -122,8 +122,8 @@ $(function() {
 		
 		
 		editormd.insertValue(json_table_data);
 		editormd.insertValue(json_table_data);
 		
 		
-		json_table_data='|键|值|类型|空|备注|\n'+
-		'|:-------|:-------|:-------|:-------|:-------|\n';
+		json_table_data='|键|类型|说明|\n'+
+		'|:-------|:-------|:-------|\n';
 		
 		
 		
 		
 		$("#json-templ .jsons").val("");
 		$("#json-templ .jsons").val("");
@@ -211,7 +211,7 @@ function Change(data)
 		var type = typeof(value);
 		var type = typeof(value);
 		if(type == "object")
 		if(type == "object")
 		{
 		{
-			json_table_data+='| '+level_str+key+' |object[] | '+type+' | 默认 | 备注 |\n';
+			json_table_data+='| '+level_str+key+' |'+type+'  | 无 |\n';
 			if(value instanceof Array)
 			if(value instanceof Array)
 			{
 			{
 				var j=level+1;
 				var j=level+1;
@@ -226,7 +226,7 @@ function Change(data)
 		}
 		}
 		else
 		else
 		{
 		{
-			json_table_data+='| '+key+' | '+value+' | '+type+' | 默认 | 备注 |\n';
+			json_table_data+='| '+key+' | '+type+'| 无 |\n';
 		}
 		}
 	}
 	}
 }
 }