mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-07-01 16:22:49 +08:00
refactor(typesetting): Wave1 - UPSERT改造 + 移除历史记录后端接口
- PhoneImage.php: saveConfigOnly/createOutput改为find-then-update-or-create - Post.php: 移除6个历史记录方法(postOutputList/getOutputListJson等) - 删除post_output/index.html模板
This commit is contained in:
@@ -1,175 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>{$post.title} - 输出管理</title>
|
||||
{include file="common/_require"}
|
||||
</head>
|
||||
|
||||
<body class="layui-layout-body">
|
||||
|
||||
<div class="layui-layout layui-layout-admin">
|
||||
{include file="common/_header"}
|
||||
{include file="common/left_post"}
|
||||
|
||||
<div class="layui-body">
|
||||
<div style="padding:15px">
|
||||
<div class="main-header">
|
||||
<span class="layui-breadcrumb">
|
||||
<a>首页</a>
|
||||
<a href="{:url('post/index')}">内容管理</a>
|
||||
<a><cite>输出管理 - {$post.title}</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="main-container">
|
||||
<div>
|
||||
<a href="{:url('post/phoneImage',['id'=>$post.id])}" class="layui-btn">
|
||||
<i class="layui-icon layui-icon-add-1"></i> 新建排版
|
||||
</a>
|
||||
<a href="{:url('post/index')}" class="layui-btn layui-btn-primary">
|
||||
<i class="layui-icon layui-icon-return"></i> 返回列表
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table class="layui-table" lay-skin="line">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>类型</th>
|
||||
<th>尺寸</th>
|
||||
<th>页数</th>
|
||||
<th>状态</th>
|
||||
<th>创建时间</th>
|
||||
<th>图片</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name='list' id='vo'}
|
||||
<tr class="item" data-id="{$vo.id}">
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.output_type_text}</td>
|
||||
<td>
|
||||
{if $vo.config && $vo.config.size}
|
||||
{if $vo.config.size == 'xiaohongshu'}小红书{/if}
|
||||
{if $vo.config.size == 'douyin'}抖音{/if}
|
||||
{else/}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$vo.page_count}</td>
|
||||
<td>{$vo.status_text}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>
|
||||
<button type="button" class="layui-btn layui-btn-xs btn-view-images"
|
||||
data-output-id="{$vo.id}">
|
||||
<i class="layui-icon layui-icon-picture"></i> 查看图片
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-btn-container">
|
||||
<a class="layui-btn layui-btn-xs layui-btn-warm"
|
||||
href="{:url('post/downloadPostOutputZip',['id'=>$vo.id])}">
|
||||
<i class="layui-icon layui-icon-download-circle"></i> 下载ZIP
|
||||
</a>
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-danger btn-delete-output"
|
||||
data-output-id="{$vo.id}">
|
||||
<i class="layui-icon layui-icon-delete"></i> 删除
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{if condition="count($list) == 0"}
|
||||
<tr>
|
||||
<td colspan="8">暂无输出记录,点击"新建排版"创建</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
{$list|raw}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 图片预览弹窗容器 -->
|
||||
<div id="image-preview-panel" style="display:none; margin-top:15px; padding:15px; background:#fff; border:1px solid #e8e8e8; border-radius:4px;">
|
||||
<div style="margin-bottom:10px; display:flex; justify-content:space-between; align-items:center;">
|
||||
<strong>图片预览</strong>
|
||||
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary" id="btn-close-preview">
|
||||
<i class="layui-icon layui-icon-close"></i> 关闭
|
||||
</button>
|
||||
</div>
|
||||
<div id="image-preview-list" style="display:flex; flex-wrap:wrap; gap:10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="common/_footer"}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 查看图片
|
||||
$('.btn-view-images').click(function () {
|
||||
var outputId = $(this).data('output-id');
|
||||
var $panel = $('#image-preview-panel');
|
||||
var $list = $('#image-preview-list');
|
||||
|
||||
$list.html('<div style="padding:20px;">加载中...</div>');
|
||||
$panel.show();
|
||||
|
||||
$.get('{:url("post/getOutputFiles")}', { output_id: outputId }, function (res) {
|
||||
if (res.code !== 0) {
|
||||
$list.html('<div style="color:red;">' + (res.msg || '加载失败') + '</div>');
|
||||
return;
|
||||
}
|
||||
if (!res.data || res.data.length === 0) {
|
||||
$list.html('<div style="color:#999;">暂无图片</div>');
|
||||
return;
|
||||
}
|
||||
var html = '';
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
var f = res.data[i];
|
||||
html += '<div style="width:120px; text-align:center;">';
|
||||
html += '<img src="' + f.file_url + '" style="max-width:120px; max-height:200px; border:1px solid #eee; border-radius:4px;" alt="第' + f.page + '页">';
|
||||
html += '<div style="font-size:12px; color:#999; margin-top:4px;">第' + f.page + '页</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
$list.html(html);
|
||||
}).fail(function () {
|
||||
$list.html('<div style="color:red;">网络错误</div>');
|
||||
});
|
||||
});
|
||||
|
||||
// 关闭预览
|
||||
$('#btn-close-preview').click(function () {
|
||||
$('#image-preview-panel').hide();
|
||||
});
|
||||
|
||||
// 删除输出
|
||||
$('.btn-delete-output').click(function () {
|
||||
var btn = $(this);
|
||||
var outputId = btn.data('output-id');
|
||||
layer.confirm('确定要删除该输出记录吗?图片文件将一并删除。', function () {
|
||||
$.get('{:url("post/deletePostOutput")}', { id: outputId }, function (res) {
|
||||
if (res.code === 0) {
|
||||
layer.msg('删除成功');
|
||||
btn.parents('.item').remove();
|
||||
$('#image-preview-panel').hide();
|
||||
} else {
|
||||
layer.msg(res.msg || '删除失败');
|
||||
}
|
||||
}).fail(function () {
|
||||
layer.msg('网络错误');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user