Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doc_wei
Skyeye
提交
951fb515
S
Skyeye
项目概览
doc_wei
/
Skyeye
通知
1195
Star
154
Fork
127
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Skyeye
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
951fb515
编写于
10月 29, 2018
作者:
doc_wei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码生成器模板分组完成
上级
099d8d94
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
799 addition
and
0 deletion
+799
-0
skyeye-common/src/main/java/com/skyeye/common/util/ToolUtil.java
...common/src/main/java/com/skyeye/common/util/ToolUtil.java
+21
-0
skyeye-dao/src/main/java/com/skyeye/codemodel/dao/CodeModelGroupDao.java
...main/java/com/skyeye/codemodel/dao/CodeModelGroupDao.java
+26
-0
skyeye-service/src/main/java/com/skyeye/codemodel/service/CodeModelGroupService.java
...a/com/skyeye/codemodel/service/CodeModelGroupService.java
+18
-0
skyeye-service/src/main/java/com/skyeye/codemodel/service/impl/CodeModelGroupServiceImpl.java
...eye/codemodel/service/impl/CodeModelGroupServiceImpl.java
+134
-0
skyeye-web/src/main/java/com/skyeye/codemodel/controller/CodeModelGroupController.java
...skyeye/codemodel/controller/CodeModelGroupController.java
+98
-0
skyeye-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml
...-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml
+91
-0
skyeye-web/src/main/resources/mapping/reqmapping.xml
skyeye-web/src/main/resources/mapping/reqmapping.xml
+24
-0
skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgroupadd.js
...eb/src/main/webapp/js/codemodelgroup/codemodelgroupadd.js
+58
-0
skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgroupedit.js
...b/src/main/webapp/js/codemodelgroup/codemodelgroupedit.js
+73
-0
skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js
...b/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js
+115
-0
skyeye-web/src/main/webapp/toolUtil.txt
skyeye-web/src/main/webapp/toolUtil.txt
+1
-0
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgroupadd.html
...src/main/webapp/tpl/codemodelgroup/codemodelgroupadd.html
+41
-0
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgroupedit.html
...rc/main/webapp/tpl/codemodelgroup/codemodelgroupedit.html
+24
-0
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgroupeditTemplate.tpl
.../webapp/tpl/codemodelgroup/codemodelgroupeditTemplate.tpl
+20
-0
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgrouplist.html
...rc/main/webapp/tpl/codemodelgroup/codemodelgrouplist.html
+55
-0
未找到文件。
skyeye-common/src/main/java/com/skyeye/common/util/ToolUtil.java
浏览文件 @
951fb515
...
...
@@ -10,6 +10,7 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Random
;
import
java.util.UUID
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
...
...
@@ -432,6 +433,26 @@ public class ToolUtil {
}
}
/**
* 随机不重复的6-8位
* @return
*/
public
static
int
card
()
{
int
[]
array
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
Random
rand
=
new
Random
();
for
(
int
i
=
10
;
i
>
1
;
i
--)
{
int
index
=
rand
.
nextInt
(
i
);
int
tmp
=
array
[
index
];
array
[
index
]
=
array
[
i
-
1
];
array
[
i
-
1
]
=
tmp
;
}
int
result
=
0
;
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
result
=
result
*
10
+
array
[
i
];
}
return
result
;
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
str
=
"123456"
;
for
(
int
i
=
0
;
i
<
5
;
i
++){
...
...
skyeye-dao/src/main/java/com/skyeye/codemodel/dao/CodeModelGroupDao.java
0 → 100644
浏览文件 @
951fb515
package
com.skyeye.codemodel.dao
;
import
java.util.List
;
import
java.util.Map
;
import
com.github.miemiedev.mybatis.paginator.domain.PageBounds
;
public
interface
CodeModelGroupDao
{
public
List
<
Map
<
String
,
Object
>>
queryCodeModelGroupList
(
Map
<
String
,
Object
>
map
,
PageBounds
pageBounds
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryCodeModelGroupMationByName
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
insertCodeModelGroupMation
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryCodeModelNumById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
deleteCodeModelGroupById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryCodeModelGroupMationToEditById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
Map
<
String
,
Object
>
queryCodeModelGroupMationByIdAndName
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
public
int
editCodeModelGroupMationById
(
Map
<
String
,
Object
>
map
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/codemodel/service/CodeModelGroupService.java
0 → 100644
浏览文件 @
951fb515
package
com.skyeye.codemodel.service
;
import
com.skyeye.common.object.InputObject
;
import
com.skyeye.common.object.OutputObject
;
public
interface
CodeModelGroupService
{
public
void
queryCodeModelGroupList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
insertCodeModelGroupMation
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
deleteCodeModelGroupById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
queryCodeModelGroupMationToEditById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
public
void
editCodeModelGroupMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
;
}
skyeye-service/src/main/java/com/skyeye/codemodel/service/impl/CodeModelGroupServiceImpl.java
0 → 100644
浏览文件 @
951fb515
package
com.skyeye.codemodel.service.impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.miemiedev.mybatis.paginator.domain.PageBounds
;
import
com.github.miemiedev.mybatis.paginator.domain.PageList
;
import
com.skyeye.codemodel.dao.CodeModelGroupDao
;
import
com.skyeye.codemodel.service.CodeModelGroupService
;
import
com.skyeye.common.object.InputObject
;
import
com.skyeye.common.object.OutputObject
;
import
com.skyeye.common.util.ToolUtil
;
@Service
public
class
CodeModelGroupServiceImpl
implements
CodeModelGroupService
{
@Autowired
private
CodeModelGroupDao
codeModelGroupDao
;
/**
*
* @Title: queryCodeModelGroupList
* @Description: 获取模板分组列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
queryCodeModelGroupList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
List
<
Map
<
String
,
Object
>>
beans
=
codeModelGroupDao
.
queryCodeModelGroupList
(
map
,
new
PageBounds
(
Integer
.
parseInt
(
map
.
get
(
"page"
).
toString
()),
Integer
.
parseInt
(
map
.
get
(
"limit"
).
toString
())));
PageList
<
Map
<
String
,
Object
>>
beansPageList
=
(
PageList
<
Map
<
String
,
Object
>>)
beans
;
int
total
=
beansPageList
.
getPaginator
().
getTotalCount
();
outputObject
.
setBeans
(
beans
);
outputObject
.
settotal
(
total
);
}
/**
*
* @Title: insertCodeModelGroupMationMation
* @Description: 新增模板分组列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
insertCodeModelGroupMation
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
bean
=
codeModelGroupDao
.
queryCodeModelGroupMationByName
(
map
);
if
(
bean
==
null
){
Map
<
String
,
Object
>
user
=
inputObject
.
getLogParams
();
map
.
put
(
"id"
,
ToolUtil
.
getSurFaceId
());
map
.
put
(
"createId"
,
user
.
get
(
"id"
));
map
.
put
(
"createTime"
,
ToolUtil
.
getTimeAndToString
());
map
.
put
(
"groupNum"
,
ToolUtil
.
card
());
codeModelGroupDao
.
insertCodeModelGroupMation
(
map
);
}
else
{
outputObject
.
setreturnMessage
(
"该模板分组已存在,请更换。"
);
}
}
/**
*
* @Title: deleteCodeModelGroupMationMationById
* @Description: 删除模板分组信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
deleteCodeModelGroupById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
bean
=
codeModelGroupDao
.
queryCodeModelNumById
(
map
);
if
(
bean
==
null
){
codeModelGroupDao
.
deleteCodeModelGroupById
(
map
);
}
else
{
if
(
Integer
.
parseInt
(
bean
.
get
(
"modelNum"
).
toString
())
==
0
){
//该模板分组下没有模板
codeModelGroupDao
.
deleteCodeModelGroupById
(
map
);
}
else
{
outputObject
.
setreturnMessage
(
"该模板分组下存在模板,无法删除。"
);
}
}
}
/**
*
* @Title: queryCodeModelGroupMationMationToEditById
* @Description: 编辑模板分组信息时进行回显
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
queryCodeModelGroupMationToEditById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
bean
=
codeModelGroupDao
.
queryCodeModelGroupMationToEditById
(
map
);
outputObject
.
setBean
(
bean
);
outputObject
.
settotal
(
1
);
}
/**
*
* @Title: editCodeModelGroupMationMationById
* @Description: 编辑模板分组信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public
void
editCodeModelGroupMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
inputObject
.
getParams
();
Map
<
String
,
Object
>
bean
=
codeModelGroupDao
.
queryCodeModelGroupMationByIdAndName
(
map
);
if
(
bean
==
null
){
codeModelGroupDao
.
editCodeModelGroupMationById
(
map
);
}
else
{
outputObject
.
setreturnMessage
(
"该模板分组已存在,请更换。"
);
}
}
}
skyeye-web/src/main/java/com/skyeye/codemodel/controller/CodeModelGroupController.java
0 → 100644
浏览文件 @
951fb515
package
com.skyeye.codemodel.controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.skyeye.codemodel.service.CodeModelGroupService
;
import
com.skyeye.common.object.InputObject
;
import
com.skyeye.common.object.OutputObject
;
@Controller
public
class
CodeModelGroupController
{
@Autowired
private
CodeModelGroupService
codeModelGroupService
;
/**
*
* @Title: queryCodeModelGroupList
* @Description: 获取模板分组列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/CodeModelGroupController/queryCodeModelGroupList"
)
@ResponseBody
public
void
queryCodeModelGroupList
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
codeModelGroupService
.
queryCodeModelGroupList
(
inputObject
,
outputObject
);
}
/**
*
* @Title: insertCodeModelGroupMation
* @Description: 新增模板分组列表
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/CodeModelGroupController/insertCodeModelGroupMation"
)
@ResponseBody
public
void
insertCodeModelGroupMation
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
codeModelGroupService
.
insertCodeModelGroupMation
(
inputObject
,
outputObject
);
}
/**
*
* @Title: deleteCodeModelGroupById
* @Description: 删除模板分组信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/CodeModelGroupController/deleteCodeModelGroupById"
)
@ResponseBody
public
void
deleteCodeModelGroupById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
codeModelGroupService
.
deleteCodeModelGroupById
(
inputObject
,
outputObject
);
}
/**
*
* @Title: queryCodeModelGroupMationToEditById
* @Description: 编辑模板分组信息时进行回显
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/CodeModelGroupController/queryCodeModelGroupMationToEditById"
)
@ResponseBody
public
void
queryCodeModelGroupMationToEditById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
codeModelGroupService
.
queryCodeModelGroupMationToEditById
(
inputObject
,
outputObject
);
}
/**
*
* @Title: editCodeModelGroupMationById
* @Description: 编辑模板分组信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping
(
"/post/CodeModelGroupController/editCodeModelGroupMationById"
)
@ResponseBody
public
void
editCodeModelGroupMationById
(
InputObject
inputObject
,
OutputObject
outputObject
)
throws
Exception
{
codeModelGroupService
.
editCodeModelGroupMationById
(
inputObject
,
outputObject
);
}
}
skyeye-web/src/main/resources/dbmapper/CodeModelGroupMapper.xml
0 → 100644
浏览文件 @
951fb515
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.skyeye.codemodel.dao.CodeModelGroupDao"
>
<select
id=
"queryCodeModelGroupList"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.group_name groupName,
a.group_num groupNum,
a.group_desc groupDesc,
CONVERT(a.create_time, char) createTime,
(SELECT COUNT(*) FROM code_model b WHERE b.group_id = a.id) modelNum
FROM
code_model_group a
WHERE 1 = 1
<if
test=
"groupName != '' and groupName != null"
>
AND a.group_name LIKE '%${groupName}%'
</if>
<if
test=
"groupNum != '' and groupNum != null"
>
AND a.group_num LIKE '%${groupNum}%'
</if>
ORDER BY a.create_time DESC
</select>
<select
id=
"queryCodeModelGroupMationByName"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.group_name groupName
FROM
code_model_group a
WHERE a.group_name = #{groupName}
</select>
<insert
id=
"insertCodeModelGroupMation"
parameterType=
"java.util.Map"
>
INSERT into code_model_group
(id, group_name, group_num, group_desc, create_id, create_time)
VALUES
(#{id}, #{groupName}, #{groupNum}, #{groupDesc}, #{createId}, #{createTime})
</insert>
<select
id=
"queryCodeModelNumById"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
COUNT(*) modelNum
FROM
code_model b
WHERE
b.group_id = #{id}
</select>
<delete
id=
"deleteCodeModelGroupById"
parameterType=
"java.util.Map"
>
DELETE
FROM
code_model_group
WHERE
id = #{id}
</delete>
<select
id=
"queryCodeModelGroupMationToEditById"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.group_name groupName,
a.group_desc groupDesc
FROM
code_model_group a
WHERE a.id = #{id}
</select>
<select
id=
"queryCodeModelGroupMationByIdAndName"
parameterType=
"java.util.Map"
resultType=
"java.util.Map"
>
SELECT
a.id,
a.group_name groupName
FROM
code_model_group a
WHERE a.id != #{id}
AND a.group_name = #{rmTypeName}
</select>
<update
id=
"editCodeModelGroupMationById"
parameterType=
"java.util.Map"
>
UPDATE code_model_group
<set>
<if
test=
"groupName != '' and groupName != null"
>
group_name = #{groupName},
</if>
<if
test=
"groupDesc != '' and groupDesc != null"
>
group_desc = #{groupDesc},
</if>
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
skyeye-web/src/main/resources/mapping/reqmapping.xml
浏览文件 @
951fb515
...
...
@@ -281,4 +281,28 @@
<!-- 小程序系列结束 -->
<!-- 代码生成器系列开始 -->
<url
id=
"codemodel001"
path=
"/post/CodeModelGroupController/queryCodeModelGroupList"
val=
"获取模板分组列表"
allUse=
"1"
>
<property
id=
"limit"
name=
"limit"
ref=
"required,num"
var=
"分页参数,每页多少条数据"
/>
<property
id=
"page"
name=
"page"
ref=
"required,num"
var=
"分页参数,第几页"
/>
<property
id=
"groupName"
name=
"groupName"
ref=
""
var=
"分组名称"
/>
<property
id=
"groupNum"
name=
"groupNum"
ref=
""
var=
"分组编号"
/>
</url>
<url
id=
"codemodel002"
path=
"/post/CodeModelGroupController/insertCodeModelGroupMation"
val=
"新增模板分组列表"
allUse=
"1"
>
<property
id=
"groupDesc"
name=
"groupDesc"
ref=
"required"
var=
"分组简介"
/>
<property
id=
"groupName"
name=
"groupName"
ref=
"required"
var=
"分组名称"
/>
</url>
<url
id=
"codemodel003"
path=
"/post/CodeModelGroupController/deleteCodeModelGroupById"
val=
"删除模板分组信息"
allUse=
"1"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"分组id"
/>
</url>
<url
id=
"codemodel004"
path=
"/post/CodeModelGroupController/queryCodeModelGroupMationToEditById"
val=
"编辑模板分组信息时进行回显"
allUse=
"1"
>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"分组id"
/>
</url>
<url
id=
"codemodel005"
path=
"/post/CodeModelGroupController/editCodeModelGroupMationById"
val=
"编辑模板分组信息"
allUse=
"1"
>
<property
id=
"groupDesc"
name=
"groupDesc"
ref=
"required"
var=
"分组简介"
/>
<property
id=
"groupName"
name=
"groupName"
ref=
"required"
var=
"分组名称"
/>
<property
id=
"rowId"
name=
"id"
ref=
"required"
var=
"分组id"
/>
</url>
<!-- 代码生成器系列结束 -->
</controller>
\ No newline at end of file
skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgroupadd.js
0 → 100644
浏览文件 @
951fb515
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
}).
define
([
'
table
'
,
'
jquery
'
,
'
winui
'
],
function
(
exports
)
{
winui
.
renderColor
();
layui
.
use
([
'
form
'
,
'
layedit
'
],
function
(
form
)
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//获取窗口索引
var
$
=
layui
.
$
,
form
=
layui
.
form
,
layedit
=
layui
.
layedit
;;
var
layContent
=
layedit
.
build
(
'
groupDesc
'
,
{
tool
:
[
'
strong
'
//加粗
,
'
italic
'
//斜体
,
'
underline
'
//下划线
,
'
del
'
//删除线
,
'
|
'
//分割线
,
'
left
'
//左对齐
,
'
center
'
//居中对齐
,
'
right
'
//右对齐
,
'
link
'
//超链接
,
'
unlink
'
//清除链接
,
'
face
'
//表情
]
});
form
.
render
();
form
.
on
(
'
submit(formAddBean)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
params
=
{
groupName
:
$
(
"
#groupName
"
).
val
(),
groupDesc
:
encodeURI
(
layedit
.
getContent
(
layContent
)),
};
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
codemodel002
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
return
false
;
});
//取消
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
(){
parent
.
layer
.
close
(
index
);
});
});
});
\ No newline at end of file
skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgroupedit.js
0 → 100644
浏览文件 @
951fb515
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
}).
define
([
'
table
'
,
'
jquery
'
,
'
winui
'
],
function
(
exports
)
{
winui
.
renderColor
();
layui
.
use
([
'
form
'
,
'
layedit
'
],
function
(
form
)
{
var
index
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
//获取窗口索引
var
$
=
layui
.
$
,
form
=
layui
.
form
;
layedit
=
layui
.
layedit
;;
showGrid
({
id
:
"
showForm
"
,
url
:
reqBasePath
+
"
codemodel004
"
,
params
:
{
rowId
:
parent
.
rowId
},
pagination
:
false
,
template
:
getFileContent
(
'
tpl/codemodelgroup/codemodelgroupeditTemplate.tpl
'
),
ajaxSendLoadBefore
:
function
(
hdb
){
},
ajaxSendAfter
:
function
(
json
){
var
layContent
=
layedit
.
build
(
'
groupDesc
'
,
{
tool
:
[
'
strong
'
//加粗
,
'
italic
'
//斜体
,
'
underline
'
//下划线
,
'
del
'
//删除线
,
'
|
'
//分割线
,
'
left
'
//左对齐
,
'
center
'
//居中对齐
,
'
right
'
//右对齐
,
'
link
'
//超链接
,
'
unlink
'
//清除链接
,
'
face
'
//表情
]
});
form
.
render
();
form
.
on
(
'
submit(formEditBean)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
var
params
=
{
groupName
:
$
(
"
#groupName
"
).
val
(),
groupDesc
:
encodeURI
(
layedit
.
getContent
(
layContent
)),
rowId
:
parent
.
rowId
};
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
codemodel005
"
,
params
:
params
,
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
parent
.
layer
.
close
(
index
);
parent
.
refreshCode
=
'
0
'
;
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
return
false
;
});
}
});
//取消
$
(
"
body
"
).
on
(
"
click
"
,
"
#cancle
"
,
function
(){
parent
.
layer
.
close
(
index
);
});
});
});
\ No newline at end of file
skyeye-web/src/main/webapp/js/codemodelgroup/codemodelgrouplist.js
0 → 100644
浏览文件 @
951fb515
var
rowId
=
""
;
layui
.
config
({
base
:
basePath
,
version
:
skyeyeVersion
}).
define
([
'
table
'
,
'
jquery
'
,
'
winui
'
,
'
form
'
],
function
(
exports
)
{
winui
.
renderColor
();
var
$
=
layui
.
$
,
form
=
layui
.
form
,
table
=
layui
.
table
;
//表格渲染
table
.
render
({
id
:
'
messageTable
'
,
elem
:
'
#messageTable
'
,
method
:
'
post
'
,
url
:
reqBasePath
+
'
codemodel001
'
,
where
:{
groupName
:
$
(
"
#groupName
"
).
val
(),
groupNum
:
$
(
"
#groupNum
"
).
val
()},
even
:
true
,
//隔行变色
page
:
true
,
limits
:
[
8
,
16
,
24
,
32
,
40
,
48
,
56
],
limit
:
8
,
cols
:
[[
{
title
:
'
序号
'
,
type
:
'
numbers
'
},
{
field
:
'
groupNum
'
,
title
:
'
分组编号
'
,
width
:
120
},
{
field
:
'
groupName
'
,
title
:
'
分组名称
'
,
width
:
120
},
{
field
:
'
groupDesc
'
,
title
:
'
分组简介
'
,
width
:
120
},
{
field
:
'
modelNum
'
,
title
:
'
模板数量
'
,
width
:
120
},
{
field
:
'
createTime
'
,
title
:
'
创建时间
'
,
width
:
180
},
{
title
:
'
操作
'
,
fixed
:
'
right
'
,
align
:
'
center
'
,
width
:
240
,
toolbar
:
'
#tableBar
'
}
]]
});
table
.
on
(
'
tool(messageTable)
'
,
function
(
obj
)
{
//注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
var
data
=
obj
.
data
;
//获得当前行数据
var
layEvent
=
obj
.
event
;
//获得 lay-event 对应的值
if
(
layEvent
===
'
del
'
)
{
//删除
del
(
data
,
obj
);
}
else
if
(
layEvent
===
'
edit
'
)
{
//编辑
edit
(
data
);
}
});
//搜索表单
form
.
render
();
form
.
on
(
'
submit(formSearch)
'
,
function
(
data
)
{
//表单验证
if
(
winui
.
verifyForm
(
data
.
elem
))
{
loadTable
();
}
return
false
;
});
//删除
function
del
(
data
,
obj
){
var
msg
=
obj
?
'
确认删除分组【
'
+
obj
.
data
.
groupName
+
'
】吗?
'
:
'
确认删除选中数据吗?
'
;
layer
.
confirm
(
msg
,
{
icon
:
3
,
title
:
'
删除分组
'
},
function
(
index
)
{
layer
.
close
(
index
);
//向服务端发送删除指令
AjaxPostUtil
.
request
({
url
:
reqBasePath
+
"
codemodel003
"
,
params
:{
rowId
:
data
.
id
},
type
:
'
json
'
,
callback
:
function
(
json
){
if
(
json
.
returnCode
==
0
){
top
.
winui
.
window
.
msg
(
"
删除成功
"
,
{
icon
:
1
,
time
:
2000
});
loadTable
();
}
else
{
top
.
winui
.
window
.
msg
(
json
.
returnMessage
,
{
icon
:
2
,
time
:
2000
});
}
}});
});
}
//编辑
function
edit
(
data
){
rowId
=
data
.
id
;
_openNewWindows
({
url
:
"
../../tpl/codemodelgroup/codemodelgroupedit.html
"
,
title
:
"
编辑模块组
"
,
pageId
:
"
codemodelgroupedit
"
,
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
top
.
winui
.
window
.
msg
(
"
操作成功
"
,
{
icon
:
1
,
time
:
2000
});
loadTable
();
}
else
if
(
refreshCode
==
'
-9999
'
)
{
top
.
winui
.
window
.
msg
(
"
操作失败
"
,
{
icon
:
2
,
time
:
2000
});
}
}});
}
//刷新数据
$
(
"
body
"
).
on
(
"
click
"
,
"
#reloadTable
"
,
function
(){
loadTable
();
});
//新增
$
(
"
body
"
).
on
(
"
click
"
,
"
#addBean
"
,
function
(){
_openNewWindows
({
url
:
"
../../tpl/codemodelgroup/codemodelgroupadd.html
"
,
title
:
"
新增模块组
"
,
pageId
:
"
codemodelgroupadd
"
,
callBack
:
function
(
refreshCode
){
if
(
refreshCode
==
'
0
'
)
{
top
.
winui
.
window
.
msg
(
"
操作成功
"
,
{
icon
:
1
,
time
:
2000
});
loadTable
();
}
else
if
(
refreshCode
==
'
-9999
'
)
{
top
.
winui
.
window
.
msg
(
"
操作失败
"
,
{
icon
:
2
,
time
:
2000
});
}
}});
});
function
loadTable
(){
table
.
reload
(
"
messageTable
"
,
{
where
:{
groupName
:
$
(
"
#groupName
"
).
val
(),
groupNum
:
$
(
"
#groupNum
"
).
val
()}});
}
exports
(
'
codemodelgrouplist
'
,
{});
});
skyeye-web/src/main/webapp/toolUtil.txt
浏览文件 @
951fb515
...
...
@@ -20,3 +20,4 @@ allMenuToTree(); 使用递归方法建树
findChildren(); 递归查找子节点
getIPPropertiesPath(); 获取ip.properties路径
deleteFile(); 删除单个文件
card(); 随机不重复的6-8位
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgroupadd.html
0 → 100644
浏览文件 @
951fb515
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title></title>
<link
href=
"../../assets/lib/layui/css/layui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/font-awesome-4.7.0/css/font-awesome.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/layui/lay/modules/ztree/css/zTreeStyle/zTreeStyle.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/layui/lay/modules/contextMenu/jquery.contextMenu.min.css"
rel=
"stylesheet"
/>
</head>
<body>
<div
style=
"width:600px;margin:0 auto;padding-top:20px;"
>
<form
class=
"layui-form"
action=
""
id=
"showForm"
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
分组名称
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"groupName"
name=
"groupName"
win-verify=
"required"
placeholder=
"请输入模块分组名"
class=
"layui-input"
maxlength=
"20"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
分组描述
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<textarea
id=
"groupDesc"
name=
"groupDesc"
style=
"display: none;"
></textarea>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
id=
"cancle"
>
取消
</button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formAddBean"
>
保存
</button>
</div>
</div>
</form>
</div>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
layui
.
config
({
base
:
'
../../js/codemodelgroup/
'
}).
use
(
'
codemodelgroupadd
'
);
</script>
</body>
</html>
\ No newline at end of file
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgroupedit.html
0 → 100644
浏览文件 @
951fb515
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title></title>
<link
href=
"../../assets/lib/layui/css/layui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/font-awesome-4.7.0/css/font-awesome.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/layui/lay/modules/ztree/css/zTreeStyle/zTreeStyle.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/layui/lay/modules/contextMenu/jquery.contextMenu.min.css"
rel=
"stylesheet"
/>
</head>
<body>
<div
style=
"width:600px;margin:0 auto;padding-top:20px;"
>
<form
class=
"layui-form"
action=
""
id=
"showForm"
autocomplete=
"off"
>
</form>
</div>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
layui
.
config
({
base
:
'
../../js/codemodelgroup/
'
}).
use
(
'
codemodelgroupedit
'
);
</script>
</body>
</html>
\ No newline at end of file
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgroupeditTemplate.tpl
0 → 100644
浏览文件 @
951fb515
{{
#
bean
}}
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
分组名称
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
id=
"groupName"
name=
"groupName"
win-verify=
"required"
placeholder=
"请输入模块分组名"
class=
"layui-input"
maxlength=
"20"
value=
"{
{
groupName
}
}"
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
分组描述
<i
class=
"red"
>
*
</i></label>
<div
class=
"layui-input-block"
>
<textarea
id=
"groupDesc"
name=
"groupDesc"
style=
"display: none;"
>
{
{
groupDesc
}
}
</textarea>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"winui-btn"
id=
"cancle"
>
取消
</button>
<button
class=
"winui-btn"
lay-submit
lay-filter=
"formEditBean"
>
保存
</button>
</div>
</div>
{
{/
bean
}
}
\ No newline at end of file
skyeye-web/src/main/webapp/tpl/codemodelgroup/codemodelgrouplist.html
0 → 100644
浏览文件 @
951fb515
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title></title>
<link
href=
"../../assets/lib/layui/css/layui.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/font-awesome-4.7.0/css/font-awesome.css"
rel=
"stylesheet"
/>
<link
href=
"../../assets/lib/winui/css/winui.css"
rel=
"stylesheet"
/>
</head>
<body>
<div
class=
"txtcenter"
style=
"width:700px;margin:0 auto;padding-top:20px;"
>
<form
class=
"layui-form layui-form-pane"
action=
""
autocomplete=
"off"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
分组编号
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"groupNum"
name=
"groupNum"
placeholder=
"请输入分组编号"
class=
"layui-input"
/>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
分组名称
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
id=
"groupName"
name=
"groupName"
placeholder=
"请输入分组名称"
class=
"layui-input"
/>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
style=
"margin:0;"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"formSearch"
>
搜索
</button>
</div>
</div>
</form>
</div>
<div
class=
"winui-toolbar"
>
<div
class=
"winui-tool"
>
<button
id=
"reloadTable"
class=
"winui-toolbtn"
><i
class=
"fa fa-refresh"
aria-hidden=
"true"
></i>
刷新数据
</button>
<button
id=
"addBean"
class=
"winui-toolbtn"
><i
class=
"fa fa-plus"
aria-hidden=
"true"
></i>
新增分组
</button>
</div>
</div>
<div
style=
"margin:auto 10px;"
>
<table
id=
"messageTable"
lay-filter=
"messageTable"
></table>
<script
type=
"text/html"
id=
"tableBar"
>
<
a
class
=
"
layui-btn layui-btn-xs
"
lay
-
event
=
"
edit
"
>
编辑
<
/a
>
{{
#
if
(
d
.
modelNum
==
0
){
}}
<
a
class
=
"
layui-btn layui-btn-danger layui-btn-xs
"
lay
-
event
=
"
del
"
>
删除
<
/a
>
{{
#
}
}}
</script>
</div>
<script
src=
"../../assets/lib/layui/layui.js"
></script>
<script
src=
"../../assets/lib/layui/custom.js"
></script>
<script
type=
"text/javascript"
>
layui
.
config
({
base
:
'
../../js/codemodelgroup/
'
}).
use
(
'
codemodelgrouplist
'
);
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录