api-log-list-delete.html 3.7 KB

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