api-log-list-delete.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>角色-添加/修改</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css js 资源 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <style type="text/css">
  17. .c-panel .el-form .c-label{width: 6em !important;}
  18. .c-panel .el-form .el-input{width: calc(100% - 120px);}
  19. </style>
  20. </head>
  21. <body>
  22. <div class="vue-box sbot" style="display: none;" :style="'display: block;'">
  23. <!-- ------- 内容部分 ------- -->
  24. <div class="s-body">
  25. <div class="c-panel">
  26. <div class="c-title">数据添加</div>
  27. <el-form v-if="m">
  28. <!-- no字段: m.id - id -->
  29. <div class="c-item br">
  30. <label class="c-label">开始日期:</label>
  31. <el-date-picker v-model="m.startTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="开始日期"></el-date-picker>
  32. </div>
  33. <div class="c-item br">
  34. <label class="c-label">结束日期:</label>
  35. <el-date-picker v-model="m.endTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="结束日期"></el-date-picker>
  36. </div>
  37. <div class="c-item br">
  38. <label class="c-label">已选范围:</label>
  39. <span style="color: red;">{{sa.forDate(m.startTime, 2)}}</span> -
  40. <span style="color: red;">{{sa.forDate(m.endTime, 2)}} </span>
  41. </div>
  42. <div class="c-item br">
  43. <label class="c-label">操作注意:</label>
  44. <span style="color: red;">日志删除后不可恢复,请谨慎操作</span>
  45. </div>
  46. </el-form>
  47. </div>
  48. </div>
  49. <!-- ------- 底部按钮 ------- -->
  50. <div class="s-foot">
  51. <el-button type="primary" @click="ok()">确定</el-button>
  52. <el-button @click="sa.closeCurrIframe()">取消</el-button>
  53. </div>
  54. </div>
  55. <script>
  56. var app = new Vue({
  57. el: '.vue-box',
  58. data: {
  59. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  60. m: {
  61. startTime: '',
  62. endTime: '',
  63. }, // 实体对象
  64. },
  65. methods: {
  66. // 提交数据
  67. ok: function(){
  68. if(sa.isNull(this.m.startTime) || sa.isNull(this.m.endTime) ) {
  69. return sa.error('请选择一个时间范围')
  70. }
  71. // 开始删除
  72. sa.ajax('/sp-admin/SgApilog/deleteByStartEnd', this.m, function(res){
  73. sa.alert('操作成功, 共删除 ' + res.data + ' 条请求记录', function() {
  74. if(parent.app) {
  75. parent.app.f5();
  76. sa.closeCurrIframe(); // 关闭本页
  77. }
  78. }.bind(this));
  79. }.bind(this));
  80. },
  81. },
  82. mounted: function(){
  83. }
  84. })
  85. </script>
  86. </body>
  87. </html>