From 83957eba1ad5bde31feced0bf07e28bd95389009 Mon Sep 17 00:00:00 2001 From: zhangyanpeng <bob.zhang@highdatas.com> Date: 星期一, 26 八月 2024 19:58:23 +0800 Subject: [PATCH] 调整 --- module/config/page/sys_menu_edit.html | 102 ++++++++++++- module/config/page/popup/popup_tablefield_edit.html | 216 ++++++++++++++++++++++++++++++ css/myelement.css | 4 js/vue/page.js | 3 js/myelement.js | 2 module/config/page/sys_menu_add.html | 39 +++++ module/model/page/table_simple.html | 21 ++ module/system/page/main.html | 20 +- js/config.js | 2 9 files changed, 379 insertions(+), 30 deletions(-) diff --git a/css/myelement.css b/css/myelement.css index f893a12..64b18f1 100644 --- a/css/myelement.css +++ b/css/myelement.css @@ -920,7 +920,9 @@ font-size: 14px; font-weight: bold; } - +.h_form .h_form_group { + margin: 0px; +} .h_form .h_form_group_name { font-size: 14px; } diff --git a/js/config.js b/js/config.js index 2631beb..bddea77 100644 --- a/js/config.js +++ b/js/config.js @@ -14,7 +14,7 @@ config = { - jscssversion: "2024082502", //.js/.css鏂囦欢鐨勭増鏈彿锛屽幓闄ゅ墠绔紦瀛樼殑涓�绉嶆満鍒� + jscssversion: "2024082602", //.js/.css鏂囦欢鐨勭増鏈彿锛屽幓闄ゅ墠绔紦瀛樼殑涓�绉嶆満鍒� isupgrading: false, //鏄惁鍗囩骇涓� appName: "TPP", title: "钀ラ攢涓�浣撳寲杩愯惀骞冲彴", diff --git a/js/myelement.js b/js/myelement.js index 8c64137..a5993df 100644 --- a/js/myelement.js +++ b/js/myelement.js @@ -7910,7 +7910,7 @@ '<div v-if="formAttr.istitle && formAttr.title" class="h_form_title_name">{{formAttr.title}}</div> '+ '<template v-for="(g, k) in tableFieldsGroup"> '+ - '<div v-if="g.name && g.name !=\' \' " style="margin: 0;"><i class="iconfont icon-fuzhushuxian" style="color: #0270c1;"></i><span class="h_form_group_name">{{g.name}}</span></div> '+ + '<div v-if="g.name && g.name !=\' \' " class="h_form_group"><i class="iconfont icon-fuzhushuxian" style="color: #0270c1;"></i><span class="h_form_group_name">{{g.name}}</span></div> '+ '<div style="margin: 0; padding-left: 0px">'+ '<h-newform-a '+ //澶栭儴鍙傛暟 diff --git a/js/vue/page.js b/js/vue/page.js index 42450f7..288bc8b 100644 --- a/js/vue/page.js +++ b/js/vue/page.js @@ -1645,6 +1645,9 @@ disabledone: config.disabledone, operationtype: config.operationtype, parentOption: window.top.tab.selected.option, + + filter: config.filter || "", + dataname: config.dataname || "", closecallback: function() { if (closecallback_) { closecallback_(); diff --git a/module/config/page/popup/popup_tablefield_edit.html b/module/config/page/popup/popup_tablefield_edit.html new file mode 100644 index 0000000..74e7a2d --- /dev/null +++ b/module/config/page/popup/popup_tablefield_edit.html @@ -0,0 +1,216 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache"> + <title>琛ㄥ崟缂栬緫瀛楁璁剧疆寮圭獥</title> + + <script type="text/javascript"> + var pageVue = null; + function loadJsCss(callback) { + var jscss_urls = []; + window.top.initJsCss(document, jscss_urls, callback); + }; + + function initVue() { + new ListVue({ + el: "#vbody", + data: { + dataname: "", + title: "琛ㄥ崟缂栬緫瀛楁璁剧疆寮圭獥", + pageAttr: { + heightType: "popuppage" + }, + delta: {}, + orderby: "", + tableAttr: { + isborder: true + }, + filterfieldClick: {}, + tablefieldClick: {}, + formfieldClick: {}, + tableHeight: 0, + isPagination: false + }, + created() { + this.popupParames = clone(Root.popupParames); + this.title = this.popupParames.title || this.popupParames.text + if (this.popupParames.filter) { + this.filterTxt = this.popupParames.filter + } + + if (this.popupParames.dataname) { + this.dataname = this.popupParames.dataname; + } + if (this.popupParames.delta) { + this.delta = this.popupParames.delta; + if (this.delta.orderby) { + this.orderby = this.delta.orderby; + } + } + + if (this.popupParames.sceneCode) { + if (this.popupParames.sceneCode == "add") {//鏂板 + this.isedit = true; + } + if (this.popupParames.sceneCode == "browse") {//鍙 + this.isedit = false; + + } + } + + }, + + mounted() { + // this.getTableMeta(); + //鑾峰彇鏁版嵁 + this.initData(); + this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂� + hideLoading(); + }); + }, + + methods:{ + //鍏抽棴寮圭獥 + closeDialog() { + this.docloseDialog(true); + }, + + //鍏抽棴鍓嶈皟鍥炶皟 + saveAfter() { + var me = this; + if(this.popupParames.callback) { + let obj = { + tableData: clone(this.tableData) + } + this.popupParames.callback(obj, function() { + me.docloseDialog(); + }); + } + else { + me.docloseDialog(); + } + }, + + initData() { + var me = this; + if (this.delta.tabledata) { + this.tableData = clone(this.delta.tabledata); + } + if (this.delta.tablefields) { + this.tableFields = clone(this.delta.tablefields); + } + me.tableDataAfter(); + // this.onQuery(function(result, callback) {//鏌ヨ鍚庣殑鍥炶皟锛岀敤浜庤幏鍙栧瓧娈电殑 + // if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) { + // var metas = clone(result.meta[me.dataname].fields); + // var tableFields_ = []; + + // metas.map(f=>{ + // f.isshow = "F"; + + // tableFields_.push(clone(f)); + // }) + // if (!me.tableFields || (me.tableFields && me.tableFields.length == 0)) { + // me.tableFields = clone(tableFields_); + + // //瀛楁鏁扮粍杞瓧娈祇bj锛岀洰鐨勪负浜嗙瓫閫夋椂鑾峰彇瀛楁灞炴�� + // me.fieldsToFieldsObj(); + + // //璁剧疆瀛楁浜嬩欢 + // me.tableFieldClick(); + // } + + // } + + // if (callback) { + // callback(); + // } + // }); + }, + + tableFieldClick() { + var me = this; + //绛涢�夊瓧娈典簨浠惰缃� + this.filterfieldClick = { + }; + //琛ㄦ牸瀛楁浜嬩欢璁剧疆 + this.tablefieldClick = { + }; + + //琛ㄥ崟瀛楁浜嬩欢璁剧疆 + this.formfieldClick = { + }; + }, + + + onRowDblClick() { + if (this.isedit) { + this.saveAfter(); + } + }, + + } + }); + }; + + loadJsCss(function () { + initVue(); + }); + </script> + <style> + /* 鍦╲ue.js涓� v-cloak 杩欎釜鎸囦护鏄槻姝㈤〉闈㈠姞杞芥椂鍑虹幇 vuejs 鐨勫彉閲忓悕鑰岃璁$殑 */ + [v-cloak] { + display: none !important; + } + </style> + + </head> + + <body style="margin: 0px;"> + <div v-cloak id="vbody"> + <div id="page_root"> + <div ref="popup_body" style="padding: 0 20px;"> + + + <div class="h_dialog__body"> + <h-table + v-if="isRefresh && tableFields.length" + ref="table1" + :table-fields="tableFields" + :table-data="tableData" + :table-attr="tableAttr" + :table-height="tableHeight" + :table-field-click="tablefieldClick" + :is-highlight-row="isedit" + :is-show-index="false" + :filtersobj="filterObj" + :is-pagination="isPagination" + :is-within-edit-table-data="true" + + :isshowtool="false" + :isfilterfield="false" + :istablebuttons="false" + :isbasicfilterfields="false" + :isdraggableorder="false" + > + </h-table> + </div> + + <!-- 搴曢儴宸ュ叿鏍� --> + <div class="el-dialog__footer" style="margin-top: 0px;"> + <el-button size="small" type="default" @click="closeDialog">鍙� 娑�</el-button> + <el-button size="small" v-if="isedit" type="primary" @click="saveAfter">纭� 瀹�</el-button> + </div> + </div> + </div> + </div> + + <div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;"> + <div class="spinner"> + <div class="cube1"></div> + <div class="cube2"></div> + </div> + </div> + + </body> +</html> diff --git a/module/config/page/sys_menu_add.html b/module/config/page/sys_menu_add.html index 62289c6..cca28cc 100644 --- a/module/config/page/sys_menu_add.html +++ b/module/config/page/sys_menu_add.html @@ -50,6 +50,7 @@ dataRequestObj: {}, options_menumap: {}, options_menutree: [], + listoptions: [], //鎸夐敭鏉冮檺璁剧疆 isedit: false,//鎻愪氦鍓嶇紪杈戯紝淇濆瓨/鎻愪氦 @@ -80,6 +81,7 @@ 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 @@ -159,7 +161,8 @@ 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(); @@ -349,6 +352,9 @@ if (entity_.id) { entity.id = entity_.id } + else { + entity.id = createCode("M") + } let param = { dataname: this.dataname, @@ -360,6 +366,9 @@ if (me.pageid) { me.onRefreshCacheByPageId(me.pageid); } + else if (entity.id) { + me.onRefreshCacheByMenuId(entity.id); + } else { Root.message({ type: 'success', @@ -370,7 +379,7 @@ }); }, - // 鍒锋柊缂撳瓨 + // 鍒锋柊缂撳瓨椤甸潰 onRefreshCacheByPageId(PageId) { var me = this; let param_ = { @@ -383,6 +392,7 @@ 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({ @@ -395,6 +405,31 @@ }); }, + 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(); + }); + } + }); + } + } }); }; diff --git a/module/config/page/sys_menu_edit.html b/module/config/page/sys_menu_edit.html index 6d1abf3..2fcd2d7 100644 --- a/module/config/page/sys_menu_edit.html +++ b/module/config/page/sys_menu_edit.html @@ -43,7 +43,7 @@ { name: "sys_menunotpage", dataname: "sys_menu", - filter: " page_id is null", + filter: " page_id is null ", isnotoption: false, //true:涓嶆槸閫夐」 code:"id",//鏄笅鎷夐�夐」鏃惰缃� label:"name",//鏄笅鎷夐�夐」鏃惰缃� @@ -51,7 +51,7 @@ { name: "modelByPage", dataname: "sys_model", - filter: "is_detail='F'", + filter: "open_type='page'", isnotoption: false, //true:涓嶆槸閫夐」 code:"id",//鏄笅鎷夐�夐」鏃惰缃� label:"name",//鏄笅鎷夐�夐」鏃惰缃� @@ -59,7 +59,7 @@ { name: "modelBydetail", dataname: "sys_model", - filter: "is_detail='T'", + filter: "open_type in ('popup','tab')", isnotoption: false, //true:涓嶆槸閫夐」 code:"id",//鏄笅鎷夐�夐」鏃惰缃� label:"name",//鏄笅鎷夐�夐」鏃惰缃� @@ -92,7 +92,7 @@ {isshow: "T", field: "model_id", labelchinese: "妯″瀷閫夋嫨", inputtype: "select", optionsgroup: "", colspan: 1, group_name: "椤甸潰閰嶇疆", buttonarrayname: [{type: "", buttonname:"妯″瀷缁存姢", icon: "", code:"showfile", classname: "form_showfile"}]}, {isshow: "T", field: "dataname", labelchinese: "鏁版嵁瀵硅薄", inputtype: "", optionsgroup: "", group_name: "椤甸潰閰嶇疆", buttonarrayname: [{type: "", buttonname:"瀵硅薄缁存姢", icon: "", code:"showfile", classname: "form_showfile"}]}, {isshow: "T", field: "buttons", labelchinese: "鍔熻兘閫夋嫨", inputtype: "checkboxobj", optionsgroup: "", colspan: 2, group_name: "椤甸潰閰嶇疆"}, - {isshow: "T", field: "detail_model_id", labelchinese: "璇︽儏妯″瀷閫夋嫨", inputtype: "select", optionsgroup: "", colspan: 2, group_name: "椤甸潰閰嶇疆", labelwidth: "120", visiblefilterrule: "buttons锛欰dd銆丒dit銆丗ormDetail"}, + {isshow: "T", field: "detail_model_id", labelchinese: "璇︽儏妯″瀷閫夋嫨", inputtype: "select", optionsgroup: "", colspan: 2, group_name: "椤甸潰閰嶇疆", labelwidth: "120", visiblefilterrule: "buttons锛欰dd銆丒dit銆丗ormDetail", buttonarrayname: [{type: "", buttonname:"璇︽儏妯″瀷缁存姢", icon: "", code:"detail_model", classname: "form_showfile"},{type: "", buttonname:"璇︽儏椤甸厤缃�", icon: "", code:"popup_detail_model", classname: ""}]}, ], tableFields_table: [ @@ -134,7 +134,7 @@ }, created() { let clientHeight = document.documentElement.clientHeight; - this.tableHeight = clientHeight - 250 - 32; + this.tableHeight = clientHeight - 250 - 32 - 10; }, @@ -211,12 +211,14 @@ menuToPageTree(oldmenus) { var me = this; oldmenus.map(om=>{ - if (om.id && om.open_type && om.open_type == "arrange") { + + if (om.id && om.open_type && om.open_type == "arrange" && om.page_id) { om.isnot_nodeadd = true; // 鑺傜偣涓嶅彲鏂板 } - else if (om.id && !om.page_id) { + else if (om.id && !om.page_id ) { // om.isnot_nodeadd = true; // 鑺傜偣涓嶅彲鏂板 - om.isnot_nodeedit = true; // 鑺傜偣涓嶅彲鏀� + // om.isnot_nodeedit = true; // 鑺傜偣涓嶅彲鏀� + om.ishnodeadd = true; om.isnot_nodedel = true; // 鑺傜偣涓嶅彲鍒� } else { @@ -471,7 +473,7 @@ var parent_ids_ = []; var parent_ids = this.getParents(data_.parent_id, this.options_menumap, parent_ids_); - data_.parent_id = parent_ids + data_.parent_id = parent_ids_ } data_.buttons = [] data_.detail_model_id = "" @@ -514,6 +516,21 @@ delta: {}, sceneCode: "add",//"refuseedit",//"approval", //"add"//"browse", callback: function(obj, callback) { + me.options_menutree = clone(obj.treeoptions) + var sys_menunotpage_ = clone(obj.listoptions); + me.options_menumap = {} + sys_menunotpage_.map(m=>{ + me.options_menumap[m.id] = m; + }) + + var formFields_ = clone(me.formFields) + formFields_.map(f=>{ + if(f.field == "parent_id") { + f.options = (me.options_menutree) + } + }) + me.formFields = clone(formFields_) + me.getMenuAll(); if (callback) { callback(); @@ -535,6 +552,19 @@ data: data, sceneCode: "edit", callback: function(options_obj, callback) { + me.options_menutree = clone(obj.treeoptions) + var sys_menunotpage_ = clone(obj.listoptions); + me.options_menumap = {} + sys_menunotpage_.map(m=>{ + me.options_menumap[m.id] = m; + }) + var formFields_ = clone(me.formFields) + formFields_.map(f=>{ + if(f.field == "parent_id") { + f.options = (me.options_menutree) + } + }) + me.formFields = clone(formFields_) me.getMenuAll(); if (callback) { callback(); @@ -615,6 +645,35 @@ }, }, + detail_model_id: { + buttonarray: { + onclick: function(obj) { + if (obj.buttonobj.code == "popup_detail_model") { + let sceneCode = "add" + var config = { + totab: false, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + width: "900px", + height: "500px", + icon: "icon-product", + text: "缂栬緫椤甸厤缃�", + id: "popup_tablefield_edit" + sceneCode,//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� + url: "module/config/page/popup/popup_tablefield_edit.html", + dataname: me.dataname, + data: {}, + delta: {dataname: me.dataname, tabledata: me.tableData, tablefields: me.tableFields_form}, + sceneCode: sceneCode,//"refuseedit",//"approval", //"add"//"browse", + callback: function(obj, callback) { + me.tableData = clone(obj.tableData) + if (callback) { + callback(); + } + } + }; + me.doPopupByPublic(config); + } + }, + }, + }, model_id: { buttonarray: { onclick: function(obj) { @@ -625,7 +684,7 @@ onchange: function(obj,row,callback) { //涓嬫媺灞曞紑浜嬩欢 let param_ = { dataname: "sys_model",//鑾峰彇缁忛攢鍟嗗搴旀敹璐у湴鍧� - filter:"is_detail='F'", + filter:"open_type='page'", } Server.call("root/data/getEntitySet", param_, function(result) { if (result && result.data && result.data.entityset) { @@ -756,6 +815,19 @@ delta: {}, sceneCode: "addmenu",//"refuseedit",//"approval", //"add"//"browse", callback: function(obj, callback) { + me.options_menutree = clone(obj.treeoptions) + var sys_menunotpage_ = clone(obj.listoptions); + me.options_menumap = {} + sys_menunotpage_.map(m=>{ + me.options_menumap[m.id] = m; + }) + var formFields_ = clone(me.formFields) + formFields_.map(f=>{ + if(f.field == "parent_id") { + f.options = (me.options_menutree) + } + }) + me.formFields = clone(formFields_) me.getMenuAll(); if (callback) { callback(); @@ -770,7 +842,7 @@ var entity_ = clone(this.formData); var entity_menu = { id: entity_.id, - parent_id: entity_.parent_id, + parent_id: entity_.parent_id[entity_.parent_id.length - 1], icon: entity_.icon, title: entity_.title }; @@ -845,6 +917,7 @@ last_update_time: datetime_, label_chinese: r.label_chinese, is_list: r.is_list ? r.is_list : false, + is_form: r.is_form ? r.is_form : false, is_filter: r.is_filter ? r.is_filter : false, list_order_no: r.list_order_no ? r.list_order_no : 0, form_order_no: r.form_order_no ? r.form_order_no : 0, @@ -984,6 +1057,11 @@ position: relative; padding-left: 20px; } + .h_form_group { + height: 32px; + line-height: 32px; + margin-top: 5px !important; + } </style> </head> @@ -1035,7 +1113,7 @@ </div> </div> - <div style="margin: 16px;"> + <div style="margin: 0 10px;"> <h-form ref="form1" :form-attr="formAttr" diff --git a/module/model/page/table_simple.html b/module/model/page/table_simple.html index 2f4cbc0..63f83fd 100644 --- a/module/model/page/table_simple.html +++ b/module/model/page/table_simple.html @@ -69,7 +69,10 @@ me.dataRequestObj = data; //棰勫姞杞芥暟鎹悗缁欏摢浜涘瓧娈佃缃畂ptions鎴杅ormatterjson if (me.dataRequestObj.sys_model) { - me.sys_model_map = me.dataRequestObj.sys_model.map.sys_model; + + me.dataRequestObj.sys_model.map(m=>{ + me.sys_model_map[m.id] = m + }) } if (me.dataRequestObj.sys_page_model) { @@ -232,14 +235,26 @@ editData(sceneCode, row) { var me = this; + let url = ""; + let totab = true; + if (me.detail_model_id && me.sys_model_map[me.detail_model_id]) { + url = me.sys_model_map[me.detail_model_id].url; + } + if (!url) { + return + } + if (me.sys_model_map[me.detail_model_id].open_type == "popup") { + totab = false; + } + var config = { - totab: true, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� + totab: totab, //true: 浠ab瀵艰埅鐨勬柟寮忔墦寮� width: "900px", height: "500px", icon: "icon-product", text: me.title + "璇︽儏", id: "popup_form_simple" + sceneCode + row.id,//totab: true鏃堕渶璁剧疆锛岀敤浜庡垽鏂槸鍚﹀凡鎵撳紑姝ら〉闈� - url: "module/model/page/popup_form_simple.html", + url: url, //"module/model/page/popup_form_simple.html", dataname: me.dataname, data: row, delta: {dataname: me.dataname}, diff --git a/module/system/page/main.html b/module/system/page/main.html index 08db079..01b1e9d 100644 --- a/module/system/page/main.html +++ b/module/system/page/main.html @@ -7,27 +7,27 @@ <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Cache" content="no-cache"> <title>钀ラ攢涓�浣撳寲杩愯惀骞冲彴</title> - <link href="../css/main.css?v=2024082502" rel="stylesheet"> - <link href="../../../css/control.css?v=2024082502" rel="stylesheet"> - <link href="../../../css/page.css?v=2024082502" rel="stylesheet"> - <link href="../../../css/icon/iconfont.css?v=2024082502" rel="stylesheet"> + <link href="../css/main.css?v=2024082602" rel="stylesheet"> + <link href="../../../css/control.css?v=2024082602" rel="stylesheet"> + <link href="../../../css/page.css?v=2024082602" rel="stylesheet"> + <link href="../../../css/icon/iconfont.css?v=2024082602" rel="stylesheet"> <link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet"> <link href="../../../img/org/head.png" rel="shortcut icon" type="image/x-icon"> - <link href="../../../css/myelement.css?v=2024082502" rel="stylesheet"> + <link href="../../../css/myelement.css?v=2024082602" rel="stylesheet"> <script src="../../../js/jquery-3.5.1.min.js"></script> <script src="../../../js/vue/vue.js"></script> - <script src="../../../js/config.js?v=2024082502"></script> + <script src="../../../js/config.js?v=2024082602"></script> <script src="../../../data/data.js"></script> <script src="../../../js/vue/elementDefault.js"></script> <script src="../../../js/vue/element-ui/lib/index.js"></script> <script src="../../../js/Sortable.js"></script> - <script src="../../../js/vue/page.js?v=2024082502"></script> - <script src="../../../js/foundation.js?v=2024082502"></script> - <script src="../../../js/control.js?v=2024082502"></script> + <script src="../../../js/vue/page.js?v=2024082602"></script> + <script src="../../../js/foundation.js?v=2024082602"></script> + <script src="../../../js/control.js?v=2024082602"></script> <script src="../../../js/loadJsCss.js"></script> - <script src="../../../js/myelement.js?v=2024082502"></script> + <script src="../../../js/myelement.js?v=2024082602"></script> </head> -- Gitblit v1.8.0