Commit 20ca5dc668a3b29f19f0d165a03e53d8fbb6ab93
1 parent
1231aa27
优化登陆日志
Showing
2 changed files
with
23 additions
and
65 deletions
src/views/user/login/Login.vue
src/views/user/userLoginList.vue
| @@ -5,12 +5,9 @@ | @@ -5,12 +5,9 @@ | ||
| 5 | <el-card class="store-list-card"> | 5 | <el-card class="store-list-card"> |
| 6 | <div class="store-list"> | 6 | <div class="store-list"> |
| 7 | <ul class="store-ul"> | 7 | <ul class="store-ul"> |
| 8 | - <li | ||
| 9 | - v-for="(item,index) in userLoginInfo.stores" | ||
| 10 | - :key="index" | ||
| 11 | - @click="swatchStore(item)" | ||
| 12 | - :class="{'selected-store':userLoginInfo.conditions.storeId == item.storeId}"> | ||
| 13 | - {{item.name}}<span v-if="item.storeTypeName">({{item.storeTypeName}})</span> | 8 | + <li v-for="(item, index) in userLoginInfo.stores" :key="index" @click="swatchStore(item)" |
| 9 | + :class="{ 'selected-store': userLoginInfo.conditions.storeId == item.storeId }"> | ||
| 10 | + {{ item.name }}<span v-if="item.storeTypeName">({{ item.storeTypeName }})</span> | ||
| 14 | </li> | 11 | </li> |
| 15 | </ul> | 12 | </ul> |
| 16 | </div> | 13 | </div> |
| @@ -23,35 +20,23 @@ | @@ -23,35 +20,23 @@ | ||
| 23 | </div> | 20 | </div> |
| 24 | <el-row :gutter="20"> | 21 | <el-row :gutter="20"> |
| 25 | <el-col :span="4"> | 22 | <el-col :span="4"> |
| 26 | - <el-input | ||
| 27 | - :placeholder="$t('userLogin.search.name')" | ||
| 28 | - v-model="userLoginInfo.conditions.name" | ||
| 29 | - clearable /> | 23 | + <el-input :placeholder="$t('userLogin.search.name')" v-model="userLoginInfo.conditions.name" clearable /> |
| 30 | </el-col> | 24 | </el-col> |
| 31 | <el-col :span="4"> | 25 | <el-col :span="4"> |
| 32 | - <el-input | ||
| 33 | - type="number" | ||
| 34 | - :placeholder="$t('userLogin.search.tel')" | ||
| 35 | - v-model="userLoginInfo.conditions.tel" | 26 | + <el-input type="number" :placeholder="$t('userLogin.search.tel')" v-model="userLoginInfo.conditions.tel" |
| 36 | clearable /> | 27 | clearable /> |
| 37 | </el-col> | 28 | </el-col> |
| 38 | <el-col :span="4"> | 29 | <el-col :span="4"> |
| 39 | - <el-date-picker | ||
| 40 | - v-model="userLoginInfo.conditions.startTime" | ||
| 41 | - type="datetime" | ||
| 42 | - :placeholder="$t('userLogin.search.startTime')" | ||
| 43 | - value-format="yyyy-MM-dd HH:mm:ss"> | 30 | + <el-date-picker v-model="userLoginInfo.conditions.startTime" type="datetime" |
| 31 | + :placeholder="$t('userLogin.search.startTime')" value-format="yyyy-MM-dd HH:mm:ss"> | ||
| 44 | </el-date-picker> | 32 | </el-date-picker> |
| 45 | </el-col> | 33 | </el-col> |
| 46 | <el-col :span="4"> | 34 | <el-col :span="4"> |
| 47 | - <el-date-picker | ||
| 48 | - v-model="userLoginInfo.conditions.endTime" | ||
| 49 | - type="datetime" | ||
| 50 | - :placeholder="$t('userLogin.search.endTime')" | ||
| 51 | - value-format="yyyy-MM-dd HH:mm:ss"> | 35 | + <el-date-picker v-model="userLoginInfo.conditions.endTime" type="datetime" |
| 36 | + :placeholder="$t('userLogin.search.endTime')" value-format="yyyy-MM-dd HH:mm:ss"> | ||
| 52 | </el-date-picker> | 37 | </el-date-picker> |
| 53 | </el-col> | 38 | </el-col> |
| 54 | - <el-col :span="4" > | 39 | + <el-col :span="4"> |
| 55 | <el-button type="primary" @click="_queryUserLoginMethod"> | 40 | <el-button type="primary" @click="_queryUserLoginMethod"> |
| 56 | <i class="el-icon-search"></i> {{ $t('common.search') }} | 41 | <i class="el-icon-search"></i> {{ $t('common.search') }} |
| 57 | </el-button> | 42 | </el-button> |
| @@ -63,50 +48,22 @@ | @@ -63,50 +48,22 @@ | ||
| 63 | <div slot="header" class="clearfix text-left"> | 48 | <div slot="header" class="clearfix text-left"> |
| 64 | <span>{{ $t('userLogin.table.title') }}</span> | 49 | <span>{{ $t('userLogin.table.title') }}</span> |
| 65 | </div> | 50 | </div> |
| 66 | - <el-table | ||
| 67 | - v-loading="loading" | ||
| 68 | - :data="userLoginInfo.logs" | ||
| 69 | - border | ||
| 70 | - style="width: 100%"> | ||
| 71 | - <el-table-column | ||
| 72 | - prop="loginId" | ||
| 73 | - :label="$t('userLogin.table.loginId')" | ||
| 74 | - align="center" /> | ||
| 75 | - <el-table-column | ||
| 76 | - prop="parentOrgName" | ||
| 77 | - :label="$t('userLogin.table.parentOrgName')" | ||
| 78 | - align="center"> | 51 | + <el-table v-loading="loading" :data="userLoginInfo.logs" border style="width: 100%"> |
| 52 | + <el-table-column prop="loginId" :label="$t('userLogin.table.loginId')" align="center" /> | ||
| 53 | + <el-table-column prop="parentOrgName" :label="$t('userLogin.table.parentOrgName')" align="center"> | ||
| 79 | <template slot-scope="scope"> | 54 | <template slot-scope="scope"> |
| 80 | {{ scope.row.parentOrgName || '-' }} | 55 | {{ scope.row.parentOrgName || '-' }} |
| 81 | </template> | 56 | </template> |
| 82 | </el-table-column> | 57 | </el-table-column> |
| 83 | - <el-table-column | ||
| 84 | - prop="orgName" | ||
| 85 | - :label="$t('userLogin.table.orgName')" | ||
| 86 | - align="center" /> | ||
| 87 | - <el-table-column | ||
| 88 | - prop="userName" | ||
| 89 | - :label="$t('userLogin.table.userName')" | ||
| 90 | - align="center" /> | ||
| 91 | - <el-table-column | ||
| 92 | - prop="loginTime" | ||
| 93 | - :label="$t('userLogin.table.loginTime')" | ||
| 94 | - align="center" /> | ||
| 95 | - <el-table-column | ||
| 96 | - prop="userId" | ||
| 97 | - :label="$t('userLogin.table.userId')" | ||
| 98 | - align="center" /> | 58 | + <el-table-column prop="orgName" :label="$t('userLogin.table.orgName')" align="center" /> |
| 59 | + <el-table-column prop="userName" :label="$t('userLogin.table.userName')" align="center" /> | ||
| 60 | + <el-table-column prop="loginTime" :label="$t('userLogin.table.loginTime')" align="center" /> | ||
| 61 | + <el-table-column prop="userId" :label="$t('userLogin.table.userId')" align="center" /> | ||
| 99 | </el-table> | 62 | </el-table> |
| 100 | 63 | ||
| 101 | - <el-pagination | ||
| 102 | - @size-change="handleSizeChange" | ||
| 103 | - @current-change="handleCurrentChange" | ||
| 104 | - :current-page="pagination.current" | ||
| 105 | - :page-sizes="[10, 20, 30, 50]" | ||
| 106 | - :page-size="pagination.size" | ||
| 107 | - layout="total, sizes, prev, pager, next, jumper" | ||
| 108 | - :total="pagination.total" | ||
| 109 | - style="margin-top: 20px;"> | 64 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" |
| 65 | + :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | ||
| 66 | + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" style="margin-top: 20px;"> | ||
| 110 | </el-pagination> | 67 | </el-pagination> |
| 111 | </el-card> | 68 | </el-card> |
| 112 | </el-col> | 69 | </el-col> |
| @@ -155,9 +112,9 @@ export default { | @@ -155,9 +112,9 @@ export default { | ||
| 155 | page: this.pagination.current, | 112 | page: this.pagination.current, |
| 156 | row: this.pagination.size | 113 | row: this.pagination.size |
| 157 | } | 114 | } |
| 158 | - const { data, records } = await queryUserLogin(params) | 115 | + const { data, total } = await queryUserLogin(params) |
| 159 | this.userLoginInfo.logs = data | 116 | this.userLoginInfo.logs = data |
| 160 | - this.pagination.total = records | 117 | + this.pagination.total = total |
| 161 | } catch (error) { | 118 | } catch (error) { |
| 162 | this.$message.error(this.$t('userLogin.fetchError')) | 119 | this.$message.error(this.$t('userLogin.fetchError')) |
| 163 | } finally { | 120 | } finally { |