No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

template_set.htm 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. {include file="public/layout" /}
  2. <script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
  3. <body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit; min-width:auto;">
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page" style="min-width:auto;box-shadow:none;">
  7. <div class="flexigrid">
  8. <div id="explanation" class="explanation">
  9. <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
  10. <h4 title="提示相关设置操作时应注意的要点">提示</h4>
  11. <span title="收起提示" id="explanationZoom" style="display: block;"></span>
  12. </div>
  13. <ul>
  14. <li>参数启用后,请确认前端模板是否正确调用此标签,具体使用方法可查看官方标签手册</li>
  15. </ul>
  16. </div>
  17. <br>
  18. <div class="hDiv">
  19. <div class="hDivBox">
  20. <table cellspacing="0" cellpadding="0" style="width: 100%">
  21. <thead>
  22. <tr>
  23. <th abbr="ac_id" axis="col4">
  24. <div class="tl pl10">参数名称</div>
  25. </th>
  26. <th axis="col1" class="w80">
  27. <div class="tc">启用</div>
  28. </th>
  29. <th axis="col1" class="w80">
  30. <div class="tc">操作</div>
  31. </th>
  32. </tr>
  33. </thead>
  34. </table>
  35. </div>
  36. </div>
  37. <div class="bDiv" style="height: auto;">
  38. <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
  39. <table style="width: 100%">
  40. <tbody>
  41. {empty name="list"}
  42. <tr>
  43. <td class="no-data" align="center" axis="col0" colspan="50">
  44. <div class="no_row">
  45. <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
  46. </div>
  47. </td>
  48. </tr>
  49. {else/}
  50. {foreach name="list" item="vo" key="k" }
  51. <tr>
  52. <td style="width: 100%">
  53. <div class="tl pl10">
  54. <input type="text" data-id='{$vo.field_id}' id="{$vo.field_name}" data-name="{$vo.field_name}" onchange="UpFieldTitle(this)" value="{$vo.field_title}">
  55. {eq name="$vo.field_name" value="server_name"}
  56. &nbsp;&nbsp;&nbsp;&nbsp;<a href="{:url('Download/set_servername')}" style="color: white;" class="ncap-btn ncap-btn-green" id="submitBtn">设置</a>
  57. {/eq}
  58. </div>
  59. </td>
  60. <td>
  61. <div class="w80 tc">
  62. <label>
  63. <input type="checkbox" data-id='{$vo.field_id}' data-title="{$vo.field_title}" onclick="UpFieldUse(this);" data-name='{$vo.field_name}' {eq name='$vo.field_use' value='1'}checked{/eq}>
  64. </label>
  65. </div>
  66. </td>
  67. <td>
  68. <div class="w80 tc">
  69. <a href="javascript:void(0);" onclick="showtext('{$vo.field_name}');" class="btn blue {$vo.field_name}" data-clipboard-text="{$field.{$vo.field_name}}">标签调用</a>
  70. </div>
  71. </td>
  72. </tr>
  73. {/foreach}
  74. {/empty}
  75. </tbody>
  76. </table>
  77. </div>
  78. <div class="iDiv" style="display: none;"></div>
  79. </div>
  80. </div>
  81. </div>
  82. <script>
  83. $(document).ready(function(){
  84. // 表格行点击选中切换
  85. $('#flexigrid > table>tbody >tr').click(function(){
  86. $(this).toggleClass('trSelected');
  87. });
  88. // 点击刷新数据
  89. $('.fa-refresh').click(function(){
  90. location.href = location.href;
  91. });
  92. });
  93. function UpFieldTitle(obj)
  94. {
  95. // 字段标题
  96. var field_title = $(obj).val();
  97. // 字段名称
  98. var field_name = $(obj).attr('data-name');
  99. // 字段ID
  100. var field_id = $(obj).attr('data-id');
  101. // 更改字段
  102. parent.$('span.title_'+field_name).html(field_title);
  103. //文件上传列表的
  104. // 更改字段
  105. parent.$('th.th_' + field_name).html(field_title);
  106. // 修改数据库中的信息
  107. $.ajax({
  108. url: "{:url('Download/template_set', ['_ajax'=>1])}",
  109. data: {field_id:field_id,field_title:field_title},
  110. type:'post',
  111. dataType:'json',
  112. success: function(res){
  113. layer.msg(res.msg, {icon: 1, time:1000});
  114. }
  115. });
  116. }
  117. function UpFieldUse(obj)
  118. {
  119. // 字段名称
  120. var field_name = $(obj).attr('data-name');
  121. // 字段标题
  122. var field_title = $('#'+field_name).val();
  123. // 字段ID
  124. var field_id = $(obj).attr('data-id');
  125. // 字段是否使用
  126. var field_use = '';
  127. if ($(obj).is(':checked')) {
  128. field_use = 1;
  129. // 显示远程文件的字段
  130. parent.$('.ey_'+field_name).show();
  131. if (field_name == 'server_name') {
  132. //显示文件列表中的字段表头
  133. parent.$('.th_' + field_name).show();
  134. //显示文件列表中的表格
  135. parent.$('#TemplateSet').attr("data-servername_use", field_use);
  136. }
  137. } else {
  138. field_use = 0;
  139. // 隐藏远程文件的字段
  140. parent.$('.ey_'+field_name).hide();
  141. if (field_name == 'server_name') {
  142. //隐藏文件列表中的字段表头
  143. parent.$('.th_' + field_name).hide();
  144. //隐藏文件列表中的表格
  145. parent.$('#TemplateSet').attr("data-servername_use", field_use);
  146. }
  147. }
  148. // 修改数据库中的信息
  149. $.ajax({
  150. url: "{:url('Download/template_set', ['_ajax'=>1])}",
  151. data: {field_id:field_id,field_use:field_use},
  152. type:'post',
  153. dataType:'json',
  154. success: function(res){
  155. }
  156. });
  157. }
  158. function showtext(classname){
  159. var clipboard1 = new Clipboard("."+classname);clipboard1.on("success", function(e) {layer.msg("复制成功");});clipboard1.on("error", function(e) {layer.msg("复制失败!请手动复制", {icon:5});});
  160. }
  161. </script>
  162. {include file="public/footer" /}