【前端】智能库房综合管理系统前端项目
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.

154 lines
5.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div>
  3. <div class="head-container">
  4. <!-- <crudOperation /> -->
  5. <!-- <el-button v-permission="permission.download" :loading="crud.downloadLoading" :disabled="!selections.length" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> -->
  6. <el-button :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button>
  7. <el-input
  8. v-model="keyWord"
  9. size="small"
  10. clearable
  11. placeholder="请输入关键词"
  12. style="width: 300px;margin-right:10px;padding-left:10px"
  13. class="input-prepend filter-item"
  14. @keyup.enter.native="crud.toQuery"
  15. >
  16. <!-- <el-select slot="prepend" v-model="optionVal" style="width: 100px" @keyup.enter.native="crud.toQuery"> -->
  17. <el-select slot="prepend" v-model="optionVal" style="width: 80px">
  18. <el-option
  19. v-for="item in options"
  20. :key="item.value"
  21. :label="item.label"
  22. :value="item.value"
  23. />
  24. </el-select>
  25. </el-input>
  26. <date-range-picker v-model="queryTime" class="date-item" />
  27. <rrOperation />
  28. </div>
  29. <el-table
  30. ref="table"
  31. :data="crud.data"
  32. style="width: 100%;"
  33. height="calc(100vh - 356px)"
  34. :cell-class-name="cell"
  35. @row-click="clickRowHandler"
  36. @selection-change="selectionChangeHandler"
  37. >
  38. <el-table-column type="selection" width="55" align="center" />
  39. <el-table-column type="index" label="序号" width="100" align="center" />
  40. <el-table-column prop="alarmLevel" label="状态" align="center" min-width="150">
  41. <template slot-scope="scope">
  42. <span v-if="scope.row.alarmLevel===0" class="clear" style="width:56px">异常</span>
  43. <span v-if="scope.row.alarmLevel===1" class="clear" style="width:56px">正常</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column prop="roomName" label="库房" align="center" min-width="150" />
  47. <el-table-column prop="deviceName" label="设备名称" align="center" min-width="180" />
  48. <el-table-column prop="maintitle" label="档案信息" align="center" min-width="180" />
  49. <el-table-column prop="archiveNo" label="档号" align="center" min-width="180" />
  50. <el-table-column prop="alarmMsg" label="警情描述" align="center" min-width="180" />
  51. <el-table-column prop="createTime" label="报警时间" align="center" min-width="180">
  52. <template slot-scope="scope">
  53. <div>{{ scope.row.createTime | parseTime }}</div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column prop="alarmEvent" label="事件" min-width="150" align="center">
  57. <template slot-scope="scope">
  58. <span v-if="scope.row.alarmEvent===0"></span>
  59. <span v-if="scope.row.alarmEvent===1"></span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="borrowerName" label="用户" align="center" min-width="150" />
  63. </el-table>
  64. <pagination />
  65. </div>
  66. </template>
  67. <script>
  68. import rrOperation from '@crud/RR.operation'
  69. import CRUD, { presenter, crud } from '@crud/crud'
  70. import DateRangePicker from '@/components/DateRangePicker'
  71. import pagination from '@crud/Pagination'
  72. import { exportFile } from '@/utils/index'
  73. import { mapGetters } from 'vuex'
  74. export default {
  75. name: 'DoorLog',
  76. components: { rrOperation, DateRangePicker, pagination },
  77. mixins: [presenter(), crud()],
  78. cruds() {
  79. return CRUD({
  80. url: 'api/securitydoor/initSecurityDoorLog',
  81. optShow: {
  82. add: false,
  83. edit: false,
  84. del: false,
  85. download: true
  86. }
  87. })
  88. },
  89. data() {
  90. return {
  91. selections: [],
  92. keyWord: '',
  93. optionVal: 'deviceName',
  94. options: [
  95. { value: 'deviceName', label: '设备' },
  96. { value: 'roomName', label: '库房' }
  97. ],
  98. queryTime: []
  99. }
  100. },
  101. computed: {
  102. ...mapGetters([
  103. 'baseApi'
  104. ])
  105. },
  106. methods: {
  107. [CRUD.HOOK.beforeRefresh]() {
  108. this.crud.query.roomName = null
  109. this.crud.query.deviceName = null
  110. this.crud.query.startTime = null
  111. this.crud.query.endTime = null
  112. if (this.optionVal === 'deviceName') {
  113. this.crud.query.deviceName = this.keyWord
  114. } else if (this.optionVal === 'roomName') {
  115. this.crud.query.roomName = this.keyWord
  116. }
  117. if (this.queryTime.length > 0) {
  118. this.crud.query.startTime = this.queryTime[0]
  119. this.crud.query.endTime = this.queryTime[1]
  120. }
  121. },
  122. // 导出
  123. handleDownload() {
  124. this.crud.downloadLoading = true
  125. exportFile(this.baseApi + '/api/securitydoor/exportSecurityDoorLogList')
  126. this.crud.downloadLoading = false
  127. },
  128. clickRowHandler(row) {
  129. this.$refs.table.toggleRowSelection(row) // 单击选中
  130. },
  131. selectionChangeHandler(val) {
  132. this.selections = val
  133. },
  134. // 查看监控
  135. handleListen() {
  136. this.$refs.listenDom.dialogVisible = true
  137. },
  138. cell({ row, columnIndex }) {
  139. if (row.alarmLevel === 1 && columnIndex === 2) {
  140. return 'have-clear'
  141. } else if (row.alarmLevel === 0 && columnIndex === 2) {
  142. return 'fail-clear'
  143. }
  144. }
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. @import '~@/assets/styles/lend-manage.scss';
  150. @import "~@/assets/styles/archives-manage.scss";
  151. </style>