Authored by min.ling

update

@@ -620,7 +620,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService { @@ -620,7 +620,7 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
620 grassArticleLabelDao.deleteByArticleId(articleId); 620 grassArticleLabelDao.deleteByArticleId(articleId);
621 List<GrassArticleLabel> grassArticleLabels = buildArticleLabels(articleId, labels, req.getAuthStatus()); 621 List<GrassArticleLabel> grassArticleLabels = buildArticleLabels(articleId, labels, req.getAuthStatus());
622 try { 622 try {
623 - if (CollectionUtils.isNotEmpty(grassArticleLabels) && 3 != req.getSort()) { 623 + if (CollectionUtils.isNotEmpty(grassArticleLabels) && 3 != sort) {
624 grassArticleLabelDao.insertArticleLabels(grassArticleLabels); 624 grassArticleLabelDao.insertArticleLabels(grassArticleLabels);
625 } 625 }
626 } catch (Exception e) { 626 } catch (Exception e) {
@@ -185,42 +185,6 @@ @@ -185,42 +185,6 @@
185 if (data && data.draftEditFlag == 1) { 185 if (data && data.draftEditFlag == 1) {
186 $("#draftType").val(1); 186 $("#draftType").val(1);
187 } 187 }
188 - if (data){  
189 - $("#articleUid").textbox("setValue", data.authorUid);  
190 -  
191 - // $("#content").val(data.articleContent);  
192 - $("#content").emojioneArea()[0].emojioneArea.setText(data.articleContent);  
193 - /*字数限制提示*/  
194 - if(data.articleContent !=null && data.articleContent !=''){  
195 - var count = data.articleContent.length;  
196 - $("#content-count").text(count);  
197 - }  
198 -  
199 - var labelIds = [];  
200 - if(data.labelList!=null && data.labelList.length>0){  
201 - for (var i=0;i<data.labelList.length;i++){  
202 - labelIds.push(data.labelList[i].id);  
203 - }  
204 - }  
205 - $("#labelId").combobox('setValues',labelIds);  
206 - if(data.topicGroupId !=null && data.topicId!=null){  
207 - $("#topicGroupId").combobox('setValue',data.topicGroupId);  
208 - $("#topicId").combobox('setValue',data.topicId);  
209 - }  
210 -  
211 - htmlTopic(data.topicName);  
212 -  
213 - if(data.sknList!=null && data.sknList.length>0){  
214 - checkedItems =data.sknList;  
215 - }  
216 - if(data.yohoList!=null && data.yohoList.length>0){  
217 - initGoods(data.yohoList,1);  
218 - }  
219 - if(data.ufoList!=null && data.ufoList.length>0){  
220 - initGoods(data.ufoList,2);  
221 - }  
222 - initGoodsDiv();  
223 - }  
224 188
225 // 复制链接 189 // 复制链接
226 new ClipboardJS('.copy'); 190 new ClipboardJS('.copy');
@@ -351,6 +315,23 @@ @@ -351,6 +315,23 @@
351 labelList+='<span class="tag"><span>'+text+'</span><a href="#" class="labelTag" data-index="'+i+'">x</a></span>&nbsp&nbsp&nbsp' 315 labelList+='<span class="tag"><span>'+text+'</span><a href="#" class="labelTag" data-index="'+i+'">x</a></span>&nbsp&nbsp&nbsp'
352 } 316 }
353 $("#labelList").html(labelList); 317 $("#labelList").html(labelList);
  318 + },
  319 + onLoadSuccess:function () {
  320 + debugger;
  321 + var arr = $(this).combobox("getValues");
  322 + var textarr = $(this).combobox("getData");
  323 + var labelList='';
  324 +
  325 + for (var i=0; i<arr.length;i++){
  326 + var text = '';
  327 + for (var j=0; j< textarr.length;j++){
  328 + if(arr[i] == textarr[j].id){
  329 + text=textarr[j].labelName;
  330 + }
  331 + }
  332 + labelList+='<span class="tag"><span>'+text+'</span><a href="#" class="labelTag" data-index="'+i+'">x</a></span>&nbsp&nbsp&nbsp'
  333 + }
  334 + $("#labelList").html(labelList);
354 } 335 }
355 }); 336 });
356 337
@@ -591,6 +572,46 @@ @@ -591,6 +572,46 @@
591 572
592 } 573 }
593 }); 574 });
  575 +
  576 +
  577 + if (data){
  578 +
  579 + $("#articleUid").textbox("setValue", data.authorUid);
  580 +
  581 + // $("#content").val(data.articleContent);
  582 + $("#content").emojioneArea()[0].emojioneArea.setText(data.articleContent);
  583 + /*字数限制提示*/
  584 + if(data.articleContent !=null && data.articleContent !=''){
  585 + var count = data.articleContent.length;
  586 + $("#content-count").text(count);
  587 + }
  588 + debugger;
  589 + var labelIds = [];
  590 + if(data.labelList!=null && data.labelList.length>0){
  591 + for (var i=0;i<data.labelList.length;i++){
  592 + labelIds.push(data.labelList[i].id);
  593 + }
  594 + }
  595 + $("#labelId").combobox('setValues',labelIds);
  596 + if(data.topicGroupId !=null && data.topicId!=null){
  597 + $("#topicGroupId").combobox('setValue',data.topicGroupId);
  598 + $("#topicId").combobox('setValue',data.topicId);
  599 + }
  600 +
  601 + htmlTopic(data.topicName);
  602 +
  603 + if(data.sknList!=null && data.sknList.length>0){
  604 + checkedItems =data.sknList;
  605 + }
  606 + if(data.yohoList!=null && data.yohoList.length>0){
  607 + initGoods(data.yohoList,1);
  608 + }
  609 + if(data.ufoList!=null && data.ufoList.length>0){
  610 + initGoods(data.ufoList,2);
  611 + }
  612 + initGoodsDiv();
  613 + }
  614 +
594 }); 615 });
595 616
596 617
@@ -727,7 +748,6 @@ @@ -727,7 +748,6 @@
727 text:textVar, 748 text:textVar,
728 iconCls : "icon-save", 749 iconCls : "icon-save",
729 handler:function(){ 750 handler:function(){
730 - ;  
731 751
732 $("#goodstd").html("<div id=\"good0\" style=\"float: left;margin-left: 30px;width: 300px\">\n" + 752 $("#goodstd").html("<div id=\"good0\" style=\"float: left;margin-left: 30px;width: 300px\">\n" +
733 " </div>"); 753 " </div>");