|
@@ -1,49 +1,55 @@
|
|
|
#set(title="新闻管理")
|
|
|
#@header()
|
|
|
<style>
|
|
|
- .flex{width: 200px;cursor: pointer;}
|
|
|
- .flex .l{padding: 10px 20px 10px 20px;font-size: 15px;font-weight: bold;position: relative;}
|
|
|
- .flex .l.active{border-bottom: 3px solid darkcyan;color:darkcyan}
|
|
|
- .badge-danger{position:absolute;right:0;top:0;}
|
|
|
+ .input-text{width: 120px!important;}
|
|
|
+ .toolbar .search{width: 500px;}
|
|
|
</style>
|
|
|
<body>
|
|
|
<div class="con">
|
|
|
- <div class="toolbar">
|
|
|
+ <form class="form-inline toolbar">
|
|
|
|
|
|
#@menu(menu_list)
|
|
|
- <div class="input-group search">
|
|
|
+ <input type="text" class="form-control input-text Wdate" placeholder="开始日期"
|
|
|
+ onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'max\')||\'%y-%M-%d\'}'})" id="min">
|
|
|
+ -
|
|
|
+ <input type="text" class="form-control input-text Wdate" placeholder="结束日期"
|
|
|
+ onfocus="WdatePicker({minDate:'#F{$dp.$D(\'min\')}',maxDate:'%y-%M-%d'})" id="max">
|
|
|
+ <div class="input-group search" id="app">
|
|
|
<div class="input-group-btn">
|
|
|
-
|
|
|
- <select class="form-control select" id="mType">
|
|
|
+
|
|
|
+ <select class="form-control select" v-model="type" @change="selected(1)">
|
|
|
+ <option :value="type.id" v-for="type in type_list">{{type.name}}</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="input-group-btn">
|
|
|
+
|
|
|
+ <select class="form-control select" v-model="colmunId" @change="selected(2)">
|
|
|
<option value="">全部栏目</option>
|
|
|
- #for(column in column_list)
|
|
|
- <option value="1">#(column.mColumnName)</option>
|
|
|
- #end
|
|
|
+ <option :value="colmun.id" v-for="colmun in colmun_list">{{colmun.mColumnName}}</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
- <input type="text" id="name" placeholder="输入栏目名称名称" class="form-control">
|
|
|
- <span class="input-group-btn"><button type="button" id="search" class="btn btn-primary">搜索</button></span>
|
|
|
+ <input type="text" id="name" placeholder="输入文章名称" class="form-control">
|
|
|
+ <span class="input-group-btn">
|
|
|
+ <button type="button" @click="search()" class="btn btn-primary">搜索</button>
|
|
|
+ <button type="reset" class="btn btn-default">重置</button>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<a class="pull-right refresh" href="javascript:location.replace(location.href);"><i class="fa fa-history"></i> 刷新</a>
|
|
|
- </div>
|
|
|
+ </form>
|
|
|
<div class="mbox">
|
|
|
- <div class="flex">
|
|
|
- <div class="l active" onclick="selected(this,'时政信息')">时政信息 <span class="badge badge-danger">53</span></div>
|
|
|
- <div class="l" onclick="selected(this,'政策宣传')">政策宣传 <span class="badge badge-danger">26</span></div>
|
|
|
- </div>
|
|
|
<table id="jqGrid"></table>
|
|
|
<div id="jqGridPager"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-#set(layer=true,util=true,jgrid=true)
|
|
|
+#set(layer=true,util=true,jgrid=true,vue=true,date=true)
|
|
|
#@js()
|
|
|
<script>
|
|
|
var colModel=[
|
|
|
{ label: 'ID', name: 'id',hidden : true,frozen: true},
|
|
|
- { label: '文章标题', name: 'mTitle',frozen: true,width:300},
|
|
|
+ { label: '文章标题', name: 'mTitle',frozen: true,width:330},
|
|
|
{ label: '文章栏目', name: 'mColumnName'},
|
|
|
{ label: '文章归类', name: 'typeName'},
|
|
|
- { label: '文章状态', name: 'mRelease'},
|
|
|
+ { label: '文章状态', name: 'mRelease',formatter: mShow},
|
|
|
{ label: '是否置顶', name: 'isTop'},
|
|
|
{ label: '发布人', name: 'realName'},
|
|
|
{ label: '发布时间', name: 'mTime'},]
|
|
@@ -58,11 +64,6 @@
|
|
|
return '<span class="label label-sm label-danger">不显示</span>';
|
|
|
}
|
|
|
}
|
|
|
- function selected(e,typeName){
|
|
|
- $(".l").removeClass("active");
|
|
|
- $(e).addClass("active");
|
|
|
- $("#jqGrid").jqGrid('setGridParam',{datatype:'json',postData:{type:typeName,name:'',columnId:'',mRelease:''},page:1}).trigger("reloadGrid");
|
|
|
- }
|
|
|
/**
|
|
|
* 操作
|
|
|
*/
|
|
@@ -77,6 +78,42 @@
|
|
|
deleteRows("#(path)/admin/work/news/delete?ids=");
|
|
|
}
|
|
|
}
|
|
|
+ var vm = new Vue({
|
|
|
+ el: "#app",
|
|
|
+ data: {
|
|
|
+ type:1,
|
|
|
+ type_list:[{name:'时政信息',id:1},{name:'政策宣传',id:2}],
|
|
|
+ colmun_list:[],
|
|
|
+ colmunId:''
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ this.getColmun(1);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //选择栏目
|
|
|
+ selected:function(index){
|
|
|
+ if(index==1){
|
|
|
+ this.getColmun(this.type);
|
|
|
+ this.colmunId='';
|
|
|
+ reloadGrid({type:this.type==1?'时政信息':'政策宣传',name:'',columnId:'',mRelease:''});
|
|
|
+ }
|
|
|
+ if(index==2){
|
|
|
+ reloadGrid({columnId:this.colmunId,min:'',max:'',name:''});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询文章
|
|
|
+ search:function(){
|
|
|
+ reloadGrid({columnId:'',min: $("#min").val(),max: $("#max").val(),name: $("#name").val()});
|
|
|
+ },
|
|
|
+ //获取栏目
|
|
|
+ getColmun:function(e){
|
|
|
+ sendAjax("#(path)/admin/work/news/colmun_list",{type:e},function(res){
|
|
|
+ vm.colmun_list=res;
|
|
|
+ cancelLoding();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|