提交 ffb0e503 编写于 作者: doc_wei's avatar doc_wei

update: 科目管理托管到表单布局

上级 923f2411
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'textool'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool;
// 获取当前登陆用户所属的学校列表
schoolUtil.queryMyBelongSchoolList(function (json) {
$("#schoolId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), json));
form.render("select");
});
textool.init({eleId: 'desc', maxlength: 500});
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
subjectName: $("#subjectName").val(),
subjectNo: $("#subjectNo").val(),
desc: $("#desc").val(),
schoolId: $("#schoolId").val()
};
AjaxPostUtil.request({url:schoolBasePath + "schoolsubjectmation002", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'textool'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
textool = layui.textool;
showGrid({
id: "showForm",
url: schoolBasePath + "schoolsubjectmation003",
params: {rowId:parent.rowId},
pagination: false,
template: getFileContent('tpl/schoolsubjectmation/schoolsubjectmationeditTemplate.tpl'),
ajaxSendAfter:function (json) {
textool.init({eleId: 'desc', maxlength: 500});
// 获取当前登陆用户所属的学校列表
schoolUtil.queryMyBelongSchoolList(function (data) {
$("#schoolId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), data));
$("#schoolId").val(json.bean.schoolId);
form.render("select");
});
matchingLanguage();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
rowId: parent.rowId,
subjectName: $("#subjectName").val(),
subjectNo: $("#subjectNo").val(),
desc: $("#desc").val(),
schoolId: $("#schoolId").val()
};
AjaxPostUtil.request({url:schoolBasePath + "schoolsubjectmation004", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
}
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
authBtn('1586094186431');
// 获取当前登陆用户所属的学校列表
schoolUtil.queryMyBelongSchoolList(function (json) {
$("#schoolId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), json));
form.render("select");
initTable();
});
function initTable(){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: schoolBasePath + 'schoolsubjectmation001',
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'subjectName', title: '科目', align: 'left', width: 160 },
{ field: 'subjectNo', title: '编号', align: 'left', width: 140 },
{ field: 'desc', title: '简介', align: 'left', width: 80, templet: function (d) {
return '<i class="fa fa-fw fa-html5 cursor" lay-event="descSel"></i>';
}},
{ field: 'schoolName', title: '所属学校', align: 'left', width: 150 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'}
]],
done: function(json) {
matchingLanguage();
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
} else if (layEvent === 'delet') { //删除
delet(data);
} else if (layEvent === 'descSel') { //descSel内容
layer.open({
id: 'descSel',
type: 1,
title: '简介',
shade: 0.3,
area: ['90vw', '90vh'],
content: data.desc
});
}
});
}
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/schoolsubjectmation/schoolsubjectmationadd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "schoolsubjectmationadd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
// 删除
function delet(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url:schoolBasePath + "schoolsubjectmation005", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
// 编辑
function edit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/schoolsubjectmation/schoolsubjectmationedit.html",
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "schoolsubjectmationedit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}
});
}
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
}
return false;
});
// 刷新数据
$("body").on("click", "#reloadTable", function() {
loadTable();
});
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams() {
return {
subjectName: $("#subjectName").val(),
subjectNo: $("#subjectNo").val(),
schoolId: $("#schoolId").val()
};
}
exports('schoolsubjectmationlist', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">所属学校<i class="red">*</i></label>
<div class="layui-input-block">
<select id="schoolId" lay-filter="schoolId" lay-search="" win-verify="required">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">科目<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="subjectName" name="subjectName" win-verify="required" placeholder="请输入科目" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">编号</label>
<div class="layui-input-block">
<input type="text" id="subjectNo" name="subjectNo" placeholder="请输入科目编号" class="layui-input" maxlength="50"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">简介</label>
<div class="layui-input-block">
<textarea id="desc" name="desc" class="layui-textarea" style="height: 100px;"></textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/schoolsubjectmation/'}).use('schoolsubjectmationadd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/schoolsubjectmation/'}).use('schoolsubjectmationedit');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">所属学校<i class="red">*</i></label>
<div class="layui-input-block">
<select id="schoolId" lay-filter="schoolId" lay-search="" win-verify="required">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">科目<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="subjectName" name="subjectName" win-verify="required" placeholder="请输入科目" class="layui-input" value="{{subjectName}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">编号</label>
<div class="layui-input-block">
<input type="text" id="subjectNo" name="subjectNo" placeholder="请输入科目编号" class="layui-input" maxlength="50" value="{{subjectNo}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">简介</label>
<div class="layui-input-block">
<textarea id="desc" name="desc" class="layui-textarea" style="height: 100px;">{{desc}}</textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">学校</label>
<div class="layui-input-inline">
<select lay-filter="schoolId" lay-search="" id="schoolId">
</select>
</div>
<label class="layui-form-label">科目</label>
<div class="layui-input-inline">
<input type="text" id="subjectName" name="subjectName" placeholder="请输入科目" class="layui-input" />
</div>
<label class="layui-form-label">编号</label>
<div class="layui-input-inline">
<input type="text" id="subjectNo" name="subjectNo" placeholder="请输入编号" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn" auth="1586094186431"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(auth('1586094193958')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1586094202242')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delet"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/schoolsubjectmation/'}).use('schoolsubjectmationlist');
</script>
</body>
</html>
\ No newline at end of file
......@@ -60,6 +60,7 @@ var dataTypeList = [
{id: 30, name: "附件"},
{id: 31, name: "行政-会议室"},
{id: 32, name: "行政-车辆"},
{id: 33, name: "学校-科目"},
];
//系统cookies从哪里获取, true:从用户登陆获取;false:跨域获取
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册