log.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-user-info');
  4. ComponentHelper::loadComponentView('com-list-page');
  5. ComponentHelper::loadComponentView('com-list-table');
  6. ?>
  7. <com-list-page :crumbs="crumbs" id="application">
  8. <com-list-table
  9. ref="table"
  10. :api-params="apiParams"
  11. :list-params-verify-fun="listParamsVerifyFun"
  12. @select-change="selectChange"
  13. :search-list="searchList"
  14. >
  15. <el-table-column prop="id" label="日志ID" align="center"></el-table-column>
  16. <el-table-column prop="id" label="操作人" align="center">
  17. <template slot-scope="scope">
  18. <com-user-info :user="scope.row.operator_user" :is-to-user-detail="scope.row.operator_user_type == 2"></com-user-info>
  19. </template>
  20. </el-table-column>
  21. <el-table-column prop="operator_user_type_text" label="操作人类型" align="center"></el-table-column>
  22. <el-table-column prop="id" label="操作目标用户" align="center">
  23. <template slot-scope="scope">
  24. <com-user-info :user="scope.row.user"></com-user-info>
  25. </template>
  26. </el-table-column>
  27. <el-table-column prop="behavior_text" label="行为" align="center"></el-table-column>
  28. <el-table-column label="操作内容" align="center">
  29. <template slot-scope="scope">
  30. <el-tooltip class="item" effect="dark" :content="scope.row.desc" placement="top">
  31. <div>{{ scope.row.desc }}</div>
  32. </el-tooltip>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="created_at_text" label="操作时间" align="center"></el-table-column>
  36. <el-table-column prop="ip_text" label="IP" align="center"></el-table-column>
  37. </com-list-table>
  38. </com-list-page>
  39. <script>
  40. const application = new Vue({
  41. el: '#application',
  42. data() {
  43. return {
  44. uid: 0,
  45. name: '',
  46. levelList: [],
  47. btnLoad: false,
  48. operatorUserTypeOptions: <?= $operatorUserTypeOptions ?>,
  49. behaviorOptions: <?= $behaviorOptions ?>,
  50. operatorUserIdPlaceholder: '操作人'
  51. }
  52. },
  53. computed: {
  54. apiParams() {
  55. return {
  56. r: 'agent/default/log'
  57. }
  58. },
  59. crumbs() {
  60. return [
  61. {
  62. title: '经销商',
  63. },
  64. {
  65. title: '经销商日志',
  66. }
  67. ]
  68. },
  69. searchList() {
  70. return [
  71. {
  72. key: 'operator_user_type',
  73. title: '操作人类型',
  74. type: 'select',
  75. placeholder: '请选择操作人类型',
  76. options: this.operatorUserTypeOptions,
  77. valueKey: {
  78. label: 'label',
  79. value: 'value',
  80. },
  81. },
  82. {
  83. key: 'operator_user_keyword',
  84. title: this.operatorUserIdPlaceholder,
  85. type: 'text',
  86. },
  87. {
  88. key: 'operator_target_user_keyword',
  89. title: '操作目标用户ID或手机号',
  90. type: 'text',
  91. },
  92. {
  93. key: 'behavior',
  94. title: '行为',
  95. type: 'select',
  96. placeholder: '请选择',
  97. options: this.behaviorOptions,
  98. valueKey: {
  99. label: 'label',
  100. value: 'value',
  101. },
  102. },
  103. ]
  104. }
  105. },
  106. created() {
  107. },
  108. methods: {
  109. selectChange(key, value) {
  110. if (key === 'operator_user_type') {
  111. if (value == 2) {
  112. this.operatorUserIdPlaceholder = '操作人ID或手机号'
  113. } else if(value == 1) {
  114. this.operatorUserIdPlaceholder = '操作人账号'
  115. } else {
  116. this.operatorUserIdPlaceholder = '操作人'
  117. }
  118. }
  119. },
  120. listParamsVerifyFun(params) {
  121. if (!isEmpty(params.operator_user_keyword) && isEmpty(params.operator_user_type)) {
  122. this.$message.error('请选择操作人类型')
  123. return false
  124. }
  125. return true
  126. }
  127. }
  128. })
  129. </script>
  130. <style>
  131. </style>