1.修复ajaxFileUpload无法使用新版jq的bug

2.修复BaseDao删除功能的bug
master
星期八 6 years ago
parent 3881fe91fa
commit a9d2da6c2b
  1. 4
      src/main/java/com/lq/code/dao/BaseDao.java
  2. 2
      src/main/resources/mybatis/mapping/WechatKeywordDao.xml
  3. 2
      src/main/resources/mybatis/mapping/WechatMessageDao.xml
  4. 2
      src/main/resources/mybatis/mappingTemplate.xml
  5. 2
      src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp
  6. 10
      src/main/webapp/WEB-INF/views/jsp/cms/wechat/message/edit.jsp
  7. 8
      src/main/webapp/WEB-INF/views/jsp/cms/wechat/message/index.jsp
  8. 3
      src/main/webapp/WEB-INF/views/jsp/cms/wechat/rule/index.jsp
  9. 10
      src/main/webapp/resources/code/js/ajaxfileupload.js

@ -1,5 +1,7 @@
package com.lq.code.dao;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -39,7 +41,7 @@ public interface BaseDao<T> {
* 删除一条数据
* @param id
*/
void delete(Long id);
void delete(@Param("id") Long id);
/**
* 批量保存数据

@ -59,7 +59,7 @@
<update id="delete" parameterType="Long">
UPDATE
FROM wechat_keyword
wechat_keyword
SET
status = 0
WHERE

@ -64,7 +64,7 @@
<update id="delete" parameterType="Long">
UPDATE
FROM wechat_message
wechat_message
SET
status = 0
WHERE

@ -53,7 +53,7 @@
<update id="delete" parameterType="Long">
UPDATE
FROM @tableName
@tableName
SET
status = 0
WHERE

@ -155,7 +155,7 @@
}
}});
}
})
});
}
function getRoleArray() {
var roleList=new Array();

@ -69,10 +69,10 @@
</table>
</div>
</body>
<script type="text/javascript" href="${ctx}/resources/cms/wechat/wechat.js"/>
<script type="text/javascript">
$(function () {
$('#file').on('change', function() {//当chooseImage的值改变时,执行此函数
$('#file').bind('change', function() {//当chooseImage的值改变时,执行此函数
var filePath = $(this).val(), //获取到input的value,里面是文件的路径
fileFormat = filePath.substring(filePath.lastIndexOf(".")).toLowerCase(),
src = window.URL.createObjectURL(this.files[0]); //转成可以在本地预览的格式
@ -92,8 +92,12 @@
$("#messageType").val(messageType);
}
showMessageTypeInput(messageType);
if (messageType=='2'||messageType=='3'){
$('#cropedBigImg').css('display','block');
$('#cropedBigImg').attr('src', '${ctx}/loadFile/${wechatMessage.imageUrl}');
}
$("#messageType").on("change",function () {
$("#messageType").bind("change",function () {
var messageType = $(this).val();
showMessageTypeInput(messageType);
})

@ -12,7 +12,7 @@
<title>微信公众号管理后台-消息</title>
<link rel="stylesheet" type="text/css" href="${ctx}/resources/code/easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/resources/code/easyui/themes/icon.css" />
<script type="text/javascript" src="${ctx}/resources/code/js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/code/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${ctx}/resources/code/easyui/jquery.easyui.min.1.2.2.js"></script>
<script type="text/javascript" src="${ctx}/resources/plugins/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/resources/code/js/ajaxfileupload.js"></script>
@ -109,10 +109,12 @@
}
function del(id) {
$.messager.confirm('消息提醒','确定是否删除该项数据?',function (result) {
var url = 'delete';
var obj = new Object();
obj.id = id;
get(url,obj);
});
}
function get(url,obj) {
@ -139,14 +141,14 @@
fileElementId:"file",
data:obj,
success:function(result){
console.log(result);
if(result.success==true){
$.messager.alert('提醒','提交成功','warning');
$("#editDate").dialog('close');
$('#dataList').datagrid('reload',{});
}
}});
}
});
}
</script>

@ -680,10 +680,7 @@
// var resultFul = messageSet.delete(messageid);
bufferSet.delete(messageid);
}
}
</script>
</html>

@ -219,11 +219,13 @@ jQuery.extend({
// If you add mimetype in your response,
// you have to delete the '<pre></pre>' tag.
// The pre tag in Chrome has attribute, so have to use regex to remove
var data = r.responseText;
var rx = new RegExp("<pre.*?>(.*?)</pre>","i");
var am = rx.exec(data);
////////////以下为新增代码///////////////
// var data = r.responseText;
// var rx = new RegExp("<pre.*?>(.*?)</pre>","i");
// var am = rx.exec(data);
//this is the desired data extracted
var data = (am) ? am[1] : ""; //the only submatch or empty
// var data = (am) ? am[1] : ""; //the only submatch or empty
eval( "data = " + data );
}
// evaluate scripts within html

Loading…
Cancel
Save