Browse Source

档案导入 / 门禁日志

master
xuhuajiao 2 years ago
parent
commit
d81fb98dd6
  1. 11
      src/api/archivesManage/fileImport.js
  2. 2
      src/api/home/securityDoor/securityDoor.js
  3. 33
      src/views/archivesManage/fileImport/dataImport/index.vue
  4. 54
      src/views/archivesManage/fileImport/importLog/index.vue
  5. 14
      src/views/archivesManage/fileImport/index.vue
  6. 84
      src/views/archivesManage/fileImport/module/detail.vue
  7. 29
      src/views/archivesManage/fileImport/module/table.json
  8. 12
      src/views/components/SecurityDoor.vue
  9. 2
      src/views/system/logManage/accessDoorLog/index.vue
  10. 60
      src/views/system/logManage/doorLog/index.vue

11
src/api/archivesManage/fileImport.js

@ -38,9 +38,18 @@ export function FetchInitImportLog(params) {
})
}
// 导入日志详情
export function FetchInitImportLogDetail(params) {
return request({
url: 'api/unzip/initImportLogDetail' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default {
zipUpload,
FetchInitImportPreview,
FetchImportZip,
FetchInitImportLog
FetchInitImportLog,
FetchInitImportLogDetail
}

2
src/api/home/securityDoor/securityDoor.js

@ -2,7 +2,7 @@ import request from '@/utils/request'
export function securitydoor(params) {
return request({
url: 'api/securitydoor/initSecurityDoorLog',
url: 'api/securitydoor/initSecurityDoorLog1',
method: 'get',
params
})

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

@ -9,7 +9,7 @@
</ul>
<div v-if="isShow01" class="step-content step-upload">
<div class="upload-container">
<input ref="fileInput" type="file" accept=".zip" @change="handleFileChange">
<input ref="fileInput" :key="key" type="file" accept=".zip" @change="handleFileChange">
<div class="upload-zip"><i class="el-icon-upload2" />选择文件</div>
</div>
<div class="el-upload__tip">上传限制文件类型zip</div>
@ -23,7 +23,7 @@
</div>
<div v-if="isShow02" class="step-content">
<div class="import-data-number">案卷<span>{{ ajnum }}</span> / 卷内<span>{{ danum }}</span> / 资料<span>{{ djnum }}</span> </div>
<detail ref="importTableList" />
<detail ref="importTableList" :is-log-or-preview="isLogOrPreview" />
</div>
<div v-if="isShow02" class="step-bottom-btn">
<el-button @click="handleReturn02">上一步</el-button>
@ -81,6 +81,7 @@ export default {
components: { detail },
data() {
return {
key: 0,
file: null,
fileList: [],
ajnum: null,
@ -96,7 +97,9 @@ export default {
},
isShow01: true,
isShow02: false,
isShow03: false
isShow03: false,
timer: null,
isLogOrPreview: 'preview'
}
},
computed: {
@ -107,9 +110,12 @@ export default {
created() {
},
methods: {
// input-upload change
handleFileChange(event) {
const files = event.target.files
this.file = files[0]
this.key++
console.log(this.file)
// const sizeLimit = this.file.size / 1024 / 1024 > 10
// if (sizeLimit) {
// this.$message.warning(' 10MB!')
@ -119,6 +125,7 @@ export default {
this.fileList.push(files[i])
}
},
// delt file
deleteFile(file) {
this.$confirm('此操作将清空所选数据, 是否继续?', '提示', {
confirmButtonText: '确定',
@ -139,19 +146,18 @@ export default {
})
})
},
//
handleStep01() {
if (this.fileList.length !== 0) {
this.zipName = this.file.name.split('.')[0]
//
crudFileImport.zipUpload(this.baseApi + '/api/unzip/preview', this.file).then(res => {
console.log(res)
if (res.data.code === 200) {
if (res.data.data) {
this.isShow01 = false
this.isShow02 = true
//
crudFileImport.FetchInitImportPreview({ page: 0, size: 10, type: 1 }).then(res => {
console.log(res)
this.ajnum = res.ajnum
this.danum = res.danum
this.djnum = res.djnum
@ -166,26 +172,31 @@ export default {
return
}
},
//
handleReturn02() {
this.fileList = []
this.isShow01 = true
this.isShow02 = false
this.isShow03 = false
},
//
handleStep02() {
this.isShow01 = false
this.isShow02 = false
this.isShow03 = true
},
//
handleReturn03() {
this.isShow01 = false
this.isShow02 = true
this.isShow01 = true
this.isShow02 = false
this.isShow03 = false
this.fileList = []
this.file = null
},
//
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//
const params = {
'archivesImportType': this.form.archivesImportType,
'importArchive': this.form.importArchive,
@ -194,12 +205,15 @@ export default {
'name': this.zipName
}
crudFileImport.FetchImportZip(params).then(res => {
console.log(res)
if (res) {
this.$message({
type: 'success',
message: '导入成功!'
})
this.timer = setTimeout(() => {
this.$emit('step-end', '1')
clearTimeout(this.timer)
}, 1000)
}
})
} else {
@ -254,7 +268,6 @@ export default {
}
}
}
&.dot-img{
width: 55px;
height: 30px;

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

@ -2,7 +2,7 @@
<div>
<div class="head-container" style="display: flex; justify-content: flex-start;">
<div class="head-search" style="margin-bottom: 0;">
<date-range-picker v-model="query.createTime" class="date-item" />
<date-range-picker v-model="query.startTime" class="date-item" />
<rrOperation />
</div>
<crudOperation />
@ -10,12 +10,16 @@
<!--表格渲染-->
<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 prop="username" label="导入数据包" />
<el-table-column prop="nickName" label="导入状态" />
<el-table-column prop="gender" label="操作人" />
<el-table-column prop="createTime" label="操作日期">
<el-table-column prop="name" label="导入数据包" />
<el-table-column prop="status" label="导入状态">
<template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>
<div>{{ scope.row.status === 1 ? '已完成' : '' }}</div>
</template>
</el-table-column>
<el-table-column prop="create_by" label="操作人" />
<el-table-column prop="create_time" label="操作日期">
<template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
</template>
</el-table-column>
</el-table>
@ -26,12 +30,7 @@
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<div class="import-data-number">
<p>导入方式<span style="color: #339cff;">跳过</span></p>
<p>成功读取数据<span style="color:rgb(246,81,99)">10000</span> </p>
<p>成功导入数据<span style="color: #1AAE93;">500</span> </p>
</div>
<detail />
<detail ref="importTableList" :is-log-or-preview="isLogOrPreview" :zip-select="zipSelect" />
</div>
</el-dialog>
@ -39,7 +38,7 @@
</template>
<script>
import crudUser from '@/api/system/user'
import crudFileImport from '@/api/archivesManage/fileImport'
import CRUD, { presenter, header, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@ -50,19 +49,21 @@ export default {
name: 'ImportLog',
components: { detail, rrOperation, DateRangePicker, crudOperation, pagination },
cruds() {
return CRUD({ title: '导入日志', url: 'api/users', crudMethod: { ...crudUser }, optShow: {
return CRUD({ title: '导入日志', url: 'api/unzip/initImportLog', crudMethod: { ...crudFileImport }, optShow: {
add: false,
edit: false,
del: false,
reset: true,
download: true,
download: false,
group: false
}})
},
mixins: [presenter(), header(), crud()],
data() {
return {
detailVisible: false
detailVisible: false,
isLogOrPreview: 'log',
zipSelect: null
}
},
created() {
@ -76,10 +77,16 @@ export default {
},
//
handleDbClick(row) {
this.zipSelect = row
this.detailVisible = true
crudFileImport.FetchInitImportLogDetail({ zipid: row.id, type: 1 }).then(res => {
this.$refs.importTableList.tableData = res.content
this.$refs.importTableList.page.total = res.totalElements
})
},
handleClose() {
this.detailVisible = false
this.$refs.importTableList.archivesTabIndex = 0
}
}
}
@ -97,19 +104,4 @@ export default {
}
}
}
.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;
}
}
</style>

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

@ -10,7 +10,9 @@
<!-- 最右侧装饰img -->
<span class="tab-right-img" />
</ul>
<component :is="comName" :ref="comName" />
<dataImport v-if="activeIndex == 0" @step-end="changeActiveTab" />
<importLog v-if="activeIndex == 1" />
</div>
</div>
</template>
@ -27,16 +29,6 @@ export default {
activeIndex: 0
}
},
computed: {
comName: function() {
if (this.activeIndex === 0) {
return 'dataImport'
} else if (this.activeIndex === 1) {
return 'importLog'
}
return 'dataImport'
}
},
created() {
},
methods: {

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

@ -1,5 +1,10 @@
<template>
<div class="import-detail-container">
<div v-if="isLogOrPreview === 'log'" class="import-data-number">
<p>导入方式<span style="color: #339cff;">{{ importType }}</span></p>
<p>成功读取数据<span style="color:rgb(246,81,99)">{{ importData }}</span> </p>
<p>成功导入数据<span style="color: #1AAE93;">{{ readData }}</span> </p>
</div>
<ul class="import-tab">
<li :class="{'active': archivesTabIndex == 0}" @click="changeActiveTab(0)">案卷</li>
<li :class="{'active': archivesTabIndex == 1}" @click="changeActiveTab(1)">文件</li>
@ -48,6 +53,18 @@ import crudFileImport from '@/api/archivesManage/fileImport'
export default {
name: 'DataImport',
components: { },
props: {
isLogOrPreview: {
type: String,
default: 'preview'
},
zipSelect: {
type: Object,
default: function() {
return {}
}
}
},
data() {
return {
archivesTabIndex: 0,
@ -56,25 +73,54 @@ export default {
page: 0,
size: 10,
total: 0
}
},
importType: null,
importData: null,
readData: null
}
},
created() {
mounted() {
console.log(this.zipSelect)
this.getTotalInfo()
},
methods: {
changeActiveTab(index) {
this.archivesTabIndex = index
this.getList()
this.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.daNum
} else if (this.archivesTabIndex === 2) {
this.importType = this.zipSelect.informationInputType === 1 ? '跳过' : '覆盖'
this.readData = this.zipSelect.djNum
this.importData = this.zipSelect.djNum
}
},
getList() {
//
crudFileImport.FetchInitImportPreview({ page: this.page.page - 1, size: this.page.size, type: this.archivesTabIndex + 1 }).then(res => {
this.ajnum = res.ajnum
this.danum = res.danum
this.djnum = res.djnum
this.tableData = res.list.content
this.page.total = res.list.totalElements
})
if (this.isLogOrPreview === 'preview') {
//
crudFileImport.FetchInitImportPreview({ page: this.page.page - 1, size: this.page.size, type: this.archivesTabIndex + 1 }).then(res => {
this.ajnum = res.ajnum
this.danum = res.danum
this.djnum = res.djnum
this.tableData = res.list.content
this.page.total = res.list.totalElements
})
} else {
crudFileImport.FetchInitImportLogDetail({ page: this.page.page - 1, size: this.page.size, zipid: this.zipSelect.id, type: this.archivesTabIndex + 1 }).then(res => {
console.log(res)
this.tableData = res.content
this.page.total = res.totalElements
})
}
},
// table
clickRowHandler(row) {
@ -97,6 +143,24 @@ export default {
</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;

29
src/views/archivesManage/fileImport/module/table.json

@ -1,29 +0,0 @@
[
{
"security_class": "机密",
"medium_type": "纸张",
"micro_number":"-",
"subject_term": "主题词123",
"remarks": "附注123",
"case_no": "A8806117A7B9058F1AA90A",
"responsibleby": "许由",
"begin_date": "2016-09-21",
"end_date": "2016-09-21",
"children_num": 1,
"tid": "",
"organization_matter": "",
"maintitle": "行政事务文件级文书档案2021002",
"archive_ctg_no": "行政事务",
"archive_year": 2021,
"page_qty": 50,
"archive_no": "AA001-D-WS.W-2023-0011",
"fonds_no": "档案室",
"created_date": "2021-10-10 ",
"id": "2102D839B14ABAC03F8FEB",
"is_storage": 2,
"department": "办公室",
"retention": "定期10年",
"piece_no": "001",
"is_borrow": ""
}
]

12
src/views/components/SecurityDoor.vue

@ -8,20 +8,20 @@
</p>
</h3>
<el-table ref="table" style="min-width: 100%;" :height="height" :data="tableData" class="warehose-el-table" stripe>
<el-table-column prop="his_time" label="时间" align="center" width="140">
<el-table-column prop="hisTime" label="时间" align="center" width="160">
<template slot-scope="scope">
<div>{{ scope.row.his_time | parseTime }}</div>
<div>{{ scope.row.hisTime | parseTime }}</div>
</template>
</el-table-column>
<el-table-column label="位置" align="center" width="160">
<template slot-scope="scope">
<div>{{ scope.row.door_name }}</div>
<div>{{ scope.row.doorName }}</div>
</template>
</el-table-column>
<el-table-column prop="in_or_out" label="说明" align="center">
<el-table-column prop="inOrOut" label="说明" align="center">
<template slot-scope="scope">
<span v-if="scope.row.in_or_out===0" class="clear"></span>
<span v-if="scope.row.in_or_out===1" class="clear"></span>
<el-tag v-if="scope.row.inOrOut===0">进门</el-tag>
<el-tag v-if="scope.row.inOrOut===1" type="warning">出门</el-tag>
</template>
</el-table-column>
</el-table>

2
src/views/system/logManage/accessDoorLog/index.vue

@ -124,7 +124,7 @@ export default {
//
handleDownload() {
this.crud.downloadLoading = true
const fileName = parseTime(new Date()) + '-门日志.xlsx'
const fileName = parseTime(new Date()) + '-通道门日志.xlsx'
getBlob(this.baseApi + '/api/securitydoor/exportSecurityDoorLogList' + '?' + qs.stringify(this.crud.query, { indices: false }), function(blob) {
saveAs(blob, fileName)
})

60
src/views/system/logManage/doorLog/index.vue

@ -36,27 +36,27 @@
@selection-change="selectionChangeHandler"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="user_name" label="姓名" min-width="100" align="center" />
<el-table-column prop="employee_id" label="工号" min-width="140" align="center" />
<el-table-column prop="card_no" label="卡编号" min-width="140" align="center" />
<el-table-column prop="card_code" label="卡内码" min-width="140" align="center" />
<el-table-column prop="department_name" label="部门" min-width="140" align="center" />
<el-table-column prop="door_name" label="门区" min-width="100" align="center" />
<el-table-column prop="in_or_out" label="事件" align="center" min-width="150">
<el-table-column prop="userName" label="姓名" min-width="100" align="center" />
<el-table-column prop="employeeId" label="工号" min-width="140" align="center" />
<el-table-column prop="cardNo" label="卡编号" min-width="140" align="center" />
<el-table-column prop="cardCode" label="卡内码" min-width="140" align="center" />
<el-table-column prop="departmentName" label="部门" min-width="140" align="center" />
<el-table-column prop="doorName" label="门区" min-width="100" align="center" />
<el-table-column prop="inOrOut" label="事件" align="center" min-width="150">
<template slot-scope="scope">
<span v-if="scope.row.in_or_out===0" class="clear" style="width:56px">进门</span>
<span v-if="scope.row.in_or_out===1" class="clear" style="width:56px">出门</span>
<el-tag v-if="scope.row.inOrOut===0">进门</el-tag>
<el-tag v-if="scope.row.inOrOut===1" type="warning">出门</el-tag>
</template>
</el-table-column>
<el-table-column prop="his_time" label="记录时间" align="center" min-width="150">
<el-table-column prop="hisTime" label="记录时间" align="center" min-width="150">
<template slot-scope="scope">
<div>{{ scope.row.his_time | parseTime }}</div>
<div>{{ scope.row.hisTime | parseTime }}</div>
</template>
</el-table-column>
<el-table-column prop="action" label="动作类型" align="center" min-width="180" />
<el-table-column prop="create_time" label="报警时间" align="center" min-width="180">
<el-table-column prop="createTime" label="创建时间" align="center" min-width="180">
<template slot-scope="scope">
<div>{{ scope.row.create_time | parseTime }}</div>
<div>{{ scope.row.createTime | parseTime }}</div>
</template>
</el-table-column>
<!-- <el-table-column prop="alarmEvent" label="事件" min-width="150" align="center">
@ -85,24 +85,25 @@ export default {
mixins: [presenter(), crud()],
cruds() {
return CRUD({
url: 'api/securitydoor/initSecurityDoorLog',
url: 'api/securitydoor/initSecurityDoorLog1',
optShow: {
add: false,
edit: false,
del: false,
download: true
}
},
sort: []
})
},
data() {
return {
selections: [],
keyWord: '',
optionVal: 'user_name',
optionVal: 'userName',
options: [
{ value: 'user_name', label: '姓名' },
{ value: 'employee_id', label: '工号' },
{ value: 'door_name', label: '门区' }
{ value: 'userName', label: '姓名' },
{ value: 'employeeId', label: '工号' },
{ value: 'doorName', label: '门区' }
],
queryTime: []
}
@ -114,25 +115,26 @@ export default {
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.roomName = null
this.crud.query.deviceName = null
this.crud.query.userName = null
this.crud.query.employeeId = null
this.crud.query.doorName = null
this.crud.query.startTime = null
this.crud.query.endTime = null
if (this.optionVal === 'deviceName') {
this.crud.query.deviceName = this.keyWord
} else if (this.optionVal === 'roomName') {
this.crud.query.roomName = this.keyWord
if (this.optionVal === 'employeeId') {
this.crud.query.employeeId = this.keyWord
} else if (this.optionVal === 'userName') {
this.crud.query.userName = this.keyWord
} else if (this.optionVal === 'doorName') {
this.crud.query.doorName = this.keyWord
}
if (this.queryTime.length > 0) {
this.crud.query.startTime = this.queryTime[0]
this.crud.query.endTime = this.queryTime[1]
this.crud.query.startTime = this.queryTime
}
},
//
handleDownload() {
this.crud.downloadLoading = true
const fileName = parseTime(new Date()) + '-门禁日志.xlsx'
getBlob(this.baseApi + '/api/securitydoor/exportSecurityDoorLogList' + '?' + qs.stringify(this.crud.query, { indices: false }), function(blob) {
getBlob(this.baseApi + '/api/securitydoor/exportSecurityDoorLog1List' + '?' + qs.stringify(this.crud.query, { indices: false }), function(blob) {
saveAs(blob, fileName)
})
this.crud.downloadLoading = false

Loading…
Cancel
Save