materialContList.zml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <#def designatedPath="/works/materialCatList.htm"/>
  2. <script language="javascript">
  3. <!--
  4. ${Scripts.doSelectBox()}
  5. ${Scripts.doClearForm()}
  6. function doUpdateKeywords(mid, keywords)
  7. {//打标签
  8. var ajax = new Z.Ajax();
  9. ajax.setClassName("WorksPresenter");
  10. ajax.setMethodName("doUpdateMaterialKeywords");
  11. ajax.addParam("mid", mid);
  12. ajax.addParam("keywords", keywords);
  13. ajax.execute();
  14. }
  15. function doUpdateStatus(mid, resStatus)
  16. {//修改状态
  17. var ajax = new Z.Ajax();
  18. ajax.setClassName("WorksPresenter");
  19. ajax.setMethodName("doUpdateMaterialStatus");
  20. ajax.addParam("mid", mid);
  21. ajax.addParam("resStatus", resStatus);
  22. ajax.execute();
  23. }
  24. function doUpdateSeq(mid, resSeq)
  25. {//修改序号
  26. var ajax = new Z.Ajax();
  27. ajax.setClassName("WorksPresenter");
  28. ajax.setMethodName("doUpdateMaterialSeq");
  29. ajax.addParam("mid", mid);
  30. ajax.addParam("resSeq", resSeq);
  31. ajax.execute();
  32. }
  33. function doDeleteWorksMaterial(mid)
  34. {//删除作品
  35. var ajax = new Z.Ajax();
  36. ajax.setClassName("WorksPresenter");
  37. ajax.setMethodName("doDeleteWorksMaterial");
  38. ajax.addParam("mid", mid);
  39. ajax.setFailureAlert();
  40. ajax.setSuccess(function(){
  41. Z.tips("删除成功");
  42. Z.L.reload();
  43. });
  44. ajax.execute();
  45. }
  46. function doDialogWorksMaterial()
  47. {//上传作品素材
  48. var dialog = new Z.Dialog();
  49. dialog.shadow = true;
  50. dialog.title = "上传作品素材";
  51. dialog.fixed = true;
  52. dialog.url = "/works/materialContAdd.htm";
  53. dialog.width = Z.D.clientWidth()-600;
  54. dialog.height =Z.D.clientHeight()-400;
  55. dialog.execute();
  56. }
  57. //-->
  58. </script>
  59. ${zhiqim_manager_breadcrumb("素材列表")}
  60. <div class="content">
  61. <#-- 导航栏 -->
  62. <div data-role="z-tabnav" class="z-tabnav-main z-mg-b20 z-blue">
  63. <nav>
  64. <ul>
  65. <#if ZmrPathRule.check(request, "/works/materialCatList.htm")><li onclick="Z.Location.href('/works/materialCatList.htm');">分类管理</li></#if>
  66. <#if ZmrPathRule.check(request, "/works/materialContList.htm")><li class="z-active">素材管理</li></#if>
  67. </ul>
  68. <div class="z-float-left z-mg10">
  69. <form name="theForm" method="post" action="/works/materialContList.htm">
  70. <select id="catId" name="catId" class="z-float-left z-select z-w100" data-role="z-select" data-class="${zmr_color_class}" >
  71. <option value="">全部</option>
  72. <#for cat : Global.get(DesMaterialCatCache.class).list()>
  73. <option value="${cat.getCatId()}" <#if cat.getCatId() == catId>selected</#if>>${cat.getCatName()}</option>
  74. </#for>
  75. </select>
  76. <input name="keywords" class="z-float-left ${zmr_color_class} z-input z-w150 z-mg-l4" value="${keywords}" maxlength="16" placeholder="关键字">
  77. <button class="z-float-left z-button z-w80 zi-bd-rd0 z-blue"><i class="z-font z-query"></i>查询</button>
  78. </form>
  79. </div>
  80. <div class="z-text-right z-mg-t10 z-mg-r5">
  81. <button class="z-button z-h30 ${zmr_color_class}" onclick="doDialogWorksMaterial();"><i class="z-font z-add"></i> 添加素材</button>
  82. </div>
  83. </nav>
  84. </div>
  85. <table class="z-table z-bordered z-bg-white z-pd6">
  86. <tr class="z-text-center z-h40 z-bg-gray">
  87. <td width=80>选择</td>
  88. <td width="100">分类</td>
  89. <td width="100">状态</td>
  90. <td width="100">序号</td>
  91. <td width="15%">关键字</td>
  92. <td width="80">文件格式</td>
  93. <td width="*">预览图</td>
  94. <td width="80">操作</td>
  95. </tr>
  96. <#if pageResult.size() == 0>
  97. ${zhiqim_manager_no_record (10, "暂时没有素材信息")}
  98. </#if>
  99. <#for item : pageResult.list()>
  100. <tr valign="middle" bgcolor=<#if item_index % 2 == 0>${zmr_tr_odd_bgcolor}<#else>${zmr_tr_even_bgcolor}</#if> class="z-text-center z-h60">
  101. <td><input name="mid" type="radio" data-role="z-radio" data-class="${zmr_color_class}" value="${item.getMid()}"></td>
  102. <td>${Global.get(DesMaterialCatCache.class).name(item.getCatId())}</td>
  103. <td>
  104. <select class="z-select z-blue" onchange="doUpdateStatus(${item.getMid()}, this.value);">
  105. <option value="0" <#if item.getMaterialStatus()=0>selected</#if>>正常</option>
  106. <option value="1" <#if item.getMaterialStatus()=1>selected</#if> class="z-text-red"><font class="z-text-red">停用</font></option>
  107. </select></td>
  108. <td><input class="z-input z-w100" value="${item.getMaterialSeq()}" onblur="doUpdateSeq(${item.getMid()}, this.value);" data-options="type:Integer;paste:true;" ></td>
  109. <td><input class="z-input z-w200" value="${item.getKeywords()}" onblur="doUpdateKeywords(${item.getMid()}, this.value);"></td>
  110. <td>${item.getMaterialSuffix()}</td>
  111. <td><#if Validates.isNotEmpty(item.getThumbUrl())><img src="${item.getThumbUrl()}" style="max-width:70px;"></#if></td>
  112. <td><button class="z-button z-h30 ${zmr_color_class}" onclick="doDeleteWorksMaterial('${item.getMid()}');">删除</button></td>
  113. </tr>
  114. </#for>
  115. </table>
  116. ${zhiqim_manager_paging (pageResult, "/works/materialContList.htm")}
  117. </div>