parent
f041f40a38
commit
09f6720cff
@ -0,0 +1,204 @@
|
||||
<!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: 85px;">数据库名称:</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>
|
||||
{{# } }}
|
||||
</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: "2",
|
||||
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: './database_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/ResDownload?id=" + obj.data.id;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
form.on('submit(user-query)', function () {
|
||||
|
||||
tableRender();
|
||||
|
||||
// 阻止表单的默认提交行为
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
form.on('input-affix(clear)', function (data) {
|
||||
tableRender();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link href="../js/layui/css/layui.css" rel="stylesheet">
|
||||
<style>
|
||||
.require-star {
|
||||
position: absolute;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
background-color: #ea4335;
|
||||
top: 12px;
|
||||
right: 8px;
|
||||
border-radius: 1.5px;
|
||||
}
|
||||
|
||||
.input-width {
|
||||
max-width: 455px
|
||||
}
|
||||
|
||||
.mainBox {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
bottom: 50px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background-color: #F8F8F8;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form class="layui-form" action="">
|
||||
<div class="mainBox">
|
||||
<div class="main-container">
|
||||
<!-- <div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: auto;"><span class="require-star"></span>文件名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="fileName" lay-verify="required" autocomplete="off" placeholder="请输入文件名称"
|
||||
class="layui-input input-width">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" style="width: auto;"><span class="require-star"></span>数据库上传</label>
|
||||
<div class="layui-input-block">
|
||||
<button type="button" class="layui-btn layui-btn-normal"
|
||||
id="ID-upload-demo-choose">选择数据库</button>
|
||||
</div>
|
||||
<!-- <button type="button" class="layui-btn" id="ID-upload-demo-action">开始上传</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div class="button-container">
|
||||
<button type="button" class="layui-btn layui-btn-sm" id="ID-upload-demo-action">
|
||||
<i class="layui-icon layui-icon-upload-drag"></i>
|
||||
上传
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script src="../js/layui/layui.js"></script>
|
||||
|
||||
<script>
|
||||
layui.use(function () {
|
||||
var form = layui.form;
|
||||
var $ = layui.jquery;
|
||||
var laytpl = layui.laytpl;
|
||||
var upload = layui.upload;
|
||||
|
||||
upload.render({
|
||||
elem: '#ID-upload-demo-choose',
|
||||
url: '/dsBase/res/uploadZskDocument',
|
||||
data: {
|
||||
type_id: "2",
|
||||
},
|
||||
accept: "file",
|
||||
exts: "xls|xlsx",
|
||||
auto: false,
|
||||
bindAction: '#ID-upload-demo-action',
|
||||
done: function (res) {
|
||||
layer.msg("上传成功!", {
|
||||
icon: 1,
|
||||
time: 1300
|
||||
}, function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
parent.layui.table.reload("data-table");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue