Chinaunix首页 | 论坛 | 博客
  • 博客访问: 29955175
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: 系统运维

2010-03-31 09:07:14



    
    {% endfor %}
        
          
        

{% extends "p_base.html" %}
{% block content %}
<script type="text/JavaScript" src="/site/js/jquery-1.2.6.js"></script>
<script type="text/javascript">

function modifyItem(eleid) {
    $("#alarm_memo"+eleid).attr("readonly","");
    $("#alarm_memo"+eleid).css("background-color", "yellow"); 
    
    $("#save"+eleid).show();
    $("#modify"+eleid).hide();
}

function saveItem(eleid) {
    var alarm_memo = $("#alarm_memo"+eleid).val();
    var tableid = $("#keyid"+eleid).val();
    $.ajax({
            type:"post",
            url: "/sysmaintain/editalarminfos/",
            dataType: 'text',
            data:{"alarm_memo":alarm_memo,"tableid":tableid},
            timeout: 1000,
            success:function(msg){
                if(msg == "0") {
                    alert("更新出错");
                    return;
                }else{
                    alert("更新成功");
                    $("#alarm_memo"+eleid).attr("readonly","readonly");
                    $("#alarm_memo"+eleid).css("background-color", "white"); 
                   
                    $("#save"+eleid).hide();
                    $("#modify"+eleid).show();
                }
            }
        })
}

function deleteItem(eleid) {
    var keyid = $("#keyid"+eleid).val();
    $.ajax({
            type:"GET",
            url: "/sysmaintain/ajaxdelalarminfos/?keyid="+keyid,
            success:function(msg){
                if(msg == "-1") {
                    alert("删除失败");
                   
                }else{
                    alert("删除成功");
                    $("tr[id=\'tr"+eleid+"\']").remove();
                    $("#countid").html(msg);
                    return;
                }
            }
        })
}
</script>

{%include "sysmaintain/alarminfoheader.html"%}

<div align="center">一共有<span id="countid">{{count}}</span>条报警记录</div>
<TABLE class="tableborder" cellSpacing=1 cellPadding=3 width="100%" align=center border=0>
  <TBODY>
  <TR class=header style="color: #000000">
    <td width="8%" align="center" >报警编号</td>
        <td width="8%" align="center" >报警方式</td>
        <td width="10%" align="center" >人员</td>
        <td width="13%" align="center" >号码</td>
        <td width="13%" align="center" >报警信息</td>
        <td width="8%" align="center" >报警发送时间</td>
        <td width="8%" align="center" >备注</td>
        <td width="10%" align="center" >修改</td>
        <td width="10%" align="center" >删除</td>
  </TR>
    {% for type in contacts.object_list %}
    <tr bgcolor="#EBF2F9" align=center id="tr{{forloop.counter}}">
    <td align="center">
    <label>{{type.alarm_number}}</label>
    <input type="hidden" id="keyid{{forloop.counter}}" value="{{type.id}}">
    </td>
    <td align="center">{{type.alarm_type}}</td>
    <td align="center">{{type.duty_name}}</td>
    <td align="center">{{type.alarm_address}}</td>
    <td align="center">{{type.alarm_message}}</td>
    <td align="center">{{type.send_date}}</td>
    <td align="center">
    <input readonly="readonly" id="alarm_memo{{forloop.counter}}" value="{{type.alarm_memo}}">
    </td>
   
   
    <td align="center">
    <div id="modify{{forloop.counter}}">
    {%ifequal update '1' %}
        <a href="#" onclick="modifyItem({{forloop.counter}})">修改</a>
    {% endifequal %}
    </div>
   
    <div id="save{{forloop.counter}}" style="display:none;">
        <a href="#" onclick="saveItem({{forloop.counter}})">保存</a>
    </div>
    </td>
       
    <td align="center">
    {%ifequal del '1' %}
    <a href="#" title="删除" onclick="deleteItem({{forloop.counter}})"">删除
    {% endifequal %}
    


        总计页数:{{contacts.number }}  当前页数:{{contacts.paginator.num_pages }}  
          {% if contacts.has_previous %}
        ?page={{ contacts.previous_page_number }}">上一页
        {% endif %} {% if contacts.has_next %}
        ?page={{ contacts.next_page_number }}">下一页
        {% endif %}
          

{%endblock%}

可以参考一下里面的删除、修改操作的内容!

 

{% extends "p_base.html" %}
{% block content %}



{%include "sysmaintain/alarminfoheader.html"%}

一共有{{count}}条报警记录


  
  
    
        
        
        
        
        
        
        
        
  
    {% for type in contacts.object_list %}
    
    
    
    
    
    
    
    
   
   
    
       
    
报警编号报警方式人员号码报警信息报警发送时间备注修改删除

    
    
    
{{type.alarm_type}}{{type.duty_name}}{{type.alarm_address}}{{type.alarm_message}}{{type.send_date}}
    
    

    

    {%ifequal update '1' %}
        修改
    {% endifequal %}
    

   
    
    

    {%ifequal del '1


阅读(974) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~