fix调整审批记录图片不显示问题

This commit is contained in:
gssong 2023-06-13 21:41:15 +08:00
parent d076834145
commit d4a4c5a5c1
3 changed files with 30 additions and 29 deletions

View File

@ -0,0 +1,13 @@
import request from '@/utils/request';
const baseUrl = import.meta.env.VITE_APP_BASE_API;
import { getToken } from '@/utils/auth';
/**
* id获取历史流程图
*/
export const getHistoryProcessImage = (processInstanceId: string) =>{
return baseUrl+`/workflow/processInstance/getHistoryProcessImage/${processInstanceId}`+'?Authorization=Bearer '+getToken()
}

View File

@ -1,34 +1,25 @@
<template>
<el-dialog v-model="visible" v-if="visible" title="审批记录" width="650px" append-to-body :close-on-click-modal="false">
<el-dialog v-model="visible" title="审批记录" width="60%" append-to-body :close-on-click-modal="false">
<div>
<div>
<el-image v-if="processInstanceId" :src="src" style="font-size: 20px; margin: 50px;">
<div slot="placeholder"><i class="el-icon-loading"></i> 流程审批历史图加载中</div>
<el-image :src="src" style="font-size: 20px; margin: 50px;">
</el-image>
</div>
</div>
</el-dialog>
</template>
<script >
const baseURL = import.meta.env.VITE_APP_BASE_API;
import { getToken } from '@/utils/auth';
import { getHistoryProcessImage } from '@/api/workflow/processInstance';
export default {
props: {
processInstanceId: String
},
data() {
return {
visible: false
src:"",
visible:false
};
},
computed: {
src() {
return baseURL+`/workflow/processInstance/getHistoryProcessImage${this.processInstanceId}?Authorization=Bearer ${getToken}`
}
},
methods: {
init(processInstanceId) {
this.visible = true
this.src = getHistoryProcessImage(processInstanceId)
}
}
};
</script>

View File

@ -35,7 +35,7 @@
<template #default="scope">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="text" size="small" icon="el-icon-thumb" @click="approvalRecord(scope.row)">审批记录</el-button>
<el-button type="text" size="small" icon="el-icon-thumb" @click="handleApprovalRecord(scope.row)">审批记录</el-button>
</el-col>
</el-row>
</template>
@ -43,7 +43,8 @@
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<approvalRecord ref="approvalRecordRef" :processInstanceId="processInstanceId"/>
<!-- 审批记录 -->
<approvalRecord ref="approvalRecordRef" />
</div>
</template>
@ -51,9 +52,8 @@
import { getTaskWaitByPage } from '@/api/workflow/task';
import { ComponentInternalInstance } from 'vue';
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
//
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
//
const loading = ref(true);
@ -75,19 +75,16 @@ const queryParams = ref<Record<string, any>>({
pageSize: 10,
name: undefined
});
const processInstanceId = ref<string>('')
onMounted(() => {
getList();
});
const approvalRecord = (row: any) => {
//
const handleApprovalRecord = (row: any) => {
if (approvalRecordRef.value) {
processInstanceId.value = row.processInstanceId
approvalRecordRef.value.visible = true
console.log(processInstanceId.value)
console.log(approvalRecordRef.value.visible)
approvalRecordRef.value.init(row.processInstanceId);
}
}
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;