<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生信息管理系统 - 学生信息表单</title>
</head>
<body>
<!-- 内容标题 -->
<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1 class="m-0">学生信息管理</h1>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- 中间内容 -->
<section class="content">
    <div class="container-fluid">
        <div class="row" style="margin-bottom: 10px">
            <div class="col-1">
                <button style="color: red" id="btnAdd" type="button" class="btn btn-block bg-gradient-primary">添加</button>
            </div>
            <div class="col-1">
                <button style="color: #0a001f" id="btnDel" type="button" class="btn btn-block  bg-gradient-primary">删除</button>
            </div>
            <div class="col-1">
                <button style="color: cyan" id="btnEdit" type="button" class="btn btn-block  bg-gradient-primary">修改</button>
            </div>
            <div class="col-1">
                <button style="color: #4c0ab8" id="btnSelectAll" type="button" class="btn btn-block  bg-gradient-primary">查询</button>
            </div>
        </div>
<pre><code>    &lt;div class=&quot;row&quot;&gt;
        &lt;div class=&quot;col-12&quot;&gt;
            &lt;div class=&quot;card&quot;&gt;
                &lt;div class=&quot;card-header&quot;&gt;
                    &lt;label class=&quot;text-left&quot;&gt;学生学号:&lt;/label&gt;
                    &lt;input type=&quot;text&quot; class=&quot;form-control my-input&quot; placeholder=&quot;请输入学号&quot;&gt;
                    &lt;button id=&quot;btnSelectName&quot; type=&quot;button&quot; class=&quot;btn bg-gradient-primary&quot;&gt;查询&lt;/button&gt;

                &lt;/div&gt;
                &lt;div class=&quot;card-body&quot;&gt;

                    &lt;div class=&quot;row&quot;&gt;
                        &lt;div class=&quot;col-12&quot;&gt;
                            &lt;table class=&quot;table table-bordered table-hover&quot;&gt;
                                &lt;thead&gt;
                                &lt;tr&gt;
                                    &lt;th&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/th&gt;
                                    &lt;th&gt;学号&lt;/th&gt;
                                    &lt;th&gt;姓名&lt;/th&gt;
                                    &lt;th&gt;性别&lt;/th&gt;
                                    &lt;th&gt;年龄&lt;/th&gt;
                                    &lt;th&gt;专业&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;/thead&gt;
                                &lt;tbody&gt;
                                &lt;tr&gt;
                                    &lt;td&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/td&gt;
                                    &lt;th&gt;20002&lt;/th&gt;
                                    &lt;th&gt;夏玲&lt;/th&gt;
                                    &lt;th&gt;女&lt;/th&gt;
                                    &lt;th&gt;17&lt;/th&gt;
                                    &lt;th&gt;医药医学&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;tr&gt;
                                    &lt;td&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/td&gt;
                                    &lt;th&gt;20003&lt;/th&gt;
                                    &lt;th&gt;泳婵&lt;/th&gt;
                                    &lt;th&gt;女&lt;/th&gt;
                                    &lt;th&gt;19&lt;/th&gt;
                                    &lt;th&gt;医药医学&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;tr&gt;
                                    &lt;td&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/td&gt;
                                    &lt;th&gt;20004&lt;/th&gt;
                                    &lt;th&gt;谢玉婵&lt;/th&gt;
                                    &lt;th&gt;女&lt;/th&gt;
                                    &lt;th&gt;19&lt;/th&gt;
                                    &lt;th&gt;医药医学&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;tr&gt;
                                    &lt;td&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/td&gt;
                                    &lt;th&gt;20005&lt;/th&gt;
                                    &lt;th&gt;林杭灵&lt;/th&gt;
                                    &lt;th&gt;女&lt;/th&gt;
                                    &lt;th&gt;19&lt;/th&gt;
                                    &lt;th&gt;医药医学&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;tr&gt;
                                    &lt;td&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/td&gt;
                                    &lt;th&gt;20006&lt;/th&gt;
                                    &lt;th&gt;夏雪&lt;/th&gt;
                                    &lt;th&gt;女&lt;/th&gt;
                                    &lt;th&gt;20&lt;/th&gt;
                                    &lt;th&gt;医药医学&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;tr&gt;
                                    &lt;td&gt;
                                        &lt;input type=&quot;checkbox&quot;&gt;
                                    &lt;/td&gt;
                                    &lt;th&gt;20007&lt;/th&gt;
                                    &lt;th&gt;冬雨&lt;/th&gt;
                                    &lt;th&gt;女&lt;/th&gt;
                                    &lt;th&gt;18&lt;/th&gt;
                                    &lt;th&gt;医药医学&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;/tbody&gt;
                            &lt;/table&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;


&lt;/div&gt;
</code></pre>
</section>
<!--保存弹出框-->
<div class="modal fade"   data-tag="add" id="modalSave" style="display: none;" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">学生添加</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div class="form-group row">
                        <label  class="col-2 col-form-label text-left">学号:</label>
                        <label  class="col-2 col-form-label text-left">姓名:</label>
                        <label  class="col-2 col-form-label text-left">性别:</label>
                        <label  class="col-2 col-form-label text-left">年龄:</label>
                        <label  class="col-2 col-form-label text-left">专业:</label>
                        <div class="col-6">
                            <input type="text" class="form-control" placeholder="请输入学号">
                            <input type="text" class="form-control" placeholder="请输入姓名">
                            <input type="text" class="form-control" placeholder="请输入性别">
                            <input type="text" class="form-control" placeholder="请输入年龄">
                            <input type="text" class="form-control" placeholder="请输入专业">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer justify-content-between">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button"  class="btn btn-primary">保存</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<script>
    /*
    需要在页面加载完毕后执行window.onload
 jquery简化window.onload=$( function () {} );
  -- 原版
    window.onload=function () {
    };*/
    $(function () {
        //页面执行完后,开始执行
        $("#btnAdd").click(function () {
<pre><code>        //设置自定义属性data-tag的值为add
        $(&quot;#modalSave&quot;).data(&quot;tag&quot;,&quot;add&quot;);
        //window.alert(&quot;OK&quot;);
        $(&quot;#modalSave&quot;).modal({
            keyboard:true,
            show:true
        });
    });
    $(&quot;#btnEdit&quot;).click(function () {
        //设置自定义属性data-tag的值为edit
        $(&quot;#modalSave&quot;).data(&quot;tag&quot;,&quot;edit&quot;);
        $(&quot;#modalSave&quot;).modal({
            keyboard:true,
            show:true
        });
    });
    //模态框事件,show执行完毕之后立即处理的事件
    $(&quot;#modalSave&quot;).on(&quot;show.bs.modal&quot;,function () {
        //window.alert($(&quot;#modalSave&quot;).data(&quot;tag&quot;));
        switch ($(&quot;#modalSave&quot;).data(&quot;tag&quot;)) {
            case &quot;add&quot;:
                $(&quot;#modalSave .modal-header h4&quot;).text(&quot;学生添加&quot;);
                break;
            case &quot;edit&quot;:
                $(&quot;#modalSave .modal-header h4&quot;).text(&quot;学生修改&quot;);
                break;
        }
    });
});
</code></pre>
</script>
</body>
</html>
<script>
</script>
学生信息管理系统 - 学生信息表单

原文地址: https://www.cveoy.top/t/topic/joli 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录