| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-user-info');
- ComponentHelper::loadComponentView('com-list-page');
- ComponentHelper::loadComponentView('com-list-table');
- ?>
- <com-list-page :crumbs="crumbs" id="application">
- <com-list-table
- ref="table"
- :api-params="apiParams"
- :list-params-verify-fun="listParamsVerifyFun"
- @select-change="selectChange"
- :search-list="searchList"
- >
- <el-table-column prop="id" label="日志ID" align="center"></el-table-column>
- <el-table-column prop="id" label="操作人" align="center">
- <template slot-scope="scope">
- <com-user-info :user="scope.row.operator_user" :is-to-user-detail="scope.row.operator_user_type == 2"></com-user-info>
- </template>
- </el-table-column>
- <el-table-column prop="operator_user_type_text" label="操作人类型" align="center"></el-table-column>
- <el-table-column prop="id" label="操作目标用户" align="center">
- <template slot-scope="scope">
- <com-user-info :user="scope.row.user"></com-user-info>
- </template>
- </el-table-column>
- <el-table-column prop="behavior_text" label="行为" align="center"></el-table-column>
- <el-table-column label="操作内容" align="center">
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" :content="scope.row.desc" placement="top">
- <div>{{ scope.row.desc }}</div>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column prop="created_at_text" label="操作时间" align="center"></el-table-column>
- <el-table-column prop="ip_text" label="IP" align="center"></el-table-column>
- </com-list-table>
- </com-list-page>
- <script>
- const application = new Vue({
- el: '#application',
- data() {
- return {
- uid: 0,
- name: '',
- levelList: [],
- btnLoad: false,
- operatorUserTypeOptions: <?= $operatorUserTypeOptions ?>,
- behaviorOptions: <?= $behaviorOptions ?>,
- operatorUserIdPlaceholder: '操作人'
- }
- },
- computed: {
- apiParams() {
- return {
- r: 'agent/default/log'
- }
- },
- crumbs() {
- return [
- {
- title: '经销商',
- },
- {
- title: '经销商日志',
- }
- ]
- },
- searchList() {
- return [
- {
- key: 'operator_user_type',
- title: '操作人类型',
- type: 'select',
- placeholder: '请选择操作人类型',
- options: this.operatorUserTypeOptions,
- valueKey: {
- label: 'label',
- value: 'value',
- },
- },
- {
- key: 'operator_user_keyword',
- title: this.operatorUserIdPlaceholder,
- type: 'text',
- },
- {
- key: 'operator_target_user_keyword',
- title: '操作目标用户ID或手机号',
- type: 'text',
- },
- {
- key: 'behavior',
- title: '行为',
- type: 'select',
- placeholder: '请选择',
- options: this.behaviorOptions,
- valueKey: {
- label: 'label',
- value: 'value',
- },
- },
- ]
- }
- },
- created() {
- },
- methods: {
- selectChange(key, value) {
- if (key === 'operator_user_type') {
- if (value == 2) {
- this.operatorUserIdPlaceholder = '操作人ID或手机号'
- } else if(value == 1) {
- this.operatorUserIdPlaceholder = '操作人账号'
- } else {
- this.operatorUserIdPlaceholder = '操作人'
- }
- }
- },
- listParamsVerifyFun(params) {
- if (!isEmpty(params.operator_user_keyword) && isEmpty(params.operator_user_type)) {
- this.$message.error('请选择操作人类型')
- return false
- }
- return true
- }
- }
- })
- </script>
- <style>
- </style>
|