Commit 321361c9 authored by xiandafu's avatar xiandafu
Browse files

init

parent 2971e3f1
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var consoleTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),roleTable,form)
}
},
initTable:function(){
consoleTable = table.render({
elem : '#consoleTable',
height : Lib.getTableHeight(1),
method : 'post',
url : Common.CTX + '/admin/console/list.json' //数据接口
,page : Lib.tablePage //开启分页
,limit : 10,
cols : [ [ //表头
{
type : 'checkbox',
fixed:'left',
},
{
field : 'id',
title : 'id',
fixed:'left',
width : 100,
},
{
field : 'title',
title : 'title',
width : 100,
},
{
field : 'content',
title : 'content',
width : 100,
},
{
field : 'createTime',
title : 'createTime',
width : 100,
},
{
field : 'createUserId',
title : 'createUserId',
width : 100,
},
{
field : 'type',
title : 'type',
width : 100,
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),consoleTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/console/add.do";
Common.openDlg(url,"CmsBlog管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"consoleTable");
if(data==null){
return ;
}
var url = "/admin/console/edit.do?id="+data.id;
Common.openDlg(url,"CmsBlog管理>"+data.CmsBlog+">编辑");
},
del : function() {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
}
};
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}
}
exports('index',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','dictApi'], function(exports) {
var form = layui.form;
var dictApi = layui.dictApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#addButton").click(function(){
dictApi.addDict(function(){
parent.window.dataReload();
Common.info("添加成功");
Lib.closeFrame();
});
});
$("#addButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('add',view);
});
\ No newline at end of file
layui.define(['table', 'dictApi'], function(exports) {
var dictApi = layui.dictApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"dictTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些数据字典?",function(){
var ids =Common.concatBatchId(data,"value");
dictApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});
\ No newline at end of file
/*访问后台的代码*/
layui.define([], function(exports) {
var api={
updateDict:function(callback){
Lib.submitForm($('#updateForm'),{},callback)
},
addDict:function(callback){
Lib.submitForm($('#addForm'),{},callback)
},
del:function(ids,callback){
Common.post("/admin/dict/delete.json",{"ids":ids},function(){
callback();
})
}
};
exports('dictApi',api);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','dictApi'], function(exports) {
var form = layui.form;
var dictApi = layui.dictApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#updateForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#updateButton").click(function(){
dictApi.updateDict(function(){
parent.window.dataReload();
Common.info("更新成功");
Lib.closeFrame();
});
});
$("#updateButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('edit',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var dictTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),dictTable,form)
}
},
initTable:function(){
dictTable = table.render({
elem : '#dictTable',
height : Lib.getTableHeight(1),
method : 'post',
url : Common.CTX + '/admin/dict/list.json' //数据接口
,page : Lib.tablePage //开启分页
,limit : 10,
cols : [ [ //表头
{
type : 'checkbox',
fixed:'left',
},
{
field : 'value',
title : '字典值',
fixed:'left',
width : 120,
},
{
field : 'name',
title : '字典名称',
width : 180,
},
{
field : 'type',
title : '字典类型',
width : 180,
},
{
field : 'typeName',
title : '字典类型名称',
width : 180,
},
{
field : 'sort',
title : '排序',
width : 60,
},
{
field : 'parent',
title : '父字典',
width : 100,
},
{
field : 'remark',
title : '备注',
width : 100,
},
{
field : 'createTime',
title : '创建时间',
width : 100,
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),dictTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/dict/add.do";
Common.openDlg(url,"字典数据管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"dictTable");
if(data==null){
return ;
}
var url = "/admin/dict/edit.do?id="+data.value;
Common.openDlg(url,"字典数据管理>"+data.value+">编辑");
},
del : function() {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
}
};
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}
}
exports('index',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','entityApi'], function(exports) {
var form = layui.form;
var entityApi = layui.entityApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#addButton").click(function(){
entityApi.addEntity(function(){
parent.window.dataReload();
Common.info("添加成功");
Lib.closeFrame();
});
});
$("#addButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('add',view);
});
\ No newline at end of file
layui.define(['table', 'entityApi'], function(exports) {
var entityApi = layui.entityApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"entityTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些CmsBlog?",function(){
var ids =Common.concatBatchId(data);
entityApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','entityApi'], function(exports) {
var form = layui.form;
var entityApi = layui.entityApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#updateForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#updateButton").click(function(){
entityApi.updateEntity(function(){
parent.window.dataReload();
Common.info("更新成功");
Lib.closeFrame();
});
});
$("#updateButton-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('edit',view);
});
\ No newline at end of file
/*访问后台的代码*/
layui.define([], function(exports) {
var api={
updateEntity:function(callback){
Lib.submitForm($('#updateForm'),{},callback)
},
addEntity:function(callback){
Lib.submitForm($('#addForm'),{},callback)
},
del:function(ids,callback){
Common.post("/admin/entity/delete.json",{"ids":ids},function(){
callback();
})
}
};
exports('entityApi',api);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var entityTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),roleTable,form)
}
},
initTable:function(){
entityTable = table.render({
elem : '#entityTable',
height : Lib.getTableHeight(1),
method : 'post',
url : Common.CTX + '/admin/entity/list.json' //数据接口
,page : Lib.tablePage //开启分页
,limit : 10,
cols : [ [ //表头
{
type : 'checkbox',
fixed:'left',
},
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),entityTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/entity/add.do";
Common.openDlg(url,"CmsBlog管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"entityTable");
if(data==null){
return ;
}
var url = "/admin/entity/edit.do?id="+data.id;
Common.openDlg(url,"CmsBlog管理>"+data.
\ No newline at end of file
layui.define(['table', 'functionApi'], function(exports) {
var functionApi = layui.functionApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"functionTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些Function?",function(){
var ids =Common.concatBatchId(data);
functionApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});
\ No newline at end of file
/*访问后台的代码*/
layui.define([], function(exports) {
var api={
updateFunction:function(callback){
Lib.submitForm($('#updateForm'),{},callback)
},
addFunction:function(callback){
Lib.submitForm($('#addForm'),{},callback)
},
del:function(ids,callback){
Common.post("/admin/function/batchDel.json",{"ids":ids},function(){
callback();
})
}
};
exports('functionApi',api);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var userTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#functionSearchForm"),userTable,form)
}
},
initTable:function(){
userTable = table.render({
elem : '#functionTable',
height : 'full-280',
method : 'post',
url : Common.CTX + '/admin/function/list.json' //数据接口
,page : {"layout":['count','prev', 'page', 'next']} //开启分页
,limit : 10,
cols : [ [ //表头
{
type : 'checkbox',
fixed:'left',
},
{
field : 'id',
title : 'id',
width : 80,
fixed:'left',
sort : true
}, {
field : 'code',
title : '功能代码',
width : 150
}, {
field : 'name',
title : '功能名称',
width : 150,
sort : true
}, {
field : 'accessUrl',
title : '访问地址',
width : 300,
sort : true
}, {
field : 'parentFunctionText',
title : '上一级功能',
width : 120,
sort : true
},{
field : 'typeText',
title : '功能类型',
width : 120,
sort : true
},
{
field : 'createTime',
title : '创建时间',
width : 120,
templet:function(d){
return Common.getDate(d.createTime);
},
sort : true
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#functionSearchForm"),userTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/function/add.do";
Common.openDlg(url,"功能点管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"functionTable");
if(data==null){
return ;
}
var url = "/admin/function/edit.do?id="+data.id;
Common.openDlg(url,"功能点管理>编辑");
},
del : function() {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
}
};
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}
}
exports('index',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','orgApi'], function(exports) {
var form = layui.form;
var orgApi = layui.orgApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#saveOrg").click(function(){
orgApi.addOrg(function(){
Common.info("添加成功");
Lib.closeFrame();
});
parent.window.dataReload();
});
$("#saveOrg-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('add',view);
});
\ No newline at end of file
layui.define(['table', 'orgApi'], function(exports) {
var orgApi = layui.orgApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"orgTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些结构?",function(){
var ids =Common.concatBatchId(data);
orgApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','orgApi'], function(exports) {
var form = layui.form;
var orgApi = layui.orgApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#updateForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#saveOrg").click(function(){
orgApi.updateOrg(function(){
Common.info("更新成功");
Lib.closeFrame();
});
parent.window.dataReload();
});
$("#saveOrg-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('edit',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var userTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#orgSearchForm"),userTable,form)
}
},
initTable:function(){
userTable = table.render({
elem : '#orgTable',
height : 'full-280',
method : 'post',
url : Common.CTX + '/admin/org/list.json' //数据接口
,page : {"layout":['count','prev', 'page', 'next']} //开启分页
,limit : 10,
cols : [ [ //表头
{
type : 'checkbox',
fixed:'left',
}, {
field : 'id',
title : 'id',
width : 80,
fixed:'left',
sort : true
}, {
field : 'code',
title : '机构代码',
width : 150
}, {
field : 'name',
title : '机构名称',
width : 120,
sort : true
}, {
field : 'parentOrgText',
title : '上一级机构',
width : 150,
sort : true
},
{
field : 'typeText',
title : '机构类型',
width : 120,
sort : true
},
{
field : 'createTime',
title : '创建时间',
width : 120,
templet:function(d){
return Common.getDate(d.createTime);
},
sort : true
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#orgSearchForm"),userTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/org/add.do";
Common.openDlg(url,"用户管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"orgTable");
if(data==null){
return ;
}
var url = "/admin/org/edit.do?id="+data.id;
Common.openDlg(url,"用户管理>编辑");
},
del : function() {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
},
orgUser : function() {
var data = Common.getOneFromTable(table,"orgTable");
if(data==null){
return ;
}
var url = "/admin/org/user/list.do?orgId="+data.id;
Common.openDlg(url,"组织管理>用户列表");
}
};
$('.ext-toolbar').on('click', function() {
var type = $(this).data('type');
toolbar[type] ? toolbar[type].call(this) : '';
});
}
}
exports('index',view);
});
\ No newline at end of file
/*访问后台的代码*/
layui.define([], function(exports) {
var api={
updateOrg:function(callback){
Lib.submitForm($('#updateForm'),{},callback)
},
addOrg:function(callback){
Lib.submitForm($('#addForm'),{},callback)
},
del:function(ids,callback){
Common.post("/admin/org/delete.json",{"ids":ids},function(){
callback();
})
}
};
exports('orgApi',api);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table' ], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var userTable = null;
var view ={
init:function(orgId){
this.initTable(orgId);
this.initClose();
},
initClose:function(){
$("#close").click(function(){
Lib.closeFrame();
});
},
initTable:function(orgId){
userTable = table.render({
elem : '#userTable',
height : 'full-180',
method : 'post',
url : Common.CTX + '/admin/org/user/list.json?orgId='+orgId //数据接口
,page : {"layout":['count','prev', 'page', 'next']} //开启分页
,limit : 10,
cols : [ [ //表头
{
type : 'checkbox',
fixed:'left',
}, {
field : 'id',
title : 'id',
width : 80,
fixed:'left',
sort : true
}, {
field : 'code',
title : '用户名',
width : 150
}, {
field : 'name',
title : '姓名',
width : 120,
sort : true
}, {
field : 'orgName',
title : '机构',
width : 300,
sort : true
}, {
field : 'stateText',
title : '状态',
width : 80,
sort : true
},
{
field : 'jobTypeText',
title : '职位',
width : 80,
sort : true
},
{
field : 'createTime',
title : '创建时间',
width : 120,
templet:function(d){
return Common.getDate(d.createTime);
},
sort : true
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#orgUserSearchForm"),userTable,form);
}
}
exports('orgUser',view);
});
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment