first commit
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
{eq name="$id" value="0"}
|
||||
<h3 class="pb-3">新增公司新闻</h3>
|
||||
{else/}
|
||||
<h3 class="pb-3">编辑公司新闻</h3>
|
||||
{/eq}
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">新闻标题<font>*</font></td>
|
||||
<td colspan="3">
|
||||
<input type="text" name="title" lay-verify="required" lay-reqText="请输入新闻标题" placeholder="请输入新闻标题" class="layui-input" value="{$detail.title|default=''}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">关联链接</td>
|
||||
<td><input type="text" name="src" placeholder="请输入链接" class="layui-input" value="{$detail.src|default=''}"></td>
|
||||
<td class="layui-td-gray">排序</td>
|
||||
<td><input type="text" name="sort" placeholder="请输入排序,数字" class="layui-input" value="{$detail.sort|default=0}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray-2">
|
||||
<div class="layui-input-inline">相关附件</div>
|
||||
<div class="layui-input-inline">
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="uploadBtn"><i class="layui-icon"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<div class="layui-row" id="uploadBox">
|
||||
<input type="hidden" data-type="file" name="file_ids" value="{$detail.file_ids|default=''}">
|
||||
{notempty name="$detail.file_ids"}
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div class="layui-col-md4" id="uploadFile{$vo.id}">{:file_card($vo)}</div>
|
||||
{/volist}
|
||||
{/notempty}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="vertical-align:top;">新闻内容<font>*</font></td>
|
||||
<td colspan="3">
|
||||
<textarea name="content" placeholder="请输入内容" class="layui-textarea" id="container" style="border:0;padding:0">{$detail.content|default=''}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="pt-4">
|
||||
<input type="hidden" name="id" value="{$id}" />
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','uploadPlus','tinymce'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool=layui.tool,uploadPlus = layui.uploadPlus;
|
||||
//相关附件上传
|
||||
var attachment = new uploadPlus();
|
||||
//编辑器初始化
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container",
|
||||
images_upload_url: '/api/index/upload/sourse/tinymce',//图片上传接口
|
||||
height: 500
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.content = tinyMCE.editors['container'].getContent();
|
||||
if (data.field.content == '') {
|
||||
layer.msg('请先完善新闻内容');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
let clickbtn = $(this);
|
||||
tool.post("/adm/news/add", data.field, callback,clickbtn);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
||||
@@ -0,0 +1,86 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-page">
|
||||
<form class="layui-form gg-form-bar border-t border-x" lay-filter="barsearchform">
|
||||
<div class="layui-input-inline" style="width:300px">
|
||||
<input type="text" name="keywords" placeholder="关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:150px">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="table-search"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
|
||||
<button type="reset" class="layui-btn layui-btn-reset" lay-filter="table-reset">清空</button>
|
||||
</div>
|
||||
</form>
|
||||
<table class="layui-hide" id="table_news" lay-filter="table_news"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<button class="layui-btn layui-btn-sm tool-add" type="button" data-href="/adm/news/add">+ 添加公司新闻</button>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool','tablePlus'];
|
||||
function gouguInit() {
|
||||
var table = layui.tablePlus, tool = layui.tool;
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: "#table_news"
|
||||
, toolbar: "#toolbarDemo"
|
||||
,url: "/adm/news/datalist"
|
||||
,page: true
|
||||
,limit: 20
|
||||
,cellMinWidth: 80
|
||||
,height: 'full-114'
|
||||
,cols: [[
|
||||
{field:'id',width:80, title: 'ID号', align:'center'}
|
||||
,{field:'title',title: '名称'}
|
||||
,{field:'admin_name',title: '创建人',width:90,align:'center'}
|
||||
,{field:'create_time', title: '创建时间',width:150,align:'center'}
|
||||
,{width:120,fixed:'right',title: '操作', align:'center',ignoreExport:true,templet: function(d){
|
||||
var html='';
|
||||
var btn1='<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view">详细</a>';
|
||||
var btn2='<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>';
|
||||
var btn3='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>';
|
||||
html = '<div class="layui-btn-group">'+btn1+btn2+btn3+'</div>';
|
||||
return html;
|
||||
}}
|
||||
]]
|
||||
});
|
||||
|
||||
table.on('tool(table_news)',function (obj) {
|
||||
var checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
|
||||
var data = obj.data;
|
||||
if (obj.event === 'view') {
|
||||
tool.side("/adm/news/view?id="+data.id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'edit') {
|
||||
tool.side("/adm/news/add?id="+data.id);
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该内容吗?', { icon: 3, title: '提示' }, function (index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/adm/news/del", { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
||||
@@ -0,0 +1,63 @@
|
||||
{extend name="../../base/view/common/base" /}
|
||||
{block name="style"}
|
||||
<link rel="stylesheet" href="{__GOUGU__}/third_party/prism/prism.css"/>
|
||||
<style>
|
||||
.text-detial-ops{line-height: 30px; color:#999; font-size: 12px; padding: 12px 0;}
|
||||
.text-detial-ops span{margin-right: 20px;}
|
||||
.text-detial-ops a{margin-right:10px;}
|
||||
.text-detial-content{padding: 8px 0; color:#333; word-break: break-all; border-top:1px solid #e8e8e8;font-size: 16px!important; line-height: 1.72!important;}
|
||||
.text-detial-content p{padding: 8px 0;}
|
||||
.text-detial-content img{max-width:98%!important; margin:0 auto; display:block; border: 1px solid #e6e6e6; -webkit-box-shadow: 0 2px 6px rgba(26,26,26,.08); box-shadow: 0 2px 6px rgba(26,26,26,.08); border-radius: 4px;}
|
||||
.text-detial-content h1,.text-detial-content h2,.text-detial-content h3,.text-detial-content h4,.text-detial-content h5{margin-top:10px;}
|
||||
.text-detial-content a{color:#186AF2; font-style:italic;}
|
||||
.text-detial-content a:hover{text-decoration:underline;}
|
||||
|
||||
.text-detial-content p code,.blog-detial-content pre{margin:0 3px;font-size: 14px; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background: #f6f6f6; padding: 10px; border-radius: 2px;}
|
||||
.text-detial-content p code{border: 1px solid #eee;padding: 2px 4px;}
|
||||
.text-detial-content table {border-collapse: collapse; border-spacing: 0; display: block; width: 100%; overflow: auto; word-break: normal;word-break: keep-all; margin-top: 0;margin-bottom: 16px;}
|
||||
.text-detial-content table tr {background-color: #fff;border-top: 1px solid #ccc;}
|
||||
.text-detial-content table tr:nth-child(2n) {background-color: #f8f8f8;}
|
||||
.text-detial-content table td, .blog-detial-content table th { padding: 6px 12px;border: 1px solid #ddd; font-size:14px; }
|
||||
.text-detial-content table th {font-weight: 800;}
|
||||
.text-detial-content li {list-style: initial;margin-left: 20px;}
|
||||
:not(pre)>code[class*=language-], pre[class*=language-]{background:#fff!important;border:1px solid #e8e8e8!important; border-radius:3px;}
|
||||
.upload-file{padding:12px; background-color:#fff; border:1px solid #eee; margin-bottom:12px;}
|
||||
.upload-file h3{margin-bottom:12px;}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h1>{$detail.title}</h1>
|
||||
<div class="text-detial-ops">
|
||||
<span>{$detail.admin_name}发表于:{$detail.create_time | date='Y-m-d H:i:s'}</span>
|
||||
</div>
|
||||
<div class="text-detial-content">
|
||||
{$detail.content|raw}
|
||||
</div>
|
||||
{notempty name="$detail.src"}
|
||||
<div class="py-3" style="font-size:16px;">
|
||||
关联链接:<a class="blue" href="{$detail.src}" target="_blank">{$detail.src}</a>
|
||||
</div>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_ids"}
|
||||
<div class="upload-file layui-row">
|
||||
<h3>相关附件</h3>
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div class="layui-col-md4" id="uploadFile{$vo.id}">{:file_card($vo,'view')}</div>
|
||||
{/volist}
|
||||
</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
{/block}
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="{__GOUGU__}/third_party/prism/prism.js"></script>
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool=layui.tool;
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
||||
Reference in New Issue
Block a user