<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<title>pdf文件管理</title>
|
<link href="../../css/commons.css" rel="stylesheet" type="text/css">
|
<link href="../../css/controls.css" rel="stylesheet" />
|
<link href="../../css/grid.css" rel="stylesheet" type="text/css">
|
<script src="../../js/jquery-3.2.1.min.js"></script>
|
<script src="../../js/foundation-2.0.js"></script>
|
<script src="../../js/grid.js"></script>
|
|
<script type="text/javascript" >
|
var user, grid, filter, param = "";
|
|
//1.查询条件
|
function clearFilter(){
|
filter.clear();
|
}
|
|
function query(){
|
param = filter.toFilter();
|
|
var url = "root/data/material/getSetByPage?pageno=1&pagesize=20&orderby=updatetime desc";
|
grid.setURL(url);
|
}
|
|
function isActive(element, value) {
|
if ("F" == value) {
|
value = "已删除";
|
}
|
else if ("T" == value) {
|
value = "正常";
|
}
|
element.html(value);
|
}
|
|
function changeStatus(field) {
|
var line = grid.getSelected() ? grid.getSelected().record : null;
|
|
if (!line) {
|
Dialog.alert("请选择一条记录");
|
return;
|
}
|
if (!line.id){
|
Dialog.alert("未有相关记录");
|
return;
|
}
|
|
var params = "table=material&filter=id='" + line.id + "'";
|
|
if(line[field] == "T") {
|
params += "&active=F"
|
}
|
else if(line[field] == "F") {
|
params += "&active=T"
|
}
|
|
params += "&field=" + field;
|
Server.call("root/data/procedure/updatetableactive/changecount", params, function(result){
|
if(result.success) {
|
if(result.integer == 1) {
|
window.top.location.href = "manager_index.html?num=4&" + new Date().getTime();
|
}
|
}
|
});
|
}
|
|
function uploadPDF() {
|
var url = "root/page/manager/uploadpdf.html?" + new Date().getTime();
|
|
Win.popup({
|
url: url,
|
width: 550,
|
height: 300,
|
callback: uploadrecord
|
});
|
}
|
|
function uploadrecord(success) {
|
if(success) {
|
window.top.location.href = "manager_index.html?num=4&" + new Date().getTime();
|
}
|
}
|
|
//4.
|
$(document).ready(function() {
|
user = window.top.user;
|
|
grid = new $.fm.Grid({
|
element: "sheet",
|
showPage:true,
|
limit: 18,
|
columns: [
|
{field: "title", caption: "显示标题", width: 200, },
|
{field: "type", caption: "类型", width: 220},
|
{field: "updatetime", caption: "最后修改时间", width: 250},
|
{field: "active", caption: "是否激活", width: 150, render: isActive}
|
]
|
});
|
|
filter = new Filter({
|
element: "query"
|
});
|
|
query();
|
});
|
</script>
|
</head>
|
|
<body style="overflow: hidden;">
|
<div id="sheet" style="margin: 0px 15px"></div>
|
|
<div style="height: 30px; line-height: 30px; margin-top: 15px;" align="center">
|
<div id="process" class="btn btn-green" onclick="changeStatus('active')">冻结/激活</div>
|
<div id="btn_upload" class="btn btn-green" onclick="uploadPDF()">添加PDF</div>
|
</div>
|
</body>
|
</html>
|