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.
202 lines
6.9 KiB
202 lines
6.9 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
|
<style>
|
|
.woo-tool-text-delimiter {
|
|
width: 1px;
|
|
height: 12px;
|
|
background: #EEEEEE;
|
|
display: inline-block;
|
|
margin: 0 6px 0 4px;
|
|
}
|
|
|
|
.woo-theme-color {
|
|
color: #2d8cf0 !important;
|
|
}
|
|
|
|
.woo-tool-span {
|
|
margin: 0 3px;
|
|
position: relative;
|
|
top: -1px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.layui-table-tool-temp {
|
|
padding-right: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="pear-container layui-form">
|
|
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<table id="data-table"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/html" id="table-toolbar">
|
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="refreshTable">
|
|
<i class="layui-icon layui-icon-refresh"></i>
|
|
刷新表
|
|
</button>
|
|
</script>
|
|
|
|
|
|
<script type="text/html" id="table-bar">
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="updateMemo"><a
|
|
class="woo-theme-color">修改表描述</a></span>
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="viewTableStructure"><a
|
|
class="woo-theme-color">查看表结构</a></span>
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<script src="../../../component/layui/layui.js"></script>
|
|
<script src="../../../component/pear/pear.js"></script>
|
|
|
|
<script>
|
|
layui.use(['table', 'form', 'jquery', 'common', 'laytpl'], 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/dataShare/listTable',
|
|
where: {
|
|
page: 1,
|
|
limit: 100,
|
|
system_id: 0
|
|
},
|
|
height: 'full-60',
|
|
cols: [[
|
|
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
|
|
{ title: '表名', field: 'table_name', align: 'center' },
|
|
{ title: '所属系统', field: 'system_name', align: 'center' },
|
|
{ title: '表描述', field: 'memo', align: 'center' },
|
|
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "20%" }
|
|
]],
|
|
skin: 'line',
|
|
toolbar: '#table-toolbar',
|
|
defaultToolbar: []
|
|
});
|
|
}
|
|
|
|
table.on('tool(data-table)', function (obj) {
|
|
if (obj.event === 'updateMemo') {
|
|
window.updateMemo(obj);
|
|
} else if (obj.event === 'viewTableStructure') {
|
|
window.viewTableStructure(obj);
|
|
}
|
|
});
|
|
|
|
table.on('toolbar(data-table)', function (obj) {
|
|
if (obj.event === 'refreshTable') {
|
|
window.refreshTable();
|
|
}
|
|
});
|
|
|
|
window.refreshTable = function () {
|
|
$.ajax({
|
|
url: "/dsBase/dataShare/refreshTable",
|
|
type: 'post',
|
|
success: function (result) {
|
|
if (result.success) {
|
|
layer.msg('刷新成功!', {
|
|
icon: 1,
|
|
time: 1000
|
|
}, function () {
|
|
table.reload('data-table');
|
|
});
|
|
} else {
|
|
layer.msg(result.message, {
|
|
icon: 2,
|
|
time: 1000
|
|
});
|
|
}
|
|
},
|
|
error: function (xhr, status, error) {
|
|
layer.close(loading);
|
|
console.log('请求出错:' + error + ',' + status);
|
|
}
|
|
});
|
|
}
|
|
|
|
window.updateMemo = function (obj) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '修改表描述',
|
|
shade: 0.1,
|
|
area: ['650px', '180px'],
|
|
content: './update_memo.html?table_name=' + obj.data.table_name
|
|
});
|
|
|
|
}
|
|
|
|
|
|
window.viewTableStructure = function (obj) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '查看表结构',
|
|
shade: 0.1,
|
|
area: ['800px', '500px'],
|
|
content: './view_table_structure.html?table_name=' + obj.data.table_name
|
|
});
|
|
}
|
|
|
|
|
|
|
|
window.refreshTable = function () {
|
|
$.ajax({
|
|
url: "/dsBase/dataShare/refreshTable",
|
|
type: 'post',
|
|
success: function (result) {
|
|
if (result.success) {
|
|
layer.msg('刷新成功!', {
|
|
icon: 1,
|
|
time: 1000
|
|
}, function () {
|
|
table.reload('data-table');
|
|
});
|
|
} else {
|
|
layer.msg(result.message, {
|
|
icon: 2,
|
|
time: 1000
|
|
});
|
|
}
|
|
},
|
|
error: function (xhr, status, error) {
|
|
layer.close(loading);
|
|
console.log('请求出错:' + error + ',' + status);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
function GetQueryString(name, istop) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
return null;
|
|
}
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |