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

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

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

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

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

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

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

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

@ -219,11 +219,13 @@ jQuery.extend({
// If you add mimetype in your response, // If you add mimetype in your response,
// you have to delete the '<pre></pre>' tag. // you have to delete the '<pre></pre>' tag.
// The pre tag in Chrome has attribute, so have to use regex to remove // 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 //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 ); eval( "data = " + data );
} }
// evaluate scripts within html // evaluate scripts within html

Loading…
Cancel
Save