Authored by 陶雨

运营管理 -> 分类管理

... ... @@ -6,14 +6,21 @@
module.exports=function(app) {
/*分类管理首页*/
app.get("/operations/category/index","operations.category.Index");
app.get("/operations/category/index","operations.category.Index", function () {
this.$extend = {
moduleName: "分类管理",
pageName: "分类列表管理"
}
});
/*分类管理添加页面*/
app.get("/operations/category/add","operations.category.Edit", "resourceManage_getUrlAction", function (response) {
this.$extend = {
data:response.data,
action:"/category/addCategory",
type:"add"
type:"add",
moduleName: "分类管理",
pageName: "添加分类"
};
});
... ... @@ -22,7 +29,9 @@ module.exports=function(app) {
this.$extend = {
data:response.data,
action:"/category/updateCategory",
type:"edit"
type:"edit",
moduleName: "分类管理",
pageName: "编辑分类"
};
});
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="/guang/article/index">分类管理</a></li>
<li>添加分类</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>添加分类</h4>
</div>
<div style="width: 70%;float: right;">
</div>
</div>
</div>
</div><!-- media -->
</div>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">添加分类</h4>
<h4 class="panel-title"><%pageName%></h4>
</div><!-- panel-heading -->
<div id="info-content" class="panel-body" action="{{action}}" type="{{type}}">
<div id="info-content" class="panel-body" action="<%action%>" type="<%type%>">
</div><!-- panel-body -->
<div class="panel-footer">
... ... @@ -53,20 +30,20 @@
<div class="form-group">
<label class="col-sm-1 control-label">分类名称</label>
<div class="col-sm-9">
<input type="text" value="<%sortName%>" class="form-control observe" data-field="sortName" placeholder="分类名称" required>
<input type="text" value="[[sortName]]" class="form-control observe" data-field="sortName" placeholder="分类名称" required>
<p style="color:#999">注:分类名称必填</p>
</div>
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-1 control-label">英文名称</label>
<div class="col-sm-9">
<input type="text" value="<%sortNameEn%>" class="form-control observe" data-field="sortNameEn" placeholder="英文名称" required>
<input type="text" value="[[sortNameEn]]" class="form-control observe" data-field="sortNameEn" placeholder="英文名称" required>
</div>
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-1 control-label">色值</label>
<div class="col-sm-2">
<input type="text" value="<%sortNameColor%>" data-field="sortNameColor" class="form-control observe" prompt="色值">
<input type="text" value="[[sortNameColor]]" data-field="sortNameColor" class="form-control observe" prompt="色值">
</div>
</div><!-- form-group -->
<div class="form-group">
... ... @@ -78,14 +55,14 @@
<div class="form-group">
<label class="col-sm-1 control-label">分类图标</label>
<div class="col-sm-9">
<input type="file" name="file" prompt="分类图标" value="<%sortIco%>" class="observe" data-field="sortIco">
<input type="file" name="file" prompt="分类图标" value="[[sortIco]]" class="observe" data-field="sortIco">
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">分类大图标</label>
<div class="col-sm-9">
<input type="file" name="file" prompt="分类大图标" value="<%sortIcoBig%>" class="observe" data-field="sortIcoBig">
<input type="file" name="file" prompt="分类大图标" value="[[sortIcoBig]]" class="observe" data-field="sortIcoBig">
</div>
</div>
... ... @@ -95,13 +72,13 @@
<input type="radio" name="isNewPage" style="width:18px;height:18px;" value="N"> 当前页面打开
<input type="radio" style="width:18px;height:18px;" name="isNewPage" value="Y" checked> 新页面打开
</div>
<input type="hidden" id="isNewPage" for="radio" value="<%isNewPage%>">
<input type="hidden" id="isNewPage" for="radio" value="[[isNewPage]]">
</div>
<div class="form-group">
<label class="col-sm-1 control-label">跳转链接</label>
<div class="col-sm-9">
<input type="text" id="sortUrl" value='<%sortUrl%>' class="form-control" placeholder="跳转链接" required readonly style="cursor: not-allowed;">
<input type="text" id="sortUrl" value='[[sortUrl]]' class="form-control" placeholder="跳转链接" required readonly style="cursor: not-allowed;">
<a class="btn btn-info" id="addUrl">添加链接</a>
<p style="color:#999">注:必填,链接中不能有英文单引号</p>
</div>
... ... @@ -112,7 +89,7 @@
<input type="radio" name="separativeSign" style="width:18px;height:18px;" value="Y">
<input type="radio" style="width:18px;height:18px;" name="separativeSign" value="N" checked>
</div>
<input type="hidden" id="separativeSign" for="radio" value="<%separativeSign%>">
<input type="hidden" id="separativeSign" for="radio" value="[[separativeSign]]">
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-1 control-label">是否新品</label>
... ... @@ -120,7 +97,7 @@
<input type="radio" name="isNew" style="width:18px;height:18px;" value="Y">
<input type="radio" style="width:18px;height:18px;" name="isNew" value="N" checked>
</div>
<input type="hidden" id="isNew" for="radio" value="<%isNew%>">
<input type="hidden" id="isNew" for="radio" value="[[isNew]]">
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-1 control-label">是否热门</label>
... ... @@ -128,12 +105,12 @@
<input type="radio" name="isHot" style="width:18px;height:18px;" value="Y">
<input type="radio" style="width:18px;height:18px;" name="isHot" value="N" checked>
</div>
<input type="hidden" id="isHot" for="radio" value="<%isHot%>">
<input type="hidden" id="isHot" for="radio" value="[[isHot]]">
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-1 control-label">位置码</label>
<div class="col-sm-4">
<input type="text" data-field="contentCode" value="<%contentCode%>" class="form-control observe" placeholder="资源位位置码">
<input type="text" data-field="contentCode" value="[[contentCode]]" class="form-control observe" placeholder="资源位位置码">
</div>
</div><!-- form-group -->
<div class="form-group">
... ... @@ -147,12 +124,12 @@
<input type="checkbox" value="web" style="width:18px;height:18px;margin-left:5px;" name="platform"> 网站
<input type="checkbox" value="platform" style="width:18px;height:18px;margin-left:5px;" name="platform"> 平台
</div>
<input type="hidden" id="platform" for="checkbox" value="<%platform%>">
<input type="hidden" id="platform" for="checkbox" value="[[platform]]">
</div><!-- form-group -->
<div class="form-group">
<label class="col-sm-1 control-label">排序</label>
<div class="col-sm-9">
<input type="text" value="<%orderBy%>" data-field="orderBy" class="form-control observe" placeholder="排序" required>
<input type="text" value="[[orderBy]]" data-field="orderBy" class="form-control observe" placeholder="排序" required>
</div>
</div><!-- form-group -->
</div><!-- row -->
... ... @@ -165,7 +142,7 @@
<div class="col-sm-8">
<select name="goTo" id="goTo" class="form-control">
<%layout action_template%>
[[layout action_template]]
</select>
</div>
... ... @@ -183,40 +160,40 @@
</script>
<script type="text/template" id="categories-template">
<select id="firstSortId" value="<%firstSortId%>" data-field="firstSortId" style="width:150px;" tabindex="-1" title="" class="select2-offscreen observe">
<select id="firstSortId" value="[[firstSortId]]" data-field="firstSortId" style="width:150px;" tabindex="-1" title="" class="select2-offscreen observe">
<option value="">请选择根分类</option>
<%each categories as item index%>
<option value="<%item.id%>"><%item.sort_name%></option>
<%/each%>
[[each categories as item index]]
<option value="[[item.id]]">[[item.sort_name]]</option>
[[/each]]
</select>
<select id="secondSortId" value="<%secondSortId%>" data-field="secondSortId" style="width:150px;margin-left:10px;" tabindex="-1" class="select2-offscreen observe">
<select id="secondSortId" value="[[secondSortId]]" data-field="secondSortId" style="width:150px;margin-left:10px;" tabindex="-1" class="select2-offscreen observe">
<option value="">请选择二级分类</option>
<%if firstSortId%>
<%each categories as item index%>
<%if item.id == firstSortId && !!item.sub%>
<%each item.sub as item1 index1%>
<option value="<%item1.id%>"><%item1.sort_name%></option>
<%/each%>
<%/if%>
<%/each%>
<%/if%>
[[if firstSortId]]
[[each categories as item index]]
[[if item.id == firstSortId && !!item.sub]]
[[each item.sub as item1 index1]]
<option value="[[item1.id]]">[[item1.sort_name]]</option>
[[/each]]
[[/if]]
[[/each]]
[[/if]]
</select>
<select id="threadSortId" value="<%threadSortId%>" data-field="threadSortId" style="width:150px;margin-left:10px;" tabindex="-1" title="" class="select2-offscreen observe">
<select id="threadSortId" value="[[threadSortId]]" data-field="threadSortId" style="width:150px;margin-left:10px;" tabindex="-1" title="" class="select2-offscreen observe">
<option value="">请选择三级分类</option>
<%if firstSortId%>
<%each categories as item index%>
<%if item.id == firstSortId && !!item.sub%>
<%each item.sub as item1 index1%>
<%if item1.id == secondSortId && !!item1.sub%>
<%each item1.sub as item2 index2%>
<option value="<%item2.id%>"><%item2.sort_name%></option>
<%/each%>
<%/if%>
<%/each%>
<%/if%>
<%/each%>
<%/if%>
[[if firstSortId]]
[[each categories as item index]]
[[if item.id == firstSortId && !!item.sub]]
[[each item.sub as item1 index1]]
[[if item1.id == secondSortId && !!item1.sub]]
[[each item1.sub as item2 index2]]
<option value="[[item2.id]]">[[item2.sort_name]]</option>
[[/each]]
[[/if]]
[[/each]]
[[/if]]
[[/each]]
[[/if]]
</select>
</script>
<%include '../__partail/actions'%>
\ No newline at end of file
<%include '../../../resource/views/__partail/actions'%>
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">分类管理</a></li>
<li>分类列表管理</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>分类列表管理</h4>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a href="/operations/category/add" class="btn btn-info btn-xs">添加分类</a>
... ... @@ -59,114 +38,114 @@
<script type="text/template" id="grid-template">
<div class="dd" id="nestable" style="width:100%;">
<ol class="dd-list">
<%each data as item index%>
<li class="dd-item dd3-item" data-id="<%item.id%>">
[[each data as item index]]
<li class="dd-item dd3-item" data-id="[[item.id]]">
<div class="dd3-content">
<table class="table table-striped table-bordered" style="width:95%;padding:0px;margin:0px;">
<tr>
<td><b><%item.sort_name%></b></td>
<td><%item.sort_name_en ? item.sort_name_en : " "%></td>
<td><b>[[item.sort_name]]</b></td>
<td>[[item.sort_name_en ? item.sort_name_en : " "]]</td>
<td width="100px">
<%if !!item.sort_ico%>
<img src="<%item.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')%>" width="32px"/>
<%/if%>
[[if !!item.sort_ico]]
<img src="[[item.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')]]" width="32px"/>
[[/if]]
</td>
<td><%item.platform%></td>
<td><%!!!item.sort_level ? '' : item.sort_level%></td>
<td class="sorting_1"><%item.status == 1 ? '已开启' : '已关闭'%></td>
<td>[[item.platform]]</td>
<td>[[!!!item.sort_level ? '' : item.sort_level]]</td>
<td class="sorting_1">[[item.status == 1 ? '已开启' : '已关闭']]</td>
<td>
<a href="/operations/category/edit/<%item.id%>" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="<%1-item.status%>" data-id="<%item.id%>" class="btn <%item.status == 1 ? 'btn-danger' : 'btn-info'%> btn-xs updateStatus"><%item.status == 1 ? '关闭分类' : '开启分类'%></a>
<a href="/operations/category/edit/[[item.id]]" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="[[1-item.status]]" data-id="[[item.id]]" class="btn [[item.status == 1 ? 'btn-danger' : 'btn-info']] btn-xs updateStatus">[[item.status == 1 ? '关闭分类' : '开启分类']]</a>
</td>
</tr>
</table>
</div>
<%if item.sub%>
[[if item.sub]]
<ol class="dd-list">
<%each item.sub as item1 index%>
<li class="dd-item dd3-item" data-id="<%item1.id%>">
[[each item.sub as item1 index]]
<li class="dd-item dd3-item" data-id="[[item1.id]]">
<div class="dd3-content" data-toggle="category">
<table class="table table-striped table-bordered" style="width:95%;padding:0px;margin:0px;">
<tr>
<td><b><%item1.sort_name%></b></td>
<td><%item1.sort_name_en ? item1.sort_name_en : " "%></td>
<td><b>[[item1.sort_name]]</b></td>
<td>[[item1.sort_name_en ? item1.sort_name_en : " "]]</td>
<td width="100">
<%if !!item1.sort_ico%>
<img src="<%item1.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')%>" width="32px"/>
<%/if%>
[[if !!item1.sort_ico]]
<img src="[[item1.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')]]" width="32px"/>
[[/if]]
</td>
<td><%item1.platform%></td>
<td><%!!!item1.sort_level ? '' : item1.sort_level%></td>
<td class="sorting_1"><%item1.status == 1 ? '已开启' : '已关闭'%></td>
<td>[[item1.platform]]</td>
<td>[[!!!item1.sort_level ? '' : item1.sort_level]]</td>
<td class="sorting_1">[[item1.status == 1 ? '已开启' : '已关闭']]</td>
<td>
<a href="/operations/category/edit/<%item1.id%>" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="<%1-item1.status%>" data-id="<%item1.id%>" class="btn <%item1.status == 1 ? 'btn-danger' : 'btn-info'%> btn-xs updateStatus"><%item1.status == 1 ? '关闭分类' : '开启分类'%></a>
<a href="/operations/category/edit/[[item1.id]]" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="[[1-item1.status]]" data-id="[[item1.id]]" class="btn [[item1.status == 1 ? 'btn-danger' : 'btn-info']] btn-xs updateStatus">[[item1.status == 1 ? '关闭分类' : '开启分类']]</a>
</td>
</tr>
</table>
</div>
<%if item1.sub%>
[[if item1.sub]]
<ol class="dd-list">
<%each item1.sub as item2 index%>
<li class="dd-item dd3-item" data-id="<%item2.id%>">
[[each item1.sub as item2 index]]
<li class="dd-item dd3-item" data-id="[[item2.id]]">
<div class="dd3-content" data-toggle="category">
<table class="table table-striped table-bordered" style="width:95%;padding:0px;margin:0px;">
<tr>
<td><b><%item2.sort_name%></b></td>
<td><%item2.sort_name_en ? item2.sort_name_en : " "%></td>
<td><b>[[item2.sort_name]]</b></td>
<td>[[item2.sort_name_en ? item2.sort_name_en : " "]]</td>
<td width="100">
<%if !!item2.sort_ico%>
<img src="<%item2.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')%>" width="32px"/>
<%/if%>
[[if !!item2.sort_ico]]
<img src="[[item2.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')]]" width="32px"/>
[[/if]]
</td>
<td><%item2.platform%></td>
<td><%!!!item2.sort_level ? '' : item2.sort_level%></td>
<td class="sorting_1"><%item2.status == 1 ? '已开启' : '已关闭'%></td>
<td>[[item2.platform]]</td>
<td>[[!!!item2.sort_level ? '' : item2.sort_level]]</td>
<td class="sorting_1">[[item2.status == 1 ? '已开启' : '已关闭']]</td>
<td>
<a href="/operations/category/edit/<%item2.id%>" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="<%1-item2.status%>" data-id="<%item2.id%>" class="btn <%item2.status == 1 ? 'btn-danger' : 'btn-info'%> btn-xs updateStatus"><%item2.status == 1 ? '关闭分类' : '开启分类'%></a>
<a href="/operations/category/edit/[[item2.id]]" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="[[1-item2.status]]" data-id="[[item2.id]]" class="btn [[item2.status == 1 ? 'btn-danger' : 'btn-info']] btn-xs updateStatus">[[item2.status == 1 ? '关闭分类' : '开启分类']]</a>
</td>
</tr>
</table>
</div>
<%if item2.sub%>
[[if item2.sub]]
<ol class="dd-list">
<%each item2.sub as item3 index%>
<li class="dd-item dd3-item" data-id="<%item3.id%>">
[[each item2.sub as item3 index]]
<li class="dd-item dd3-item" data-id="[[item3.id]]">
<div class="dd3-content" data-toggle="category">
<table class="table table-striped table-bordered" style="width:95%;padding:0px;margin:0px;">
<tr>
<td><b><%item3.sort_name%></b></td>
<td><%item3.sort_name_en ? item3.sort_name_en : " "%></td>
<td><b>[[item3.sort_name]]</b></td>
<td>[[item3.sort_name_en ? item3.sort_name_en : " "]]</td>
<td width="100">
<%if !!item3.sort_ico%>
<img src="<%item3.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')%>" width="32px"/>
<%/if%>
[[if !!item3.sort_ico]]
<img src="[[item3.sort_ico.replace('{mode}', '1').replace('{width}', '32').replace('{height}', '32')]]" width="32px"/>
[[/if]]
</td>
<td><%item3.platform%></td>
<td><%!!!item3.sort_level ? '' : item3.sort_level%></td>
<td class="sorting_1"><%item3.status == 1 ? '已开启' : '已关闭'%></td>
<td>[[item3.platform]]</td>
<td>[[!!!item3.sort_level ? '' : item3.sort_level]]</td>
<td class="sorting_1">[[item3.status == 1 ? '已开启' : '已关闭']]</td>
<td>
<a href="/operations/category/edit/<%item3.id%>" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="<%1-item3.status%>" data-id="<%item3.id%>" class="btn <%item3.status == 1 ? 'btn-danger' : 'btn-info'%> btn-xs updateStatus"><%item3.status == 1 ? '关闭分类' : '开启分类'%></a>
<a href="/operations/category/edit/[[item3.id]]" class="btn btn-primary btn-xs">编辑</a>
<a href="JavaScript:;" data-status="[[1-item3.status]]" data-id="[[item3.id]]" class="btn [[item3.status == 1 ? 'btn-danger' : 'btn-info']] btn-xs updateStatus">[[item3.status == 1 ? '关闭分类' : '开启分类']]</a>
</td>
</tr>
</table>
</div>
</li>
<%/each%>
[[/each]]
</ol>
<%/if%>
[[/if]]
</li>
<%/each%>
[[/each]]
</ol>
<%/if%>
[[/if]]
</li>
<%/each%>
[[/each]]
</ol>
<%/if%>
[[/if]]
</li>
<%/each%>
[[/each]]
</ol>
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -54,7 +54,6 @@ var util = {
dataType: 'json',
data: options.data || {},
success: function(res) {
res = res.data;
if (res.code != 200) {
util.__tip(res.message, "warning");
return false;
... ...
... ... @@ -3,8 +3,8 @@
*/
var $ = require('jquery'),
common = require('../common/common'),
Category = require('./partials/Category');
common = require('../../../common/common'),
Category = require('./../partials/Category');
var edit = new common.edit2(".row", {bucket:"yhb-img01"});
... ...
... ... @@ -3,8 +3,8 @@
*/
var $ = require('jquery'),
common = require('../common/common');
require('../util/jquery.nestable.js');
common = require('../../../common/common');
require('../../../common/util/jquery.nestable.js');
new common.dropDown({el: "#status"});
new common.dropDown({el: "#platform"});
... ...