|
@@ -1,6 +1,8 @@
|
|
@extends('admin.layout')
|
|
@extends('admin.layout')
|
|
<style type="text/css">
|
|
<style type="text/css">
|
|
-
|
|
|
|
|
|
+ #sg-import-modal .form-control {
|
|
|
|
+ height: auto;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|
|
@section('header')
|
|
@section('header')
|
|
|
|
|
|
@@ -32,7 +34,11 @@
|
|
</form>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-8 pull-right">
|
|
<div class="col-sm-8 pull-right">
|
|
- <a href="{{ $pre_uri . 'create' }}" class="btn btn-sm btn-primary pull-right">添加{{ $model_name }}</a>
|
|
|
|
|
|
+ <div class="btn-group pull-right" id="sg-top-actions">
|
|
|
|
+ <a href="{{ $pre_uri . 'export' }}" class="btn btn-sm btn-info">导出</a>
|
|
|
|
+ <button class="btn btn-sm btn-warning btn-import">导入</button>
|
|
|
|
+ <a href="{{ $pre_uri . 'create' }}" class="btn btn-sm btn-primary">添加{{ $model_name }}</a>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
|
|
<table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
|
|
@@ -104,6 +110,33 @@
|
|
</form>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+<div class="modal fade" id="sg-import-modal" tabindex="-1" role="dialog" aria-labelledby="import-label" aria-hidden="true">
|
|
|
|
+ <div class="modal-dialog">
|
|
|
|
+ <form id="sg-import-form" class="form-horizontal" method="POST" action="{{ $pre_uri . 'import' }}" enctype="multipart/form-data">
|
|
|
|
+ {{ csrf_field() }}
|
|
|
|
+
|
|
|
|
+ <div class="modal-content">
|
|
|
|
+ <div class="modal-header">
|
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
+ <h4 class="modal-title" id="delete-label">选择要导入的文件</h4>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="modal-body">
|
|
|
|
+ <div class="form-group">
|
|
|
|
+ <label for="lastname" class="col-sm-2 control-label">选择文件</label>
|
|
|
|
+ <div class="col-sm-10">
|
|
|
|
+ <input type="file" class="form-control" name="file" required>
|
|
|
|
+ <span class="help-block">导入的文件只支持xlsx和xls</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="modal-footer">
|
|
|
|
+ <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
|
|
|
+ <button type="submit" class="btn btn-success">导入</button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+</div>
|
|
@endsection
|
|
@endsection
|
|
|
|
|
|
@section('footer')
|
|
@section('footer')
|
|
@@ -113,6 +146,10 @@ $(function () {
|
|
$('#delete-input-id').val($(this).attr('data-id'));
|
|
$('#delete-input-id').val($(this).attr('data-id'));
|
|
$('#delete-modal').modal('show');
|
|
$('#delete-modal').modal('show');
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ $('#sg-top-actions').on('click', '.btn-import', function() {
|
|
|
|
+ $('#sg-import-modal').modal('show');
|
|
|
|
+ });
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
@endsection
|
|
@endsection
|