华西海圻ELN前端工程
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.9 KiB

  1. <template>
  2. <div class="system-log-list">
  3. <div class="ytbd-search">
  4. <el-form :model="searchForm" ref="searchForm" :inline="true" label-width="80px">
  5. <el-form-item :label="$t('page.system.systemLog.czr')" prop="nickName">
  6. <el-input v-model="searchForm.nickName" :placeholder="$t('form.placeholderInput')" clearable
  7. style="width: 120px" />
  8. </el-form-item>
  9. <el-form-item :label="$t('page.system.systemLog.czsj')">
  10. <el-date-picker v-model="daterange" clearable type="daterange" range-separator="-" :start-placeholder="$t('page.business.study.study.startDate')"
  11. :end-placeholder="$t('page.business.study.study.endDate')" value-format="yyyy-MM-dd" @change="search" style="width: 200px" />
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" icon="el-icon-search" @click="search">{{ $t('page.business.study.study.search') }}</el-button>
  15. <el-button icon="el-icon-refresh" @click="reset">{{ $t('form.reset') }}</el-button>
  16. <el-button type="warning" plain icon="el-icon-download" @click="handleExport" v-hasPermi="['business:systemLog:operate:export']">{{$t('form.export')}}</el-button>
  17. </el-form-item>
  18. </el-form>
  19. </div>
  20. <div class="ytbd-content">
  21. <el-table v-loading="loading" :data="list">
  22. <el-table-column :label="$t('page.system.systemLog.czr')" prop="nickName" width="200" />
  23. <el-table-column :label="$t('page.system.systemLog.czlx')" width="200">
  24. <template slot-scope="scope">
  25. <span>{{$t('login.logIn')}}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column :label="$t('page.system.systemLog.czxq')">
  29. <template slot-scope="scope">
  30. <span>{{scope.row.msg}}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column :label="$t('page.business.archive.czsj')" align="center" prop="accessTime" width="200" />
  34. </el-table>
  35. <pagination v-show="total > 0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize"
  36. @pagination="getList" />
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. import { list} from "@/api/system/logininfor"
  42. export default {
  43. name: 'Dlrz',
  44. props: {
  45. },
  46. computed: {
  47. },
  48. data() {
  49. return {
  50. daterange:[],
  51. searchForm: {
  52. pageNum: 1,
  53. pageSize: 10,
  54. nickName: '',
  55. startDate:'',
  56. endDate:'',
  57. },
  58. loading: false,
  59. total: 0,
  60. list: [],
  61. }
  62. },
  63. created() {
  64. this.getList()
  65. },
  66. methods: {
  67. search() {
  68. this.searchForm.pageNum = 1
  69. this.getList()
  70. },
  71. reset() {
  72. this.searchForm.nickName = ''
  73. this.searchForm.startDate = ''
  74. this.searchForm.endDate = ''
  75. this.daterange = []
  76. this.search()
  77. },
  78. getList() {
  79. this.loading = true
  80. this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''
  81. this.searchForm.endDate = this.daterange && this.daterange.length > 1 ? this.daterange[1] : ''
  82. list(this.searchForm).then(response => {
  83. this.list = response.rows
  84. this.total = response.total
  85. this.loading = false
  86. })
  87. },
  88. handleExport(){
  89. this.saveSimpleLog({name:'',nameEn:'',jcmc:'登录日志导出',jcmcEn:'User Login Log Export'})
  90. this.searchForm.startDate = this.daterange && this.daterange.length > 0 ? this.daterange[0] : ''
  91. this.searchForm.endDate = this.daterange && this.daterange.length > 1 ? this.daterange[1] : ''
  92. this.download('system/logininfor/export', this.searchForm, `userLoginLog_${new Date().getTime()}.xlsx`)
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .system-log-list {
  99. .ytbd-search {
  100. background: #fff;
  101. padding: 20px;
  102. padding-bottom: 0;
  103. margin-bottom: 10px;
  104. .right-btn {
  105. text-align: right
  106. }
  107. }
  108. .ytbd-content {
  109. padding: 20px;
  110. background: #fff;
  111. .add-box {
  112. margin-bottom: 10px;
  113. }
  114. }
  115. }
  116. </style>