Browse Source

完成web人员信息页面

v6
超级管理员 2 years ago
parent
commit
ac2976cf0e
  1. 4
      src/api/hr/org/type.ts
  2. 10
      src/api/hr/people/index.ts
  3. 1
      src/types/components.d.ts
  4. 123
      src/views/hr/archives/index.vue

4
src/api/hr/org/type.ts

@ -174,3 +174,7 @@ export interface criteriaForPeopleList{
adminorgname: string
}
export type archivesList = PageResult<criteriaForPeopleList[]>
export interface msgAry {
msg:string[]
}

10
src/api/hr/people/index.ts

@ -356,3 +356,13 @@ import {
data: data
});
}
/**
*
*/
export function analysisRedisExelect(data?: any): AxiosPromise {
return request({
url: '/hrapi/staff/analysisRedisExelect',
method: 'post',
data: data
});
}

1
src/types/components.d.ts

@ -59,6 +59,7 @@ declare module '@vue/runtime-core' {
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']

123
src/views/hr/archives/index.vue

@ -4,19 +4,21 @@
@ 备注: 人员管理
-->
<script lang='ts' setup>
import { orgInfo } from '@/api/hr/org/type'
import { orgInfo,msgAry } from '@/api/hr/org/type'
import { getOrgTreeList } from '@/api/hr/org/index'
import { archivesCont,searchCriteriaForPeople } from '@/api/hr/people/type'
import { emptypeOptions } from '@/api/hr/people/datacont'
import { getArchivesListPage } from '@/api/hr/people/index'
import { getArchivesListPage,analysisRedisExelect } from '@/api/hr/people/index'
import UserRole from '@/assets/icons/user.svg'
import { UploadFilled } from '@element-plus/icons-vue'
/**
* 引入页面
*/
import ArchivesCont from '@/views/hr/archives/archivescont.vue'
import ArchivesCont from '@/views/hr/archives/archivescont.vue'
const uploadFFurl = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFiles"
// const uploadFFurl = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFiles"
const uploadFFurl = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFilesRedis"
const searchOrgFormRef = ref(ElForm);
const orgTreeRef = ref(ElTree); //
@ -34,6 +36,8 @@ const searchArchiveQuery = reactive<searchCriteriaForPeople>({
page:1,
pagesize:13
})
// const progressSize = 0
const progressSize = ref(0)
const archivesBox= ref(false); //
/**1: , 2: ;3:&;4567891011退1213退14',
`company` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '入职公司',
@ -107,12 +111,17 @@ const piLiangBox = ref(false)
const openPiliangBox = () =>{
piLiangBox.value = true
}
let jiBuQiVal = 0;
//
const handleOpenClose = () =>{
piLiangBox.value = false
piLiangBox.value = false
peopleListAry.value = []
progressSize.value = 0
peopleMsg.value = []
jiBuQiVal = 0
}
const excelLoading = ref(false)
const excelJiexi = ref(false)
/**
* Excel文件change事件
*
@ -127,7 +136,12 @@ const excelLoading = ref(false)
}
}
const peopleListAry = ref<any[]>();
let peopleListAry = new Array;
const peopleMsg = ref<string[]>([])
const meritsYearIng = ref<any>();
const rewPunYearsIng = ref<any>();
const redisListKey = ref<string>();
const totalNum = ref<number>();
/**
@ 作者: 秦东
@ 时间: 2024-02-03 14:04:48
@ -138,15 +152,86 @@ const uploadTrue = (response: any, uploadFile: UploadFile, uploadFiles: UploadFi
console.log("response",response);
console.log("uploadFile",uploadFile);
console.log("uploadFiles",uploadFiles);
peopleListAry.value = response.data.listAry
peopleListAry.push("文件上传成功!开始解析数据并写入数据库!")
peopleMsg.value.push("文件上传成功!开始解析数据并写入数据库!")
// peopleListAry.value.push("")
console.log("上传成功",response.code)
if (response.code == 0){
jiBuQiVal = 0
progressSize.value = 0
excelJiexi.value = true
meritsYearIng.value = response.data.meritsYearIng
rewPunYearsIng.value = response.data.rewPunYearsIng
redisListKey.value = response.data.redisListKey
totalNum.value = response.data.totalNum
insetPeopleCont()
}
}
const uploadError = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
excelLoading.value = false;
excelLoading.value = true;
console.log("1response",response);
console.log("1uploadFile",uploadFile);
console.log("1uploadFiles",uploadFiles);
let msgAry = new Array
msgAry.push("响应时间过长,系统自动转为后台静默处理,可先关闭窗口!完成时间大约90分钟。请于90分钟后刷新信息")
// errorMsg = ["9090"]
peopleListAry.value = msgAry
}
const excelUpload = ref<any>()
const insetPeopleCont = () =>{
console.log("启动数据写入数据库",jiBuQiVal,totalNum.value)
if (jiBuQiVal < totalNum.value){
let sendData = {
meritsYearIng:meritsYearIng.value,
rewPunYearsIng:rewPunYearsIng.value,
redisListKey:redisListKey.value,
number:jiBuQiVal,
}
console.log("启动数据写入数据库",sendData)
analysisRedisExelect(sendData)
.then((data:any)=>{
console.log("启动数据写入11111数据库",data)
peopleMsg.value.push(data.data.msgstr)
jiBuQiVal++
// if (jibuq+ 1 >= totalNum.value){
// }
progressSize.value = Math.round((jiBuQiVal/totalNum.value)*10000)/100
insetPeopleCont()
})
}else{
excelJiexi.value = false
progressSize.value = 100
excelUpload.value.clearFiles()
}
}
//
const writeDataBase = () => {
let jibuq = 0
for(let i = 0; i < totalNum.value;i++){
let sendData = {
meritsYearIng:meritsYearIng.value,
rewPunYearsIng:rewPunYearsIng.value,
redisListKey:redisListKey.value,
number:i,
}
console.log("启动数据写入数据库",sendData)
analysisRedisExelect(sendData)
.then((data:any)=>{
console.log("启动数据写入11111数据库",data)
peopleMsg.value.push(data.data.msgstr)
jibuq++
if (jibuq+ 1 >= totalNum.value){
excelJiexi.value = false
}
})
}
}
//
onMounted(() => {
haveOrgTreeInfo();
@ -291,15 +376,17 @@ onMounted(() => {
width="800"
:before-close="handleOpenClose"
>
<el-row v-loading="excelLoading" element-loading-text="文档解析中,请稍候...">
<el-col :span="24">
<el-row v-loading="excelLoading" element-loading-text="文档上传中,请稍候...">
<el-col :span="24" v-loading="excelJiexi" element-loading-text="文档解析中,请稍候...">
<el-upload
ref="excelUpload"
class="upload-demo"
drag
:action="uploadFFurl"
:before-upload="handleExcelChange"
:on-success="uploadTrue"
:on-error = "uploadError"
:show-file-list = "false"
multiple
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
@ -311,13 +398,21 @@ onMounted(() => {
</el-col>
</el-row>
<div class="divBoxCont">
<el-row>
<el-col :span="24">
<el-progress :text-inside="true" :stroke-width="20" :percentage="progressSize">
<span>已完成{{progressSize}}%</span>
</el-progress>
</el-col>
</el-row>
<el-scrollbar ref="myScrollbar" style="height: 300px">
<el-row>
<el-col v-for="(item,index) in peopleListAry" :key="index" :span="24">
<el-col v-for="(item,index) in peopleMsg" :key="index" :span="24">
{{ item}}
</el-col>
</el-row>
</div>
</el-scrollbar>
</el-dialog>
</el-container>
</template>

Loading…
Cancel
Save