operatorLog.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view>
  3. <view class="log" v-for="item in operatorLogs" :key="item.code">
  4. <view class="oper">
  5. <text class="title">操作内容:{{item.content}}</text>
  6. </view>
  7. <view class="content">
  8. <text>操 作 人:{{item.userRealname}}</text>
  9. <text>操作时间:{{item.updateTime | timeFilter}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. operatorLogs: [],
  19. }
  20. },
  21. filters: {
  22. timeFilter(data) {
  23. if(data!=='') {
  24. let time = uni.$moment(data).format("YYYY-MM-DD HH:mm:ss")
  25. return time
  26. }
  27. }
  28. },
  29. onLoad() {
  30. uni.request({
  31. url: 'http://127.0.0.1:9999/operatorLog/list',
  32. method: 'GET',
  33. data: {},
  34. success: res => {
  35. this.operatorLogs = res.data.data.operatorLogs;
  36. console.log(res.data.data.operatorLogs);
  37. },
  38. })
  39. },
  40. methods: {
  41. }
  42. }
  43. </script>
  44. <style>
  45. .log {
  46. width: 702rpx;
  47. height: 329rpx;
  48. background-color: white;
  49. margin-top: 30rpx;
  50. margin-left: 24rpx;
  51. border-radius: 10rpx;
  52. padding-top: 30rpx;
  53. }
  54. .content {
  55. display: flex;
  56. flex-direction: column;
  57. margin-top: 20rpx;
  58. margin-left: 30rpx;
  59. line-height: 55rpx;
  60. color: #444546;
  61. font-size: 28rpx;
  62. }
  63. .oper{
  64. height: 180rpx;
  65. }
  66. .title {
  67. font-size: 36rpx;
  68. margin-left: 30rpx;
  69. color: #282828;
  70. font-weight: 600;
  71. }
  72. </style>