|
|
|
@ -16,16 +16,43 @@
|
|
|
|
|
.dh_ico {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.layui-layer-title {
|
|
|
|
|
padding: 0 80px 0 20px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
border-bottom: 1px solid #F0F0F0;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #333;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
border-radius: 2px 2px 0 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.layui-layer-setwin {
|
|
|
|
|
width: 50px;
|
|
|
|
|
height: 100%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 15px;
|
|
|
|
|
top: 17px;
|
|
|
|
|
font-size: 0;
|
|
|
|
|
line-height: initial;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body class="layui-bg-gray">
|
|
|
|
|
|
|
|
|
|
默认分割线
|
|
|
|
|
<hr>
|
|
|
|
|
<div style="background-color: #fff;display: flex;justify-content: space-between;align-items:center;margin: 0 5px">
|
|
|
|
|
<div class="layui-layer-title" style="font-weight: bolder;">创建任务</div>
|
|
|
|
|
<div style="width: 140px;"><button type="button" class="layui-btn layui-btn-sm" lay-on="save">保
|
|
|
|
|
存</button><button type="button" class="layui-btn layui-btn-primary layui-btn-sm">返 回</button></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="layui-row layui-col-space10" style="height: 100%;">
|
|
|
|
|
<div class="layui-col-md2">
|
|
|
|
|
<div class="layui-card" style="margin-top: 10px;margin-left: 10px;">
|
|
|
|
|
<div class="layui-col-md2" style="height: 100%;">
|
|
|
|
|
<div class="layui-card" style="margin-top: 10px;margin-left: 10px;height: calc(100% - 60px);">
|
|
|
|
|
<div class="layui-card-header">Sheet表</div>
|
|
|
|
|
<div class="layui-card-body">
|
|
|
|
|
<ul class="layui-menu" id="sheetListView">
|
|
|
|
|
</ul>
|
|
|
|
@ -35,8 +62,8 @@
|
|
|
|
|
<div class="layui-menu-body-title">
|
|
|
|
|
<a href="javascript:;">{{item.sheet_name}}</a>
|
|
|
|
|
|
|
|
|
|
<i class="layui-icon layui-icon-ok-circle"
|
|
|
|
|
style="font-size: 18px; color: #04B543;margin-top: -10px;" class=""></i>
|
|
|
|
|
<i id="ico{{item.sheet_index}}" class="layui-icon layui-icon-ok-circle {{ item.is_check == 0 ? 'dh_ico' : '' }}"
|
|
|
|
|
style="font-size: 18px; color: #04B543;margin-top: -10px;" ></i>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
@ -47,7 +74,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-col-md10" style="height: 100%;">
|
|
|
|
|
<div class="layui-card" style="margin-top: 10px;margin-right: 10px;height: calc(100% - 10px);">
|
|
|
|
|
<div class="layui-card" style="margin-top: 10px;margin-right: 10px;height: calc(100% - 60px);">
|
|
|
|
|
<div class="layui-inline" style="margin-top: 15px;margin-bottom: 5px;">
|
|
|
|
|
<label class="layui-form-label" style="width: auto;margin-left: 1px;">数据库表名称:</label>
|
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
@ -55,7 +82,7 @@
|
|
|
|
|
style="width: 300px;">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
|
<button class="layui-btn layui-btn-primary layui-border-green" lay-on="save">
|
|
|
|
|
<button class="layui-btn layui-btn-primary layui-border-green" lay-on="confirm">
|
|
|
|
|
<i class="layui-icon layui-icon-success"></i>
|
|
|
|
|
确认
|
|
|
|
|
</button>
|
|
|
|
@ -106,6 +133,7 @@
|
|
|
|
|
async: false,
|
|
|
|
|
url: '/QingLong/collect/getSheets?job_id=' + jobId,
|
|
|
|
|
success: function (res) {
|
|
|
|
|
|
|
|
|
|
var sheetListTpl = sheetListScript.innerHTML;
|
|
|
|
|
var sheetListView = document.getElementById('sheetListView');
|
|
|
|
|
laytpl(sheetListTpl).render(res.data, function (html) {
|
|
|
|
@ -122,7 +150,7 @@
|
|
|
|
|
id: 'setField',
|
|
|
|
|
elem: '#data-table',
|
|
|
|
|
url: '/QingLong/collect/getSheetStruct?job_id=' + jobId + '&sheet_index=' + sheetIndex,
|
|
|
|
|
height: 'full-100',
|
|
|
|
|
height: 'full-150',
|
|
|
|
|
page: false,
|
|
|
|
|
even: true,
|
|
|
|
|
css: [
|
|
|
|
@ -135,7 +163,7 @@
|
|
|
|
|
{ title: '原始名称', field: 'original_name', align: 'center', width: "20%" },
|
|
|
|
|
{ title: '字段类型', align: 'center', width: "10%", templet: '#fieldsType_select' },
|
|
|
|
|
{ title: '必填', align: 'center', width: "10%", templet: '#required_switch' },
|
|
|
|
|
{ title: '数据范围', field: 'options', align: 'center', edit: 'text' }
|
|
|
|
|
{ title: '数据范围(用,号分隔)', field: 'options', align: 'center', edit: 'text' }
|
|
|
|
|
|
|
|
|
|
]],
|
|
|
|
|
// skin: 'line',
|
|
|
|
@ -165,14 +193,13 @@
|
|
|
|
|
} else {
|
|
|
|
|
data.allow_blank = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
util.on({
|
|
|
|
|
save: function () {
|
|
|
|
|
confirm: function () {
|
|
|
|
|
var data = table.getData('setField');
|
|
|
|
|
// if (errArr.length > 0) {
|
|
|
|
|
// layer.msg("有问题的数据,请检查!");
|
|
|
|
@ -192,11 +219,33 @@
|
|
|
|
|
"job_id": jobId,
|
|
|
|
|
"sheet_index": initSheetIndex
|
|
|
|
|
},
|
|
|
|
|
success: function (result) {
|
|
|
|
|
layer.msg('成功!', {
|
|
|
|
|
icon: 1,
|
|
|
|
|
time: 1500,
|
|
|
|
|
});
|
|
|
|
|
unconfirmedCount--;
|
|
|
|
|
|
|
|
|
|
$('#ico' + initSheetIndex).removeClass('dh_ico');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
save: function () {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/QingLong/collect/saveJob",
|
|
|
|
|
data: {
|
|
|
|
|
"job_id": jobId,
|
|
|
|
|
"job_name": "测试任务"
|
|
|
|
|
},
|
|
|
|
|
success: function (result) {
|
|
|
|
|
console.log(result);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//监听单元格编辑
|
|
|
|
@ -204,7 +253,7 @@
|
|
|
|
|
var field = obj.field;
|
|
|
|
|
|
|
|
|
|
var regex = /^[a-z][a-z0-9]{0,31}$/;
|
|
|
|
|
var cellElem = obj.tr.find('td[data-field="username"]');
|
|
|
|
|
var cellElem = obj.tr.find('td[data-field="column_name"]');
|
|
|
|
|
if (regex.test(obj.value)) {
|
|
|
|
|
var _index = errArr.indexOf(obj.index);
|
|
|
|
|
errArr.splice(_index, 1);
|
|
|
|
|