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.
389 lines
12 KiB
389 lines
12 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;
|
|
}
|
|
|
|
.woo-theme-color-none {
|
|
color: #cccccc !important;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="pear-container layui-form">
|
|
|
|
<div class="layui-card" style="margin-bottom: 10px !important;">
|
|
<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: 65px;">系统名称</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="system_name" lay-affix="clear" lay-filter="clear" placeholder="请输入系统名称"
|
|
class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item layui-inline">
|
|
<button class="pear-btn pear-btn-md pear-btn-primary" 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>
|
|
</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-add-1"></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="edit"><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="share"><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="sub"><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="reset"><a
|
|
class="woo-theme-color">重置密码</a></span>
|
|
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
<span class="woo-tool-span woo-tool-text-span selectFile" id="{{d.system_id}}" title="只允许上传xls或xlsx文件"><a
|
|
class="woo-theme-color">上传文档</a></span>
|
|
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
{{# if(d.url == null){ }}
|
|
<span class="woo-tool-span woo-tool-text-span" style="cursor:default" title="未上传文档"><a
|
|
class="woo-theme-color-none">下载文档</a></span>
|
|
{{# } else { }}
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="download"><a
|
|
class="woo-theme-color">下载文档</a></span>
|
|
{{# } }}
|
|
|
|
<!--
|
|
<i class="woo-tool-text-delimiter"></i>
|
|
{{# if(d.url == null){ }}
|
|
<span class="woo-tool-span woo-tool-text-span" style="cursor:default" title="未上传文档"><a
|
|
class="woo-theme-color-none">预览文档</a></span>
|
|
{{# } else { }}
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="preview"><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="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'], function () {
|
|
var table = layui.table;
|
|
var form = layui.form;
|
|
var $ = layui.jquery;
|
|
var common = layui.common;
|
|
var upload = layui.upload;
|
|
|
|
tableRender();
|
|
|
|
form.on('submit(user-query)', function () {
|
|
tableRender();
|
|
return false;
|
|
});
|
|
|
|
form.on('input-affix(clear)', function (data) {
|
|
tableRender();
|
|
});
|
|
|
|
function tableRender() {
|
|
table.render({
|
|
elem: '#data-table',
|
|
url: '/QingLong/dataShare/listSystem',
|
|
where: {
|
|
keyword: $("#system_name").val(),
|
|
except_system_id: -1
|
|
},
|
|
height: 'full-150',
|
|
page: {
|
|
limit: 15
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
, prev: "上一页"
|
|
, next: "下一页"
|
|
},
|
|
cols: [[
|
|
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
|
|
{ title: '系统名称', field: 'system_name', align: 'center' },
|
|
{ title: '共享表数', field: 'share_table_count', align: 'center', width: "8%" },
|
|
{ title: '已订阅系统数', field: 'subscribe_system_count', align: 'center', width: "10%" },
|
|
{ title: '访问账号', field: 'user_name', align: 'center', width: "15%" },
|
|
{ title: '访问密码', field: 'pwd', align: 'center', width: "15%" },
|
|
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "30%" }
|
|
]],
|
|
skin: 'line',
|
|
toolbar: '#table-toolbar',
|
|
defaultToolbar: [],
|
|
done: function (res, curr, count) {
|
|
upload.render({
|
|
elem: '.selectFile',
|
|
url: '/QingLong/dataShare/saveUploadFile',
|
|
auto: true,
|
|
acceptMime:'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
accept: 'file',
|
|
exts: 'xls|xlsx',
|
|
before: function () {
|
|
layer.load(); //上传loading
|
|
system_id = this.id;
|
|
},
|
|
data: {
|
|
system_id: function () {
|
|
return system_id;
|
|
}
|
|
},
|
|
done: function (result) {
|
|
if (result.success) {
|
|
layer.closeAll('loading');
|
|
layer.msg("上传成功!", {
|
|
icon: 1,
|
|
time: 1300
|
|
}, function () {
|
|
table.reload('data-table');
|
|
});
|
|
} else {
|
|
alert(result.message);
|
|
layer.closeAll('loading');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
form.render();
|
|
}
|
|
|
|
table.on('tool(data-table)', function (obj) {
|
|
if (obj.event === 'sub') {
|
|
window.sub(obj);
|
|
} else if (obj.event === 'share') {
|
|
window.share(obj);
|
|
} else if (obj.event === 'upload') {
|
|
window.upload(obj);
|
|
} else if (obj.event === 'remove') {
|
|
window.remove(obj);
|
|
} else if (obj.event === 'edit') {
|
|
window.edit(obj);
|
|
} else if (obj.event === 'download') {
|
|
window.download(obj);
|
|
} else if (obj.event === 'reset') {
|
|
window.reset(obj);
|
|
} else if (obj.event === 'preview') {
|
|
window.preview(obj);
|
|
}
|
|
|
|
});
|
|
|
|
table.on('toolbar(data-table)', function (obj) {
|
|
if (obj.event === 'add') {
|
|
window.add();
|
|
} else if (obj.event === 'refresh') {
|
|
$.ajax({
|
|
type: "POST",
|
|
async: false,
|
|
url: "/QingLong/dataShare/refreshTable",
|
|
success: function (res) {
|
|
if (result.success) {
|
|
layer.msg('刷新成功!', {
|
|
icon: 1,
|
|
time: 1000
|
|
});
|
|
} else {
|
|
layer.msg(result.message, {
|
|
icon: 2,
|
|
time: 1000
|
|
});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
window.add = function () {
|
|
layer.open({
|
|
type: 2,
|
|
title: '新增',
|
|
shade: 0.1,
|
|
area: ['650px', '280px'],
|
|
content: './add.html'
|
|
});
|
|
}
|
|
|
|
window.sub = function (obj) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '订阅管理',
|
|
shade: 0.1,
|
|
area: ['650px', '400px'],
|
|
content: './subscribe.html?system_id=' + obj.data.system_id
|
|
});
|
|
}
|
|
|
|
window.share = function (obj) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '共享管理',
|
|
shade: 0.1,
|
|
area: ['650px', '400px'],
|
|
content: './share.html?system_id=' + obj.data.system_id
|
|
});
|
|
}
|
|
|
|
window.download = function (obj) {
|
|
window.location.href = '/QingLong/dataShare/downloadXlsx?system_id=' + obj.data.system_id;
|
|
}
|
|
|
|
window.reset = function (obj) {
|
|
layer.confirm('确定要重置密码吗?', {
|
|
icon: 3,
|
|
title: '提示'
|
|
}, function (index) {
|
|
$.ajax({
|
|
url: "/QingLong/dataShare/changePwd",
|
|
data: { system_id: obj.data.system_id },
|
|
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.preview = function (obj) {
|
|
window.open('/QingLong/dataShare/previewXlsx?system_id=' + obj.data.system_id, '_blank');
|
|
}
|
|
|
|
window.edit = function (obj) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '编辑',
|
|
shade: 0.1,
|
|
area: ['650px', '280px'],
|
|
content: './update.html?system_id=' + obj.data.system_id
|
|
});
|
|
}
|
|
|
|
window.remove = function (obj) {
|
|
layer.confirm('确定要删除该系统吗?', {
|
|
icon: 3,
|
|
title: '提示'
|
|
}, function (index) {
|
|
layer.close(index);
|
|
let loading = layer.load();
|
|
$.ajax({
|
|
url: "/QingLong/dataShare/delSystem",
|
|
data: { system_id: obj.data.system_id },
|
|
type: 'post',
|
|
success: function (result) {
|
|
layer.close(loading);
|
|
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.refresh = function (param) {
|
|
table.reload('data-table');
|
|
}
|
|
|
|
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> |