| | |
| | | //id: uuid_short(), |
| | | // code: createCode("BA"), |
| | | }, |
| | | formData: {}, |
| | | formData: { |
| | | title: "", |
| | | }, |
| | | |
| | | dataRequest: [ |
| | | { |
| | |
| | | |
| | | pageid: "", // 新页面id |
| | | parent_menuobj: {}, // 父级菜单 |
| | | |
| | | isAddMenu: false, // 仅添加一个菜单 |
| | | treeoptions: [] |
| | | }, |
| | | created() { |
| | | this.popupParames = clone(Root.popupParames); |
| | |
| | | // } |
| | | |
| | | if (this.popupParames.data) { |
| | | this.parent_menuobj = this.popupParames.data; |
| | | if (this.popupParames.sceneCode) { |
| | | if (this.popupParames.sceneCode == 'add') { |
| | | this.pageid = createCode("R_"); |
| | | if (this.popupParames.sceneCode == 'addmenu') { |
| | | this.isAddMenu = true; |
| | | this.parent_menuobj = this.popupParames.data; |
| | | if (this.parent_menuobj && this.parent_menuobj.id) { |
| | | this.formData.parent_id = this.parent_menuobj.id |
| | | } |
| | | } |
| | | else if (this.popupParames.sceneCode == 'add') { |
| | | this.parent_menuobj = this.popupParames.data; |
| | | this.pageid = createCode("M_P"); |
| | | this.formData.parent_id = this.popupParames.data.id; |
| | | } else if (this.popupParames.sceneCode == 'edit') { |
| | | } |
| | | else if (this.popupParames.sceneCode == 'edit') { |
| | | this.pageid = this.popupParames.data.page_id; |
| | | |
| | | this.parent_menuobj = { |
| | | id: this.popupParames.data.parent_id, |
| | | type_code: this.popupParames.data.type_code |
| | | }; |
| | | if (this.popupParames.data.url && this.popupParames.data.url.indexOf("viewlet=") > 0) { |
| | | var url_ = this.popupParames.data.url.split("viewlet=") |
| | | var url_parame_ = url_[1].split("&") |
| | | |
| | | if (url_parame_[1] && url_parame_[1] == "op=write") { |
| | | this.popupParames.data.reporttype = "write" |
| | | } |
| | | else if (url_parame_[1] && url_parame_[1] == "op=view") { |
| | | this.popupParames.data.reporttype = "view" |
| | | } |
| | | else { |
| | | this.popupParames.data.reporttype = "" |
| | | } |
| | | this.popupParames.data.url = url_parame_[0] |
| | | } |
| | | this.formData = clone(this.popupParames.data); |
| | | } |
| | | } |
| | |
| | | } |
| | | formFields_.push(clone(f)); |
| | | }) |
| | | var page_url = {isshow: "T", field: "url", name: "路径", type: "input", required: true} |
| | | formFields_.push(clone(page_url)); |
| | | // if (!me.isAddMenu) { |
| | | // var page_url = {isshow: "T", field: "url", name: "路径", type: "input", required: true, placeholder: "如:patch_report/DMS_index_mysql.frm", appendix: "报表中的参数包含actor(角色类型Org/Business/Sales/Customer/Admin)、target_id(销售岗位ID/DMS开户ID)、company_id、bu_id", isvalexplain_br: true} |
| | | // var page_reporttype = {isshow: "T", field: "reporttype", name: "类型", type: "radio", options: [{code: "", value: "预览"}, {code: "write", value: "填报"},{code: "view", value: "分析"}]} |
| | | // formFields_.push(clone(page_url)); |
| | | // formFields_.push(clone(page_reporttype)); |
| | | // } |
| | | |
| | | if (!me.formFields || (me.formFields && me.formFields.length == 0)) { |
| | | me.formFields = clone(formFields_); |
| | | |
| | |
| | | var me = this; |
| | | if (this.pageid) { |
| | | var entity_ = clone(this.formData); |
| | | |
| | | var entity = { |
| | | id: this.pageid, |
| | | code: this.pageid, |
| | | title: entity_.title, |
| | | url: "module/report/page/report_iframe.html?viewlet=" + entity_.url, |
| | | url: entity_.url ? entity_.url : "module/model/model_iframe.html", |
| | | is_active: "T" |
| | | }; |
| | | |
| | |
| | | var me = this; |
| | | var entity_ = clone(this.formData); |
| | | var entity = { |
| | | parent_id: this.parent_menuobj.id, |
| | | type_code: this.parent_menuobj.type_code, |
| | | page_id: this.pageid, |
| | | parent_id: this.parent_menuobj.id || null, |
| | | type_code: this.parent_menuobj.type_code || "Z", |
| | | open_type: "arrange", |
| | | page_id: this.pageid || null, |
| | | title: entity_.title, |
| | | icon: entity_.icon, |
| | | order_no: this.parent_menuobj.children.length + 1, |
| | | order_no: entity_.order_no ? entity_.order_no : (this.parent_menuobj.children ? this.parent_menuobj.children.length + 1 : 1), |
| | | }; |
| | | |
| | | if (entity_.id) { |
| | |
| | | param.data[this.dataname] = entity; |
| | | Server.call("root/data/saveEntity", param, function(result) { |
| | | console.log(result); |
| | | if (me.pageid) { |
| | | me.onRefreshCacheByPageId(me.pageid); |
| | | } |
| | | else { |
| | | Root.message({ |
| | | type: 'success', |
| | | message: '保存成功' |
| | | }); |
| | | me.saveAfter(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 刷新缓存 |
| | | onRefreshCacheByPageId(PageId) { |
| | | var me = this; |
| | | let param_ = { |
| | | page_id: PageId |
| | | } |
| | | Server.call("root/system/reloadMenuByPage", param_, function(result) { |
| | | if (result.success) { |
| | | let param_ = { |
| | | dataname: "sys_menu", |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }); |