| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <style>
- </style>
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-form layui-card-header layuiadmin-card-header-auto">
- <button class="layui-btn layuiadmin-btn" data-type="export">导出</button>
- </div>
- <div class="layui-card-body">
- <table id="{$lay_table}" lay-filter="{$lay_table}"></table>
- </div>
- </div>
- </div>
- <script>
- layui.use(['index', 'admin', 'form', 'table'], function () {
- const $ = layui.$;
- const admin = layui.admin;
- const form = layui.form;
- const table = layui.table;
- form.render();
- table.render({
- elem: '#{$lay_table}',
- url: "{:url('officer/listDetail')}?id={$id}",
- cols: [
- [
- {field: 'name', title: '姓名' ,width: 150},
- {field: 'mobile', title: '手机号', width: 200},
- {field: 'sex', title: '性别', width: 150},
- {field: 'age', title: '年龄', width: 150},
- {field: 'marry', title: '婚姻状况', width: 150},
- {field: 'education', title: '学历', width: 150},
- {field: 'major', title: '专业', width: 150},
- {field: 'score', title: '总分', width: 150},
- {field: 'create_time', title: '提交时间', align: 'center'},
- ]
- ],
- page: true,
- limit: 50,
- cellMinWidth: 150,
- text: '对不起,加载出现异常!'
- });
- //事件
- const active = {
- export: function() {
- const url = "{:url('officer/export')}?id={$id}";
- window.open(url);
- },
- };
- $('.layui-btn.layuiadmin-btn').on('click', function () {
- const type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- });
- </script>
|