parent
9a0d180fb1
commit
30a8c8a712
@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
||||
<style>
|
||||
.content {
|
||||
width: 300px;
|
||||
height: 140px;
|
||||
/* border: 1px solid red; */
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
left: 50%;
|
||||
border-radius: 12px;
|
||||
transform: translate(-50%, -50%);
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
-moz-transform: translate(-50%, -50%);
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
td {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
span {
|
||||
cursor: pointer;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
td img {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="pear-container layui-form">
|
||||
|
||||
|
||||
<div class="content">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col width="350">
|
||||
<col width="100">
|
||||
<col width="350">
|
||||
</colgroup>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="./imgs/form.png" alt="" style="width: 60%;height: 60%;" lay-on="form"></td>
|
||||
<td></td>
|
||||
<td><img src="./imgs/excel.png" alt="" style="width: 55%;height: 55%;" lay-on="excel"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span lay-on="form">表单</span></td>
|
||||
<td></td>
|
||||
<td><span lay-on="excel">EXCEL模板</span></td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../../component/layui/layui.js"></script>
|
||||
<script src="../../../component/pear/pear.js"></script>
|
||||
|
||||
<script>
|
||||
layui.use(function () {
|
||||
var $ = layui.jquery;
|
||||
var util = layui.util;
|
||||
|
||||
|
||||
util.on({
|
||||
form: function () {
|
||||
alert('表单');
|
||||
},
|
||||
excel: function () {
|
||||
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
||||
parent.openExcelCreatePage();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 3.6 KiB |
@ -0,0 +1,349 @@
|
||||
<!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" 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: auto;">任务名称:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="task_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>
|
||||
<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-share"></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-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="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="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', 'dtree', '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: '/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: [[
|
||||
{ type: 'checkbox', width: "5%" },
|
||||
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
|
||||
{ title: '系统名称', field: 'system_name', align: 'center' },
|
||||
{ title: '前缀标识', field: 'prefix', align: 'center', width: "10%" },
|
||||
{ title: '已订阅表个数', field: 'table_cnt', align: 'center', width: "10%" },
|
||||
{ title: 'AK', field: 'access_key', align: 'center', width: "20%", templet: '#AK-Templet' },
|
||||
{ title: 'SK', field: 'secret_key', align: 'center', width: "20%", templet: '#SK-Templet' },
|
||||
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "15%" }
|
||||
]],
|
||||
skin: 'line',
|
||||
toolbar: '#table-toolbar',
|
||||
defaultToolbar: []
|
||||
});
|
||||
}
|
||||
|
||||
table.on('tool(data-table)', function (obj) {
|
||||
if (obj.event === 'sub') {
|
||||
window.sub(obj);
|
||||
} else if (obj.event === 'remove') {
|
||||
window.remove(obj);
|
||||
} else if (obj.event === 'edit') {
|
||||
window.edit(obj);
|
||||
}
|
||||
});
|
||||
|
||||
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: ['450px', '250px'],
|
||||
content: './format_select.html'
|
||||
});
|
||||
}
|
||||
|
||||
window.sub = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<span style="color: #16BAAA;font-size: 16px">正在为 “' + obj.data.system_name + '” 设置订阅数据关系</span>',
|
||||
shadeClose: true,
|
||||
shade: false,
|
||||
maxmin: false,
|
||||
move: false,
|
||||
area: ['100%', '100%'],
|
||||
content: "./already_sub_system.html?system_id=" + obj.data.system_id
|
||||
});
|
||||
}
|
||||
|
||||
window.edit = function (obj) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '编辑',
|
||||
shade: 0.1,
|
||||
area: ['650px', '320px'],
|
||||
content: './update.html?system_id=' + obj.data.system_id
|
||||
});
|
||||
}
|
||||
|
||||
window.refresh = function () {
|
||||
|
||||
}
|
||||
|
||||
|
||||
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.batchRemove = function (obj) {
|
||||
var personIds = common.checkField(obj, 'person_id');
|
||||
if (personIds === "") {
|
||||
layer.msg("请选择要删除的学生!", {
|
||||
icon: 2,
|
||||
time: 1500
|
||||
});
|
||||
return false;
|
||||
}
|
||||
layer.confirm('确定要删除选择的学生吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function (index) {
|
||||
layer.close(index);
|
||||
let loading = layer.load();
|
||||
$.ajax({
|
||||
url: "/QingLong/student/deleteStudent",
|
||||
data: { person_ids: personIds },
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
window.openExcelCreatePage = function () {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '创建任务',
|
||||
shadeClose: true,
|
||||
shade: false,
|
||||
maxmin: false,
|
||||
move: false,
|
||||
area: ['100%', '100%'],
|
||||
content: "./upload_excel.html"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
||||
|
||||
<style>
|
||||
td {
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="pear-container layui-form">
|
||||
|
||||
|
||||
<blockquote class="layui-elem-quote" style="background-color: #fff;">
|
||||
● 支持上传 2MB 以内的xls、xlsx格式文件。<br>
|
||||
● 文件中数据不能超过100行、50列。<br>
|
||||
● 为快速识别表格字段,请将表头设置背景色,如下所示:<br>
|
||||
<div style="margin: 20px 0 0 10px">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col>
|
||||
<col width="50">
|
||||
<col>
|
||||
<col width="50">
|
||||
<col>
|
||||
<col width="50">
|
||||
<col>
|
||||
</colgroup>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><img src="./imgs/1.jpg"></td>
|
||||
<td></td>
|
||||
<td><img src="./imgs/2.jpg"></td>
|
||||
<td></td>
|
||||
<td><img src="./imgs/3.jpg"></td>
|
||||
<td></td>
|
||||
<td><img src="./imgs/4.jpg"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="height: 30px;">示例一</td>
|
||||
<td></td>
|
||||
<td>示例二</td>
|
||||
<td></td>
|
||||
<td>示例三</td>
|
||||
<td></td>
|
||||
<td>示例四</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<div class="layui-upload-drag" style="display: block;height: 150px;" id="upload-excel">
|
||||
<i class="layui-icon layui-icon-upload"></i>
|
||||
<div>点击上传,或将文件拖拽到此处</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="../../../component/layui/layui.js"></script>
|
||||
<script src="../../../component/pear/pear.js"></script>
|
||||
|
||||
<script>
|
||||
layui.use(function () {
|
||||
var $ = layui.jquery;
|
||||
var upload = layui.upload;
|
||||
|
||||
|
||||
upload.render({
|
||||
elem: '#upload-excel',
|
||||
url: '', // 实际使用时改成您自己的上传接口即可。
|
||||
exts: 'xlsx',
|
||||
done: function (res) {
|
||||
layer.msg('上传成功');
|
||||
$('#ID-upload-demo-preview').removeClass('layui-hide')
|
||||
.find('img').attr('src', res.files.file);
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in new issue