index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <right-toolbar
  5. :showSearch.sync="showSearch"
  6. @queryTable="getList"
  7. ></right-toolbar>
  8. </el-row>
  9. <el-table
  10. v-loading="loading"
  11. :data="NFIDReaderList"
  12. @selection-change="handleSelectionChange"
  13. >
  14. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  15. <!-- <el-table-column label="ID" align="center" prop="id" width="80" /> -->
  16. <el-table-column label="设备序列号" align="center" prop="deviceSerial" />
  17. <el-table-column label="设备名称" align="center" prop="deviceName" />
  18. <el-table-column label="设备点位" align="center" prop="deviceSpot">
  19. <template slot-scope="scope">
  20. <el-tag v-if="scope.row.deviceSpot=='bind'">吊钩绑定</el-tag>
  21. <el-tag v-if="scope.row.deviceSpot=='weight'">白条称重</el-tag>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="最近通信时间" align="center" prop="lastActiveTime">
  25. <template slot-scope="scope">
  26. <span>{{ parseTime(scope.row.lastActiveTime) }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="状态" align="center" prop="status">
  30. <template slot-scope="scope">
  31. <el-tag type="info" v-if="scope.row.status=='0'">离线</el-tag>
  32. <el-tag v-if="scope.row.status=='1'">在线</el-tag>
  33. <el-tag type="danger" v-if="scope.row.status=='2'">异常</el-tag>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. <pagination
  38. v-show="total > 0"
  39. :total="total"
  40. :page.sync="queryParams.pageNum"
  41. :limit.sync="queryParams.pageSize"
  42. @pagination="getList"
  43. />
  44. </div>
  45. </template>
  46. <script>
  47. import {
  48. listNFIDReader,
  49. listAllNFIDReader
  50. } from "@/api/app/NFIDReader";
  51. export default {
  52. name: "NFIDReader",
  53. data() {
  54. return {
  55. // 遮罩层
  56. loading: true,
  57. // 选中数组
  58. ids: [],
  59. // 非单个禁用
  60. single: true,
  61. // 非多个禁用
  62. multiple: true,
  63. // 显示搜索条件
  64. showSearch: true,
  65. // 总条数
  66. total: 0,
  67. // 设备表格数据
  68. NFIDReaderList: [],
  69. regionOptions: [],
  70. // 弹出层标题
  71. title: "",
  72. isView:false,
  73. // 是否显示弹出层
  74. open: false,
  75. // 查询参数
  76. queryParams: {
  77. pageNum: 1,
  78. pageSize: 10,
  79. },
  80. // 表单参数
  81. form: {},
  82. // 表单校验
  83. rules: {
  84. },
  85. };
  86. },
  87. created() {
  88. this.getList();
  89. },
  90. methods: {
  91. /** 查询设备列表 */
  92. getList() {
  93. this.loading = true;
  94. listNFIDReader(this.queryParams).then((response) => {
  95. this.NFIDReaderList = response.rows;
  96. this.total = response.total;
  97. this.loading = false;
  98. });
  99. },
  100. // 取消按钮
  101. cancel() {
  102. this.open = false;
  103. this.reset();
  104. },
  105. // 表单重置
  106. reset() {
  107. this.form = {
  108. };
  109. this.resetForm("form");
  110. },
  111. /** 搜索按钮操作 */
  112. handleQuery() {
  113. this.queryParams.pageNum = 1;
  114. this.getList();
  115. },
  116. /** 重置按钮操作 */
  117. resetQuery() {
  118. this.resetForm("queryForm");
  119. this.handleQuery();
  120. },
  121. },
  122. };
  123. </script>