pub_log.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <el-drawer
  3. title="操作日志"
  4. size="40%"
  5. :append-to-body="false"
  6. :destroy-on-close="true"
  7. :visible="true"
  8. :modal-append-to-body="false"
  9. :before-close="handleClose"
  10. :wrapperClosable="false"
  11. ref="drawer_close">
  12. <div v-loading="loading" style="margin-top: 20px;" class="block">
  13. <el-timeline>
  14. <el-timeline-item v-for="item in list" :timestamp="item.addtime" placement="top">
  15. <p style="display:flex;flex-direction: row">
  16. <span style="display: flex;flex-direction: column">
  17. <span :style="`margin-right:5px;width: 40px;height: 40px;display: inline-block;border: 50%;background:url(${item.user.icon_url});background-size: contain;background-position: center;`"></span>
  18. <div style="flex: 1"></div>
  19. </span>
  20. <span style="flex: 1;line-height: 30px;word-break:break-all">
  21. <a style="color: #006eff;margin-right: 5px;" target="_blank" :href="`${item.root_url}/rooter/user/${item.user.uid}`">{{item.user.nickname}}</a>{{item.content}}
  22. </span>
  23. </p>
  24. </el-timeline-item>
  25. </el-timeline>
  26. <el-pagination
  27. v-if="search.total>search.pagesize"
  28. background
  29. style="margin-left: 30px;margin-top: 30px"
  30. layout="total,prev, pager, next"
  31. @current-change="page_event"
  32. :page-size="search.pagesize"
  33. :total="search.total">
  34. </el-pagination>
  35. </div>
  36. </el-drawer>
  37. </template>
  38. <script>
  39. export default {
  40. props: {
  41. action: {
  42. },
  43. pro: {
  44. },
  45. back:{
  46. type:Object
  47. },
  48. },
  49. data() {
  50. return {
  51. search: {
  52. pagesize: 15,
  53. page:0,
  54. total:0,
  55. },
  56. loading:true,
  57. list: []
  58. };
  59. },
  60. computed: {},
  61. watch: {},
  62. created() {},
  63. mounted() {
  64. this.getList();
  65. },
  66. methods: {
  67. handleClose:function()
  68. {
  69. this.back.drawer_obj.pub_log=false;
  70. this.back.drawer_obj.id="";
  71. },
  72. async getList() {
  73. this.loading = true;
  74. let data = this.search;
  75. data.pro = this.pro;
  76. data.action = this.action;
  77. let res = await this.$post("/uapi/pub/info/user/behavior_log/list",data);
  78. this.loading = false;
  79. if (res.status == 1) {
  80. this.list = res.data.list;
  81. this.search.total = res.data.total;
  82. }
  83. },
  84. page_event(page) {
  85. this.search.page = page;
  86. this.getList();
  87. },
  88. }
  89. };
  90. </script>
  91. <style scoped>
  92. .el-tag {
  93. cursor: pointer;
  94. }
  95. </style>