公司管理和pom文件提交
|
|
@ -48,7 +48,6 @@ public class SecurityHandlerConfig {
|
|||
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
|
||||
Authentication authentication) throws IOException, ServletException {
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
|
||||
Token token = tokenService.saveToken(loginUser);
|
||||
ResponseUtil.responseJson(response, HttpStatus.OK.value(), token);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,27 @@
|
|||
package com.bonus.leader.performance.manager.manager.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.dao.UserDao;
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.UserDto;
|
||||
import com.bonus.leader.performance.manager.manager.entity.ZNode;
|
||||
import com.bonus.leader.performance.manager.manager.model.SysUser;
|
||||
import com.bonus.leader.performance.manager.manager.table.PageTableHandler;
|
||||
import com.bonus.leader.performance.manager.manager.table.PageTableRequest;
|
||||
import com.bonus.leader.performance.manager.manager.table.PageTableResponse;
|
||||
import com.bonus.leader.performance.manager.manager.service.UserService;
|
||||
import com.bonus.leader.performance.manager.manager.utils.AjaxRes;
|
||||
import com.bonus.leader.performance.manager.manager.utils.GlobalConst;
|
||||
import com.bonus.leader.performance.manager.manager.utils.UserUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.annotation.LogAnnotation;
|
||||
|
||||
|
|
@ -39,6 +39,7 @@ public class UserController {
|
|||
|
||||
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
|
|
@ -119,4 +120,69 @@ public class UserController {
|
|||
return userDao.getById(id);
|
||||
}
|
||||
|
||||
|
||||
/**-------------------------------------------用户管理新接口-----------------------------------------------------------------*/
|
||||
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("getLoginLog")
|
||||
@ApiOperation(value = "个人信息-登录日志")
|
||||
public List<Map<String, Object>> getLoginLogs() {
|
||||
return userService.getLoginLogs();
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping(value = "/getRole")
|
||||
@ApiOperation(value = "人员角色select列表")
|
||||
public List<MapBean> getRole() {
|
||||
List<MapBean> result = userService.getRole();
|
||||
return result;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("getDepartmentTree")
|
||||
@ApiOperation(value = "用户管理-获取部门树")
|
||||
public AjaxRes getDepartmentTree() {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
try {
|
||||
List<ZNode> list = userService.getDepartmentTree();
|
||||
ar.setSucceed(list);
|
||||
} catch (Exception e) {
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getListPerson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "个人信息-查询")
|
||||
public AjaxRes getListPerson(){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
SysUser sysUser = userService.getListPerson();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(sysUser !=null){
|
||||
map.put("sysUser",sysUser);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updatePerson", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "个人信息-修改")
|
||||
public AjaxRes updatePerson(@RequestBody SysUser bean){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = userService.updatePerson(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
if (cb == 5){
|
||||
ar.setFailMsg("手机号已存在");
|
||||
}
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bonus.leader.performance.manager.manager.dao;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.ZNode;
|
||||
import com.bonus.leader.performance.manager.manager.model.SysUser;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
|
|
@ -22,7 +24,7 @@ public interface UserDao {
|
|||
@Select("select * from sys_user t where t.id = #{id}")
|
||||
SysUser getById(Long id);
|
||||
|
||||
@Select("select * from sys_user t where t.username = #{username}")
|
||||
@Select("select * from sys_user t where t.phone = #{username}")
|
||||
SysUser getUser(String username);
|
||||
|
||||
@Update("update sys_user t set t.password = #{password} where t.id = #{id}")
|
||||
|
|
@ -39,4 +41,20 @@ public interface UserDao {
|
|||
int saveUserRoles(@Param("userId") Long userId, @Param("roleIds") List<Long> roleIds);
|
||||
|
||||
int update(SysUser user);
|
||||
|
||||
int insertLoginInfo(SysUser sysuser);
|
||||
|
||||
List<SysUser> findAllByOrderByCreateTimeDesc(String userId);
|
||||
|
||||
List<MapBean> getRole();
|
||||
|
||||
List<ZNode> getDepartmentTree(ZNode o);
|
||||
|
||||
SysUser getListById(String id);
|
||||
|
||||
int phoneIfExists(String sysUser, String phone, String phone1, String string);
|
||||
|
||||
int updateInfo(SysUser bean);
|
||||
|
||||
int updateRoleUser(SysUser bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,307 @@
|
|||
package com.bonus.leader.performance.manager.manager.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ZNode implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String pId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String code;
|
||||
|
||||
private String pName;
|
||||
|
||||
private String checked;
|
||||
|
||||
private Integer type;
|
||||
private String puid;
|
||||
|
||||
private boolean open = false;
|
||||
|
||||
private boolean existed = true;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String sort;
|
||||
|
||||
private String leasePrice;
|
||||
|
||||
private String internalPrice;
|
||||
|
||||
private String portalPrice;
|
||||
|
||||
private Float num;
|
||||
|
||||
private Integer currency;
|
||||
|
||||
private Integer level;
|
||||
|
||||
private String unitName;
|
||||
|
||||
private String unitValue;
|
||||
|
||||
private String partId;
|
||||
|
||||
private Integer isCount;
|
||||
|
||||
private String storageNum;
|
||||
|
||||
private Integer keepId;
|
||||
private String keepName;
|
||||
|
||||
private String orgIds;
|
||||
private String levels;
|
||||
|
||||
public String getOrgIds() {
|
||||
return orgIds;
|
||||
}
|
||||
|
||||
public void setOrgIds(String orgIds) {
|
||||
this.orgIds = orgIds;
|
||||
}
|
||||
|
||||
public String getLevels() {
|
||||
return levels;
|
||||
}
|
||||
|
||||
public void setLevels(String levels) {
|
||||
this.levels = levels;
|
||||
}
|
||||
|
||||
public String getPuid() {
|
||||
return puid;
|
||||
}
|
||||
|
||||
public void setPuid(String puid) {
|
||||
this.puid = puid;
|
||||
}
|
||||
|
||||
public Integer getIsCount() {
|
||||
return isCount;
|
||||
}
|
||||
|
||||
public void setIsCount(Integer isCount) {
|
||||
this.isCount = isCount;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getPortalPrice() {
|
||||
return portalPrice;
|
||||
}
|
||||
|
||||
public void setPortalPrice(String portalPrice) {
|
||||
this.portalPrice = portalPrice;
|
||||
}
|
||||
|
||||
public String getPartId() {
|
||||
return partId;
|
||||
}
|
||||
|
||||
public void setPartId(String partId) {
|
||||
this.partId = partId;
|
||||
}
|
||||
|
||||
public String getUnitName() {
|
||||
return unitName;
|
||||
}
|
||||
|
||||
public void setUnitName(String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
|
||||
public String getUnitValue() {
|
||||
return unitValue;
|
||||
}
|
||||
|
||||
public void setUnitValue(String unitValue) {
|
||||
this.unitValue = unitValue;
|
||||
}
|
||||
|
||||
public String getpName() {
|
||||
return pName;
|
||||
}
|
||||
|
||||
public void setpName(String pName) {
|
||||
this.pName = pName;
|
||||
}
|
||||
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public Integer getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setCurrency(Integer currency) {
|
||||
this.currency = currency;
|
||||
}
|
||||
|
||||
public String getInternalPrice() {
|
||||
return internalPrice;
|
||||
}
|
||||
|
||||
public void setInternalPrice(String internalPrice) {
|
||||
this.internalPrice = internalPrice;
|
||||
}
|
||||
|
||||
public Float getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Float num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getLeasePrice() {
|
||||
return leasePrice;
|
||||
}
|
||||
|
||||
public void setLeasePrice(String leasePrice) {
|
||||
this.leasePrice = leasePrice;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getpId() {
|
||||
return pId;
|
||||
}
|
||||
|
||||
public void setpId(String pId) {
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public void setChecked(String checked) {
|
||||
this.checked = checked;
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
return open;
|
||||
}
|
||||
|
||||
public void setOpen(boolean open) {
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
public boolean isExisted() {
|
||||
return existed;
|
||||
}
|
||||
|
||||
public void setExisted(boolean existed) {
|
||||
this.existed = existed;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(String sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public String getStorageNum() {
|
||||
return storageNum;
|
||||
}
|
||||
|
||||
public void setStorageNum(String storageNum) {
|
||||
this.storageNum = storageNum;
|
||||
}
|
||||
|
||||
|
||||
public Integer getKeepId() {
|
||||
return keepId;
|
||||
}
|
||||
|
||||
public void setKeepId(Integer keepId) {
|
||||
this.keepId = keepId;
|
||||
}
|
||||
|
||||
public String getKeepName() {
|
||||
return keepName;
|
||||
}
|
||||
|
||||
public void setKeepName(String keepName) {
|
||||
this.keepName = keepName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ZNode{" +
|
||||
"id='" + id + '\'' +
|
||||
", pId='" + pId + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", code='" + code + '\'' +
|
||||
", pName='" + pName + '\'' +
|
||||
", checked='" + checked + '\'' +
|
||||
", type=" + type +
|
||||
", puid='" + puid + '\'' +
|
||||
", open=" + open +
|
||||
", existed=" + existed +
|
||||
", icon='" + icon + '\'' +
|
||||
", sort='" + sort + '\'' +
|
||||
", leasePrice='" + leasePrice + '\'' +
|
||||
", internalPrice='" + internalPrice + '\'' +
|
||||
", portalPrice='" + portalPrice + '\'' +
|
||||
", num=" + num +
|
||||
", currency=" + currency +
|
||||
", level=" + level +
|
||||
", unitName='" + unitName + '\'' +
|
||||
", unitValue='" + unitValue + '\'' +
|
||||
", partId='" + partId + '\'' +
|
||||
", isCount=" + isCount +
|
||||
", storageNum='" + storageNum + '\'' +
|
||||
", keepId=" + keepId +
|
||||
", keepName='" + keepName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,9 @@ package com.bonus.leader.performance.manager.manager.model;
|
|||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SysUser extends BaseEntity<Long> {
|
||||
|
||||
private static final long serialVersionUID = -6525908145032868837L;
|
||||
|
|
@ -21,8 +23,30 @@ public class SysUser extends BaseEntity<Long> {
|
|||
private Integer status;
|
||||
private String intro;
|
||||
|
||||
private String userId;
|
||||
private String roleId;
|
||||
private String departmentId;
|
||||
private String department;
|
||||
private String keyWord;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String level;
|
||||
private String orgId;
|
||||
private String pId;
|
||||
private String orgIds;
|
||||
private String noticeId;
|
||||
private String noticeName;
|
||||
private String noticeType;
|
||||
private String isRead;
|
||||
private String createTimed;
|
||||
private String ipAddress;
|
||||
private String sysUserId;
|
||||
private String systemName;
|
||||
private String hostName;
|
||||
private String month;
|
||||
private String ip;
|
||||
private String type;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
package com.bonus.leader.performance.manager.manager.service;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.UserDto;
|
||||
import com.bonus.leader.performance.manager.manager.entity.ZNode;
|
||||
import com.bonus.leader.performance.manager.manager.model.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface UserService {
|
||||
|
||||
SysUser saveUser(UserDto userDto);
|
||||
|
|
@ -13,4 +18,15 @@ public interface UserService {
|
|||
|
||||
void changePassword(String username, String oldPassword, String newPassword);
|
||||
|
||||
// int addLoginLog();
|
||||
|
||||
List<Map<String, Object>> getLoginLogs();
|
||||
|
||||
List<MapBean> getRole();
|
||||
|
||||
List<ZNode> getDepartmentTree();
|
||||
|
||||
SysUser getListPerson();
|
||||
|
||||
int updatePerson(SysUser bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
package com.bonus.leader.performance.manager.manager.service.impl;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.dao.UserDao;
|
||||
import com.bonus.leader.performance.manager.manager.entity.LoginUser;
|
||||
import com.bonus.leader.performance.manager.manager.entity.Token;
|
||||
import com.bonus.leader.performance.manager.manager.model.SysUser;
|
||||
import com.bonus.leader.performance.manager.manager.service.SysLogService;
|
||||
import com.bonus.leader.performance.manager.manager.service.TokenService;
|
||||
import com.bonus.leader.performance.manager.manager.service.UserService;
|
||||
import com.bonus.leader.performance.manager.manager.utils.UserUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
|
@ -15,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||
/**
|
||||
* token存到redis的实现类<br>
|
||||
* 普通token,uuid
|
||||
* @author Lenovo
|
||||
*/
|
||||
@Deprecated
|
||||
@Service("tokenService")
|
||||
|
|
@ -29,6 +38,8 @@ public class TokenServiceImpl implements TokenService {
|
|||
private RedisTemplate<String, LoginUser> redisTemplate;
|
||||
@Autowired
|
||||
private SysLogService logService;
|
||||
@Autowired
|
||||
private UserDao userDao;
|
||||
|
||||
@Override
|
||||
public Token saveToken(LoginUser loginUser) {
|
||||
|
|
@ -36,12 +47,47 @@ public class TokenServiceImpl implements TokenService {
|
|||
|
||||
loginUser.setToken(token);
|
||||
cacheLoginUser(loginUser);
|
||||
addLoginLog();
|
||||
// 登陆日志
|
||||
logService.save(loginUser.getId(), "登陆", true, null);
|
||||
|
||||
return new Token(token, loginUser.getLoginTime());
|
||||
}
|
||||
|
||||
public int addLoginLog() {
|
||||
int num = 0;
|
||||
try {
|
||||
// 获取当前IP地址
|
||||
InetAddress ipAddress = InetAddress.getLocalHost();
|
||||
String ip = ipAddress.getHostAddress();
|
||||
|
||||
// 获取系统名称
|
||||
String systemName = System.getProperty("os.name");
|
||||
|
||||
// 获取所在位置(主机名)
|
||||
String hostName = ipAddress.getHostName();
|
||||
|
||||
LocalDate currentYearMonth = LocalDate.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String formattedYearMonth = currentYearMonth.format(formatter);
|
||||
|
||||
String id = UserUtil.getLoginUser().getId().toString();
|
||||
|
||||
// 创建SysUser对象并设置值
|
||||
SysUser sysuser = new SysUser();
|
||||
sysuser.setIpAddress(ip);
|
||||
sysuser.setSystemName(systemName);
|
||||
sysuser.setHostName(hostName);
|
||||
sysuser.setMonth(formattedYearMonth);
|
||||
sysuser.setUserId(id);
|
||||
|
||||
num = userDao.insertLoginInfo(sysuser);
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
private void cacheLoginUser(LoginUser loginUser) {
|
||||
loginUser.setLoginTime(System.currentTimeMillis());
|
||||
loginUser.setExpireTime(loginUser.getLoginTime() + expireSeconds * 1000);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,20 @@
|
|||
package com.bonus.leader.performance.manager.manager.service.impl;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.dao.UserDao;
|
||||
import com.bonus.leader.performance.manager.manager.entity.MapBean;
|
||||
import com.bonus.leader.performance.manager.manager.entity.ZNode;
|
||||
import com.bonus.leader.performance.manager.manager.model.SysUser;
|
||||
import com.bonus.leader.performance.manager.manager.utils.UserUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -68,6 +79,8 @@ public class UserServiceImpl implements UserService {
|
|||
log.debug("修改{}的密码", username);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public SysUser updateUser(UserDto userDto) {
|
||||
|
|
@ -77,4 +90,71 @@ public class UserServiceImpl implements UserService {
|
|||
return userDto;
|
||||
}
|
||||
|
||||
/**-------------------------------------------用户管理新接口-----------------------------------------------------------------*/
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getLoginLogs() {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
String userId = UserUtil.getLoginUser().getId().toString();
|
||||
List<SysUser> sysUsers = userDao.findAllByOrderByCreateTimeDesc(userId);
|
||||
Map<String, List<Map<String, String>>> resultMap = new LinkedHashMap<>();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
|
||||
for (SysUser sysUser : sysUsers) {
|
||||
String loginDate = dateFormat.format(sysUser.getCreateTime());
|
||||
|
||||
Map<String, String> record = new LinkedHashMap<>();
|
||||
record.put("system", sysUser.getSystemName());
|
||||
record.put("ip", sysUser.getIpAddress());
|
||||
record.put("hostName", sysUser.getHostName());
|
||||
record.put("time", timeFormat.format(sysUser.getCreateTime()));
|
||||
|
||||
if (!resultMap.containsKey(loginDate)) {
|
||||
resultMap.put(loginDate, new ArrayList<>());
|
||||
}
|
||||
resultMap.get(loginDate).add(record);
|
||||
}
|
||||
|
||||
for (Map.Entry<String, List<Map<String, String>>> entry : resultMap.entrySet()) {
|
||||
Map<String, Object> dateRecord = new LinkedHashMap<>();
|
||||
dateRecord.put("date", entry.getKey());
|
||||
dateRecord.put("records", entry.getValue());
|
||||
result.add(dateRecord);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapBean> getRole() {
|
||||
return userDao.getRole();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZNode> getDepartmentTree() {
|
||||
ZNode o = new ZNode();
|
||||
o.setLevels(UserUtil.getLoginUser().getLevel());
|
||||
o.setOrgIds(UserUtil.getLoginUser().getOrgId());
|
||||
return userDao.getDepartmentTree(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUser getListPerson() {
|
||||
String id = UserUtil.getLoginUser().getId().toString();
|
||||
return userDao.getListById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePerson(SysUser bean) {
|
||||
int num =0;
|
||||
bean.setId(UserUtil.getLoginUser().getId());
|
||||
// int phone = userDao.phoneIfExists("sys_user","phone",bean.getPhone(),bean.getId().toString());
|
||||
// if(phone >0){
|
||||
// return 5;
|
||||
// }
|
||||
num = userDao.updateInfo(bean);
|
||||
int team = userDao.updateRoleUser(bean);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,35 +4,37 @@ import com.bonus.leader.performance.manager.manager.annotation.LogAnnotation;
|
|||
import com.bonus.leader.performance.manager.manager.utils.AjaxRes;
|
||||
import com.bonus.leader.performance.manager.manager.utils.GlobalConst;
|
||||
import com.bonus.leader.performance.manager.manager.utils.R;
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.projectManageBean;
|
||||
import com.bonus.leader.performance.manager.projectManagement.service.projectManageService;
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.ProjectManageBean;
|
||||
import com.bonus.leader.performance.manager.projectManagement.service.ProjectManageService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/projectManage")
|
||||
public class projectManageController {
|
||||
public class ProjectManageController {
|
||||
|
||||
@Resource
|
||||
private projectManageService service;
|
||||
private ProjectManageService service;
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("getProjectManageList")
|
||||
@ApiOperation(value = "项目管理-列表")
|
||||
public R getFirmList(projectManageBean o){
|
||||
List<projectManageBean> list = service.getProjectManageList(o);
|
||||
public R getFirmList(ProjectManageBean o){
|
||||
List<ProjectManageBean> list = service.getProjectManageList(o);
|
||||
return !list.isEmpty() ? R.okTable(list, list.size()): R.failTable("暂无数据");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "addProjectManage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@PreAuthorize("hasAuthority('sysFirmContent:add')")
|
||||
@PreAuthorize("hasAuthority('sysProjectManage:add')")
|
||||
@ApiOperation(value = "项目管理-新增")
|
||||
public AjaxRes addProjectManage(@RequestBody projectManageBean bean) throws Exception {
|
||||
public AjaxRes addProjectManage(@RequestBody ProjectManageBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.addProjectManage(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
|
|
@ -47,9 +49,9 @@ public class projectManageController {
|
|||
|
||||
@RequestMapping(value = "updateProjectManage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@PreAuthorize("hasAuthority('sysFirmContent:update')")
|
||||
@PreAuthorize("hasAuthority('sysProjectManage:update')")
|
||||
@ApiOperation(value = "项目管理-修改")
|
||||
public AjaxRes updateProjectManage(@RequestBody projectManageBean bean) throws Exception {
|
||||
public AjaxRes updateProjectManage(@RequestBody ProjectManageBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.updateProjectManage(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
|
|
@ -64,7 +66,7 @@ public class projectManageController {
|
|||
|
||||
@RequestMapping(value = "delProjectManage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@PreAuthorize("hasAuthority('sysFirmContent:delete')")
|
||||
@PreAuthorize("hasAuthority('sysProjectManage:delete')")
|
||||
@ApiOperation(value = "项目管理-删除")
|
||||
public AjaxRes delProjectManage(String id) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
|
|
@ -79,5 +81,33 @@ public class projectManageController {
|
|||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getListProjectManage", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "项目管理-查询人员信息")
|
||||
public AjaxRes getListProjectManage(String id){
|
||||
AjaxRes ar = new AjaxRes();
|
||||
ProjectManageBean projectManage = service.getListProjectManage(id);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(projectManage !=null){
|
||||
map.put("projectManage",projectManage);
|
||||
}
|
||||
ar.setSucceed(map,GlobalConst.DATA_SUCCEED);
|
||||
return ar;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateBind", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@PreAuthorize("hasAuthority('sysProjectManage:bind')")
|
||||
@ApiOperation(value = "项目管理-项目绑定")
|
||||
public AjaxRes updateBind(@RequestBody ProjectManageBean bean) throws Exception {
|
||||
AjaxRes ar = new AjaxRes();
|
||||
int cb = service.updateBind(bean);
|
||||
ar.setFailMsg(GlobalConst.DATA_FAIL);
|
||||
if(cb>0){
|
||||
ar.setFailMsg(GlobalConst.INIT_SUCCEED);
|
||||
}
|
||||
return ar;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.leader.performance.manager.projectManagement.dao;
|
||||
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.ProjectManageBean;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository(value = "ProjectManageDao")
|
||||
public interface ProjectManageDao {
|
||||
|
||||
List<ProjectManageBean> getProjectManageList(ProjectManageBean o);
|
||||
|
||||
int getProName(ProjectManageBean bean);
|
||||
|
||||
int addProjectManage(ProjectManageBean bean);
|
||||
|
||||
int updateProjectManage(ProjectManageBean bean);
|
||||
|
||||
int delProjectManage(String id);
|
||||
|
||||
ProjectManageBean getListProjectManage(String id);
|
||||
|
||||
int updateBind(ProjectManageBean bean);
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.bonus.leader.performance.manager.projectManagement.dao;
|
||||
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.projectManageBean;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository(value = "projectManageDao")
|
||||
public interface projectManageDao {
|
||||
|
||||
List<projectManageBean> getProjectManageList(projectManageBean o);
|
||||
|
||||
int getProName(projectManageBean bean);
|
||||
|
||||
int addProjectManage(projectManageBean bean);
|
||||
|
||||
int updateProjectManage(projectManageBean bean);
|
||||
|
||||
int delProjectManage(String id);
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ import lombok.Data;
|
|||
* @date 2023/11/10 14:22
|
||||
*/
|
||||
@Data
|
||||
public class projectManageBean {
|
||||
public class ProjectManageBean {
|
||||
|
||||
private String id;
|
||||
private String dataKey;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.leader.performance.manager.projectManagement.service;
|
||||
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.ProjectManageBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProjectManageService {
|
||||
|
||||
List<ProjectManageBean> getProjectManageList(ProjectManageBean o);
|
||||
|
||||
int addProjectManage(ProjectManageBean bean);
|
||||
|
||||
int updateProjectManage(ProjectManageBean bean);
|
||||
|
||||
String delProjectManage(String id);
|
||||
|
||||
ProjectManageBean getListProjectManage(String id);
|
||||
|
||||
int updateBind(ProjectManageBean bean);
|
||||
}
|
||||
|
|
@ -1,27 +1,26 @@
|
|||
package com.bonus.leader.performance.manager.projectManagement.service;
|
||||
|
||||
import com.bonus.leader.performance.manager.manager.utils.StringHelper;
|
||||
import com.bonus.leader.performance.manager.projectManagement.dao.projectManageDao;
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.projectManageBean;
|
||||
import com.bonus.leader.performance.manager.projectManagement.dao.ProjectManageDao;
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.ProjectManageBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service("projectManageService")
|
||||
public class projectManageServiceimlp implements projectManageService {
|
||||
@Service("ProjectManageService")
|
||||
public class ProjectManageServiceimlp implements ProjectManageService {
|
||||
@Resource
|
||||
private projectManageDao dao;
|
||||
private ProjectManageDao dao;
|
||||
|
||||
// 重写getProjectManageList方法,用于获取项目列表
|
||||
@Override
|
||||
public List<projectManageBean> getProjectManageList(projectManageBean o) {
|
||||
public List<ProjectManageBean> getProjectManageList(ProjectManageBean o) {
|
||||
// 调用dao层的getProjectManageList方法,传入projectManageBean对象,获取项目列表
|
||||
return dao.getProjectManageList(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addProjectManage(projectManageBean bean) {
|
||||
public int addProjectManage(ProjectManageBean bean) {
|
||||
int proName = dao.getProName(bean);
|
||||
if(proName >0){
|
||||
return 3;
|
||||
|
|
@ -30,7 +29,7 @@ public class projectManageServiceimlp implements projectManageService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int updateProjectManage(projectManageBean bean) {
|
||||
public int updateProjectManage(ProjectManageBean bean) {
|
||||
int proName = dao.getProName(bean);
|
||||
if(proName >0){
|
||||
return 3;
|
||||
|
|
@ -51,4 +50,14 @@ public class projectManageServiceimlp implements projectManageService {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectManageBean getListProjectManage(String id) {
|
||||
return dao.getListProjectManage(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBind(ProjectManageBean bean) {
|
||||
return dao.updateBind(bean);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.bonus.leader.performance.manager.projectManagement.service;
|
||||
|
||||
import com.bonus.leader.performance.manager.projectManagement.entity.projectManageBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface projectManageService {
|
||||
|
||||
List<projectManageBean> getProjectManageList(projectManageBean o);
|
||||
|
||||
int addProjectManage(projectManageBean bean);
|
||||
|
||||
int updateProjectManage(projectManageBean bean);
|
||||
|
||||
String delProjectManage(String id);
|
||||
}
|
||||
|
|
@ -72,4 +72,37 @@ public class SelectController {
|
|||
return list;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("getProjectType")
|
||||
@ApiOperation(value = "查询工程类型")
|
||||
public List<SelectBean> getProjectType(SelectBean o) {
|
||||
List<SelectBean> list = service.getProjectType(o);
|
||||
if (list.size() <= 0) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("getPushNotification")
|
||||
@ApiOperation(value = "查询产业工人系统工程名称")
|
||||
public List<SelectBean> getPushNotification(SelectBean o) {
|
||||
List<SelectBean> list = service.getPushNotification(o);
|
||||
if (list.size() <= 0) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@LogAnnotation
|
||||
@PostMapping("getFound")
|
||||
@ApiOperation(value = "查询领导履职系统工程名称")
|
||||
public List<SelectBean> getFound(SelectBean o) {
|
||||
List<SelectBean> list = service.getFound(o);
|
||||
if (list.size() <= 0) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,10 @@ public interface ProjectManagerDao {
|
|||
List<SelectBean> getVoltageLevel(SelectBean o);
|
||||
|
||||
List<SelectBean> getProjectName(SelectBean o);
|
||||
|
||||
List<SelectBean> getProjectType(SelectBean o);
|
||||
|
||||
List<SelectBean> getPushNotification(SelectBean o);
|
||||
|
||||
List<SelectBean> getFound(SelectBean o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,10 @@ public interface ProjectManagerService {
|
|||
List<SelectBean> getVoltageLevel(SelectBean o);
|
||||
|
||||
List<SelectBean> getProjectName(SelectBean o);
|
||||
|
||||
List<SelectBean> getProjectType(SelectBean o);
|
||||
|
||||
List<SelectBean> getPushNotification(SelectBean o);
|
||||
|
||||
List<SelectBean> getFound(SelectBean o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,4 +34,19 @@ public class ProjectManagerServiceImpl implements ProjectManagerService{
|
|||
return dao.getProjectName(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SelectBean> getProjectType(SelectBean o) {
|
||||
return dao.getProjectType(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SelectBean> getPushNotification(SelectBean o) {
|
||||
return dao.getPushNotification(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SelectBean> getFound(SelectBean o) {
|
||||
return dao.getFound(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,133 @@
|
|||
<?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.bonus.leader.performance.manager.projectManagement.dao.projectManageDao">
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.leader.performance.manager.projectManagement.dao.ProjectManageDao">
|
||||
<!-- 新增,插入项目管理的SQL语句 -->
|
||||
<insert id="addProjectManage">
|
||||
|
||||
<insert id="addProjectManage">
|
||||
INSERT INTO bm_project
|
||||
(
|
||||
pro_name,
|
||||
short_name,
|
||||
pro_type,
|
||||
depart_id,
|
||||
level,
|
||||
pro_status,
|
||||
pro_from,
|
||||
create_time,
|
||||
is_active
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{proName},
|
||||
#{shortName},
|
||||
#{proType},
|
||||
#{projectIds},
|
||||
#{volLevelIds},
|
||||
'1',
|
||||
'2',
|
||||
NOW(),
|
||||
'1'
|
||||
)
|
||||
</insert>
|
||||
<!-- 修改,更新项目管理的SQL语句 -->
|
||||
<update id="updateProjectManage">
|
||||
|
||||
<update id="updateProjectManage">
|
||||
UPDATE bm_project
|
||||
SET
|
||||
pro_name = #{proName},
|
||||
short_name = #{shortName},
|
||||
pro_type = #{proType},
|
||||
depart_id = #{projectIds},
|
||||
level = #{volLevelIds},
|
||||
update_time = NOW()
|
||||
WHERE
|
||||
id = #{id}
|
||||
</update>
|
||||
<update id="updateBind">
|
||||
UPDATE bm_project AS pm_push
|
||||
JOIN bm_project AS pm_found ON pm_found.id = #{pushNotification} AND pm_found.is_active = '1'
|
||||
SET
|
||||
pm_push.real_name = pm_found.real_name,
|
||||
pm_push.pro_type = pm_found.pro_type,
|
||||
pm_push.depart_id = pm_found.depart_id,
|
||||
pm_push.level = pm_found.level,
|
||||
pm_push.pro_status = pm_found.pro_status,
|
||||
pm_push.update_time = NOW(),
|
||||
pm_found.is_active = '0'
|
||||
WHERE
|
||||
pm_push.id = #{found} AND pm_push.is_active = '1'
|
||||
</update>
|
||||
<!-- 删除项目管理的删除操作 -->
|
||||
<delete id="delProjectManage">
|
||||
|
||||
<delete id="delProjectManage">
|
||||
UPDATE bm_project
|
||||
SET
|
||||
is_active = '0'
|
||||
WHERE
|
||||
id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 查询项目管理系统列表 -->
|
||||
<select id="getProjectManageList"
|
||||
resultType="com.bonus.leader.performance.manager.projectManagement.entity.projectManageBean">
|
||||
|
||||
<select id="getProjectManageList"
|
||||
resultType="com.bonus.leader.performance.manager.projectManagement.entity.ProjectManageBean">
|
||||
SELECT
|
||||
bpm.id as id, -- 项目ID
|
||||
if(bpm.real_name IS NULL, bpm.pro_name, bpm.real_name) AS proName, -- 项目名称
|
||||
bpm.short_name as shortName, -- 项目简称
|
||||
so1.org_name as orgName, -- 所属组织
|
||||
sdd.dict_key as proType, -- 工程类型
|
||||
sdd1.dict_key as volLevel, -- 电压等级
|
||||
bpm.pro_status as proStatus, -- 项目状态
|
||||
bpm.pro_from as proSource -- 项目来源
|
||||
FROM bm_project bpm
|
||||
LEFT JOIN sys_data_dict sdd on sdd.id = bpm.pro_type AND sdd.is_active = '1'
|
||||
LEFT JOIN sys_organization so on so.id = bpm.depart_id AND so.is_active = '1'
|
||||
LEFT JOIN sys_organization so1 on so1.id = so.parent_id AND so1.is_active = '1'
|
||||
LEFT JOIN sys_data_dict sdd1 on sdd1.id = bpm.level AND sdd1.is_active = '1'
|
||||
WHERE
|
||||
bpm.is_active = '1'
|
||||
<if test="orgId != null and orgId != ''">
|
||||
AND so1.id = #{orgId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
bpm.pro_name LIKE concat ('%',#{keyWord},'%')
|
||||
OR bpm.real_name LIKE concat ('%',#{keyWord},'%')
|
||||
OR sdd.dict_key LIKE concat ('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="volLevelIds != null and volLevelIds != ''">
|
||||
AND bpm.level = #{volLevelIds}
|
||||
</if>
|
||||
<if test="statusId != null and statusId != ''">
|
||||
AND bpm.pro_status LIKE concat ('%',#{statusId},'%')
|
||||
</if>
|
||||
</select>
|
||||
<!-- 查询工程的名称 -->
|
||||
<select id="getProName" resultType="java.lang.Integer">
|
||||
|
||||
<select id="getProName" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM
|
||||
bm_project
|
||||
WHERE
|
||||
depart_id = #{projectIds} and pro_name = #{projectName}
|
||||
AND is_active = '1'
|
||||
<if test="id != null and id != ''">
|
||||
AND id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
<!-- 查询单个工程信息 -->
|
||||
<select id="getListProjectManage"
|
||||
resultType="com.bonus.leader.performance.manager.projectManagement.entity.ProjectManageBean">
|
||||
SELECT
|
||||
bpm.id as id, -- 项目ID
|
||||
bpm.pro_name as proName, -- 项目名称
|
||||
bpm.short_name as shortName, -- 项目简称
|
||||
bpm.depart_id as orgName, -- 所属组织
|
||||
bpm.pro_type as proType, -- 工程类型
|
||||
bpm.level as volLevel, -- 电压等级
|
||||
bpm.pro_status as proStatus, -- 项目状态
|
||||
bpm.pro_from as proSource -- 项目来源
|
||||
FROM bm_project bpm
|
||||
WHERE
|
||||
bpm.is_active = '1' AND bpm.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 888 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1016 B |
|
After Width: | Height: | Size: 930 B |
|
After Width: | Height: | Size: 1017 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 269 B |
|
After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 628 B |
|
|
@ -32,6 +32,19 @@
|
|||
<li class="layui-nav-item">
|
||||
<!-- <a href='javascript:;' lay-id="-997" data-url="pages/notice/noticePubList.html"><i class="fa fa-envelope-o" aria-hidden="true" title="公告" unreadNotice></i></a>-->
|
||||
</li>
|
||||
<!-- 新增云下载按钮 -->
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:;" class="admin-header-user-cloud">
|
||||
<img id="cloud-img" width="40" style="margin-left: 90%;margin-top: 6%;"/>
|
||||
</a>
|
||||
<dl class="layui-nav-child" id="cloud-img-container" style="width: 300px;height:300px;overflow-y: auto">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">文件 <span style="color: darkolivegreen;cursor: pointer;margin-left: 135px" onclick="delAll()">清空记录</span></div>
|
||||
<div class="layui-card-body" id="cloud-img-record">
|
||||
</div>
|
||||
</div>
|
||||
</dl>
|
||||
</li>
|
||||
<li class="layui-nav-item" pc>
|
||||
<a href="javascript:;" class="admin-header-user">
|
||||
<img />
|
||||
|
|
@ -39,7 +52,7 @@
|
|||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href='javascript:;' lay-id="-999" data-url="pages/user/updateMyself.html"><i class="fa fa-user-circle" aria-hidden="true"></i> 个人信息</a>
|
||||
<a href='javascript:;' lay-id="-999" data-url="pages/personalData.html"><i class="fa fa-user-circle" aria-hidden="true"></i> 个人信息</a>
|
||||
</dd>
|
||||
<!-- <dd>-->
|
||||
<!-- <a href='javascript:;' lay-id="-998" data-url="pages/user/updateHeadImg.html"><i class="fa fa-drupal" aria-hidden="true"></i> 头像</a>-->
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ layui.use(['table', 'layer', 'laydate', 'jquery', 'form'], function () {
|
|||
if ($.inArray('sysMsgContent:update', pers) >= 0) {
|
||||
text +='<a lay-event="edit" style="color: #009688;cursor: pointer;font-size: 16px">编辑</a>';
|
||||
}
|
||||
if ($.inArray('sysMsgContent:del', pers) >= 0) {
|
||||
text +='<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 16px">删除</a>';
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,149 @@ function logout(){
|
|||
});
|
||||
}
|
||||
|
||||
showCloud(1);
|
||||
function showCloud(type){
|
||||
var pro = window.location.protocol;
|
||||
var host = window.location.host;
|
||||
var domain = pro + "//" + host;
|
||||
var img = $(".admin-header-user-cloud img");
|
||||
if (type == 1){
|
||||
img.attr("src", domain+ctxPath+"/img/cloudDownloadGrey.png");
|
||||
}else {
|
||||
img.attr("src", domain+ctxPath+"/img/cloudDownload.png");
|
||||
}
|
||||
}
|
||||
// 获取img元素
|
||||
var cloudImg = document.getElementById('cloud-img');
|
||||
// 监听鼠标移入事件
|
||||
cloudImg.addEventListener('mouseenter', function() {
|
||||
// 鼠标移入img时的操作
|
||||
showCloud(2)
|
||||
//获取下载记录
|
||||
|
||||
getDownloadRecord();
|
||||
|
||||
});
|
||||
function downloads(type){
|
||||
// alert(type)
|
||||
}
|
||||
// 监听鼠标移出事件
|
||||
cloudImg.addEventListener('mouseleave', function() {
|
||||
// 鼠标移出img时的操作
|
||||
showCloud(1)
|
||||
});
|
||||
// 获取img元素
|
||||
var cloudTmgContainer = document.getElementById('cloud-img-container');
|
||||
// 监听鼠标移入事件
|
||||
cloudTmgContainer.addEventListener('mouseenter', function() {
|
||||
// 鼠标移入img时的操作
|
||||
showCloud(2)
|
||||
|
||||
});
|
||||
// 监听鼠标移出事件
|
||||
cloudTmgContainer.addEventListener('mouseleave', function() {
|
||||
// 鼠标移出img时的操作
|
||||
showCloud(1)
|
||||
});
|
||||
|
||||
function getDownloadRecord(){
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/users/getDownloadRecord',
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
async: false,
|
||||
data: {
|
||||
},
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
if ("数据获取成功" == resMsg) {
|
||||
let info = data.obj.fileBeans;
|
||||
$("#cloud-img-record").empty();
|
||||
var htmls = '';
|
||||
if (info == null || info.length == 0) {
|
||||
htmls = '<dd><span >暂无记录</span></dd>';
|
||||
}else {
|
||||
for (let i = 0; i < info.length; i++) {
|
||||
var typePath = getTypeImg(info[i].fileName);
|
||||
htmls += '<dd style="width:280px;height:50px">' +
|
||||
'<div style="float:left">' +
|
||||
'<img src="'+typePath+'" width="45"/>' +
|
||||
'</div>' +
|
||||
'<div style="float:left;color:gray;width:150px;font-size: 12px">' +
|
||||
'<div style="height:20px;margin-top: 0px;font-size: 10px">'+determineStrLength(info[i].fileName)+'</div>' +
|
||||
'<div style="height:20px;font-size: 10px">2023-10-11 10:10:10</div>' +
|
||||
'</div>' +
|
||||
'<div>' +
|
||||
'<img src="./img/login/filetype/download.png" onclick="download(\'' + info[i].filePath +'\',\'' + info[i].fileName +'\')" width="20"/>' +
|
||||
'<img src="./img/login/filetype/chanel.png" onclick="chanel(\'' + info[i].id +'\')" width="20" style="margin-left: 5px"/>' +
|
||||
'</div>' +
|
||||
'</dd>'
|
||||
}
|
||||
}
|
||||
$("#cloud-img-record").append(htmls);
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log("获取下载记录数据出错:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function chanel(id){
|
||||
var index = layer.confirm('确定要删除吗?', {
|
||||
btn : [ '确定', '取消' ]
|
||||
}, function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/users/delRecordById',// 请求地址
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {'id': id}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
layer.close(index);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
layer.msg('删除成功',{icon:1,timeout:2000});
|
||||
}else {
|
||||
layer.msg('删除失败',{icon:2,timeout:2000});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function delAll(){
|
||||
var index = layer.confirm('确定清空记录吗?', {
|
||||
btn : [ '确定', '取消' ]
|
||||
}, function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/users/delAll',// 请求地址
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
layer.close(index);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
layer.msg('删除成功',{icon:1,timeout:2000});
|
||||
}else {
|
||||
layer.msg('删除失败',{icon:2,timeout:2000});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function determineStrLength(str){
|
||||
if (str.length > 13){
|
||||
return str.substr(0, 11) + "..";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
var active;
|
||||
|
||||
layui.use(['layer', 'element'], function() {
|
||||
|
|
@ -211,4 +354,88 @@ layui.use(['layer', 'element'], function() {
|
|||
shadeMobile.on('click', function () {
|
||||
$('body').removeClass('site-mobile');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getTypeImg(str) {
|
||||
if (str.toLowerCase().indexOf("xlsx") > 0 || str.toLowerCase().indexOf("xls") > 0) {
|
||||
return "./img/login/filetype/excel.png";
|
||||
} else if (str.toLowerCase().indexOf("pdf") > 0) {
|
||||
return "./img/login/filetype/pdf.png";
|
||||
} else if (str.toLowerCase().indexOf("ppt") > 0) {
|
||||
return "./img/login/filetype/ppt.png";
|
||||
} else if (str.toLowerCase().indexOf("txt") > 0) {
|
||||
return "./img/login/filetype/txt.png";
|
||||
} else if (str.toLowerCase().indexOf("vsdx") > 0) {
|
||||
return "./img/login/filetype/visio.png";
|
||||
} else if (str.toLowerCase().indexOf("doc") > 0 || str.toLowerCase().indexOf("docx") > 0) {
|
||||
return "./img/login/filetype/word.png";
|
||||
}else if (str.toLowerCase().indexOf("zip") > 0 || str.toLowerCase().indexOf("rar") > 0) {
|
||||
return "./img/login/filetype/zip.png";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取 blob
|
||||
* @param {String} url 目标文件地址
|
||||
* @return {Promise}
|
||||
*/
|
||||
function getBlob(url) {
|
||||
return new Promise(resolve => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
xhr.responseType = 'blob';
|
||||
xhr.onload = () => {
|
||||
if (xhr.status === 200) {
|
||||
resolve(xhr.response);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param {Blob} blob
|
||||
* @param {String} filename 想要保存的文件名称
|
||||
*/
|
||||
function saveAs(blob, filename) {
|
||||
if (window.navigator.msSaveOrOpenBlob) {
|
||||
navigator.msSaveBlob(blob, filename);
|
||||
} else {
|
||||
const link = document.createElement('a');
|
||||
const body = document.querySelector('body');
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = filename;
|
||||
|
||||
// fix Firefox
|
||||
link.style.display = 'none';
|
||||
body.appendChild(link);
|
||||
|
||||
link.click();
|
||||
body.removeChild(link);
|
||||
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载
|
||||
* @param {String} url 目标文件地址
|
||||
* @param {String} filename 想要保存的文件名称
|
||||
*/
|
||||
function download(url, filename) {
|
||||
var truePath;
|
||||
// window.location.href = '/download/download?filePath=' + data.filePath;
|
||||
if (url.indexOf("http") != -1) {
|
||||
truePath = url;
|
||||
} else {
|
||||
truePath = ctxPath + "/statics/" + url;
|
||||
}
|
||||
|
||||
|
||||
getBlob(truePath).then(blob => {
|
||||
saveAs(blob, filename);
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
layui.config({
|
||||
base: '../../js/layuiModules/', // 第三方模块所在目录
|
||||
version: 'v1.6.4' // 插件版本号
|
||||
}).extend({
|
||||
soulTable: 'notice,layNotify', // 模块
|
||||
});
|
||||
let form;
|
||||
var tree;
|
||||
var table;
|
||||
var notice;
|
||||
var layNotify;
|
||||
var oldKeyWord = "";
|
||||
var orgId = "";
|
||||
var statusId = "";
|
||||
var volLevelIds = "";
|
||||
const token = localStorage.getItem("token");
|
||||
let pers = checkPermission();
|
||||
$("#resetBt").click(function(){
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/projectManage/getProjectManageList'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
keyWord: '',
|
||||
orgId: '',
|
||||
volLevelIds: '',
|
||||
statusId: '',
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
$("#keyWord").val('');
|
||||
$("#statusId").val('');
|
||||
getOrgName(form,"");
|
||||
getVoltageLevel(form,"");
|
||||
})
|
||||
$("#searchBt").click(function(){
|
||||
oldKeyWord = $("#keyWord").val();
|
||||
orgId = $("#orgId").val();
|
||||
volLevelIds = $("#volLevelIds").val();
|
||||
statusId = $("#statusId").val();
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/projectManage/getProjectManageList'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
keyWord: oldKeyWord,
|
||||
orgId: orgId,
|
||||
volLevelIds: volLevelIds,
|
||||
statusId: statusId,
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
$("#keyWord").val(oldKeyWord);
|
||||
$("#orgId").val(orgId);
|
||||
$("#volLevelIds").val(volLevelIds);
|
||||
$("#statusId").val(statusId);
|
||||
})
|
||||
$("#addBt").click(function(){
|
||||
localStorage.setItem("id","")
|
||||
layerOpenFormForSencond("新增","./projectManageForm.html");
|
||||
})
|
||||
$("#bind").click(function(){
|
||||
layerOpenFormForSencond("项目绑定","./projectManageBind.html");
|
||||
})
|
||||
$("#exportBt").click(function(){
|
||||
oldKeyWord = $("#keyWord").val();
|
||||
orgId = $("#orgId").val();
|
||||
volLevelIds = $("#volLevelIds").val();
|
||||
statusId = $("#statusId").val();
|
||||
window.location.href = ctxPath + "/projectManage/exportPhysicalCheckResult?"
|
||||
+"orgId=" + orgId
|
||||
+ "&volLevelIds=" + volLevelIds
|
||||
+ "&keyWord=" + oldKeyWord
|
||||
+ "&statusId=" + statusId
|
||||
+ "&type=" + '1'
|
||||
+ "&token=" + token; //下载文件
|
||||
})
|
||||
|
||||
layui.use(['table', 'form','notice', 'layNotify'], function () {
|
||||
table = layui.table;
|
||||
form = layui.form;
|
||||
tree = layui.tree;
|
||||
notice = layui.notice;
|
||||
layNotify = layui.layNotify;
|
||||
|
||||
|
||||
// if ($.inArray('sysProjectManage:add', pers) < 0) {
|
||||
// document.getElementById('addDiv').remove();
|
||||
// }
|
||||
|
||||
|
||||
//渲染表格
|
||||
table.render({
|
||||
elem: '#demo'
|
||||
, url: ctxPath + '/projectManage/getProjectManageList' //数据接口
|
||||
, method: 'post' //方式默认是get
|
||||
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
, where: {} //post请求必须加where ,post请求需要的参数
|
||||
, cellMinWidth: 80
|
||||
, cols: [[ //表头
|
||||
{
|
||||
field: 'number', width:80,title: '序号', align: 'center', type: 'numbers'
|
||||
}
|
||||
, {field: 'orgName', align: 'center', title: '分公司'}
|
||||
, {field: 'proName', align: 'center', title: '工程名称'}
|
||||
, {field: 'proType', align: 'center', title: '工程类型'}
|
||||
, {field: 'volLevel', align: 'center', title: '电压等级'}
|
||||
, {
|
||||
field: 'proStatus', title: '项目状态', align: 'center', templet: d => {
|
||||
let text = "";
|
||||
if (d.proStatus === "1") {
|
||||
text = "<span class='layui-badge-dot layui-bg-green'></span>在建";
|
||||
} else if (d.proStatus === "2") {
|
||||
text = "<span class='layui-badge-dot'></span>已完工";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
, {
|
||||
field: 'proSource', title: '项目来源', align: 'center', templet: d => {
|
||||
let text = "";
|
||||
if (d.proSource === "1") {
|
||||
text = "<span style='color: #FACD91;'>推送</span>";
|
||||
} else if (d.proSource === "2") {
|
||||
text = "<span style='color: #00BFBF;'>创建</span>";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
,{
|
||||
fixed: 'right', width:180, title: '操作', align: 'center', templet: d => {
|
||||
let text = "";
|
||||
let proStatus = d.proSource;
|
||||
if (proStatus == "1") {
|
||||
text = "<span style='color: #cccccc;'>不可操作</span>";
|
||||
}else{
|
||||
if ($.inArray('sysProjectManage:update', pers) > 0) {
|
||||
text +='<a lay-event="update" style="color: #009688;cursor: pointer;font-size: 15px" id="updateBtn">修改</a>';
|
||||
text +='<span lay-event="com" style="font-size: 15px;"> | </span>';
|
||||
}
|
||||
if ($.inArray('sysProjectManage:delete', pers) > 0) {
|
||||
text +='<a lay-event="del" style="color: #009688;cursor: pointer;font-size: 15px" id="deleteBtn" >删除</a>';
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
]]
|
||||
, id: 'menuTable'
|
||||
, page: true //开启分页
|
||||
, loading: true //数据加载中。。。
|
||||
, limits: [5, 10, 20] //一页选择显示3,5或10条数据
|
||||
, limit: 10 //一页显示5条数据
|
||||
, response: {
|
||||
statusCode: 200 //规定成功的状态码,默认:0
|
||||
}, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据,res为从url中get到的数据
|
||||
let result;
|
||||
if (res.data !== '' && res.data != null && res.data !== "null") {
|
||||
if (this.page.curr) {
|
||||
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
|
||||
} else {
|
||||
result = res.data.slice(0, this.limit);
|
||||
}
|
||||
}
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.count, //解析数据长度
|
||||
"data": result, //解析数据列表
|
||||
};
|
||||
}
|
||||
,toolbar: "#toolbar"
|
||||
, done: function(res, curr, count) {
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
// console.log('res.data[i]:', res.data[i])
|
||||
var data = res.data[i];
|
||||
data.planTime = data.startTime + ' ~ ' + data.endTime;
|
||||
console.log('planTime:', data.planTime); // 打印 planTime 的值
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//监听工具条
|
||||
table.on('tool(test)', function (obj) {
|
||||
var data = obj.data; //当前行数据
|
||||
console.log(data)
|
||||
var rowIndex = obj.index;
|
||||
var layEvent = obj.event; //当前点击的事件名
|
||||
var proProcess = data.proProcess;
|
||||
if (layEvent === 'update') {
|
||||
localStorage.setItem('id',data.id);
|
||||
localStorage.setItem('title',data.title);
|
||||
localStorage.setItem('voltageLevelId',data.voltageLevelId);
|
||||
localStorage.setItem('teamName',data.teamName);
|
||||
layerOpenFormForSencond("修改","./projectManageForm.html");
|
||||
}
|
||||
if (layEvent === 'del') {
|
||||
var indexs = layer.confirm('确定要删除吗?', {
|
||||
btn : [ '确定', '取消' ]
|
||||
}, function() {
|
||||
// ajaxCommonMethod('/linePro/delProjectById',{'id': data.id});
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/projectManage/delProjectManage',// 请求地址
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {'id': data.id}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
layer.close(indexs);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
reloadTip("删除","删除成功",'success');
|
||||
} else if ("数据获取失败" === resMsg) {
|
||||
reloadTip("删除","删除失败",'error');
|
||||
}
|
||||
}
|
||||
});
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/projectManage/getProjectManageList'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
keyWord: "",
|
||||
status: "",
|
||||
branchId: "",
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 单元格编辑事件
|
||||
table.on('edit(test)', function (obj) {
|
||||
var field = obj.field; // 得到字段
|
||||
var value = obj.value; // 得到修改后的值
|
||||
var oldValue = obj.oldValue;
|
||||
var data = obj.data; // 得到所在行所有键值
|
||||
var update = {};
|
||||
|
||||
// 值的校验
|
||||
if (field === 'idNumber') {
|
||||
if (value.length != 18) {
|
||||
update[field] = oldValue;
|
||||
obj.update(update);
|
||||
layer.tips('输入的身份证不正确,请重新编辑', this, {tips: 1});
|
||||
return obj.reedit(); // 重新编辑 -- v2.8.0 新增
|
||||
} else {
|
||||
update[field] = value;
|
||||
obj.update(update);
|
||||
}
|
||||
}
|
||||
// 编辑后续操作,如提交更新请求,以完成真实的数据更新
|
||||
// …
|
||||
layer.msg('编辑成功', {icon: 1});
|
||||
});
|
||||
getOrgName(form,null);
|
||||
getVoltageLevel(form, "");
|
||||
|
||||
document.getElementById("searchBt").classList.add("layui-none");
|
||||
});
|
||||
|
||||
function reloadTip(tip,message,type){
|
||||
layNotify.notice({
|
||||
title: tip+"提示",
|
||||
type: type,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ function getAnnouncementType(from,id) {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取项目部数据
|
||||
* 获取分公司数据
|
||||
* @param id 工种id
|
||||
*/
|
||||
function getProjectName(from,id) {
|
||||
|
|
@ -86,7 +86,7 @@ function getProjectName(from,id) {
|
|||
success: function (data) {
|
||||
var res = data;
|
||||
var html = '';
|
||||
html += '<option value="">请选择项目部</option>';
|
||||
html += '<option value="">请选择分公司</option>';
|
||||
for(var i=0;i<res.length;i++){
|
||||
if(id == res[i].id){
|
||||
html += '<option selected value=\'' + res[i].id + '\'>' + res[i].name + '</option>';
|
||||
|
|
@ -405,31 +405,31 @@ function getRole(form,roleId) {
|
|||
* 获取设备工序
|
||||
* @param id 工种id
|
||||
*/
|
||||
function getVoltageLevel(from,id) {
|
||||
$("#volLevelIds").empty();
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/selectUtil/getVoltageLevel',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
var res = data;
|
||||
var html = '';
|
||||
html += '<option value="">请选择电压等级</option>';
|
||||
for(var i=0;i<res.length;i++){
|
||||
if(id == res[i].id || id == res[i].name){
|
||||
html += '<option selected value=\'' + res[i].id + '\'>' + res[i].name + '</option>';
|
||||
}else{
|
||||
html += '<option value=\'' + res[i].id + '\'>' + res[i].name + '</option>';
|
||||
}
|
||||
}
|
||||
$("#volLevelIds").html(html);
|
||||
form.render("select");
|
||||
},
|
||||
error: function (err) {
|
||||
console.log("获取电压等级数据失败:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
// function getVoltageLevel(from,id) {
|
||||
// $("#volLevelIds").empty();
|
||||
// $.ajax({
|
||||
// type: 'post',
|
||||
// url: ctxPath + '/selectUtil/getVoltageLevel',
|
||||
// async: false,
|
||||
// success: function (data) {
|
||||
// var res = data;
|
||||
// var html = '';
|
||||
// html += '<option value="">请选择电压等级</option>';
|
||||
// for(var i=0;i<res.length;i++){
|
||||
// if(id == res[i].id || id == res[i].name){
|
||||
// html += '<option selected value=\'' + res[i].id + '\'>' + res[i].name + '</option>';
|
||||
// }else{
|
||||
// html += '<option value=\'' + res[i].id + '\'>' + res[i].name + '</option>';
|
||||
// }
|
||||
// }
|
||||
// $("#volLevelIds").html(html);
|
||||
// form.render("select");
|
||||
// },
|
||||
// error: function (err) {
|
||||
// console.log("获取电压等级数据失败:", err);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取设备工序
|
||||
|
|
@ -518,3 +518,98 @@ function getSelect(form,Id) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/********************************************************领导履职********************************************************/
|
||||
/**
|
||||
* 获取工程类型
|
||||
* @param form
|
||||
* @param Id
|
||||
*/
|
||||
function getProjectType(form,Id) {
|
||||
$("#parentId").html("");
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/selectUtil/getProjectType',
|
||||
data: {
|
||||
},
|
||||
async: false,
|
||||
success: function (data) {
|
||||
var html = '<option value="">--请选择--</option>';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (Id == data[i].id) {
|
||||
html += '<option selected="selected" value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
||||
} else {
|
||||
html += '<option value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
||||
}
|
||||
}
|
||||
$("#proType").html(html);
|
||||
layui.form.render('select');
|
||||
},
|
||||
error: function (err) {
|
||||
console.log("获取工程类型下拉列表出错:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产业工人系统工程名称
|
||||
* @param form
|
||||
* @param Id
|
||||
*/
|
||||
function getPushNotification(form,Id) {
|
||||
$("#parentId").html("");
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/selectUtil/getPushNotification',
|
||||
data: {
|
||||
},
|
||||
async: false,
|
||||
success: function (data) {
|
||||
var html = '<option value="">--请选择--</option>';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (Id == data[i].id) {
|
||||
html += '<option selected="selected" value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
||||
} else {
|
||||
html += '<option value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
||||
}
|
||||
}
|
||||
$("#pushNotification").html(html);
|
||||
layui.form.render('select');
|
||||
},
|
||||
error: function (err) {
|
||||
console.log("获取产业工人系统工程下拉列表出错:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取领导履职系统工程名称
|
||||
* @param form
|
||||
* @param Id
|
||||
*/
|
||||
function getFound(form,Id) {
|
||||
$("#parentId").html("");
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/selectUtil/getFound',
|
||||
data: {
|
||||
},
|
||||
async: false,
|
||||
success: function (data) {
|
||||
var html = '<option value="">--请选择--</option>';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (Id == data[i].id) {
|
||||
html += '<option selected="selected" value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
||||
} else {
|
||||
html += '<option value=\'' + data[i].id + '\'>' + data[i].name + '</option>';
|
||||
}
|
||||
}
|
||||
$("#found").html(html);
|
||||
layui.form.render('select');
|
||||
},
|
||||
error: function (err) {
|
||||
console.log("获取领导履职系统工程下拉列表出错:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>个人资料</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../js/layui-v2.9.6/css/layui.css">
|
||||
<style>
|
||||
.framework{
|
||||
display: flex;
|
||||
width: 1260px;
|
||||
height: 756px;
|
||||
margin-top: 1%;
|
||||
margin-left: 11%;
|
||||
border: 1px solid #dfd9d9;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="framework">
|
||||
<div class="layui-panel" style="width: 260px;">
|
||||
<ul class="layui-menu" id="demo-menu">
|
||||
<li lay-options="{id: 100}">
|
||||
<div class="layui-menu-body-title">
|
||||
<a href="javascript:;" data-url="./user/addUserFormS.html">资料设置</a>
|
||||
</div>
|
||||
</li>
|
||||
<li lay-options="{id: 101}">
|
||||
<div class="layui-menu-body-title">
|
||||
<a href="javascript:;" data-url="./from.html">修改密码</a>
|
||||
</div>
|
||||
</li>
|
||||
<li lay-options="{id: 102}">
|
||||
<div class="layui-menu-body-title">
|
||||
<a href="javascript:;" data-url="./from.html">登录记录</a>
|
||||
</div>
|
||||
</li>
|
||||
<li lay-options="{id: 103}">
|
||||
<div class="layui-menu-body-title">
|
||||
<a href="javascript:;" data-url="./from.html">系统通知</a>
|
||||
<!-- <span class="layui-badge-dot"></span>-->
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-body" style="width: 100%;height: 100%;left: 0px;">
|
||||
<!-- tab切换区域 -->
|
||||
<div class="layui-tab-item layui-show" lay-filter="docDemoTabBrief" style="height: 100%;">
|
||||
<iframe id="myIframe" src="./user/addUserForms.html" frameborder="0" style="width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="../js/layui-v2.9.6/layui.js"></script>
|
||||
<script>
|
||||
layui.use(function(){
|
||||
var dropdown = layui.dropdown;
|
||||
var layer = layui.layer;
|
||||
var util = layui.util;
|
||||
dropdown.on('click(demo-menu)', function(options){
|
||||
console.log(options);
|
||||
var id = options.id;
|
||||
let url;
|
||||
if(id == '100')
|
||||
{
|
||||
// url = './user/updateMyself.html';
|
||||
url = './user/addUserForms.html';
|
||||
}else if(id == '101')
|
||||
{
|
||||
url = './user/changePassword.html';
|
||||
}else if(id == '102')
|
||||
{
|
||||
url = './user/noticeDetail.html';
|
||||
}else if(id == '103')
|
||||
{
|
||||
url = './user/systemNotifications.html';
|
||||
}
|
||||
document.getElementById('myIframe').src = url;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>工程绑定表单</title>
|
||||
<link rel="stylesheet" href="../../js/layui-v2.9.6/css/layui.css" media="all"/>
|
||||
</head>
|
||||
<style>
|
||||
.layui-form-label {
|
||||
position: relative;
|
||||
float: left;
|
||||
display: block;
|
||||
padding: 9px 15px;
|
||||
width: 100%;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
.layui-form-item .layui-input-inline {
|
||||
margin-right: 22px;
|
||||
}
|
||||
/* 弹出层外部容器样式 */
|
||||
.layui-layer {
|
||||
border-radius: 10px; /* 设置圆角半径,根据需要调整 */
|
||||
}
|
||||
|
||||
/* 弹出层内部容器样式(如果需要) */
|
||||
.layui-layer-content {
|
||||
border-radius: 10px; /* 设置圆角半径,根据需要调整 */
|
||||
overflow: hidden; /* 防止内容溢出圆角区域 */
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<form class="layui-form" action="" onsubmit="return false">
|
||||
<div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>产业工人系统工程名称:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<select id="pushNotification" name="pushNotification" class="layui-select" lay-search=""
|
||||
lay-filter="ProjectType" lay-verify="required"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>领导履职系统工程名称:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<select id="found" name="found" class="layui-select" lay-search=""
|
||||
lay-filter="volLevelIds" lay-verify="required"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="display: none">
|
||||
<div class="layui-input-block">
|
||||
<button type="submit" class="layui-btn subBtn" id="commit" lay-submit lay-filter="formDemo">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<table id="demo" lay-filter="test" style="padding: 10px"></table>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script src="../../js/jquery-3.6.0.js"></script>
|
||||
<script src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: '../../js/layuiModules/', // 第三方模块所在目录
|
||||
version: 'v1.6.4' // 插件版本号
|
||||
}).extend({
|
||||
soulTable: 'notice,layNotify,notice', // 模块
|
||||
});
|
||||
|
||||
var form;
|
||||
var table;
|
||||
var laydate
|
||||
var notice;
|
||||
var layarea;
|
||||
var layNotify;
|
||||
var id = localStorage.getItem("id");
|
||||
var type = "1";
|
||||
|
||||
layui.use(['table', 'form','notice', 'layNotify', 'layarea'], function () {
|
||||
table = layui.table;
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
notice = layui.notice;
|
||||
layNotify = layui.layNotify;
|
||||
layarea = layui.layarea;
|
||||
|
||||
layarea.render({
|
||||
elem: '#area-picker3',
|
||||
change: function (res) {
|
||||
//选择结果
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
getPushNotification(form, "");
|
||||
getFound(form, "");
|
||||
// 验证成功后才会执行下面的操作
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
console.log(data.field);
|
||||
data.field.id = id;
|
||||
addInfo(data); //新增方法
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增或修改的提交方法
|
||||
* @param formData
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function addInfo(formData) {
|
||||
var tip = '保存';
|
||||
var formUrl = ctxPath + "/projectManage/updateBind";
|
||||
formData.field.id = id;
|
||||
console.log(formData.field)
|
||||
// 加载提示
|
||||
addLoadingMsg = top.layer.msg('数据上传中,请稍候...', {
|
||||
icon: 16,
|
||||
scrollbar: false,
|
||||
time: 0,
|
||||
shade: [0.8, '#393D49']
|
||||
});
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: formUrl, // 请求地址
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: JSON.stringify(formData.field), //获取提交的表单字段
|
||||
success: function (data) {
|
||||
if (data.resMsg === "发起成功") {
|
||||
parent.layer.closeAll();
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
parent.layer.msg(tip + '成功', {icon: 1, time: 2000});
|
||||
window.parent.location.reload();
|
||||
} else if (data.resMsg === "该项目部下已存在改工程") {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg("该项目部下已存在改工程", {icon: 0, time: 2000})
|
||||
} else {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg(tip + '失败', {icon: 2, time: 2000});
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reloadTip(tip,message,type){
|
||||
parent.layNotify.notice({
|
||||
title: tip+"提示",
|
||||
type: type,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>线路工程表单</title>
|
||||
<link rel="stylesheet" href="../../js/layui-v2.9.6/css/layui.css" media="all"/>
|
||||
</head>
|
||||
<style>
|
||||
.layui-form-label {
|
||||
position: relative;
|
||||
float: left;
|
||||
display: block;
|
||||
padding: 9px 15px;
|
||||
width: 100%;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
.layui-form-item .layui-input-inline {
|
||||
margin-right: 22px;
|
||||
}
|
||||
/* 弹出层外部容器样式 */
|
||||
.layui-layer {
|
||||
border-radius: 10px; /* 设置圆角半径,根据需要调整 */
|
||||
}
|
||||
|
||||
/* 弹出层内部容器样式(如果需要) */
|
||||
.layui-layer-content {
|
||||
border-radius: 10px; /* 设置圆角半径,根据需要调整 */
|
||||
overflow: hidden; /* 防止内容溢出圆角区域 */
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<form class="layui-form" action="" onsubmit="return false">
|
||||
<div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>工程名称:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<input class="teamName layui-input" id="proName" name="proName"
|
||||
lay-verify="required" placeholder="填写工程名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>工程简称:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<input class="teamName layui-input" id="shortName" name="shortName"
|
||||
lay-verify="" placeholder="填写工程简称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>工程类型:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<select id="proType" name="proType" class="layui-select" lay-search=""
|
||||
lay-filter="ProjectType" lay-verify="required"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>所属分公司:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<select id="projectIds" name="projectIds" class="layui-select" lay-search=""
|
||||
lay-filter="volLevelIds" lay-verify="required"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 1%;">
|
||||
<div class="layui-input-inline">
|
||||
<label class="layui-form-label"><i class="tip-required"
|
||||
style="color: red;font-size: 20px">*</i>电压等级:</label>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="border: 0px dashed dimgrey;width: 74%;">
|
||||
<select id="volLevelIds" name="volLevelIds" class="layui-select" lay-search=""
|
||||
lay-filter="volLevelIds" lay-verify="required"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="display: none">
|
||||
<div class="layui-input-block">
|
||||
<button type="submit" class="layui-btn subBtn" id="commit" lay-submit lay-filter="formDemo">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<table id="demo" lay-filter="test" style="padding: 10px"></table>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script src="../../js/jquery-3.6.0.js"></script>
|
||||
<script src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: '../../js/layuiModules/', // 第三方模块所在目录
|
||||
version: 'v1.6.4' // 插件版本号
|
||||
}).extend({
|
||||
soulTable: 'notice,layNotify,notice', // 模块
|
||||
});
|
||||
|
||||
var form;
|
||||
var table;
|
||||
var newData;
|
||||
var laydate
|
||||
var notice;
|
||||
var layarea;
|
||||
var layNotify;
|
||||
var id = localStorage.getItem("id");
|
||||
var finalData;
|
||||
var type = "1";
|
||||
|
||||
layui.use(['table', 'form','notice', 'layNotify', 'layarea'], function () {
|
||||
table = layui.table;
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
notice = layui.notice;
|
||||
layNotify = layui.layNotify;
|
||||
layarea = layui.layarea;
|
||||
|
||||
layarea.render({
|
||||
elem: '#area-picker3',
|
||||
change: function (res) {
|
||||
//选择结果
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (isEmpty(id)) {
|
||||
//新增
|
||||
getVoltageLevel(form, "");
|
||||
getProjectName(form, "");
|
||||
getProjectType(form, "");
|
||||
} else {
|
||||
type = "2";
|
||||
//修改
|
||||
// document.getElementById("teamTypeId").style.readOnly = true;
|
||||
getList();
|
||||
}
|
||||
|
||||
|
||||
// 验证成功后才会执行下面的操作
|
||||
form.on('submit(formDemo)', function (data) {
|
||||
// if (endTime <= startTime) {
|
||||
// layer.msg('完工时间必须大于开工时间', {icon: 2});
|
||||
// return false; // 阻止表单提交
|
||||
// }else {
|
||||
//
|
||||
// }
|
||||
console.log(data.field);
|
||||
data.field.id = id;
|
||||
addInfo(data); //新增方法
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增或修改的提交方法
|
||||
* @param formData
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function addInfo(formData) {
|
||||
var tip = '保存';
|
||||
var formUrl = ctxPath + "/projectManage/addProjectManage";
|
||||
if (id != '') {
|
||||
formUrl = ctxPath + "/projectManage/updateProjectManage";
|
||||
tip = '修改';
|
||||
}
|
||||
formData.field.id = id;
|
||||
console.log(formData.field)
|
||||
// 加载提示
|
||||
addLoadingMsg = top.layer.msg('数据上传中,请稍候...', {
|
||||
icon: 16,
|
||||
scrollbar: false,
|
||||
time: 0,
|
||||
shade: [0.8, '#393D49']
|
||||
});
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: formUrl, // 请求地址
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: JSON.stringify(formData.field), //获取提交的表单字段
|
||||
success: function (data) {
|
||||
if (data.resMsg === "发起成功") {
|
||||
parent.layer.closeAll();
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
parent.layer.msg(tip + '成功', {icon: 1, time: 2000});
|
||||
window.parent.location.reload();
|
||||
} else if (data.resMsg === "该项目部下已存在改工程") {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg("该项目部下已存在改工程", {icon: 0, time: 2000})
|
||||
} else {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg(tip + '失败', {icon: 2, time: 2000});
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取单个数据进行回显
|
||||
*/
|
||||
function getList() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/projectManage/getListProjectManage',// 请求地址
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {'id': id}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
if ("数据获取成功" === resMsg) {
|
||||
let info = data.obj.projectManage;
|
||||
$("#proName").val(info.proName);
|
||||
$("#shortName").val(info.shortName);
|
||||
getVoltageLevel(form, info.volLevel);
|
||||
getProjectName(form, info.orgName);
|
||||
getProjectType(form, info.proType);
|
||||
|
||||
layarea.render({
|
||||
elem: '#area-picker3',
|
||||
data: {
|
||||
province: province,
|
||||
city: city,
|
||||
},
|
||||
change: function (res) {
|
||||
//选择结果
|
||||
console.log(res);
|
||||
}
|
||||
});
|
||||
form.render();
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
// layer.close(loadingMsg);
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reloadTip(tip,message,type){
|
||||
parent.layNotify.notice({
|
||||
title: tip+"提示",
|
||||
type: type,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>工程管理--线路工程列表</title>
|
||||
<link rel="stylesheet" href="../../js/layui-v2.9.6/css/layui.css" media="all"/>
|
||||
</head>
|
||||
<style>
|
||||
.layui-table th{
|
||||
font-weight: bold;
|
||||
text-align: center
|
||||
}
|
||||
.layui-table td{
|
||||
text-align: center
|
||||
}
|
||||
.layui-btn-sm {
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
padding: 0px 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
<body style="margin-left: 15px">
|
||||
<form class="layui-form" action="" onsubmit="return false">
|
||||
<div class="layui-form-item" style="margin-bottom: 0px;">
|
||||
<div class="layui-inline" style="margin-top: 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyWord" name="keyWord" placeholder="请输入关键字" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
||||
<select id="orgId" name="orgId" class="layui-select" lay-search=""></select>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
||||
<select id="volLevelIds" name="volLevelIds" class="layui-select" lay-search=""></select>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 150px;margin-left: 18px;">
|
||||
<select id="statusId" name="statusId" class="form-control input-sm">
|
||||
<option value="">请选择状态</option>
|
||||
<option value="1">在建</option>
|
||||
<option value="2">已完工</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button id="searchBt" class="layui-btn layui-btn-sm">查询</button>
|
||||
<button id="resetBt" class="layui-btn layui-btn-sm">重置</button>
|
||||
<button id="addBt" class="layui-btn layui-btn-sm" permission="sysProjectManage:add">新增</button>
|
||||
<button id="exportBt" class="layui-btn layui-btn-sm">导出</button>
|
||||
<button id="bind" class="layui-btn layui-btn-sm" permission="sysProjectManage:bind" style="background-color: #FF9900">项目绑定</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table id="demo" lay-filter="test"></table>
|
||||
|
||||
<script type="text/html" id="toolsBar">
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script src="../../js/jquery-3.6.0.js"></script>
|
||||
<script src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script src="../../js/projectManagement/lineProjectList.js"></script>
|
||||
|
|
@ -0,0 +1,363 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>用户查询--新增</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../js/layui-v2.9.6/css/layui.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/publicStyles.css">
|
||||
<link rel="stylesheet" href="../../css/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
|
||||
<style>
|
||||
.layui-form-label {
|
||||
width: 16%;
|
||||
}
|
||||
|
||||
.layui-inline {
|
||||
width: 90%
|
||||
}
|
||||
|
||||
.layui-input {
|
||||
width: 84%
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.layui-form-select dl {
|
||||
position: absolute;
|
||||
left: 19.3% !important;
|
||||
top: 50px;
|
||||
padding: 5px 0;
|
||||
z-index: 899;
|
||||
min-width: 84%;
|
||||
border: 1px solid #eee;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
box-shadow: 1px 1px 4px rgb(0 0 0 / 8%);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
xm-select {
|
||||
background-color: #FFF;
|
||||
position: relative;
|
||||
border: 1px solid #E6E6E6;
|
||||
border-radius: 2px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
height: 45px !important;
|
||||
}
|
||||
|
||||
xm-select > .xm-tips {
|
||||
color: #757575 !important;
|
||||
padding: 0 10px;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
font-family: math;
|
||||
font-size: 16px !important;
|
||||
margin-top: 2px !important;
|
||||
}
|
||||
|
||||
xm-select > .xm-label .scroll .label-content {
|
||||
display: flex;
|
||||
padding: 7px 10px !important;
|
||||
}
|
||||
#orgContent{
|
||||
display:none;
|
||||
overflow: auto;
|
||||
width: 30%;
|
||||
height: 300px;
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
background-color: rgb(255 255 255);
|
||||
left: 195.875px;
|
||||
border: 1px solid #e1e1e1;
|
||||
top: 48px;
|
||||
}
|
||||
.layui-form-select .layui-edge {
|
||||
left: 86%;
|
||||
}
|
||||
.layui-input {
|
||||
width: 69%;
|
||||
}
|
||||
.layui-form-select dl {
|
||||
left: 16%;
|
||||
min-width: 69%;
|
||||
}
|
||||
.layui-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" id="projectForm" action="" onsubmit="">
|
||||
<div class="layui-form-item" style="margin-top: 2%;width: 99%">
|
||||
<div class="layui-form-item" style="margin-top: 3%;">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><i class="tip-required" style="color: red;font-size: 20px">*</i>用户名:</label>
|
||||
<input type="text" name="username" lay-verify="required"
|
||||
id="username" required class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 20px;">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><i class="tip-required" style="color: red;font-size: 20px">*</i>联系方式:</label>
|
||||
<input type="text" name="phone" lay-verify="required" id="phone" maxlength="11" class="layui-input" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 20px;">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><i class="tip-required" style="color: red;font-size: 20px">*</i>部门:</label>
|
||||
<input class="inp" id="department" readonly="readonly" style="text-align: center;font-size: 26px;height:40px;border: 1px solid #f1ecec;width: 30%;" value="点击进行部门选择" jyValidate="required" type="text" onclick="showRole(); return false;" />
|
||||
<input type="hidden" id="departmentId" name="departmentId">
|
||||
<div id='orgContent' class="menuContent ztreeMC">
|
||||
<ul id="departmentTree" class="ztree accountOrgTree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 20px;">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label"><i class="tip-required" style="color: red;font-size: 20px">*</i>角色:</label>
|
||||
<select id="roleId" class="layui-select" name="roleId" lay-verify="required">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button type="submit" class="layui-btn" id="commit" lay-submit lay-filter="demo1">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
<script type="text/javascript" src="../../js/jquery-3.6.0.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/dict.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script src="../../css/ztree/3.5/jquery.ztree.all.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var form;
|
||||
var layuiForm;
|
||||
$(function () {
|
||||
|
||||
$("#commit").click(function () {
|
||||
var formData = {
|
||||
"username": $("#username").val(),
|
||||
"phone": $("#phone").val(),
|
||||
"departmentId": $("#departmentId").val(),
|
||||
"roleId": $("#roleId").val()
|
||||
}
|
||||
addInfo(formData);
|
||||
});
|
||||
|
||||
layui.use(['form', 'laydate', 'upload'], function () {
|
||||
form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
||||
layuiForm = form;
|
||||
laydate = layui.laydate;
|
||||
form.render();
|
||||
form.verify({});
|
||||
/**
|
||||
* 人员角色下拉框
|
||||
*/
|
||||
getRole(form, null);
|
||||
/**
|
||||
* 部门下拉树
|
||||
*/
|
||||
loadOrgTree();
|
||||
/**
|
||||
* 修改方法调用数据回显
|
||||
*/
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false, // 默认异步true,false表示同步
|
||||
url: ctxPath + '/users/getListPerson',// 请求地址
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
data: {}, //获取提交的表单字段
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
if ("数据获取成功" === resMsg) {
|
||||
let info = data.obj.sysUser;
|
||||
$("#username").val(info.username);
|
||||
$("#phone").val(info.phone);
|
||||
getRole(form, info.roleId);
|
||||
$("#departmentId").val(info.departmentId);
|
||||
$("#department").val(info.department);
|
||||
}
|
||||
},
|
||||
error: function (XMLHttpRequest, textStatus, e) {
|
||||
// layer.close(loadingMsg);
|
||||
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
||||
}
|
||||
});
|
||||
// 验证成功后才会执行下面的操作
|
||||
/**
|
||||
* 点击除了部门输入框和下拉树范围之外的地方,关闭下拉树列表
|
||||
*/
|
||||
$(document).on('click',function(e){
|
||||
if ($(e.target).closest('#orgContent').length == 0 && $(e.target).closest('#department').length == 0){
|
||||
hideRole();
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增或修改的提交方法
|
||||
* @param formData
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function addInfo(formData) {
|
||||
// if (!phone_reg($("#phone").val())) {
|
||||
// layer.msg("手机号码错误,请仔细核对!", {icon: 0});
|
||||
// return false;
|
||||
// }
|
||||
// if ($("#department").val() == "点击进行部门选择") {
|
||||
// layer.msg("请选择部门!", {icon: 0});
|
||||
// return false;
|
||||
// }
|
||||
// formUrl = ctxPath + "/users/updatePerson";
|
||||
tip = '修改';
|
||||
// 加载提示
|
||||
addLoadingMsg = top.layer.msg('数据上传中,请稍候...', {
|
||||
icon: 16,
|
||||
scrollbar: false,
|
||||
time: 0,
|
||||
shade: [0.8, '#393D49']
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: ctxPath + '/users/updatePerson',
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
async: false,
|
||||
data: JSON.stringify(formData),
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (data) {
|
||||
if (data.resMsg === "发起成功") {
|
||||
layer.closeAll();
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg(tip + '成功', {icon: 1, time: 2000});
|
||||
location.reload();
|
||||
} else if (data.resMsg === "人员已存在") {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg("用户已存在", {icon: 0, time: 2000})
|
||||
}else if (data.resMsg === "手机号已存在") {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg("手机号已存在", {icon: 0, time: 2000})
|
||||
}else {
|
||||
top.layer.close(addLoadingMsg); //再执行关闭
|
||||
layer.msg(tip + '失败', {icon: 2, time: 2000});
|
||||
}
|
||||
},
|
||||
error: function (err) {
|
||||
console.log("获取工程下拉列表出错:", err);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取单个数据进行回显
|
||||
*/
|
||||
function getList() {
|
||||
|
||||
}
|
||||
|
||||
/** 树的方法开始 */
|
||||
var machines = new Set(); //专业容器
|
||||
var size = 1; //序号
|
||||
var map =[];
|
||||
var mapinfo={};
|
||||
function loadOrgTree(){
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: ctxPath + "/users/getDepartmentTree",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$.fn.zTree.init($("#departmentTree"),{view:{dblClickExpand:true,selectedMulti:false,nameIsHTML:true},data:{simpleData:{enable: true}},
|
||||
callback:{onClick:clickRole
|
||||
}},data.obj);
|
||||
// 获取树对象
|
||||
var treeObj = $.fn.zTree.getZTreeObj("departmentTree");
|
||||
/* 获取所有树节点 */
|
||||
var nodes = treeObj.transformToArray(treeObj.getNodes());
|
||||
//展开第一级树
|
||||
treeObj.expandNode(nodes[1], true);
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
alert("未连接到服务器,请检查网络!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业的选择
|
||||
*/
|
||||
var preisShow=false;//窗口是否显示
|
||||
function showRole() {
|
||||
if(preisShow){
|
||||
hideRole();
|
||||
}else{
|
||||
var obj = $("#department");
|
||||
var offpos = $("#department").position();
|
||||
$("#orgContent").css({width:offpos.width+"px",left:offpos.left+"px",top:offpos.top+obj.heigth+"px"}).slideDown("fast");
|
||||
preisShow=true;
|
||||
}
|
||||
}
|
||||
|
||||
function hideRole(){
|
||||
$("#orgContent").fadeOut("fast");
|
||||
preisShow=false;
|
||||
}
|
||||
var isParent = null
|
||||
var examPerfession = null;
|
||||
var typeId = null;
|
||||
function clickRole(e, treeId, treeNode) {
|
||||
// if(!treeNode.isParent){
|
||||
var check = (treeNode);
|
||||
if(check){
|
||||
var zTree = $.fn.zTree.getZTreeObj("departmentTree"),
|
||||
nodes = zTree.getSelectedNodes(),v ="",n ="",o="",p="";
|
||||
for (var i=0, l=nodes.length; i<l; i++) {
|
||||
v += nodes[i].name + ",";//获取name值
|
||||
n += nodes[i].id + ",";//获取id值
|
||||
o += nodes[i].other + ",";//获取自定义值
|
||||
var pathNodes=nodes[i].getPath();
|
||||
for(var y=0;y<pathNodes.length;y++){
|
||||
p+=pathNodes[y].name+"/";//获取path/name值
|
||||
}
|
||||
}
|
||||
if (v.length > 0 ) v = v.substring(0, v.length-1);
|
||||
if (n.length > 0 ) n = n.substring(0, n.length-1);
|
||||
if (o.length > 0 ) o = o.substring(0, o.length-1);
|
||||
if (p.length > 0 ) p = p.substring(0, p.length-1);
|
||||
$("#departmentId").val(n);
|
||||
$("#department").val(p);
|
||||
// typeId = n;
|
||||
examPerfession = n;
|
||||
isParent = treeNode.isParent;
|
||||
typeId = treeNode.type;
|
||||
hideRole();
|
||||
}
|
||||
// }
|
||||
}
|
||||
/**树的方法结束*/
|
||||
|
||||
</script>
|
||||
|
|
@ -1,24 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>修改密码</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../js/layui-v2.9.6/css/layui.css">
|
||||
<style>
|
||||
.from-sty{
|
||||
font: 16px "Helvetica Neue", Helvetica, "PingFang SC", Tahoma, Arial, sans-serif;
|
||||
}
|
||||
.button-sty{
|
||||
height: 38px!important;
|
||||
line-height: 38px!important;
|
||||
font-size: 16px!important;
|
||||
width: 90px!important;
|
||||
background-color: #009688!important;
|
||||
border-color: #009688!important;
|
||||
color: #fff!important;
|
||||
}
|
||||
.form-control {
|
||||
width: 82%;
|
||||
height: 45px;
|
||||
}
|
||||
.button-sty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<form class="form-horizontal" onsubmit="return false" id="form">
|
||||
<fieldset>
|
||||
<fieldset style="margin-top: 2%;">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">用户名</label>
|
||||
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>联系方式:(登录名)</label>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" placeholder="用户名" type="text" id="username" readonly="readonly" name="username"
|
||||
<input class="form-control" placeholder="联系方式" type="text" id="username" readonly="readonly" name="username"
|
||||
data-bv-notempty="true"
|
||||
data-bv-notempty-message="用户名 不能为空">
|
||||
data-bv-notempty-message="联系方式 不能为空">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">旧密码</label>
|
||||
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>旧密码:</label>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" placeholder="旧密码" type="text" name="oldPassword"
|
||||
data-bv-notempty="true"
|
||||
|
|
@ -26,7 +51,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">新密码</label>
|
||||
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>新密码:</label>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" placeholder="新密码" type="text" name="newPassword" id="newPassword"
|
||||
data-bv-notempty="true"
|
||||
|
|
@ -38,7 +63,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">再次输入新密码</label>
|
||||
<label class="col-md-2 control-label from-sty"><i class="tip-required" style="color: red;font-size: 20px">*</i>再次输入新密码:</label>
|
||||
<div class="col-md-10">
|
||||
<input class="form-control" placeholder="再次输入新密码" type="text" name="newPassword2" id="newPassword2"
|
||||
data-bv-notempty="true"
|
||||
|
|
@ -51,9 +76,10 @@
|
|||
<div class="form-actions">
|
||||
<div class="row" align="center">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" type="submit" onclick="update()">
|
||||
<i class="fa fa-save"></i> 保存
|
||||
<button class="btn btn-primary button-sty" type="submit" onclick="update()">
|
||||
<i class="fa fa-save" style="margin-right: 5px;"></i>保存
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -61,9 +87,9 @@
|
|||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript" src="../../js/jquery-3.6.0.js"></script>
|
||||
<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
|
@ -77,7 +103,8 @@
|
|||
async : false,
|
||||
data : $("#form").serialize(),
|
||||
success : function(data) {
|
||||
$("#username").val(data.username);
|
||||
console.log(data)
|
||||
$("#username").val(data.phone);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -99,7 +126,8 @@
|
|||
data : $("#form").serialize(),
|
||||
success : function(data) {
|
||||
layer.msg("修改成功", {shift: -1, time: 1000}, function(){
|
||||
deleteCurrentTab();
|
||||
// deleteCurrentTab();
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>个人信息-登陆记录</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="loginRecords"></div>
|
||||
</body>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script src="../../js/jquery-3.6.0.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript" src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/common.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script type="text/javascript" src="../../js/dict.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
$.ajax({
|
||||
url: ctxPath + "/users/getLoginLog",
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
// 当 AJAX 请求成功时执行的回调函数
|
||||
var loginData = data;
|
||||
document.getElementById('loginRecords').innerHTML = generateLoginRecords(loginData);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// 当 AJAX 请求失败时执行的回调函数
|
||||
console.log('AJAX Error: ', error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function generateLoginRecords(data) {
|
||||
var html = '';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var date = data[i].date;
|
||||
var records = data[i].records;
|
||||
|
||||
html += '<h4 style="color: rgb(153, 153, 153);">' + date + '</h4>';
|
||||
|
||||
for (var j = 0; j < records.length; j++) {
|
||||
var record = records[j];
|
||||
html += '<div style="border: 1px solid #ccc; padding: 10px; margin-bottom: 10px;">';
|
||||
html += '<div style="display: flex; justify-content: space-between;">';
|
||||
html += '<div><strong>系统名称:</strong> ' + record.system + '</div>';
|
||||
html += '<div><strong>登录时间:</strong> ' + record.time + '</div>';
|
||||
html += '</div>';
|
||||
html += '<div><strong>' + record.hostName + '</strong> ' + record.ip + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
}
|
||||
return html;
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>系统通知</title>
|
||||
<link rel="stylesheet" href="../../js/layui-v2.9.6/css/layui.css" media="all"/>
|
||||
</head>
|
||||
<body>
|
||||
<form class="layui-form" action="" onsubmit="return false" style="margin-top: 3%;margin-left: 2%;">
|
||||
<div class="layui-form-item" style="margin-bottom: 0;">
|
||||
<div class="layui-input-inline" style="width: 70px;margin-top: 2px">
|
||||
<button id="allBt" class="layui-btn layui-btn-sm layui-btn-normal" onclick="toggleButton('allBt')">全部消息</button>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 70px;margin-top: 2px">
|
||||
<button id="announcementBt" class="layui-btn layui-btn-sm" onclick="toggleButton('announcementBt')">系统公告</button>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 70px;margin-top: 2px">
|
||||
<button id="notificationBt" class="layui-btn layui-btn-sm" onclick="toggleButton('notificationBt')">系统通知</button>
|
||||
</div>
|
||||
<div>
|
||||
<span id="readAlready" style="color: rgb(153, 153, 153);margin-left: 65%;">全部标记为已读</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table id="demo" lay-filter="test"></table>
|
||||
</body>
|
||||
</html>
|
||||
<script src="../../js/jquery-3.6.0.js"></script>
|
||||
<script src="../../js/layui-v2.9.6/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script src="../../js/common_methon.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../js/select.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/permission.js"></script>
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: '../../js/layuiModules/', // 第三方模块所在目录
|
||||
version: 'v1.6.4' // 插件版本号
|
||||
}).extend({
|
||||
soulTable: 'notice,layNotify', // 模块
|
||||
});
|
||||
let form;
|
||||
var tree;
|
||||
var table;
|
||||
var notice;
|
||||
var layNotify;
|
||||
var type;
|
||||
let userId = sessionStorage.getItem("userId");
|
||||
console.log('userId:', userId);
|
||||
$("#allBt").click(function(){
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/users/getSystemNotification'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
type:'',
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
})
|
||||
$("#announcementBt").click(function(){
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/users/getSystemNotification'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
type:'2',
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
})
|
||||
$("#notificationBt").click(function(){
|
||||
table.reload('menuTable', {
|
||||
url: ctxPath + '/users/getSystemNotification'
|
||||
, method: 'post' //方式默认是get
|
||||
, page: true
|
||||
, where: {
|
||||
type:'3',
|
||||
} //设定异步数据接口的额外参数
|
||||
});
|
||||
})
|
||||
$("#readAlready").click(function(){
|
||||
var index = layer.confirm('全部标记为已读?', {
|
||||
btn : [ '确定', '取消' ]
|
||||
}, function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
async: false,
|
||||
url: ctxPath + '/users/delReadAlready',// 请求地址
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
dataType: 'json', // 服务器返回数据类型
|
||||
success: function (data) {
|
||||
var resMsg = data.resMsg;
|
||||
layer.close(index);
|
||||
if ("数据获取成功" === resMsg) {
|
||||
layer.msg('状态修改成功', {icon: 1, time: 2000}, function() {
|
||||
location.reload();
|
||||
});
|
||||
}else {
|
||||
layer.msg('状态修改失败',{icon:2,timeout:2000});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
layui.use(['table', 'form','notice', 'layNotify'], function () {
|
||||
table = layui.table;
|
||||
form = layui.form;
|
||||
tree = layui.tree;
|
||||
notice = layui.notice;
|
||||
layNotify = layui.layNotify;
|
||||
//渲染表格
|
||||
table.render({
|
||||
elem: '#demo'
|
||||
, url: ctxPath + '/users/getSystemNotification' //数据接口
|
||||
, method: 'post' //方式默认是get
|
||||
, toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
|
||||
, where: {} //post请求必须加where ,post请求需要的参数
|
||||
, cellMinWidth: 80
|
||||
, cols: [[ //表头
|
||||
// {
|
||||
// field: 'number', width:80,title: '序号', align: 'center', type: 'numbers'
|
||||
// }
|
||||
{field: 'noticeName', align: 'center', title: '通知标题', event: 'noticeDetail', templet: d => {
|
||||
let text = '';
|
||||
if (d.isRead === "0")
|
||||
{
|
||||
text = "<span class='layui-badge-dot'></span>" + d.noticeName;
|
||||
|
||||
}else {
|
||||
text = d.noticeName;
|
||||
}
|
||||
return text;
|
||||
}}
|
||||
, {
|
||||
field: 'isRead', title: '状态', align: 'center', templet: d => {
|
||||
let text = "";
|
||||
if (d.isRead === "0") {
|
||||
text = "<span class='layui-badge-dot'></span>未读";
|
||||
} else if (d.isRead === "1") {
|
||||
text = "<span class='layui-badge-dot layui-bg-green'></span>已读";
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
, {field: 'noticeType', align: 'center', title: '类型'}
|
||||
, {field: 'createTimed', align: 'center', title: '发布时间'}
|
||||
|
||||
]]
|
||||
, id: 'menuTable'
|
||||
, page: true //开启分页
|
||||
, loading: true //数据加载中。。。
|
||||
, limits: [5, 10, 20] //一页选择显示3,5或10条数据
|
||||
, limit: 10 //一页显示5条数据
|
||||
, response: {
|
||||
statusCode: 200 //规定成功的状态码,默认:0
|
||||
}, parseData: function (res) { //将原始数据解析成 table 组件所规定的数据,res为从url中get到的数据
|
||||
let result;
|
||||
if (res.data !== '' && res.data != null && res.data !== "null") {
|
||||
if (this.page.curr) {
|
||||
result = res.data.slice(this.limit * (this.page.curr - 1), this.limit * this.page.curr);
|
||||
} else {
|
||||
result = res.data.slice(0, this.limit);
|
||||
}
|
||||
}
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.count, //解析数据长度
|
||||
"data": result, //解析数据列表
|
||||
};
|
||||
}
|
||||
,toolbar: "#toolbar"
|
||||
, done: function(res, curr, count) {
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
console.log('res.data[i]:', res.data[i])
|
||||
var data = res.data[i];
|
||||
data.planTime = data.startTime + ' ~ ' + data.endTime;
|
||||
console.log('planTime:', data.planTime); // 打印 planTime 的值
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
table.on('tool(test)', function(obj){
|
||||
var data = obj.data;
|
||||
console.log('data:', data)
|
||||
if(obj.event === 'noticeDetail'){
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
url : ctxPath + '/users/upLoginLog',
|
||||
async : false,
|
||||
data: {
|
||||
id: data.id,
|
||||
},
|
||||
success : function(data) {
|
||||
localStorage.setItem("announcementId", obj.data.noticeId);
|
||||
console.log('announcementId:', obj.data.noticeId)
|
||||
var index = layer.open({
|
||||
title: ['公告详情', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||||
type: 2,
|
||||
content: '../announcement/AnnouncementView.html',
|
||||
area: ["90%", "95%"],
|
||||
maxmin: false,
|
||||
btn: ['关闭'],
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
function toggleButton(buttonId) {
|
||||
var buttons = document.getElementsByTagName("button");
|
||||
for (var i = 0; i < buttons.length; i++) {
|
||||
var button = buttons[i];
|
||||
if (button.id === buttonId) {
|
||||
button.classList.add("layui-btn-normal");
|
||||
} else {
|
||||
button.classList.remove("layui-btn-normal");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||