123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- com.sinosoft.lz.system.Button = function(){
- var _this = this;
-
- /** treegrid组件 **/
- var $treegrid;
- var moduleIdForm;
-
- var loadGrid= function(){
- $treegrid = $('#cxdmfff').treegrid({
- url:'/gzfw/ws/button/FunctionService/getFunctionList',
- idField : 'id',
- treeField : 'module_id',
- toolbar:"#tb",
- fit :true,
- width: 'auto',
- rownumbers: true,
- fitColumns:true,
- columns : [ [ {
- title : '所属模块',
- field : 'module_id'
- }, {
- field : 'id',
- title : '功能点编号'
- }, {
- field : 'name',
- title : '功能点名称'
- }, {
- field : 'operate',
- title : '操作'
- }, {
- field : 'button',
- title : '已分配按钮'
- } ] ]
- });
- };
-
- var moduleIdCombox =function(){
- moduleIdForm = $('#Module_Id').combotree({
- url:'/gzfw/page/system/button/divTreeService.jsp?nodeID=mdpModules&buildSelf=false',
- required: true
- });
-
- };
- var saveFunction = function(){
- $('#fm').form('submit',{
- url: '/gzfw/ws/button/FunctionService/saveFunction/',
- onSubmit: function(){
- return $(this).form('validate');
- },
- success: function(result){
- var result = eval('('+result+')');
- if (!result.success){
- $.messager.show({
- title: 'Error',
- msg: result.success
- });
- } else {
- $('#tb').form('clear');
- $treegrid.treegrid('reload'); // reload the user data
- }
- }
- });
- };
- var saveFunctionButton = function(){
- $('#formButton').form('submit',{
- url: '/gzfw/ws/button/FunctionService/saveFunctionButton/',
- onSubmit: function(){
- return $(this).form('validate');
- },
- success: function(result){
- var result = eval('('+result+')');
- if (result.success){
- parent.$('#dd').dialog('close');
- parent.$treegrid.treegrid('reload'); // reload the user data
- } else {
- $.messager.show({
- title: 'Error',
- msg: result.success
- });
-
- }
- }
- });
- };
-
- var OpenFrame = function(id) {
- $('#dd').dialog('clear');
- var trUrl = "functionbutton.jsp?fun_id="+id;
- $('#dd').append("<iframe src='"+trUrl+"' height='380' width='630' frameborder='0'></iframe>");
- $('#dd').dialog('open').dialog('setTitle','按钮权限分配');
- };
- var submitAction = function(codeId){
- $.messager.confirm('按钮删除','确定要删除功能模块吗?',
- function(r){
- if (r){
- $.post('/gzfw/ws/button/FunctionService/deleteFunction/',{fd_objectid:codeId},function(result){
-
- if (result.success){
- $treegrid.treegrid('reload'); // reload the user data
- } else {
- $.messager.show({ // show error message
- title: 'Error',
- msg: result.success
- });
- }
- },'json');
- }
- });
- };
-
- var deleteFunctionButton = function(codeId,funId){
- $.messager.confirm('按钮删除','确定要删除功能按钮吗?',
- function(r){
- if (r){
- $.post('/gzfw/ws/button/FunctionService/deleteFunctionButton/',{fd_objectid:codeId,funId:funId},function(result){
- if (result.success){
- $treegrid.treegrid('reload'); // reload the user data
- } else {
- $.messager.show({ // show error message
- title: 'Error',
- msg: result.success
- });
- }
- },'json');
- }
- });
- };
- return {
- /**
- * 功能:初始化
- */
- init : function(){
- loadGrid();
- moduleIdCombox();
- }
-
- };
- }();
- $(function(){
- com.sinosoft.lz.system.Button.init();
-
- });
|