add.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .el-select .el-input.is-focus .el-input__inner {
  5. border-color: #18a689;
  6. }
  7. .el-select-dropdown.is-multiple .el-select-dropdown__item.selected {
  8. color: #18a689;
  9. background-color: #fff;
  10. }
  11. .el-select-dropdown__item.selected {
  12. color: #18a689;
  13. font-weight: 700;
  14. }
  15. .el-select .el-input .el-select__caret {
  16. font-weight: bold;
  17. color: #555;
  18. }
  19. .el-input__inner {
  20. border-radius: 0px;
  21. }
  22. </style>
  23. <div class="row">
  24. <div class="col-sm-12">
  25. <div class="ibox float-e-margins">
  26. <!--<div class="ibox-title">-->
  27. <!--<h5>{$title}</h5>-->
  28. <!--<div class="ibox-tools">-->
  29. <!--<a class="toback" href="{:url('index')}">-->
  30. <!--返回上一页-->
  31. <!--</a>-->
  32. <!--</div>-->
  33. <!--</div>-->
  34. <div class="ibox-content">
  35. <form method="post" action="{:url('add')}" class="form-horizontal">
  36. <div class="form-group">
  37. <label class="col-sm-2 control-label">接收群组</label>
  38. <div class="col-sm-6">
  39. <label class="cr-inline">
  40. <input type="radio" onclick="setGroup(1)" value="1" checked name="group">全体(请谨慎选择此项)&nbsp;&nbsp;
  41. </label>
  42. <label class="cr-inline">
  43. <input type="radio" onclick="setGroup(2)" value="2" name="group">指定某人
  44. </label>
  45. <label class="cr-inline">
  46. <input type="radio" onclick="setGroup(3)" value="3" name="group">指定角色
  47. </label>
  48. </div>
  49. </div>
  50. <div class="form-group" style="display: none;" id="user">
  51. <label class="col-sm-2 control-label">指定某人</label>
  52. <div class="col-sm-6">
  53. {:widget_view('common/multiselect',['name'=>'users','lists' =>$userAll, 'val' => []])}
  54. </div>
  55. </div>
  56. <div class="form-group" style="display: none;" id="role">
  57. <label class="col-sm-2 control-label">指定角色</label>
  58. <div class="col-sm-6">
  59. {:widget_view('common/multiselect',['name'=>'roles','lists' =>$rolesAll, 'val' =>[]])}
  60. </div>
  61. </div>
  62. <div class="form-group">
  63. <label class="col-sm-2 control-label">通知类型<span class="text-danger">*</span></label>
  64. <div class="col-sm-6">
  65. <select name="cate_id" class="form-control">
  66. {volist name="$cate" id="v"}
  67. <option value="{$v.id}">{$v.name}</option>
  68. {/volist}
  69. </select>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label class="col-sm-2 control-label">标题<span class="text-danger">*</span></label>
  74. <div class="col-sm-6">
  75. <input type="text" class="form-control" required name="title">
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="col-sm-2 control-label">内容<span class="text-danger">*</span></label>
  80. <div class="col-sm-6">
  81. <textarea name="content" class="form-control" cols="30" rows="3" id="value"></textarea>
  82. </div>
  83. </div>
  84. <div class="hr-line-dashed"></div>
  85. <div class="form-group">
  86. <div class="col-sm-6 col-sm-offset-2">
  87. <button class="btn btn-primary ajax-post" data-layer_c="1" target-form="form-horizontal" type="submit">确 定</button>
  88. <!--<a href="{:url('index')}" class="btn btn-default">取 消</a>-->
  89. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  90. </div>
  91. </div>
  92. </form>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. {/block}
  98. {block name="script"}
  99. <script>
  100. function setGroup(val) {
  101. if(val==1){
  102. $('#user').attr('style','display:none');
  103. $('#role').attr('style','display:none');
  104. }
  105. if(val==2){
  106. $('#user').attr('style','display:block');
  107. $('#role').attr('style','display:none');
  108. $("input[name=roles]").val('');
  109. }
  110. if(val==3){
  111. $('#user').attr('style','display:none');
  112. $('#role').attr('style','display:block');
  113. $("input[name=users]").val('');
  114. }
  115. }
  116. $(document).ready(function(){
  117. formSetValue("enable", {$info.enable|default=1});
  118. });
  119. </script>
  120. {/block}