1.Caused by: java.sql.SQLException: Field 'supc_code' doesn't have a default valuejavascript
答:前端没有加css
<div class="form-group">
<label class="col-sm-3 control-label">供应商分类编码:</label>
</dive>
2.如何以登陆人作为默认的值存储到数据库
前端:
<input id="createBy" name="createBy" class="form-control" type="text" readonly="true" th:value="${createBy}"/>
后台:
mmap.put("createBy", ShiroUtils.getLoginName() );
3.修改父类供应商分类parentcode时,弹出供应商分类树
500
内部服务器错误!
4.树形目目录没法显示:
http://localhost:8013/basicsetting/supplierCategory/selectSupplierCategoryTree/02
经过调试对比departController.java,departserviceImpl.java发现
*
* @param supplierCategory 供应商分类信息
* @return 供应商分类集合
*/
@Override
@DataScope(tableAlias = "d")-----少这行
@return 全部供应商分类信息
*/
@Override
public List<Map<String, Object>> selectSupplierCategoryTree() {
List<Map<String, Object>> trees = new ArrayList<~>();------不知为何变化??
--------小孔指导是
5.树形目录选择完后,没法获得当前选择结点:孔
<select id="selectSupplierCategoryById" parameterType="String" resultMap="SupplierCategoryResult">
select c.supc_code,c.supc_name, c.parent_code, c.ancestors, c.sort, c.status, c.del_flag, c.create_by, c.create_time, c.update_by, c.update_time,
IFNULL(p.supc_name,"供应商分类") as parent_name
from basic_supplier_category c
left join basic_supplier_category p on c.parent_code = p.supc_code
where c.supc_code = #{supcCode}
</select>
6.父结点祖级列表输出语句
自:
update SupplierCategory set ancestors =
<foreach collection="SupplierCategorys" item="item" index="index"
separator=" " open="case supc_code" close="end">
when #{item.supc_code} then #{item.ancestors}
</foreach>
where supc_code in
<foreach collection="SupplierCategorys" item="item" index="index"
separator="," open="(" close=")">
#{item.supc_code}
</foreach>
</update>
7.没法删除供应商分类编码del_flag=2-随然提示保存成功
自:suppliercategoryMapper<if test="delFlag = '0' "> and del_flag = #{delFlag}</if>
8.没法点开父供应商份类增长父供应商Code界面
9 如何集成jqgrid编辑插件
1.在index.html文件中<!--jqgrid注:ruoyi\前端框架\Hplus-master\Hplus-master\web\js\plugins-->
<script th:src="@{/libs/jqgrid/jquery.jqGrid.minffe4.js}"></script>
2.
10.二维数组表示
var arrEle1 = new Array("1","0","1","0");
var arrEle2 = new Array("1","1","0","1");
var arrEle3 = new Array("1","0","1","1");
//建立二维数组
var myArr = new Array();
myArr[0]=arrEle1;
myArr[1]=arrEle2;
myArr[2]=arrEle3;
document.write("myArr[0][0]=",myArr[0,0],"<br>");
document.write("myArr[1][1]=",myArr[1,1],"<br>");
document.write("myArr[2][1]=",myArr[2,2],"<br>");
另外一种表示方法
document.writeln(str);
function num(arr){
for (var i = 0; i < a.length; i++) {
for (var j = 0; j< 4; j++) {
alert(a[i][j]);
}
}
}
var a=[[1,0,1,0],[1,1,0,1],[1,0,1,1]];
num(a);
11. 调试
12.不显示删除恢复按钮
- del_flag != 2
+ <if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
13. themleaf拼接字符串<td th:text="${info}+'str'"></td>Checked 回显赋给数组Thymeleaf下拉框回显:html
<div class="form-group draggable"> <label class="col-sm-3 control-label">bizMch:</label> <div class="col-sm-8"> <select class="form-control" name="bizMchId" id="bizMchId"> <option th:each="bizMch:${list}" th:selected="${bizMch.bizMchId==homeMap.bizMchId}" th:value="${bizMch.bizMchId}" th:text="${bizMch.name}" ></option> </select> </div> </div>下拉框(session版):前端
<div class="form-group draggable"> <label class="col-sm-3 control-label">bizMch:</label> <div class="col-sm-8"> <select class="form-control" name="bizMchId" id="bizMchId"> <option th:each="list:${session.list}" th:value="${list.bizMchId}" th:text="${list.name }"></option> </select> </div> </div>1.thymeleaf 标签获取 contextPath:java
<script type="text/javascript" th:inline="javascript"> /*<![CDATA[*/ contextPath = /*[[@{/}]]*/ ''; /*]]>*/ </script>二、thymeleaf 循环标签jquery
<tr th:each="info:${list}">info 为循环变量,在循环中使用info点属性便可git
三、thymeleaf 使用 href标签带参数:github
<a class="acicon" th:href="@{/attendanceRecord/userAttendanceRecordListPage(userInfoId=${attendanceRecordDTO.userInfoId})}">四、thymeleaf 中将值传给 事件函数:web
<a class="acicon" ><img th:src="@{/img/common/listedit.png}" th:name="${userInfo.userInfoId}" onclick="editUserInfoPage(this)"/></a>而后 $(this).attr('name');获取name的值 这个方法有点臃肿 不过能实现ajax
五、循环给select 赋值:
<select name="areaInfoId" class="selectpicker" onchange="setCity(this)"> <option>请选择省</option> <option th:each="areaInfo : ${areaInfos}" th:value="${areaInfo.areaInfoId}" th:text="${areaInfo.areaName}"></option> </select>六、给select动态选中:
<select name="enableFlag" class="selectpicker" onchange="setAreaName()"> <option value="true" th:if="${userInfo.enableFlag ==true}" th:selected="selected">是</option> <option value="false" th:if="${userInfo.enableFlag ==false}" th:selected="selected">否</option> <option value="true" th:if="${userInfo.enableFlag ==false}">是</option> <option value="false" th:if="${userInfo.enableFlag ==true}">否</option> </select>七、路径信息:
<script type="text/javascript" th:src="@{/js/basis/jquery/jquery-1.10.2.min.js}"></script><link rel="stylesheet" type="text/css" th:href="@{/style/basis/bootstrap/bootstrap3.min.css}"/>八、字符串拼接:
<td th:text="${info}+'str'"></td>注意双引号是必需要有的
九、使用thymeleaf控制 单选框
<ul> <li class="fl"> <input type="radio" name="enableFlag" th:checked="${userInfo.enableFlag== true}" value="true" style="margin: 10px;"/> <label class="iRadioLable" style="width:auto; max-width:auto;margin: 0">是</label> </li> <li class="fl"> <input type="radio" name="enableFlag" th:checked="${userInfo.enableFlag==false}" value="false" style="margin: 10px"/> <label class="iRadioLable" style="width:auto; max-width:auto;margin: 0">否</label> </li> </ul>十、thymeleaf中使用三目运算
<td th:text="${imposeOccupyInfo.certificateCode== null} ? '-':${imposeOccupyInfo.certificateCode}"></td>十一、thymeleaf中动态控制class 样式
<li th:class="${enterpriseInfo.creditGrade gt iterStat.index}?'start':''"></li>十二、thymeleaf中使用时间格式化
<td th:text="${#dates.format(enterpriseInfo.insertTime,'yyyy-MM-dd')}"></td>13.radio回显
<div class="form-group"> <label class="col-sm-3 control-label">settleType:</label> <div class="col-sm-8"> <label class="radio-inline"> <input th:field="*{merchant.settleType}" type="radio" name="settleType" value="1" checked> open </label> <label class="radio-inline"> <input th:field="*{merchant.settleType}" type="radio" name="settleType" value="2"> close </label> </div> </div>切割
<div class="form-group col-md-6"> <label for="name">FIRST NAME</label> <input type="text" class="form-control" id="name" name="firstName" th:value="${#strings.arraySplit(adminUser.name,' ')[1]}" readonly> </div> <div class="form-group col-md-6"> <label for="name">FAMILY NAME</label> <input type="text" class="form-control" id="nickname" name="familyName" th:value="${#strings.arraySplit(adminUser.name,' ')[0]}" readonly> </div>
13. 如何循环获得themleaf value中的值
<tr
class="whauthtr"
align="center" style="word-break: break-all; border-width: 1px; border-style: solid;" th:each="wh : ${warehouse}">
<td style="word-break: break-all; border-width: 1px; border-style: solid;" class="whid" th:text="*{wh.whId}"></td>
14 前台获取themleaf 的二维数组值
function submitHandler() {
var array = new Array();
$('#whauthtable tr.whauthtr').each(function () {
var whid = $(this).children('td.whid').text();
var arrayAuth = [];
arrayAuth.push($(this).find('input[name="authView"]').is(':checked') == true ? 1 : 0);
arrayAuth.push($(this).find('input[name="authAdd"]').is(':checked') == true ? 1 : 0);
arrayAuth.push($(this).find('input[name="authEdit"]').is(':checked') == true ? 1 : 0);
arrayAuth.push($(this).find('input[name="authRemove"]').is(':checked') == true ? 1 : 0);
var auth = arrayAuth.join('');
if(auth!='0000'){
array.push({
"whId": whid,
"wahousAuthMask": auth
});
}
});
$.ajax({
type : "POST",
url : prefix + "user/warehouseauth",
data : {
"authStrs":JSON.stringify(array),
"userId": $('#userId').val()
},
dataType:"json",
error : function(request) {
$.modal.alertError("系统错误");
},
success : function(data) {
$.operate.successCallback(data);
}
});
}
15 后台转josn 为list对象
答:在warehouseserviceimpl.java
//操做使用fastjson进行字符串对象转换
List<WarehouseAuth> WarehouseAuthList = new ArrayList<>();
JSONArray jsonArray= JSONArray.parseArray(authStrs);
for(int i = 0; i < jsonArray.size(); i++){
JSONObject jsonResult = jsonArray.getJSONObject(i);
WarehouseAuth warehouseAuth = JSONObject.toJavaObject(jsonResult,WarehouseAuth.class);
warehouseAuth.setUserId(userId);
warehouseAuth.setCreateBy(ShiroUtils.getLoginName());
WarehouseAuthList.add(warehouseAuth);
}
warehouseAuthMapper.deleteWarehouseAuthByUserId(userId);
return warehouseAuthMapper.insertUserWarehouseAuthMask(WarehouseAuthList);
16 行内编辑
https://blog.csdn.net/hanxintong9/article/details/47084777
<span style="font-family:KaiTi_GB2312;font-size:18px;"> numId.click(function () { var tdObj = $(this); var text = tdObj.html(); tdObj.html(""); var inputObj = $("<input type='text'>").css("border-width", "0") .css("font-size", "16px").width(tdObj.width()) .css("background-color", tdObj.css("background-color")) .val(text).appendTo(tdObj); //是文本框插入以后被选中 inputObj.get(0).select(); inputObj.click(function () { return false; }); //处理文本框上回车和esc按键的操做 inputObj.keyup(function (event) { //获取当前按下键盘的键值 //处理回车的状况 var keycode = event.which if (keycode == 13) { var inputtext = $(this).val(); tdObj.html(inputtext); } if (keycode == 27) { tdObj.html(text); } }); });</span>
17.如何在datagrid、bootstrap-table、datatable选择插件
1.datagrid在github 用的比较少,datatable用的比bootstrap要多
2.datatable 用到jquerytable
bootstrap-table 用用bootstrap
而datagrid用到是easyui里面的集成插件
3.daner用的是录入明细时,选择一种便捷的录入方式,尽可能是在一个界面完成(参
考datatable);
4.H+ 自己支持bootstrap-table,rouyi也推荐bootstrap-table
下载:
以前版本
https://cdn.datatables.net/releases.html
18 Cannot read property 'style' of undefined TypeError: Cannot read property 'style' of undefined
datatables edittables -行编辑器插件测试发生错误
答:在您的代码中。您试图访问未定义变量的属性。您能够从那里调试。
https://stackoverflow.com/questions/39376658/datatables-cannot-read-property-style-of-undefined#
19 DataTables warning: table id=podetail - Ajax error. For more information about this error, please see http://datatables.net/tn/7
主要是json数据存放路径不对,应放在静态文件夹下,老牛指导:
19 DataTables warning: table id=podetail - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
json 传数据类型不对
json 写这样
{
"data": [
[
"001"
]
]
}
20 http://localhost:8089/po/po/potestajaxedittab
Error in event handler for (unknown): SyntaxError: Unexpected token <
是因为浏览器安装了百度插件
21 设备类别分类没法展开
老牛:主要是前端页面问题
bootstrap-tree-table 原来写为bootstrap-table
22 想三级联动把规格带出
23.回车到下一个输入框
//回车后跳到下一个输入框
function focusNextInput(thisInput)
{
var inputs = document.getElementsByTagName("input");
for(var i = 0;i<inputs.length;i++){
// 若是是最后一个,则焦点回到第一个
if(i==(inputs.length-1)){
inputs[0].focus(); break;
}else if(thisInput == inputs[i]){
inputs[i+1].focus(); break;
}
}
}
'data': 'specification', 'title': '规格 ', render: function (data, type, row, meta) { return '<input type="text" name="specification" onfocus="autofull(this,\'/basic/part/list\',\'specification\',\'specification\',' + meta.row + ');"/>'