2 回答

TA貢獻(xiàn)1840條經(jīng)驗(yàn) 獲得超5個(gè)贊
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <%--預(yù)警規(guī)則添加處理begin--%> function addRule() { //指標(biāo) var iid = $("#showIndicator").combobox("getValue"); //周期 var aid = $("#showPeriod").combobox("getValue"); //描述 var ds = $("#showRuleDesc").val(); $.ajax({ type : "POST", url : "addRule.action",// 請(qǐng)求的url data : { "indicatorId" : iid, "alarmPeroidsTypeId" : aid, "ruleDesc" : ds }, dataType : "json", success : function() { $.messager.alert("提示","保存成功!"); $("#addRuleDiv").dialog("close"); }, error : function() { alert("錯(cuò)誤!"); } });
} <%--預(yù)警規(guī)則添加處理end--%> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /** * 添加預(yù)警信息 * @see [類、類#方法、類#成員] */ public void addRule() { AlarmRules rule = new AlarmRules(); long num = System.currentTimeMillis(); ruleId = "R" + num; rule.setAlarmRuleId(ruleId); rule.setAlarmPeriodsTypeId(alarmPeroidsTypeId); rule.setAlarmIndicatorId(indicatorId); rule.setAlarmRuleDesc(ruleDesc);
//添加數(shù)據(jù) ruleConfigService.insertRules(rule); } |

TA貢獻(xiàn)1951條經(jīng)驗(yàn) 獲得超3個(gè)贊
前臺(tái):
1 2 3 4 5 6 7 8 9 10 11 | jQuery.ajax( { type : 'POST', url : '/cloud-web/getMember.htm', cache: false, data : {"groupId": groupid}, dataType : 'json', success : function(data) { //成功后回調(diào)回來(lái)所執(zhí)行的代碼 error: function(data){ } }); |
后臺(tái):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | @RequestMapping(value = "/getMember") @ResponseBody public List<TUserInfo> getMember(HttpServletRequest request, HttpServletResponse response, HttpSession session) { String groupId = request.getParameter("groupId"); Object user = session.getAttribute(USER_ID); if (null != user) { if (groupId != null && groupId.length() != 0) { return chatService.getUserByGroupid(Integer.parseInt(groupId)); } else { return null; } } else { return null; } } |
這里面當(dāng)然還有很多地方需要配置,這個(gè)是一個(gè)簡(jiǎn)單的例子,我直接貼給你,后臺(tái)用的是spring
- 2 回答
- 0 關(guān)注
- 1227 瀏覽
添加回答
舉報(bào)