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.
192 lines
6.3 KiB
192 lines
6.3 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;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="pear-container layui-form">
|
|
|
|
|
|
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<table id="data-table"></table>
|
|
<script type="text/html" id="AK-Templet">
|
|
<button type="button" class="layui-btn layui-btn-xs layui-btn-radius" id="{{= d.access_key }}" lay-submit
|
|
lay-filter="copyAK">
|
|
<i class="layui-icon layui-icon-share"></i> {{= d.access_key }}
|
|
</button>
|
|
</script>
|
|
|
|
<script type="text/html" id="SK-Templet">
|
|
<button type="button" class="layui-btn layui-btn-xs layui-btn-radius" id="{{= d.secret_key }}" lay-submit
|
|
lay-filter="copySK">
|
|
<i class="layui-icon layui-icon-engine"></i> {{= d.secret_key }}
|
|
</button>
|
|
</script>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/html" id="table-toolbar">
|
|
|
|
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
|
|
<i class="layui-icon layui-icon-upload"></i>
|
|
上传数据文件
|
|
</button>
|
|
|
|
|
|
<!-- <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
|
|
<i class="layui-icon layui-icon-delete"></i>
|
|
删除
|
|
</button> -->
|
|
|
|
</script>
|
|
|
|
<script type="text/html" id="table-bar">
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="remove"><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();
|
|
|
|
form.on('submit(user-query)', function () {
|
|
tableRender();
|
|
return false;
|
|
});
|
|
|
|
form.on('input-affix(clear)', function (data) {
|
|
tableRender();
|
|
});
|
|
|
|
form.on('submit(copyAK)', function (data) {
|
|
var text = data.elem.id;
|
|
var input = document.createElement('input');
|
|
input.setAttribute('value', text);
|
|
document.body.appendChild(input);
|
|
input.select();
|
|
document.execCommand('copy');
|
|
document.body.removeChild(input);
|
|
layer.msg('已复制到剪贴板!', {
|
|
icon: 1,
|
|
time: 1000
|
|
});
|
|
return false; // 阻止默认 form 跳转
|
|
});
|
|
|
|
form.on('submit(copySK)', function (data) {
|
|
var text = data.elem.id;
|
|
var input = document.createElement('input');
|
|
input.setAttribute('value', text);
|
|
document.body.appendChild(input);
|
|
input.select();
|
|
document.execCommand('copy');
|
|
document.body.removeChild(input);
|
|
layer.msg('已复制到剪贴板!', {
|
|
icon: 1,
|
|
time: 1000
|
|
});
|
|
return false; // 阻止默认 form 跳转
|
|
});
|
|
|
|
function tableRender() {
|
|
table.render({
|
|
elem: '#data-table',
|
|
url: '/dsBase/view/jrgl/xtgl/data.json',
|
|
height: 'full-60',
|
|
page: {
|
|
limit: 15
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
, prev: "上一页"
|
|
, next: "下一页"
|
|
},
|
|
cols: [[
|
|
{ title: '序号', align: 'center', width: "10%", type: 'numbers' },
|
|
{ title: '名称', field: 'name', align: 'center' },
|
|
{ title: '类型', field: 'type', align: 'center', width: "15%" },
|
|
{ title: '文件名', field: 'file', align: 'center', width: "15%" },
|
|
{ title: '备注', field: 'memo', align: 'center', width: "15%" },
|
|
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "15%" }
|
|
]],
|
|
skin: 'line',
|
|
toolbar: '#table-toolbar',
|
|
defaultToolbar: []
|
|
});
|
|
}
|
|
|
|
table.on('tool(data-table)', function (obj) {
|
|
if (obj.event === 'remove') {
|
|
layer.msg('删除成功!', {
|
|
icon: 1,
|
|
time: 1000
|
|
});
|
|
}
|
|
});
|
|
|
|
table.on('toolbar(data-table)', function (obj) {
|
|
if (obj.event === 'add') {
|
|
window.add();
|
|
}
|
|
});
|
|
|
|
window.add = function () {
|
|
layer.open({
|
|
type: 2,
|
|
title: '上传数据文件',
|
|
shade: 0.1,
|
|
area: ['550px', '220px'],
|
|
content: './upload.html'
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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> |