修改提交
This commit is contained in:
parent
9538771809
commit
f6c480d34e
|
|
@ -1,41 +0,0 @@
|
|||
//package com.company.business.controller;
|
||||
//
|
||||
//
|
||||
//import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//import com.company.business.entity.TbUserOption;
|
||||
//import com.company.business.service.OptionService;
|
||||
//import com.company.project.common.aop.annotation.LogAnnotation;
|
||||
//
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//
|
||||
///**
|
||||
// * 用户意见收集查询
|
||||
// */
|
||||
//@RequestMapping("/option")
|
||||
//@RestController
|
||||
//@Api(tags = "意见收集-意见收集")
|
||||
//public class OptionController {
|
||||
// @Resource
|
||||
// private OptionService optionService;
|
||||
//
|
||||
// @PostMapping("/listByPage")
|
||||
// @ApiOperation(value = "分页查询用户意见接口")
|
||||
// @LogAnnotation(title = "意见收集", action = "分页查询用户意见接口")
|
||||
// @SaCheckPermission("tb:option:list")
|
||||
// @SuppressWarnings("unchecked")
|
||||
// public Page<TbUserOption> pageInfo(@RequestBody TbUserOption vo) {
|
||||
// LambdaQueryWrapper<TbUserOption> queryWrapper = Wrappers.lambdaQuery();
|
||||
// queryWrapper.orderByDesc(TbUserOption::getCreateTime);
|
||||
// return optionService.page(vo.getQueryPage(), queryWrapper);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
|
@ -1,32 +1,31 @@
|
|||
package com.company.project.controller;
|
||||
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.company.business.entity.TbUserOption;
|
||||
import com.company.project.entity.SysRole;
|
||||
import com.company.project.entity.SysUser;
|
||||
import com.company.project.entity.TbTask;
|
||||
import com.company.project.entity.TbUserOption;
|
||||
import com.company.project.common.aop.annotation.LogAnnotation;
|
||||
import com.company.project.common.utils.ExportExcelUtil;
|
||||
|
||||
import com.company.project.service.OptionService;
|
||||
import com.company.project.service.UserService;
|
||||
import com.company.project.vo.resp.UserInfoRespVO;
|
||||
import com.company.project.vo.resp.UserOwnRoleRespVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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 javax.annotation.Resource;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +40,9 @@ public class OptionController {
|
|||
@Resource
|
||||
private OptionService optionService;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@PostMapping("/listByPage")
|
||||
@ApiOperation(value = "分页查询用户意见接口")
|
||||
@LogAnnotation(title = "意见收集", action = "分页查询用户意见接口")
|
||||
|
|
@ -85,4 +87,47 @@ public class OptionController {
|
|||
public void addOption(@RequestBody TbUserOption vo) {
|
||||
optionService.addOption(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/addOrUpdateTask")
|
||||
@ApiOperation(value = "新增任务")
|
||||
@LogAnnotation(title = "任务管理", action = "新增任务")
|
||||
@SuppressWarnings("unchecked")
|
||||
public String addOrUpdateTask(@RequestBody TbTask vo) {
|
||||
return optionService.addOrUpdateTask(vo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/userRole")
|
||||
@ApiOperation(value = "用户角色")
|
||||
public String userRole() {
|
||||
String userId = StpUtil.getLoginIdAsString();
|
||||
UserOwnRoleRespVO us= userService.getUserOwnRole(userId);
|
||||
List<SysRole> roleList=us.getAllRole();
|
||||
List<SysRole> ownRole=new ArrayList<>();
|
||||
List<String> roles=us.getOwnRoles();
|
||||
for (SysRole role:roleList){
|
||||
for (String id:roles){
|
||||
if(role.getId().equals(id)){
|
||||
ownRole.add(role);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (SysRole role:ownRole){
|
||||
if(role.getName().contains("督察")){
|
||||
return "1";
|
||||
}else if(role.getName().contains("巡察")){
|
||||
return "2";
|
||||
}
|
||||
else if(role.getName().contains("临时")){
|
||||
return "3";
|
||||
}else{
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.company.project.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Api(tags = "临时用户管理")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/temp/user/")
|
||||
public class TemporaryUserController {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.company.project.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class TbSourceFile {
|
||||
|
||||
private String id;
|
||||
|
||||
private String sourceId;
|
||||
|
||||
private String filePath;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String fileSuffix;
|
||||
|
||||
private String fileType;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.company.project.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
* 任务管理
|
||||
*/
|
||||
@Data
|
||||
public class TbTask {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String taskType;
|
||||
/**
|
||||
* 任务时间
|
||||
*/
|
||||
private String taskTime;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 任务主题
|
||||
*/
|
||||
private String taskTitle;
|
||||
/**
|
||||
*主题说明
|
||||
*/
|
||||
private String taskDescribe;
|
||||
/**
|
||||
* 二维码路径
|
||||
*/
|
||||
private String filePath;
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.company.business.entity;
|
||||
package com.company.project.entity;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
|
|
@ -22,7 +22,7 @@ public class TbUserOption extends BasePageEntity implements Serializable {
|
|||
|
||||
private String id;
|
||||
@Excel(name = "序号", width = 10.0, orderNum = "1")
|
||||
private String rowNum;
|
||||
private int rowNum;
|
||||
/**
|
||||
* 使用人
|
||||
*/
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
package com.company.business.mapper;
|
||||
package com.company.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.company.business.entity.TbUserOption;
|
||||
import com.company.project.entity.SysGenerator;
|
||||
import com.company.project.entity.SysRole;
|
||||
import com.company.project.entity.TbUserOption;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.company.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.company.business.entity.TbUserOption;
|
||||
import com.company.project.entity.TbTask;
|
||||
import com.company.project.entity.TbUserOption;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -38,4 +38,11 @@ public interface OptionService extends IService<TbUserOption> {
|
|||
* @return
|
||||
*/
|
||||
void addOption(TbUserOption vo);
|
||||
|
||||
/**
|
||||
* 新增/修改任务
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
String addOrUpdateTask(TbTask vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package com.company.project.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.company.business.entity.TbUserOption;
|
||||
import com.company.business.mapper.OptionMapper;
|
||||
import com.company.project.entity.TbTask;
|
||||
import com.company.project.entity.TbUserOption;
|
||||
import com.company.project.mapper.OptionMapper;
|
||||
import com.company.project.common.exception.BusinessException;
|
||||
import com.company.project.service.OptionService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -69,4 +69,14 @@ public class OptionServiceImpl extends ServiceImpl<OptionMapper, TbUserOption>
|
|||
}
|
||||
mapper.addOption(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/修改任务
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String addOrUpdateTask(TbTask vo) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -41,7 +42,8 @@ import java.util.List;
|
|||
@Service
|
||||
@Slf4j
|
||||
public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements UserService {
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Resource
|
||||
|
|
@ -89,11 +91,41 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
|
|||
sysUser.setDeptNo(sysDept.getDeptNo());
|
||||
}
|
||||
}
|
||||
String roleType=getRolType(sysUser.getId());
|
||||
respVO.setRoleType(roleType);
|
||||
//saToken
|
||||
StpUtil.login(sysUser.getId());
|
||||
return respVO;
|
||||
}
|
||||
|
||||
|
||||
private String getRolType(String userId){
|
||||
UserOwnRoleRespVO us= getUserOwnRole(userId);
|
||||
List<SysRole> roleList=us.getAllRole();
|
||||
List<SysRole> ownRole=new ArrayList<>();
|
||||
List<String> roles=us.getOwnRoles();
|
||||
for (SysRole role:roleList){
|
||||
for (String id:roles){
|
||||
if(role.getId().equals(id)){
|
||||
ownRole.add(role);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (SysRole role:ownRole){
|
||||
if(role.getName().contains("督察")){
|
||||
return "1";
|
||||
}else if(role.getName().contains("巡察")){
|
||||
return "2";
|
||||
}
|
||||
else if(role.getName().contains("临时")){
|
||||
return "3";
|
||||
}else{
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserInfo(SysUser vo) {
|
||||
|
||||
|
|
@ -247,6 +279,7 @@ public class UserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impleme
|
|||
for (SysRole role:list){
|
||||
if("1".equals(role.getId())){
|
||||
list.remove(role);
|
||||
break;
|
||||
}
|
||||
}
|
||||
UserOwnRoleRespVO vo = new UserOwnRoleRespVO();
|
||||
|
|
|
|||
|
|
@ -24,4 +24,6 @@ public class LoginRespVO {
|
|||
private String phone;
|
||||
@ApiModelProperty(value = "用户所拥有的菜单权限(前后端分离返回给前端控制菜单和按钮的显示和隐藏)")
|
||||
private List<PermissionRespNode> list;
|
||||
@ApiModelProperty(value = "角色类型")
|
||||
private String roleType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ spring:
|
|||
datasource:
|
||||
master:
|
||||
username: root
|
||||
password: 123456
|
||||
password: Bonus@admin123!
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/company_project?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
|
||||
url: jdbc:mysql://192.168.0.14:4417/company_project?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
|
||||
oracle:
|
||||
username: root
|
||||
password: 123456
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# 端口
|
||||
server:
|
||||
port: 8080
|
||||
port: 21666
|
||||
servlet:
|
||||
context-path: /manager
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
mvc:
|
||||
throw-exception-if-no-handler-found: true
|
||||
resources:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?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.company.business.mapper.OptionMapper">
|
||||
<mapper namespace="com.company.project.mapper.OptionMapper">
|
||||
<insert id="addOption">
|
||||
insert into tb_user_option(
|
||||
user_name,
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
update tb_user_option set del_flag=1 WHERE id=#{id}
|
||||
</update>
|
||||
<!-- 获取列表 -->
|
||||
<select id="pageInfo" resultType="com.company.business.entity.TbUserOption">
|
||||
<select id="pageInfo" resultType="com.company.project.entity.TbUserOption">
|
||||
SELECT id, user_name userName, user_phone userPhone,
|
||||
unit, create_time, create_day createDay, options
|
||||
from tb_user_option
|
||||
|
|
@ -30,9 +30,9 @@
|
|||
<if test="vo.times!=null and vo.times!=''">
|
||||
and create_day between #{vo.startTime} and #{vo.endTime}
|
||||
</if>
|
||||
ORDER BY create_time desc
|
||||
ORDER BY id desc
|
||||
</select>
|
||||
<select id="getPageList" resultType="com.company.business.entity.TbUserOption">
|
||||
<select id="getPageList" resultType="com.company.project.entity.TbUserOption">
|
||||
SELECT
|
||||
@rownum:=@rownum+1 AS rownum,
|
||||
id, user_name userName, user_phone userPhone,
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
<if test="vo.times!=null and vo.times!=''">
|
||||
and create_day between #{vo.startTime} and #{vo.endTime}
|
||||
</if>
|
||||
order by create_time desc
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@
|
|||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-icon layui-icon-username" name="username" ></label>
|
||||
<input type="text" name="username" lay-verify="required|account" placeholder="用户名" autocomplete="off" class="layui-input" value="admin">
|
||||
<input type="text" name="username" lay-verify="required|account" placeholder="用户名" autocomplete="off" class="layui-input" >
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-icon layui-icon-password" name="password"></label>
|
||||
<input type="password" name="password" lay-verify="required|password" placeholder="密码" autocomplete="off" class="layui-input" value="123456">
|
||||
<input type="password" name="password" lay-verify="required|password" placeholder="密码" autocomplete="off" class="layui-input" >
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-icon layui-icon-vercode" name="captcha"></label>
|
||||
|
|
@ -70,7 +70,6 @@
|
|||
layer.msg('密码不能为空');
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ctx + 'sys/user/login',
|
||||
|
|
@ -78,7 +77,10 @@
|
|||
data: JSON.stringify(data),
|
||||
contentType: "application/json",
|
||||
success: function (res) {
|
||||
|
||||
if (res.code == 0) {
|
||||
CoreUtil.setData("roleType",res.data.roleType);
|
||||
console.log(CoreUtil.getData("roleType"));
|
||||
layer.msg('登录成功', {time: 1000}, function () {
|
||||
window.location = ctx + 'index/home';
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<!--公共模块-->
|
||||
<div th:replace="~{layout}"></div>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-container" style="width:600px;">
|
||||
<form class="layui-form layui-form-pane" action="" lay-filter="info">
|
||||
<input name="id" hidden>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">任务类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="username" lay-verify="title" disabled="disabled"
|
||||
style="background:#eeeeee!important" autocomplete="off" placeholder="请输入账号"
|
||||
class="layui-input layui-disabled ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">任务主题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="realName" placeholder="请输入真实姓名" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">主题说明</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="tel" name="phone" placeholder="请输入手机号" lay-verify="required|phone" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">任务时效</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button type="submit" class="layui-btn" lay-submit="" lay-filter="submit">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
var form = layui.form,
|
||||
layer = layui.layer;
|
||||
layui.use(function () {
|
||||
// 初始化表单数据
|
||||
function initForm(data) {
|
||||
form.val('info', {
|
||||
"id": data.id,
|
||||
"username": data.username,
|
||||
"realName": data.realName,
|
||||
"phone": data.phone,
|
||||
"email": data.email,
|
||||
"sex": data.sex.toString(), // 性别需要转换为字符串
|
||||
"status": data.status === 1 // 开关状态
|
||||
});
|
||||
form.render(); // 更新全部
|
||||
}
|
||||
|
||||
// 获取数据并初始化表单
|
||||
$(function () {
|
||||
CoreUtil.sendGet(ctx + "sys/user", null, function (res) {
|
||||
if (res.data != null) {
|
||||
initForm(res.data);
|
||||
}
|
||||
});
|
||||
// 监听提交
|
||||
form.on('submit(submit)', function (data) {
|
||||
//checkbox值 没有选中默认0
|
||||
data.field.status = CoreUtil.isEmptyGet(data.field.status, 0) ;
|
||||
CoreUtil.sendPut(ctx + "sys/user/info", data.field, function (res) {
|
||||
layer.msg(res.msg);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
|
|
@ -11,9 +11,9 @@
|
|||
<div class="role_table_div">
|
||||
<div id="searchParam" sa:hasPermission="tb:option:list">
|
||||
<form class="layui-form layui-form-pane" action="">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item" style="margin-left: 10px">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="keyWord" class="layui-input" autocomplete="off" placeholder="请如数关键字">
|
||||
<input type="text" name="keyWord" class="layui-input" autocomplete="off" placeholder="姓名、电话、意见归口单位">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" readonly class="layui-input" name="times" id="times" placeholder="请选择评价时间">
|
||||
|
|
@ -30,28 +30,72 @@
|
|||
</div>
|
||||
<table class="layui-hide" id="option_table" lay-filter="option_table"></table>
|
||||
</div>
|
||||
|
||||
<!-- 新增-->
|
||||
<div class="panel panel-default task_add" id="task_add" hidden>
|
||||
<div class="panel-heading title" ></div>
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-form-pane" action="" lay-filter="taskInfo">
|
||||
<input name="id" id="id" hidden>
|
||||
<input name="taskType" id="taskType" hidden>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">任务类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="type" id="type" lay-verify="required" readonly
|
||||
autocomplete="off" style="background:#eeeeee!important" placeholder="请输入任务"
|
||||
class="layui-input ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">任务主题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="taskTitle" id="taskTitle" placeholder="请输入任务主题" lay-verify="required|length" maxlength="200" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">主题说明</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="taskDescribe" id="taskDescribe" placeholder="请输入主题说明" lay-verify="required|length" maxlength="6000" autocomplete="off" class="layui-textarea">
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="isBlock">
|
||||
<label class="layui-form-label">任务时效</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="taskTime" id="taskTime" readonly lay-verify="required" placeholder="请选择时间" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
<script type="text/html" id="toolbar">
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- <button class="layui-btn layui-btn-sm" lay-event="addNewRole" sa:hasPermission="sys:role:add">添加</button>-->
|
||||
<!-- </div>-->
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm" lay-event="addTask" sa:hasPermission="tb:option:add">新增</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="export" sa:hasPermission="tb:option:export">导出</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="del" sa:hasPermission="tb:option:del">删除</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/html" id="tool">
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" sa:hasPermission="tb:option:del">删除</a>
|
||||
</script>
|
||||
<script>
|
||||
|
||||
layui.config({
|
||||
base: ctx + 'static/layui-ext/'
|
||||
}).extend({
|
||||
eleTree: 'eleTree/eleTree'
|
||||
}).use(function () {
|
||||
var table = layui.table;
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
var laydate = layui.laydate;
|
||||
var tree = layui.tree;
|
||||
var eleTree = layui.eleTree;
|
||||
|
||||
var tableIns1 = table.render({
|
||||
elem: '#option_table'
|
||||
|
|
@ -69,6 +113,7 @@
|
|||
}
|
||||
, cols: [
|
||||
[
|
||||
{type: 'checkbox', fixed: 'left'},
|
||||
{field:'index', width:80, title: '序号',type:'numbers', sort: true,fixed: 'left',},
|
||||
{field: 'userName', title: '姓名', width: 250},
|
||||
{field: 'userPhone', title: '电话', width: 250},
|
||||
|
|
@ -86,9 +131,66 @@
|
|||
elem: '#times'
|
||||
, type: 'times',
|
||||
range: true //或 range: '到' 来自定义范围内的分隔字符
|
||||
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#taskTime'
|
||||
, type: 'times',
|
||||
range: true //或 range: '到' 来自定义范围内的分隔字符
|
||||
});
|
||||
|
||||
table.on('toolbar(option_table)', function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id);
|
||||
let roleType = CoreUtil.getData("roleType");
|
||||
console.log("角色类型-->"+roleType);
|
||||
switch (obj.event) {
|
||||
case 'addTask':
|
||||
resetForm();
|
||||
let XL='600px';
|
||||
let YL='600px';
|
||||
//新增
|
||||
if(roleType==='1'){
|
||||
$("#type").val("监督类")
|
||||
$("#taskType").val("1")
|
||||
}else {
|
||||
YL='420px';
|
||||
$("#isBlock").hide();
|
||||
$("#type").val("巡查类");
|
||||
$("#taskType").val("2")
|
||||
}
|
||||
layer.open({
|
||||
type: 1,
|
||||
offset: '50px',
|
||||
skin: 'layui-layer-molv',
|
||||
title: "新增任务",
|
||||
area: [XL, YL],
|
||||
shade: 0,
|
||||
shadeClose: false,
|
||||
content: $("#task_add"),
|
||||
btn: ['确定', '取消'],
|
||||
yes: function (index) {
|
||||
console.log("提交");
|
||||
let formData={
|
||||
'id':$("#id").val(),
|
||||
'taskType':$("#taskType").val(),
|
||||
'taskTitle':$("#taskTitle").val(),
|
||||
'taskTime':$("#taskTime").val(),
|
||||
'taskDescribe':$("#taskDescribe").val(),
|
||||
}
|
||||
//新增任务/修改
|
||||
CoreUtil.sendPost(ctx + "option/addOrUpdateTask", formData, function (res) {
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
break;
|
||||
case 'export':
|
||||
break;
|
||||
};
|
||||
});
|
||||
|
||||
table.on('tool(option_table)', function (obj) {
|
||||
var data = obj.data;
|
||||
|
|
@ -96,11 +198,20 @@
|
|||
case 'del':
|
||||
tipDialog(data.id);
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function resetForm() {
|
||||
form.val('taskInfo', {
|
||||
'id': '',
|
||||
'type': '',
|
||||
'taskType': '',
|
||||
'taskTitle': '',
|
||||
'taskDescribe': '',
|
||||
'taskTime': ''
|
||||
});
|
||||
form.render(); // 更新全部
|
||||
}
|
||||
|
||||
var tipDialog = function (id) {
|
||||
layer.open({
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="panel panel-default operation_user" hidden>
|
||||
<div class="panel-heading title" s></div>
|
||||
<div class="panel-heading title" ></div>
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form " action="" lay-filter="info" style="width: 700px;margin-top: 10px">
|
||||
<input name="id" hidden/>
|
||||
|
|
@ -31,50 +31,6 @@
|
|||
<input type="password" name="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <div class="layui-form-label ">所属部门</div>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="deptName" name="deptName" placeholder="请选择所属部门" autocomplete="off" class="layui-input"-->
|
||||
<!-- readonly="readonly" style="background:#eeeeee!important">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">真实姓名</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="text" name="realName" placeholder="请输入真实姓名" autocomplete="off" class="layui-input">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <div class="layui-form-label ">手机号</div>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="phone" name="phone" placeholder="请输入手机号" autocomplete="off" class="layui-input">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">邮箱</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off"-->
|
||||
<!-- class="layui-input">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">状态</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="checkbox" name="status" value="1" lay-skin="switch" title="启用|禁止"-->
|
||||
<!-- lay-filter="switch" checked="checked">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">单选框</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input type="radio" name="sex" value="1" title="男">-->
|
||||
<!-- <input type="radio" name="sex" value="2" title="女">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button type="submit" class="layui-btn" lay-submit="" lay-filter="submit">保存</button>
|
||||
|
|
@ -278,7 +234,7 @@
|
|||
offset: '50px',
|
||||
skin: 'layui-layer-molv',
|
||||
title: "赋予角色",
|
||||
area: ['500px', '400px'],
|
||||
area: ['600px', '600px'],
|
||||
shade: 0,
|
||||
shadeClose: false,
|
||||
content: $("#roles"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue