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
44074919
Commit
44074919
authored
Jun 22, 2018
by
stylefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
!39 移动手机端浏览页面不兼容
移动端浏览页面布局无法兼容
parent
47a63463
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
190 additions
and
3 deletions
+190
-3
guns-admin/src/main/webapp/WEB-INF/view/common/_container.html
+13
-0
guns-admin/src/main/webapp/static/js/common/DateUtils.js
+174
-0
guns-admin/src/main/webapp/static/modular/system/menu/menu.js
+3
-3
No files found.
guns-admin/src/main/webapp/WEB-INF/view/common/_container.html
View file @
44074919
...
@@ -45,6 +45,19 @@
...
@@ -45,6 +45,19 @@
<script
src=
"${ctxPath}/static/js/common/ztree-object.js"
></script>
<script
src=
"${ctxPath}/static/js/common/ztree-object.js"
></script>
<script
src=
"${ctxPath}/static/js/common/Feng.js"
></script>
<script
src=
"${ctxPath}/static/js/common/Feng.js"
></script>
<style
type=
"text/css"
>
table
{
width
:
100px
;
table-layout
:
fixed
;
/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */
}
td
{
width
:
100%
;
word-break
:
keep-all
;
/* 不换行 */
white-space
:
nowrap
;
/* 不换行 */
overflow
:
hidden
;
/* 内容超出宽度时隐藏超出部分的内容 */
text-overflow
:
ellipsis
;
/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用*/
}
</style>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
Feng
.
addCtx
(
"${ctxPath}"
);
Feng
.
addCtx
(
"${ctxPath}"
);
...
...
guns-admin/src/main/webapp/static/js/common/DateUtils.js
0 → 100644
View file @
44074919
var
DateUtils
=
{
/**
* 扩展Date 对象格式化方法
*/
expandDate
:
function
()
{
Date
.
prototype
.
format
=
function
(
fmt
)
{
//author: meizz
var
o
=
{
"M+"
:
this
.
getMonth
()
+
1
,
//月份
"d+"
:
this
.
getDate
(),
//日
"h+"
:
this
.
getHours
()
%
12
==
0
?
12
:
this
.
getHours
()
%
12
,
//小时
"H+"
:
this
.
getHours
(),
//小时
"m+"
:
this
.
getMinutes
(),
//分
"s+"
:
this
.
getSeconds
(),
//秒
"q+"
:
Math
.
floor
((
this
.
getMonth
()
+
3
)
/
3
),
//季度
"S"
:
this
.
getMilliseconds
()
//毫秒
};
if
(
/
(
y+
)
/
.
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
this
.
getFullYear
()
+
""
).
substr
(
4
-
RegExp
.
$1
.
length
));
for
(
var
k
in
o
)
if
(
new
RegExp
(
"("
+
k
+
")"
).
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
RegExp
.
$1
.
length
==
1
)
?
(
o
[
k
])
:
((
"00"
+
o
[
k
]).
substr
((
""
+
o
[
k
]).
length
)));
return
fmt
;
}
},
/**
* 获取具体年龄
* @param {} beginStr
* @param {} endStr
* @return {}
*/
getAgeInfo
:
function
(
beginStr
,
endStr
)
{
var
reg
=
new
RegExp
(
/^
(\d{1,4})(
-|
\/)(\d{1,2})(
-|
\/)(\d{1,2})(\s)(\d{1,2})(
:
)(\d{1,2})(
:
{0,1})(\d{0,2})
$/
);
var
beginArr
=
beginStr
.
match
(
reg
);
var
endArr
=
endStr
.
match
(
reg
);
var
days
=
0
;
var
month
=
0
;
var
year
=
0
;
days
=
endArr
[
5
]
-
beginArr
[
5
];
if
(
days
<
0
)
{
month
=
-
1
;
days
=
30
+
days
;
}
month
=
month
+
(
endArr
[
3
]
-
beginArr
[
3
]);
if
(
month
<
0
)
{
year
=
-
1
;
month
=
12
+
month
;
}
year
=
year
+
(
endArr
[
1
]
-
beginArr
[
1
]);
var
yearString
=
year
>
0
?
year
+
"岁"
:
""
;
var
mnthString
=
month
>
0
?
month
+
"月"
:
""
;
var
dayString
=
days
>
0
?
days
+
"天"
:
""
;
/*
* 1 如果岁 大于等于1 那么年龄取 几岁 2 如果 岁等于0 但是月大于1 那么如果天等于0天小于3天 取小时 例如出生2天 就取 48小时
*/
var
result
=
""
;
if
(
year
>=
1
)
{
result
=
yearString
+
mnthString
;
}
else
{
if
(
month
>=
1
)
{
result
=
days
>
0
?
mnthString
+
dayString
:
mnthString
;
}
else
{
var
begDate
=
new
Date
(
beginArr
[
1
],
beginArr
[
3
]
-
1
,
beginArr
[
5
],
beginArr
[
7
],
beginArr
[
9
],
beginArr
[
11
]);
var
endDate
=
new
Date
(
endArr
[
1
],
endArr
[
3
]
-
1
,
endArr
[
5
],
endArr
[
7
],
endArr
[
9
],
endArr
[
11
]);
var
between
=
(
endDate
.
getTime
()
-
begDate
.
getTime
())
/
1000
;
days
=
Math
.
floor
(
between
/
(
24
*
3600
));
var
hours
=
Math
.
floor
(
between
/
3600
-
(
days
*
24
));
var
dayString
=
days
>
0
?
days
+
"天"
:
""
;
result
=
days
>=
3
?
dayString
:
days
*
24
+
hours
+
"小时"
;
}
}
return
result
;
},
/**
* 获取年龄,不满一天算天
* @param {} birthday
* @param {} today
* @return {}
*/
getAge
:
function
(
birthday
,
today
)
{
var
reg
=
new
RegExp
(
/^
(\d{1,4})(
-|
\/)(\d{1,2})(
-|
\/)(\d{1,2})
$/
);
var
beginArr
=
birthday
.
match
(
reg
);
var
endArr
=
today
.
match
(
reg
);
var
days
=
0
;
var
month
=
0
;
var
year
=
0
;
days
=
endArr
[
5
]
-
beginArr
[
5
];
if
(
days
<
0
)
{
month
=
-
1
;
days
=
30
+
days
;
}
month
=
month
+
(
endArr
[
3
]
-
beginArr
[
3
]);
if
(
month
<
0
)
{
year
=
-
1
;
month
=
12
+
month
;
}
year
=
year
+
(
endArr
[
1
]
-
beginArr
[
1
]);
var
yearString
=
year
>
0
?
year
+
"岁"
:
""
;
var
mnthString
=
month
>
0
?
month
+
"月"
:
""
;
var
dayString
=
days
>
0
?
days
+
"天"
:
"1天"
;
/*
* 1 如果岁 大于等于1 那么年龄取 几岁 2 如果 岁等于0 但是月大于1 name取几月 3 如果不足月, 则取天数 4 不满一天算一天
*/
var
result
=
""
;
if
(
year
>=
1
)
{
result
=
yearString
+
mnthString
+
dayString
;
}
else
{
if
(
month
>=
1
)
{
result
=
days
>
0
?
mnthString
+
dayString
:
mnthString
;
}
else
{
result
=
dayString
;
}
}
return
result
;
},
/**
* 获取月龄
* @param {} birthday
* @param {} today
* @return {}
*/
getMonthage
:
function
(
birthday
,
today
)
{
var
reg
=
new
RegExp
(
/^
(\d{1,4})(
-|
\/)(\d{1,2})(
-|
\/)(\d{1,2})
$/
);
var
beginArr
=
birthday
.
match
(
reg
);
var
endArr
=
today
.
match
(
reg
);
var
days
=
0
;
var
month
=
0
;
var
year
=
0
;
days
=
endArr
[
5
]
-
beginArr
[
5
];
if
(
days
<
0
)
{
month
=
-
1
;
days
=
30
+
days
;
}
month
=
month
+
(
endArr
[
3
]
-
beginArr
[
3
]);
if
(
month
<
0
)
{
year
=
-
1
;
month
=
12
+
month
;
}
year
=
year
+
(
endArr
[
1
]
-
beginArr
[
1
]);
var
result
=
""
;
if
(
year
>=
1
)
{
result
=
(
year
*
12
+
month
+
1
)
+
"个月"
;
}
else
{
if
(
month
>=
1
)
{
result
=
(
month
+
1
)
+
"个月"
;
}
else
{
result
=
"1个月"
;
}
}
return
result
;
}
}
\ No newline at end of file
guns-admin/src/main/webapp/static/modular/system/menu/menu.js
View file @
44074919
...
@@ -15,10 +15,10 @@ Menu.initColumn = function () {
...
@@ -15,10 +15,10 @@ Menu.initColumn = function () {
var
columns
=
[
var
columns
=
[
{
field
:
'selectItem'
,
radio
:
true
},
{
field
:
'selectItem'
,
radio
:
true
},
{
title
:
'id'
,
field
:
'id'
,
visible
:
false
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'id'
,
field
:
'id'
,
visible
:
false
,
align
:
'center'
,
valign
:
'middle'
},
{
title
:
'菜单名称'
,
field
:
'name'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
,
width
:
'17%'
},
{
title
:
'菜单名称'
,
field
:
'name'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'菜单编号'
,
field
:
'code'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
,
width
:
'12%'
},
{
title
:
'菜单编号'
,
field
:
'code'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'菜单父编号'
,
field
:
'pcode'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'菜单父编号'
,
field
:
'pcode'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'请求地址'
,
field
:
'url'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
,
width
:
'15%'
},
{
title
:
'请求地址'
,
field
:
'url'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'排序'
,
field
:
'num'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'排序'
,
field
:
'num'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'层级'
,
field
:
'levels'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'层级'
,
field
:
'levels'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'是否是菜单'
,
field
:
'isMenuName'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
{
title
:
'是否是菜单'
,
field
:
'isMenuName'
,
align
:
'center'
,
valign
:
'middle'
,
sortable
:
true
},
...
...
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