47e7841db05ce42e56c4afe9bc1c5fde.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php /*a:5:{s:70:"D:\phpstudy_pro\WWW\CRMEB\app\admin\view\setting\system_city\index.php";i:1595820902;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: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. <style>
  71. a:hover{
  72. color: #0e9aef;
  73. }
  74. </style>
  75. <div class="row">
  76. <div class="col-sm-12">
  77. <div class="ibox">
  78. <div class="ibox-title">
  79. <?php if($pid != 0): ?>
  80. <a type="button" class="btn btn-w-m btn-primary" href="<?php echo Url('index'); ?>">返回</a>
  81. <?php endif; ?>
  82. <button type="button" class="btn btn-w-m btn-primary"
  83. onclick="$eb.createModalFrame(this.innerText,'<?php echo htmlentities($addurl); ?>')">添加城市
  84. </button>
  85. <div class="ibox-tools">
  86. <button class="btn btn-w-m btn-primary clean-cache"
  87. data-url="<?php echo Url('clean_cache'); ?>" type="button"><i
  88. class="fa fa-warning"></i> 清除缓存
  89. </button>
  90. </div>
  91. </div>
  92. <div class="ibox-content">
  93. <div class="table-responsive">
  94. <table class="table table-striped table-bordered">
  95. <thead>
  96. <tr>
  97. <th class="text-center">编号</th>
  98. <th class="text-center">上级名称</th>
  99. <th class="text-center">地区名称</th>
  100. <!-- <th class="text-center">父级</th>-->
  101. <th class="text-center">操作</th>
  102. </tr>
  103. </thead>
  104. <tbody class="">
  105. <?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;?>
  106. <tr>
  107. <td class="text-center">
  108. <?php echo htmlentities($vo['id']); ?>
  109. </td>
  110. <td class="text-center">
  111. <?php echo htmlentities($vo['parent_id']); ?>
  112. </td>
  113. <td class="text-center">
  114. <a href="<?php echo Url('index',array('parent_id'=>$vo['city_id'])); ?>"><?php echo htmlentities($vo['name']); ?></a>
  115. </td>
  116. <!-- <td class="text-center">-->
  117. <!-- <?php echo htmlentities($vo['parent_id']); ?>-->
  118. <!-- </td>-->
  119. <td class="text-center">
  120. <button class="btn btn-info btn-xs" type="button"
  121. onclick="$eb.createModalFrame(this.innerText,'<?php echo Url('edit',array('id'=>$vo['id'])); ?>')">
  122. <i class="fa fa-edit"></i> 编辑
  123. </button>
  124. <button class="btn btn-danger btn-xs "
  125. data-url="<?php echo Url('delete',array('city_id'=>$vo['city_id'])); ?>" type="button"><i
  126. class="fa fa-warning"></i> 删除
  127. </button>
  128. </td>
  129. </tr>
  130. <?php endforeach; endif; else: echo "" ;endif; ?>
  131. </tbody>
  132. </table>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <script>
  139. $('.btn-danger').on('click', function () {
  140. var _this = $(this), url = _this.data('url');
  141. $eb.$swal('delete', function () {
  142. $eb.axios.get(url).then(function (res) {
  143. console.log(res);
  144. if (res.status == 200 && res.data.code == 200) {
  145. $eb.$swal('success', res.data.msg);
  146. _this.parents('tr').remove();
  147. } else
  148. return Promise.reject(res.data.msg || '删除失败')
  149. }).catch(function (err) {
  150. $eb.$swal('error', err);
  151. });
  152. })
  153. });
  154. $('.clean-cache').on('click', function () {
  155. var _this = $(this), url = _this.data('url');
  156. $eb.$swal('delete', function () {
  157. $eb.axios.get(url).then(function (res) {
  158. if (res.status == 200 && res.data.code == 200) {
  159. $eb.$swal('success', res.data.msg);
  160. } else
  161. return Promise.reject(res.data.msg || '清除失败')
  162. }).catch(function (err) {
  163. $eb.$swal('error', err);
  164. });
  165. },{'title':'您确定要清除城市缓存吗?','text':'清除后系统会自动生成','confirm':'是的,我要清除'})
  166. });
  167. </script>
  168. </div>
  169. </body>
  170. </html>