You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
206 lines
7.1 KiB
206 lines
7.1 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link href="../js/layui/css/layui.css" rel="stylesheet">
|
|
<style>
|
|
.woo-tool-text-delimiter {
|
|
width: 1px;
|
|
height: 12px;
|
|
background: #EEEEEE;
|
|
display: inline-block;
|
|
margin: 0 6px 0 4px;
|
|
}
|
|
|
|
.woo-theme-color {
|
|
color: #1e9fff !important;
|
|
}
|
|
|
|
.woo-tool-span {
|
|
margin: 0 3px;
|
|
position: relative;
|
|
top: -1px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.layui-card-body .layui-form {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.layui-form-select {
|
|
width: 300px;
|
|
}
|
|
|
|
.layui-card {
|
|
margin-bottom: 0;
|
|
border-radius: 2px;
|
|
background-color: #fff;
|
|
box-shadow: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="layui-form">
|
|
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="layui-form-item" style="margin: 10px 0 5px 0 !important;">
|
|
<div class="layui-form-item layui-inline">
|
|
<label class="layui-form-label" style="width: 70px;">文档名称:</label>
|
|
<div class="layui-input-inline" style="width: 300px;">
|
|
<input type="text" id="docName" lay-affix="clear" lay-filter="clear" placeholder="请输入文档名称"
|
|
class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<button type="button" class="layui-btn" lay-submit lay-filter="user-query">
|
|
<i class="layui-icon layui-icon-search"></i>
|
|
查询
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<table id="data-table"></table>
|
|
<script type="text/html" id="tableToolbar">
|
|
<div class="layui-btn-container">
|
|
<button class="layui-btn layui-btn-sm" lay-event="addFile"><i class="layui-icon layui-icon-upload-drag"></i>上传文件</button>
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" id="table-bar">
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="download"><a
|
|
class="woo-theme-color">下载</a></span>
|
|
{{#if (d.can_del) { }}
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="delete"><a
|
|
class="woo-theme-color">删除</a></span>
|
|
{{# } else { }}
|
|
--
|
|
{{# } }}
|
|
</script>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="../js/layui/layui.js"></script>
|
|
|
|
<script>
|
|
layui.use(function () {
|
|
var table = layui.table;
|
|
var form = layui.form;
|
|
var $ = layui.jquery;
|
|
var common = layui.common;
|
|
var laytpl = layui.laytpl;
|
|
|
|
|
|
tableRender();
|
|
function tableRender() {
|
|
table.render({
|
|
elem: '#data-table',
|
|
url: '/dsBase/res/getZskPage',
|
|
where: {
|
|
type_id: "1",
|
|
keyword: $("#docName").val()
|
|
},
|
|
height: 'full-105',
|
|
page: {
|
|
limit: 20
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
, prev: "上一页"
|
|
, next: "下一页"
|
|
},
|
|
toolbar: '#tableToolbar',
|
|
cols: [[
|
|
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
|
|
{ title: '文档名称', field: 'name', align: 'center' },
|
|
{ title: '上传时间', field: 'create_time', align: 'center' },
|
|
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "10%" }
|
|
]],
|
|
skin: 'line',
|
|
defaultToolbar: [],
|
|
parseData: function (res) {
|
|
if (res.code === 200) {
|
|
return {
|
|
"code": 0,
|
|
"msg": "",
|
|
"count": res.data.total,
|
|
"data": res.data.list
|
|
};
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
table.on('toolbar(data-table)', function (obj) {
|
|
if (obj.event === 'addFile') {
|
|
layer.open({
|
|
type: 2,
|
|
title: '上传文件',
|
|
area: ['600px', '230px'],
|
|
shade: 0.1,
|
|
content: './document_add.html'
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
table.on('tool(data-table)', function (obj) {
|
|
if (obj.event === 'delete') {
|
|
layer.confirm('确定要删除该文档吗?', {
|
|
icon: 3,
|
|
title: '提示'
|
|
}, function (index) {
|
|
layer.close(index);
|
|
$.ajax({
|
|
url: "/dsBase/res/delZskDocument",
|
|
data: { id: obj.data.id },
|
|
type: 'post',
|
|
success: function (res) {
|
|
if (res.success) {
|
|
layer.msg('删除成功!', {
|
|
icon: 1,
|
|
time: 1000
|
|
}, function () {
|
|
table.reload('data-table');
|
|
});
|
|
} else {
|
|
layer.msg(res.message, {
|
|
icon: 2,
|
|
time: 2000
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
window.location.href = "/dsBase/res/download?id=" + obj.data.id;
|
|
}
|
|
|
|
});
|
|
|
|
form.on('submit(user-query)', function () {
|
|
|
|
tableRender();
|
|
|
|
// 阻止表单的默认提交行为
|
|
return false;
|
|
});
|
|
|
|
|
|
form.on('input-affix(clear)', function (data) {
|
|
tableRender();
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |