jeecg框架日常开发问题解决方法
生活随笔
收集整理的這篇文章主要介紹了
jeecg框架日常开发问题解决方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原文:https://my.oschina.net/matt0614/blog/822225
摘要: 用這個框架,發現好多問題,記錄下來,以后做項目減少查找問題時間,此文章會不定期更新。。。
啟動報錯
The argument does not represent an annotation type: ContextConfiguration
org.jeecgframework.core.junit.AbstractUnitTest 類的依賴類 需要導入本地junit4 測試包 圖片保存相對路徑
把表單的圖片字段設置為text類型 生成代碼后,多選框 報錯問題。修改DictSelectTag類,在272行加入
if(this.defaultVal==null){this.defaultVal="";
}
4.表格id轉名稱 屬性
dictionary="GCCJ_TASK_ASSIGNMENT,ID,TASK_NAME"? jeecg框架添加三級菜單支持org.jeecgframework.core.util.ListtoMenu 類 修改 如下方法
private static String getHplusSubMenu(TSFunction parent, int level, Map<Integer, List<TSFunction>> map) {StringBuffer menuString = new StringBuffer();List<TSFunction> list = map.get(level);for (TSFunction function : list) {if (function.getTSFunction().getId().equals(parent.getId())){if (!function.hasSubFunction(map)) {menuString.append(getLeafOfHplusTree(function));} else {//增加多級菜單顯示menuString.append("<li>");menuString.append("<a href=\"#\" >");menuString.append(getMutiLang(function.getFunctionName()));menuString.append("<span class=\"fa arrow\"></span>");menuString.append("</a><ul class=\"nav nav-third-level\" >");menuString.append(getHplusSubMenu(function,level+1,map));menuString.append("</ul></li>");}}}return menuString.toString();}
只支持H+平面風格,其他的風格你可以參考上面的代碼進行修改 在jeecg中實現多表關聯查詢?
http://www.jeecg.org/forum.php?mod=viewthread&tid=3063&fromuid=8256 怎么在頁面當中打開一個新的tab頁面?
curdtool*.js通用js里面有方法 addoneTab JEECG通用文件上傳-彈出式(覺得文件上傳不好用的來看)
http://www.jeecg.org/forum.php?mod=viewthread&tid=935&extra=page%3D38?
commonUpload函數在 代碼生成的對應頁面的 .js 文件中 按鈕中獲取選中記錄的字段值function resetPassword() {var row = $('#tSBaseUserList').datagrid('getSelections')[0];if (row == undefined) {alertTip('請選擇需要重置的記錄', '提示');return;}var userName, password;userName = row.username;password = '123456';var url = 'userController.do?userUpdate4App&userName=' + userName + '&password=123456';$.dialog.confirm('是否重置密碼為 123456 ?', function () {$.ajax({async: false,cache: false,type: 'POST',dataType: 'json',url: url,// 請求的action路徑error: function () {// 請求失敗處理函數},success: function (data) {if (data.success) {$.messager.show({title: '提示信息',msg: '密碼重置成功,默認密碼為123456',timeout: 1000 * 5});} else {$.messager.show({title: '提示信息',msg: data.msg,timeout: 1000 * 3});}}});}, function () {});
} maven地址
?找到 maven老家 conf/settings.xml,
??在<mirrors>標簽內增加阿里云maven鏡像 最終結果見下面:
??<mirrors>
? ?? ? <mirror>
? ?? ?? ?? ?? ?? ?? ?? ?<id>nexus-aliyun</id>
? ?? ?? ?? ?? ?? ?? ?? ?<mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>
? ?? ?? ?? ?? ?? ?? ?? ?<name>Nexus aliyun</name>
? ?? ?? ?? ?? ?? ?? ?? ?<url>http://maven.aliyun.com/nexus/content/groups/public</url>
? ?? ???</mirror>?
? ? </mirrors>
??然后執行maven命令,享受一下mvn時飛的感覺;
??備注: 配置了鏡像,默認所有的依賴都只會去鏡像下載,所以你這邊如果也有自己的私服,可以參考jeecg方式排除一下,不然不會從自己的私服去下載私有的依賴。 彈窗默認最大化<t:dgToolBar title="任務錄入" icon="icon-add" url="gccjTaskAssignmentController.do?goAdd" funname="add" width="100%" height="100%"></t:dgToolBar>
解決彈窗被菜單遮蓋問題:
1.修改 plug-in/tools/curdtools_zh-cn.js 里getzIndex()方法
setCookie("ZINDEXNUMBER",2980);
zindexNumber = 2980;
2.修改 org.jeecgframework.web.system.controller.core.LoginController
Cookie zIndexCookie = new Cookie("ZINDEXNUMBER", "2990"); 彈出窗口增加按鈕
重寫plug-in/tools/curdtools_zh-cn.js文件中createdetailwindow方法(重命名),復制重寫的方法到對應的 *-list文件中,修改錄入、修改、查看或者刪除方法的調用方法名為重寫的方法
彈窗組件API 參考網址 http://www.lhgdialog.com/ 獲取當前登錄用戶信息TSUser user = ResourceUtil.getSessionUserName(); 獲取當前日期String date = DateUtils.date2Str(new Date(), DateUtils.date_sdf); rest風格請求地址調用方法
例如:
查詢list :http://localhost:8080/系統名稱/rest/tZzxtDictionaryController/
查詢1條數據:http://localhost:8080/系統名稱/rest/tZzxtDictionaryController/{id}
其他方法去對應的controller里面找 修改系統title
系統管理->國際化語言 菜單
語言key:?jeect.platform? 修改彈出框為layer彈出框
BaseTag.java 加入js庫if (oConvertUtils.isIn("tools", types)) {。。。。。。。。。。省略sb.append("<script type=\"text/javascript\" src=\"plug-in/layer/layer.js\" ></script>");}修改createwindow方法,加入此代碼
加入該方法//layer新增窗口 function addLayer(title, addurl,width,height){layer.open({type: 2,maxmin:true,title: title,shadeClose: true,shade: 0.8,fixed:false,resize:true,scrollbar:false,parent:windowapi,area: [width,height],content: addurl, //iframe的urlbtn:['確定','關閉'],yes:function(index, layero){// iframe = this.iframe.contentWindow;// iframe = layero.find('iframe')[0];iframe = window[layero.find('iframe')[0]['name']];console.log(iframe.document);saveObj();// $('#btn_sub', iframeWin.document).click();// console.log(form);// $('#btn_sub',document).click();layer.close(index);tip('操作成功');reloadTable();}}); }效果圖:
上面有BUG,就是有的框內內容,沒有滾動條,暫時不知道怎么解決,刷新體驗也有點差,有知道的大神,請賜教!
The argument does not represent an annotation type: ContextConfiguration
org.jeecgframework.core.junit.AbstractUnitTest 類的依賴類 需要導入本地junit4 測試包
把表單的圖片字段設置為text類型
?
?
http://www.jeecg.org/forum.php?mod=viewthread&tid=3063&fromuid=8256
curdtool*.js通用js里面有方法 addoneTab
http://www.jeecg.org/forum.php?mod=viewthread&tid=935&extra=page%3D38?
commonUpload函數在 代碼生成的對應頁面的 .js 文件中
?找到 maven老家 conf/settings.xml,
??在<mirrors>標簽內增加阿里云maven鏡像 最終結果見下面:
??<mirrors>
? ?? ? <mirror>
? ?? ?? ?? ?? ?? ?? ?? ?<id>nexus-aliyun</id>
? ?? ?? ?? ?? ?? ?? ?? ?<mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>
? ?? ?? ?? ?? ?? ?? ?? ?<name>Nexus aliyun</name>
? ?? ?? ?? ?? ?? ?? ?? ?<url>http://maven.aliyun.com/nexus/content/groups/public</url>
? ?? ???</mirror>?
? ? </mirrors>
??然后執行maven命令,享受一下mvn時飛的感覺;
??備注: 配置了鏡像,默認所有的依賴都只會去鏡像下載,所以你這邊如果也有自己的私服,可以參考jeecg方式排除一下,不然不會從自己的私服去下載私有的依賴。
來源:?http://www.jeecg.org/forum.php?mod=viewthread&tid=3949&extra=page%3D1
?
重寫plug-in/tools/curdtools_zh-cn.js文件中createdetailwindow方法(重命名),復制重寫的方法到對應的 *-list文件中,修改錄入、修改、查看或者刪除方法的調用方法名為重寫的方法
彈窗組件API 參考網址 http://www.lhgdialog.com/
?
例如:
查詢list :http://localhost:8080/系統名稱/rest/tZzxtDictionaryController/
查詢1條數據:http://localhost:8080/系統名稱/rest/tZzxtDictionaryController/{id}
其他方法去對應的controller里面找
系統管理->國際化語言 菜單
語言key:?jeect.platform?
BaseTag.java 加入js庫if (oConvertUtils.isIn("tools", types)) {。。。。。。。。。。省略sb.append("<script type=\"text/javascript\" src=\"plug-in/layer/layer.js\" ></script>");}修改createwindow方法,加入此代碼
加入該方法//layer新增窗口 function addLayer(title, addurl,width,height){layer.open({type: 2,maxmin:true,title: title,shadeClose: true,shade: 0.8,fixed:false,resize:true,scrollbar:false,parent:windowapi,area: [width,height],content: addurl, //iframe的urlbtn:['確定','關閉'],yes:function(index, layero){// iframe = this.iframe.contentWindow;// iframe = layero.find('iframe')[0];iframe = window[layero.find('iframe')[0]['name']];console.log(iframe.document);saveObj();// $('#btn_sub', iframeWin.document).click();// console.log(form);// $('#btn_sub',document).click();layer.close(index);tip('操作成功');reloadTable();}}); }效果圖:
上面有BUG,就是有的框內內容,沒有滾動條,暫時不知道怎么解決,刷新體驗也有點差,有知道的大神,請賜教!
總結
以上是生活随笔為你收集整理的jeecg框架日常开发问题解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 排序单链表反转
- 下一篇: Jeewx 捷微管家操作配置文档(开源版