| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456 |
- <link rel="stylesheet" href="/static/css/font-awesome.min.css">
- <link rel="stylesheet" href="/static/css/css.css">
- <link rel="stylesheet" href="/static/css/ace.min.css">
- <style>
- body,html{
- background:white;
- overflow-y:hidden;
- }
- .pagination{
- margin-left:190px;
- padding-top:10px;
- }
- #mine_list{
- overflow:hidden;
- overflow-y:scroll;
- }
- #mine_list::-webkit-scrollbar{
- display:none;
- }
- #camera_table{
- overflow:hidden;
- overflow-y:scroll;
- }
- #camera_table::-webkit-scrollbar{
- display:none;
- }
- </style>
- <div @if(request()->ajax()) style="max-height: 600px;overflow-y: auto;" @endif>
- @if(count($searchs) > 0)
- <div style="width:200px;max-height:615px;position:absolute;" id="mine_list">
- <div class="row">
- <div class="col-sm-6">
- <div class="widget-box" style="margin-top:0;">
- <div class="widget-header header-color-blue2" style="background:#009688;">
- <h4 class="lighter smaller">区域列表</h4>
- </div>
- <div class="widget-body" style="border:0px solid #009688;">
- <div class="widget-main padding-8">
- <div id="tree1" class="tree tree-selectable">
- <div class="tree-folder" style="display:none;">
- <div class="tree-folder-header">
- <i class="icon-plus"></i>
- <div class="tree-folder-name"></div>
- </div>
- <div class="tree-folder-content"></div>
- <div class="tree-loader" style="display: none;"></div>
- </div>
- <div class="tree-item" style="display:none;">
- <i class="icon-remove"></i>
- <div class="tree-item-name"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-row" style="margin-left:210px;">
- <form class="layui-form" method="get" action="/admin/{{ $path }}" style="margin-bottom: 10px;" id="search_form">
- @csrf
- @if(request()->has('id'))
- <input type="hidden" name="id" value="{{ request()->input('id') }}">
- @endif
- <input type="hidden" name="mine_id" id="mine_id" value="">
- @foreach($searchs as $var => $search)
- @if($search['type'] == 'input')
- <div class="layui-input-inline">
- <input class="layui-input" type="text"
- placeholder="{{ $search['label'] }}"
- name="{{ $var }}"
- value="{{ ${$var} ?? '' }}">
- </div>
- @endif
- @if($search['type'] == 'select')
- <div class="layui-input-inline">
- <select name="{{ $var }}">
- <option value="0"
- @if(!isset($search['assist'])) selected @endif>{{ $search['label'] }}
- </option>
- @if(count($search['assist']) > 0)
- @foreach($search['assist'] as $k => $col)
- <option value="{{ $k }}"
- @if(isset(${$var}) && ${$var} == $k) selected @endif>{{ $col }}
- </option>
- @endforeach
- @endif
- </select>
- </div>
- @endif
- @if($search['type'] == 'tree_select')
- <div class="layui-input-inline">
- <select name="{{ $var }}">
- <option value="0"
- @if(!isset($search['assist'])) selected @endif>{{ $search['label'] }}
- </option>
- @if(count($search['assist']) > 0)
- @include('admin::component.multi_select_option', ['selects' => $search['assist'], 'selectPid' => request($var) ?? ''])
- @endif
- </select>
- </div>
- @endif
- @if($search['type'] == 'date')
- <div class="layui-input-inline">
- <input class="layui-input date-{{ $var }}" type="text"
- placeholder="{{ $search['label'] ?? '日期' }}"
- name="{{ $var }}" autocomplete="off" readonly
- disableautocomplete value="{{ $search['assist'][0] ?? '' }}"
- >
- </div>
- <script>
- $('.date-{{ $var }}').datepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- date: '{{ $search['assist'][0] ?? null }}',
- });
- </script>
- @endif
- @if($search['type'] == 'date_time')
- <div class="layui-input-inline">
- <input class="layui-input star-{{ $var }}" type="text"
- placeholder="{{ $search['label'][0] ?? '起始日期' }}"
- name="star_{{ $var }}" autocomplete="off" readonly
- disableautocomplete value="{{ $search['assist'][0] ?? '' }}">
- </div> -
- <div class="layui-input-inline">
- <input class="layui-input end-{{ $var }}" type="text"
- placeholder="{{ $search['label'][1] ?? '结束日期' }}"
- name="end_{{ $var }}" autocomplete="off" readonly
- disableautocomplete value="{{ $search['assist'][1] ?? '' }}">
- </div>
- <script>
- $('.star-{{ $var }}').datepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- date: '{{ $search['assist'][0] ?? null }}',
- pick: function (rtime) {
- $('.end-{{ $var }}').datepicker('setStartDate', rtime.date);
- }
- });
- $('.end-{{ $var }}').datepicker({
- language: 'zh-CN',
- format: 'yyyy-mm-dd',
- date: '{{ $search['assist'][0] ?? null }}'
- });
- </script>
- @endif
- @endforeach
- <button class="layui-btn" type="submit"><i class="layui-icon"></i></button>
- </form>
- </div>
- @endif
- @if(count($topActions) > 0 || (isset($topActionOthers) && count($topActionOthers)) > 0)
- <div class="weadmin-block layui-clear" style="margin-left:210px;">
- @if(in_array('goback', $topActions))
- @if(isset($topActions['href']))
- <a class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;"
- href="{{ $topActions['href'] }}">返回
- </a>
- @else
- <button class="layui-btn layui-btn-primary layui-layer-close" style="position:relative;" type="button"
- onclick="javascript:history.go(-1);">返回
- </button>
- @endif
- @endif
- @if(checkBtn('/admin/'.$path.'/add', $permissionsList))
- @if(in_array('add', $topActions))
- @if(isset($topActions['add_params']))
- <a href="/admin/{{ $path }}/add?{{ $topActions['add_params']}} " class="layui-btn">添加</a>
- @else
- <a href="/admin/{{ $path }}/add" class="layui-btn">添加</a>
- @endif
- @endif
- @endif
- @if(checkBtn('/admin/'.$path.'/export', $permissionsList))
- @if(in_array('export', $topActions))
- <a href="/admin/{{ $path }}/export?{{ http_build_query(request()->except('_token')) }}"
- class="layui-btn">Excel导出当前页</a>
- <a href="/admin/{{ $path }}/export?type=all&{{ http_build_query(request()->except('_token')) }}"
- class="layui-btn">Excel导出全部</a>
- @endif
- @endif
- @if(checkBtn('/admin/'.$path.'/importTemplate', $permissionsList))
- @if(in_array('importTemplate', $topActions))
- <a href="/admin/{{ $path }}/importTemplate" class="layui-btn">下载导入模板</a>
- @endif
- @endif
- @if(checkBtn('/admin/'.$path.'/import', $permissionsList))
- @if(in_array('import', $topActions))
- <button type="button" class="layui-btn" id="import">
- <i class="layui-icon"></i>Excel导入
- </button>
- @endif
- @endif
- <div style="float: right;">
- @if(isset($topActionOthers) && count($topActionOthers) > 0)
- @foreach($topActionOthers as $topActionOther)
- @if(checkBtn('/admin/'.$topActionOther['path'], $permissionsList))
- @if(isset($topActionOther['isShow']))
- @if(isset($topActionOther['isJump']))
- <button class="layui-btn {{ $topActionOther['class'] }}"
- onclick="jumpBtn(this)"
- data-jumptype="{{ $topActionOther['isJump'] }}"
- data-href="{{ $topActionOther['path'] }}">{{ $topActionOther['name'] }}
- </button>
- @else
- <a href="/admin/{{ $topActionOther['path'] }}"
- class="layui-btn {{ $topActionOther['class'] }}">{{ $topActionOther['name'] }}</a>
- @endif
- @endif
- @endif
- @endforeach
- @endif
- </div>
- </div>
- @endif
- <div style="margin-left:210px;max-height:454px;" id="camera_table">
- <table class="layui-table" style="">
- <thead>
- <tr>
- @foreach($columns as $column)
- <th style="width:11%;">{{ $column['name'] }}</th>
- @endforeach
- @if((isset($displayActionOthers) && count($displayActionOthers) > 0) || count($actionBtns) > 0)
- <th style="width:15%;">操作</th>
- @endif
- </tr>
- </thead>
- <tbody>
- @if(count($items) > 0)
- @foreach($items as $item)
- <tr>
- @foreach($columns as $varName => $column)
- <td>{!! isset($column['value']) ? $column['value']($item->$varName, $item) : $item->$varName !!}</td>
- @endforeach
- @if((isset($displayActionOthers) && count($displayActionOthers) > 0) || count($actionBtns) > 0)
- <td>
- @if(isset($displayActionOthers) && count($displayActionOthers) > 0)
- @foreach($displayActionOthers as $displayActionOther)
- @if(checkBtn('/admin/'.$displayActionOther['path'], $permissionsList))
- @if(isset($displayActionOther['isShow']) ? $displayActionOther['isShow']($item) : 1)
- @if(isset($displayActionOther['isJump']))
- <button
- class="layui-btn layui-btn-xs {{ $displayActionOther['class'] }} @if($displayActionOther['isJump'] == 'uploadimg') uploadimg @endif"
- onclick="jumpBtn(this)"
- data-title="{{ $displayActionOther['title'] ?? '' }}"
- data-jumptype="{{ $displayActionOther['isJump'] }}"
- data-href="{{ substr($displayActionOther['path'],-1) == '&' ? $displayActionOther['path']:$displayActionOther['path'].'?' }}{{ $primaryKey }}={{ $item->$primaryKey }}">{{ $displayActionOther['name'] }}
- </button>
- @else
- <a href="/admin/{{ substr($displayActionOther['path'],-1) == '&' ? $displayActionOther['path']:$displayActionOther['path'].'?' }}{{ $primaryKey }}={{ $item->$primaryKey }}"
- class="layui-btn layui-btn-xs {{ $displayActionOther['class'] }}"
- @if(isset($displayActionOther['fullWin'])) target="_blank" @endif>{{ $displayActionOther['name'] }}</a>
- @endif
- @endif
- @endif
- @endforeach
- @endif
- @if(!is_array($item) || !in_array($item[$displayActions['name']], $displayActions['value']))
- @if(checkBtn('/admin/'.$path.'/view', $permissionsList))
- @if(in_array('view', $actionBtns))
- <a href="/admin/{{ $path }}/view?{{ $primaryKey }}={{ $item->$primaryKey }}"
- class="layui-btn layui-btn-normal layui-btn-xs" {{ $actionBtnsAttribute['view'] ?? '' }} >查看</a>
- @endif
- @endif
- @if(checkBtn('/admin/'.$path.'/edit', $permissionsList))
- @if(in_array('edit', $actionBtns))
- <a href="/admin/{{ $path }}/edit?{{ $primaryKey }}={{ $item->$primaryKey }}"
- class="layui-btn layui-btn-xs" {{ $actionBtnsAttribute['edit'] ?? '' }}>编辑</a>
- @endif
- @endif
- @if(checkBtn('/admin/'.$path.'/del', $permissionsList))
- @if(in_array('del', $actionBtns))
- <button class="layui-btn layui-btn-xs layui-btn-danger delItem"
- data-itemid="{{ $item->$primaryKey }}" {{ $actionBtnsAttribute['del'] ?? '' }}>
- 删除
- </button>
- @endif
- @endif
- @endif
- </td>
- @endif
- </tr>
- @endforeach
- @else
- <tr>
- <td colspan="{{ count($columns) + 1 }}">暂无数据</td>
- </tr>
- @endif
- </tbody>
- </table>
- </div>
- </div>
- @if(method_exists($items, 'links'))
- {{ $items->appends(request()->except('_token'))->links() }}
- @endif
- <script>
- $(function () {
- $('.delItem').on('click', function () {
- var self = $(this);
- layer.confirm('你确定删除?', function () {
- layer.closeAll();
- $.post('/admin/{{ $path }}/del', {"{{ $primaryKey }}": self.data('itemid')}, function (res) {
- if (res.code === 0) {
- layer.msg('成功!', {anim: 0}, function () {
- location.reload();
- });
- } else {
- layer.msg(res.message);
- }
- });
- });
- })
- });
- function jumpBtn(el) {
- var self = $(el);
- var path = self.data('href');
- var type = self.data('jumptype');
- var jvalue = self.data('value') || '';
- var title = self.data('title') || '';
- var text = self.text();
- if (type === 'confirm') {
- layer.confirm('确定' + text + '?', function (index) {
- layer.close(index);
- $.get('/admin/' + path, function (res) {
- if (res.code === 0) {
- layer.msg('成功!', {anim: 0}, function () {
- location.reload();
- });
- } else {
- layer.msg('失败:' + res.message);
- }
- });
- });
- } else if (type === 'uploadimg') {
- } else if (type === 'prompt') {
- layer.prompt({
- value: jvalue,
- title: title,
- }, function (value, index, elem) {
- layer.close(index);
- $.get('/admin/' + path, {newValue: value}, function (res) {
- if (res.code === 0) {
- layer.msg('成功!', {anim: 0, time: 1000}, function () {
- self.text(value).data('value', value);
- location.reload();
- });
- } else {
- layer.msg('失败:' + res.message);
- }
- });
- });
- } else {
- $.get('/admin/' + path, function (res) {
- layer.open({
- type: 1,
- area: '700px',
- offset: '150px',
- title: false,
- content: res
- });
- });
- }
- }
- layui.use(['upload', 'form'], function () {
- var upload = layui.upload, form = layui.form;
- form.on('switch', function (data) {
- var self = $(data.elem);
- var path = self.data('href');
- $.get('/admin/' + path, function (res) {
- console.log(res);
- if (res.code === 0) {
- } else {
- layer.msg('失败:' + res.message);
- }
- });
- });
- //执行实例
- var uploadInst = upload.render({
- elem: '#import' //绑定元素
- , field: 'excel'
- , exts: 'xls|xlsx|csv'
- , url: '/admin/{{ $path }}/import' //上传接口
- , done: function (res) {
- if (res.code === 0) {
- layer.msg('导入成功,加载请稍等待!', {anim: 0}, function () {
- location.reload();
- });
- } else {
- layer.msg('导入失败,即将跳转到错误信息页。', {anim: 0}, function () {
- location.href = '/admin/errorPage';
- });
- }
- }
- , error: function (res) {
- layer.msg(res.message);
- }
- });
- //执行实例
- $('.uploadimg').each(function (index, elem) {
- upload.render({
- elem: elem //绑定元素
- , field: 'img'
- , url: '/admin/' + $(elem).data('href') //上传接口
- , done: function (res) {
- if (res.code === 0) {
- layer.msg('上传成功', {anim: 0}, function () {
- location.reload();
- });
- } else {
- layer.msg(res.message);
- }
- }
- , error: function (res) {
- layer.msg(res.message);
- }
- });
- });
- });
- </script>
- <script src="/static/js/jquery.min.js"></script>
- <script src="/static/js/bootstrap.min.js"></script>
- <script src="/static/js/fuelux.tree-sampledata.js"></script>
- <script src="/static/js/fuelux.tree.min.js"></script>
- <script src="/static/js/ace-elements.min.js"></script>
- <script src="/static/js/ace.min.js"></script>
- <script type="text/javascript">
- var tree_data = <?php echo json_encode($tree_data);?>;
- var treeDataSource = new DataSourceTree({data: tree_data});
- jQuery(function($){
- $('#tree1').ace_tree({
- dataSource: treeDataSource ,
- multiSelect:true,
- loadingHTML:'<div class="tree-loading"><i class="icon-refresh icon-spin blue"></i></div>',
- 'open-icon' : 'icon-minus',
- 'close-icon' : 'icon-plus',
- 'selectable' : true,
- // 'selected-icon' : 'icon-ok',
- // 'unselected-icon' : 'icon-remove'
- });
- });
- </script>
|