refactor: 重构
This commit is contained in:
parent
e78d367cea
commit
f0ded13df1
@ -0,0 +1,41 @@
|
|||||||
|
<!--
|
||||||
|
审批详情
|
||||||
|
约定${task.formPath}/frame 为内嵌表单 用于展示 需要在本地路由添加
|
||||||
|
apps/web-antd/src/router/routes/workflow-iframe.ts
|
||||||
|
-->
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type { FlowInfoResponse } from '#/api/workflow/instance/model';
|
||||||
|
import type { TaskInfo } from '#/api/workflow/task/model';
|
||||||
|
|
||||||
|
import { Divider, Skeleton } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import { ApprovalTimeline } from '.';
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'ApprovalDetails',
|
||||||
|
inheritAttrs: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
currentFlowInfo: FlowInfoResponse;
|
||||||
|
iframeHeight: number;
|
||||||
|
iframeLoaded: boolean;
|
||||||
|
task: TaskInfo;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 约定${task.formPath}/frame 为内嵌表单 用于展示 需要在本地路由添加 -->
|
||||||
|
<iframe
|
||||||
|
v-show="iframeLoaded"
|
||||||
|
:src="`${task.formPath}/iframe?readonly=true&id=${task.businessId}`"
|
||||||
|
:style="{ height: `${iframeHeight}px` }"
|
||||||
|
class="w-full"
|
||||||
|
></iframe>
|
||||||
|
<Skeleton v-show="!iframeLoaded" :paragraph="{ rows: 6 }" active />
|
||||||
|
<Divider />
|
||||||
|
<ApprovalTimeline :list="currentFlowInfo.list" />
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -1,3 +1,4 @@
|
|||||||
|
<!-- 该文件需要重构 但我没空 -->
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { User } from '#/api/core/user';
|
import type { User } from '#/api/core/user';
|
||||||
import type { FlowInfoResponse } from '#/api/workflow/instance/model';
|
import type { FlowInfoResponse } from '#/api/workflow/instance/model';
|
||||||
@ -20,12 +21,11 @@ import {
|
|||||||
MenuItem,
|
MenuItem,
|
||||||
message,
|
message,
|
||||||
Modal,
|
Modal,
|
||||||
Skeleton,
|
|
||||||
Space,
|
Space,
|
||||||
TabPane,
|
TabPane,
|
||||||
Tabs,
|
Tabs,
|
||||||
} from 'ant-design-vue';
|
} from 'ant-design-vue';
|
||||||
import { isEmpty, isObject } from 'lodash-es';
|
import { isObject } from 'lodash-es';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
cancelProcessApply,
|
cancelProcessApply,
|
||||||
@ -40,12 +40,8 @@ import {
|
|||||||
} from '#/api/workflow/task';
|
} from '#/api/workflow/task';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
|
|
||||||
import {
|
import { approvalModal, approvalRejectionModal, flowInterfereModal } from '.';
|
||||||
approvalModal,
|
import ApprovalDetails from './approval-details.vue';
|
||||||
approvalRejectionModal,
|
|
||||||
ApprovalTimeline,
|
|
||||||
flowInterfereModal,
|
|
||||||
} from '.';
|
|
||||||
import { approveWithReasonModal } from './helper';
|
import { approveWithReasonModal } from './helper';
|
||||||
import userSelectModal from './user-select-modal.vue';
|
import userSelectModal from './user-select-modal.vue';
|
||||||
|
|
||||||
@ -92,15 +88,10 @@ const buttonPermissions = computed(() => {
|
|||||||
|
|
||||||
// 是否显示 `其他` 按钮
|
// 是否显示 `其他` 按钮
|
||||||
const showButtonOther = computed(() => {
|
const showButtonOther = computed(() => {
|
||||||
if (isEmpty(buttonPermissions.value)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 加签 减 委托 转办
|
|
||||||
const moreCollections = new Set(['addSign', 'subSign', 'transfer', 'trust']);
|
const moreCollections = new Set(['addSign', 'subSign', 'transfer', 'trust']);
|
||||||
// 是否包含其中之一
|
return Object.keys(buttonPermissions.value).some(
|
||||||
return Object.keys(buttonPermissions.value).some((key) => {
|
(key) => moreCollections.has(key) && buttonPermissions.value[key],
|
||||||
return moreCollections.has(key) && buttonPermissions.value[key];
|
);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -443,18 +434,12 @@ async function handleCopy(text: string) {
|
|||||||
</div>
|
</div>
|
||||||
<Tabs v-if="currentFlowInfo" class="flex-1">
|
<Tabs v-if="currentFlowInfo" class="flex-1">
|
||||||
<TabPane key="1" tab="审批详情">
|
<TabPane key="1" tab="审批详情">
|
||||||
<div class="h-fulloverflow-y-auto">
|
<ApprovalDetails
|
||||||
<!-- 约定${task.formPath}/frame 为内嵌表单 用于展示 需要在本地路由添加 -->
|
:current-flow-info="currentFlowInfo"
|
||||||
<iframe
|
:iframe-loaded="iframeLoaded"
|
||||||
v-show="iframeLoaded"
|
:iframe-height="iframeHeight"
|
||||||
:src="`${task.formPath}/iframe?readonly=true&id=${task.businessId}`"
|
:task="task"
|
||||||
:style="{ height: `${iframeHeight}px` }"
|
/>
|
||||||
class="w-full"
|
|
||||||
></iframe>
|
|
||||||
<Skeleton v-show="!iframeLoaded" :paragraph="{ rows: 6 }" active />
|
|
||||||
<Divider />
|
|
||||||
<ApprovalTimeline :list="currentFlowInfo.list" />
|
|
||||||
</div>
|
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane key="2" tab="审批流程图">
|
<TabPane key="2" tab="审批流程图">
|
||||||
<img
|
<img
|
||||||
|
Loading…
Reference in New Issue
Block a user