Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
a9cb90a9
Commit
a9cb90a9
authored
Nov 15, 2017
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成完善
parent
af53b9bf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
19 deletions
+71
-19
guns-admin/src/main/resources/gunsTemplate/advanced/page_add.html.btl
+16
-2
guns-admin/src/main/resources/gunsTemplate/advanced/page_edit.html.btl
+17
-3
guns-admin/src/main/resources/gunsTemplate/advanced/page_info.js.btl
+7
-1
guns-core/src/main/java/com/stylefeng/guns/core/util/ToolUtil.java
+31
-13
No files found.
guns-admin/src/main/resources/gunsTemplate/advanced/page_add.html.btl
View file @
a9cb90a9
...
@@ -7,11 +7,25 @@
...
@@ -7,11 +7,25 @@
<div class="row">
<div class="row">
<div class="col-sm-6 b-r">
<div class="col-sm-6 b-r">
<% var leftSize = tool.toInt((table.fields.~size + 1) / 2); %>
<% var rightSize = tool.toInt(table.fields.~size - leftSize); %>
<% for(var i=0;i<leftSize;i++){ %>
<% if(i != (leftSize-1) ){ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}" underline="true"/>
<% }else{ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}"/>
<% } %>
<% } %>
</div>
</div>
<div class="col-sm-6">
<div class="col-sm-6">
<% for(var i=leftSize;i<table.fields.~size;i++){ %>
<% if(i != (rightSize-1) ){ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}" underline="true"/>
<% }else{ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}"/>
<% } %>
<% } %>
</div>
</div>
</div>
</div>
...
...
guns-admin/src/main/resources/gunsTemplate/advanced/page_edit.html.btl
View file @
a9cb90a9
...
@@ -3,15 +3,29 @@
...
@@ -3,15 +3,29 @@
<div class="ibox-content">
<div class="ibox-content">
<div class="form-horizontal">
<div class="form-horizontal">
<input type="hidden" id="id" value="\${
${context.bizEnName}
.id}">
<input type="hidden" id="id" value="\${
item
.id}">
<div class="row">
<div class="row">
<div class="col-sm-6 b-r">
<div class="col-sm-6 b-r">
<% var leftSize = tool.toInt((table.fields.~size + 1) / 2); %>
<% var rightSize = tool.toInt(table.fields.~size - leftSize); %>
<% for(var i=0;i<leftSize;i++){ %>
<% if(i != (leftSize-1) ){ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}" value="\${item.${table.fields[i].propertyName}}" underline="true"/>
<% }else{ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}" value="\${item.${table.fields[i].propertyName}}" />
<% } %>
<% } %>
</div>
</div>
<div class="col-sm-6">
<div class="col-sm-6">
<% for(var i=leftSize;i<table.fields.~size;i++){ %>
<% if(i != (table.fields.~size-1) ){ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}" value="\${item.${table.fields[i].propertyName}}" underline="true"/>
<% }else{ %>
<#input id="${table.fields[i].propertyName}" name="${table.fields[i].comment}" value="\${item.${table.fields[i].propertyName}}" />
<% } %>
<% } %>
</div>
</div>
</div>
</div>
...
...
guns-admin/src/main/resources/gunsTemplate/advanced/page_info.js.btl
View file @
a9cb90a9
...
@@ -44,7 +44,13 @@ ${context.bizEnBigName}InfoDlg.close = function() {
...
@@ -44,7 +44,13 @@ ${context.bizEnBigName}InfoDlg.close = function() {
* 收集数据
* 收集数据
*/
*/
${context.bizEnBigName}InfoDlg.collectData = function() {
${context.bizEnBigName}InfoDlg.collectData = function() {
this.set('id');
this
<% for(item in table.fields!){ %>
<% if(itemLP.last != true){ %>
.set('${item.propertyName}')
<% }else{ %>
;
<% }} %>
}
}
/**
/**
...
...
guns-core/src/main/java/com/stylefeng/guns/core/util/ToolUtil.java
View file @
a9cb90a9
...
@@ -21,6 +21,7 @@ import java.io.IOException;
...
@@ -21,6 +21,7 @@ import java.io.IOException;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
import
java.io.StringWriter
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.Array
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
...
@@ -52,10 +53,10 @@ public class ToolUtil {
...
@@ -52,10 +53,10 @@ public class ToolUtil {
* @author stylefeng
* @author stylefeng
* @Date 2017/4/18 12:55
* @Date 2017/4/18 12:55
*/
*/
public
static
String
dateType
(
Object
o
){
public
static
String
dateType
(
Object
o
)
{
if
(
o
instanceof
Date
)
{
if
(
o
instanceof
Date
)
{
return
DateUtil
.
getDay
((
Date
)
o
);
return
DateUtil
.
getDay
((
Date
)
o
);
}
else
{
}
else
{
return
o
.
toString
();
return
o
.
toString
();
}
}
}
}
...
@@ -69,16 +70,16 @@ public class ToolUtil {
...
@@ -69,16 +70,16 @@ public class ToolUtil {
*/
*/
public
static
String
getExceptionMsg
(
Exception
e
)
{
public
static
String
getExceptionMsg
(
Exception
e
)
{
StringWriter
sw
=
new
StringWriter
();
StringWriter
sw
=
new
StringWriter
();
try
{
try
{
e
.
printStackTrace
(
new
PrintWriter
(
sw
));
e
.
printStackTrace
(
new
PrintWriter
(
sw
));
}
finally
{
}
finally
{
try
{
try
{
sw
.
close
();
sw
.
close
();
}
catch
(
IOException
e1
)
{
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
e1
.
printStackTrace
();
}
}
}
}
return
sw
.
getBuffer
().
toString
().
replaceAll
(
"\\$"
,
"T"
);
return
sw
.
getBuffer
().
toString
().
replaceAll
(
"\\$"
,
"T"
);
}
}
/**
/**
...
@@ -483,7 +484,7 @@ public class ToolUtil {
...
@@ -483,7 +484,7 @@ public class ToolUtil {
* @author stylefeng
* @author stylefeng
* @Date 2017/5/7 21:56
* @Date 2017/5/7 21:56
*/
*/
public
static
String
currentTime
(){
public
static
String
currentTime
()
{
return
DateUtil
.
getTime
();
return
DateUtil
.
getTime
();
}
}
...
@@ -493,7 +494,7 @@ public class ToolUtil {
...
@@ -493,7 +494,7 @@ public class ToolUtil {
* @author stylefeng
* @author stylefeng
* @Date 2017/5/7 22:01
* @Date 2017/5/7 22:01
*/
*/
public
static
String
firstLetterToUpper
(
String
val
){
public
static
String
firstLetterToUpper
(
String
val
)
{
return
StrKit
.
firstCharToUpperCase
(
val
);
return
StrKit
.
firstCharToUpperCase
(
val
);
}
}
...
@@ -503,7 +504,7 @@ public class ToolUtil {
...
@@ -503,7 +504,7 @@ public class ToolUtil {
* @author stylefeng
* @author stylefeng
* @Date 2017/5/7 22:02
* @Date 2017/5/7 22:02
*/
*/
public
static
String
firstLetterToLower
(
String
val
){
public
static
String
firstLetterToLower
(
String
val
)
{
return
StrKit
.
firstCharToLowerCase
(
val
);
return
StrKit
.
firstCharToLowerCase
(
val
);
}
}
...
@@ -513,11 +514,11 @@ public class ToolUtil {
...
@@ -513,11 +514,11 @@ public class ToolUtil {
* @author stylefeng
* @author stylefeng
* @Date 2017/5/24 22:34
* @Date 2017/5/24 22:34
*/
*/
public
static
Boolean
isWinOs
(){
public
static
Boolean
isWinOs
()
{
String
os
=
System
.
getProperty
(
"os.name"
);
String
os
=
System
.
getProperty
(
"os.name"
);
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
}
}
}
}
...
@@ -528,7 +529,23 @@ public class ToolUtil {
...
@@ -528,7 +529,23 @@ public class ToolUtil {
* @author stylefeng
* @author stylefeng
* @Date 2017/5/24 22:35
* @Date 2017/5/24 22:35
*/
*/
public
static
String
getTempPath
(){
public
static
String
getTempPath
()
{
return
System
.
getProperty
(
"java.io.tmpdir"
);
return
System
.
getProperty
(
"java.io.tmpdir"
);
}
}
/**
* 把一个数转化为int
*
* @author fengshuonan
* @Date 2017/11/15 下午11:10
*/
public
static
Integer
toInt
(
Object
val
)
{
if
(
val
instanceof
Double
)
{
BigDecimal
bigDecimal
=
new
BigDecimal
((
Double
)
val
);
return
bigDecimal
.
intValue
();
}
else
{
return
(
Integer
)
val
;
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment