first commit
This commit is contained in:
12
web/templates/manage/base/footer.tmpl
Normal file
12
web/templates/manage/base/footer.tmpl
Normal file
@@ -0,0 +1,12 @@
|
||||
{{define "footer"}}
|
||||
<input type="hidden" id="csrf_token" value="{{.CsrfToken}}">
|
||||
<script src="/statics/component/layui/layui.js"></script>
|
||||
<script src="/statics/component/pear/pear.js"></script>
|
||||
<script src="/statics/component/pear/help.js"></script>
|
||||
<script src="/statics/js/Function/public.js"></script>
|
||||
<script src="/statics/js/upload.js"></script>
|
||||
{{block "js" .}}{{end}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{{end}}
|
||||
18
web/templates/manage/base/header.tmpl
Normal file
18
web/templates/manage/base/header.tmpl
Normal file
@@ -0,0 +1,18 @@
|
||||
{{define "header"}}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>component</title>
|
||||
<link rel="icon" type="image/x-icon" href="/statics/favicon.ico">
|
||||
<link rel="stylesheet" href="/statics/component/pear/css/pear.css" />
|
||||
<link rel="stylesheet" href="/statics/admin/css/loader.css" />
|
||||
<link rel="stylesheet" href="/statics/admin/css/admin.css" />
|
||||
<link rel="stylesheet" href="/statics/admin/css/style.css" />
|
||||
{{block "css" .}}{{end}}
|
||||
</head>
|
||||
|
||||
<body class="pear-container">
|
||||
{{end}}
|
||||
87
web/templates/manage/base/submit.tmpl
Normal file
87
web/templates/manage/base/submit.tmpl
Normal file
@@ -0,0 +1,87 @@
|
||||
{{define "submit"}}
|
||||
<script src="/statics/plugins/jquery.form/jquery.form.js"></script>
|
||||
<script>
|
||||
// 初始化
|
||||
$(function () {
|
||||
$('#EditForm').ajaxForm({
|
||||
beforeSubmit: function () {
|
||||
|
||||
// 遍历必填的文本框如果值为空就提示 并隐藏进度条
|
||||
$('#EditForm input').each(function () {
|
||||
var $this = $(this);
|
||||
|
||||
if (($this.attr('required') != undefined || $this.attr('validType') != undefined) && $this.attr('class').toString().indexOf('easy') < 0) {
|
||||
if (!$this.validatebox('isValid')) {
|
||||
alert($this.parents("td").prev("th").html() + "数据异常!");
|
||||
$.messager.progress('close');
|
||||
}
|
||||
}
|
||||
|
||||
// 必填项未填,自动定位到Tabs相应位置,提示信息必填
|
||||
var $tabs = $('#EditForm .easyui-tabs');
|
||||
if ($tabs.length > 0 && $this.attr('required') && $this.hasClass('validatebox-invalid')) {
|
||||
var selectTabsIndex = $this.parents('.panel-body').parents('.panel').index();
|
||||
|
||||
$tabs.tabs('select', selectTabsIndex);
|
||||
$.messager.progress('close');
|
||||
}
|
||||
})
|
||||
|
||||
// 提交前验证
|
||||
var isValid = $('#EditForm').form('validate');
|
||||
if (!isValid) {
|
||||
// 如果表单是无效的则隐藏进度条
|
||||
$.messager.progress('close');
|
||||
}
|
||||
|
||||
// 返回false终止表单提交
|
||||
return isValid;
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
// 提交成功后
|
||||
$.messager.progress('close');
|
||||
if (data.success) {
|
||||
$.messager.alert('提示', data.message, 'info', function () {
|
||||
window.parent.refreshGrid();
|
||||
if (data.guid != undefined) {
|
||||
window.setGuid(data.guid);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.messager.alert('错误', data.message, 'error');
|
||||
}
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
|
||||
alert(data);
|
||||
|
||||
// 提交失败
|
||||
$.messager.progress('close');
|
||||
$.messager.alert('错误', '页面提交发生错误,请联系管理员', 'error');
|
||||
},
|
||||
dataType: 'json'// 数据格式
|
||||
});
|
||||
});
|
||||
|
||||
// 保存
|
||||
function save() {
|
||||
Loading();
|
||||
$("#EditForm").submit();
|
||||
}
|
||||
|
||||
// 页面载入窗口
|
||||
function Loading() {
|
||||
$.messager.progress({
|
||||
title: '请等待',
|
||||
msg: '页面加载中...'
|
||||
});
|
||||
}
|
||||
|
||||
// 页面载入窗口关闭
|
||||
function LoadingClose() {
|
||||
$.messager.progress('close');
|
||||
}
|
||||
</script>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user