123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /*
- * 描 述:权限常量管理
- */
- var selectedRow;
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 查询
- $('#btn_Search').on('click', function () {
- var keyword = $('#txt_Keyword').val();
- page.search({ keyword: keyword });
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Code');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/UserCenterManager/ACLConst/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 新增
- $('#lr_add').on('click', function () {
- var keyValue = {};
- selectedRow = $('#gridtable').jfGridGet('rowdata') || {};
- learun.layerForm({
- id: 'form',
- title: '添加',
- url: top.$.rootUrl + '/UserCenterManager/ACLConst/Form',
- height: 400,
- width: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- $('#lr_acladd').on('click', function () {
- learun.layerConfirm('是否要添加权限!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/UserCenterManager/ACLConst/SaveWebACLConst', {}, function () {
- refreshGirdData();
- });
- }
- });
- });
- // 添加按钮权限
- $('#lr_acladdbtn').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Code');
- selectedRow = $('#gridtable').jfGridGet('rowdata');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'ModuleBtnForm',
- title: '添加权限按钮',
- url: top.$.rootUrl + '/UserCenterManager/ACLConst/ModuleBtnForm?keyValue=' + keyValue,
- width: 500,
- height: 340,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
-
- },
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/UserCenterManager/ACLConst/GetList',
- headData: [
- learun.jfFormatter.col_NAME("权限常量名称"),
- {
- label: '应用类型', name: 'AppTypeNum', width: 80, align: "center"
- , formatterAsync: function (callback, value, row) {
- learun.clientdata.getAsync('dataItem', {
- Rowkey: value,
- GrpCode: 'EAppType',
- getType: 'Num',
- callback: function (item) {
- callback(item.F_NAME);
- }
- });
- }
- },
- { label: "排序号", name: "SortNum", width: 100, align: "left" },
- { label: "权限常量", name: "ACLItem", width: 300, align: "left" },
- learun.jfFormatter.col_ISSTOP(),
- learun.jfFormatter.col_AddWho(),
- learun.jfFormatter.col_AddTime(),
- learun.jfFormatter.col_EditWho(),
- learun.jfFormatter.col_EditTime(),
- learun.jfFormatter.col_MEMO()
- ],
- isTree: true,
- mainId: 'Code',
- parentId: 'PNO'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', param);
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|