流程清单增加 历史记录导出功能

This commit is contained in:
qinoy 2023-11-09 18:33:25 +08:00
parent e7abf1c8f4
commit 808bee1707
2 changed files with 201 additions and 3 deletions

View File

@ -0,0 +1,178 @@
<script>
import awsuiAxios from "@/awsuiAxios";
export default {
name: "ExportLog",
props: {
visible: {
type: Boolean,
default: false
},
wsId: {// ID
type: String,
default: '',
required: true
}
},
data() {
return {
internalVisible: this.visible,
width: '800px',
timer: null, //
exportLogData: [],
loading: true,
executingIds: [] // ID
}
},
methods: {
async init() {
const param = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.processlist_export_log_data',
wsId: this.wsId
}
};
const {result, msg, data } = await awsuiAxios.post(param);
// console.log('',result, msg)
if (result === 'ok'){
this.loading = false;
this.exportLogData = [...data.exportList]
this.executingIds = [...data.executeIdList]
this.handleClearInterVal(data.isAllComplate)
}else {
this.$message({
type: 'error',
message: msg
})
}
},
//
async handleExportExecutingStatusInfo(){
if (!this.executingIds.length){
return;
}
const param = {
url:'jd',
data:{
cmd: 'com.actionsoft.apps.coe.pal.processlist_export_executing_status_get',
wsId: this.wsId,
exportIds: JSON.stringify(this.executingIds)
}
};
const { result, msg, data } = await awsuiAxios.post(param);
if (result === 'ok'){
// console.log('', data)
this.executingIds = [...data.executeIdList]
const exportLogData = [...data.exportList]
exportLogData.forEach(item1 => {
this.exportLogData.forEach(item2 => {
if (item1.id === item2.id){
item2.progress = item1.progress
item2.status = item1.status
item2.statusText = item1.statusText
item2.updateTime = item1.updateTime
}
})
})
this.handleClearInterVal(data.isAllComplate)
}else {
this.$message({
type: 'error',
message: msg
})
}
},
handleClearInterVal(isAllComplate){
if (isAllComplate){
// console.log('')
clearInterval(this.timer);
}
},
downloadExportLog(url){
if (url){
document.getElementById("downloadIframe").src = url;
}
},
handleClose(done) {
this.$emit('close')
done();
},
},
watch: {
visible(newVal) {
this.internalVisible = newVal;
}
},
mounted() {
this.init(); //
this.timer = setInterval( () => {
this.handleExportExecutingStatusInfo(); // 5s
}, 5000);
},
beforeDestroy() {
clearInterval(this.timer); //
// console.log(' ')
}
}
</script>
<template>
<el-dialog
title="导出记录"
:visible.sync="internalVisible"
:destroy-on-close=true
:width="width"
:modal-append-to-body=false
:close-on-click-modal=false
:before-close="handleClose"
:append-to-body=true>
<div class="export-log-content">
<el-table
:data="exportLogData"
v-loading="loading"
height="350"
style="width: 100%">
<el-table-column
align="center"
prop="fileName"
label="文件名称"
width="280">
</el-table-column>
<el-table-column
prop="statusText"
align="center"
label="状态"
width="80">
</el-table-column>
<el-table-column
prop="progress"
align="center"
width="100"
label="进度">
<template slot-scope="{ row }">
<el-progress :percentage="row.progress" ></el-progress>
</template>
</el-table-column>
<el-table-column
prop="updateTime"
align="center"
label="更新时间"
width="200">
</el-table-column>
<el-table-column
width="80"
align="center"
label="下载">
<template slot-scope="{ row }">
<i v-if="row.status === 1" style="cursor: pointer;" class="awsui-iconfont" @click="downloadExportLog(row.downloadUrl)">&#xe653;</i>
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
</template>
<style scoped>
</style>

View File

@ -13,8 +13,11 @@
<div class="head-title" style="float:left;width:200px;">
<awsui-select id="levelSelect" v-model="levelValue" collapse-tags placeholder="请选择流程层级" :options="levelOptions" multiple @change="searchProcessList(false)"></awsui-select>
</div>
<div class="head-title" style="float:right;width: 260px;position: relative;bottom: 5px;">
<div class="head-title" style="float:right;width: 300px;position: relative;bottom: 5px;">
<awsui-button class="button-general-color button_fixed_width" type="primary" @click="exportProcessList">导出</awsui-button>
<el-tooltip class="item" effect="dark" content="历史导出记录" placement="bottom-end" :hide-after="1000">
<i class="awsui-iconfont custom_table_dlg_icon" style="margin-right: 10px;" @click="openExportLogPage()">&#xe690;</i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="重置筛选条件" placement="bottom-end" :hide-after="1000">
<awsui-button class="button_fixed_width" @click="resetCondition">重置</awsui-button>
</el-tooltip>
@ -206,6 +209,7 @@
:title="bpmOrgAddress.title"
:multiple="bpmOrgAddress.multiple"
/>
<ExportLog v-if="exportLog.visible" :ws-id="exportLog.wsId" :visible="exportLog.visible" v-on:close="closeExportLogPage"/>
</awsui-layout>
</template>
@ -213,6 +217,7 @@
import draggable from "vuedraggable";
import awsuiAxios from "../awsuiAxios";
import {openDesigner} from "../api/commonFun";
import ExportLog from "@/components/ExportLog.vue";
import PalRelationAddress from "@/components/common/PalRelationAddress/index.js";
import PALRepositoryTree from "@/components/common/PALRepositoryTree/index.js";
import BPMOrgAddress from "@/components/common/BPMOrgAddress/index.js";// pal簿
@ -228,7 +233,8 @@
draggable,
PalRelationAddress,
BPMOrgAddress,
PALRepositoryTree
PALRepositoryTree,
ExportLog
},
data() {
return {
@ -276,6 +282,10 @@
isRequired: false
},
showMoreSearch: false,
exportLog: {
wsId: wsId,
visible: false,
}
}
},
methods : {
@ -501,7 +511,11 @@
params = this.getSearchCondition(params);
awsuiAxios.post(params).then(function (ro) {//
if (ro.result == 'ok') {
document.getElementById("downloadIframe").src=ro.msg;
// document.getElementById("downloadIframe").src=ro.msg;
that.$message({
type: 'success',
message: ro.msg
})
} else {
// alert('');
// debugger;
@ -592,6 +606,12 @@
this.showMoreSearch = visible;
this.searchProcessList(false);
},
openExportLogPage(){ //
this.exportLog.visible = true;
},
closeExportLogPage(){
this.exportLog.visible = false;
},
clearSearchMore() {
this.frameworkSearchInput1 = '';
this.frameworkSearchInput1Arr = [];