<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
|
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<title>导入模板信息</title>
|
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
|
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
|
<link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
|
<link rel="stylesheet" href="static/styles/common.css" type="text/css">
|
<link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
|
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
|
<script type="text/javascript" src="static/scripts/customResize.js"></script>
|
|
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
|
|
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
|
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<style>
|
html, body {
|
height: 100%;
|
width: 100%;
|
overflow: hidden;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="pt-wrap margin-lr" style="height:100%;">
|
<div class="pt-main-top clear">
|
<div class="pt-nav">
|
<span class="pt-title-icon"><i class=" fa fa-upload"></i></span>
|
<div class="pt-title">
|
<div>
|
<h4>导入模板列表</h4>
|
</div>
|
</div>
|
</div>
|
<div class="pt-search">
|
<p class="pt-retrieval">
|
<input id="txtKeySearch" type="text" placeholder="请输入模板名称进行搜索">
|
<button id="btnKeySearch">
|
<i class="fa fa-search"></i>
|
</button>
|
</p>
|
<shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.CONFIG.IMPORT.ADD">
|
<button id="btnAdd" class="pt-btn pt-btn-primary">
|
<i class="fa fa-plus"></i>新增
|
</button>
|
</shiro:hasPermission>
|
<shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.CONFIG.IMPORT.DELETE">
|
<button id="btnDelete" class="pt-btn pt-btn-danger">
|
<i class="fa fa-trash-o"></i>删除
|
</button>
|
</shiro:hasPermission>
|
</div>
|
</div>
|
<div id="div_table">
|
|
<table id="dg_importTemplate" style="width:100%;height:100%;"></table>
|
|
</div>
|
</div>
|
</body>
|
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
|
<script>
|
//定义页面全局变量
|
var NowSelectedNodeId = 0;
|
var isStatic;
|
$(function () {
|
|
//初始化表格
|
$('#dg_importTemplate').datagrid({
|
url: 'config/importTemplate/getImportTemplatePageList?moduleId=' + "${moduleId}",
|
fitColumns: true,
|
striped: true,
|
idField: "importTemplateId",
|
rownumbers: true,
|
pagination: true,
|
checkOnSelect: false,
|
selectOnCheck: false,
|
singleSelect: true,
|
columns: [[
|
{
|
field: 'ck',
|
checkbox: true
|
},
|
{
|
field: 'scene',
|
title: '场景',
|
width: 80,
|
align: 'center',
|
formatter: function (value, row, index) {
|
if (value == '1') {
|
return "导数据";
|
} else if (value == '2') {
|
return "归档导入";
|
} else {
|
return value;
|
}
|
}
|
},
|
{
|
field: 'importTemplateName',
|
title: '导入模板名称',
|
width: 250,
|
align: 'left'
|
},
|
{
|
field: 'moduleName',
|
title: '所属模块',
|
width: 150,
|
align: 'center'
|
},
|
{
|
field: 'importType',
|
title: '遇错是否继续导入',
|
width: 150,
|
align: 'center',
|
formatter: function (value, row, index) {
|
if (value == 0) {
|
return "是";
|
} else {
|
return "否";
|
}
|
}
|
},
|
{
|
field: 'mountFile',
|
title: '挂载附件',
|
width: 100,
|
align: 'center',
|
formatter: function (value, row, index) {
|
if (value == 1) {
|
return "是";
|
} else {
|
return "否";
|
}
|
}
|
}
|
,
|
{
|
field: 'ruleName',
|
title: '规则',
|
width: 200,
|
align: 'left',
|
formatter: function (value, row, index) {
|
if (row.mountFile == 1) {
|
return value;
|
} else {
|
return "";
|
}
|
}
|
},
|
/*{
|
field : 'createTime',
|
title : '创建时间',
|
width : 100,
|
align : 'center'
|
},*/
|
{
|
field: 'importTemplateId',
|
title: '操作',
|
width: 150,
|
align: 'center',
|
formatter: function (value, row, index) {
|
var str = "";
|
<shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.CONFIG.IMPORT.SAVE">
|
str += ' <a onclick=\'editImportTemplate("' + value + '");\' class="pt-color-success"><i class="fa fa-pencil" title="编辑"></i></a>';
|
</shiro:hasPermission>
|
<shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.CONFIG.IMPORT.DELETE">
|
str += '<a onclick=\'deleteImportTemplate("' + value + '");\' class="pt-color-danger"><i class="fa fa-trash-o" title="删除"></i></a>';
|
</shiro:hasPermission>
|
<shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.CONFIG.IMPORT.SAVE">
|
str += '<a onclick=\'copyImportTemplate("' + value + '");\' class="pt-color-danger"><i class="fa fa-copy" title="复制"></i></a>';
|
</shiro:hasPermission>
|
// if(row.mountFile == 1){
|
// str += '<a onclick=\'ruleConfig("' + value + '");\' class="pt-color-warning"><i class="fa fa-bolt" title="附件存放规则设置"></i></a>';
|
// }
|
return str;
|
|
|
}
|
}
|
]]
|
});
|
|
|
// new ResizeScroll({
|
// "id" : ".pt-right-main",
|
// "fun" : function() {
|
// var wh = $(window).height();
|
// //$(".pt-form").height(wh-79-48);
|
// return (wh - 81 - 20);
|
// }
|
// });
|
|
//绑定按钮事件
|
//新增按钮事件
|
$("#btnAdd").click(function () {
|
editImportTemplate(0);
|
});
|
|
//删除按钮事件
|
$("#btnDelete").click(function () {
|
//获取dg选中的数据行
|
var checkRows = $("#dg_importTemplate").datagrid("getChecked");
|
if (checkRows.length == 0) {
|
layer.alert("请选择需要删除的导入模板!");
|
} else {
|
var ids = new Array();
|
$.each(checkRows, function (index, value) {
|
ids.push(value.importTemplateId);
|
});
|
|
deleteImportTemplates(ids);
|
}
|
});
|
|
//绑定关键字检索输入框回车事件
|
$("#btnKeySearch").click(function () {
|
SearchKey();
|
});
|
|
//关键字检索按钮事件
|
$('#txtKeySearch').bind('keypress', function (event) {
|
if (event.keyCode == "13") {
|
SearchKey();
|
}
|
});
|
|
new CustomResize({
|
"id": "div_table",
|
"fun": computeHeight
|
});
|
|
})
|
|
function computeHeight() {
|
var wh = $(window).height();
|
$("#div_table").height(wh - 86);
|
$("#dg_importTemplate").datagrid("resize");
|
}
|
|
//关键字搜索方法
|
function SearchKey() {
|
var keyValue = $("#txtKeySearch").val();
|
var moduleId = 0;
|
$('#dg_importTemplate').datagrid('load', {
|
searchText: keyValue,
|
moduleId: moduleId
|
});
|
}
|
|
//编辑,新增
|
function editImportTemplate(importTemplateId) {
|
var url = "config/importTemplate/editImportTemplate?importTemplateId=" + importTemplateId + "&moduleId=" + "${moduleId}";
|
var title = importTemplateId == 0 ? "新增导入模板" : "编辑导入模板";
|
top.layer.open({
|
title: title,
|
type: 2,
|
area: ["1300px", "590px"],
|
fixed: false,
|
content: url,
|
success: function (layero, index) {
|
var body = window.top.layer.getChildFrame('body', index);
|
var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
|
|
//将回调函数传给子页面
|
iframeWin.params.callBack = refreshData;
|
}
|
});
|
|
//window.event ? window.event.returnValue == false : e.preventDefault();
|
}
|
|
//刷新表格数据
|
function refreshData() {
|
$('#dg_importTemplate').datagrid('reload');
|
//清除已经选择的数据
|
$('#dg_importTemplate').datagrid('clearSelections');
|
$('#dg_importTemplate').datagrid('clearChecked');
|
}
|
|
//删除单个事件
|
function deleteImportTemplate(importTemplateId) {
|
deleteImportTemplates([importTemplateId]);
|
}
|
|
//删除多个事件
|
function deleteImportTemplates(importTemplateIds) {
|
layer.confirm("确定要删除选择的导入模板吗?", {
|
icon: 3,
|
title: '提示'
|
}, function (index) {
|
wcp.ui.setBusy("body", wcp.ajax({
|
url: "config/importTemplate/deleteImportTemplate",
|
data: JSON.stringify(importTemplateIds),
|
}).done(function (result) {
|
wcp.notify.success('删除成功!');
|
|
//刷新数据
|
refreshData();
|
}));
|
|
layer.close(index);
|
});
|
|
}
|
|
function copyImportTemplate(importTemplateId) {
|
layer.prompt({
|
formType: 0,
|
value: '',
|
title: '新模板名称:'
|
}, function (value, index, elem) {
|
var obj = new Object();
|
obj.importTemplateId = importTemplateId;
|
obj.importTemplateName = value;
|
wcp.ui.setBusy("body", wcp.ajax({
|
url: "config/importTemplate/copyImportTemplate",
|
data: JSON.stringify(obj),
|
}).done(function (result) {
|
wcp.notify.success('操作成功!');
|
//刷新数据
|
refreshData();
|
}));
|
layer.close(index);
|
});
|
}
|
|
//设计编码
|
function ruleConfig(id) {
|
var url = "config/importTemplate/ruleConfigListShow?importTemplateId=" + id;
|
var title = "导入规则设置";
|
top.layer.open({
|
title: title,
|
type: 2,
|
area: ["850px", "540px"],
|
fixed: false,
|
content: url,
|
success: function (layero, index) {
|
var body = window.top.layer.getChildFrame('body', index);
|
var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
|
//将回调函数传给子页面
|
iframeWin.params.callBack = refreshData;
|
}
|
});
|
}
|
</script>
|
</html>
|