api-log-list-delete.html 3.1 KB

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