Authored by csgyoho

grass-shieldarticle

@@ -59,6 +59,8 @@ @@ -59,6 +59,8 @@
59 </input> 59 </input>
60 <input class="easyui-combobox" id="recommendSort"> 60 <input class="easyui-combobox" id="recommendSort">
61 </input> 61 </input>
  62 + <input class="easyui-combobox" id="authStatus">
  63 + </input>
62 <a id="searchBtn" class="btn-info">筛选</a> 64 <a id="searchBtn" class="btn-info">筛选</a>
63 <!--<a id="addActivityBtn" class="btn-success">新增</a>--> 65 <!--<a id="addActivityBtn" class="btn-success">新增</a>-->
64 <a id="allBtn" class="btn-info">全部 </a> 66 <a id="allBtn" class="btn-info">全部 </a>
@@ -90,7 +92,7 @@ @@ -90,7 +92,7 @@
90 $("#startTimeStr").datetimebox('setValue',""); 92 $("#startTimeStr").datetimebox('setValue',"");
91 $("#endTimeStr").datetimebox('setValue',""); 93 $("#endTimeStr").datetimebox('setValue',"");
92 $("#activityListTable").datagrid("load", { 94 $("#activityListTable").datagrid("load", {
93 - authStatus: "1" 95 + authStatus: "-1"
94 }); 96 });
95 } 97 }
96 }); 98 });
@@ -141,6 +143,15 @@ @@ -141,6 +143,15 @@
141 data:[{text:"选择推荐顺序",value:"0"},{text:"推荐降序",value:"desc"},{text:"推荐升序",value:"asc"}] 143 data:[{text:"选择推荐顺序",value:"0"},{text:"推荐降序",value:"desc"},{text:"推荐升序",value:"asc"}]
142 }); 144 });
143 145
  146 + //是否屏蔽
  147 + $("#authStatus").combobox({
  148 + valueField : "value",
  149 + textField : "text",
  150 + required:false,
  151 + prompt: "请选择屏蔽状态",
  152 + data:[{text:"全部",value:"-1"},{text:"已屏蔽",value:"4"},{text:"未屏蔽",value:"1"}]
  153 + });
  154 +
144 // 检索按钮 155 // 检索按钮
145 $("#searchBtn").linkbutton({ 156 $("#searchBtn").linkbutton({
146 iconCls : "icon-search", 157 iconCls : "icon-search",
@@ -155,7 +166,7 @@ @@ -155,7 +166,7 @@
155 endTime = parseInt(new Date($("#endTimeStr").datetimebox('getValue')).getTime() ); 166 endTime = parseInt(new Date($("#endTimeStr").datetimebox('getValue')).getTime() );
156 } 167 }
157 $("#activityListTable").datagrid("load", { 168 $("#activityListTable").datagrid("load", {
158 - authStatus: "1", 169 + authStatus: $("#authStatus").combobox("getValue"),
159 publisher: $("#publisher").textbox("getValue"), 170 publisher: $("#publisher").textbox("getValue"),
160 authorUid: $("#publisherUid").textbox("getValue"), 171 authorUid: $("#publisherUid").textbox("getValue"),
161 articleId: $("#articleId").textbox("getValue"), 172 articleId: $("#articleId").textbox("getValue"),
@@ -180,7 +191,7 @@ @@ -180,7 +191,7 @@
180 articleId: $("#articleId").textbox("getValue"), 191 articleId: $("#articleId").textbox("getValue"),
181 source: $("#source").textbox("getValue"), 192 source: $("#source").textbox("getValue"),
182 recommendSort:$("#recommendSort").combobox("getValue"), 193 recommendSort:$("#recommendSort").combobox("getValue"),
183 - authStatus: "1" 194 + authStatus: $("#authStatus").combobox("getValue")
184 }, 195 },
185 url: serverContextPath + "/grassArticle/articleList", 196 url: serverContextPath + "/grassArticle/articleList",
186 method: 'POST', 197 method: 'POST',
@@ -356,6 +367,19 @@ @@ -356,6 +367,19 @@
356 } 367 }
357 }, 368 },
358 { 369 {
  370 + title: "屏蔽状态",
  371 + field: "authStatus",
  372 + width: 25,
  373 + align: "left",
  374 + formatter: function (value, rowData, rowIndex) {
  375 + if(rowData.authStatus == '4'){
  376 + return "已屏蔽";
  377 + }else{
  378 + return "未屏蔽";
  379 + }
  380 + }
  381 + },
  382 + {
359 title: "操作", 383 title: "操作",
360 field: "ddg", 384 field: "ddg",
361 width: 50, 385 width: 50,
@@ -385,7 +409,11 @@ @@ -385,7 +409,11 @@
385 if(rowData.authStatus == 2){ 409 if(rowData.authStatus == 2){
386 str += "审核未通过" 410 str += "审核未通过"
387 } 411 }
388 - 412 + if(rowData.authStatus == 4){
  413 + str += "<a role='shieldR' class='btn-success' dataId='"+rowData.articleId+ "' dataAuthStatus='1' index='"+ rowIndex + "' style='margin-left:10px'>取消屏蔽</a>";
  414 + }else{
  415 + str += "<a role='shieldR' class='btn-success' dataId='"+rowData.articleId+ "' dataAuthStatus='4' index='"+ rowIndex + "' style='margin-left:10px'>屏蔽</a>";
  416 + }
389 str += "<a role='deleteR' class='btn-success' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' style='margin-left:10px'>删除</a>"; 417 str += "<a role='deleteR' class='btn-success' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' style='margin-left:10px'>删除</a>";
390 return str; 418 return str;
391 } 419 }
@@ -484,9 +512,20 @@ @@ -484,9 +512,20 @@
484 } 512 }
485 }); 513 });
486 514
487 -  
488 -  
489 - 515 + $(this).datagrid("getPanel").find("a[role='shieldR']").linkbutton({
  516 + iconCls : "icon-edit",
  517 + onClick: function () {
  518 + var dataId = $(this).attr("dataId");
  519 + var authStatus = $(this).attr("dataAuthStatus");//取消屏蔽则恢复为审核通过状态
  520 + $.post(serverContextPath + "/grassArticle/updateArticle?articleId=" + dataId+"&authStatus="+authStatus+"&operateType=2", function (data) {
  521 + if(data.code != 200){
  522 + alert(data.message);
  523 + }else{
  524 + $("#activityListTable").datagrid("reload");
  525 + }
  526 + }, "json");
  527 + }
  528 + });
490 } 529 }
491 }); 530 });
492 531