b805f47273dee915ad9458585d3a5b4a.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php /*a:6:{s:75:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\routine\routine_template\index.php";i:1603079624;s:61:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\container.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_head.php";i:1595820902;s:57:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\style.php";i:1595820902;s:62:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\inner_page.php";i:1595820902;s:64:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\public\frame_footer.php";i:1595820902;}*/ ?>
  2. <!DOCTYPE html>
  3. <html lang="zh-CN">
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <?php if(empty($is_layui) || (($is_layui instanceof \think\Collection || $is_layui instanceof \think\Paginator ) && $is_layui->isEmpty())): ?>
  8. <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
  9. <?php endif; ?>
  10. <link href="/static/plug/layui/css/layui.css" rel="stylesheet">
  11. <link href="/system/css/layui-admin.css" rel="stylesheet">
  12. <link href="/system/frame/css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
  13. <link href="/system/frame/css/animate.min.css" rel="stylesheet">
  14. <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
  15. <script src="/system/frame/js/jquery.min.js"></script>
  16. <script src="/system/frame/js/bootstrap.min.js"></script>
  17. <script src="/static/plug/layui/layui.all.js"></script>
  18. <script>
  19. $eb = parent._mpApi;
  20. window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
  21. window.module="<?php echo app('http')->getName();?>";
  22. </script>
  23. <title></title>
  24. <!--<script type="text/javascript" src="/static/plug/basket.js"></script>-->
  25. <script type="text/javascript" src="/static/plug/requirejs/require.js"></script>
  26. <?php /* <script type="text/javascript" src="/static/plug/requirejs/require-basket-load.js"></script> */ ?>
  27. <script>
  28. var hostname = location.hostname;
  29. if(location.port) hostname += ':' + location.port;
  30. requirejs.config({
  31. map: {
  32. '*': {
  33. 'css': '/static/plug/requirejs/require-css.js'
  34. }
  35. },
  36. shim:{
  37. 'iview':{
  38. deps:['css!iviewcss']
  39. },
  40. 'layer':{
  41. deps:['css!layercss']
  42. }
  43. },
  44. baseUrl:'//'+hostname+'/',
  45. paths: {
  46. 'static':'static',
  47. 'system':'system',
  48. 'vue':'static/plug/vue/dist/vue.min',
  49. 'axios':'static/plug/axios.min',
  50. 'iview':'static/plug/iview/dist/iview.min',
  51. 'iviewcss':'static/plug/iview/dist/styles/iview',
  52. 'lodash':'static/plug/lodash',
  53. 'layer':'static/plug/layer/layer',
  54. 'layercss':'static/plug/layer/theme/default/layer',
  55. 'jquery':'static/plug/jquery/jquery.min',
  56. 'moment':'static/plug/moment',
  57. 'sweetalert':'static/plug/sweetalert2/sweetalert2.all.min',
  58. 'formCreate':'/static/plug/form-create/form-create.min',
  59. },
  60. basket: {
  61. excludes:['system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  62. // excludes:['system/util/mpFormBuilder','system/js/index','system/util/mpVueComponent','system/util/mpVuePackage']
  63. }
  64. });
  65. </script>
  66. <script type="text/javascript" src="/system/util/mpFrame.js"></script>
  67. </head>
  68. <body class="gray-bg">
  69. <div class="wrapper wrapper-content">
  70. <div class="row">
  71. <div class="col-sm-12">
  72. <div class="ibox">
  73. <div class="ibox-title">
  74. <button type="button" class="btn btn-w-m btn-primary" onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('create'); ?>')">添加模板消息</button>
  75. <button type="button" class="layui-btn btn btn-w-m btn-primary" onclick="syncTemplate()">一键同步</button>
  76. <div class="ibox-tools">
  77. </div>
  78. </div>
  79. <div class="ibox-content">
  80. <div class="row">
  81. <div class="m-b m-l">
  82. <form action="" class="form-inline">
  83. <select name="status" aria-controls="editable" class="form-control input-sm">
  84. <option value="">是否有效</option>
  85. <option value="1" <?php if($where['status'] == '1'): ?>selected="selected"<?php endif; ?>>开启</option>
  86. <option value="0" <?php if($where['status'] == '0'): ?>selected="selected"<?php endif; ?>>关闭</option>
  87. </select>
  88. <div class="input-group">
  89. <input type="text" name="name" value="<?php echo htmlentities($where['name']); ?>" placeholder="请输入模板名" class="input-sm form-control"> <span class="input-group-btn">
  90. <button type="submit" class="btn btn-sm btn-primary"> <i class="fa fa-search" ></i>搜索</button> </span>
  91. </div>
  92. </form>
  93. </div>
  94. </div>
  95. <div class="table-responsive">
  96. <table class="table table-striped table-bordered">
  97. <thead>
  98. <tr>
  99. <th class="text-center">编号</th>
  100. <th class="text-center">模板编号</th>
  101. <th class="text-center">模板ID</th>
  102. <th class="text-center">模板名</th>
  103. <th class="text-center">回复内容</th>
  104. <th class="text-center">状态</th>
  105. <th class="text-center">添加时间</th>
  106. <th class="text-center">操作</th>
  107. </tr>
  108. </thead>
  109. <tbody class="">
  110. <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
  111. <tr>
  112. <td class="text-center">
  113. <?php echo htmlentities($vo['id']); ?>
  114. </td>
  115. <td class="text-center">
  116. <?php echo htmlentities($vo['tempkey']); ?>
  117. </td>
  118. <td class="text-center">
  119. <?php echo htmlentities($vo['tempid']); ?>
  120. </td>
  121. <td class="text-center">
  122. <?php echo htmlentities($vo['name']); ?>
  123. </td>
  124. <td class="text-center">
  125. <pre><?php echo htmlentities($vo['content']); ?></pre>
  126. </td>
  127. <td class="text-center">
  128. <i class="fa <?php if($vo['status'] == '1'): ?>fa-check text-navy<?php else: ?>fa-close text-danger<?php endif; ?>"></i>
  129. </td>
  130. <td class="text-center">
  131. <?php echo htmlentities(date('Y-m-d H:i:s',!is_numeric($vo['add_time'])? strtotime($vo['add_time']) : $vo['add_time'])); ?>
  132. </td>
  133. <td class="text-center">
  134. <button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','<?php echo Url('edit',array('id'=>$vo['id'])); ?>',{h:400})"><i class="fa fa-edit"></i>编辑</button>
  135. <button class="btn btn-danger btn-xs" data-url="<?php echo Url('delete',array('id'=>$vo['id'])); ?>" type="button"><i class="fa fa-times"></i> 删除
  136. </button>
  137. </td>
  138. </tr>
  139. <?php endforeach; endif; else: echo "" ;endif; ?>
  140. </tbody>
  141. </table>
  142. </div>
  143. <link href="/system/frame/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
  144. <div class="row">
  145. <div class="col-sm-6">
  146. <div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">共 <?php echo htmlentities($total); ?> 项</div>
  147. </div>
  148. <div class="col-sm-6">
  149. <div class="dataTables_paginate paging_simple_numbers" id="editable_paginate">
  150. <?php echo $page;?>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <script>
  159. $('.btn-danger').on('click',function(){
  160. window.t = $(this);
  161. var _this = $(this),url =_this.data('url');
  162. $eb.$swal('delete',function(){
  163. $eb.axios.get(url).then(function(res){
  164. console.log(res);
  165. if(res.status == 200 && res.data.code == 200) {
  166. $eb.$swal('success',res.data.msg);
  167. _this.parents('tr').remove();
  168. }else
  169. return Promise.reject(res.data.msg || '删除失败')
  170. }).catch(function(err){
  171. $eb.$swal('error',err);
  172. });
  173. });
  174. });
  175. function syncTemplate(){
  176. // var url = layList.U({c: 'routine.routine_template', a: 'syncSubscribe'});
  177. var url = "<?php echo Url('routine.routine_template/syncSubscribe'); ?>";
  178. // var url = "/system/js/layuiList.js";
  179. console.log(url);
  180. $eb.axios.get(url).then(function (res) {
  181. if (res.status == 200 && res.data.code == 200) {
  182. $eb.$swal('success', res.data.msg);
  183. } else
  184. return Promise.reject(res.data.msg || '同步失败')
  185. }).catch(function (err) {
  186. $eb.$swal('error', err);
  187. });
  188. }
  189. // require(['vue'], function (Vue) {
  190. // new Vue({
  191. // el: "#app",
  192. // data:{},
  193. // methods: {
  194. // syncTemplate: function() {
  195. // console.log(layList.Url({c: 'routine.routine_template', a: 'syncSubscribe'}));
  196. // // layList.baseGet(layList.Url({c: 'routine.routine_template', a: 'syncSubscribe'}), function (rem) {
  197. // // if(res.status == 200) {
  198. // // $eb.$swal('success',res.data.msg);
  199. // // }else
  200. // // return Promise.reject(res.data.msg || '同步失败')
  201. // // });
  202. // }
  203. // },
  204. // mounted: function () {}
  205. // })
  206. // });
  207. </script>
  208. </div>
  209. </body>
  210. </html>