Authored by mlge

种草--话题 话题分组修改

@@ -90,7 +90,7 @@ public class TopicServiceImpl implements ITopicService { @@ -90,7 +90,7 @@ public class TopicServiceImpl implements ITopicService {
90 if(req.getId() == null){ 90 if(req.getId() == null){
91 record.setArticleAmount(0); 91 record.setArticleAmount(0);
92 record.setAttAmount(0); 92 record.setAttAmount(0);
93 - record.setStatus(0); 93 + record.setStatus(3);//待上架
94 record.setCreateTime(DateUtil.getCurrentTimeSeconds()); 94 record.setCreateTime(DateUtil.getCurrentTimeSeconds());
95 topicGroupDAO.updateTopicNum(req.getRelatedGroup(),true); 95 topicGroupDAO.updateTopicNum(req.getRelatedGroup(),true);
96 grassTopicDAO.insert(record); 96 grassTopicDAO.insert(record);
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 14
15 <tr style="height: 60px"> 15 <tr style="height: 60px">
16 <td> 16 <td>
17 - <span style="color:red">*</span><label>分组图标</label> <br> 17 + <label>分组图标</label> <br>
18 18
19 <div id="imageUpload"> 19 <div id="imageUpload">
20 </div> 20 </div>
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <td> 26 <td>
27 <span style="color:red">*</span><label>话题状态</label> <br> 27 <span style="color:red">*</span><label>话题状态</label> <br>
28 <input type="radio" value="1" checked name="status" style="width:30px">开启</input> 28 <input type="radio" value="1" checked name="status" style="width:30px">开启</input>
29 - <input type="radio" value="0" name="status" style="width:30px">关闭</input> 29 + <input type="radio" value="0" name="status" style="width:30px" checked="true">关闭</input>
30 </td> 30 </td>
31 </tr> 31 </tr>
32 32
@@ -133,6 +133,9 @@ @@ -133,6 +133,9 @@
133 width: 30, 133 width: 30,
134 align: "left", 134 align: "left",
135 formatter: function (value, rowData, rowIndex) { 135 formatter: function (value, rowData, rowIndex) {
  136 + if(value == null || value == ""){
  137 + return "<div style='height: 100px;width: 100px'>";
  138 + }
136 return "<img src='"+value+"' style='height: 100px;width: 100px'>"; 139 return "<img src='"+value+"' style='height: 100px;width: 100px'>";
137 } 140 }
138 }, 141 },
@@ -252,19 +255,19 @@ @@ -252,19 +255,19 @@
252 return false; 255 return false;
253 } 256 }
254 257
255 - //2)是否上传了图片  
256 - var imageCount = 0;  
257 - $("input[name='imageUrl']").each(function (j, item) {  
258 - var url = item.value;  
259 - if (url != '') {  
260 - imageCount++;  
261 - }  
262 - });  
263 - if (imageCount == 0) {  
264 - $.messager.alert("保存失败", "至少要选择一张图片", "error");  
265 - return false;  
266 -  
267 - } 258 +// //2)是否上传了图片
  259 +// var imageCount = 0;
  260 +// $("input[name='imageUrl']").each(function (j, item) {
  261 +// var url = item.value;
  262 +// if (url != '') {
  263 +// imageCount++;
  264 +// }
  265 +// });
  266 +// if (imageCount == 0) {
  267 +// $.messager.alert("保存失败", "至少要选择一张图片", "error");
  268 +// return false;
  269 +//
  270 +// }
268 271
269 $.messager.progress({ 272 $.messager.progress({
270 title: "正在执行", 273 title: "正在执行",
@@ -86,8 +86,10 @@ @@ -86,8 +86,10 @@
86 textField: "text", 86 textField: "text",
87 required: false, 87 required: false,
88 prompt: "请选择状态", 88 prompt: "请选择状态",
89 - data: [{text: "请选择状态", value: "8"}, {text: "进行中", value: "1"}, {text: "已下架", value: "0"}] 89 + data: [{text: "请选择状态", value: "8"}, {text: "进行中", value: "1"}, {text: "待上架", value: "3"},{text: "已下架", value: "0"}]
90 }); 90 });
  91 + //初次加载 设置默认选中的
  92 + $("#statusParam").combobox('select', '1');
91 93
92 $("#isOfficialParam").combobox({ 94 $("#isOfficialParam").combobox({
93 valueField: "value", 95 valueField: "value",
@@ -142,11 +144,9 @@ @@ -142,11 +144,9 @@
142 fit: true, 144 fit: true,
143 fitColumns: true, 145 fitColumns: true,
144 striped: true, 146 striped: true,
145 - /*queryParams: {  
146 - rewardName: $("#rewardName1").textbox("getValue"),  
147 - status: $("#rewardstatus1").combobox("getValue"),  
148 - type: $("#rewardtype1").combobox("getValue")  
149 - },*/ 147 + queryParams: {
  148 + status: $("#statusParam").combobox("getValue")
  149 + },
150 url: serverContextPath + "/grassTopicManage/getGrassTopicList", 150 url: serverContextPath + "/grassTopicManage/getGrassTopicList",
151 method: 'POST', 151 method: 'POST',
152 loadFilter: function (data) { 152 loadFilter: function (data) {
@@ -213,8 +213,10 @@ @@ -213,8 +213,10 @@
213 formatter: function (value, rowData, rowIndex) { 213 formatter: function (value, rowData, rowIndex) {
214 if (value == 1) { 214 if (value == 1) {
215 return "进行中"; 215 return "进行中";
216 - } else {  
217 - return "下架"; 216 + } else if(value == 3) {
  217 + return "待上架";
  218 + }else{
  219 + "下架";
218 } 220 }
219 } 221 }
220 222
@@ -225,15 +227,16 @@ @@ -225,15 +227,16 @@
225 width: 40, 227 width: 40,
226 align: "center", 228 align: "center",
227 formatter: function (value, rowData, rowIndex) { 229 formatter: function (value, rowData, rowIndex) {
  230 +
228 var str = "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px;background-color: #31b0d5' index='" + rowIndex + "'>编辑</a>"; 231 var str = "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px;background-color: #31b0d5' index='" + rowIndex + "'>编辑</a>";
229 - var changeStatus = "<a role='changeStatus' style='margin-left:10px;background-color: #ffa951' changedStatus='0' dataId='" + rowData.id + "' index='" + rowIndex + "'>下架</a>";  
230 - ;  
231 - if (rowData.status == 0) {  
232 - changeStatus = "<a role='changeStatus' style='margin-left:10px;background-color: #c4ddff' changedStatus='1' dataId='" + rowData.id + "' index='" + rowIndex + "'>上架</a>";  
233 - } 232 + var changeStatus = "<a role='changeStatus' style='margin-left:10px;background-color: #c4ddff' changedStatus='1' dataId='" + rowData.id + "' index='" + rowIndex + "'>上架</a>";
234 233
235 - str += changeStatus; 234 + if (rowData.status == 1) {
  235 + str = "";//进行中的话题不可编辑
  236 + changeStatus = "<a role='changeStatus' style='margin-left:10px;background-color: #ffa951' changedStatus='0' dataId='" + rowData.id + "' index='" + rowIndex + "'>下架</a>";
236 237
  238 + }
  239 + str += changeStatus;
237 // str += "<a role='' style='margin-left:10px;background-color: #ffa951' changedStatus='1' dataId='" + rowData.id + "' index='" + rowIndex + "'>复制链接</a>" ; 240 // str += "<a role='' style='margin-left:10px;background-color: #ffa951' changedStatus='1' dataId='" + rowData.id + "' index='" + rowIndex + "'>复制链接</a>" ;
238 241
239 return str ; 242 return str ;