1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- layui.use(['form','layer','laydate','table','laytpl','layedit','upload'],function(){
- var form = layui.form,
- // layer = parent.layer === undefined ? layui.layer : top.layer,
- layer = layui.layer,
- $ = layui.jquery,
- laydate = layui.laydate,
- laytpl = layui.laytpl,
- table = layui.table,
- layedit = layui.layedit
- ,upload = layui.upload;
- var ue = UE.getEditor('editor'); //编辑器
- var ue = UE.getEditor('editor1'); //编辑器
- var ue = UE.getEditor('editor2'); //编辑器
- var ue = UE.getEditor('editor3'); //编辑器
- form.on('submit(tijiao)',function (data) {
- var index = layer.msg('数据提交中,请稍候',{icon: 16,time:true,shade:0.8}); //数据提交提示
- var formData = new FormData($('#house_form')[0]);
- $.ajax({
- // cache : true,
- type : "post",
- url : "/othersiteset/addform",
- data : formData, // 你的formid
- // async : false, //async 默认为true异步,修改为false为同步
- contentType: false, //jax 中 contentType 设置为 false 是为了避免 JQuery 对其操作,从而失去分界符,而使服务器不能正常解析文件
- processData: false, //当设置为true的时候,jquery ajax 提交的时候不会序列化 data,而是直接使用data
- error : function(request) {
- layer.close(index); //关闭数据提交信息
- layer.alert("网络超时");
- },
- success : function(data) {
- if (data.code == 200) {
- layer.msg(data.msg);
- parent.layui.table.reload('tablerReload');
- TableClose();
- } else if(data.code == 300){
- layer.msg(data.msg);
- layer.msg(ReturnInfo(data.data),{icon:5});
- }
- }
- });
- return false;
- })
- })
- $(function(){
- //选项卡切换
- $('.layui-tab-title .site-demo-active').on('click', function(){
- $(this).addClass('layui-this').siblings().removeClass('layui-this');
- var lay_id = $(this).attr('lay-id');
- $('.layui-tab-item').removeClass('layui-show')
- $('.layui-tab-content #'+lay_id).addClass('layui-show')
- });
- })
|