feature: kpi item template
This commit is contained in:
parent
598424b2c5
commit
905e6091ca
|
|
@ -88,11 +88,34 @@ class Doc extends Backend
|
||||||
->whereRaw('JSON_OVERLAPS(group_ids, ?)', [json_encode($this->auth->getChildrenGroupIds(true))])
|
->whereRaw('JSON_OVERLAPS(group_ids, ?)', [json_encode($this->auth->getChildrenGroupIds(true))])
|
||||||
->order($sort, $order)
|
->order($sort, $order)
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
|
|
||||||
|
foreach ($list as $k => $row) {
|
||||||
|
$list[$k]['url'] = cdnurl($row['path']);
|
||||||
|
}
|
||||||
|
|
||||||
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
||||||
return json($result);
|
return json($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function detail($ids)
|
||||||
|
{
|
||||||
|
$row = $this->model->get(['id' => $ids]);
|
||||||
|
if (!$row) {
|
||||||
|
$this->error(__('No Results were found'));
|
||||||
|
}
|
||||||
|
if ($this->request->isAjax()) {
|
||||||
|
$this->success("Ajax请求成功", null, ['id' => $ids]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$row['url'] = cdnurl($row['path']);
|
||||||
|
|
||||||
|
|
||||||
|
$this->view->assign("row", $row->toArray());
|
||||||
|
return $this->view->fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -33,16 +33,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-3">{:__('Path')}:</label>
|
<label class="control-label col-xs-12 col-sm-3">{:__('Path')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="c-path" class="form-control" size="50" name="row[path]" type="text">
|
<input id="c-path" data-rule="required" class="form-control" size="50" name="row[path]" type="text" value="">
|
||||||
<div class="input-group-addon no-border no-padding">
|
<div class="input-group-addon no-border no-padding">
|
||||||
<span><button type="button" id="faupload-path" class="btn btn-danger faupload" data-input-id="c-path" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-path" data-mimetype="*" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
<span><button type="button" id="fachoose-path" class="btn btn-primary fachoose" data-input-id="c-path" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
<span><button type="button" id="fachoose-path" class="btn btn-primary fachoose" data-input-id="c-path" data-mimetype="*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
</div>
|
</div>
|
||||||
<span class="msg-box n-right" for="c-path"></span>
|
<span class="msg-box n-right" for="c-path"></span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="row list-inline faupload-preview" id="p-path"></ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
|
|
|
||||||
23
application/admin/view/oa/doc/detail.html
Normal file
23
application/admin/view/oa/doc/detail.html
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{if $row.type == '1'}
|
||||||
|
<div>
|
||||||
|
<video controls>
|
||||||
|
<source src="{$row.url}" type="video/mp4">
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{if $row.type == '2'}
|
||||||
|
<div>
|
||||||
|
<img src="{$row.url}" alt="">
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{if $row.type == '3'}
|
||||||
|
<div>
|
||||||
|
<a href="{$row.url}" target="_blank">点击下载</a>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<div class="hide layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -33,16 +33,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Path')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Path')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="c-path" class="form-control" size="50" name="row[path]" type="text" value="{$row.path|htmlentities}">
|
<input id="c-path" data-rule="required" class="form-control" size="50" name="row[path]" type="text" value="{$row.path|htmlentities}">
|
||||||
<div class="input-group-addon no-border no-padding">
|
<div class="input-group-addon no-border no-padding">
|
||||||
<span><button type="button" id="faupload-path" class="btn btn-danger faupload" data-input-id="c-path" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-path" data-mimetype="*" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
<span><button type="button" id="fachoose-path" class="btn btn-primary fachoose" data-input-id="c-path" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
<span><button type="button" id="fachoose-path" class="btn btn-primary fachoose" data-input-id="c-path" data-mimetype="*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
</div>
|
</div>
|
||||||
<span class="msg-box n-right" for="c-path"></span>
|
<span class="msg-box n-right" for="c-path"></span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="row list-inline faupload-preview" id="p-path"></ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
{field: 'path', title: __('Path'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'path', title: __('Path'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||||
|
buttons:[
|
||||||
|
{
|
||||||
|
name: 'detail',
|
||||||
|
title: __('查看详情'),
|
||||||
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||||
|
icon: 'fa fa-list',
|
||||||
|
url: 'oa/doc/detail'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user