123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <fieldset>
- <legend>条件搜索</legend>
- <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
- <div class="layui-form-item layui-inline">
- <label class="layui-form-label">标题</label>
- <div class="layui-input-inline">
- <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入关键词" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item layui-inline">
- <button class="layui-btn layui-btn-primary"><i class="layui-icon"></i> 搜 索</button>
- </div>
- <div class="layui-form-item layui-inline">
- <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="upload" style="margin-right: 10px;">
- <i class="layui-icon"></i>批量导入
- </button>
- </div>
- </form>
- <script>form.render()
- layui.use('upload', function(){
- var upload = layui.upload;
- //执行实例
- var uploadInst = upload.render({
- elem: '#upload' //绑定元素
- ,url: "{:url('import')}" //上传接口
- , method: 'POST'
- ,accept: 'file'//指定允许上传时校验的文件类型,可选值有:images(图片)、file(所有文件)、video(视频)、audio(音频)
- ,exts: 'xlsx|xls'//只允许上传excel文件,未设定,那么限制的就是图片的文件格式
- ,before: function(obj){ //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
- layer.load(); //上传loading
- }
- ,done: function(res){
- layer.closeAll('loading'); //关闭loading
- //上传完毕回调
- console.log(res)
- if(res.code == 1){
- layer.open({
- title: '导入结果'
- ,content: res.msg
- ,btn:['确定']
- ,yes:function(index, layero){
- location.reload();//刷新单前页
- }
- });
- }else{
- layer.msg(res.msg, {icon: 5});
- }
- }
- });
- });
- </script>
- </fieldset>
|