mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 19:42:47 +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,8 +27,28 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<div>
|
<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>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<button class="layui-btn">查询</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<table class="layui-table">
|
<table class="layui-table">
|
||||||
|
|
||||||
@@ -43,14 +63,18 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<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"}
|
{volist name="list" id="vo" empty="$empty"}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$vo.id}</td>
|
<td>{$vo.id}</td>
|
||||||
<td>
|
<td>
|
||||||
{switch $vo.mime_type}
|
{switch $vo.mime_type}
|
||||||
{case image/png|image/gif|image/jpeg }
|
{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>
|
<a href="{$vo.src}" target="_blank"><img
|
||||||
|
onerror="this.src = '/static/images/error.jpg'" src="{$vo.src}"
|
||||||
|
alt=""></a>
|
||||||
{/case}
|
{/case}
|
||||||
{default /}
|
{default /}
|
||||||
<a href="{$vo.src}" target="_blank" class="layui-btn layui-btn-sm">打开源文件</a>
|
<a href="{$vo.src}" target="_blank" class="layui-btn layui-btn-sm">打开源文件</a>
|
||||||
@@ -71,11 +95,19 @@
|
|||||||
<p style="color: red">{$vo.status}</p>
|
<p style="color: red">{$vo.status}</p>
|
||||||
<p>上传时间:{$vo.create_time}</p>
|
<p>上传时间:{$vo.create_time}</p>
|
||||||
<p>使用时间:{$vo.used_time}</p>
|
<p>使用时间:{$vo.used_time}</p>
|
||||||
<p>清除时间:{$vo.delete_time}</p>
|
<p>删除时间:{$vo.delete_time}</p>
|
||||||
<p>清除时间:{$vo.clear_time}</p>
|
<p>清除时间:{$vo.clear_time}</p>
|
||||||
</td>
|
</td>
|
||||||
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/volist}
|
{/volist}
|
||||||
|
|||||||
Reference in New Issue
Block a user