Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
fb395113
Commit
fb395113
authored
Apr 24, 2018
by
李家智
Browse files
bug fix
parents
93127595
31899010
Changes
70
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
fb395113
...
...
@@ -5,7 +5,7 @@
基本技术栈来源于我为电子工业出版社编写的的
[
<<Spring Boot 2 精髓 >>
](
http://ibeetl.com/sb2/#more
)
(
这本书每一章也有各种例子,但Springboot-plus
更偏向于应用而不是教学)
当前版本:1.
0.0
当前版本:1.
1.2
技术交流群:219324263
...
...
@@ -28,6 +28,12 @@
## 1.1 安装说明
> 建议在彻底熟悉plus系统之前,先暂时不要修改其他配置选项,免得系统无法访问
>
> 本系统基于Spring Boot 2 ,因此请务必使用JDK8,且打开编译选项[parameters(点击了解parameters)](http://www.mamicode.com/info-detail-2162647.html),<u> 并重新编译工程,如果你没有使用Java8的 parameters 特性,系统不能正常使用</u>
从Git上获取代码后,通过IDE导入此Maven工程,包含俩个子工程
*
admin-core ,核心包,包含了缓存,数据权限,公用的JS和HTML页面。
...
...
@@ -44,13 +50,9 @@ spring.datasource.password=123456
~~~
> 建议在彻底熟悉plus系统之前,先暂时不要修改其他配置选项,免得系统无法访问
>
> 本系统基于Spring Boot 2 ,因此请务必使用JDK8,且打开编译选项[parameters](http://www.mamicode.com/info-detail-2162647.html),<u> 并重新编译工程,如果你没有使用Java8的 parameters 特性,系统不能正常使用</u>
运行CosonleApplication,然后访问http://127.0.0.1:8080/ 输入admin/123456 则可以直接登录进入管理系统
如果成功启动后运行报错:变量userId未定义,位于第6行,那是因为你没有启用
[
parameters
](
http://www.mamicode.com/info-detail-2162647.html
)
如果成功启动后运行报错:变量userId未定义,位于第6行,那是因为你没有启用
[
parameters
](
http://www.mamicode.com/info-detail-2162647.html
)
,启用后,需要重新build整个工程
...
...
@@ -58,7 +60,7 @@ spring.datasource.password=123456
SpringBoot-plus 是一个适合大系统拆分成小系统的架构,或者是一个微服务系统,因此,如果你需要创建自己的业务系统,比如,一个CMS子系统,建议你不要在SpringBoot-Plus 添加代码,应该是新建立一个maven工程,依赖admin-core,或者依赖admin-console(如果你有后台管理需求,通常都有,但不是必须的)
创建子系统,可以进入代码生成>子系统生成, 输入maven项目路径,还有包名,就可以直接生成一个可运行的基于SpringBoot-Plus 的子系统
创建子系统,可以进入代码生成>子系统生成, 输入maven项目路径,还有包名,就可以直接生成一个可运行的基于SpringBoot-Plus 的子系统
,所有代码可以在这些完成
### 1.2.1 配置子系统
...
...
@@ -97,7 +99,7 @@ SpringPlus-Boot 并非以菜单或者按钮来组织整个系统,而是以功
### 1.2.2 添加代码
可以参考1.3业务代码生成生成初始化的代码
可以参考1.3业务代码生成生成初始化的代码
,业务代码生成了14个文件,包含前后端所有代码,可以通过生成来了解代码习作规范
...
...
admin-cloud/admin-cloud-eureka-server/bin/.gitignore
0 → 100644
View file @
fb395113
/target/
admin-cloud/admin-cloud-eureka-server/bin/pom.xml
0 → 100644
View file @
fb395113
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-cloud
</artifactId>
<version>
1.1.1
</version>
</parent>
<artifactId>
admin-cloud-eureka-server
</artifactId>
<name>
admin-cloud-eureka-server
</name>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-server
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
admin-cloud/admin-cloud-eureka-server/bin/src/main/java/com/ibeetl/cloud/eurekaserver/EurekaServerApplication.class
0 → 100644
View file @
fb395113
File added
admin-cloud/admin-cloud-eureka-server/bin/src/main/resources/application.properties
0 → 100644
View file @
fb395113
server.port
=
8761
spring.application.name
=
eureka-service
#eureka-server
eureka.instance.hostname
=
localhost
eureka.client.register-with-eureka
=
false
eureka.client.fetch-registry
=
false
eureka.client.serviceUrl.defaultZone
=
http://${eureka.instance.hostname}:${server.port}/eureka/
admin-cloud/admin-cloud-eureka-server/pom.xml
View file @
fb395113
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-cloud
</artifactId>
<version>
1.1.
1
</version>
<version>
1.1.
2
</version>
</parent>
<artifactId>
admin-cloud-eureka-server
</artifactId>
<name>
admin-cloud-eureka-server
</name>
...
...
admin-cloud/pom.xml
View file @
fb395113
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin
</artifactId>
<version>
1.1.
1
</version>
<version>
1.1.
2
</version>
</parent>
<artifactId>
admin-cloud
</artifactId>
<packaging>
pom
</packaging>
...
...
admin-console/bin/.gitignore
0 → 100644
View file @
fb395113
/application.properties
/banner.txt
/beetl.properties
/btsql-ext.properties
/com/
/excelTemplates/
/sql/
/static/
/templates/
admin-console/pom.xml
View file @
fb395113
...
...
@@ -3,23 +3,16 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
admin-console
</artifactId>
<packaging>
jar
</packaging>
<!-- <parent> -->
<!-- <groupId>com.ibeetl</groupId> -->
<!-- <artifactId>admin</artifactId> -->
<!-- <version>1.1.1</version> -->
<!-- </parent> -->
<parent>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-cloud
</artifactId>
<version>
1.1.
1
</version>
<version>
1.1.
2
</version>
</parent>
<dependencies>
<dependency>
<groupId>
com.ibeetl
</groupId>
<artifactId>
admin-core
</artifactId>
<version>
1.1.
1
</version>
<version>
1.1.
2
</version>
</dependency>
<dependency>
...
...
admin-console/src/main/resources/sql/console/function.md
View file @
fb395113
...
...
@@ -22,6 +22,6 @@ queryByCondtion
and f.parent_id = #parentFunctionId#
@}
@pageIgnoreTag(){
order by id
desc
order by id
@}
admin-console/src/main/resources/sql/console/menu.md
View file @
fb395113
...
...
@@ -27,7 +27,7 @@ queryByCondtion
@}
@pageIgnoreTag(){
order by m.
seq asc , m.id desc
order by m.
id
@}
...
...
admin-console/src/main/resources/sql/console/org.md
View file @
fb395113
...
...
@@ -23,6 +23,10 @@ queryByCondtion
@if(!isEmpty(parentOrgId)){
and o.parent_org_id = #parentOrgId#
@}
@pageIgnoreTag(){
order by o.id
@}
...
...
admin-console/src/main/resources/static/js/admin/function/del.js
View file @
fb395113
layui
.
define
([
'
table
'
,
'
functionApi
'
],
function
(
exports
)
{
layui
.
define
([
'
table
'
,
'
functionApi
'
,
'
treeGrid
'
],
function
(
exports
)
{
var
functionApi
=
layui
.
functionApi
;
var
table
=
layui
.
table
;
var
treeGrid
=
layui
.
treeGrid
;
var
view
=
{
init
:
function
(){
},
delBatch
:
function
(){
var
data
=
Common
.
getMoreDataFromTable
(
t
able
,
"
functionTable
"
);
var
data
=
Common
.
getMoreDataFromTable
(
t
reeGrid
,
"
functionTable
"
);
if
(
data
==
null
){
return
;
}
...
...
admin-console/src/main/resources/static/js/admin/function/index.js
View file @
fb395113
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
table
=
layui
.
table
;
var
functionTable
=
null
;
var
view
=
{
init
:
function
(){
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
(){
Lib
.
doSearchForm
(
$
(
"
#functionSearchForm
"
),
functionTable
)
}
},
initTable
:
function
(){
functionTable
=
table
.
render
({
elem
:
'
#functionTable
'
,
height
:
'
full-280
'
,
method
:
'
post
'
,
url
:
Common
.
ctxPath
+
'
/admin/function/list.json
'
//数据接口
,
page
:
{
"
layout
"
:[
'
count
'
,
'
prev
'
,
'
page
'
,
'
next
'
]}
//开启分页
,
limit
:
10
,
cols
:
[
[
//表头
{
type
:
'
checkbox
'
,
fixed
:
'
left
'
,
},
{
field
:
'
id
'
,
title
:
'
id
'
,
width
:
80
,
fixed
:
'
left
'
,
sort
:
true
},
{
field
:
'
code
'
,
title
:
'
功能代码
'
,
width
:
150
},
{
field
:
'
name
'
,
title
:
'
功能名称
'
,
width
:
150
,
sort
:
true
},
{
field
:
'
accessUrl
'
,
title
:
'
访问地址
'
,
width
:
300
,
sort
:
true
},
{
field
:
'
parentFunctionText
'
,
title
:
'
上一级功能
'
,
width
:
120
,
sort
:
true
},{
field
:
'
typeText
'
,
title
:
'
功能类型
'
,
width
:
120
,
sort
:
true
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
120
,
templet
:
function
(
d
){
return
Common
.
getDate
(
d
.
createTime
);
},
sort
:
true
}
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
,
'
treeGrid
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
table
=
layui
.
table
;
var
treeGrid
=
layui
.
treeGrid
;
var
functionTable
=
null
;
var
view
=
{
]
]
init
:
function
()
{
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
()
{
Lib
.
doSearchForm
(
$
(
"
#functionSearchForm
"
),
functionTable
)
}
});
},
initSearchForm
:
function
(){
Lib
.
initSearchForm
(
$
(
"
#functionSearchForm
"
),
functionTable
,
form
);
},
initToolBar
:
function
(){
toolbar
=
{
add
:
function
()
{
//获取选中数据
var
url
=
"
/admin/function/add.do
"
;
Common
.
openDlg
(
url
,
"
功能点管理>新增
"
);
},
edit
:
function
()
{
//获取选中数目
var
data
=
Common
.
getOneFromTable
(
table
,
"
functionTable
"
);
if
(
data
==
null
){
return
;
}
var
url
=
"
/admin/function/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
功能点管理>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
(){
var
delView
=
layui
.
del
delView
.
delBatch
();
});
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
}
exports
(
'
index
'
,
view
);
},
initTable
:
function
()
{
functionTable
=
treeGrid
.
render
({
elem
:
'
#functionTable
'
,
height
:
Lib
.
getTableHeight
(
4
),
url
:
Common
.
ctxPath
+
'
/admin/function/list.json
'
,
method
:
'
post
'
,
treeId
:
'
id
'
,
//树形id字段名称
treeUpId
:
'
parentId
'
,
//树形父id字段名称
treeShowName
:
'
name
'
,
//以树形式显示的字段
cols
:
[[
//表头
{
type
:
'
numbers
'
,
title
:
'
序号
'
},
{
type
:
'
checkbox
'
,
// fixed: 'left'
},
{
field
:
'
name
'
,
title
:
'
功能名称
'
,
width
:
150
},
{
field
:
'
typeText
'
,
title
:
'
功能类型
'
,
width
:
120
,
align
:
'
center
'
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
120
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
return
Common
.
getDate
(
d
.
createTime
);
}
},
{
field
:
'
id
'
,
title
:
'
id
'
,
align
:
'
center
'
,
width
:
80
}
]],
done
:
function
(
res
,
curr
,
count
)
{
$
(
"
[data-field='id']
"
).
css
(
'
display
'
,
'
none
'
);
},
page
:
false
});
// functionTable = table.render({
// elem : '#functionTable',
// height : 'full-280',
// method : 'post',
// url : Common.ctxPath + '/admin/function/list.json' //数据接口
// ,page : {"layout":['count','prev', 'page', 'next']} //开启分页
// ,limit : 10,
// cols : [ [ //表头
// {
// type : 'checkbox',
// fixed:'left',
// },
// {
// field : 'id',
// title : 'id',
// width : 80,
// fixed:'left',
// sort : true
// }, {
// field : 'code',
// title : '功能代码',
// width : 150
// }, {
// field : 'name',
// title : '功能名称',
// width : 150,
// sort : true
// }, {
// field : 'accessUrl',
// title : '访问地址',
// width : 300,
// sort : true
// }, {
// field : 'parentFunctionText',
// title : '上一级功能',
// width : 120,
// sort : true
// },{
// field : 'typeText',
// title : '功能类型',
// width : 120,
// sort : true
// },
// {
// field : 'createTime',
// title : '创建时间',
// width : 120,
// templet:function(d){
// return Common.getDate(d.createTime);
// },
// sort : true
// }
//
// ] ]
//
// });
},
initSearchForm
:
function
()
{
Lib
.
initSearchForm
(
$
(
"
#functionSearchForm
"
),
functionTable
,
form
);
},
initToolBar
:
function
()
{
toolbar
=
{
add
:
function
()
{
//获取选中数据
var
url
=
"
/admin/function/add.do
"
;
Common
.
openDlg
(
url
,
"
功能点管理>新增
"
);
},
edit
:
function
()
{
//获取选中数目
var
data
=
Common
.
getOneFromTable
(
treeGrid
,
"
functionTable
"
);
if
(
data
==
null
)
{
return
;
}
var
url
=
"
/admin/function/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
功能点管理>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
()
{
var
delView
=
layui
.
del
;
delView
.
delBatch
();
});
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
};
exports
(
'
index
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/menu/del.js
View file @
fb395113
layui
.
define
([
'
table
'
,
'
menuApi
'
],
function
(
exports
)
{
layui
.
define
([
'
table
'
,
'
menuApi
'
,
'
treeGrid
'
],
function
(
exports
)
{
var
menuApi
=
layui
.
menuApi
;
var
table
=
layui
.
table
;
var
treeGrid
=
layui
.
treeGrid
;
var
view
=
{
init
:
function
(){
},
delBatch
:
function
(){
var
data
=
Common
.
getMoreDataFromTable
(
t
able
,
"
menuTable
"
);
var
data
=
Common
.
getMoreDataFromTable
(
t
reeGrid
,
"
menuTable
"
);
if
(
data
==
null
){
return
;
}
...
...
admin-console/src/main/resources/static/js/admin/menu/index.js
View file @
fb395113
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
table
=
layui
.
table
;
var
menuTable
=
null
;
var
view
=
{
init
:
function
(){
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
(){
Lib
.
doSearchForm
(
$
(
"
#menuSearchForm
"
),
menuTable
)
}
},
initTable
:
function
(){
menuTable
=
table
.
render
({
elem
:
'
#menuTable
'
,
height
:
'
full-280
'
,
method
:
'
post
'
,
url
:
Common
.
ctxPath
+
'
/admin/menu/list.json
'
//数据接口
,
page
:
{
"
layout
"
:[
'
count
'
,
'
prev
'
,
'
page
'
,
'
next
'
]}
//开启分页
,
limit
:
10
,
cols
:
[
[
//表头
{
type
:
'
checkbox
'
,
fixed
:
'
left
'
,
},
{
field
:
'
id
'
,
title
:
'
id
'
,
width
:
80
,
fixed
:
'
left
'
,
sort
:
true
},
{
field
:
'
code
'
,
title
:
'
菜单代码
'
,
width
:
120
},
{
field
:
'
name
'
,
title
:
'
菜单名称
'
,
width
:
120
,
sort
:
true
},
{
field
:
'
accessUrl
'
,
title
:
'
菜单入口地址
'
,
width
:
250
,
sort
:
true
}
,
{
field
:
'
icon
'
,
title
:
'
图标
'
,
width
:
80
},{
field
:
'
seq
'
,
title
:
'
排序
'
,
width
:
80
,
sort
:
true
},{
field
:
'
parentMenuName
'
,
title
:
'
上一级菜单
'
,
width
:
120
,
sort
:
true
},{
field
:
'
typeText
'
,
title
:
'
菜单类型
'
,
width
:
100
,
sort
:
true
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
120
,
templet
:
function
(
d
){
return
Common
.
getDate
(
d
.
createTime
);
},
sort
:
true
}
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
treeGrid
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
// var table = layui.table;
var
treeGrid
=
layui
.
treeGrid
;
var
menuTable
=
null
;
var
view
=
{
]
]
init
:
function
()
{
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
()
{
Lib
.
doSearchForm
(
$
(
"
#menuSearchForm
"
),
menuTable
)
}
});
},
initSearchForm
:
function
(){
Lib
.
initSearchForm
(
$
(
"
#menuSearchForm
"
),
menuTable
,
form
);
},
initToolBar
:
function
(){
toolbar
=
{
add
:
function
()
{
//获取选中数据
var
url
=
"
/admin/menu/add.do
"
;
Common
.
openDlg
(
url
,
"
菜单管理>新增
"
);
},
edit
:
function
()
{
//获取选中数目
var
data
=
Common
.
getOneFromTable
(
table
,
"
menuTable
"
);
if
(
data
==
null
){
return
;
}
var
url
=
"
/admin/menu/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
菜单管理>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
(){
var
delView
=
layui
.
del
delView
.
delBatch
();
});
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
}
exports
(
'
index
'
,
view
);
},
initTable
:
function
()
{
menuTable
=
treeGrid
.
render
({
elem
:
'
#menuTable
'
,
height
:
Lib
.
getTableHeight
(
4
),
url
:
Common
.
ctxPath
+
'
/admin/menu/list.json
'
,
method
:
'
post
'
,
cellMinWidth
:
100
,
treeId
:
'
id
'
,
//树形id字段名称
treeUpId
:
'
parentMenuId
'
,
//树形父id字段名称
treeShowName
:
'
name
'
,
//以树形式显示的字段
cols
:
[[
//表头
// {type: 'numbers', title: '序号', fixed: 'left'},
{
type
:
'
numbers
'
,
title
:
'
序号
'
},
{
type
:
'
checkbox
'
,
// fixed: 'left'
},
{
field
:
'
name
'
,
title
:
'
菜单名称
'
,
width
:
200
},
{
field
:
'
typeText
'
,
title
:
'
菜单类型
'
,
width
:
100
,
align
:
'
center
'
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
120
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
return
Common
.
getDate
(
d
.
createTime
);
}
},
{
field
:
'
id
'
,
title
:
'
id
'
,
width
:
80
,
align
:
'
center
'
}
]],
done
:
function
(
res
,
curr
,
count
)
{
$
(
"
[data-field='id']
"
).
css
(
'
display
'
,
'
none
'
);
},
page
:
false
});
// menuTable = table.render({
// elem : '#menuTable',
// height : 'full-280',
// method : 'post',
// url : Common.ctxPath + '/admin/menu/list.json' //数据接口
// ,page : {"layout":['count','prev', 'page', 'next']} //开启分页
// ,limit : 10,
// cols : [ [ //表头
// {
// type : 'checkbox',
// fixed:'left',
// },
// {
// field : 'id',
// title : 'id',
// width : 80,
// fixed:'left',
// sort : true
// }, {
// field : 'code',
// title : '菜单代码',
// width : 120
// }, {
// field : 'name',
// title : '菜单名称',
// width : 120,
// sort : true
// }, {
// field : 'accessUrl',
// title : '菜单入口地址',
// width : 250,
// sort : true
// } , {
// field : 'icon',
// title : '图标',
// width : 80
// },{
// field : 'seq',
// title : '排序',
// width : 80,
// sort : true
// },{
// field : 'parentMenuName',
// title : '上一级菜单',
// width : 120,
// sort : true
// },{
// field : 'typeText',
// title : '菜单类型',
// width : 100,
// sort : true
// },
// {
// field : 'createTime',
// title : '创建时间',
// width : 120,
// templet:function(d){
// return Common.getDate(d.createTime);
// },
// sort : true
// }
//
// ] ]
//
// });
},
initSearchForm
:
function
()
{
Lib
.
initSearchForm
(
$
(
"
#menuSearchForm
"
),
menuTable
,
form
);
},
initToolBar
:
function
()
{
toolbar
=
{
add
:
function
()
{
//获取选中数据
var
url
=
"
/admin/menu/add.do
"
;
Common
.
openDlg
(
url
,
"
菜单管理>新增
"
);
},
edit
:
function
()
{
//获取选中数目
var
data
=
Common
.
getOneFromTable
(
treeGrid
,
"
menuTable
"
);
if
(
data
==
null
)
{
return
;
}
var
url
=
"
/admin/menu/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
菜单管理>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
()
{
var
delView
=
layui
.
del
;
delView
.
delBatch
();
});
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
};
exports
(
'
index
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/static/js/admin/org/del.js
View file @
fb395113
layui
.
define
([
'
table
'
,
'
orgApi
'
],
function
(
exports
)
{
layui
.
define
([
'
table
'
,
'
orgApi
'
,
'
treeGrid
'
],
function
(
exports
)
{
var
orgApi
=
layui
.
orgApi
;
var
table
=
layui
.
table
;
var
treeGrid
=
layui
.
treeGrid
;
var
view
=
{
init
:
function
(){
},
delBatch
:
function
(){
var
data
=
Common
.
getMoreDataFromTable
(
t
able
,
"
orgTable
"
);
var
data
=
Common
.
getMoreDataFromTable
(
t
reeGrid
,
"
orgTable
"
);
if
(
data
==
null
){
return
;
}
...
...
admin-console/src/main/resources/static/js/admin/org/index.js
View file @
fb395113
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
var
table
=
layui
.
table
;
var
userTable
=
null
;
var
view
=
{
init
:
function
(){
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
(){
Lib
.
doSearchForm
(
$
(
"
#orgSearchForm
"
),
userTable
)
}
},
initTable
:
function
(){
userTable
=
table
.
render
({
elem
:
'
#orgTable
'
,
height
:
Lib
.
getTableHeight
(
2
),
method
:
'
post
'
,
url
:
Common
.
ctxPath
+
'
/admin/org/list.json
'
//数据接口
,
page
:
{
"
layout
"
:[
'
count
'
,
'
prev
'
,
'
page
'
,
'
next
'
]}
//开启分页
,
limit
:
10
,
cols
:
[
[
//表头
{
type
:
'
checkbox
'
,
fixed
:
'
left
'
,
},
{
field
:
'
id
'
,
title
:
'
id
'
,
width
:
80
,
fixed
:
'
left
'
,
sort
:
true
},
{
field
:
'
code
'
,
title
:
'
机构代码
'
,
width
:
150
},
{
field
:
'
name
'
,
title
:
'
机构名称
'
,
width
:
120
,
sort
:
true
},
{
field
:
'
parentOrgText
'
,
title
:
'
上一级机构
'
,
width
:
150
,
sort
:
true
},
{
field
:
'
typeText
'
,
title
:
'
机构类型
'
,
width
:
120
,
sort
:
true
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
120
,
templet
:
function
(
d
){
return
Common
.
getDate
(
d
.
createTime
);
},
sort
:
true
}
]
]
});
},
initSearchForm
:
function
(){
Lib
.
initSearchForm
(
$
(
"
#orgSearchForm
"
),
userTable
,
form
);
},
initToolBar
:
function
(){
toolbar
=
{
add
:
function
()
{
//获取选中数据
var
url
=
"
/admin/org/add.do
"
;
Common
.
openDlg
(
url
,
"
用户管理>新增
"
);
},
edit
:
function
()
{
//获取选中数目
var
data
=
Common
.
getOneFromTable
(
table
,
"
orgTable
"
);
if
(
data
==
null
){
return
;
}
var
url
=
"
/admin/org/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
用户管理>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
(){
var
delView
=
layui
.
del
delView
.
delBatch
();
});
},
orgUser
:
function
()
{
var
data
=
Common
.
getOneFromTable
(
table
,
"
orgTable
"
);
if
(
data
==
null
){
return
;
}
var
url
=
"
/admin/org/user/list.do?orgId=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
组织管理>用户列表
"
);
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
}
exports
(
'
index
'
,
view
);
layui
.
define
([
'
form
'
,
'
laydate
'
,
'
table
'
,
'
treeGrid
'
],
function
(
exports
)
{
var
form
=
layui
.
form
;
var
laydate
=
layui
.
laydate
;
// var table = layui.table;
var
treeGrid
=
layui
.
treeGrid
;
var
userTable
=
null
;
var
view
=
{
init
:
function
()
{
this
.
initTable
();
this
.
initSearchForm
();
this
.
initToolBar
();
window
.
dataReload
=
function
()
{
Lib
.
doSearchForm
(
$
(
"
#orgSearchForm
"
),
userTable
)
}
},
initTable
:
function
()
{
userTable
=
treeGrid
.
render
({
elem
:
'
#orgTable
'
,
height
:
Lib
.
getTableHeight
(
4
),
url
:
Common
.
ctxPath
+
'
/admin/org/list.json
'
,
method
:
'
post
'
,
cellMinWidth
:
100
,
treeId
:
'
id
'
,
//树形id字段名称
treeUpId
:
'
parentOrgId
'
,
//树形父id字段名称
treeShowName
:
'
name
'
,
//以树形式显示的字段
cols
:
[[
//表头
// {type: 'numbers', title: '序号', fixed: 'left'},
{
type
:
'
numbers
'
,
title
:
'
序号
'
},
{
type
:
'
checkbox
'
,
// fixed: 'left'
// fixed: 'left'
},
{
field
:
'
name
'
,
title
:
'
机构名称
'
,
width
:
500
},
{
field
:
'
typeText
'
,
title
:
'
机构类型
'
,
width
:
120
,
align
:
'
center
'
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
120
,
align
:
'
center
'
,
templet
:
function
(
d
)
{
return
Common
.
getDate
(
d
.
createTime
);
}
},
{
field
:
'
id
'
,
title
:
'
id
'
,
width
:
50
,
align
:
'
center
'
}
]],
done
:
function
(
res
,
curr
,
count
)
{
$
(
"
[data-field='id']
"
).
css
(
'
display
'
,
'
none
'
);
},
page
:
false
});
},
initSearchForm
:
function
()
{
Lib
.
initSearchForm
(
$
(
"
#orgSearchForm
"
),
userTable
,
form
);
},
initToolBar
:
function
()
{
toolbar
=
{
add
:
function
()
{
//获取选中数据
var
url
=
"
/admin/org/add.do
"
;
Common
.
openDlg
(
url
,
"
用户管理>新增
"
);
},
edit
:
function
()
{
//获取选中数目
var
data
=
Common
.
getOneFromTable
(
treeGrid
,
"
orgTable
"
);
if
(
data
==
null
)
{
return
;
}
var
url
=
"
/admin/org/edit.do?id=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
用户管理>编辑
"
);
},
del
:
function
()
{
layui
.
use
([
'
del
'
],
function
()
{
var
delView
=
layui
.
del
;
delView
.
delBatch
();
});
},
orgUser
:
function
()
{
var
data
=
Common
.
getOneFromTable
(
treeGrid
,
"
orgTable
"
);
if
(
data
==
null
)
{
return
;
}
var
url
=
"
/admin/org/user/list.do?orgId=
"
+
data
.
id
;
Common
.
openDlg
(
url
,
"
组织管理>用户列表
"
);
}
};
$
(
'
.ext-toolbar
'
).
on
(
'
click
'
,
function
()
{
var
type
=
$
(
this
).
data
(
'
type
'
);
toolbar
[
type
]
?
toolbar
[
type
].
call
(
this
)
:
''
;
});
}
};
exports
(
'
index
'
,
view
);
});
\ No newline at end of file
admin-console/src/main/resources/templates/admin/function/add.html
View file @
fb395113
...
...
@@ -20,7 +20,7 @@
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
功能地址
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"accessUrl"
lay-verify=
"required"
<input
type=
"text"
name=
"accessUrl"
placeholder=
"请输入"
autocomplete=
"off"
class=
"layui-input"
value=
""
>
</div>
...
...
admin-console/src/main/resources/templates/admin/function/edit.html
View file @
fb395113
...
...
@@ -20,7 +20,7 @@
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
功能地址
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"accessUrl"
lay-verify=
"required"
<input
type=
"text"
name=
"accessUrl"
placeholder=
"请输入"
autocomplete=
"off"
class=
"layui-input"
value=
"${function.accessUrl}"
>
</div>
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
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