mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
封装上传文件管理
This commit is contained in:
25
app/UploadFiles.php
Normal file
25
app/UploadFiles.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace app;
|
||||
|
||||
class UploadFiles
|
||||
{
|
||||
public static function create()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function use()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function delete()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function clear()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,27 @@
|
||||
</div>
|
||||
<div class="main-container">
|
||||
<div>
|
||||
<form action="" class="layui-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">范围</label>
|
||||
<div class="layui-input-inline" style="width: 100px;">
|
||||
<select name="city" lay-verify="">
|
||||
<option value="">全部</option>
|
||||
<option value="0">未使用(仅供预览)</option>
|
||||
<option value="1">使用</option>
|
||||
<option value="2">已删除</option>
|
||||
<option value="3">已清除</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn">查询</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<table class="layui-table">
|
||||
@@ -43,17 +63,21 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{php}$empty = '<tr><td colspan="10">暂无数据</td></tr>';{/php}
|
||||
{php}$empty = '<tr>
|
||||
<td colspan="10">暂无数据</td>
|
||||
</tr>';{/php}
|
||||
{volist name="list" id="vo" empty="$empty"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>
|
||||
{switch $vo.mime_type}
|
||||
{case image/png|image/gif|image/jpeg }
|
||||
<a href="{$vo.src}" target="_blank"><img onerror="this.src = '/static/images/error.jpg'" src="{$vo.src}" alt=""></a>
|
||||
{/case}
|
||||
{default /}
|
||||
<a href="{$vo.src}" target="_blank" class="layui-btn layui-btn-sm">打开源文件</a>
|
||||
{case image/png|image/gif|image/jpeg }
|
||||
<a href="{$vo.src}" target="_blank"><img
|
||||
onerror="this.src = '/static/images/error.jpg'" src="{$vo.src}"
|
||||
alt=""></a>
|
||||
{/case}
|
||||
{default /}
|
||||
<a href="{$vo.src}" target="_blank" class="layui-btn layui-btn-sm">打开源文件</a>
|
||||
{/switch}
|
||||
</td>
|
||||
<td>
|
||||
@@ -61,7 +85,7 @@
|
||||
<p>文件名:{$vo->getData('file_name')}</p>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
|
||||
<p>文件类型: {$vo.mime_type}</p>
|
||||
<p>文件用途: <span style="color: red">{$vo.type}</span> </p>
|
||||
<p>文件大小: {$vo.file_size}</p>
|
||||
@@ -71,15 +95,23 @@
|
||||
<p style="color: red">{$vo.status}</p>
|
||||
<p>上传时间:{$vo.create_time}</p>
|
||||
<p>使用时间:{$vo.used_time}</p>
|
||||
<p>清除时间:{$vo.delete_time}</p>
|
||||
<p>删除时间:{$vo.delete_time}</p>
|
||||
<p>清除时间:{$vo.clear_time}</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-btn-container">
|
||||
{if condition="!empty($vo->getData('used_time')) &&
|
||||
empty($vo->getData('delete_time'))" }
|
||||
<div class="layui-btn layui-btn-sm">强制清除文件</div>
|
||||
{else /}
|
||||
<div class="layui-btn layui-btn-sm">清除文件</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user