| | |
| | | dataRequestObj: {}, |
| | | options_menumap: {}, |
| | | options_menutree: [], |
| | | listoptions: [], |
| | | |
| | | //按键权限设置 |
| | | isedit: false,//提交前编辑,保存/提交 |
| | |
| | | if (this.popupParames.sceneCode) { |
| | | if (this.popupParames.sceneCode == 'addmenu') { |
| | | this.isAddMenu = true; |
| | | // this.pageid = createCode("M_P"); |
| | | this.parent_menuobj = this.popupParames.data; |
| | | if (this.parent_menuobj && this.parent_menuobj.id) { |
| | | this.formData.parent_id = this.parent_menuobj.id |
| | |
| | | var me = this; |
| | | if(this.popupParames.callback) { |
| | | let obj = { |
| | | options: this.treeoptions, |
| | | treeoptions: this.options_menutree, |
| | | listoptions: this.listoptions |
| | | } |
| | | this.popupParames.callback(obj, function() { |
| | | me.closeDialog(); |
| | |
| | | if (entity_.id) { |
| | | entity.id = entity_.id |
| | | } |
| | | else { |
| | | entity.id = createCode("M") |
| | | } |
| | | |
| | | let param = { |
| | | dataname: this.dataname, |
| | |
| | | if (me.pageid) { |
| | | me.onRefreshCacheByPageId(me.pageid); |
| | | } |
| | | else if (entity.id) { |
| | | me.onRefreshCacheByMenuId(entity.id); |
| | | } |
| | | else { |
| | | Root.message({ |
| | | type: 'success', |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 刷新缓存 |
| | | // 刷新缓存页面 |
| | | onRefreshCacheByPageId(PageId) { |
| | | var me = this; |
| | | let param_ = { |
| | |
| | | filter: "page_id is null", |
| | | } |
| | | Server.call("root/data/getEntitySet", param_, function(result2){ |
| | | me.listoptions = clone(result2.data.entityset); |
| | | let agm_category_ = ArrayToTree(clone(result2.data.entityset), "title", "parent_id"); |
| | | me.options_menutree = agm_category_; |
| | | Root.message({ |
| | |
| | | }); |
| | | }, |
| | | |
| | | onRefreshCacheByMenuId(MenuId) { |
| | | var me = this; |
| | | let param_ = { |
| | | menu_id: MenuId |
| | | } |
| | | Server.call("root/system/reloadOneMenu", param_, function(result) { |
| | | if (result.success) { |
| | | let param_ = { |
| | | dataname: "sys_menu", |
| | | filter: "page_id is null", |
| | | } |
| | | Server.call("root/data/getEntitySet", param_, function(result2){ |
| | | me.listoptions = clone(result2.data.entityset); |
| | | let agm_category_ = ArrayToTree(clone(result2.data.entityset), "title", "parent_id"); |
| | | me.options_menutree = agm_category_; |
| | | Root.message({ |
| | | type: 'success', |
| | | message: '保存成功' |
| | | }); |
| | | me.saveAfter(); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | }; |