deviceIdErr.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div>
  3. <div class="gva-search-box">
  4. <el-form ref="searchForm" :inline="true" :model="searchInfo">
  5. <el-form-item label="游戏id">
  6. <el-input v-model="searchInfo.game_id" placeholder="游戏id" />
  7. </el-form-item>
  8. <el-form-item label="日期" prop="create_date">
  9. <el-date-picker
  10. v-model="searchInfo.create_date"
  11. popper-class="picker-popovers"
  12. class="timefilter"
  13. type="datetime"
  14. placeholder="选择日期时间"
  15. value-format="YYYY-MM-DD"
  16. >
  17. </el-date-picker>
  18. </el-form-item>
  19. <el-form-item>
  20. <el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
  21. <el-button size="small" icon="refresh" @click="onReset">重置</el-button>
  22. </el-form-item>
  23. </el-form>
  24. </div>
  25. <div class="gva-table-box">
  26. <el-table :data="tableData" @sort-change="sortChange">
  27. <el-table-column align="left" label="游戏ID" min-width="100" prop="game_id" sortable="custom" />
  28. <el-table-column align="left" label="电脑编号" min-width="80" prop="pc_code"/>
  29. <el-table-column align="left" label="负责人" min-width="90" prop="operator" />
  30. <el-table-column align="left" label="账号" min-width="150" prop="account" />
  31. <el-table-column align="left" label="设备id" min-width="150" prop="first_device_id" />
  32. <el-table-column align="left" label="异常游戏ID" min-width="150" prop="current_game_id" />
  33. <el-table-column align="left" label="异常账号" min-width="150" prop="current_account" />
  34. <el-table-column align="left" label="异常设备id" min-width="150" prop="current_device_id" />
  35. <el-table-column align="left" label="上报时间" min-width="150" prop="create_time" />
  36. <el-table-column align="left" label="日期" min-width="150" prop="create_date" />
  37. <el-table-column align="left" label="备注" min-width="60" prop="status">
  38. <template #default="scope">
  39. <div>
  40. {{ typeFiletr(scope.row.status) }}
  41. </div>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. <div class="gva-pagination">
  46. <el-pagination
  47. :current-page="page"
  48. :page-size="pageSize"
  49. :page-sizes="[10, 30, 50, 100]"
  50. :total="total"
  51. layout="total, sizes, prev, pager, next, jumper"
  52. @current-change="handleCurrentChange"
  53. @size-change="handleSizeChange"
  54. />
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. export default {
  61. name: 'DeviceId',
  62. }
  63. </script>
  64. <script setup>
  65. import {
  66. getDeviceIdErr
  67. } from '@/api/log'
  68. import { toSQLLine } from '@/utils/stringFun'
  69. import { ref } from 'vue'
  70. const page = ref(1)
  71. const total = ref(0)
  72. const pageSize = ref(10)
  73. const tableData = ref([])
  74. const searchInfo = ref({})
  75. const onReset = () => {
  76. searchInfo.value = {}
  77. }
  78. const searchStatusOptions = ref([
  79. {
  80. value: -1,
  81. label: '否',
  82. type: 'success'
  83. },
  84. {
  85. value: 1,
  86. label: '是',
  87. type: ''
  88. }
  89. ])
  90. // 搜索
  91. const onSubmit = () => {
  92. page.value = 1
  93. pageSize.value = 10
  94. searchInfo.value.game_id = Number(searchInfo.value.game_id)
  95. getTableData()
  96. }
  97. // 分页
  98. const handleSizeChange = (val) => {
  99. pageSize.value = val
  100. getTableData()
  101. }
  102. const handleCurrentChange = (val) => {
  103. page.value = val
  104. getTableData()
  105. }
  106. // 排序
  107. const sortChange = ({ prop, order }) => {
  108. if (prop) {
  109. if (prop === 'id') {
  110. prop = 'id'
  111. }
  112. searchInfo.value.orderKey = toSQLLine(prop)
  113. searchInfo.value.desc = order === 'descending'
  114. }
  115. getTableData()
  116. }
  117. // 查询
  118. const getTableData = async() => {
  119. const table = await getDeviceIdErr({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
  120. if (table.code === 0) {
  121. tableData.value = table.data.list
  122. total.value = table.data.total
  123. page.value = table.data.page
  124. pageSize.value = table.data.pageSize
  125. }
  126. }
  127. getTableData()
  128. const typeFiletr = (value) => {
  129. const target = typeOptions.value.filter(item => item.value === value)[0]
  130. return target && `${target.label}`
  131. }
  132. const typeOptions = ref([
  133. {
  134. value: 1,
  135. label: '设备id不同',
  136. type: ''
  137. },
  138. {
  139. value: 2,
  140. label: '设备id相同',
  141. type: ''
  142. },
  143. ])
  144. </script>
  145. <style scoped lang="scss">
  146. .button-box {
  147. padding: 10px 20px;
  148. .el-button {
  149. float: right;
  150. }
  151. }
  152. .warning {
  153. color: #dc143c;
  154. }
  155. </style>