Browse Source

批量导入/环控设备/样式优化

master
xuhuajiao 3 months ago
parent
commit
24e0246510
  1. 24
      src/api/archivesManage/fileImport.js
  2. 12
      src/api/storeManage/deviceManage/device.js
  3. 228
      src/views/archivesManage/fileImport/dataImport/index.vue
  4. 60
      src/views/archivesManage/fileImport/importLog/index.vue
  5. 1
      src/views/archivesManage/fileImport/index.vue
  6. 139
      src/views/archivesManage/fileImport/module/EditableCell.vue
  7. 122
      src/views/archivesManage/fileImport/module/detail.vue
  8. 202
      src/views/archivesManage/fileImport/module/listPre-edit.vue
  9. 282
      src/views/archivesManage/fileImport/module/listPre.vue
  10. 8
      src/views/components/AccessDoor.vue
  11. 8
      src/views/components/WarehouseWarning.vue
  12. 11
      src/views/environmentalScreen/index.vue
  13. 4
      src/views/home.vue
  14. 19
      src/views/storeManage/deviceManage/module/deviceDetail.vue

24
src/api/archivesManage/fileImport.js

@ -4,9 +4,11 @@ import axios from 'axios'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
// 预览上传zip信息 // 预览上传zip信息
export function zipUpload(api, file) {
export function zipUpload(api, file, username) {
var data = new FormData() var data = new FormData()
data.append('multipartFile', file)
// data.append('multipartFile', file)
data.append('file', file)
data.append('username', username)
const config = { const config = {
headers: { 'Authorization': getToken() } headers: { 'Authorization': getToken() }
} }
@ -21,6 +23,13 @@ export function FetchInitImportPreview(params) {
}) })
} }
export function FetchHpArchivesDetailsByHpId(params) {
return request({
url: 'api/unzip/getHpArchivesDetailsByHpId' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 导入 // 导入
export function FetchImportZip(parameter) { export function FetchImportZip(parameter) {
return request({ return request({
@ -30,6 +39,15 @@ export function FetchImportZip(parameter) {
}) })
} }
// 黄陂导入
export function FetchImportHp(parameter) {
return request({
url: 'api/unzip/importHp',
method: 'post',
data: parameter
})
}
// 导入日志 // 导入日志
export function FetchInitImportLog(params) { export function FetchInitImportLog(params) {
return request({ return request({
@ -49,7 +67,9 @@ export function FetchInitImportLogDetail(params) {
export default { export default {
zipUpload, zipUpload,
FetchInitImportPreview, FetchInitImportPreview,
FetchHpArchivesDetailsByHpId,
FetchImportZip, FetchImportZip,
FetchImportHp,
FetchInitImportLog, FetchInitImportLog,
FetchInitImportLogDetail FetchInitImportLogDetail
} }

12
src/api/storeManage/deviceManage/device.js

@ -76,7 +76,7 @@ function getUrl(data, optTYpe) {
url = 'api/insidedevices/' url = 'api/insidedevices/'
} else if (data.deviceTypeId.name === '通道门' || data.deviceTypeId.name === '手持式RFID读写器') { } else if (data.deviceTypeId.name === '通道门' || data.deviceTypeId.name === '手持式RFID读写器') {
url = 'api/outsidedevices/' url = 'api/outsidedevices/'
} else if (data.deviceTypeId.name === '条码打印机' || data.deviceTypeId.name === '门禁') {
} else if (data.deviceTypeId.name === '条码打印机' || data.deviceTypeId.name === '门禁' || data.deviceTypeId.name === '原品环控') {
url = 'api/device/' url = 'api/device/'
} }
if (optTYpe === 'add') { if (optTYpe === 'add') {
@ -171,4 +171,12 @@ export function FetchRFIDReadStatus(params) {
}) })
} }
export default { add, edit, del, getSupplier, getDeviceType, getDeviceById, getDesecabinetById, getRotarycabinetById, getDeviceList, FetchIsOnline, FetchInBorrowByQuCol, unbind, FetchCallExternalOpenCol, FetchCallExternalResetCol, FetchCallExternalVent, FetchCallExternalStopMove, FetchPingIP, FetchRFIDReadStatus }
// 根据原品查看设备是否在线
export function FetchypNetStatusByIp(params) {
return request({
url: 'api/device/getypNetStatusByIp' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { add, edit, del, getSupplier, getDeviceType, getDeviceById, getDesecabinetById, getRotarycabinetById, getDeviceList, FetchIsOnline, FetchInBorrowByQuCol, unbind, FetchCallExternalOpenCol, FetchCallExternalResetCol, FetchCallExternalVent, FetchCallExternalStopMove, FetchPingIP, FetchRFIDReadStatus, FetchypNetStatusByIp }

228
src/views/archivesManage/fileImport/dataImport/index.vue

@ -16,10 +16,10 @@
class="step-content step-upload" class="step-content step-upload"
> >
<div class="upload-container"> <div class="upload-container">
<input ref="fileInput" :key="key" type="file" accept=".zip" @change="handleFileChange">
<input ref="fileInput" :key="key" type="file" accept=".xlsx, .xls" @change="handleFileChange">
<div class="upload-zip"><i class="el-icon-upload2" />选择文件</div> <div class="upload-zip"><i class="el-icon-upload2" />选择文件</div>
</div> </div>
<div class="el-upload__tip">上传限制文件类型zip</div>
<div class="el-upload__tip">上传限制文件类型xlsx, xls</div>
<div v-for="item in fileList" :key="item.name" class="file-list"> <div v-for="item in fileList" :key="item.name" class="file-list">
{{ item.name }} {{ item.name }}
<i class="el-icon-close" @click="deleteFile(item)" /> <i class="el-icon-close" @click="deleteFile(item)" />
@ -28,15 +28,42 @@
<div v-if="isShow01" class="step-bottom-btn"> <div v-if="isShow01" class="step-bottom-btn">
<el-button type="primary" @click="handleStep01">下一步</el-button> <el-button type="primary" @click="handleStep01">下一步</el-button>
</div> </div>
<div v-show="isShow02" class="step-content">
<div class="import-data-number">案卷<span>{{ ajnum }}</span> / 卷内<span>{{ danum }}</span> / 资料<span>{{ djnum }}</span> </div>
<detail ref="importTableList" :is-log-or-preview="isLogOrPreview" :ajnum="ajnum" :danum="danum" :djnum="djnum" />
<div v-if="isShow02" class="step-content">
<div class="import-data-number"> <span style="color: #339cff;">{{ totalNum }}</span> 正常 <span style="color: #1AAE93;">{{ normalNum }}</span> 问题 <span style="color:rgb(246,81,99)">{{ errorNum }}</span> </div>
<ListPre
ref="importTableList"
:hp-id="hpId"
:initial-table-data="previewTableData"
:initial-total="previewTotal"
/>
</div> </div>
<div v-if="isShow02" class="step-bottom-btn"> <div v-if="isShow02" class="step-bottom-btn">
<el-button @click="handleReturn02">上一步</el-button> <el-button @click="handleReturn02">上一步</el-button>
<el-button type="primary" @click="handleStep02">下一步</el-button>
<el-button type="primary" @click="submitImport">导入</el-button>
</div> </div>
<div v-if="isShow03" class="step-content step-content03"> <div v-if="isShow03" class="step-content step-content03">
<!-- 导入中状态 -->
<div v-if="importStatus === 'loading'" class="import-status-indicator">
<i class="el-icon-loading" />
<p>数据导入中,请耐心等待...</p>
</div>
<!-- 导入成功状态 -->
<div v-else-if="importStatus === 'success'" class="import-status-indicator success">
<i class="el-icon-circle-check" />
<p>数据导入成功</p>
<el-button type="primary" @click="handleReturn03">完成</el-button>
</div>
<!-- 导入失败状态 -->
<div v-else-if="importStatus === 'error'" class="import-status-indicator error">
<i class="el-icon-circle-close" />
<p>数据导入失败请重试</p>
<el-button type="primary" @click="retryImport">重试</el-button>
<el-button @click="handleReturn03">取消</el-button>
</div>
</div>
<!-- <div v-if="isShow03" class="step-content step-content03">
<el-form ref="form" :model="form" label-width="160px"> <el-form ref="form" :model="form" label-width="160px">
<el-row> <el-row>
<el-form-item label="案卷及文件数据"> <el-form-item label="案卷及文件数据">
@ -44,7 +71,6 @@
</el-form-item> </el-form-item>
<el-form-item label="遇到重复数据导入方式"> <el-form-item label="遇到重复数据导入方式">
<el-radio-group v-model="form.archivesImportType"> <el-radio-group v-model="form.archivesImportType">
<!-- <el-radio label="1">跳过</el-radio> -->
<el-radio label="2">覆盖</el-radio> <el-radio label="2">覆盖</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -55,7 +81,6 @@
</el-form-item> </el-form-item>
<el-form-item label="遇到重复数据导入方式" pr> <el-form-item label="遇到重复数据导入方式" pr>
<el-radio-group v-model="form.informationInputType"> <el-radio-group v-model="form.informationInputType">
<!-- <el-radio label="1">跳过</el-radio> -->
<el-radio label="2">覆盖</el-radio> <el-radio label="2">覆盖</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -65,7 +90,7 @@
<el-button @click="handleReturn03">取消</el-button> <el-button @click="handleReturn03">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div>
</div> -->
<el-dialog title="确认删除" :visible.sync="deleteVisible"> <el-dialog title="确认删除" :visible.sync="deleteVisible">
<span class="dialog-right-top" /> <span class="dialog-right-top" />
<span class="dialog-left-bottom" /> <span class="dialog-left-bottom" />
@ -82,20 +107,20 @@
<script> <script>
import crudFileImport from '@/api/archivesManage/fileImport' import crudFileImport from '@/api/archivesManage/fileImport'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import detail from '../module/detail.vue'
import ListPre from '../module/listPre.vue'
export default { export default {
name: 'DataImport', name: 'DataImport',
components: { detail },
components: { ListPre },
data() { data() {
return { return {
key: 0, key: 0,
file: null, file: null,
fileList: [], fileList: [],
ajnum: 0,
danum: 0,
djnum: 0,
totalNum: 0,
errorNum: 0,
normalNum: 0,
deleteVisible: false, deleteVisible: false,
zipName: null,
fileName: null,
form: { form: {
importArchive: true, importArchive: true,
importInformation: true, importInformation: true,
@ -106,12 +131,16 @@ export default {
isShow02: false, isShow02: false,
isShow03: false, isShow03: false,
timer: null, timer: null,
isLogOrPreview: 'preview',
loading1: false
loading1: false,
previewTableData: [], //
previewTotal: 0, //
hpId: null,
importStatus: 'loading'
} }
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'user',
'baseApi' 'baseApi'
]) ])
}, },
@ -161,54 +190,53 @@ export default {
message: '当前批量数据导入所需的时间较长,请用户耐心等待,谢谢!', message: '当前批量数据导入所需的时间较长,请用户耐心等待,谢谢!',
customClass: 'centered-notify', customClass: 'centered-notify',
showClose: false, showClose: false,
duration: 0 // 0
duration: 0
}) })
if (this.fileList.length !== 0) {
this.zipName = this.file.name.split('.')[0]
//
crudFileImport.zipUpload(this.baseApi + '/api/unzip/preview', this.file).then(res => {
if (res.data.code === 200) {
if (res.data.data) {
//
crudFileImport.FetchInitImportPreview({ page: 0, size: 10, type: 1 }).then(res => {
this.ajnum = res.ajnum
this.danum = res.danum
this.djnum = res.djnum
this.$refs.importTableList.tableData = res.list.content
this.$refs.importTableList.page.total = res.list.totalElements
this.timer = setTimeout(() => {
this.loading1 = false
notifyInstance.close()
this.isShow01 = false
this.isShow02 = true
clearTimeout(this.timer)
}, 1000)
}).catch(() => {
this.loading1 = false
notifyInstance.close()
this.isShow01 = false
this.isShow02 = true
})
} else {
this.loading1 = false
notifyInstance.close()
this.isShow01 = false
this.isShow02 = true
}
} else {
this.loading1 = false
notifyInstance.close()
}
}).catch(() => {
this.loading1 = false
notifyInstance.close()
})
} else {
if (this.fileList.length === 0) {
this.$message.warning('请上传相关文件 !') this.$message.warning('请上传相关文件 !')
this.loading1 = false this.loading1 = false
notifyInstance.close() notifyInstance.close()
return return
} }
this.fileName = this.file.name.split('.')[0]
crudFileImport.zipUpload(this.baseApi + '/api/unzip/importArchives', this.file, this.user.username)
.then(res => {
if (res.data.code === 200 && res.data.data) {
this.hpId = res.data.data
return crudFileImport.FetchHpArchivesDetailsByHpId({
page: 0,
size: 10,
hpId: this.hpId,
isError: true
})
} else {
throw new Error('文件上传或解析失败')
}
})
.then(res => {
console.log('预览数据 res2:', res.data.content)
this.totalNum = res.total
this.errorNum = res.error
this.normalNum = res.normal
this.previewTableData = res.data.content
this.previewTotal = res.data.totalElements
this.isShow01 = false
this.isShow02 = true
})
.catch(() => {
this.$message.error('数据加载失败,请重试。')
this.isShow01 = false
this.isShow02 = true
})
.finally(() => {
this.loading1 = false
notifyInstance.close()
})
}, },
// //
handleReturn02() { handleReturn02() {
@ -223,15 +251,54 @@ export default {
this.isShow02 = false this.isShow02 = false
this.isShow03 = true this.isShow03 = true
}, },
//
//
submitImport() {
this.isShow01 = false
this.isShow02 = false
this.isShow03 = true
this.importStatus = 'loading'
const modifiedRows = this.$refs.importTableList.getModifiedRows()
const params = {
'hpId': this.hpId,
'hpTempList': modifiedRows
}
console.log('params:', params)
crudFileImport.FetchImportHp(params).then(res => {
this.$message({
type: 'success',
message: '导入成功!'
})
console.log('导入成功, 结果:', res)
// this.importStatus = 'success' //
}).catch(() => {
// console.error('')
// this.importStatus = 'error' //
this.timer = setTimeout(() => {
this.$emit('step-end', '1')
clearTimeout(this.timer)
}, 1000)
})
this.timer = setTimeout(() => {
this.$emit('step-end', '1')
clearTimeout(this.timer)
}, 1000)
},
retryImport() {
this.submitImport()
},
handleReturn03() { handleReturn03() {
this.isShow01 = true this.isShow01 = true
this.isShow02 = false this.isShow02 = false
this.isShow03 = false this.isShow03 = false
this.fileList = [] this.fileList = []
this.file = null this.file = null
this.importStatus = 'loading'
if (this.timer) {
clearTimeout(this.timer)
this.timer = null
}
}, },
//
submitForm(formName) { submitForm(formName) {
// this.loading1 = true // this.loading1 = true
// const notifyInstance = this.$notify.info({ // const notifyInstance = this.$notify.info({
@ -248,8 +315,9 @@ export default {
'importArchive': this.form.importArchive, 'importArchive': this.form.importArchive,
'importInformation': this.form.importInformation, 'importInformation': this.form.importInformation,
'informationInputType': this.form.informationInputType, 'informationInputType': this.form.informationInputType,
'name': this.zipName
'name': this.fileName
} }
console.log('params:', params)
crudFileImport.FetchImportZip(params).then(res => { crudFileImport.FetchImportZip(params).then(res => {
console.log('resZip', res) console.log('resZip', res)
this.$message({ this.$message({
@ -352,8 +420,40 @@ export default {
.step-content{ .step-content{
position: relative; position: relative;
} }
.step-content03{
margin-top: 50px;
.step-content03 {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center; //
min-height: 200px; //
color: #fff;
.import-status-indicator {
display: flex;
flex-direction: column;
align-items: center;
gap: 15px; //
i {
font-size: 48px;
}
p {
font-size: 16px;
}
.el-button {
margin-top: 10px;
}
&.success i {
color: #19be6b; //
}
&.error i {
color: #fa5555; //
}
}
} }
.step-upload{ .step-upload{
width: 40%; width: 40%;

60
src/views/archivesManage/fileImport/importLog/index.vue

@ -2,7 +2,8 @@
<div> <div>
<div class="head-container" style="display: flex; justify-content: flex-start;"> <div class="head-container" style="display: flex; justify-content: flex-start;">
<div class="head-search" style="margin-bottom: 0;"> <div class="head-search" style="margin-bottom: 0;">
<date-range-picker v-model="query.startTime" class="date-item" />
<!-- <date-range-picker v-model="query.startTime" class="date-item" /> -->
<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" />
<rrOperation /> <rrOperation />
</div> </div>
<crudOperation /> <crudOperation />
@ -10,18 +11,22 @@
<!--表格渲染--> <!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @row-click="clickRowHandler" @selection-change="selectionChangeHandler" @row-dblclick="handleDbClick"> <el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @row-click="clickRowHandler" @selection-change="selectionChangeHandler" @row-dblclick="handleDbClick">
<el-table-column type="selection" align="center" width="55" /> <el-table-column type="selection" align="center" width="55" />
<el-table-column prop="name" label="导入数据包" />
<el-table-column prop="name" label="导入数据包" width="300px" />
<el-table-column prop="status" label="导入状态"> <el-table-column prop="status" label="导入状态">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.status === 0" class="import-loading">导入中</div> <div v-if="scope.row.status === 0" class="import-loading">导入中</div>
<div v-if="scope.row.status === 1">已完成</div> <div v-if="scope.row.status === 1">已完成</div>
<div v-if="scope.row.status === 2" class="import-error">导入失败</div>
<!-- <div v-if="scope.row.status === 2" class="import-error">导入失败</div> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_by" label="操作人" />
<el-table-column prop="create_time" label="操作日期">
<el-table-column prop="archivesNum" label="读取数量" />
<el-table-column prop="normalNum" label="成功数量" />
<el-table-column prop="skipNum" label="跳过数量" />
<el-table-column prop="coverNum" label="覆盖数量" />
<el-table-column prop="errorNum" label="失败数量" />
<el-table-column prop="createTime" label="操作日期">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
<div>{{ scope.row.createTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -32,7 +37,13 @@
<span class="dialog-right-top" /> <span class="dialog-right-top" />
<span class="dialog-left-bottom" /> <span class="dialog-left-bottom" />
<div class="setting-dialog"> <div class="setting-dialog">
<detail ref="importTableList" :is-log-or-preview="isLogOrPreview" :zip-select="zipSelect" />
<ListPre
ref="importTableList"
:is-log-or-preview="isLogOrPreview"
:hp-id="hpId"
:initial-table-data="previewTableData"
:initial-total="previewTotal"
/>
</div> </div>
</el-dialog> </el-dialog>
@ -45,13 +56,13 @@ import CRUD, { presenter, header, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation' import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import detail from '../module/detail.vue'
// import DateRangePicker from '@/components/DateRangePicker'
import ListPre from '../module/listPre.vue'
export default { export default {
name: 'ImportLog', name: 'ImportLog',
components: { detail, rrOperation, DateRangePicker, crudOperation, pagination },
components: { ListPre, rrOperation, crudOperation, pagination },
cruds() { cruds() {
return CRUD({ title: '导入日志', url: 'api/unzip/initImportLog', crudMethod: { ...crudFileImport }, optShow: {
return CRUD({ title: '导入日志', url: 'api/unzip/getImportHpLog', crudMethod: { ...crudFileImport }, optShow: {
add: false, add: false,
edit: false, edit: false,
del: false, del: false,
@ -59,15 +70,17 @@ export default {
download: false, download: false,
group: false group: false
}, },
sort: ['create_time,desc']
sort: []
}) })
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
data() { data() {
return { return {
detailVisible: false, detailVisible: false,
isLogOrPreview: 'log',
zipSelect: null
previewTableData: [], //
previewTotal: 0, //
hpId: null,
isLogOrPreview: ''
} }
}, },
created() { created() {
@ -81,16 +94,27 @@ export default {
}, },
// //
handleDbClick(row) { handleDbClick(row) {
this.zipSelect = { ...row }
this.hpId = row.id
this.isLogOrPreview = 'log'
if (row.status === 0) { if (row.status === 0) {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '当前批量数据导入中,请用户耐心等待,谢谢!' message: '当前批量数据导入中,请用户耐心等待,谢谢!'
}) })
} else { } else {
crudFileImport.FetchInitImportLogDetail({ page: 0, size: 10, zipid: row.id, type: 1 }).then(res => {
this.$refs.importTableList.tableData = res.content
this.$refs.importTableList.page.total = res.totalElements
crudFileImport.FetchHpArchivesDetailsByHpId({
page: 0,
size: 10,
hpId: this.hpId,
isError: false
}).then(res => {
this.$refs.importTableList.readData = row.archivesNum
this.$refs.importTableList.importData = row.normalNum
this.$refs.importTableList.skipData = row.skipNum
this.$refs.importTableList.coverData = row.coverNum
this.$refs.importTableList.errorData = row.errorNum
this.previewTableData = res.data.content
this.previewTotal = res.data.totalElements
}) })
this.detailVisible = true this.detailVisible = true
} }

1
src/views/archivesManage/fileImport/index.vue

@ -12,7 +12,6 @@
</ul> </ul>
<dataImport v-if="activeIndex == 0" @step-end="changeActiveTab" /> <dataImport v-if="activeIndex == 0" @step-end="changeActiveTab" />
<importLog v-if="activeIndex == 1" /> <importLog v-if="activeIndex == 1" />
</div> </div>
</div> </div>
</template> </template>

139
src/views/archivesManage/fileImport/module/EditableCell.vue

@ -0,0 +1,139 @@
<template>
<div class="editable-cell-wrapper">
<!-- 显示模式 -->
<span
v-if="!isEditing"
class="cell-text"
@dblclick="startEditing"
>
{{ value }}
</span>
<!-- 编辑模式 -->
<el-input
v-else
ref="editInput"
:value="value"
size="mini"
class="cell-input"
@input="handleInput"
@blur="finishEditing"
@keyup.enter.native="finishEditing"
/>
</div>
</template>
<script>
export default {
name: 'EditableCell',
props: {
//
value: {
type: [String, Number, Boolean, null],
default: null
},
//
cellKey: {
type: String,
required: true
}
},
data() {
return {
//
isEditing: false,
// cellKey
editingCellKey: ''
}
},
beforeDestroy() {
//
this.$root.$off('editable-cell:cancel-edit', this.handleCancelEdit)
},
methods: {
/**
* 开始编辑
*/
startEditing() {
//
if (this.editingCellKey && this.editingCellKey !== this.cellKey) {
this.$root.$emit('editable-cell:cancel-edit', this.editingCellKey)
}
this.isEditing = true
this.editingCellKey = this.cellKey
//
this.$root.$on('editable-cell:cancel-edit', this.handleCancelEdit)
//
this.$nextTick(() => {
this.$refs.editInput.focus()
})
},
/**
* 处理输入
* @param {string} newValue - 输入框的新值
*/
handleInput(newValue) {
// 使 .trim()
// nullundefined''
const trimmedValue = newValue.trim() || null
// 'input'
this.$emit('input', trimmedValue)
},
/**
* 结束编辑失去焦点或按回车
*/
finishEditing() {
this.isEditing = false
this.editingCellKey = ''
//
this.$root.$off('editable-cell:cancel-edit', this.handleCancelEdit)
//
this.$emit('change')
},
/**
* 处理来自其他单元格的取消编辑请求
* @param {string} key - 请求取消编辑的单元格的 cellKey
*/
handleCancelEdit(key) {
if (key === this.cellKey) {
this.isEditing = false
this.editingCellKey = ''
this.$root.$off('editable-cell:cancel-edit', this.handleCancelEdit)
}
}
}
}
</script>
<style scoped>
.editable-cell-wrapper {
width: 100%;
height: 100%;
}
.cell-text {
display: block;
width: 100%;
height: 100%;
padding: 0 5px; /* 增加内边距,方便点击 */
cursor: pointer;
word-break: break-all;
}
.cell-text:hover {
background-color: rgba(51, 156, 255, 0.1);
}
.cell-input {
padding: 0;
margin: 0;
}
/* 让 el-input 完全填充单元格 */
::v-deep .cell-input .el-input__inner {
padding: 0 5px;
height: 28px; /* 与表格行高对齐 */
line-height: 28px;
}
</style>

122
src/views/archivesManage/fileImport/module/detail.vue

@ -6,9 +6,9 @@
<p>成功导入数据<span style="color: #1AAE93;">{{ importData === null ? 0 : importData }}</span> </p> <p>成功导入数据<span style="color: #1AAE93;">{{ importData === null ? 0 : importData }}</span> </p>
</div> </div>
<ul class="import-tab"> <ul class="import-tab">
<li :class="{'active': archivesTabIndex == 0}" @click="changeActiveTab(0)">案卷</li>
<li :class="{'active': archivesTabIndex == 1}" @click="changeActiveTab(1)">文件</li>
<li :class="{'active': archivesTabIndex == 2}" @click="changeActiveTab(2)">资料</li>
<!-- <li :class="{'active': archivesTabIndex == 0}" @click="changeActiveTab(0)">案卷</li> -->
<li class="active">文件</li>
<!-- <li :class="{'active': archivesTabIndex == 2}" @click="changeActiveTab(2)">资料</li> -->
</ul> </ul>
<el-table <el-table
ref="table" ref="table"
@ -27,33 +27,33 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- 资料 --> <!-- 资料 -->
<el-table-column v-if=" archivesTabIndex == 2" prop="serialNo" label="序号" align="center" width="60px" />
<el-table-column v-if=" archivesTabIndex == 2" prop="arriveDate" label="收发日期" align="center" show-overflow-tooltip min-width="160px" />
<el-table-column v-if=" archivesTabIndex == 2" prop="arriveClass" label="收发类别" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if=" archivesTabIndex == 2" prop="arriveNo" label="类别编号" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if=" archivesTabIndex == 2" prop="arriveMark" label="收发标识" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if=" archivesTabIndex == 2" prop="sourcePartNo" label="源份号" align="center" show-overflow-tooltip min-width="80px" />
<el-table-column v-if=" archivesTabIndex == 2" prop="docNo" label="发文字号" align="center" show-overflow-tooltip min-width="160px" />
<el-table-column prop="serialNo" label="序号" align="center" width="60px" />
<el-table-column prop="maintitle" label="姓名" align="center" show-overflow-tooltip />
<el-table-column prop="id_type" label="身份类别" align="center" show-overflow-tooltip />
<el-table-column prop="id_number" label="公民身份证号" align="center" show-overflow-tooltip />
<el-table-column prop="native_place" label="籍贯" align="center" show-overflow-tooltip />
<el-table-column prop="archive_no" label="证件号" align="center" show-overflow-tooltip />
<!-- <el-table-column v-if=" archivesTabIndex == 2" prop="docNo" label="发文字号" align="center" show-overflow-tooltip min-width="160px" /> -->
<!-- 案卷 / 文件 / 资料 --> <!-- 案卷 / 文件 / 资料 -->
<el-table-column prop="securityClass" label="密级" align="center" show-overflow-tooltip min-width="80px" />
<!-- <el-table-column prop="securityClass" label="密级" align="center" show-overflow-tooltip min-width="80px" /> -->
<!-- 案卷 / 文件 --> <!-- 案卷 / 文件 -->
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="mediumType" label="载体类型" align="center" show-overflow-tooltip min-width="100px" />
<!-- <el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="mediumType" label="载体类型" align="center" show-overflow-tooltip min-width="100px" /> -->
<!-- 资料 --> <!-- 资料 -->
<el-table-column v-if="archivesTabIndex == 2" prop="recordType" label="公文种类" align="center" show-overflow-tooltip min-width="100px" />
<!-- <el-table-column v-if="archivesTabIndex == 2" prop="recordType" label="公文种类" align="center" show-overflow-tooltip min-width="100px" /> -->
<!-- 文件 --> <!-- 文件 -->
<el-table-column v-if=" archivesTabIndex == 1" prop="recordType" label="文种" align="center" show-overflow-tooltip min-width="80px" />
<el-table-column v-if=" archivesTabIndex == 1" prop="documentNo" label="文件编号" align="center" show-overflow-tooltip min-width="100px" />
<!-- <el-table-column v-if=" archivesTabIndex == 1" prop="recordType" label="文种" align="center" show-overflow-tooltip min-width="80px" />
<el-table-column v-if=" archivesTabIndex == 1" prop="documentNo" label="文件编号" align="center" show-overflow-tooltip min-width="100px" /> -->
<!-- 案卷 / 文件 --> <!-- 案卷 / 文件 -->
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="microfilm" label="缩微号" align="center" show-overflow-tooltip min-width="80px" />
<!-- <el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="microfilm" label="缩微号" align="center" show-overflow-tooltip min-width="80px" /> -->
<!-- 文件 --> <!-- 文件 -->
<el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="fileNo" label="电子文件号" align="center" show-overflow-tooltip min-width="120px" />
<!-- <el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="fileNo" label="电子文件号" align="center" show-overflow-tooltip min-width="120px" /> -->
<!-- 案卷 / 文件 --> <!-- 案卷 / 文件 -->
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="archiveNo" label="档号" align="center" show-overflow-tooltip min-width="240px" />
<!-- <el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="archiveNo" label="档号" align="center" show-overflow-tooltip min-width="240px" /> -->
<!-- 文件 --> <!-- 文件 -->
<el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="maintitle" label="题名" align="center" show-overflow-tooltip min-width="240px" />
<!-- <el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="maintitle" label="题名" align="center" show-overflow-tooltip min-width="240px" /> -->
<!-- 资料 --> <!-- 资料 -->
<el-table-column v-if="archivesTabIndex == 2" prop="createdDate" label="成文日期" align="center" show-overflow-tooltip min-width="140px" />
<!-- <el-table-column v-if="archivesTabIndex == 2" prop="createdDate" label="成文日期" align="center" show-overflow-tooltip min-width="140px" />
<el-table-column v-if="archivesTabIndex == 2" prop="organizer" label="承办单位" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 2" prop="organizer" label="承办单位" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 2" prop="undertaker" label="承办人" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 2" prop="undertaker" label="承办人" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 2" prop="endorsementLeader" label="签批领导" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 2" prop="endorsementLeader" label="签批领导" align="center" show-overflow-tooltip min-width="100px" />
@ -67,30 +67,30 @@
<el-table-column v-if="archivesTabIndex == 1" prop="created_date" label="时间" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 1" prop="created_date" label="时间" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="mediumQty" label="载体数量" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="mediumQty" label="载体数量" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="mediumUnit" label="载体单位" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="mediumUnit" label="载体单位" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="mediumSpecs" label="载体规格" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 1 || archivesTabIndex == 2" prop="mediumSpecs" label="载体规格" align="center" show-overflow-tooltip min-width="100px" /> -->
<!-- 案卷 --> <!-- 案卷 -->
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 2" prop="pieceQty" label="文件件数" align="center" show-overflow-tooltip min-width="100px" />
<!-- <el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 2" prop="pieceQty" label="文件件数" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 2" prop="tempNo" label="临时卷号" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 2" prop="tempNo" label="临时卷号" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 0" prop="maintitle" label="案卷题名" align="center" show-overflow-tooltip min-width="240px" /> <el-table-column v-if="archivesTabIndex == 0" prop="maintitle" label="案卷题名" align="center" show-overflow-tooltip min-width="240px" />
<el-table-column v-if="archivesTabIndex == 0" prop="beginDate" label="起始时间" align="center" show-overflow-tooltip min-width="140px" /> <el-table-column v-if="archivesTabIndex == 0" prop="beginDate" label="起始时间" align="center" show-overflow-tooltip min-width="140px" />
<el-table-column v-if="archivesTabIndex == 0" prop="endDate" label="终止时间" align="center" show-overflow-tooltip min-width="140px" />
<el-table-column v-if="archivesTabIndex == 0" prop="endDate" label="终止时间" align="center" show-overflow-tooltip min-width="140px" /> -->
<!-- 案卷 / 文件 --> <!-- 案卷 / 文件 -->
<el-table-column prop="archiveCtgNo" label="分类号" align="center" show-overflow-tooltip min-width="140px" />
<!-- <el-table-column prop="archiveCtgNo" label="分类号" align="center" show-overflow-tooltip min-width="140px" />
<el-table-column prop="keyword" label="主题词" align="center" show-overflow-tooltip min-width="140px" /> <el-table-column prop="keyword" label="主题词" align="center" show-overflow-tooltip min-width="140px" />
<el-table-column prop="remarks" label="附注" align="center" show-overflow-tooltip min-width="120px" />
<el-table-column prop="remarks" label="附注" align="center" show-overflow-tooltip min-width="120px" /> -->
<!-- 资料 --> <!-- 资料 -->
<el-table-column v-if=" archivesTabIndex ==2" prop="dividedQty" label="已分份数" align="center" show-overflow-tooltip min-width="120px" />
<!-- <el-table-column v-if=" archivesTabIndex ==2" prop="dividedQty" label="已分份数" align="center" show-overflow-tooltip min-width="120px" />
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="retention" label="保管期限" align="center" show-overflow-tooltip min-width="120px" /> <el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="retention" label="保管期限" align="center" show-overflow-tooltip min-width="120px" />
<el-table-column prop="archiveYear" label="年度" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column prop="archiveYear" label="年度" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="fondsNo" label="全宗" align="center" show-overflow-tooltip min-width="100px" /> <el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="fondsNo" label="全宗" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="recordNo" label="卷号" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if="archivesTabIndex == 0 || archivesTabIndex == 1" prop="recordNo" label="卷号" align="center" show-overflow-tooltip min-width="100px" /> -->
<!-- 文件 --> <!-- 文件 -->
<el-table-column v-if=" archivesTabIndex ==1" prop="pieceNo" label="件号" align="center" show-overflow-tooltip min-width="100px" />
<!-- <el-table-column v-if=" archivesTabIndex ==1" prop="pieceNo" label="件号" align="center" show-overflow-tooltip min-width="100px" /> -->
<!-- 资料 --> <!-- 资料 -->
<el-table-column v-if=" archivesTabIndex ==2" prop="fileQty" label="归档份数" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if=" archivesTabIndex ==2" prop="classSerialNo" label="类别序号" align="center" show-overflow-tooltip min-width="100px" />
<!-- <el-table-column v-if=" archivesTabIndex ==2" prop="fileQty" label="归档份数" align="center" show-overflow-tooltip min-width="100px" />
<el-table-column v-if=" archivesTabIndex ==2" prop="classSerialNo" label="类别序号" align="center" show-overflow-tooltip min-width="100px" /> -->
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<el-pagination <el-pagination
@ -116,7 +116,7 @@ export default {
type: String, type: String,
default: 'preview' default: 'preview'
}, },
zipSelect: {
fileSelect: {
type: Object, type: Object,
default: function() { default: function() {
return {} return {}
@ -153,7 +153,7 @@ export default {
} }
}, },
watch: { watch: {
zipSelect: {
fileSelect: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log('newValue', newVal) console.log('newValue', newVal)
console.log('oldVal', oldVal) console.log('oldVal', oldVal)
@ -170,18 +170,23 @@ export default {
this.getTotalInfo() this.getTotalInfo()
this.$nextTick(() => { this.$nextTick(() => {
if (this.isLogOrPreview === 'preview') { if (this.isLogOrPreview === 'preview') {
if (this.ajnum && this.ajnum !== 0) {
this.changeActiveTab(0)
} else if (this.djnum && this.djnum !== 0) {
this.changeActiveTab(2)
}
// if (this.ajnum && this.ajnum !== 0) {
// this.changeActiveTab(0)
// } else if (this.djnum && this.djnum !== 0) {
// this.changeActiveTab(2)
// }
} else { } else {
if (this.zipSelect && this.zipSelect.ajNum !== 0) {
this.changeActiveTab(0)
} else if (this.zipSelect && this.zipSelect.djNum !== 0) {
this.changeActiveTab(2)
}
// if (this.fileSelect && this.fileSelect.ajNum !== 0) {
// this.changeActiveTab(0)
// } else if (this.fileSelect && this.fileSelect.djNum !== 0) {
// this.changeActiveTab(2)
// }
} }
this.page.page = 1
// this.archivesTabIndex = index
this.getList()
this.getTotalInfo()
}) })
}, },
methods: { methods: {
@ -192,24 +197,27 @@ export default {
this.getTotalInfo() this.getTotalInfo()
}, },
getTotalInfo() { getTotalInfo() {
if (this.archivesTabIndex === 0) {
this.importType = this.zipSelect.archivesImportType === 1 ? '跳过' : '覆盖'
this.readData = this.zipSelect.ajNum
this.importData = this.zipSelect.ajOkNnum
} else if (this.archivesTabIndex === 1) {
this.importType = this.zipSelect.archivesImportType === 1 ? '跳过' : '覆盖'
this.readData = this.zipSelect.daNum
this.importData = this.zipSelect.daOkNum
} else if (this.archivesTabIndex === 2) {
this.importType = this.zipSelect.informationInputType === 1 ? '跳过' : '覆盖'
this.readData = this.zipSelect.djNum
this.importData = this.zipSelect.djOkNum
}
this.importType = this.fileSelect.archivesImportType === 1 ? '跳过' : '覆盖'
this.readData = this.fileSelect.ajNum
this.importData = this.fileSelect.ajOkNnum
// if (this.archivesTabIndex === 0) {
// this.importType = this.fileSelect.archivesImportType === 1 ? '' : ''
// this.readData = this.fileSelect.ajNum
// this.importData = this.fileSelect.ajOkNnum
// } else if (this.archivesTabIndex === 1) {
// this.importType = this.fileSelect.archivesImportType === 1 ? '' : ''
// this.readData = this.fileSelect.daNum
// this.importData = this.fileSelect.daOkNum
// } else if (this.archivesTabIndex === 2) {
// this.importType = this.fileSelect.informationInputType === 1 ? '' : ''
// this.readData = this.fileSelect.djNum
// this.importData = this.fileSelect.djOkNum
// }
}, },
getList() { getList() {
if (this.isLogOrPreview === 'preview') { if (this.isLogOrPreview === 'preview') {
// //
crudFileImport.FetchInitImportPreview({ page: this.page.page - 1, size: this.page.size, type: this.archivesTabIndex + 1 }).then(res => {
crudFileImport.FetchInitImportPreview({ page: this.page.page - 1, size: this.page.size, type: 1 }).then(res => {
// this.ajnum = res.ajnum // this.ajnum = res.ajnum
// this.danum = res.danum // this.danum = res.danum
// this.djnum = res.djnum // this.djnum = res.djnum
@ -221,7 +229,7 @@ export default {
if (page === -1) { if (page === -1) {
page = 0 page = 0
} }
crudFileImport.FetchInitImportLogDetail({ page: page, size: this.page.size, zipid: this.zipSelect.id, type: this.archivesTabIndex + 1 }).then(res => {
crudFileImport.FetchInitImportLogDetail({ page: page, size: this.page.size, zipid: this.fileSelect.id, type: 1 }).then(res => {
this.tableData = res.content this.tableData = res.content
this.page.total = res.totalElements this.page.total = res.totalElements
}) })

202
src/views/archivesManage/fileImport/module/listPre-edit.vue

@ -0,0 +1,202 @@
<template>
<div class="import-detail-container">
<ul class="import-tab">
<li class="active">文件</li>
</ul>
<el-table
ref="table"
:data="tableData"
style="width: 100%"
height="calc(100vh - 500px)"
row-key="id"
@row-click="clickRowHandler"
@selection-change="selectionChangeHandler"
>
<el-table-column prop="status" label="状态" align="center" width="80px">
<template slot-scope="scope">
<el-tag v-if="scope.row.status===1" type="success">导入</el-tag>
<el-tag v-if="scope.row.status===2" type="warning">覆盖</el-tag>
<el-tag v-if="scope.row.status===3">跳过</el-tag>
<el-tag v-if="scope.row.status===4" type="danger">失败</el-tag>
</template>
</el-table-column>
<el-table-column label="序号" width="60" align="center" type="index" />
<el-table-column prop="maintitle" label="姓名" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<editable-cell
:value="scope.row.maintitle"
:cell-key="`${scope.row.id}-maintitle`"
@input="(val) => { scope.row.maintitle = val }"
/>
</template>
</el-table-column>
<el-table-column prop="idType" label="身份类别" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<editable-cell
:value="scope.row.idType"
:cell-key="`${scope.row.id}-idType`"
@input="(val) => { scope.row.idType = val }"
/>
</template>
</el-table-column>
<el-table-column prop="idNumber" label="公民身份证号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<editable-cell
:value="scope.row.idNumber"
:cell-key="`${scope.row.id}-idNumber`"
@input="(val) => { scope.row.idNumber = val }"
/>
</template>
</el-table-column>
<el-table-column prop="nativePlace" label="籍贯" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<editable-cell
:value="scope.row.nativePlace"
:cell-key="`${scope.row.id}-nativePlace`"
@input="(val) => { scope.row.nativePlace = val }"
/>
</template>
</el-table-column>
<el-table-column prop="archiveNo" label="证件号" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<editable-cell
:value="scope.row.archiveNo"
:cell-key="`${scope.row.id}-archiveNo`"
@input="(val) => { scope.row.archiveNo = val }"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page.page"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="handleSizeChange"
@current-change="handleCurrentPage"
/>
</div>
</template>
<script>
import crudFileImport from '@/api/archivesManage/fileImport'
import EditableCell from './EditableCell.vue'
export default {
name: 'ListPre',
components: { EditableCell },
props: {
djnum: { type: Number, default: 0 },
hpId: { type: String, default: '' },
initialTableData: { type: Array, default: () => [] },
initialTotal: { type: Number, default: 0 }
},
data() {
return {
tableData: [],
page: {
page: 1,
size: 10,
total: 0
}
}
},
watch: {
initialTableData(newVal) {
if (newVal) {
this.tableData = newVal
}
},
initialTotal(newVal) {
if (newVal !== undefined) {
this.page.total = newVal
}
}
},
created() {
this.tableData = this.initialTableData
this.page.total = this.initialTotal
},
methods: {
getList() {
crudFileImport.FetchHpArchivesDetailsByHpId({
page: this.page.page - 1,
size: this.page.size,
hpId: this.hpId,
isError: false
}).then(res => {
this.tableData = res.content
this.page.total = res.totalElements
})
this.doLayout()
},
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row)
},
selectionChangeHandler(val) {
this.selections = val
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
this.getList()
},
handleCurrentPage(val) {
this.page.page = val
this.getList()
},
doLayout() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
}
}
}
</script>
<style lang='scss' scoped>
/* 你的样式代码保持不变 */
.import-detail-container {
position: relative;
}
.import-tab {
display: flex;
justify-content: flex-start;
margin-bottom: 10px;
li {
padding: 10px 20px 14px 20px;
font-size: 16px;
color: #339CFF;
cursor: pointer;
&.active {
position: relative;
color: #fff;
&::after {
content: "";
position: absolute;
left: 0;
bottom: -1px;
width: 100%;
height: 3px;
border-radius: 3px;
background-color: #fff;
}
}
}
}
.el-tag.el-tag--success {
color: #1aae93;
border-color: #1aae93;
background-color: transparent !important;
}
/* 让单元格内容垂直居中 */
::v-deep .el-table .cell {
display: flex;
align-items: center;
justify-content: center; /* 针对 align="center" 的列 */
height: 100%;
}
</style>

282
src/views/archivesManage/fileImport/module/listPre.vue

@ -0,0 +1,282 @@
<template>
<div class="import-detail-container">
<div v-if="isLogOrPreview === 'log'" class="import-data-number">
<p>成功读取数据<span style="color:#339cff">{{ readData === null ? 0 : readData }}</span> </p>
<p>成功导入数据<span style="color: #1AAE93;">{{ importData === null ? 0 : importData }}</span> </p>
<p>跳过数据<span style="color: rgb(246,81,99);">{{ skipData === null ? 0 : skipData }}</span> </p>
<p>覆盖数据<span style="color: rgb(246,81,99);">{{ coverData === null ? 0 : coverData }}</span> </p>
<p>导入失败数据<span style="color: rgb(246,81,99);">{{ errorData === null ? 0 : errorData }}</span> </p>
</div>
<div class="import-tab">
<p class="active">文件</p>
<el-checkbox v-if="isLogOrPreview !== 'log'" v-model="isData" style="margin-left: 20px; color: #fff;" @change="changeDataChecked">仅显示问题数据</el-checkbox>
</div>
<el-table
ref="table"
:data="tableData"
style="width: 100%"
height="calc(100vh - 500px)"
@row-click="clickRowHandler"
@selection-change="selectionChangeHandler"
>
<el-table-column v-if="isLogOrPreview !== 'log'" prop="status" label="状态" align="center" width="120px">
<template slot-scope="scope">
<!-- 状态为1的行显示为"导入" -->
<el-tag v-if="scope.row.status === 1" type="success">导入</el-tag>
<!-- 状态为3且有空值的行显示为"跳过" -->
<el-tag v-else-if="scope.row.status === 3 && hasEmptyValues(scope.row)">跳过</el-tag>
<!-- 其他情况包括用户修改后的状态显示下拉框 -->
<el-select
v-else
v-model="scope.row.status"
class="set-select"
placeholder="请选择"
size="mini"
style="width: 100px; background-color: transparent;"
@change="handleStatusChange(scope.row)"
>
<el-option label="覆盖" :value="2" />
<el-option label="跳过" :value="3" />
</el-select>
</template>
</el-table-column>
<el-table-column v-else prop="status" label="状态" align="center" width="80px">
<template slot-scope="scope">
<el-tag v-if="scope.row.status===1" type="success">导入</el-tag>
<el-tag v-if="scope.row.status===2" type="warning">覆盖</el-tag>
<el-tag v-if="scope.row.status===3">跳过</el-tag>
<el-tag v-if="scope.row.status===4" type="danger">失败</el-tag>
</template>
</el-table-column>
<el-table-column label="序号" width="55" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ (page.page - 1) * page.size + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column prop="maintitle" label="姓名" align="center" width="100" show-overflow-tooltip />
<el-table-column prop="idType" label="身份类别" align="center" width="100" show-overflow-tooltip />
<el-table-column prop="idNumber" label="公民身份证号" align="center" show-overflow-tooltip />
<el-table-column prop="nativePlace" label="籍贯" align="center" show-overflow-tooltip />
<el-table-column prop="archiveNo" label="证件号" align="center" show-overflow-tooltip />
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page.page"
:total="page.total"
:page-size="page.size"
:pager-count="5"
layout="total, prev, pager, next, sizes"
@size-change="handleSizeChange"
@current-change="handleCurrentPage"
/>
</div>
</template>
<script>
import crudFileImport from '@/api/archivesManage/fileImport'
export default {
name: 'ListPre', //
components: {},
props: {
isLogOrPreview: {
type: String,
default: ''
},
hpId: {
type: String,
default: ''
},
initialTableData: {
type: Array,
default: () => []
},
initialTotal: {
type: Number,
default: 0
}
},
data() {
return {
tableData: [],
page: {
page: 1,
size: 10,
total: 0
},
selections: [],
isData: true,
//
// : { 'rowId1': { ...modifiedRowData1 }, 'rowId2': { ...modifiedRowData2 } }
modifiedRowsCache: {},
readData: null,
importData: null,
skipData: null,
coverData: null,
errorData: null
}
},
watch: {
initialTableData(newVal) {
if (newVal && newVal.length > 0) {
this.tableData = this.applyModificationsToData(newVal)
}
},
initialTotal(newVal) {
if (newVal !== undefined && newVal !== null) {
this.page.total = newVal
}
}
},
created() {
if (this.initialTableData && this.initialTableData.length > 0) {
this.tableData = this.applyModificationsToData(this.initialTableData)
this.page.total = this.initialTotal
} else {
this.getList()
}
},
methods: {
//
applyModificationsToData(data) {
return data.map(row => {
// idkey
const cachedRow = this.modifiedRowsCache[row.id]
//
return cachedRow ? { ...row, ...cachedRow } : row
})
},
changeDataChecked(val) {
this.page.page = 1
this.getList()
},
getList() {
const pageParam = this.page.page - 1
crudFileImport.FetchHpArchivesDetailsByHpId({
page: pageParam,
size: this.page.size,
hpId: this.hpId,
isError: this.isLogOrPreview === 'log' ? false : this.isData
}).then(res => {
this.tableData = this.applyModificationsToData(res.data.content || [])
this.page.total = res.data.totalElements || 0
this.doLayout()
})
},
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row)
},
selectionChangeHandler(val) {
this.selections = val
},
handleSizeChange(size) {
this.page.size = size
this.page.page = 1
this.getList()
},
handleCurrentPage(val) {
this.page.page = val
this.getList()
},
doLayout() {
this.$nextTick(() => {
if (this.$refs.table) {
this.$refs.table.doLayout()
}
})
},
hasEmptyValues(row) {
const fieldsToCheck = ['maintitle', 'idType', 'idNumber', 'nativePlace', 'archiveNo']
return fieldsToCheck.some(field => {
const value = row[field]
return value === null || value === undefined || (typeof value === 'string' && value.trim() === '')
})
},
//
handleStatusChange(row) {
if (!row.id) {
console.error('行数据缺少唯一的id字段,无法缓存修改!', row)
return
}
this.modifiedRowsCache[row.id] = { ...row }
this.$message.success(`证件号为 ${row.archiveNo} 姓名为 ${row.maintitle} 的状态已更新为: ${row.status === 2 ? '覆盖' : '跳过'}`)
},
/**
* 返回一个包含所有修改行数据的数组
*/
getModifiedRows() {
return Object.values(this.modifiedRowsCache)
}
}
}
</script>
<style lang='scss' scoped>
.import-detail-container{
position: relative;
.import-data-number{
position: absolute;
right: 10px;
top: 20px;
font-size: 12px;
color: #fff;
display: flex;
justify-content: flex-start;
& p{
margin-right: 10px;
}
& span{
font-weight: bold;
}
}
}
.import-tab{
display: flex;
justify-content: flex-start;
align-items: center;
margin-bottom: 10px;
p{
padding: 10px 20px 14px 20px;
font-size: 16px;
color: #339CFF;
cursor: pointer;
&.active{
position: relative;
color: #fff;
&::after{
content: "";
position: absolute;
left: 0;
bottom: -1px;
width: 100%;
height: 3px;
border-radius: 3px;
background-color: #fff;
}
}
}
}
.el-tag.el-tag--success {
color: #1aae93;
border-color: #1aae93;
background-color: transparent !important;
}
.set-select{
::v-deep .el-input .el-input__inner{
border: 1px solid #339cff;
background-color: #021941;
height: 30px;
line-height: 30px;
color: #fff;
}
}
</style>

8
src/views/components/AccessDoor.vue

@ -13,12 +13,12 @@
<div>{{ scope.row.time | parseTime }}</div> <div>{{ scope.row.time | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="姓名" align="center" :show-overflow-tooltip="true" width="100">
<el-table-column label="姓名" align="center" :show-overflow-tooltip="true" :width="isScreen ? 100 :''">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.name }}</div> <div>{{ scope.row.name }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="minorName" label="说明" align="center" :show-overflow-tooltip="true" width="148" />
<el-table-column prop="minorName" label="说明" align="center" :show-overflow-tooltip="true" :width="isScreen ? 148 :''" />
</el-table> </el-table>
</div> </div>
</template> </template>
@ -30,6 +30,10 @@ import { mapGetters } from 'vuex'
export default { export default {
name: 'AccessDoor', name: 'AccessDoor',
props: { props: {
isScreen: {
type: Boolean,
default: false
},
width: { width: {
type: String, type: String,
default: '100%' default: '100%'

8
src/views/components/WarehouseWarning.vue

@ -15,8 +15,8 @@
<!-- <span v-if="scope.row.TS">{{ scope.row.TS | parseTime }}</span> --> <!-- <span v-if="scope.row.TS">{{ scope.row.TS | parseTime }}</span> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="设备" align="center" :show-overflow-tooltip="true" width="100" />
<el-table-column prop="value" label="警情" align="center" :show-overflow-tooltip="true" width="148" />
<el-table-column prop="name" label="设备" align="center" :show-overflow-tooltip="true" :width="isScreen ? 100 :''" />
<el-table-column prop="value" label="警情" align="center" :show-overflow-tooltip="true" :width="isScreen ? 148 :''" />
</el-table> </el-table>
</div> </div>
</template> </template>
@ -26,6 +26,10 @@ import { mapGetters } from 'vuex'
export default { export default {
name: 'WarehouseWarning', name: 'WarehouseWarning',
props: { props: {
isScreen: {
type: Boolean,
default: false
},
width: { width: {
type: String, type: String,
default: '100%' default: '100%'

11
src/views/environmentalScreen/index.vue

@ -180,9 +180,9 @@
</div> </div>
<div class="env-main-right"> <div class="env-main-right">
<!-- 环控实时报警 --> <!-- 环控实时报警 -->
<warehouse-warning :height="'calc(100% - 38px)'" />
<warehouse-warning is-screen="true" :height="'calc(100% - 38px)'" />
<!-- 门禁出入记录 --> <!-- 门禁出入记录 -->
<AccessDoor :height="'calc(100% - 40px)'" size="4" />
<AccessDoor is-screen="true" :height="'calc(100% - 40px)'" size="4" />
<!-- 当日告警统计 --> <!-- 当日告警统计 -->
<div class="env-item container-wrap"> <div class="env-item container-wrap">
<span class="right-top-line" /> <span class="right-top-line" />
@ -559,8 +559,11 @@ export default {
}) })
// 2. // 2.
this.onlineDeviceNum = this.apiOnlineNum + localStats.online
this.offlineDeviceNum = this.apiOfflineNum + localStats.offline
// this.onlineDeviceNum = this.apiOnlineNum + localStats.online
// this.offlineDeviceNum = this.apiOfflineNum + localStats.offline
this.onlineDeviceNum = this.apiOnlineNum
this.offlineDeviceNum = this.apiOfflineNum
// 3. IP // 3. IP
console.log('===== 合并后的设备数量详情 =====', { console.log('===== 合并后的设备数量详情 =====', {

4
src/views/home.vue

@ -1,8 +1,8 @@
<template> <template>
<div class="dashboard-container"> <div class="dashboard-container">
<div class="dashboard-editor-container"> <div class="dashboard-editor-container">
<!-- <panel-group /> -->
<panel-group :device-list="allDisplayConfigData" />
<panel-group />
<!-- <panel-group :device-list="allDisplayConfigData" /> -->
<el-row :gutter="20" style="margin-bottom:20px;height: 152px;"> <el-row :gutter="20" style="margin-bottom:20px;height: 152px;">
<el-col :xs="24" :sm="24" :lg="8"> <el-col :xs="24" :sm="24" :lg="8">
<!-- search-area --> <!-- search-area -->

19
src/views/storeManage/deviceManage/module/deviceDetail.vue

@ -39,7 +39,7 @@
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" style="width: 370px;" /> <el-input v-model="form.deviceName" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item v-if="selectedDeviceType === '智能密集架' || selectedDeviceType === '回转柜' || selectedDeviceType === '摄像头' || isInsidedevices || selectedDeviceType === '门禁' " label="接口IP" prop="deviceIp">
<el-form-item v-if="selectedDeviceType === '智能密集架' || selectedDeviceType === '回转柜' || selectedDeviceType === '摄像头' || isInsidedevices || selectedDeviceType === '门禁' || selectedDeviceType === '原品环控' " label="接口IP" prop="deviceIp">
<el-input v-model="form.deviceIp" style="width: 370px;" /> <el-input v-model="form.deviceIp" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item v-if="selectedDeviceType === '智能密集架' || selectedDeviceType === '回转柜' || selectedDeviceType === '摄像头' || isInsidedevices || selectedDeviceType === '门禁'" label="端口" prop="devicePort"> <el-form-item v-if="selectedDeviceType === '智能密集架' || selectedDeviceType === '回转柜' || selectedDeviceType === '摄像头' || isInsidedevices || selectedDeviceType === '门禁'" label="端口" prop="devicePort">
@ -167,7 +167,6 @@
<el-table-column align="center" prop="storeroomId.name" label="所属区域" width="100" show-overflow-tooltip /> <el-table-column align="center" prop="storeroomId.name" label="所属区域" width="100" show-overflow-tooltip />
<el-table-column align="center" label="设备状态" width="100"> <el-table-column align="center" label="设备状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.deviceState === null" class="el-icon-loading" /> <span v-if="scope.row.deviceState === null" class="el-icon-loading" />
<span v-else :class="{ 'spk-a': scope.row.deviceState === 1, 'off-line': scope.row.deviceState !== 1 }" /> <span v-else :class="{ 'spk-a': scope.row.deviceState === 1, 'off-line': scope.row.deviceState !== 1 }" />
</template> </template>
@ -465,6 +464,8 @@ export default {
const RFID_DEVICE_TYPE_ID = 'E2767FEACA9CE0E3B16B89' const RFID_DEVICE_TYPE_ID = 'E2767FEACA9CE0E3B16B89'
// ID - 线 // ID - 线
const ONLINE_DEVICE_TYPE_ID = 'DD656054BE3D1DF1E2F1FC' const ONLINE_DEVICE_TYPE_ID = 'DD656054BE3D1DF1E2F1FC'
// id
const YP_DEVICE_TYPE_ID = '54140FFB4DD943B4817AB27'
crud.data.forEach(element => { crud.data.forEach(element => {
console.log('element', element) console.log('element', element)
@ -473,6 +474,9 @@ export default {
this.getRFIDReadStatus(element) this.getRFIDReadStatus(element)
} else if (element.deviceTypeId?.id === ONLINE_DEVICE_TYPE_ID) { } else if (element.deviceTypeId?.id === ONLINE_DEVICE_TYPE_ID) {
element.deviceState = 1 element.deviceState = 1
} else if (element.deviceTypeId?.id === YP_DEVICE_TYPE_ID) {
element.deviceState = null
this.getypNetStatusByIp(element)
} else { } else {
if (element.deviceIp) { if (element.deviceIp) {
this.getDeviceState(element) this.getDeviceState(element)
@ -504,6 +508,17 @@ export default {
element.deviceState = 0 element.deviceState = 0
}) })
}, },
getypNetStatusByIp(element) {
crudDevice.FetchypNetStatusByIp({ id: element.id })
.then((data) => {
element.deviceState = data === '0' ? 1 : 0
})
.catch((error) => {
console.error('获取原品环控设备状态失败:', error)
element.deviceState = 0
})
},
// //
[CRUD.HOOK.afterValidateCU](crud) { [CRUD.HOOK.afterValidateCU](crud) {
if (crud.status.edit === 1) { if (crud.status.edit === 1) {

Loading…
Cancel
Save