上报信息

This commit is contained in:
周源 2021-07-13 20:29:36 +08:00
parent 934ec5ade5
commit 00fb961a8f
20 changed files with 702 additions and 12 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -0,0 +1,79 @@
package com.ydool.boot.api.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
import com.github.xiaoymin.knife4j.annotations.DynamicResponseParameters;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.modules.rddb.entity.Report;
import com.ydool.boot.modules.rddb.entity.bo.ReportBo;
import com.ydool.boot.modules.rddb.service.ReportService;
import com.ydool.boot.modules.rddb.vo.ReportVo;
import com.ydool.boot.modules.rddb.wrapper.ReportWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author: zhouyuan
* @date: 2021/7/13
*/
@RestController
@RequestMapping("/api/report")
@Api(value = "上报信息", tags = "上报信息")
public class ApiReportController extends ApiBaseController {
@Autowired
private ReportService reportService;
@ApiOperation("我的上报列表")
@GetMapping
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页"),
@ApiImplicitParam(name = "size", value = "显示条数"),
@ApiImplicitParam(name = "title", value = "标题"),
})
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "上报信息", dataTypeClass = ReportVo.class)
})
public void reportList(String title) {
QueryWrapper<Report> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("created_at")
.eq("created_id", getApiUserId())
.like(StrUtil.isNotBlank(title), "title", title);
Page page = reportService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(ReportWrapper.build().pageVO(page)));
}
@ApiOperation("上报详情")
@GetMapping("{id}")
@DynamicResponseParameters(properties = {
@DynamicParameter(name = "data", value = "上报信息", dataTypeClass = ReportVo.class)
})
public void reportDetail(@PathVariable String id) {
Report report = reportService.getById(id);
if (report == null) Ret.fail("未找到该记录");
if (!report.getCreatedId().equals(getApiUserId())) Ret.fail("您不能查看他人提交的数据");
render(Ret.ok().data(ReportWrapper.build().entityVO(report)));
}
@ApiOperation("添加上报")
@PostMapping("save")
public void reportSave(@Validated ReportBo reportBo) {
Report report = new Report();
BeanUtils.copyProperties(reportBo,report);
report.setCreatedId(getApiUserId());
report.setScore(0);
report.setHireStatus(0);
boolean flag = reportService.save(report);
render(flag ? Ret.ok() : Ret.fail("操作失败"));
}
}

View File

@ -0,0 +1,59 @@
package com.ydool.boot.modules.rddb.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.boot.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 上报
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_report")
public class Report extends BaseEntity{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "创建者id")
private String createdId;
@ApiModelProperty(value = "更新者id")
private String updatedId;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "乡镇id")
private String street;
@ApiModelProperty(value = "录用级别")
private String hireLevel;
@ApiModelProperty(value = "录用类别")
private String hireCategory;
@ApiModelProperty(value = "录用日期,年月")
private String hireDate;
@ApiModelProperty(value = "得分")
private Integer score;
@ApiModelProperty(value = "录用状态 0待审核 1通过 2拒绝")
private Integer hireStatus;
@ApiModelProperty(value = "附件路径")
private String attachmentPath;
@ApiModelProperty(value = "附件名")
private String attachmentName;
}

View File

@ -0,0 +1,35 @@
package com.ydool.boot.modules.rddb.entity.bo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* <p>
* 上报
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Data
public class ReportBo {
@ApiModelProperty(value = "标题")
@NotBlank(message = "标题不能为空")
private String title;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "乡镇id")
private String street;
@ApiModelProperty(value = "附件路径")
private String attachmentPath;
@ApiModelProperty(value = "附件名")
private String attachmentName;
}

View File

@ -20,7 +20,7 @@ public class MyGenerator {
public static void main(String[] args) {
//表名
String tableName = "t_user_type";
String tableName = "t_report";
//表前缀
String tablePrefix = "t_";
@ -44,10 +44,10 @@ public class MyGenerator {
//数据源
DataSourceConfig dsc = new DataSourceConfig();
dsc.setUrl("jdbc:mysql://106.54.109.185:3306/ydool_rddb?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8");
dsc.setUrl("jdbc:mysql://127.0.0.1:3306/ydool_rd?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("yuan961124");
dsc.setPassword("123456");
dsc.setDbType(DbType.MYSQL);
mpg.setDataSource(dsc);

View File

@ -0,0 +1,16 @@
package com.ydool.boot.modules.rddb.mapper;
import com.ydool.boot.modules.rddb.entity.Report;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 上报 Mapper 接口
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
public interface ReportMapper extends BaseMapper<Report> {
}

View File

@ -0,0 +1,5 @@
<?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.ydool.boot.modules.rddb.mapper.ReportMapper">
</mapper>

View File

@ -0,0 +1,19 @@
package com.ydool.boot.modules.rddb.service;
import com.ydool.boot.core.service.BaseService;
import com.ydool.boot.modules.rddb.entity.Report;
import com.ydool.boot.modules.rddb.mapper.ReportMapper;
import org.springframework.stereotype.Service;
/**
* <p>
* 上报 服务实现类
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Service
public class ReportService extends BaseService<ReportMapper, Report> {
}

View File

@ -0,0 +1,39 @@
package com.ydool.boot.modules.rddb.vo;
import com.ydool.boot.modules.rddb.entity.Report;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* <p>
* 上报
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Data
public class ReportVo extends Report {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "录用级别中文")
private String hireLevelStr;
@ApiModelProperty(value = "录用类别中文")
private String hireCategoryStr;
@ApiModelProperty(value = "附件路径集合")
private List attachmentPathList;
@ApiModelProperty(value = "附件名集合")
private List attachmentNameList;
@ApiModelProperty(value = "创建人")
private String createdName;
@ApiModelProperty(value = "所属乡镇中文")
private String streetStr;
}

View File

@ -0,0 +1,86 @@
package com.ydool.boot.modules.rddb.web;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ydool.boot.common.result.Ret;
import com.ydool.boot.core.auth.PreAuth;
import com.ydool.boot.modules.rddb.entity.Report;
import com.ydool.boot.modules.rddb.service.ReportService;
import com.ydool.boot.modules.rddb.vo.ReportVo;
import com.ydool.boot.modules.rddb.wrapper.ReportWrapper;
import com.ydool.boot.modules.sys.web.BaseAdminController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
* 上报 前端控制器
* </p>
*
* @author zhouyuan
* @since 2021-07-13
*/
@Controller
@RequestMapping("${ydool.path}/rddb/report")
public class ReportController extends BaseAdminController {
@Autowired
private ReportService reportService;
@GetMapping
public String index() {
return "modules/rddb/report/index.html";
}
@PostMapping("list")
@ResponseBody
public void list(Report report) {
QueryWrapper<Report> wrapper = new QueryWrapper<>();
if (StringUtils.isNotBlank(report.getTitle())) wrapper.like("title", report.getTitle());
wrapper.orderByDesc("created_at");
Page page = reportService.page(new Page(getPageNum(), getPageSize()), wrapper);
render(Ret.ok().paged(ReportWrapper.build().pageVO(page)));
}
@PreAuth("rddb:report:form")
@GetMapping("form")
public String form(String id, Model model) {
if (ObjectUtil.isNotEmpty(id)) {
Report report = reportService.getById(id);
if(report!=null){
model.addAttribute("report",ReportWrapper.build().entityVO(report));
}
} else {
model.addAttribute("report", new ReportVo());
}
return "modules/rddb/report/form.html";
}
@PostMapping("save")
public void save(@Validated ReportVo report) {
if(StrUtil.isBlank(report.getId())) {
report.setHireStatus(0);
report.setScore(0);
report.setCreatedId(getLoginUser().getId());
}
boolean flag = reportService.saveOrUpdate(report);
render(flag ? Ret.ok() : Ret.fail("操作失败"));
}
@PostMapping("/delete")
public void delete(String id) {
boolean flag = reportService.removeById(id);
render(!flag ? Ret.fail("操作失败") : Ret.ok());
}
}

View File

@ -0,0 +1,43 @@
package com.ydool.boot.modules.rddb.wrapper;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.ydool.boot.common.cache.DictUtils;
import com.ydool.boot.common.cache.StreetUtils;
import com.ydool.boot.common.utils.SpringUtils;
import com.ydool.boot.core.wrapper.BaseWrapper;
import com.ydool.boot.modules.rddb.entity.Report;
import com.ydool.boot.modules.rddb.vo.ReportVo;
import com.ydool.boot.modules.sys.entity.User;
import com.ydool.boot.modules.sys.service.UserService;
import java.util.Arrays;
/**
* @author zhouyuan
* @date 2020/07/13
*/
public class ReportWrapper extends BaseWrapper<Report, ReportVo> {
public static ReportWrapper build() {
return new ReportWrapper();
}
@Override
public ReportVo entityVO(Report report) {
ReportVo vo = BeanUtil.copyProperties(report, ReportVo.class);
UserService userService = SpringUtils.getBean(UserService.class);
User user = userService.getById(report.getCreatedId());
vo.setCreatedName(user != null ? user.getUserName() : "");
vo.setHireCategoryStr(DictUtils.getDictLabel("report_hire_category", report.getHireCategory()));
vo.setHireLevelStr(DictUtils.getDictLabel("report_hire_level", report.getHireLevel()));
vo.setStreetStr(StreetUtils.getStreetName(report.getStreet()));
if(StrUtil.isNotBlank(vo.getAttachmentName())) vo.setAttachmentNameList(Arrays.asList(vo.getAttachmentName().split(",")));
if(StrUtil.isNotBlank(vo.getAttachmentPath())) vo.setAttachmentPathList(Arrays.asList(vo.getAttachmentPath().split(",")));
return vo;
}
}

View File

@ -1,6 +1,13 @@
db.user = ydool_rd
db.pass = MfaSPabGrDmPtET@123
db.url = jdbc:mysql://122.112.138.17:3306/ydool_rd?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8
#online
#db.user = ydool_rd
#db.pass = MfaSPabGrDmPtET@123
#db.url = jdbc:mysql://122.112.138.17:3306/ydool_rd?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8
#db.driver = com.mysql.cj.jdbc.Driver
#local
db.user = root
db.pass = 123456
db.url = jdbc:mysql://127.0.0.1:3306/ydool_rd?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8
db.driver = com.mysql.cj.jdbc.Driver
spring.servlet.multipart.max-file-size=500MB

View File

@ -206,7 +206,8 @@
<script>
function before() {
var sHTML = $('.summerNote').summernote('code');
$("#content").val(sHTML.replace("'", "\""));
sHTML= sHTML.replace(new RegExp("'","gm"), "\"");
$("#content").val(sHTML);
var userIdsArr = [];
var datas = roleGrid.dataGrid('getRowData');

View File

@ -54,7 +54,8 @@
<script>
function before() {
var sHTML = $('.summerNote').summernote('code');
$("#content").val(sHTML.replace("'", "\""));
sHTML= sHTML.replace(new RegExp("'","gm"), "\"");
$("#content").val(sHTML);
return true;
}

View File

@ -54,7 +54,8 @@
<script>
function before() {
var sHTML = $('.summerNote').summernote('code');
$("#content").val(sHTML.replace("'", "\""));
sHTML= sHTML.replace(new RegExp("'","gm"), "\"");
$("#content").val(sHTML);
return true;
}

View File

@ -41,7 +41,7 @@
{header: '标题', name: 'title', index: 'title', width: 350, align: "center"},
{header: '添加时间', name: 'createdAt', index: 'createdAt', width: 200, align: "center",formatter: "date",
formatoptions: {srcformat: 'Y-m-d', newformat: 'Y-m-d'}},
{header: '添加人', name: 'createdName', index: 'createdName', width: 250, align: "center"},
{header: '添加人', name: 'createdName', index: 'createdName', width: 250, align: "center"},
{
header: '操作',
name: 'actions',

View File

@ -92,7 +92,8 @@
function before() {
var sHTML = $('.summerNote').summernote('code');
$("#content").val(sHTML.replace("'", "\""));
sHTML= sHTML.replace(new RegExp("'","gm"), "\"");
$("#content").val(sHTML);
return true;
}

View File

@ -56,7 +56,8 @@
<script>
function before() {
var sHTML = $('.summerNote').summernote('code');
$("#content").val(sHTML.replace("'", "\""));
sHTML= sHTML.replace(new RegExp("'","gm"), "\"");
$("#content").val(sHTML);
return true;
}

View File

@ -0,0 +1,206 @@
<% layout('/layouts/default.html', {title: '上报信息', libs: ['dataGrid','validate','date','summernote','fileupload']}){ %>
<div class="main-content">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-book-open"></i> ${report.isNewRecord ? '新增' : '修改'}上报信息
</div>
</div>
<act:form id="inputForm" model="${report!}" action="${ctx}/rddb/report/save" remote="true" result="updateResult"
before="before">
<input type="hidden" name="id" value="${report.id!}">
<div class="box-body">
<div class="form-unit">基本信息</div>
<act:title title="" fields="2"/>
<act:input text="标题" name="title" required="true" col="2"/>
<act:input text="内容" name="content" as="textarea" col="2" rows="8"/>
<!--files-->
<div class="row">
<input type="hidden" name="attachmentName">
<input type="hidden" name="attachmentPath">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">
附件:
</label>
<div class="col-sm-10">
<input type="file" id="input-attachments" name="license" onchange="uploadFile()"
style="display: none" multiple/>
<div class="input-group" id="div-attachments">
<label for="fileMsg"></label><input id="fileMsg" type="text" name="fileMsg"
value="" class="form-control" readonly/>
<span class="input-group-btn" data-input="filesFile">
<a href="javascript:" class="btn btn-default" title="上传文件"><i
class="fa fa-upload"></i></a></span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">
</label>
<div class="col-sm-10">
<div class="queueList">
<div class="table-responsive">
<table class="table table-striped filetable table-hover">
<tbody id="uploadFileList" class="ui-sortable">
<% for(file in report.attachmentPathList!){ %>
<tr class="template-upload state-error">
<input type="hidden" name="attachmentPathList" value="${file}"/>
<input type="hidden" name="attachmentNameList"
value="${report.attachmentNameList[fileLP.dataIndex]}"/>
<td class="name"><i class="fa fa-file-text-o"></i>${report.attachmentNameList[fileLP.dataIndex]}
</td>
<td class="name"><i class="fa fa-file-text-o"></i> ${file}</td>
<td class="btncancel">
<a onclick="deleteFile(this);"
class="btn btn-default btn-xs yellow delete"><i
class="fa fa-ban"></i> 删除 </a>
<a href="${file}" download
class="btn btn-default btn-xs yellow delete"><i
class="fa fa-download"></i> 下载 </a>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!--files-->
<div class="form-unit">审核信息</div>
<act:title title="" fields="4"/>
<act:input text="录用状态" name="hireStatus" col="2" as="select" dictType="sys_wait_pass_refuse"/>
<act:input text="录用级别" name="hireLevel" col="2" as="select" dictType="report_hire_level"/>
<act:input text="录用媒体" name="hireCategory" col="2" as="select" dictType="report_hire_category"/>
<act:input text="录用时间" as="date" view="month" name="hireDate" col="2"/>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label class="control-label col-sm-2">
<span aria-required="true"></span>
得分:
</label>
<div class="col-sm-10">
<input type="number" max="100" min="1" id="title" name="score" value="${report.score!}" maxlength=""
class="form-control" placeholder="">
</div>
</div>
</div>
</div>
</div>
<div class="box-footer">
<div class="row">
<div class="col-sm-offset-2 col-sm-10">
<% if(hasAuth('rddb:report:save')) { %>
<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i>
保 存
</button>&nbsp;
<% } %>
<button type="button" class="btn btn-sm btn-default" id="btnCancel"
onclick="act.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> 关 闭
</button>
</div>
</div>
</div>
</act:form>
</div>
</div>
<% } %>
<script>
function uploadFile() {
const formData = new FormData();
const files = $("#input-attachments")[0].files;
if (files == null) {
act.error("请先选择文件");
return false;
}
for (let i = 0; i < files.length; i++) {
formData.append('files', files[i]);
}
$.ajax({
url: "${ctx}/sys/filemanager/upload_json",
type: 'post',
cache: false,
data: formData,
processData: false,
contentType: false,
dataType: "json",
success: function (result) {
if (result.state === 1) {
for (let i = 0; i < result.data.length; i++) {
const datum = result.data[i];
$("#uploadFileList").append("<tr id=\"\" data-path='" + datum + "' class=\"template-upload state-error\">\n" +
" <input type='hidden' name='attachmentPathList' value='" + datum + "'>" +
" <input type='hidden' name='attachmentNameList' value='" + files[i].name + "'>" +
" <td class=\"name\"><i class=\"fa fa-file-text-o\"></i> " + files[i].name + "</td>\n" +
" <td class=\"name\"><i class=\"fa fa-file-text-o\"></i> " + datum + "</td>\n" +
" <td class=\"btncancel\" ><a onclick=\"deleteFile(this);\" " +
" class=\"btn btn-default btn-xs yellow delete\">\n" +
" <i class=\"fa fa-ban\"></i> 删除 </a>" +
" <a href='" + datum + "' download class=\"btn btn-default btn-xs yellow delete\"><i class=\"fa fa-download\"></i> 下载 </a></td>\n" +
" </tr>");
}
} else {
act.error(result.msg);
}
}
});
}
$('#div-attachments').click(function () {
$('#input-attachments').click();
});
function deleteFile(current) {
act.confirm("确定删除该文件吗?", function () {
$(current).parent().parent().remove();
}, true);
}
</script>
<script>
function before() {
var paths = new Array();
var names = new Array();
var _paths = $("[name='attachmentPathList']");
var _names = $("[name='attachmentNameList']");
$.each(_paths, function (i, n) {
debugger
var path = $(n).val();
paths.push(path)
});
$.each(_names, function (i, n) {
var name = $(n).val();
names.push(name)
});
$("[name='attachmentPath']").val(paths.join(","));
$("[name='attachmentName']").val(names.join(","));
return true;
}
function updateResult(resp) {
if (resp.state === 1) {
act.closeCurrentTabPage(function (win) {
win.$('#dataGrid').dataGrid('refresh');
});
}
}
</script>

View File

@ -0,0 +1,91 @@
<% layout('/layouts/default.html', {title: '上报信息管理', libs: ['dataGrid','importExcel','date']}){ %>
<div class="main-content">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-globe"></i> 上报信息管理
</div>
<div class="box-tools pull-right">
<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
<a href="#" class="btn btn-default" id="btnRefresh" title="刷新"><i class="fa fa-refresh"></i> 刷新</a>
<% if(hasAuth("rddb:report:add")) { %>
<a href="${ctx}/rddb/report/form" class="btn btn-default btnTool" title="新增上报信息"><i class="fa fa-plus"></i> 新增</a>
<% } %>
</div>
</div>
<div class="box-body">
<act:form id="searchForm" action="${ctx}/rddb/report/list" method="post" class="form-inline hide">
<div class="form-group">
<label class="control-label">标题</label>
<div class="control-inline">
<act:text name="title" maxlength="50"/>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-sm">查询</button>
<button type="reset" class="btn btn-default btn-sm">重置</button>
</div>
</act:form>
<table id="dataGrid"></table>
<div id="dataGridPage"></div>
</div>
</div>
</div>
<% } %>
<style>
</style>
<script>
$('#dataGrid').dataGrid({
searchForm: $('#searchForm'),
rownumbers: true,
rownumWidth: 50,
showCheckbox: false,
columnModel: [
{header: '标题', name: 'title', index: 'title', width: 250, align: "center"},
{header: '上报时间', name: 'createdAt', index: 'createdAt', width: 200, align: "center"},
{
header: '审核状态',
name: 'hireStatus',
index: 'hireStatus',
width: 200,
align: "center",
formatter: function (val, obj, row, act) {
if (val == 0) return "待审批";
if (val == 1) return "已通过";
if (val == 2) return "已拒绝";
}
}, {
header: '操作',
name: 'actions',
width: 180,
sortable: false,
title: false,
formatter: function (val, obj, row, act) {
var actions = [];
<% if(hasAuth("rddb:report:edit")) { %>
actions.push('<a href="${ctx}/rddb/report/form?id=' + row.id + '" class="btnList" title="编辑"><i class="fa fa-pencil"></i></a>&nbsp;');
<% } %>
<% if(hasAuth("rddb:report:del")) { %>
actions.push('<a href="${ctx}/rddb/report/delete?id=' + row.id + '" class="btnList" title="删除" data-confirm="确认要删除该数据吗?"><i class="fa fa-trash-o"></i></a>&nbsp;');
<% } %>
return actions.join('');
}
}
]
})
</script>