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
5c794401
Commit
5c794401
authored
Jun 27, 2019
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加职位的管理
parent
ffb13d1f
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1167 additions
and
9 deletions
+1167
-9
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/controller/PositionController.java
+168
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/entity/Position.java
+177
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/PositionMapper.java
+55
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/mapping/PositionMapper.xml
+79
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/params/PositionParam.java
+78
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/result/PositionResult.java
+72
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/PositionService.java
+69
-0
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/impl/PositionServiceImpl.java
+84
-0
guns-sys/src/main/webapp/assets/modular/system/menu/menu.js
+0
-9
guns-sys/src/main/webapp/assets/modular/system/position/position.js
+150
-0
guns-sys/src/main/webapp/assets/modular/system/position/position_add.js
+47
-0
guns-sys/src/main/webapp/assets/modular/system/position/position_edit.js
+52
-0
guns-sys/src/main/webapp/pages/modular/system/position/position.html
+40
-0
guns-sys/src/main/webapp/pages/modular/system/position/position_add.html
+48
-0
guns-sys/src/main/webapp/pages/modular/system/position/position_edit.html
+48
-0
No files found.
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/controller/PositionController.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
controller
;
import
cn.stylefeng.guns.base.enums.CommonStatus
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.service.PositionService
;
import
cn.stylefeng.roses.core.base.controller.BaseController
;
import
cn.stylefeng.roses.core.reqres.response.ResponseData
;
import
cn.stylefeng.roses.core.reqres.response.SuccessResponseData
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
cn.stylefeng.roses.kernel.model.exception.RequestEmptyException
;
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.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
* 职位表控制器
*
* @author stylefeng
* @Date 2019-06-27 21:33:47
*/
@Controller
@RequestMapping
(
"/position"
)
public
class
PositionController
extends
BaseController
{
private
String
PREFIX
=
"/modular/system/position"
;
@Autowired
private
PositionService
positionService
;
/**
* 跳转到主页面
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
""
)
public
String
index
()
{
return
PREFIX
+
"/position.html"
;
}
/**
* 新增页面
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/add"
)
public
String
add
()
{
return
PREFIX
+
"/position_add.html"
;
}
/**
* 编辑页面
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/edit"
)
public
String
edit
()
{
return
PREFIX
+
"/position_edit.html"
;
}
/**
* 新增接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/addItem"
)
@ResponseBody
public
ResponseData
addItem
(
PositionParam
positionParam
)
{
this
.
positionService
.
add
(
positionParam
);
return
ResponseData
.
success
();
}
/**
* 编辑接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/editItem"
)
@ResponseBody
public
ResponseData
editItem
(
PositionParam
positionParam
)
{
this
.
positionService
.
update
(
positionParam
);
return
ResponseData
.
success
();
}
/**
* 删除接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/delete"
)
@ResponseBody
public
ResponseData
delete
(
PositionParam
positionParam
)
{
this
.
positionService
.
delete
(
positionParam
);
return
ResponseData
.
success
();
}
/**
* 查看详情接口
*
* @author stylefeng
* @Date 2019-06-27
*/
@RequestMapping
(
"/detail"
)
@ResponseBody
public
ResponseData
detail
(
PositionParam
positionParam
)
{
Position
detail
=
this
.
positionService
.
getById
(
positionParam
.
getPositionId
());
return
ResponseData
.
success
(
detail
);
}
/**
* 查询列表
*
* @author stylefeng
* @Date 2019-06-27
*/
@ResponseBody
@RequestMapping
(
"/list"
)
public
LayuiPageInfo
list
(
@RequestParam
(
value
=
"condition"
,
required
=
false
)
String
condition
)
{
PositionParam
positionParam
=
new
PositionParam
();
if
(
ToolUtil
.
isNotEmpty
(
condition
))
{
positionParam
.
setCode
(
condition
);
positionParam
.
setName
(
condition
);
}
return
this
.
positionService
.
findPageBySpec
(
positionParam
);
}
/**
* 修改状态
*
* @author stylefeng
* @Date 2019-06-27
*/
@ResponseBody
@RequestMapping
(
"/changeStatus"
)
public
ResponseData
changeStatus
(
@RequestParam
(
"positionId"
)
String
positionId
,
@RequestParam
(
"status"
)
Boolean
status
)
{
Position
position
=
this
.
positionService
.
getById
(
positionId
);
if
(
position
==
null
)
{
throw
new
RequestEmptyException
();
}
if
(
status
)
{
position
.
setStatus
(
CommonStatus
.
ENABLE
.
getCode
());
}
else
{
position
.
setStatus
(
CommonStatus
.
DISABLE
.
getCode
());
}
this
.
positionService
.
updateById
(
position
);
return
new
SuccessResponseData
();
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/entity/Position.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 职位表
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@TableName
(
"sys_position"
)
public
class
Position
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
@TableId
(
value
=
"position_id"
,
type
=
IdType
.
AUTO
)
private
Long
positionId
;
/**
* 职位名称
*/
@TableField
(
"name"
)
private
String
name
;
/**
* 职位编码
*/
@TableField
(
"code"
)
private
String
code
;
/**
* 顺序
*/
@TableField
(
"sort"
)
private
Integer
sort
;
/**
* 状态(字典)
*/
@TableField
(
"status"
)
private
String
status
;
/**
* 备注
*/
@TableField
(
"remark"
)
private
String
remark
;
/**
* 创建时间
*/
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
/**
* 更新者
*/
@TableField
(
value
=
"update_user"
,
fill
=
FieldFill
.
UPDATE
)
private
Long
updateUser
;
/**
* 更新时间
*/
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
UPDATE
)
private
Date
updateTime
;
/**
* 创建者
*/
@TableField
(
value
=
"create_user"
,
fill
=
FieldFill
.
INSERT
)
private
Long
createUser
;
public
Long
getPositionId
()
{
return
positionId
;
}
public
void
setPositionId
(
Long
positionId
)
{
this
.
positionId
=
positionId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Long
getUpdateUser
()
{
return
updateUser
;
}
public
void
setUpdateUser
(
Long
updateUser
)
{
this
.
updateUser
=
updateUser
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Long
getCreateUser
()
{
return
createUser
;
}
public
void
setCreateUser
(
Long
createUser
)
{
this
.
createUser
=
createUser
;
}
@Override
public
String
toString
()
{
return
"Position{"
+
"positionId="
+
positionId
+
", name="
+
name
+
", code="
+
code
+
", sort="
+
sort
+
", status="
+
status
+
", remark="
+
remark
+
", createTime="
+
createTime
+
", updateUser="
+
updateUser
+
", updateTime="
+
updateTime
+
", createUser="
+
createUser
+
"}"
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/PositionMapper.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
mapper
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.PositionResult
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 职位表 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
public
interface
PositionMapper
extends
BaseMapper
<
Position
>
{
/**
* 获取列表
*
* @author stylefeng
* @Date 2019-06-27
*/
List
<
PositionResult
>
customList
(
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
/**
* 获取map列表
*
* @author stylefeng
* @Date 2019-06-27
*/
List
<
Map
<
String
,
Object
>>
customMapList
(
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
/**
* 获取分页实体列表
*
* @author stylefeng
* @Date 2019-06-27
*/
Page
<
PositionResult
>
customPageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
/**
* 获取分页map列表
*
* @author stylefeng
* @Date 2019-06-27
*/
Page
<
Map
<
String
,
Object
>>
customPageMapList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"paramCondition"
)
PositionParam
paramCondition
);
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/mapper/mapping/PositionMapper.xml
0 → 100644
View file @
5c794401
<?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=
"cn.stylefeng.guns.sys.modular.system.mapper.PositionMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"cn.stylefeng.guns.sys.modular.system.entity.Position"
>
<id
column=
"position_id"
property=
"positionId"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"code"
property=
"code"
/>
<result
column=
"sort"
property=
"sort"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"remark"
property=
"remark"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_user"
property=
"updateUser"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"create_user"
property=
"createUser"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
position_id AS "positionId", name AS "name", code AS "code", sort AS "sort", status AS "status", remark AS "remark", create_time AS "createTime", update_user AS "updateUser", update_time AS "updateTime", create_user AS "createUser"
</sql>
<select
id=
"customList"
resultType=
"cn.stylefeng.guns.sys.modular.system.model.result.PositionResult"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position where 1 = 1
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
and name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
and code like CONCAT('%',#{paramCondition.code},'%')
</if>
order by sort asc
</select>
<select
id=
"customMapList"
resultType=
"map"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position where 1 = 1
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
and name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
and code like CONCAT('%',#{paramCondition.code},'%')
</if>
order by sort asc
</select>
<select
id=
"customPageList"
resultType=
"cn.stylefeng.guns.sys.modular.system.model.result.PositionResult"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position
<where>
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
or code like CONCAT('%',#{paramCondition.code},'%')
</if>
</where>
order by sort asc
</select>
<select
id=
"customPageMapList"
resultType=
"map"
parameterType=
"cn.stylefeng.guns.sys.modular.system.model.params.PositionParam"
>
select
<include
refid=
"Base_Column_List"
/>
from sys_position where 1 = 1
<if
test=
"paramCondition.name != null and paramCondition.name != ''"
>
and name like CONCAT('%',#{paramCondition.name},'%')
</if>
<if
test=
"paramCondition.code != null and paramCondition.code != ''"
>
and code like CONCAT('%',#{paramCondition.code},'%')
</if>
order by sort asc
</select>
</mapper>
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/params/PositionParam.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
model
.
params
;
import
cn.stylefeng.roses.kernel.model.validator.BaseValidatingParam
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 职位表
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@Data
public
class
PositionParam
implements
Serializable
,
BaseValidatingParam
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
positionId
;
/**
* 职位名称
*/
private
String
name
;
/**
* 职位编码
*/
private
String
code
;
/**
* 顺序
*/
private
Integer
sort
;
/**
* 状态(字典)
*/
private
String
status
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新者
*/
private
Long
updateUser
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 创建者
*/
private
Long
createUser
;
@Override
public
String
checkParam
()
{
return
null
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/model/result/PositionResult.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
model
.
result
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
* 职位表
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@Data
public
class
PositionResult
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
private
Long
positionId
;
/**
* 职位名称
*/
private
String
name
;
/**
* 职位编码
*/
private
String
code
;
/**
* 顺序
*/
private
Integer
sort
;
/**
* 状态(字典)
*/
private
String
status
;
/**
* 备注
*/
private
String
remark
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新者
*/
private
Long
updateUser
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 创建者
*/
private
Long
createUser
;
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/PositionService.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
service
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.PositionResult
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 职位表 服务类
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
public
interface
PositionService
extends
IService
<
Position
>
{
/**
* 新增
*
* @author stylefeng
* @Date 2019-06-27
*/
void
add
(
PositionParam
param
);
/**
* 删除
*
* @author stylefeng
* @Date 2019-06-27
*/
void
delete
(
PositionParam
param
);
/**
* 更新
*
* @author stylefeng
* @Date 2019-06-27
*/
void
update
(
PositionParam
param
);
/**
* 查询单条数据,Specification模式
*
* @author stylefeng
* @Date 2019-06-27
*/
PositionResult
findBySpec
(
PositionParam
param
);
/**
* 查询列表,Specification模式
*
* @author stylefeng
* @Date 2019-06-27
*/
List
<
PositionResult
>
findListBySpec
(
PositionParam
param
);
/**
* 查询分页数据,Specification模式
*
* @author stylefeng
* @Date 2019-06-27
*/
LayuiPageInfo
findPageBySpec
(
PositionParam
param
);
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/impl/PositionServiceImpl.java
0 → 100644
View file @
5c794401
package
cn
.
stylefeng
.
guns
.
sys
.
modular
.
system
.
service
.
impl
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageFactory
;
import
cn.stylefeng.guns.base.pojo.page.LayuiPageInfo
;
import
cn.stylefeng.guns.sys.modular.system.entity.Position
;
import
cn.stylefeng.guns.sys.modular.system.mapper.PositionMapper
;
import
cn.stylefeng.guns.sys.modular.system.model.params.PositionParam
;
import
cn.stylefeng.guns.sys.modular.system.model.result.PositionResult
;
import
cn.stylefeng.guns.sys.modular.system.service.PositionService
;
import
cn.stylefeng.roses.core.util.ToolUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <p>
* 职位表 服务实现类
* </p>
*
* @author stylefeng
* @since 2019-06-27
*/
@Service
public
class
PositionServiceImpl
extends
ServiceImpl
<
PositionMapper
,
Position
>
implements
PositionService
{
@Override
public
void
add
(
PositionParam
param
){
Position
entity
=
getEntity
(
param
);
this
.
save
(
entity
);
}
@Override
public
void
delete
(
PositionParam
param
){
this
.
removeById
(
getKey
(
param
));
}
@Override
public
void
update
(
PositionParam
param
){
Position
oldEntity
=
getOldEntity
(
param
);
Position
newEntity
=
getEntity
(
param
);
ToolUtil
.
copyProperties
(
newEntity
,
oldEntity
);
this
.
updateById
(
newEntity
);
}
@Override
public
PositionResult
findBySpec
(
PositionParam
param
){
return
null
;
}
@Override
public
List
<
PositionResult
>
findListBySpec
(
PositionParam
param
){
return
null
;
}
@Override
public
LayuiPageInfo
findPageBySpec
(
PositionParam
param
){
Page
pageContext
=
getPageContext
();
IPage
page
=
this
.
baseMapper
.
customPageList
(
pageContext
,
param
);
return
LayuiPageFactory
.
createPageInfo
(
page
);
}
private
Serializable
getKey
(
PositionParam
param
){
return
param
.
getPositionId
();
}
private
Page
getPageContext
()
{
return
LayuiPageFactory
.
defaultPage
();
}
private
Position
getOldEntity
(
PositionParam
param
)
{
return
this
.
getById
(
getKey
(
param
));
}
private
Position
getEntity
(
PositionParam
param
)
{
Position
entity
=
new
Position
();
ToolUtil
.
copyProperties
(
param
,
entity
);
return
entity
;
}
}
guns-sys/src/main/webapp/assets/modular/system/menu/menu.js
View file @
5c794401
...
@@ -181,13 +181,4 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
...
@@ -181,13 +181,4 @@ layui.use(['layer', 'form', 'ztree', 'laydate', 'admin', 'ax', 'table', 'treetab
}
}
});
});
// 修改user状态
form
.
on
(
'switch(status)'
,
function
(
obj
)
{
var
userId
=
obj
.
elem
.
value
;
var
checked
=
obj
.
elem
.
checked
?
true
:
false
;
Menu
.
changeUserStatus
(
userId
,
checked
);
});
});
});
guns-sys/src/main/webapp/assets/modular/system/position/position.js
0 → 100644
View file @
5c794401
layui
.
use
([
'table'
,
'admin'
,
'ax'
,
'form'
],
function
()
{
var
$
=
layui
.
$
;
var
table
=
layui
.
table
;
var
$ax
=
layui
.
ax
;
var
admin
=
layui
.
admin
;
var
form
=
layui
.
form
;
/**
* 职位表管理
*/
var
Position
=
{
tableId
:
"positionTable"
};
/**
* 初始化表格的列
*/
Position
.
initColumn
=
function
()
{
return
[[
{
type
:
'checkbox'
},
{
field
:
'positionId'
,
hide
:
true
,
title
:
'主键id'
},
{
field
:
'name'
,
sort
:
true
,
title
:
'职位名称'
},
{
field
:
'code'
,
sort
:
true
,
title
:
'职位编码'
},
{
field
:
'remark'
,
sort
:
true
,
title
:
'备注'
},
{
field
:
'createTime'
,
sort
:
true
,
title
:
'创建时间'
},
{
field
:
'updateTime'
,
sort
:
true
,
title
:
'更新时间'
},
{
field
:
'status'
,
sort
:
true
,
templet
:
'#statusTpl'
,
title
:
'状态'
},
{
align
:
'center'
,
toolbar
:
'#tableBar'
,
title
:
'操作'
}
]];
};
/**
* 点击查询按钮
*/
Position
.
search
=
function
()
{
var
queryData
=
{};
queryData
[
'condition'
]
=
$
(
"#condition"
).
val
();
table
.
reload
(
Position
.
tableId
,
{
where
:
queryData
,
page
:
{
curr
:
1
}
});
};
/**
* 弹出添加对话框
*/
Position
.
openAddDlg
=
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position/add'
;
};
/**
* 导出excel按钮
*/
Position
.
exportExcel
=
function
()
{
var
checkRows
=
table
.
checkStatus
(
Position
.
tableId
);
if
(
checkRows
.
data
.
length
===
0
)
{
Feng
.
error
(
"请选择要导出的数据"
);
}
else
{
table
.
exportFile
(
tableResult
.
config
.
id
,
checkRows
.
data
,
'xls'
);
}
};
/**
* 点击编辑
*
* @param data 点击按钮时候的行数据
*/
Position
.
openEditDlg
=
function
(
data
)
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position/edit?positionId='
+
data
.
positionId
;
};
/**
* 点击删除
*
* @param data 点击按钮时候的行数据
*/
Position
.
onDeleteItem
=
function
(
data
)
{
var
operation
=
function
()
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/delete"
,
function
(
data
)
{
Feng
.
success
(
"删除成功!"
);
table
.
reload
(
Position
.
tableId
);
},
function
(
data
)
{
Feng
.
error
(
"删除失败!"
+
data
.
responseJSON
.
message
+
"!"
);
});
ajax
.
set
(
"positionId"
,
data
.
positionId
);
ajax
.
start
();
};
Feng
.
confirm
(
"是否删除?"
,
operation
);
};
/**
* 修改职位状态
*/
Position
.
changeStatus
=
function
(
positionId
,
checked
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/changeStatus"
,
function
(
data
)
{
Feng
.
success
(
"修改成功!"
);
},
function
(
data
)
{
Feng
.
error
(
"修改成功!"
);
table
.
reload
(
Position
.
tableId
);
});
ajax
.
set
(
"positionId"
,
positionId
);
ajax
.
set
(
"status"
,
checked
);
ajax
.
start
();
};
// 渲染表格
var
tableResult
=
table
.
render
({
elem
:
'#'
+
Position
.
tableId
,
url
:
Feng
.
ctxPath
+
'/position/list'
,
page
:
true
,
height
:
"full-158"
,
cellMinWidth
:
100
,
cols
:
Position
.
initColumn
()
});
// 搜索按钮点击事件
$
(
'#btnSearch'
).
click
(
function
()
{
Position
.
search
();
});
// 添加按钮点击事件
$
(
'#btnAdd'
).
click
(
function
()
{
Position
.
openAddDlg
();
});
// 导出excel
$
(
'#btnExp'
).
click
(
function
()
{
Position
.
exportExcel
();
});
// 工具条点击事件
table
.
on
(
'tool('
+
Position
.
tableId
+
')'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
var
layEvent
=
obj
.
event
;
if
(
layEvent
===
'edit'
)
{
Position
.
openEditDlg
(
data
);
}
else
if
(
layEvent
===
'delete'
)
{
Position
.
onDeleteItem
(
data
);
}
});
// 修改user状态
form
.
on
(
'switch(status)'
,
function
(
obj
)
{
var
positionId
=
obj
.
elem
.
value
;
var
checked
=
obj
.
elem
.
checked
?
true
:
false
;
Position
.
changeStatus
(
positionId
,
checked
);
});
});
guns-sys/src/main/webapp/assets/modular/system/position/position_add.js
0 → 100644
View file @
5c794401
/**
* 添加或者修改页面
*/
var
PositionInfoDlg
=
{
data
:
{
name
:
""
,
code
:
""
,
sort
:
""
,
status
:
""
,
remark
:
""
,
createTime
:
""
,
updateUser
:
""
,
updateTime
:
""
,
createUser
:
""
}
};
layui
.
use
([
'form'
,
'admin'
,
'ax'
],
function
()
{
var
$
=
layui
.
jquery
;
var
$ax
=
layui
.
ax
;
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
//让当前iframe弹层高度适应
admin
.
iframeAuto
();
//表单提交事件
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/addItem"
,
function
(
data
)
{
Feng
.
success
(
"添加成功!"
);
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
},
function
(
data
)
{
Feng
.
error
(
"添加失败!"
+
data
.
responseJSON
.
message
)
});
ajax
.
set
(
data
.
field
);
ajax
.
start
();
return
false
;
});
//返回按钮
$
(
"#backupPage"
).
click
(
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
});
});
\ No newline at end of file
guns-sys/src/main/webapp/assets/modular/system/position/position_edit.js
0 → 100644
View file @
5c794401
/**
* 详情对话框
*/
var
PositionInfoDlg
=
{
data
:
{
name
:
""
,
code
:
""
,
sort
:
""
,
status
:
""
,
remark
:
""
,
createTime
:
""
,
updateUser
:
""
,
updateTime
:
""
,
createUser
:
""
}
};
layui
.
use
([
'form'
,
'admin'
,
'ax'
],
function
()
{
var
$
=
layui
.
jquery
;
var
$ax
=
layui
.
ax
;
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
//让当前iframe弹层高度适应
admin
.
iframeAuto
();
//获取详情信息,填充表单
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/detail?positionId="
+
Feng
.
getUrlParam
(
"positionId"
));
var
result
=
ajax
.
start
();
form
.
val
(
'positionForm'
,
result
.
data
);
//表单提交事件
form
.
on
(
'submit(btnSubmit)'
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/position/editItem"
,
function
(
data
)
{
Feng
.
success
(
"更新成功!"
);
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
},
function
(
data
)
{
Feng
.
error
(
"更新失败!"
+
data
.
responseJSON
.
message
)
});
ajax
.
set
(
data
.
field
);
ajax
.
start
();
return
false
;
});
//返回按钮
$
(
"#backupPage"
).
click
(
function
()
{
window
.
location
.
href
=
Feng
.
ctxPath
+
'/position'
});
});
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/position/position.html
0 → 100644
View file @
5c794401
@layout("/common/_container.html",{js:["/assets/modular/system/position/position.js"]}){
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
职位表管理
</span>
</div>
<div
class=
"layui-fluid"
>
<div
class=
"layui-row layui-col-space15"
>
<div
class=
"layui-col-sm12 layui-col-md12 layui-col-lg12"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<div
class=
"layui-form toolbar"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
<input
id=
"condition"
class=
"layui-input"
type=
"text"
placeholder=
"名称"
/>
</div>
<div
class=
"layui-inline"
>
<button
id=
"btnSearch"
class=
"layui-btn icon-btn"
><i
class=
"layui-icon"
>

</i>
搜索
</button>
<button
id=
"btnAdd"
class=
"layui-btn icon-btn"
><i
class=
"layui-icon"
>

</i>
添加
</button>
<button
id=
"btnExp"
class=
"layui-btn icon-btn"
><i
class=
"layui-icon"
>

</i>
导出
</button>
</div>
</div>
</div>
<table
class=
"layui-table"
id=
"positionTable"
lay-filter=
"positionTable"
></table>
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/html"
id=
"tableBar"
>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
lay
-
event
=
"edit"
>
修改
<
/a
>
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"delete"
>
删除
<
/a
>
</script>
<script
type=
"text/html"
id=
"statusTpl"
>
<
input
type
=
"checkbox"
lay
-
filter
=
"status"
value
=
"{{d.positionId}}"
lay
-
skin
=
"switch"
lay
-
text
=
"启用|禁用"
{{
d
.
status
==
'ENABLE'
?
'checked'
:
''
}}
/
>
</script>
@}
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/position/position_add.html
0 → 100644
View file @
5c794401
@layout("/common/_container.html",{js:["/assets/modular/system/position/position_add.js"]}){
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
添加
</span>
</div>
<div
class=
"layui-fluid "
style=
""
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
id=
"positionForm"
lay-filter=
"positionForm"
class=
"layui-form model-form"
style=
"max-width: 700px;margin: 40px auto;"
>
<input
name=
"positionId"
type=
"hidden"
/>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位名称
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"name"
name=
"name"
placeholder=
"请输入职位名称"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位编码
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"code"
name=
"code"
placeholder=
"请输入职位编码"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
顺序
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"sort"
name=
"sort"
placeholder=
"请输入顺序"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
备注
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"remark"
name=
"remark"
placeholder=
"请输入备注"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"layui-btn"
lay-filter=
"btnSubmit"
lay-submit
>
 
提交
 
</button>
<button
class=
"layui-btn layui-btn-primary"
type=
"button"
id=
"backupPage"
>
 
返回
 
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@}
\ No newline at end of file
guns-sys/src/main/webapp/pages/modular/system/position/position_edit.html
0 → 100644
View file @
5c794401
@layout("/common/_container.html",{js:["/assets/modular/system/position/position_edit.js"]}){
<div
class=
"layui-body-header"
>
<span
class=
"layui-body-header-title"
>
修改
</span>
</div>
<div
class=
"layui-fluid "
style=
""
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
id=
"positionForm"
lay-filter=
"positionForm"
class=
"layui-form model-form"
style=
"max-width: 700px;margin: 40px auto;"
>
<input
name=
"positionId"
type=
"hidden"
/>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位名称
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"name"
name=
"name"
placeholder=
"请输入职位名称"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
职位编码
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"code"
name=
"code"
placeholder=
"请输入职位编码"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
顺序
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"sort"
name=
"sort"
placeholder=
"请输入顺序"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
备注
<span
style=
"color: red;"
>
*
</span></label>
<div
class=
"layui-input-block"
>
<input
id=
"remark"
name=
"remark"
placeholder=
"请输入备注"
type=
"text"
class=
"layui-input"
lay-verify=
"required"
required
/>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-input-block"
>
<button
class=
"layui-btn"
lay-filter=
"btnSubmit"
lay-submit
>
 
提交
 
</button>
<button
class=
"layui-btn layui-btn-primary"
type=
"button"
id=
"backupPage"
>
 
返回
 
</button>
</div>
</div>
</form>
</div>
</div>
</div>
@}
\ 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