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> <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>
<div> <el-image :src="src" style="font-size: 20px; margin: 50px;">
<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> </el-image>
</div> </div>
</div>
</el-dialog> </el-dialog>
</template> </template>
<script > <script >
const baseURL = import.meta.env.VITE_APP_BASE_API; import { getHistoryProcessImage } from '@/api/workflow/processInstance';
import { getToken } from '@/utils/auth';
export default { export default {
props: {
processInstanceId: String
},
data() { data() {
return { return {
visible: false src:"",
visible:false
}; };
}, },
computed: {
src() {
return baseURL+`/workflow/processInstance/getHistoryProcessImage${this.processInstanceId}?Authorization=Bearer ${getToken}`
}
},
methods: { methods: {
init(processInstanceId) {
this.visible = true
this.src = getHistoryProcessImage(processInstanceId)
}
} }
}; };
</script> </script>

View File

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