增加密码本上传功能
This commit is contained in:
parent
5fddd90564
commit
5a95da724d
|
|
@ -26,6 +26,7 @@
|
||||||
.ui-state-focus {
|
.ui-state-focus {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.layui-btn {
|
.layui-btn {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
@ -36,6 +37,23 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.password-book-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.password-book-item span {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.password-book-item span:last-child {
|
||||||
|
cursor: pointer;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
@ -43,8 +61,14 @@
|
||||||
<div class="layui-container" style="width: 100%;height: 100%;padding: 10px">
|
<div class="layui-container" style="width: 100%;height: 100%;padding: 10px">
|
||||||
<form id="baseForm" class="layui-form" method="POST" onsubmit="return false;">
|
<form id="baseForm" class="layui-form" method="POST" onsubmit="return false;">
|
||||||
<div>人员密码本:</div>
|
<div>人员密码本:</div>
|
||||||
|
<div class="password-book-list">
|
||||||
|
<!-- <div class="password-book-item">
|
||||||
|
<span>密码1</span>
|
||||||
|
<span>删除</span>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
<button class="layui-btn" title="上传" type="button" id="upload-btn">上传</button>
|
<button class="layui-btn" title="上传" type="button" id="upload-btn">上传</button>
|
||||||
<button class="layui-btn" title="查看" type="button" onclick="viewBook(2)">查看</button>
|
<!-- <button class="layui-btn" title="查看" type="button" onclick="viewBook(2)">查看</button> -->
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -77,12 +101,18 @@
|
||||||
console.log(res, '上传成功')
|
console.log(res, '上传成功')
|
||||||
debugger
|
debugger
|
||||||
if (res.code === 0) { // 假设返回数据中有code字段,0表示成功
|
if (res.code === 0) { // 假设返回数据中有code字段,0表示成功
|
||||||
// 在"人员密码本"后面添加文件名
|
|
||||||
$("form#baseForm div:first").append(
|
|
||||||
'<span style="margin-left: 10px; color: #1761c1;">' +
|
console.log(res, 'res.message')
|
||||||
res.message +
|
|
||||||
'</span>'
|
// $('.password-book-list').append(
|
||||||
);
|
// '<div class="password-book-item">' +
|
||||||
|
// '<span>' + res.message + '</span>' +
|
||||||
|
// '<span>删除</span>' +
|
||||||
|
// '</div>'
|
||||||
|
// );
|
||||||
|
|
||||||
|
getUploadFile()
|
||||||
layer.msg('上传成功');
|
layer.msg('上传成功');
|
||||||
} else {
|
} else {
|
||||||
layer.msg(res.resMsg || '上传失败');
|
layer.msg(res.resMsg || '上传失败');
|
||||||
|
|
@ -94,6 +124,17 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 获取上传的文件
|
||||||
|
function getUploadFile() {
|
||||||
|
$.ajax({
|
||||||
|
url: ctxPath + '/upload/getFile',
|
||||||
|
type: 'GET',
|
||||||
|
success: function (res) {
|
||||||
|
console.log(res, 'res文件列表')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue