zoukankan      html  css  js  c++  java
  • 查询详情在模态框展示

    1.

    <a href="#" onclick="detail('${alarmTask.id}')"class="btn btn-sm btn-primary">查看任务</a>

    2.

    <script>
    function detail(id) {
        alert("aaaaaaaaaaaaaa");
        $.ajax({
             type: "GET",
             url: "${ctx}/direct/alarmTask/look",
             data: {id:id},
             dataType: "json",
             success: function(alarmTask){
                 alert("请求成功id="+id);
                $("#task_name").val(alarmTask.taskName);
                $("#task_num").val(alarmTask.taskNum);
                $("#queryTaskModal").modal('show');
             },
             error:function(){
                alert("请求失败id="+id);
             }
             })
    }
    </script>

    3.

        @RequestMapping(value = { "look" })
        @ResponseBody
        public ApAlarmTaskPO look(HttpServletRequest request,ApAlarmTaskPO alarmTask, Model model) {
            String id=request.getParameter("id");
            alarmTask=alarmTaskService.selectById(id);
            model.addAttribute("alarmTask",alarmTask);
            return alarmTask;
        }

    4.

    <div class="modal fade" style=" 900px;margin:0 auto;" id="queryTaskModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog" style="100%;margin: 0 auto;  ">
                        <div class="modal-content" style="100%; margin: 0 auto;">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title" id="myModalLabel">任务信息</h4>
                            </div>
                            <div class="modal-body row">
                                <form role="form" class="form-horizontal">
                                    <div class="form-group">
                                        <label class="control-label  col-sm-2">任务名称</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" name="task_name" id="task_name">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label  col-sm-2">任务编号</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" name="task_num" id="task_num">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2">任务类别</label>
                                        <div class="col-sm-4">
                                            <select class="form-control m-b" name="">
                                                <option value=""></option>
                                                <option>突发灾害</option>
                                                <option selected="selected">自然灾害</option>
    
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2">下发时间</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" name="publicOrg" value="2019-08-06 15:32:25">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-sm-2">来源</label>
                                        <div class="col-sm-4">
                                            <select class="form-control m-b" name="type">
                                                <option value=""></option>
                                                <option selected="selected">预案</option>
                                                <option selected="selected">分配</option>
                                            </select>
                                        </div>
                                    </div>
    
                                    <div class="form-group">
                                        <label class="control-label col-sm-2">任务概述</label>
                                        <div class="col-sm-8">
                                            <textarea class="form-control" rows="6" name="textNote"> 请参与救火
                                            
                                          </textarea>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
    
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
  • 相关阅读:
    但是难道我就不能在JBuilder里面看我可爱的中文了吗?[小糊涂的灵感]
    why is j2me midp superior to wap?[小糊涂的灵感]
    NRF51822之GPIOTE介绍
    Unity脚本生命周期
    树状数组学习笔记
    模版—扩展欧几里德
    hdu4339Query
    POJ3273Monthly Expense
    多校第一场
    ZOJJ Watashi's BG3631
  • 原文地址:https://www.cnblogs.com/fxx5/p/11882187.html
Copyright © 2011-2022 走看看