黄海 2 years ago
commit 7646c9a4db

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -258,9 +258,9 @@
opacity : 0.5;
width : 100px;
text-align : right;
height : 18px;
margin-bottom : -18px;
display : none;
/* height : 18px; */
margin-bottom : -25px;
/* display : none; */
}
.uploader-list .handle i {
@ -752,28 +752,4 @@ body .cool-black .layui-layer-btn a {
height: 25px;
text-align: center;
display: none;
}
.uploader-list .handle {
position: relative;
background-color: black;
color: white;
filter: alpha(Opacity=80);
-moz-opacity: 0.5;
opacity: 0.5;
width: 100px;
text-align: right;
height: 18px;
margin-bottom: -18px;
display: none;
}
.uploader-list .handle i {
margin-right: 5px;
}
.uploader-list .handle i:hover {
cursor: pointer;
}
.uploader-list .file-iteme {
margin: 12px 0 0 15px;
padding: 1px;
float: left;
}

@ -2084,7 +2084,7 @@ layui.config({ base: './ayq/modules/' }).define(["layer", 'flow', "laytpl", "ele
_html += '<colgroup><col><col width="100"><col width="150"><col width="100"></colgroup>';
_html += '<thead><tr><th>文件名</th><th>大小</th><th>上传进度</th><th>操作</th></tr></thead>';
_html += '<tbody id="list-{0}"></tbody></table></div>'.format(json.id);
_html += '<button type="button" class="layui-btn" id="listAction-{0}">开始上传</button>'.format(json.id);
// _html += '<button type="button" class="layui-btn" id="listAction-{0}">开始上传</button>'.format(json.id);
_html += '</div>';
_html += '</blockquote>';
_html += '</div>';
@ -2152,7 +2152,7 @@ layui.config({ base: './ayq/modules/' }).define(["layer", 'flow', "laytpl", "ele
_html += '<colgroup><col><col width="150"><col width="260"><col width="150"></colgroup>';
_html += '<thead><tr><th>文件名</th><th>大小</th><th>上传进度</th><th>操作</th></tr></thead>';
_html += '<tbody id="list-{0}"></tbody></table></div>'.format(json.id);
_html += '<button type="button" class="layui-btn" id="listAction-{0}">开始上传</button>'.format(json.id);
// _html += '<button type="button" class="layui-btn" id="listAction-{0}">开始上传</button>'.format(json.id);
_html += '</div>';
_html += '</blockquote>';
_html += '</div>';

@ -107,7 +107,7 @@
upload.render({
elem: '#' + images[i].select
, url: '/QingLong/collect/uploadFile'
, data: { job_id: jobId, input_id: images[i].select.substring(5) }
, data: { job_id: jobId, input_id: images[i].select.substring(5), type_id: 2 }
, multiple: true
, before: function (obj) {
layer.msg('图片上传中...', {
@ -117,12 +117,13 @@
})
}
, done: function (res) {
layer.close(layer.msg());//关闭上传提示窗口
layer.close(layer.msg());//关闭上传提示窗口
console.log(res);
//上传完毕
$('#uploader-list-' + images[i].select.substring(5)).append(
'<div id="" class="file-iteme">' +
'<div class="handle"><i class="layui-icon layui-icon-delete"></i></div>' +
$('#uploader-list-' + res.input_id).append(
'<div id="' + res.file_id + '" class="file-iteme">' +
'<div class="handle"><i class="layui-icon layui-icon-delete" onclick=delimgs("' + res.file_id + '")></i></div>' +
'<img style="width: 100px;height: 100px;" src=/QingLong' + res.url + '>' +
'</div>'
);
@ -132,16 +133,17 @@
var filesData = render.getFiles();
filesData = unique(filesData);
var file_input_id = filesData[0].select.substring(4);
for (var i = 0; i < filesData.length; i++) {
upload.render({
elem: '#' + filesData[i].select
, elemList: $('#list-' + filesData[i].select.substring(4)) //列表元素对象
, url: '/QingLong/collect/uploadFile'
, data: { job_id: jobId, input_id: filesData[i].select.substring(4) }
, data: { job_id: jobId, input_id: filesData[i].select.substring(4), type_id: 1 }
, accept: 'file'
, multiple: true
, number: 3
, auto: false
, auto: true
, bindAction: '#listAction-' + filesData[i].select.substring(4)
, choose: function (obj) {
var that = this;
@ -162,17 +164,16 @@
tr.find('.demo-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
// uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
that.elemList.append(tr);
element.render('progress'); //渲染新加的进度条组件
});
}
, done: function (res, index, upload) { //成功的回调
}, done: function (res, index, upload) { //成功的回调
console.log(res);
var that = this;
//if(res.code == 0){ //上传成功
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(3).html(''); //清空操作
@ -180,23 +181,21 @@
return;
//}
this.error(index, upload);
}
, allDone: function (obj) { //多文件上传完毕后的状态回调
console.log(obj)
}
, error: function (index, upload) { //错误回调
}, allDone: function (obj) { //多文件上传完毕后的状态回调
setTimeout(function () {
reloadFiles(file_input_id);
}, 700);
}, error: function (index, upload) { //错误回调
var that = this;
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
}
, progress: function (n, elem, e, index) {
}, progress: function (n, elem, e, index) {
element.progress('progress-demo-' + index, n + '%'); //执行进度条。n 即为返回的进度百分比
}
});
}
}, error: function (xhr, status, error) {
layer.msg("获取任务信息异常!", {
icon: 2,
@ -205,7 +204,6 @@
}
});
//获取表单数据
$.ajax({
url: "/QingLong/collect/getFormFillJob?job_id=" + jobId,
@ -217,6 +215,33 @@
}
});
window.reloadFiles = function (file_input_id) {
$.ajax({
url: "/QingLong/collect/getJobUploadList?job_id=" + jobId,
async: false,
type: 'GET',
success: function (res) {
$('#list-' + file_input_id).html('');
if (res.data.length > 0) {
for (var i = 0; i < res.data.length; i++) {
if (res.data[i].type_id == 1) {
var tr = $('#list-' + res.data[i].input_id).append(
'<tr id="upload-' + i + '">' +
'<td>' + res.data[i].fileName + '</td>' +
'<td>' + res.data[i].file_size + '</td>' +
'<td>已上传</td>' +
'<td>' +
'<button class="layui-btn layui-btn-xs layui-btn-danger" onclick=delfiles("' + res.data[i].file_id + '","' + res.data[i].input_id + '")>删除</button>' +
'</td>' +
'</tr>'
);
}
}
}
}
});
}
//获取图片和文件数据
$.ajax({
url: "/QingLong/collect/getJobUploadList?job_id=" + jobId,
@ -225,13 +250,27 @@
success: function (res) {
if (res.data.length > 0) {
for (var i = 0; i < res.data.length; i++) {
$('#uploader-list-' + res.data[i].input_id).append(
'<div id="" class="file-iteme">' +
'<div class="handle"><i class="layui-icon layui-icon-delete"></i></div>' +
'<img style="width: 100px;height: 100px;" src=/QingLong/Excel/' + res.data[i].file_id + '.' + res.data[i].suffix + '>' +
'</div>'
);
console.log(res.data[i]);
if (res.data[i].type_id == 1) {
var tr = $('#list-' + res.data[i].input_id).append(
'<tr id="upload-' + i + '">' +
'<td>' + res.data[i].fileName + '</td>' +
'<td>' + res.data[i].file_size + '</td>' +
'<td>已上传</td>' +
'<td>' +
'<button class="layui-btn layui-btn-xs layui-btn-danger" onclick=delfiles("' + res.data[i].file_id + '","' + res.data[i].input_id + '")>删除</button>' +
'</td>' +
'</tr>'
);
} else {
$('#uploader-list-' + res.data[i].input_id).append(
'<div id="' + res.data[i].file_id + '" class="file-iteme">' +
'<div class="handle"><i class="layui-icon layui-icon-delete" onclick=delimgs("' + res.data[i].file_id + '")></i></div>' +
'<img style="width: 100px;height: 100px;" src=/QingLong/Excel/' + res.data[i].file_id + '.' + res.data[i].suffix + '>' +
'</div>'
);
}
}
}
@ -269,68 +308,70 @@
return false;
});
//导入数据
$('#importJsonData').on('click', function () {
layer.open({
type: 1
, title: 'JSON模板数据导入'
, id: 'Lay_layer_importjsoncodeview'
, content: $('.importjsoncodedataview')
, area: ['800px', '640px']
, shade: false
, resize: false
, success: function (layero, index) {
}
, end: function () {
$('.importjsoncodeview').css("display", "none")
window.delimgs = function (file_id) {
$.ajax({
url: '/QingLong/collect/delUploadFile',
type: 'post',
data: {
"job_id": jobId,
"file_id": file_id
},
success: function (result) {
if (result.success) {
layer.msg("成功!", {
icon: 1,
time: 1000
}, function () {
$('#' + file_id).remove();
});
} else {
layer.msg(result.message, {
icon: 2,
time: 2000
});
}
}
});
});
}
//导入数据
$('#getFormData').on('click', function () {
var _value = render.getFormData();
$('#get-form-data').val(JSON.stringify(_value, null, 4));
layer.open({
type: 1
, title: 'JSON模板数据导入'
, id: 'Lay_layer_importjsoncodeview'
, content: $('.getFormData')
, area: ['800px', '640px']
, shade: false
, resize: false
, success: function (layero, index) {
}
, end: function () {
$('.getFormData').css("display", "none")
window.delfiles = function (file_id, file_input_id) {
event.preventDefault();
$.ajax({
url: '/QingLong/collect/delUploadFile',
type: 'post',
data: {
"job_id": jobId,
"file_id": file_id
},
success: function (result) {
if (result.success) {
layer.msg("成功!", {
icon: 1,
time: 1000
}, function () {
reloadFiles(file_input_id);
});
} else {
layer.msg(result.message, {
icon: 2,
time: 2000
});
}
}
});
});
$('#import-json-code-data').on('click', function () {
var _value = document.getElementById("import-json-code-view").value;
try {
var json = JSON.parse(_value);
console.log(json);
render.setFormData(json);
layer.closeAll();
layer.msg('导入成功');
} catch (e) {
layer.closeAll();
layer.msg('导入数据格式异常');
}
});
return false;
}
$('#globalDisable').on('click', function () {
render.globalDisable();
});
$('#globalNoDisable').on('click', function () {
render.globalNoDisable();
});
});
function getSubmitData() {
var data = $('#testdemo').form[0].serialize();
console.log(data);
@ -346,6 +387,8 @@
return null;
}
</script>
</body>

@ -124,8 +124,7 @@
offset: 'r',
anim: 'slideLeft',
area: ['750px', '100%'],
shade: 0.1,
shadeClose: true,
shade: 0.1,
content: "../form/report.html?job_id=" + obj.data.job_id
});
} else {

Loading…
Cancel
Save