mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-12 01:00:09 +08:00
新增 `FlowActions` 审批操作按钮组件,统一处理我的申请、审批、管理员等不同场景下的操作逻辑。 重构 `ApprovalPanel` 组件,将操作按钮抽离为独立组件,简化原有代码结构。 移除了 `ApprovalDetails` 中冗余的 iframe 高度控制属性。 优化 `FlowPreview` 组件,调整 iframe 样式并增强主题切换时与子页面的通信逻辑。 新增 `ApprovalType` 类型定义文件,明确各审批场景类型。
47 lines
993 B
Vue
47 lines
993 B
Vue
<!-- 流程图预览组件 -->
|
|
|
|
<script setup lang="ts">
|
|
import { useAppConfig } from '@vben/hooks';
|
|
import { stringify } from '@vben/request';
|
|
import { useAccessStore } from '@vben/stores';
|
|
|
|
import { useWarmflowIframe } from './hook';
|
|
|
|
defineOptions({ name: 'FlowPreview' });
|
|
|
|
const props = defineProps<Props>();
|
|
|
|
interface Props {
|
|
/**
|
|
* 流程实例ID
|
|
*/
|
|
instanceId: string;
|
|
}
|
|
|
|
const { clientId } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
|
|
|
const accessStore = useAccessStore();
|
|
const params = {
|
|
Authorization: `Bearer ${accessStore.accessToken}`,
|
|
id: props.instanceId,
|
|
clientid: clientId,
|
|
type: 'FlowChart',
|
|
};
|
|
|
|
/**
|
|
* iframe地址
|
|
* 后端地址 + 固定flow地址拼接
|
|
*/
|
|
const url = `${import.meta.env.VITE_GLOB_API_URL}/warm-flow-ui/index.html?${stringify(params)}`;
|
|
|
|
const { iframeRef } = useWarmflowIframe();
|
|
</script>
|
|
|
|
<template>
|
|
<iframe
|
|
ref="iframeRef"
|
|
:src="url"
|
|
class="h-[600px] w-full rounded-[6px] border"
|
|
></iframe>
|
|
</template>
|