1 Star 0 Fork 229

疯狂的逍遥/ayq-layui-form-designer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
preview.html 2.61 KB
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout 后台大布局 - Layui</title>
<link rel="stylesheet" href="./layui/css/layui.css" />
<style>
/* 图片上传 */
.uploader-list {
margin-left: -15px;
}
.uploader-list .info {
position: relative;
margin-top: -25px;
background-color: black;
color: white;
filter: alpha(Opacity=80);
-moz-opacity: 0.5;
opacity: 0.5;
width: 100px;
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;
}
</style>
</head>
<body >
<div >
<div id="testdemo" style="margin: 20px 20px;padding: 20px 20px;border: 1px solid #009688;">
</div>
</div>
<script type="text/javascript" src="./layui/layui.js"></script>
<script type="text/javascript" src="./ayq/js/config.js?v=100"></script>
<script>
var demojs = [];
//JavaScript代码区域
layui.config(
{base: './ayq/modules/'}).use(['formPreview', 'form'], function () {
var $ = layui.jquery;
var index = layui.index;
var formPreview = layui.formPreview;
var form = layui.form;
if (window.localStorage.getItem('layui_form_json') !== undefined) {
demojs = JSON.parse(window.localStorage.getItem('layui_form_json'));
formPreview.render({
elem: '#testdemo',
data: demojs
});
}
//监听提交
form.on('submit(demo1)', function(data){
console.log(data);
var json = data.field;
var temp = JSON.stringify(json);
$.ajax({
url:"/activiti-manager/addActivitiManagera",
type:"POST",
data:temp,
contentType:"application/json",
dataType: "json",
success:function(res){
alert(res.message);
}
});
return false;
});
});
function getSubmitData(){
var data=$('#testdemo').form[0].serialize();
console.log(data);
return data;
}
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/wlz-xb/ayq-layui-form-designer.git
git@gitee.com:wlz-xb/ayq-layui-form-designer.git
wlz-xb
ayq-layui-form-designer
ayq-layui-form-designer
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385