202 lines
9.1 KiB
HTML
202 lines
9.1 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||
<head>
|
||
<th:block th:include="include :: header('先进部门列表')" />
|
||
</head>
|
||
<body class="gray-bg">
|
||
<div class="container-div">
|
||
<div class="row">
|
||
<div class="col-sm-12 search-collapse">
|
||
<form id="formId">
|
||
<div class="select-list">
|
||
<ul>
|
||
<li>
|
||
<label>年度:</label>
|
||
<input type="text" name="year"/>
|
||
</li>
|
||
<li>
|
||
<label>部门:</label>
|
||
<input type="text" name="dept"/>
|
||
</li>
|
||
<li>
|
||
<label>评选人:</label>
|
||
<input type="text" name="commit"/>
|
||
</li>
|
||
<li>
|
||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<div class="btn-group-sm" id="toolbar" role="group">
|
||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="base:advanceddept:add">
|
||
<i class="fa fa-plus"></i> 添加
|
||
</a>
|
||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="base:advanceddept:edit">
|
||
<i class="fa fa-edit"></i> 修改
|
||
</a>
|
||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="base:advanceddept:remove">
|
||
<i class="fa fa-remove"></i> 删除
|
||
</a>
|
||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:advanceddept:export">
|
||
<i class="fa fa-download"></i> 导出
|
||
</a>
|
||
</div>
|
||
<div class="col-sm-12 select-table table-striped">
|
||
<table id="bootstrap-table"></table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<th:block th:include="include :: footer" />
|
||
<script th:inline="javascript">
|
||
var editFlag = [[${@permission.hasPermi('base:advanceddept:edit')}]];
|
||
var removeFlag = [[${@permission.hasPermi('base:advanceddept:remove')}]];
|
||
var prefix = ctx + "base/advanceddept";
|
||
|
||
$(function() {
|
||
var options = {
|
||
url: prefix + "/list",
|
||
createUrl: prefix + "/add",
|
||
updateUrl: prefix + "/edit/{id}",
|
||
removeUrl: prefix + "/remove",
|
||
exportUrl: prefix + "/export",
|
||
modalName: "先进部门",
|
||
columns: [{
|
||
checkbox: true
|
||
},
|
||
{
|
||
field: 'id',
|
||
title: '',
|
||
visible: false
|
||
},
|
||
{
|
||
field: 'year',
|
||
title: '年度'
|
||
},
|
||
{
|
||
field: 'dept',
|
||
title: '先进部门'
|
||
},
|
||
{
|
||
field: 'score',
|
||
title: '指标综合评分'
|
||
},
|
||
{
|
||
field: 'process',
|
||
title: '指标完成进度'
|
||
},
|
||
{
|
||
field: 'sort',
|
||
title: '综合排名'
|
||
},
|
||
// {
|
||
// field: 'commit',
|
||
// title: '评选人'
|
||
// },
|
||
{
|
||
field: 'time',
|
||
title: '评选时间'
|
||
},
|
||
// {
|
||
// field: 'confirm',
|
||
// title: '审核人'
|
||
// },
|
||
{
|
||
field: 'show',
|
||
title: '是否显示'
|
||
},
|
||
// {
|
||
// field: 'events',
|
||
// title: '主要事迹附件上传'
|
||
// },
|
||
{
|
||
field: 'remark',
|
||
title: '备注'
|
||
},
|
||
{
|
||
title: '操作',
|
||
align: 'center',
|
||
formatter: function(value, row, index) {
|
||
var actions = [];
|
||
actions.push('<a data-files="'+row.events+'" data-type="1" class="viewFiles0828 btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>查看图片</a> ');
|
||
actions.push('<a data-files="'+row.events+'" data-type="2" class="viewFiles0828 btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>下载附件</a> ');
|
||
actions.push('<a data-id="'+row.id+'" class="openUpload btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>上传附件</a> ');
|
||
// actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
|
||
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||
return actions.join('');
|
||
}
|
||
}]
|
||
};
|
||
$.table.init(options);
|
||
$("#bootstrap-table").on('click','.openUpload',function () {
|
||
let _id = $(this)[0].dataset.id;
|
||
layer.open({
|
||
title:'上传附件',
|
||
area:['80%','80%'],
|
||
type:2,
|
||
content:'/base/affairs/upload',
|
||
success(res,index){
|
||
//传值
|
||
parent.a_upload_id = _id;
|
||
parent.a_upload_index = index;
|
||
parent.a_upload_type = "2";
|
||
},
|
||
end(){
|
||
$.table.search()
|
||
}
|
||
})
|
||
});
|
||
$("#bootstrap-table").on("click",".viewFiles0828",function () {
|
||
let _files = $(this)[0].dataset.files.split(',');
|
||
let _type = $(this)[0].dataset.type;
|
||
let _dataImg = [];
|
||
let _downData = [];
|
||
_files.forEach((item,index) => {
|
||
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
|
||
_dataImg.push({
|
||
"alt": "",
|
||
"pid": index, //图片id
|
||
"src": window.location.origin+item, //原图地址
|
||
"thumb": window.location.origin+item //缩略图地址
|
||
})
|
||
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
|
||
_downData.push(item);
|
||
}
|
||
})
|
||
if(_type === '1'){ //查看图片
|
||
let json = {
|
||
"title": "查看图片", //相册标题
|
||
"id": 123, //相册id
|
||
"start": 0, //初始显示的图片序号,默认0
|
||
"data": _dataImg
|
||
};
|
||
layer.photos({
|
||
photos: json,
|
||
closeBtn: 0, //右上角按钮,可通过配置1和2来展示,如果不显示,则closeBtn: 0
|
||
anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
|
||
});
|
||
}else{ //下载附件
|
||
if(_downData.length === 0){
|
||
$.modal.msgError('暂无文件!')
|
||
return false;
|
||
}
|
||
_downData.forEach(item => {
|
||
let _lastNum = item.lastIndexOf('/')+1;
|
||
let _title = item.substr(_lastNum,item.length-1);
|
||
const a = document.createElement('a');
|
||
a.style.display = 'none';
|
||
a.download = _title;
|
||
a.href = window.location.origin+item;
|
||
document.body.appendChild(a);
|
||
a.click();
|
||
document.body.removeChild(a);
|
||
})
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
</body>
|
||
</html> |