黄陂项目
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.

148 lines
5.0 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <div>
  3. <div class="head-container" style="display: flex; justify-content: flex-start;">
  4. <div class="head-search" style="margin-bottom: 0;">
  5. <!-- <date-range-picker v-model="query.startTime" class="date-item" /> -->
  6. <el-input v-model="query.search" clearable size="small" placeholder="文件名搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
  7. <rrOperation />
  8. </div>
  9. <crudOperation />
  10. </div>
  11. <!--表格渲染-->
  12. <el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @row-click="clickRowHandler" @selection-change="selectionChangeHandler" @row-dblclick="handleDbClick">
  13. <el-table-column type="selection" align="center" width="55" />
  14. <el-table-column prop="name" label="导入数据包" width="300px" />
  15. <el-table-column prop="status" label="导入状态">
  16. <template slot-scope="scope">
  17. <div v-if="scope.row.status === 0" class="import-loading">导入中</div>
  18. <div v-if="scope.row.status === 1">已完成</div>
  19. <!-- <div v-if="scope.row.status === 2" class="import-error">导入失败</div> -->
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="archivesNum" label="读取数量" />
  23. <el-table-column prop="normalNum" label="成功数量" />
  24. <el-table-column prop="skipNum" label="跳过数量" />
  25. <el-table-column prop="coverNum" label="覆盖数量" />
  26. <el-table-column prop="errorNum" label="失败数量" />
  27. <el-table-column prop="createTime" label="操作日期">
  28. <template slot-scope="scope">
  29. <div>{{ scope.row.createTime | parseTime }}</div>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. <!--分页组件-->
  34. <pagination />
  35. <el-dialog class="import-dialog" :close-on-click-modal="false" :visible.sync="detailVisible" title="导入详情" @closed="handleClose">
  36. <span class="dialog-right-top" />
  37. <span class="dialog-left-bottom" />
  38. <div class="setting-dialog">
  39. <ListPre
  40. ref="importTableList"
  41. :is-log-or-preview="isLogOrPreview"
  42. :hp-id="hpId"
  43. :initial-table-data="previewTableData"
  44. :initial-total="previewTotal"
  45. />
  46. </div>
  47. </el-dialog>
  48. </div>
  49. </template>
  50. <script>
  51. import crudFileImport from '@/api/archivesManage/fileImport'
  52. import CRUD, { presenter, header, crud } from '@crud/crud'
  53. import rrOperation from '@crud/RR.operation'
  54. import crudOperation from '@crud/CRUD.operation'
  55. import pagination from '@crud/Pagination'
  56. // import DateRangePicker from '@/components/DateRangePicker'
  57. import ListPre from '../module/listPre.vue'
  58. export default {
  59. name: 'ImportLog',
  60. components: { ListPre, rrOperation, crudOperation, pagination },
  61. cruds() {
  62. return CRUD({ title: '导入日志', url: 'api/unzip/getImportHpLog', crudMethod: { ...crudFileImport }, optShow: {
  63. add: false,
  64. edit: false,
  65. del: false,
  66. reset: true,
  67. download: false,
  68. group: false
  69. },
  70. sort: []
  71. })
  72. },
  73. mixins: [presenter(), header(), crud()],
  74. data() {
  75. return {
  76. detailVisible: false,
  77. previewTableData: [], // 用于存储预览表格数据
  78. previewTotal: 0, // 用于存储预览数据总数
  79. hpId: null,
  80. isLogOrPreview: ''
  81. }
  82. },
  83. created() {
  84. },
  85. methods: {
  86. clickRowHandler(row) {
  87. // this.$refs.table.toggleRowSelection(row)
  88. },
  89. selectionChangeHandler(val) {
  90. this.selections = val
  91. },
  92. // 双击详情
  93. handleDbClick(row) {
  94. this.hpId = row.id
  95. this.isLogOrPreview = 'log'
  96. if (row.status === 0) {
  97. this.$message({
  98. type: 'info',
  99. message: '当前批量数据导入中,请用户耐心等待,谢谢!'
  100. })
  101. } else {
  102. crudFileImport.FetchHpArchivesDetailsByHpId({
  103. page: 0,
  104. size: 10,
  105. hpId: this.hpId,
  106. isError: false
  107. }).then(res => {
  108. this.$refs.importTableList.readData = row.archivesNum
  109. this.$refs.importTableList.importData = row.normalNum
  110. this.$refs.importTableList.skipData = row.skipNum
  111. this.$refs.importTableList.coverData = row.coverNum
  112. this.$refs.importTableList.errorData = row.errorNum
  113. this.previewTableData = res.data.content
  114. this.previewTotal = res.data.totalElements
  115. })
  116. this.detailVisible = true
  117. }
  118. },
  119. handleClose() {
  120. this.detailVisible = false
  121. this.$refs.importTableList.archivesTabIndex = 0
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. .import-dialog{
  128. ::v-deep .el-dialog{
  129. width: 940px;
  130. .el-dialog__body{
  131. padding: 20px 0 30px 0;
  132. }
  133. .setting-dialog{
  134. position: relative;
  135. }
  136. }
  137. }
  138. .import-loading{
  139. color: #fd8042;
  140. }
  141. .import-error{
  142. color: rgb(246, 81, 99);
  143. }
  144. </style>