labelRelation.zml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <script>
  2. <!--
  3. var indIdarr = Z.AR.toArray("${indIdarr}", ",");
  4. var attrIdarr = Z.AR.toArray("${attrIdarr}", ",");
  5. function doLabelIdSet(type,attaid)
  6. {
  7. if (type == "industry")
  8. {
  9. if (Z.AR.contains(indIdarr, attaid))
  10. Z.AR.remove(indIdarr, attaid);
  11. else
  12. indIdarr.push(attaid);
  13. }
  14. else if (type == "attribute")
  15. {
  16. if(Z.AR.contains(attrIdarr, attaid))
  17. Z.AR.remove(attrIdarr, attaid)
  18. else
  19. attrIdarr.push(attaid);
  20. }
  21. }
  22. function doLabelRelation()
  23. {
  24. var ajax = new Z.Ajax();
  25. ajax.setClassName("WorksPresenter");
  26. ajax.setMethodName("doLabelRelation");
  27. ajax.addParam('${works.getWorksId()}');
  28. ajax.addParam('${works.getDesignType()}');
  29. ajax.addParam('${works.getIndustryId()}');
  30. ajax.addParam(indIdarr);
  31. ajax.addParam(attrIdarr);
  32. ajax.setFailureAlert();
  33. ajax.setSuccess(function(){
  34. Z.success("关联成功", function(){parent.location.reload();})
  35. });
  36. ajax.execute();
  37. }
  38. -->
  39. </script>
  40. <div class="z-w300p">
  41. ${zhiqim_manager_title("关联标签行业")}
  42. <table class="z-table z-bordered z-pd6">
  43. <tr class="z-h40" bgcolor="${zmr_thead_bgcolor}">
  44. <td width="10%" >产品类型:</td>
  45. <td width="*"> ${Global.get(ProductTypeCache.class).getName(works.getDesignType())}</td>
  46. </tr>
  47. <tr class="z-h40" bgcolor="#FFFFFF">
  48. <td>标签行业:</td>
  49. <td>${Global.get(DesignIndustryCache.class).getIndustryName(works.getIndustryId())}</td>
  50. </tr>
  51. <tr class="z-h40" bgcolor="${zmr_thead_bgcolor}">
  52. <td>标签子行业:</td>
  53. <td>
  54. <#for item : inSubList>
  55. <button name="subName" id="sub_${item.getIndustrySubId()}" type="button" class="z-button z-large z-bordered z-blue-bd z-hover <#if subsList.contains(item.getIndustrySubId()+"")>z-active</#if>" onclick="Z.EL.toggleClass(this, 'z-active');doLabelIdSet('industry', '${item.getIndustrySubId()}')">${item.getIndustrySubName()}</button>
  56. </#for>
  57. </td>
  58. </tr>
  59. </table><br>
  60. ${zhiqim_manager_title("关联标签属性")}
  61. <table class="z-table z-bordered z-pd6">
  62. <#for item : attrCatList>
  63. <tr class="z-h40" bgcolor="${zmr_thead_bgcolor}">
  64. <td width="10%">${item.getAttributeCatName()}:</td>
  65. <td width="*">
  66. <#for aitem : map.get(item.getAttributeCatId())>
  67. <button name="attrId" id="sub_${aitem.getAttributeId()}" type="button" class="z-button z-large z-bordered z-blue-bd z-hover <#if attrList.contains(aitem.getAttributeId()+"")>z-active</#if>" onclick="Z.EL.toggleClass(this, 'z-active');doLabelIdSet('attribute', '${aitem.getAttributeId()}')">${aitem.getAttributeName()}</button>
  68. </#for>
  69. </td>
  70. </tr>
  71. </#for>
  72. </table>
  73. <div class="z-absolute z-w100p z-h80 z-text-center z-bg-gray" style="bottom:0;left:0">
  74. <button class="z-button ${zmr_color_class} z-w150 z-h50 z-mg-t15 z-mg-l5 z-mg-l20 fi-px22" type="button" onclick="doLabelRelation();">提交</button>
  75. <button class="z-button z-w150 z-h50 z-mg-t15 z-mg-l5 z-mg-l20 fi-px22" type="button" onclick="parent.location.reload();">关闭</button>
  76. </div>
  77. </div>