node.index.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {extend name='extra@admin/content'}
  2. {block name="content"}
  3. <table class="table table-hover">
  4. <thead>
  5. <tr>
  6. <th style="width:20px"></th>
  7. <th class='text-left'>系统节点结构</th>
  8. <th class='text-left'></th>
  9. <th>&nbsp;</th>
  10. </tr>
  11. </thead>
  12. <tbody>
  13. {foreach $nodes as $key=>$vo}
  14. <tr>
  15. <td style="width:20px"></td>
  16. <td class='text-left nowrap'>
  17. {$vo.spl}{$vo.node}
  18. {if auth("$classuri/save")}
  19. &nbsp;<input class='layui-input layui-input-inline title-input' name='title' data-node="{$vo.node}"
  20. value="{$vo.title}" style='height:28px;line-height:28px;width:auto'/>
  21. {/if}
  22. </td>
  23. <td class='text-left nowrap'>
  24. {if auth("$classuri/save")}
  25. <label data-tips-text="勾选后需要登录后才能访问">
  26. {if substr_count($vo['node'],'/')==2}
  27. {notempty name='vo.is_login'}
  28. <input checked='checked' class="check-box login_{$key}"
  29. type='checkbox' value='1' name='is_login' data-node="{$vo.node}"
  30. onclick="!this.checked&&($('.auth_{$key}')[0].checked=!!this.checked)"/>
  31. {else}
  32. <input class="check-box login_{$key}" type='checkbox' value='1' name='is_login' data-node="{$vo.node}"
  33. onclick="!this.checked&&($('.auth_{$key}')[0].checked=!!this.checked)"/>
  34. {/notempty}
  35. 加入登录控制
  36. {/if}
  37. </label>
  38. &nbsp;&nbsp;&nbsp;&nbsp;
  39. <label data-tips-text="勾选后需配置用户权限后才能访问">
  40. {if substr_count($vo['node'],'/')==2}
  41. {notempty name='vo.is_auth'}
  42. <input name='is_auth' data-node="{$vo.node}" checked='checked' class="check-box auth_{$key}"
  43. type='checkbox' onclick="this.checked&&($('.login_{$key}')[0].checked=!!this.checked)"
  44. value='1'/>
  45. {else}
  46. <input name='is_auth' data-node="{$vo.node}" class="check-box auth_{$key}" type='checkbox' value='1'
  47. onclick="this.checked&&($('.login_{$key}')[0].checked=!!this.checked)"
  48. />
  49. {/notempty}
  50. 加入权限控制
  51. {/if}
  52. </label>
  53. &nbsp;&nbsp;&nbsp;&nbsp;
  54. <label data-tips-text="勾选后配置菜单时节点可自动选择">
  55. {if substr_count($vo['node'],'/')==2}
  56. {notempty name='vo.is_menu'}
  57. <input name='is_menu' data-node="{$vo.node}" checked='checked' class='check-box menu_{$key}'
  58. type='checkbox' value='1'/>
  59. {else}
  60. <input name='is_menu' data-node="{$vo.node}" class='check-box menu_{$key}' type='checkbox' value='1'/>
  61. {/notempty}
  62. 加入菜单节点选择器
  63. {/if}
  64. </label>
  65. {/if}
  66. </td>
  67. <td style="width:100%"></td>
  68. </tr>
  69. {/foreach}
  70. </tbody>
  71. </table>
  72. {if auth("$classuri/save")}
  73. <script>
  74. $(function () {
  75. $('input.title-input').on('blur', function () {
  76. var data = {list: [{name: this.name, value: this.value, node: this.getAttribute('data-node')}]};
  77. $.form.load('{:url("save")}', data, 'POST', function (ret) {
  78. if(ret.code===0){
  79. setTimeout(function(){
  80. $.form.reload();
  81. },3000);
  82. $.msg.auto(ret);
  83. }
  84. return false;
  85. });
  86. });
  87. $('input.check-box').on('click', function () {
  88. var data = {list: []};
  89. $(this).parent().parent().find('input').map(function () {
  90. data.list.push({name: this.name, value: this.checked ? 1 : 0, node: this.getAttribute('data-node')});
  91. });
  92. $.form.load('{:url("save")}', data, 'POST', function (ret) {
  93. if(ret.code===0){
  94. setTimeout(function(){
  95. $.form.reload();
  96. },3000);
  97. $.msg.auto(ret);
  98. }
  99. return false;
  100. });
  101. });
  102. });
  103. </script>
  104. {/if}
  105. {/block}