"eladmin-generator/src/vscode:/vscode.git/clone" did not exist on "4e0deae13d0d14c12b13f92bbf714db61624135a"
Commit e27ca5d7 authored by trumansdo's avatar trumansdo
Browse files

去除原有管理系统页面,开始清理调整架构

parent 6833044a
layui.define(['table', 'menuApi'], function(exports) {
var menuApi = layui.menuApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"menuTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些菜单?",function(){
var ids =Common.concatBatchId(data);
menuApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','menuApi'], function(exports) {
var form = layui.form;
var menuApi = layui.menuApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#updateForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#saveMenu").click(function(){
//默认值
if(!$('#parentMenuId').val()){
$('#parentMenuId').val(0);
}
menuApi.updateMenu(function(){
Common.info("更新成功");
Lib.closeFrame();
parent.window.dataReload();
});
});
$("#saveMenu-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 menuTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#menuSearchForm"),menuTable)
}
},
initTable:function(){
menuTable = table.render({
elem : '#menuTable',
height : 'full-280',
method : 'post',
url : Common.ctxPath + '/admin/menu/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 : 120
}, {
field : 'name',
title : '菜单名称',
width : 120,
sort : true
}, {
field : 'accessUrl',
title : '菜单入口地址',
width : 250,
sort : true
} , {
field : 'icon',
title : '图标',
width : 80
},{
field : 'seq',
title : '排序',
width : 80,
sort : true
},{
field : 'parentMenuName',
title : '上一级菜单',
width : 120,
sort : true
},{
field : 'typeText',
title : '菜单类型',
width : 100,
sort : true
},
{
field : 'createTime',
title : '创建时间',
width : 120,
templet:function(d){
return Common.getDate(d.createTime);
},
sort : true
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#menuSearchForm"),menuTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/menu/add.do";
Common.openDlg(url,"菜单管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"menuTable");
if(data==null){
return ;
}
var url = "/admin/menu/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([], function(exports) {
var api={
updateMenu:function(callback){
Lib.submitForm("/admin/menu/update.json",$('#updateForm'),{},callback)
},
addMenu:function(callback){
Lib.submitForm("/admin/menu/save.json",$('#addForm'),{},callback)
},
del:function(ids,callback){
Common.post("/admin/menu/batchDel.json",{"ids":ids},callback)
}
};
exports('menuApi',api);
});
\ 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($('#addForm'),function(){
parent.window.dataReload();
Common.info("添加成功");
Lib.closeFrame();
});
});
$("#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($("#updateForm"),function(){
parent.window.dataReload();
Common.info("更新成功");
Lib.closeFrame();
});
});
$("#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)
}
},
initTable:function(){
userTable = table.render({
elem : '#orgTable',
height : Lib.getTableHeight(2),
method : 'post',
url : Common.ctxPath + '/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(form,callback){
Lib.submitForm("/admin/org/update.json",form,{},callback)
},
addOrg:function(form,callback){
Lib.submitForm("/admin/org/save.json",form,{},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.initSearchForm();
this.initClose();
},
initClose:function(){
$("#close").click(function(){
Lib.closeFrame();
});
},
initTable:function(orgId){
userTable = table.render({
elem : '#userTable',
height : 'full-180',
method : 'post',
url : Common.ctxPath + '/admin/org/user/list.json?orgId='+orgId //数据接口
,page : Lib.tablePage //开启分页
,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 : 'jobType1Text',
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
layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
var form = layui.form;
var roleApi = layui.roleApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#addButton").click(function(){
roleApi.addRole($("#addForm"),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', 'roleApi'], function(exports) {
var roleApi = layui.roleApi;
var table=layui.table;
var view = {
init:function(){
},
delBatch:function(){
var data = Common.getMoreDataFromTable(table,"roleTable");
if(data==null){
return ;
}
Common.openConfirm("确认要删除这些角色?",function(){
var ids =Common.concatBatchId(data);
roleApi.del(ids,function(){
Common.info("删除成功");
dataReload();
})
})
}
}
exports('del',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
var form = layui.form;
var roleApi = layui.roleApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#updateForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#updateButton").click(function(){
roleApi.updateRole($("#updateForm"),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 roleTable = null;
var view ={
init:function(){
this.initTable();
this.initSearchForm();
this.initToolBar();
window.dataReload = function(){
Lib.doSearchForm($("#searchForm"),roleTable)
}
},
initTable:function(){
roleTable = table.render({
elem : '#roleTable',
height : Lib.getTableHeight(2),
method : 'post',
url : Common.ctxPath + '/admin/role/list.json' //数据接口
,page : Lib.tablePage //开启分页
,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 : 'typeText',
title : '角色类型',
width : 300,
sort : true
},
{
field : 'createTime',
title : '创建时间',
width : 120,
templet:function(d){
return Common.getDate(d.createTime);
},
sort : true
}
] ]
});
},
initSearchForm:function(){
Lib.initSearchForm( $("#searchForm"),roleTable,form);
},
initToolBar:function(){
toolbar = {
add : function() { //获取选中数据
var url = "/admin/role/add.do";
Common.openDlg(url,"角色管理>新增");
},
edit : function() { //获取选中数目
var data = Common.getOneFromTable(table,"roleTable");
if(data==null){
return ;
}
var url = "/admin/role/edit.do?id="+data.id;
Common.openDlg(url,"角色管理>>编辑");
},
del : function() {
layui.use(['del'], function(){
var delView = layui.del
delView.delBatch();
});
},
roleUser : function() {
var data = Common.getOneFromTable(table,"roleTable");
if(data==null){
return ;
}
var url = "/admin/role/user/list.do?roleId="+data.id;
Common.openDlg(url,"角色管理>"+data.name+">用户列表");
}
};
$('.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={
updateRole:function(form,callback){
Lib.submitForm("/admin/role/update.json",form,{},callback)
},
addRole:function(form,callback){
Lib.submitForm("/admin/role/add.json",form,{},callback)
},
del:function(ids,callback){
Common.post("/admin/role/delete.json",{"ids":ids},function(){
callback();
})
},
queryFunctionByRole:function(roleId,callback){
Common.post("/admin/role/function/ids.json",{"roleId":roleId},function(data){
callback(data);
})
},
saveFunctions:function(roleId,ids){
Common.post("/admin/role//function/update.json",{"roleId":roleId,"ids":ids},function(data){
Common.info("保存功能成功")
})
},
saveDataAccess:function(roleId,fnId,accessType){
Common.post("/admin/role/function/updateDataAccess.json",{"roleId":roleId,"fnId":fnId,"accessType":accessType},function(data){
Common.info("保存数据权限成功")
})
}
};
exports('roleApi',api);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var checkedRoleId=null;
var roleApi=layui.roleApi;
var view ={
init:function(roleId){
this.initRoles();
},
initRoles:function(){
var that = this;
form.on('radio(roleId)', function(data){
checkedRoleId = data.value; //被点击的radio的value值
that.loadDataAccessByRole(checkedRoleId);
})
this.initFirstRole();
},
initFirstRole:function(){
var firstRole=$(".layui-form").find(":radio")[0]
checkedRoleId= $(firstRole).val();
this.loadDataAccessByRole(checkedRoleId);
$(firstRole).prop("checked",true);
},
loadDataAccessByRole:function(roleId){
$("#dataAccess").load(Common.ctxPath+"/admin/role/function/dataAccess.do?roleId="+roleId,{},function(){
form.render();
form.on('select', function(data){
var dom = data.elem;
var fnId = $(dom).data("id");
var accessType= data.value;
roleApi.saveDataAccess(checkedRoleId,fnId,accessType)
});
});
},
}
exports('roleData',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','roleApi'], function(exports) {
var form = layui.form;
var laydate = layui.laydate;
var table = layui.table;
var zTreeObj = null;
var roleApi = layui.roleApi;
var checkedRoleId=null;
var view ={
init:function(roleId){
this.initFunctionTree();
this.initSaveFunction();
},
initFunctionTree:function(){
var that = this;
$.post(Common.ctxPath + "/admin/function/tree.json", {}, function(response) {
var zNodes = response.data;
// select parent node does not affect the children node
var setting = {"check":{"chkStyle":"checkbox","enable":true, "chkboxType": { "Y": "p", "N": "p" }}};
zTreeObj = $.fn.zTree.init($("#functionTree"), setting, zNodes);
//功能树加载完毕后在初始化其他控件
that.initFirstRole();
that.initRoles();
})
},
initSaveFunction:function(){
$("#save").click(function(){
var nodes = zTreeObj.getCheckedNodes(true);
var ids = Common.concatBatchId(nodes,"id")
roleApi.saveFunctions(checkedRoleId,ids)
});
},
initRoles:function(){
var that = this;
form.on('radio(roleId)', function(data){
checkedRoleId = data.value; //被点击的radio的value值
that.loadFunctionByRole(checkedRoleId);
})
},
initFirstRole:function(){
var firstRole=$(".layui-form").find(":radio")[0]
checkedRoleId= $(firstRole).val();
this.loadFunctionByRole(checkedRoleId);
$(firstRole).prop("checked",true);
form.render();
},
loadFunctionByRole:function(roleId){
// debugger;
var nodes = zTreeObj.getCheckedNodes(true);
for(var i=0;i<nodes.length;i++){
zTreeObj.checkNode(nodes[i], false, true);
}
roleApi.queryFunctionByRole(roleId,function(fnIds){
for(var i=0;i<fnIds.length;i++){
var node = zTreeObj.getNodesByParam("id",fnIds[i]);
zTreeObj.checkNode(node[0], true, true);
}
});
}
}
exports('roleFn',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(roleId){
this.initTable(roleId);
this.initSearchForm();
this.initClose();
},
initClose:function(){
$("#close").click(function(){
Lib.closeFrame();
});
},
initTable:function(roleId){
userTable = table.render({
elem : '#userTable',
height : 'full-180',
method : 'post',
url : Common.ctxPath + '/admin/role/user/list.json?roleId='+roleId //数据接口
,page : Lib.tablePage //开启分页
,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 : 'orgIdText',
title : '任职机构',
width : 300,
sort : true
},{
field : 'orgId1Text',
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( $("#roleUserSearchForm"),userTable,form);
}
}
exports('roleUser',view);
});
\ No newline at end of file
layui.define([ 'form', 'laydate', 'table','userApi'], function(exports) {
var form = layui.form;
var userApi = layui.userApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#saveUser").click(function(){
userApi.addUser($('#addForm'),function(){
parent.window.dataReload();
Common.info("添加成功");
Lib.closeFrame();
});
});
$("#saveUser-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('add',view);
});
\ No newline at end of file
layui.define([ 'form', 'table','userApi'], function(exports) {
var form = layui.form;
var userApi = layui.userApi;
var index = layui.index;
var view = {
init:function(){
Lib.initGenrealForm($("#changePasswordForm"),form);
this.initSubmit();
},
initSubmit:function(){
$("#savePassword").click(function(){
userApi.changePassword($('#changePasswordForm'),function(){
Common.info("密码更改成功");
Lib.closeFrame();
});
});
$("#savePassword-cancel").click(function(){
Lib.closeFrame();
});
}
}
exports('changePassword',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