æ·fix导入,添加校文添加文件校验

This commit is contained in:
ZhiJian 2024-07-24 00:29:31 +08:00
parent ffe52038bb
commit 2dc8aaad49
26 changed files with 727 additions and 499 deletions

View File

@ -45,7 +45,15 @@ public class CxxmUserController {
@PostMapping("/importData")
public AjaxResult importData(@ApiParam(value = "用户数据文件") @RequestPart MultipartFile file,@ApiParam(value = "是否更新已经存在的用户数据") @RequestParam(required = false) boolean updateSupport) throws Exception {
ExcelUtil<CxxmUserZJ> util = new ExcelUtil<CxxmUserZJ>(CxxmUserZJ.class);
List<CxxmUserZJ> userList = util.importExcel(file.getInputStream());
List<CxxmUserZJ> userList;
try {
userList = util.importExcel("用户数据",file.getInputStream(),0);
if (userList.contains(null)) {
return AjaxResult.error("数据解析失败,请严格按照导入模板填写数据!");
}
}catch (Exception e) {
return AjaxResult.error("数据解析失败,请严格按照导入模板填写数据!");
}
String operName = getUsername();
String message = userService.importCxxmUser(userList, updateSupport, operName);
return success(message);

View File

@ -10,4 +10,8 @@ public class UserGroup {
private Integer userCount;
private Integer taskCount;
private Integer yzpCount;
private Integer wzpCount;
}

View File

@ -97,6 +97,9 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
if (user.getGroupName() == null || Objects.equals(user.getGroupName(), "")) {
user.setGroupName("");
}
if (user.getSex() == null || Objects.equals(user.getSex(), "")) {
user.setSex("2"); // 设置性别未知
}
// 验证是否存在这个用户
SysUser u = userMapper.selectUserByUserName(user.getUserName());
if (StringUtils.isNull(u)) {
@ -119,17 +122,26 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
} else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
int row = userList.indexOf(user) + 1;
failureMsg.append("<br/>" + failureNum + "、第" + row + "行:账号 " + user.getUserName() + " 已存在");
}
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
String msg;
int row = userList.indexOf(user) + 1;
if (user.getUserName() == null || Objects.equals(user.getUserName(), "")) {
msg = "<br/>" + failureNum + "、第" + row + "行:登录账号不能为空";
} else {
msg = "<br/>" + failureNum + "、第" + row + "行:账号 " + user.getUserName() + " 导入失败。";
msg += e.getMessage();
}
failureMsg.append(msg);
log.error(msg, e);
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
failureMsg.insert(0, "" + failureNum + " 条数据导入失败,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
@ -139,6 +151,7 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
/**
* 根据部门id获取部门下所有用户组
*
* @param deptId
* @return
*/
@ -150,16 +163,31 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
.eq(ZftkTask::getGroupName, userGroup.getGroupName())
.count();
userGroup.setTaskCount(count.intValue());
// Long count = zftkTaskService.lambdaQuery()
// .eq(ZftkTask::getXzmc, userGroup.getGroupName())
// .count();
// userGroup.setTaskCount(count.intValue());
// Long yzp = zftkTaskService.lambdaQuery()
// .eq(ZftkTask::getXzmc, userGroup.getGroupName())
// .eq(ZftkTask::getXzxfqk, "1")
// .count();
// userGroup.setYzpCount(yzp.intValue());
// Long wzp = zftkTaskService.lambdaQuery()
// .eq(ZftkTask::getXzmc, userGroup.getGroupName())
// .eq(ZftkTask::getXzxfqk, "0")
// .count();
// userGroup.setWzpCount(wzp.intValue());
}
return userGroups;
}
/**
* 根据用户组名获取用户组下的所有用户
*
* @param groupName
* @return
*/
public List<SysUser> getZftkUserListByGroupName(String groupName,Long deptId){
public List<SysUser> getZftkUserListByGroupName(String groupName, Long deptId) {
SysUser user = new SysUser();
user.setGroupName(groupName);
user.setDeptId(deptId);
@ -190,10 +218,11 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
/**
* 根据用户组名获取用户组下的所有用户
*
* @param groupName
* @return
*/
public List<SysUser> getZttbUserListByGroupName(String groupName,Long deptId){
public List<SysUser> getZttbUserListByGroupName(String groupName, Long deptId) {
SysUser user = new SysUser();
user.setGroupName(groupName);
user.setDeptId(deptId);
@ -207,6 +236,7 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
/**
* 根据部门id获取部门下所有用户组
*
* @param deptId
* @return
*/
@ -214,20 +244,35 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
public List<UserGroup> getZttbGroupNameByDeptId(Long deptId) {
List<UserGroup> userGroups = cxxmUserMapper.getGroupNameByDeptId(deptId);
for (UserGroup userGroup : userGroups) {
// Long count = zttbTaskService.lambdaQuery()
// .eq(ZttbTask::getGroupName, userGroup.getGroupName())
// .count();
// userGroup.setTaskCount(count.intValue());
Long count = zttbTaskService.lambdaQuery()
.eq(ZttbTask::getGroupName, userGroup.getGroupName())
.eq(ZttbTask::getXzmc, userGroup.getGroupName())
.count();
userGroup.setTaskCount(count.intValue());
Long yzp = zttbTaskService.lambdaQuery()
.eq(ZttbTask::getXzmc, userGroup.getGroupName())
.eq(ZttbTask::getXzxfqk, "1")
.count();
userGroup.setYzpCount(yzp.intValue());
Long wzp = zttbTaskService.lambdaQuery()
.eq(ZttbTask::getXzmc, userGroup.getGroupName())
.eq(ZttbTask::getXzxfqk, "0")
.count();
userGroup.setWzpCount(wzp.intValue());
}
return userGroups;
}
/**
* 根据用户组名获取用户组下的所有用户
*
* @param groupName
* @return
*/
public List<SysUser> getZtUserListByGroupName(String groupName,Long deptId){
public List<SysUser> getZtUserListByGroupName(String groupName, Long deptId) {
SysUser user = new SysUser();
user.setGroupName(groupName);
user.setDeptId(deptId);
@ -241,6 +286,7 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
/**
* 根据部门id获取部门下所有用户组
*
* @param deptId
* @return
*/
@ -248,10 +294,23 @@ public class CxxmUserServiceImpl implements ICxxmUserService {
public List<UserGroup> getZtGroupNameByDeptId(Long deptId) {
List<UserGroup> userGroups = cxxmUserMapper.getGroupNameByDeptId(deptId);
for (UserGroup userGroup : userGroups) {
// Long count = ztTaskService.lambdaQuery()
// .eq(ZtTask::getGroupName, userGroup.getGroupName())
// .count();
Long count = ztTaskService.lambdaQuery()
.eq(ZtTask::getGroupName, userGroup.getGroupName())
.eq(ZtTask::getXzmc, userGroup.getGroupName())
.count();
userGroup.setTaskCount(count.intValue());
Long yzp = ztTaskService.lambdaQuery()
.eq(ZtTask::getXzmc, userGroup.getGroupName())
.eq(ZtTask::getXzxfqk, "1")
.count();
userGroup.setYzpCount(yzp.intValue());
Long wzp = ztTaskService.lambdaQuery()
.eq(ZtTask::getXzmc, userGroup.getGroupName())
.eq(ZtTask::getXzxfqk, "0")
.count();
userGroup.setWzpCount(wzp.intValue());
}
return userGroups;
}

View File

@ -207,18 +207,23 @@ public class ZftkTaskServiceImpl extends ServiceImpl<ZftkTaskMapper, ZftkTask> i
// 根据部门ID查询该部门及其所有父部门的任务
queryWrapper.in(Objects.nonNull(task.getDeptId()), ZftkTask::getDeptId, deptMapper.getAllAncestorsByDeptId(task.getDeptId()));
// 根据年份进行模糊查询
queryWrapper.like(Objects.nonNull(task.getNian()), ZftkTask::getNian, task.getNian());
// 根据任务所在县进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXian()), ZftkTask::getXian, task.getXian());
// 根据任务项目名称进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXmmc()), ZftkTask::getXmmc, task.getXmmc());
// 根据任务地块号进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getDkh()), ZftkTask::getDkh, task.getDkh());
// 根据功能分区进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getGnfq()), ZftkTask::getGnfq, task.getGnfq());
// 根据任务动工状态进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getDgzt()), ZftkTask::getDgzt, task.getDgzt());
queryWrapper.and(
Objects.nonNull(task.getNian()),
// 根据年份进行模糊查询
qw -> qw.like(Objects.nonNull(task.getNian()), ZftkTask::getNian, task.getNian())
// 根据任务所在县进行模糊查询
.or().like(Objects.nonNull(task.getXian()), ZftkTask::getXian, task.getXian())
// 根据任务项目名称进行模糊查询
.or().like(Objects.nonNull(task.getXmmc()), ZftkTask::getXmmc, task.getXmmc())
// 根据任务地块号进行模糊查询
.or().like(Objects.nonNull(task.getDkh()), ZftkTask::getDkh, task.getDkh())
// 根据功能分区进行模糊查询
.or().like(Objects.nonNull(task.getGnfq()), ZftkTask::getGnfq, task.getGnfq())
// 根据任务动工状态进行模糊查询
.or().like(Objects.nonNull(task.getDgzt()), ZftkTask::getDgzt, task.getDgzt())
);
// 根据处理时间进行区间查询
List<String> drsjQuery = task.getDrsjQuery();
@ -326,7 +331,7 @@ public class ZftkTaskServiceImpl extends ServiceImpl<ZftkTaskMapper, ZftkTask> i
// 获取图斑信息
ZftkTask task = this.getById(taskId);
if(task == null){
if (task == null) {
throw new RuntimeException("Id=" + taskId + "的任务不存在!");
}
TaskGis taskGis = this.selectTaskGisById(taskId);

View File

@ -117,7 +117,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
Map taskMap = JSONObject.parseObject(properties.toString(), Map.class);
// 校验必填字段是否存在
String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC"};
String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC"};
for (String field : requiredFields) {
if (taskMap.get(field) == null) {
throw new RuntimeException(StringUtils.format("缺少必须字段:{},请检查导入数据!", field));
@ -175,6 +175,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
/**
* 构造查询条件对象
*
* @param task
* @return
*/
@ -190,6 +191,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
// 构建查询条件
LambdaQueryWrapper<ZtTask> queryWrapper = new LambdaQueryWrapper<>();
// 根据任务类型进行精确查询
queryWrapper.eq(Objects.nonNull(task.getRwlx()), ZtTask::getRwlx, task.getRwlx());
// 根据州级下发情况进行精确查询
@ -208,17 +210,20 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
queryWrapper.in(Objects.nonNull(task.getDeptId()), ZtTask::getDeptId, deptMapper.getAllAncestorsByDeptId(task.getDeptId()));
// 根据年份进行模糊查询
queryWrapper.like(Objects.nonNull(task.getNian()), ZtTask::getNian, task.getNian());
// 根据任务所在县进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXian()), ZtTask::getXian, task.getXian());
// 根据任务所在乡镇进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXzmc()), ZtTask::getXzmc, task.getXzmc());
queryWrapper.or().like(Objects.nonNull(task.getCsmc()), ZtTask::getCsmc, task.getCsmc());
queryWrapper.or().like(Objects.nonNull(task.getTblx()), ZtTask::getTblx, task.getTblx());
queryWrapper.or().like(Objects.nonNull(task.getTbbh()), ZtTask::getTbbh, task.getTbbh());
queryWrapper.or().like(Objects.nonNull(task.getCzwt()), ZtTask::getCzwt, task.getCzwt());
// 根据任务项目名称进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXmmc()), ZtTask::getXmmc, task.getXmmc());
queryWrapper.and(
Objects.nonNull(task.getNian()),
qw -> qw.like(Objects.nonNull(task.getNian()), ZtTask::getNian, task.getNian())
// 根据任务所在县进行模糊查询
.or().like(Objects.nonNull(task.getXian()), ZtTask::getXian, task.getXian())
// 根据任务所在乡镇进行模糊查询
.or().like(Objects.nonNull(task.getXzmc()), ZtTask::getXzmc, task.getXzmc())
.or().like(Objects.nonNull(task.getCsmc()), ZtTask::getCsmc, task.getCsmc())
.or().like(Objects.nonNull(task.getTblx()), ZtTask::getTblx, task.getTblx())
.or().like(Objects.nonNull(task.getTbbh()), ZtTask::getTbbh, task.getTbbh())
.or().like(Objects.nonNull(task.getCzwt()), ZtTask::getCzwt, task.getCzwt())
// 根据任务项目名称进行模糊查询
.or().like(Objects.nonNull(task.getXmmc()), ZtTask::getXmmc, task.getXmmc())
);
// 根据处理时间进行区间查询
List<String> drsjQuery = task.getDrsjQuery();
@ -326,7 +331,7 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
// 获取图斑信息
ZtTask task = this.getById(taskId);
if(task == null){
if (task == null) {
throw new RuntimeException("Id=" + taskId + "的任务不存在!");
}
TaskGis taskGis = this.selectTaskGisById(taskId);

View File

@ -114,7 +114,7 @@ public class ZttbTaskServiceImpl extends ServiceImpl<ZttbTaskMapper, ZttbTask> i
Object properties = item.get("properties");
Map taskMap = JSONObject.parseObject(properties.toString(), Map.class);
// 校验必填字段是否存在
String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC"};
String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC"};
for (String field : requiredFields) {
if (taskMap.get(field) == null) {
throw new RuntimeException(StringUtils.format("缺少必须字段:{},请检查导入数据!", field));
@ -173,6 +173,7 @@ public class ZttbTaskServiceImpl extends ServiceImpl<ZttbTaskMapper, ZttbTask> i
/**
* 构造查询条件对象
*
* @param task
* @return
*/
@ -205,18 +206,23 @@ public class ZttbTaskServiceImpl extends ServiceImpl<ZttbTaskMapper, ZttbTask> i
// 根据部门ID查询该部门及其所有父部门的任务
queryWrapper.in(Objects.nonNull(task.getDeptId()), ZttbTask::getDeptId, deptMapper.getAllAncestorsByDeptId(task.getDeptId()));
// 根据年份进行模糊查询
queryWrapper.like(Objects.nonNull(task.getNian()), ZttbTask::getNian, task.getNian());
// 根据任务所在县进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXian()), ZttbTask::getXian, task.getXian());
// 根据任务所在乡镇进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXzmc()), ZttbTask::getXzmc, task.getXzmc());
queryWrapper.or().like(Objects.nonNull(task.getCsmc()), ZttbTask::getCsmc, task.getCsmc());
queryWrapper.or().like(Objects.nonNull(task.getTbly()), ZttbTask::getTbly, task.getTbly());
queryWrapper.or().like(Objects.nonNull(task.getTbbh()), ZttbTask::getTbbh, task.getTbbh());
queryWrapper.or().like(Objects.nonNull(task.getCzwt()), ZttbTask::getCzwt, task.getCzwt());
// 根据任务项目名称进行模糊查询
queryWrapper.or().like(Objects.nonNull(task.getXmmc()), ZttbTask::getXmmc, task.getXmmc());
queryWrapper.and(
Objects.nonNull(task.getNian()),
// 根据年份进行模糊查询
qw -> qw.like(Objects.nonNull(task.getNian()), ZttbTask::getNian, task.getNian())
// 根据任务所在县进行模糊查询
.or().like(Objects.nonNull(task.getXian()), ZttbTask::getXian, task.getXian())
// 根据任务所在乡镇进行模糊查询
.or().like(Objects.nonNull(task.getXzmc()), ZttbTask::getXzmc, task.getXzmc())
.or().like(Objects.nonNull(task.getCsmc()), ZttbTask::getCsmc, task.getCsmc())
.or().like(Objects.nonNull(task.getTbly()), ZttbTask::getTbly, task.getTbly())
.or().like(Objects.nonNull(task.getTbbh()), ZttbTask::getTbbh, task.getTbbh())
.or().like(Objects.nonNull(task.getCzwt()), ZttbTask::getCzwt, task.getCzwt())
// 根据任务项目名称进行模糊查询
.or().like(Objects.nonNull(task.getXmmc()), ZttbTask::getXmmc, task.getXmmc())
);
// 根据处理时间进行区间查询
List<String> drsjQuery = task.getDrsjQuery();
@ -324,7 +330,7 @@ public class ZttbTaskServiceImpl extends ServiceImpl<ZttbTaskMapper, ZttbTask> i
// 获取图斑信息
ZttbTask task = this.getById(taskId);
if(task == null){
if (task == null) {
throw new RuntimeException("Id=" + taskId + "的任务不存在!");
}
TaskGis taskGis = this.selectTaskGisById(taskId);

View File

@ -5,6 +5,8 @@ import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;

View File

@ -1,6 +1,7 @@
package com.ruoyi.framework.web.service;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
@ -29,14 +30,17 @@ import com.ruoyi.framework.security.context.AuthenticationContextHolder;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 登录校验方法
*
* @author ruoyi
*/
@Component
public class SysLoginService
{
public class SysLoginService {
@Autowired
private TokenService tokenService;
@ -57,40 +61,31 @@ public class SysLoginService
*
* @param username 用户名
* @param password 密码
* @param code 验证码
* @param uuid 唯一标识
* @param code 验证码
* @param uuid 唯一标识
* @return 结果
*/
public String login(String username, String password, String code, String uuid)
{
public String login(String username, String password, String code, String uuid) {
// 验证码校验
validateCaptcha(username, code, uuid);
// 登录前置校验
loginPreCheck(username, password);
// 用户验证
Authentication authentication = null;
try
{
try {
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
AuthenticationContextHolder.setContext(authenticationToken);
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager.authenticate(authenticationToken);
}
catch (Exception e)
{
if (e instanceof BadCredentialsException)
{
} catch (Exception e) {
if (e instanceof BadCredentialsException) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
else
{
} else {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
throw new ServiceException(e.getMessage());
}
}
finally
{
} finally {
AuthenticationContextHolder.clearContext();
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
@ -104,25 +99,21 @@ public class SysLoginService
* 校验验证码
*
* @param username 用户名
* @param code 验证码
* @param uuid 唯一标识
* @param code 验证码
* @param uuid 唯一标识
* @return 结果
*/
public void validateCaptcha(String username, String code, String uuid)
{
public void validateCaptcha(String username, String code, String uuid) {
boolean captchaEnabled = configService.selectCaptchaEnabled();
if (captchaEnabled)
{
if (captchaEnabled) {
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
String captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null)
{
if (captcha == null) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
if (!code.equalsIgnoreCase(captcha))
{
if (!code.equalsIgnoreCase(captcha)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
@ -131,35 +122,31 @@ public class SysLoginService
/**
* 登录前置校验
*
* @param username 用户名
* @param password 用户密码
*/
public void loginPreCheck(String username, String password)
{
public void loginPreCheck(String username, String password) {
// 用户名或密码为空 错误
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
{
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
throw new UserNotExistsException();
}
// 密码如果不在指定范围内 错误
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
{
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
// 用户名不在指定范围内 错误
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
{
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
// IP黑名单校验
String blackStr = configService.selectConfigByKey("sys.login.blackIPList");
if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr()))
{
if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("login.blocked")));
throw new BlackListException();
}
@ -170,8 +157,7 @@ public class SysLoginService
*
* @param userId 用户ID
*/
public void recordLoginInfo(Long userId)
{
public void recordLoginInfo(Long userId) {
SysUser sysUser = new SysUser();
sysUser.setUserId(userId);
sysUser.setLoginIp(IpUtils.getIpAddr());

View File

@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => {
if (store.getters.roles.length === 0) {
isRelogin.show = true
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
store.dispatch('GetInfo').then((res) => {
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
// 根据roles权限生成可访问的路由表

View File

@ -1,47 +1,32 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"/>
</el-col>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目名称" prop="xmmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xmmc"-->
<!-- placeholder="请输入项目名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目名称" prop="xmmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xmmc"-->
<!-- placeholder="请输入项目名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="综合搜索" prop="dkh">
<el-input
v-model="queryParams.dkh"
@ -50,22 +35,22 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="功能分区" prop="gnfq">-->
<!-- <el-input-->
<!-- v-model="queryParams.gnfq"-->
<!-- placeholder="请输入功能分区"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="动工状态" prop="dgzt">-->
<!-- <el-input-->
<!-- v-model="queryParams.dgzt"-->
<!-- placeholder="请输入动工状态"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="功能分区" prop="gnfq">-->
<!-- <el-input-->
<!-- v-model="queryParams.gnfq"-->
<!-- placeholder="请输入功能分区"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="动工状态" prop="dgzt">-->
<!-- <el-input-->
<!-- v-model="queryParams.dgzt"-->
<!-- placeholder="请输入动工状态"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="下发情况" prop="xjxfqk">-->
<!-- <el-select v-model="queryParams.xjxfqk" placeholder="请选择下发情况" clearable-->
<!-- @change="handleQuery">-->
@ -78,7 +63,7 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="指派情况" prop="xzxfqk">
<el-select v-model="queryParams.xzxfqk" placeholder="请选择下发情况" clearable
<el-select v-model="queryParams.xzxfqk" placeholder="请选择指派情况" clearable
@change="handleQuery">
<el-option key="0" label="未指派" value="0"></el-option>
<el-option key="1" label="已指派" value="1"></el-option>
@ -92,15 +77,14 @@
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="openDistributePage"-->
<!-- >下发-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="openDistributePage"-->
<!-- >乡镇情况-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
@ -181,10 +165,19 @@
<el-button
size="mini"
type="text"
icon="el-icon-view"
icon="el-icon-download"
@click="openAssignPage(scope.row)"
v-if="scope.row.xzxfqk=='0'"
>去指派
</el-button>
<el-button
size="mini"
style="color: orangered;border: none"
icon="el-icon-download"
@click="openAssignPage(scope.row)"
v-if="scope.row.xzxfqk=='1'"
>改派
</el-button>
</template>
</el-table-column>
</el-table>
@ -196,9 +189,6 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@ -256,7 +246,7 @@
</el-dialog>
<el-drawer
title="任务下发"
title="乡镇任务情况"
size="35%"
:visible.sync="drawer"
direction="rtl">
@ -264,22 +254,24 @@
<el-table-column label="乡镇名称" align="center" prop="groupName"/>
<el-table-column label="任务总数" align="center" prop="taskCount"/>
<el-table-column label="人员总数" align="center" prop="userCount"/>
<el-table-column label="人均任务数" align="center">
<template slot-scope="scope">
{{ Math.round(scope.row.taskCount / scope.row.userCount) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleDistribute(scope.row)"
>下发至乡镇
</el-button>
</template>
</el-table-column>
<el-table-column label="已指派" align="center" prop="yzpCount"/>
<el-table-column label="未指派" align="center" prop="wzpCount"/>
<!-- <el-table-column label="人均任务数" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- {{ Math.round(scope.row.taskCount / scope.row.userCount) }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-view"-->
<!-- @click="handleDistribute(scope.row)"-->
<!-- >下发至乡镇-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- <pagination-->

View File

@ -75,6 +75,14 @@
<el-table-column label="县名称" align="center" prop="xian"/>
<el-table-column label="项目名称" align="center" prop="xmmc" min-width="180"/>
<el-table-column label="地块号" align="center" prop="dkh"/>
<el-table-column label="已巡查次数" align="center" prop="yxccs"/>
<el-table-column label="州级巡查次数" align="center" prop="zjxccs"/>
<el-table-column label="县级巡查次数" align="center" prop="xjxccs"/>
<el-table-column label="最后巡查时间" align="center" prop="xcsj" min-width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.xcsj, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="功能分区" align="center" prop="gnfq" min-width="180"/>
<el-table-column label="地块面积" align="center" prop="dkmj" :show-overflow-tooltip="true"/>
<el-table-column label="农用地面积" align="center" prop="nydmj" :show-overflow-tooltip="true"/>

View File

@ -257,7 +257,9 @@ template
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
<el-button type="primary" v-if="auditForm.id" @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
</el-button>
<el-button type="primary" v-else @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
</el-button>
<!-- <el-button @click="open = false"> </el-button>-->
</div>

View File

@ -18,30 +18,30 @@
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目名称" prop="xmmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xmmc"-->
<!-- placeholder="请输入项目名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="项目名称" prop="xmmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xmmc"-->
<!-- placeholder="请输入项目名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="综合搜索" prop="dkh">
<el-input
v-model="queryParams.dkh"
@ -50,22 +50,22 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="功能分区" prop="gnfq">-->
<!-- <el-input-->
<!-- v-model="queryParams.gnfq"-->
<!-- placeholder="请输入功能分区"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="动工状态" prop="dgzt">-->
<!-- <el-input-->
<!-- v-model="queryParams.dgzt"-->
<!-- placeholder="请输入动工状态"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="功能分区" prop="gnfq">-->
<!-- <el-input-->
<!-- v-model="queryParams.gnfq"-->
<!-- placeholder="请输入功能分区"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="动工状态" prop="dgzt">-->
<!-- <el-input-->
<!-- v-model="queryParams.dgzt"-->
<!-- placeholder="请输入动工状态"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="下发情况" prop="zjxfqk">
<el-select v-model="queryParams.zjxfqk" placeholder="请选择下发情况" clearable
@change="handleQuery">
@ -170,7 +170,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-if="form.zjxfqk==0"
v-if="scope.row.zjxfqk==0"
>删除
</el-button>
<el-button
@ -200,58 +200,50 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="125px">
<el-form-item label="年份" prop="nian">
<el-input v-model="form.nian" placeholder="请输入年份" />
<el-input v-model="form.nian" placeholder="请输入年份"/>
</el-form-item>
<el-form-item label="县名称" prop="xian">
<el-input v-model="form.xian" placeholder="请输入县名称" />
</el-form-item>
<el-form-item label="乡镇名称" prop="xzmc">
<el-input v-model="form.xzmc" placeholder="请输入乡镇名称" />
</el-form-item>
<el-form-item label="村社名称" prop="csmc">
<el-input v-model="form.csmc" placeholder="请输入村社名称" />
</el-form-item>
<el-form-item label="图斑来源" prop="tbly">
<el-input v-model="form.tbly" placeholder="请输入图斑来源" />
</el-form-item>
<el-form-item label="图斑编号" prop="tbbh">
<el-input v-model="form.tbbh" placeholder="请输入图斑编号" />
</el-form-item>
<el-form-item label="下发时间" prop="xfsj">
<el-date-picker clearable
v-model="form.xfsj"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择下发时间">
</el-date-picker>
</el-form-item>
<el-form-item label="图斑面积" prop="tbmj">
<el-input v-model="form.tbmj" placeholder="请输入图斑面积" />
</el-form-item>
<el-form-item label="耕地面积" prop="gdmj">
<el-input v-model="form.gdmj" placeholder="请输入耕地面积" />
</el-form-item>
<el-form-item label="基本农田面积" prop="jbntmj">
<el-input v-model="form.jbntmj" placeholder="请输入基本农田面积" />
<el-input v-model="form.xian" placeholder="请输入县名称"/>
</el-form-item>
<el-form-item label="项目名称" prop="xmmc">
<el-input v-model="form.xmmc" placeholder="请输入项目名称" />
<el-input v-model="form.xmmc" placeholder="请输入项目名称"/>
</el-form-item>
<el-form-item label="存在问题" prop="czwt">
<el-input v-model="form.czwt" placeholder="请输入存在问题" />
<el-form-item label="地块号" prop="dkh">
<el-input v-model="form.dkh" placeholder="请输入地块号"/>
</el-form-item>
<el-form-item label="功能分区" prop="gnfq">
<el-input v-model="form.gnfq" placeholder="请输入功能分区"/>
</el-form-item>
<el-form-item label="地块面积" prop="dkmj">
<el-input v-model="form.dkmj" placeholder="请输入地块面积"/>
</el-form-item>
<el-form-item label="农用地面积" prop="nydmj">
<el-input v-model="form.nydmj" placeholder="请输入农用地面积"/>
</el-form-item>
<el-form-item label="耕地面积" prop="gdmj">
<el-input v-model="form.gdmj" placeholder="请输入耕地面积"/>
</el-form-item>
<el-form-item label="建设用地面积" prop="jsydmj">
<el-input v-model="form.jsydmj" placeholder="请输入建设用地面积"/>
</el-form-item>
<el-form-item label="未利用用地面积" prop="wlydmj">
<el-input v-model="form.wlydmj" placeholder="请输入未利用用地面积"/>
</el-form-item>
<el-form-item label="永久基本农田面积" prop="yjjbntmj">
<el-input v-model="form.yjjbntmj" placeholder="请输入永久基本农田面积"/>
</el-form-item>
<el-form-item label="动工状态" prop="dgzt">
<el-input v-model="form.dgzt" placeholder="请输入动工状态"/>
</el-form-item>
<el-form-item label="经度" prop="x">
<el-input v-model="form.x" placeholder="请输入经度" />
<el-input v-model="form.x" placeholder="请输入经度"/>
</el-form-item>
<el-form-item label="纬度" prop="y">
<el-input v-model="form.y" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="县代码" prop="xdm">
<el-input v-model="form.xdm" placeholder="请输入县代码" />
</el-form-item>
<el-form-item label="详细信息" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容" />
<el-input v-model="form.y" placeholder="请输入纬度"/>
</el-form-item>
<!-- <el-form-item label="详细信息" prop="info">-->
<!-- <el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -263,7 +255,14 @@
</template>
<script>
import {listDistributeTask as listTask, getTask, delTask, addTask, updateTask, distributeTask} from "@/api/cxxm/zftk/task";
import {
listDistributeTask as listTask,
getTask,
delTask,
addTask,
updateTask,
distributeTask
} from "@/api/cxxm/zftk/task";
import {deptTreeSelect} from "@/api/system/user";
export default {

View File

@ -122,7 +122,7 @@
size="mini"
type="text"
icon="el-icon-delete"
v-if="form.zjxfqk==0"
v-if="scope.row.zjxfqk==0"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
@ -190,9 +190,9 @@
<el-form-item label="纬度" prop="y">
<el-input v-model="form.y" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="详细信息" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容" />
</el-form-item>
<!-- <el-form-item label="详细信息" prop="info">-->
<!-- <el-input v-model="form.info" type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -211,6 +211,7 @@
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-change="beforeUpload"
:auto-upload="false"
drag
>
@ -222,10 +223,10 @@
<!-- 是否更新已经存在的任务数据-->
<!-- </div>-->
<div style="margin-top: 10px">
<span>仅允许导入json格式文件</span>
<!-- <el-link type="primary" style="font-size:12px;vertical-align: baseline;"-->
<!-- :href='importTemplate'>下载模板-->
<!-- </el-link>-->
<span>仅允许导入json格式文件</span>
<el-link type="primary" style="color: red;font-size:12px;vertical-align: baseline;"
:href='importTemplate'>查看导入数据要求
</el-link>
</div>
</div>
</el-upload>
@ -313,8 +314,9 @@ export default {
rules: {
},
//
importTemplate: process.env.VUE_APP_BASE_API + "/profile/common/task_import_template_v1.0.doc",
importTemplate: process.env.VUE_APP_BASE_API + "/profile/common/执法踏勘数据要求V1.0.doc",
//
isAllowed: true,
upload: {
//
open: false,
@ -463,6 +465,26 @@ export default {
this.upload.open = true;
this.upload.rwlx = null;
},
beforeUpload(file) {
const allowedExtensions = ['json']; //
const extension = file.name.split('.').pop(); //
const isAllowed = allowedExtensions.includes(extension);
const MAX_SIZE = 256 * 1024 * 1024; // 256MB in bytes
const sizeAllowed = file.size < MAX_SIZE
if (!isAllowed) {
this.isAllowed = false;
this.$message.error('只能上传json文件!');
return this.isAllowed; //
} else if (!sizeAllowed) {
this.isAllowed = false;
this.$message.error('上传的文件大小不能超过 256MB!');
return this.isAllowed; //
}
this.isAllowed = isAllowed && sizeAllowed
return this.isAllowed;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
@ -499,6 +521,10 @@ export default {
if (this.upload.rwlx == null) {
this.$message.error("请选择任务类型!")
} else {
if (!this.isAllowed) {
this.$message.error('文件格式错误!');
return;
}
this.$refs.upload.submit();
Loading.service({fullscreen: true, text: "导入中..."});
}

View File

@ -2,46 +2,46 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="乡镇名称" prop="xzmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xzmc"-->
<!-- placeholder="请输入乡镇名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="村社名称" prop="csmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.csmc"-->
<!-- placeholder="请输入村社名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="图斑来源" prop="tbly">-->
<!-- <el-input-->
<!-- v-model="queryParams.tbly"-->
<!-- placeholder="请输入图斑来源"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="乡镇名称" prop="xzmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xzmc"-->
<!-- placeholder="请输入乡镇名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="村社名称" prop="csmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.csmc"-->
<!-- placeholder="请输入村社名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="图斑来源" prop="tbly">-->
<!-- <el-input-->
<!-- v-model="queryParams.tbly"-->
<!-- placeholder="请输入图斑来源"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="综合搜索" prop="tbbh">
<el-input
v-model="queryParams.tbbh"
@ -50,19 +50,19 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="下发情况" prop="zjxfqk">-->
<!-- <el-select v-model="queryParams.xjxfqk" placeholder="请选择下发情况" clearable-->
<!-- @change="handleQuery">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.task_xfqk"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="下发情况" prop="zjxfqk">-->
<!-- <el-select v-model="queryParams.xjxfqk" placeholder="请选择下发情况" clearable-->
<!-- @change="handleQuery">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.task_xfqk"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="指派情况" prop="xzxfqk">
<el-select v-model="queryParams.xzxfqk" placeholder="请选择下发情况" clearable
<el-select v-model="queryParams.xzxfqk" placeholder="请选择指派情况" clearable
@change="handleQuery">
<el-option key="0" label="未指派" value="0"></el-option>
<el-option key="1" label="已指派" value="1"></el-option>
@ -74,19 +74,18 @@
</el-form-item>
</el-form>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="openDistributePage"-->
<!-- >下发-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="openDistributePage"-->
<!-- >乡镇情况-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -124,19 +123,19 @@
<span>{{ parseTime(scope.row.zjxfsj, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="县级下发情况" align="center" prop="xjxfqk">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.task_xfqk" :value="scope.row.xjxfqk" v-if="scope.row.xjxfqk=='0'"-->
<!-- style="color: red"/>-->
<!-- <dict-tag :options="dict.type.task_xfqk" :value="scope.row.xjxfqk" v-if="scope.row.xjxfqk=='1'"-->
<!-- style="color: green"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="县级下发时间" align="center" prop="xjxfsj" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.xjxfsj, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="县级下发情况" align="center" prop="xjxfqk">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.task_xfqk" :value="scope.row.xjxfqk" v-if="scope.row.xjxfqk=='0'"-->
<!-- style="color: red"/>-->
<!-- <dict-tag :options="dict.type.task_xfqk" :value="scope.row.xjxfqk" v-if="scope.row.xjxfqk=='1'"-->
<!-- style="color: green"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="县级下发时间" align="center" prop="xjxfsj" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.xjxfsj, '{y}-{m}-{d}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="指派情况" align="center" prop="xzxfqk">
<template slot-scope="scope">
<dict-tag :options="dict.type.task_xfqk" value="未指派" v-if="scope.row.xzxfqk=='0'"
@ -164,10 +163,19 @@
<el-button
size="mini"
type="text"
icon="el-icon-view"
icon="el-icon-download"
@click="openAssignPage(scope.row)"
v-if="scope.row.xzxfqk=='0'"
>去指派
</el-button>
<el-button
size="mini"
style="color: orangered;border: none"
icon="el-icon-download"
@click="openAssignPage(scope.row)"
v-if="scope.row.xzxfqk=='1'"
>改派
</el-button>
</template>
</el-table-column>
</el-table>
@ -244,7 +252,7 @@
</el-dialog>
<el-drawer
title="任务下发"
title="乡镇任务情况"
size="35%"
:visible.sync="drawer"
direction="rtl">
@ -252,22 +260,24 @@
<el-table-column label="乡镇名称" align="center" prop="groupName"/>
<el-table-column label="任务总数" align="center" prop="taskCount"/>
<el-table-column label="人员总数" align="center" prop="userCount"/>
<el-table-column label="人均任务数" align="center">
<template slot-scope="scope">
{{ Math.round(scope.row.taskCount / scope.row.userCount) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleDistribute(scope.row)"
>下发至乡镇
</el-button>
</template>
</el-table-column>
<el-table-column label="已指派" align="center" prop="yzpCount"/>
<el-table-column label="未指派" align="center" prop="wzpCount"/>
<!-- <el-table-column label="人均任务数" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- {{ Math.round(scope.row.taskCount / scope.row.userCount) }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-view"-->
<!-- @click="handleDistribute(scope.row)"-->
<!-- >下发至乡镇-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- <pagination-->
@ -293,8 +303,8 @@
</el-option>
</el-select>
<el-table v-loading="loading" :data="users" style="align-items: center; justify-content: center;">
<el-table-column label="用户账号" align="center" prop="userName"/>
<el-table-column label="用户昵称" align="center" prop="nickName"/>
<el-table-column label="登录账号" align="center" prop="userName"/>
<el-table-column label="用户姓名" align="center" prop="nickName"/>
<el-table-column label="任务总数" align="center" prop="taskCount"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
<template slot-scope="scope">
@ -321,7 +331,15 @@
</template>
<script>
import {listDistribute2Task as listTask, getTask, delTask, addTask, updateTask, distribute2Task, assignTask} from "@/api/cxxm/zt/task";
import {
listDistribute2Task as listTask,
getTask,
delTask,
addTask,
updateTask,
distribute2Task,
assignTask
} from "@/api/cxxm/zt/task";
import {getUsers, getGroupNames} from "@/api/cxxm/zt/user";
import {getUserProfile} from "@/api/system/user";

View File

@ -78,6 +78,14 @@
<el-table-column label="村社名称" align="center" prop="csmc" min-width="180"/>
<el-table-column label="图斑类型" align="center" prop="tblx"/>
<el-table-column label="图斑编号" align="center" prop="tbbh" min-width="190"/>
<el-table-column label="已巡查次数" align="center" prop="yxccs"/>
<el-table-column label="州级巡查次数" align="center" prop="zjxccs"/>
<el-table-column label="县级巡查次数" align="center" prop="xjxccs"/>
<el-table-column label="最后巡查时间" align="center" prop="xcsj" min-width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.xcsj, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="图斑面积" align="center" prop="tbmj" :show-overflow-tooltip="true"/>
<el-table-column label="耕地面积" align="center" prop="gdmj" :show-overflow-tooltip="true"/>
<el-table-column label="基本农田面积" align="center" prop="jbntmj" :show-overflow-tooltip="true"/>

View File

@ -255,7 +255,10 @@ template
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAuditForm" style="float:right"> </el-button>
<el-button type="primary" v-if="auditForm.id" @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
</el-button>
<el-button type="primary" v-else @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
</el-button>
<!-- <el-button @click="open = false"> </el-button>-->
</div>
</div>

View File

@ -246,9 +246,9 @@
<el-form-item label="县代码" prop="xdm">
<el-input v-model="form.xdm" placeholder="请输入县代码"/>
</el-form-item>
<el-form-item label="详细信息" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="详细信息" prop="info">-->
<!-- <el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>

View File

@ -199,9 +199,9 @@
<el-form-item label="县代码" prop="xdm">
<el-input v-model="form.xdm" placeholder="请输入县代码"/>
</el-form-item>
<el-form-item label="详细信息" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="详细信息" prop="info">-->
<!-- <el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -220,6 +220,7 @@
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-change="beforeUpload"
:auto-upload="false"
drag
>
@ -231,10 +232,10 @@
<!-- 是否更新已经存在的任务数据-->
<!-- </div>-->
<div style="margin-top: 10px">
<span>仅允许导入json格式文件</span>
<!-- <el-link type="primary" style="font-size:12px;vertical-align: baseline;"-->
<!-- :href='importTemplate'>下载模板-->
<!-- </el-link>-->
<span>仅允许导入json格式文件</span>
<el-link type="primary" style="color: red;font-size:12px;vertical-align: baseline;"
:href='importTemplate'>查看导入数据要求
</el-link>
</div>
</div>
</el-upload>
@ -323,8 +324,9 @@ export default {
rules: {
},
//
importTemplate: process.env.VUE_APP_BASE_API + "/profile/common/task_import_template_v1.0.doc",
importTemplate: process.env.VUE_APP_BASE_API + "/profile/common/部省监管数据要求V1.0.doc",
//
isAllowed: true,
upload: {
//
open: false,
@ -474,6 +476,26 @@ export default {
this.upload.open = true;
this.upload.rwlx = null;
},
beforeUpload(file) {
const allowedExtensions = ['json']; //
const extension = file.name.split('.').pop(); //
const isAllowed = allowedExtensions.includes(extension);
const MAX_SIZE = 256 * 1024 * 1024; // 256MB in bytes
const sizeAllowed = file.size < MAX_SIZE
if (!isAllowed) {
this.isAllowed = false;
this.$message.error('只能上传json文件!');
return this.isAllowed; //
} else if (!sizeAllowed) {
this.isAllowed = false;
this.$message.error('上传的文件大小不能超过 256MB!');
return this.isAllowed; //
}
this.isAllowed = isAllowed && sizeAllowed
return this.isAllowed;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
@ -510,6 +532,10 @@ export default {
if (this.upload.rwlx == null) {
this.$message.error("请选择任务类型!")
} else {
if (!this.isAllowed) {
this.$message.error('文件格式错误!');
return;
}
this.$refs.upload.submit();
Loading.service({fullscreen: true, text: "导入中..."});
}

View File

@ -1,20 +1,5 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"/>
</el-col>
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<!-- <el-form-item label="年份" prop="nian">-->
@ -77,7 +62,7 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="指派情况" prop="xzxfqk">
<el-select v-model="queryParams.xzxfqk" placeholder="请选择下发情况" clearable
<el-select v-model="queryParams.xzxfqk" placeholder="请选择指派情况" clearable
@change="handleQuery">
<el-option key="0" label="未指派" value="0"></el-option>
<el-option key="1" label="已指派" value="1"></el-option>
@ -91,15 +76,14 @@
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="openDistributePage"-->
<!-- >下发-->
<!-- </el-button>-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="openDistributePage"-->
<!-- >乡镇情况-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- </el-row>-->
@ -180,10 +164,19 @@
<el-button
size="mini"
type="text"
icon="el-icon-view"
icon="el-icon-download"
@click="openAssignPage(scope.row)"
v-if="scope.row.xzxfqk=='0'"
>去指派
</el-button>
<el-button
size="mini"
style="color: orangered;border: none"
icon="el-icon-download"
@click="openAssignPage(scope.row)"
v-if="scope.row.xzxfqk=='1'"
>改派
</el-button>
</template>
</el-table-column>
</el-table>
@ -195,8 +188,6 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<!-- 添加或修改任务对话框 -->
@ -264,7 +255,7 @@
</el-dialog>
<el-drawer
title="任务下发"
title="乡镇任务情况"
size="35%"
:visible.sync="drawer"
direction="rtl">
@ -272,22 +263,24 @@
<el-table-column label="乡镇名称" align="center" prop="groupName"/>
<el-table-column label="任务总数" align="center" prop="taskCount"/>
<el-table-column label="人员总数" align="center" prop="userCount"/>
<el-table-column label="人均任务数" align="center">
<template slot-scope="scope">
{{ Math.round(scope.row.taskCount / scope.row.userCount) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleDistribute(scope.row)"
>下发至乡镇
</el-button>
</template>
</el-table-column>
<el-table-column label="已指派" align="center" prop="yzpCount"/>
<el-table-column label="未指派" align="center" prop="wzpCount"/>
<!-- <el-table-column label="人均任务数" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- {{ Math.round(scope.row.taskCount / scope.row.userCount) }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-view"-->
<!-- @click="handleDistribute(scope.row)"-->
<!-- >下发至乡镇-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- <pagination-->

View File

@ -78,6 +78,14 @@
<el-table-column label="村社名称" align="center" prop="csmc" min-width="180"/>
<el-table-column label="图斑来源" align="center" prop="tbly"/>
<el-table-column label="图斑编号" align="center" prop="tbbh" min-width="190"/>
<el-table-column label="已巡查次数" align="center" prop="yxccs"/>
<el-table-column label="州级巡查次数" align="center" prop="zjxccs"/>
<el-table-column label="县级巡查次数" align="center" prop="xjxccs"/>
<el-table-column label="最后巡查时间" align="center" prop="xcsj" min-width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.xcsj, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="图斑面积" align="center" prop="tbmj" :show-overflow-tooltip="true"/>
<el-table-column label="耕地面积" align="center" prop="gdmj" :show-overflow-tooltip="true"/>
<el-table-column label="基本农田面积" align="center" prop="jbntmj" :show-overflow-tooltip="true"/>

View File

@ -255,7 +255,10 @@ template
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitAuditForm" style="float:right"> </el-button>
<el-button type="primary" v-if="auditForm.id" @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
</el-button>
<el-button type="primary" v-else @click="submitAuditForm" style="float:right" v-hasRole="['zjgly']">
</el-button>
<!-- <el-button @click="open = false"> </el-button>-->
</div>
</div>

View File

@ -247,9 +247,9 @@
<el-form-item label="县代码" prop="xdm">
<el-input v-model="form.xdm" placeholder="请输入县代码"/>
</el-form-item>
<el-form-item label="详细信息" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="详细信息" prop="info">-->
<!-- <el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">

View File

@ -1,46 +1,46 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="乡镇名称" prop="xzmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xzmc"-->
<!-- placeholder="请输入乡镇名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="村社名称" prop="csmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.csmc"-->
<!-- placeholder="请输入村社名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="图斑来源" prop="tbly">-->
<!-- <el-input-->
<!-- v-model="queryParams.tbly"-->
<!-- placeholder="请输入图斑来源"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="年份" prop="nian">-->
<!-- <el-input-->
<!-- v-model="queryParams.nian"-->
<!-- placeholder="请输入年份"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="县名称" prop="xian">-->
<!-- <el-input-->
<!-- v-model="queryParams.xian"-->
<!-- placeholder="请输入县名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="乡镇名称" prop="xzmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.xzmc"-->
<!-- placeholder="请输入乡镇名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="村社名称" prop="csmc">-->
<!-- <el-input-->
<!-- v-model="queryParams.csmc"-->
<!-- placeholder="请输入村社名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="图斑来源" prop="tbly">-->
<!-- <el-input-->
<!-- v-model="queryParams.tbly"-->
<!-- placeholder="请输入图斑来源"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="综合搜索" prop="tbbh">
<el-input
v-model="queryParams.tbbh"
@ -201,9 +201,9 @@
<el-form-item label="县代码" prop="xdm">
<el-input v-model="form.xdm" placeholder="请输入县代码"/>
</el-form-item>
<el-form-item label="详细信息" prop="info">
<el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="详细信息" prop="info">-->
<!-- <el-input v-model="form.info" type="textarea" placeholder="请输入内容"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -222,6 +222,7 @@
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-change="beforeUpload"
:auto-upload="false"
drag
>
@ -233,10 +234,10 @@
<!-- 是否更新已经存在的任务数据-->
<!-- </div>-->
<div style="margin-top: 10px">
<span>仅允许导入json格式文件</span>
<!-- <el-link type="primary" style="font-size:12px;vertical-align: baseline;"-->
<!-- :href='importTemplate'>下载模板-->
<!-- </el-link>-->
<span>仅允许导入json格式文件</span>
<el-link type="primary" style="color: red;font-size:12px;vertical-align: baseline;"
:href='importTemplate'>查看导入数据要求
</el-link>
</div>
</div>
</el-upload>
@ -324,8 +325,9 @@ export default {
//
rules: {},
//
importTemplate: process.env.VUE_APP_BASE_API + "/profile/common/task_import_template_v1.0.doc",
importTemplate: process.env.VUE_APP_BASE_API + "/profile/common/自提图斑数据要求V1.0.doc",
//
isAllowed: true,
upload: {
//
open: false,
@ -476,6 +478,26 @@ export default {
this.upload.open = true;
this.upload.rwlx = null;
},
beforeUpload(file) {
const allowedExtensions = ['json']; //
const extension = file.name.split('.').pop(); //
const isAllowed = allowedExtensions.includes(extension);
const MAX_SIZE = 256 * 1024 * 1024; // 256MB in bytes
const sizeAllowed = file.size < MAX_SIZE
if (!isAllowed) {
this.isAllowed = false;
this.$message.error('只能上传json文件!');
return this.isAllowed; //
} else if (!sizeAllowed) {
this.isAllowed = false;
this.$message.error('上传的文件大小不能超过 256MB!');
return this.isAllowed; //
}
this.isAllowed = isAllowed && sizeAllowed
return this.isAllowed;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
@ -512,6 +534,10 @@ export default {
if (this.upload.rwlx == null) {
this.$message.error("请选择任务类型!")
} else {
if (!this.isAllowed) {
this.$message.error('文件格式错误!');
return;
}
this.$refs.upload.submit();
Loading.service({fullscreen: true, text: "导入中..."});
}

View File

@ -5,28 +5,29 @@
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="用户姓名" prop="nickName">
<el-input v-model="form.nickName" disabled />
<el-input v-model="form.nickName" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="登录账号" prop="userName">
<el-input v-model="form.userName" disabled />
<el-input v-model="form.userName" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<h4 class="form-header h4">角色信息</h4>
<el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
<el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table"
@selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)">
<el-table-column label="序号" type="index" align="center">
<template slot-scope="scope">
<span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
<el-table-column label="角色编号" align="center" prop="roleId" />
<el-table-column label="角色名称" align="center" prop="roleName" />
<el-table-column label="权限字符" align="center" prop="roleKey" />
<el-table-column label="角色编号" align="center" prop="roleId"/>
<el-table-column label="角色名称" align="center" prop="roleName"/>
<el-table-column label="权限字符" align="center" prop="roleKey"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -34,7 +35,7 @@
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize"/>
<el-form label-width="100px">
<el-form-item style="text-align: center;margin-left:-120px;margin-top:30px;">
@ -46,20 +47,20 @@
</template>
<script>
import { getAuthRole, updateAuthRole } from "@/api/system/user";
import {getAuthRole, updateAuthRole} from "@/api/system/user";
export default {
name: "AuthRole",
data() {
return {
//
//
loading: true,
//
total: 0,
pageNum: 1,
pageSize: 10,
//
roleIds:[],
roleIds: [],
//
roles: [],
//
@ -92,7 +93,15 @@ export default {
},
//
handleSelectionChange(selection) {
this.roleIds = selection.map((item) => item.roleId);
// this.roleIds = selection.map((item) => item.roleId);
//
if (selection.length == 1) {
this.roleIds = selection.map((item) => item.roleId);
} else if (selection.length > 1) {
// 1
this.$refs.table.clearSelection(); //
this.$refs.table.toggleRowSelection(selection.pop()); //
}
},
//
getRowKey(row) {
@ -102,16 +111,21 @@ export default {
submitForm() {
const userId = this.form.userId;
const roleIds = this.roleIds.join(",");
updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
updateAuthRole({userId: userId, roleIds: roleIds}).then((response) => {
this.$modal.msgSuccess("授权成功");
this.close();
});
},
/** 关闭按钮 */
close() {
const obj = { path: "/system/user" };
const obj = {path: "/system/user"};
this.$tab.closeOpenPage(obj);
},
},
};
</script>
<style scoped>
::v-deep .el-table__header-wrapper .el-checkbox {
visibility: hidden;
}
</style>

View File

@ -193,6 +193,7 @@
align="center"
width="160"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope" v-if="scope.row.userId !== 1">
<el-button
@ -281,7 +282,7 @@
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="用户角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择用户角色">
<el-select v-model="form.roleIds" multiple multiple-limit="1" placeholder="请选择用户角色">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
@ -361,6 +362,7 @@
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:on-change="beforeUpload"
:auto-upload="false"
drag
>
@ -447,6 +449,7 @@ export default {
label: "label"
},
//
isAllowed: true,
upload: {
//
open: false,
@ -728,6 +731,26 @@ export default {
importTemplateXJ() {
this.download('cxxm/user/importTemplateXJ', {}, `xj_user_template_v1.0.xlsx`)
},
beforeUpload(file) {
const allowedExtensions = ['xls', 'xlsx']; //
const extension = file.name.split('.').pop(); //
const isAllowed = allowedExtensions.includes(extension);
const MAX_SIZE = 256 * 1024 * 1024; // 256MB in bytes
const sizeAllowed = file.size < MAX_SIZE
if (!isAllowed) {
this.isAllowed = false;
this.$message.error('只能上传xls、xlsx文件!');
return this.isAllowed; //
} else if (!sizeAllowed) {
this.isAllowed = false;
this.$message.error('上传的文件大小不能超过 256MB!');
return this.isAllowed; //
}
this.isAllowed = isAllowed && sizeAllowed
return this.isAllowed;
},
//
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
@ -743,6 +766,10 @@ export default {
},
//
submitFileForm() {
if(!this.isAllowed){
this.$message.error('文件格式错误!');
return;
}
this.$refs.upload.submit();
Loading.service({fullscreen: true, text: "导入中..."});
}