完善单页面

This commit is contained in:
muzi_ys 2022-07-05 00:10:25 +08:00
parent c6a0489fa8
commit 509028dc4f
3 changed files with 92 additions and 149 deletions

View File

@ -187,8 +187,7 @@ class Page extends AuthController
'name' => '', 'name' => '',
'status' => '' 'status' => ''
]; ];
$category = cModel::systemPage($where);
$category = get_tree_list($category);
$this->assign("category", $category); $this->assign("category", $category);
$this->assign("category_id", $category_id); $this->assign("category_id", $category_id);
return $this->fetch(); return $this->fetch();

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<head> <head>
<title>添加文章 - {:system_config('title')}后台管理系统</title> <title>添加页面 - {:system_config('title')}后台管理系统</title>
{include file="public/header" /} {include file="public/header" /}
<!--标签插件--> <!--标签插件-->
<link rel="stylesheet" href="/static/admin/js/jquery-tags-input/jquery.tagsinput.min.css"> <link rel="stylesheet" href="/static/admin/js/jquery-tags-input/jquery.tagsinput.min.css">
@ -15,131 +15,80 @@
<div class="card-body"> <div class="card-body">
<ul id="myTabs" class="nav nav-tabs" role="tablist"> <ul id="myTabs" class="nav nav-tabs" role="tablist">
<li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li> <li class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab">基本信息</a></li>
<li><a href="#profile" role="tab" id="profile-tab" data-toggle="tab">文章设置</a></li> <li class="tab-right"><a data-toggle="tooltip" data-original-title="返回" onclick="history.back(-1);return false;">返 回</a></li>
<li class="tab-right"><a data-toggle="tooltip" data-original-title="返回"
onclick="history.back(-1);return false;">返 回</a></li>
</ul> </ul>
<div id="myTabContent" class="tab-content"> <div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home"> <form action="#!" method="post" class="row add-form" onsubmit="return false;">
<form action="#!" method="post" class="row add-form" onsubmit="return false;"> <div class="form-group col-md-12">
<div class="form-group col-md-12"> <label>页面名称</label>
<label>文章名称</label> <input type="text" class="form-control" id="title" name="title" value="" placeholder="页面名称"/>
<input type="text" class="form-control" id="title" name="title" value="" </div>
placeholder="文章名称"/> <div class="form-group">
</div> <div class="row">
<div class="form-group col-md-12">
<label>别名</label>
<input type="text" class="form-control" id="alias" name="alias" value=""
placeholder="别名索引"/>
</div>
<div class="form-group col-md-12">
<label for="category_id">栏目分类</label>
<div class="form-controls">
<select name="category_id" id="category_id" class="form-control">
<option value="0">请选择</option>
{volist name="category" id="vo"}
<option value="{$vo.id}"
{notempty name="pid" }{if $vo.id==$category_id}selected{/if} {/notempty}
>{$vo.html}{$vo.title}</option>
{/volist}
</select>
</div>
</div>
<div class="form-group col-md-12">
<label for="writer">作者</label>
<input type="text" class="form-control" id="writer" name="writer" value=""
placeholder="原作者"/>
</div>
<div class="form-group col-md-12">
<label>主图</label>
<div class="form-controls">
<ul class="list-inline clearfix lyear-uploads-pic">
<li class="col-xs-4 col-sm-3 col-md-2" id="pic-image" style="display: none;">
</li>
<li class="col-xs-4 col-sm-3 col-md-2" id="pic-upload">
<input type="hidden" class="form-control" name="cover_path" id="cover_path"
value=""/>
<input type="file" id="file_cover_path" accept="image/*" style="display: none;"
onchange="upload('cover_path')"/>
<a class="pic-add" href="#!" onclick="btnClick('cover_path')"
title="上传"></a>
</li>
</ul>
</div>
</div>
<div class="form-group col-md-12">
<label for="abstract">摘要</label>
<input type="text" class="form-control" name="abstract" id="abstract"
placeholder="请输入摘要">
</div>
<div class="form-group col-md-12">
<label for="abstract">标签</label>
<input class="form-control js-tags-input" type="text" name="tags" data-height="38px"
placeholder="请输入标签">
</div>
<div class="form-group col-md-12">
<label for="content">文章内容</label>
<textarea id="content" name="content" data-provide="summernote" data-toolbar="full"></textarea>
</div>
<div class="form-group col-md-12">
<button type="submit" class="btn btn-primary ajax-post" target-form="add-form">立即提交
</button>
</div>
</form>
</div>
<div class="tab-pane fade" id="profile">
<form action="#!" method="post" class="row add-form" onsubmit="return false;">
<div class="form-group row col-md-2">
<div class="col-xs-6">推荐</div>
<div class="col-xs-6"> <div class="col-xs-6">
<label class="lyear-switch switch-solid switch-primary"> <label>展示模板</label>
<input type="checkbox" name="is_recommend"> <input class="form-control" name="theme" type="text" placeholder="展示模板">
<span></span>
</label>
</div> </div>
</div>
<div class="form-group row col-md-2">
<div class="col-xs-6">热门</div>
<div class="col-xs-6"> <div class="col-xs-6">
<label class="lyear-switch switch-solid switch-primary"> <label>URL名称</label>
<input type="checkbox" name="is_hot"> <input class="form-control" id="alias" name="alias" type="text" placeholder="URL名称">
<span></span>
</label>
</div> </div>
</div> </div>
<div class="form-group row col-md-2"> </div>
<div class="col-xs-6">置顶</div> <div class="form-group col-md-12">
<div class="col-xs-6"> <label for="abstract">排序</label>
<label class="lyear-switch switch-solid switch-primary"> <input type="text" class="form-control" name="sort" placeholder="请输入排序" value="99">
<input type="checkbox" name="is_top"> </div>
<span></span> <div class="form-group col-md-12">
</label> <label for="link_str">外链</label>
</div> <input type="text" class="form-control" name="link_str" id="link_str" placeholder="外链">
</div>
<div class="form-group col-md-12">
<label for="keywords">seo关键字</label>
<input type="text" class="form-control" id="keywords" name="keywords"
placeholder="请输入seo关键字">
</div>
<div class="form-group col-md-12">
<label for="description">seo描述</label>
<input type="text" class="form-control" name="description" id="description"
placeholder="seo描述">
</div>
<div class="form-group col-md-12">
<label>主图</label>
<div class="form-controls">
<ul class="list-inline clearfix lyear-uploads-pic">
<li class="col-xs-4 col-sm-3 col-md-2" id="pic-image" style="display: none;">
</li>
<li class="col-xs-4 col-sm-3 col-md-2" id="pic-upload">
<input type="hidden" class="form-control" name="cover_path" id="cover_path"
value=""/>
<input type="file" id="file_cover_path" accept="image/*" style="display: none;"
onchange="upload('cover_path')"/>
<a class="pic-add" href="#!" onclick="btnClick('cover_path')"
title="上传"></a>
</li>
</ul>
</div> </div>
<div class="form-group col-md-12"> </div>
<label for="abstract">排序</label> <div class="form-group col-md-12">
<input type="text" class="form-control" name="sort" placeholder="请输入排序" value="99"> <label for="abstract">摘要</label>
</div> <input type="text" class="form-control" name="abstract" id="abstract"
<div class="form-group col-md-12"> placeholder="请输入摘要">
<label for="link_str">外链</label> </div>
<input type="text" class="form-control" name="link_str" id="link_str" placeholder="外链"> <div class="form-group col-md-12">
</div> <label for="abstract">标签</label>
<div class="form-group col-md-12"> <input class="form-control js-tags-input" type="text" name="tags" data-height="38px"
<label for="keywords">seo关键字</label> placeholder="请输入标签">
<input type="text" class="form-control" id="keywords" name="keywords" </div>
placeholder="请输入seo关键字"> <div class="form-group col-md-12">
</div> <label for="content">页面内容</label>
<div class="form-group col-md-12"> <textarea id="content" name="content" data-provide="summernote" data-toolbar="full"></textarea>
<label for="description">seo描述</label> </div>
<input type="text" class="form-control" name="description" id="description" <div class="form-group col-md-12">
placeholder="seo描述"> <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">立即提交
</div> </button>
<div class="form-group col-md-12"> </div>
<button type="submit" class="btn btn-primary ajax-post" target-form="add-form">立即提交 </form>
</button>
</div>
</form>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -253,14 +202,9 @@
$.each(Arr, function (index, item) { $.each(Arr, function (index, item) {
try { try {
switch (item.name) { switch (item.name) {
case 'category_id':
if (!item.value) {
throw "栏目分类不能为空";
}
break;
case 'title': case 'title':
if (!item.value) { if (!item.value) {
throw "文章名称不能为空"; throw "页面名称不能为空";
} }
break; break;
case 'cover_path': case 'cover_path':

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<head> <head>
<title>文章管理 - {:system_config('title')}后台管理系统</title> <title>页面管理 - {:system_config('title')}后台管理系统</title>
{include file="public/header" /} {include file="public/header" /}
</head> </head>
<body> <body>
@ -13,10 +13,10 @@
<div class="card-body"> <div class="card-body">
<form class="form-inline searchForm" onsubmit="return false;"> <form class="form-inline searchForm" onsubmit="return false;">
<div class="form-group"> <div class="form-group">
<label for="title">文章标题</label> <label for="title">页面标题</label>
<div class="input-group"> <div class="input-group">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" id="title" name="title" placeholder="请输入文章标题"> <input type="text" class="form-control" id="title" name="title" placeholder="请输入页面标题">
</div> </div>
</div> </div>
</div> </div>
@ -92,8 +92,26 @@
field: 'title', field: 'title',
title: '标题' title: '标题'
}, { }, {
field: 'category_title', field: 'alias',
title: '分类', title: 'URL名称'
}, {
field: 'theme',
title: '模板文件',
}, {
field: 'create_time',
title: '发布时间',
}, {
field: 'sort',
title: '排序',
editable: {
type: 'text',
emptytext: '',
highlight: false,
mode: 'inline'
}
}, {
field: 'view',
title: '浏览量',
}, { }, {
field: 'display', field: 'display',
title: '可见性', title: '可见性',
@ -107,24 +125,6 @@
result = '<label class="lyear-switch switch-primary switch-solid lyear-status"><input type="checkbox" ' + is_checked + '><span onClick="updateStatus(' + row.id + ', ' + value + ', \'' + field + '\')"></span></label>'; result = '<label class="lyear-switch switch-primary switch-solid lyear-status"><input type="checkbox" ' + is_checked + '><span onClick="updateStatus(' + row.id + ', ' + value + ', \'' + field + '\')"></span></label>';
return result; return result;
}, },
}, {
field: 'view',
title: '浏览量',
}, {
field: 'sort',
title: '排序',
editable: {
type: 'text',
emptytext: '',
highlight: false,
mode: 'inline'
}
}, {
field: 'create_time',
title: '创建时间',
}, {
field: 'create_time',
title: '更新时间',
}, { }, {
field: 'operate', field: 'operate',
title: '操作', title: '操作',