|
|
|
@ -1,151 +1,155 @@
|
|
|
|
|
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
layui.define(['form', 'laydate', 'table'], function (exports) {
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var laydate = layui.laydate;
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var universityFacultyTable = null;
|
|
|
|
|
var view ={
|
|
|
|
|
init:function(){
|
|
|
|
|
var view = {
|
|
|
|
|
init: function () {
|
|
|
|
|
this.initTable();
|
|
|
|
|
this.initSearchForm();
|
|
|
|
|
this.initToolBar();
|
|
|
|
|
window.dataReload = function(){
|
|
|
|
|
Lib.doSearchForm($("#searchForm"),universityFacultyTable)
|
|
|
|
|
window.dataReload = function () {
|
|
|
|
|
Lib.doSearchForm($("#searchForm"), universityFacultyTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
initTable:function(){
|
|
|
|
|
var sx_ = localStorage.getItem("universityFacultyTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存
|
|
|
|
|
if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);}
|
|
|
|
|
initTable: function () {
|
|
|
|
|
var sx_ = localStorage.getItem("universityFacultyTable_field_" + Common.userInfoId); //筛选值显示、隐藏缓存
|
|
|
|
|
if ($.isEmpty(sx_)) {
|
|
|
|
|
sx_ = {};
|
|
|
|
|
} else {
|
|
|
|
|
sx_ = JSON.parse(sx_);
|
|
|
|
|
}
|
|
|
|
|
universityFacultyTable = table.render({
|
|
|
|
|
elem : '#universityFacultyTable',
|
|
|
|
|
height : Lib.getTableHeight(1),
|
|
|
|
|
elem: '#universityFacultyTable',
|
|
|
|
|
height: Lib.getTableHeight(1),
|
|
|
|
|
cellMinWidth: 100,
|
|
|
|
|
method : 'post',
|
|
|
|
|
url : Common.ctxPath + '/jlw/universityFaculty/list.json' // 数据接口
|
|
|
|
|
,page : Lib.tablePage // 开启分页
|
|
|
|
|
,toolbar: '#toolbar_universityFaculty' //自定义头部左侧工具栏
|
|
|
|
|
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏
|
|
|
|
|
,limit : 10,
|
|
|
|
|
cols : [ [ // 表头
|
|
|
|
|
{
|
|
|
|
|
type : 'checkbox',
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: Common.ctxPath + '/jlw/universityFaculty/list.json' // 数据接口
|
|
|
|
|
, page: Lib.tablePage // 开启分页
|
|
|
|
|
/*,toolbar: '#toolbar_universityFaculty' //自定义头部左侧工具栏
|
|
|
|
|
,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏*/
|
|
|
|
|
, limit: 10,
|
|
|
|
|
cols: [[ // 表头
|
|
|
|
|
/*{
|
|
|
|
|
type: 'checkbox',
|
|
|
|
|
|
|
|
|
|
},*/
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyId',
|
|
|
|
|
// title : '院系ID(学院ID)',
|
|
|
|
|
title: '院系ID',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: true,/*$.isEmpty(sx_['universityFacultyId']) ? false : sx_['universityFacultyId'],*/
|
|
|
|
|
width: 60,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'universitiesCollegesIdText',
|
|
|
|
|
title: '院校名称',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universitiesCollegesIdText']) ? false : sx_['universitiesCollegesIdText'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyName',
|
|
|
|
|
title: '院系名称',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universityFacultyName']) ? false : sx_['universityFacultyName'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyContact',
|
|
|
|
|
title: '联系人',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universityFacultyContact']) ? false : sx_['universityFacultyContact'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyContactTel',
|
|
|
|
|
title: '联系人电话',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universityFacultyContactTel']) ? false : sx_['universityFacultyContactTel'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyContactAddress',
|
|
|
|
|
title: '联系人地址',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universityFacultyContactAddress']) ? false : sx_['universityFacultyContactAddress'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyId',
|
|
|
|
|
// title : '院系ID(学院ID)',
|
|
|
|
|
title : '院系ID',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyId'])?false:sx_['universityFacultyId'],
|
|
|
|
|
|
|
|
|
|
width : 60,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyName',
|
|
|
|
|
title : '院系名称',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyName'])?false:sx_['universityFacultyName'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyContact',
|
|
|
|
|
title : '联系人',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyContact'])?false:sx_['universityFacultyContact'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyContactTel',
|
|
|
|
|
title : '联系人电话',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyContactTel'])?false:sx_['universityFacultyContactTel'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyContactAddress',
|
|
|
|
|
title : '联系人地址',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyContactAddress'])?false:sx_['universityFacultyContactAddress'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universitiesCollegesIdText',
|
|
|
|
|
title : '院校名称',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universitiesCollegesIdText'])?false:sx_['universitiesCollegesIdText'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyStatusText', //数据字典类型为 global_status
|
|
|
|
|
title : '状态',
|
|
|
|
|
// title : '状态( 1 正常 2删除)',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyStatusText'])?false:sx_['universityFacultyStatusText'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field : 'universityFacultyAddTime',
|
|
|
|
|
title : '创建时间',
|
|
|
|
|
align:"center",
|
|
|
|
|
hideField :false,
|
|
|
|
|
hide:$.isEmpty(sx_['universityFacultyAddTime'])?false:sx_['universityFacultyAddTime'],
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// field : 'userId',
|
|
|
|
|
// title : '用户ID',
|
|
|
|
|
// align:"center",
|
|
|
|
|
// hideField :false,
|
|
|
|
|
// hide:$.isEmpty(sx_['userId'])?false:sx_['userId'],
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field : 'orgId',
|
|
|
|
|
// title : '组织ID',
|
|
|
|
|
// align:"center",
|
|
|
|
|
// hideField :false,
|
|
|
|
|
// hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'],
|
|
|
|
|
// }
|
|
|
|
|
{
|
|
|
|
|
field : 'operation_',title : '操作',align:"center", templet: function (d) {
|
|
|
|
|
var htm = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button>';
|
|
|
|
|
htm += '<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>';
|
|
|
|
|
return htm;
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyStatusText', //数据字典类型为 global_status
|
|
|
|
|
title: '状态',
|
|
|
|
|
// title : '状态( 1 正常 2删除)',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universityFacultyStatusText']) ? false : sx_['universityFacultyStatusText'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'universityFacultyAddTime',
|
|
|
|
|
title: '创建时间',
|
|
|
|
|
align: "center",
|
|
|
|
|
hideField: false,
|
|
|
|
|
hide: $.isEmpty(sx_['universityFacultyAddTime']) ? false : sx_['universityFacultyAddTime'],
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// field : 'userId',
|
|
|
|
|
// title : '用户ID',
|
|
|
|
|
// align:"center",
|
|
|
|
|
// hideField :false,
|
|
|
|
|
// hide:$.isEmpty(sx_['userId'])?false:sx_['userId'],
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// field : 'orgId',
|
|
|
|
|
// title : '组织ID',
|
|
|
|
|
// align:"center",
|
|
|
|
|
// hideField :false,
|
|
|
|
|
// hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'],
|
|
|
|
|
// }
|
|
|
|
|
{
|
|
|
|
|
field: 'operation_', title: '操作', align: "center", templet: function (d) {
|
|
|
|
|
var htm = '<a class="layui-table-link" lay-event="edit">编辑</a>';
|
|
|
|
|
htm += '<a class="layui-table-link" lay-event="del">删除</a>';
|
|
|
|
|
return htm;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
] ]
|
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
table.on('checkbox(universityFacultyTable)', function(obj){
|
|
|
|
|
table.on('checkbox(universityFacultyTable)', function (obj) {
|
|
|
|
|
var universityFaculty = obj.data;
|
|
|
|
|
if(obj.checked){
|
|
|
|
|
if (obj.checked) {
|
|
|
|
|
//按钮逻辑Lib.buttonEnable()
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initSearchForm:function(){
|
|
|
|
|
Lib.initSearchForm( $("#searchForm"),universityFacultyTable,form);
|
|
|
|
|
initSearchForm: function () {
|
|
|
|
|
Lib.initSearchForm($("#searchForm"), universityFacultyTable, form);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initToolBar:function(){
|
|
|
|
|
initToolBar: function () {
|
|
|
|
|
toolbar = {
|
|
|
|
|
add: function () {
|
|
|
|
|
var url = "/jlw/universityFaculty/add.do";
|
|
|
|
|
Common.openDlg(url,"院系管理管理>新增");
|
|
|
|
|
Common.openDlg(url, "院系管理管理>新增");
|
|
|
|
|
},
|
|
|
|
|
edit: function () {
|
|
|
|
|
var data = Common.getOneFromTable(table,"universityFacultyTable");
|
|
|
|
|
if(data==null){
|
|
|
|
|
return ;
|
|
|
|
|
var data = Common.getOneFromTable(table, "universityFacultyTable");
|
|
|
|
|
if (data == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var url = "/jlw/universityFaculty/add.do?universityFacultyId="+data.universityFacultyId;
|
|
|
|
|
Common.openDlg(url,"院系管理管理>"+data.universityFacultyId+">编辑");
|
|
|
|
|
var url = "/jlw/universityFaculty/add.do?universityFacultyId=" + data.universityFacultyId;
|
|
|
|
|
Common.openDlg(url, "院系管理管理>" + data.universityFacultyId + ">编辑");
|
|
|
|
|
},
|
|
|
|
|
del: function () {
|
|
|
|
|
layui.use(['del'], function(){
|
|
|
|
|
layui.use(['del'], function () {
|
|
|
|
|
var delView = layui.del
|
|
|
|
|
delView.delBatch();
|
|
|
|
|
});
|
|
|
|
@ -161,7 +165,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
//触发事件
|
|
|
|
|
$('.ext-toolbar').on('click', function() {
|
|
|
|
|
$('.ext-toolbar').on('click', function () {
|
|
|
|
|
var type = $(this).data('type');
|
|
|
|
|
toolbar[type] ? toolbar[type].call(this) : '';
|
|
|
|
|
});
|
|
|
|
@ -169,17 +173,17 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
}, initTableTool: table.on('tool(universityFacultyTable)', function (obj) {
|
|
|
|
|
var data = obj.data;
|
|
|
|
|
if (obj.event === 'edit') {
|
|
|
|
|
var url = "/jlw/universityFaculty/add.do?universityFacultyId="+data.universityFacultyId;
|
|
|
|
|
Common.openDlg(url,"院系管理管理>"+data.universityFacultyId+">编辑");
|
|
|
|
|
}else if(obj.event === "del"){
|
|
|
|
|
var url = "/jlw/universityFaculty/add.do?universityFacultyId=" + data.universityFacultyId;
|
|
|
|
|
Common.openDlg(url, "院系管理管理>" + data.universityFacultyId + ">编辑");
|
|
|
|
|
} else if (obj.event === "del") {
|
|
|
|
|
layer.confirm('是否确定删除该信息?', function (index) {
|
|
|
|
|
var ret = Common.postAjax("/jlw/universityFaculty/delete.json",{ids:data.universityFacultyId});
|
|
|
|
|
layer.msg(ret.code == 0?"删除成功!":ret.msg, {
|
|
|
|
|
var ret = Common.postAjax("/jlw/universityFaculty/delete.json", {ids: data.universityFacultyId});
|
|
|
|
|
layer.msg(ret.code == 0 ? "删除成功!" : ret.msg, {
|
|
|
|
|
offset: ['50%'],
|
|
|
|
|
icon: ret.code == 0?1:2,
|
|
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
|
|
time: 1500 //2秒关闭(如果不配置,默认是3秒)
|
|
|
|
|
},function (){
|
|
|
|
|
if(ret.code == 0){
|
|
|
|
|
}, function () {
|
|
|
|
|
if (ret.code == 0) {
|
|
|
|
|
Lib.tableRefresh();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -187,6 +191,6 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
exports('index',view);
|
|
|
|
|
exports('index', view);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|