feat(notice): 接入流程进度嵌入页(守卫端点 + Drawer iframe)
This commit is contained in:
@@ -127,6 +127,10 @@ class NoticeApi {
|
||||
flowWithdraw(serid: number) {
|
||||
return postForm<void>(`${NOTICE}/flow/Withdraw`, { serid });
|
||||
}
|
||||
/** 办件进度嵌入页地址(Drawer iframe 直嵌;pageUrl 含短时 token 现取现发,勿缓存复用) */
|
||||
flowEmbed(serid: number) {
|
||||
return get<{ pageUrl: string }>(`${NOTICE}/flow/Embed`, { serid });
|
||||
}
|
||||
/** 应用级流程绑定(应用设置 > 流程绑定;发通知页据此判断「提交审核」还是「发送」) */
|
||||
getFlowBinding() {
|
||||
return get<FlowBindingVo>(`${NOTICE}/flow/Binding`);
|
||||
|
||||
@@ -90,6 +90,24 @@ function onDiagramError() {
|
||||
diagramVisible.value = false;
|
||||
Message.error("流程图加载失败(可能已过期,请刷新页面重试)");
|
||||
}
|
||||
|
||||
/* 办件进度嵌入页(iframe 免签嵌入 flow-center 统一进度页):每次打开现取 pageUrl——
|
||||
* token 10 分钟短时效,不缓存、不落 localStorage 复用;嵌入页内部自己滚动 */
|
||||
const embedVisible = ref(false);
|
||||
const embedPageUrl = ref("");
|
||||
async function openFlowEmbed() {
|
||||
if (!detail.value?.flowInstanceId) return;
|
||||
embedVisible.value = true;
|
||||
embedPageUrl.value = "";
|
||||
try {
|
||||
const res = await noticeApi.flowEmbed(serid.value).send();
|
||||
embedPageUrl.value = res?.pageUrl || "";
|
||||
} catch (e: any) {
|
||||
embedVisible.value = false;
|
||||
Message.error(e?.msg || e?.message || "嵌入页地址获取失败");
|
||||
}
|
||||
}
|
||||
|
||||
const readGroups = ref<ReadGroup[]>([]);
|
||||
const showRead = ref(false);
|
||||
const prevId = ref(0);
|
||||
@@ -265,6 +283,13 @@ function openPreview(item: { name?: string; filename?: string; fileid?: number;
|
||||
<span v-if="flowTrace.currentNodes" class="flow-nodes">当前节点:{{ flowTrace.currentNodes }}</span>
|
||||
<div class="flow-ops">
|
||||
<Button v-if="detail.flowGuid" size="small" @click="openFlowDiagram">查看流程图</Button>
|
||||
<Button
|
||||
v-if="detail.flowInstanceId"
|
||||
size="small"
|
||||
style="margin-left: 8px"
|
||||
@click="openFlowEmbed"
|
||||
>审批进度</Button
|
||||
>
|
||||
<Button
|
||||
v-if="detail.flowInstanceId && flowTrace.auditStatus === 10"
|
||||
size="small"
|
||||
@@ -324,6 +349,13 @@ function openPreview(item: { name?: string; filename?: string; fileid?: number;
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!-- 办件进度嵌入页(Drawer 内 iframe 撑满,嵌入页内部滚动;token 每次打开现取) -->
|
||||
<Drawer v-model="embedVisible" title="审批进度" :width="860" :transfer="false" :styles="{ body: { padding: '0' } }">
|
||||
<div class="embed-frame-wrap">
|
||||
<iframe v-if="embedPageUrl" :src="embedPageUrl" title="办件进度"></iframe>
|
||||
</div>
|
||||
</Drawer>
|
||||
|
||||
<div v-if="viewType !== 0" class="meta">
|
||||
<span>发文单位:{{ detail.DeptName || "—" }}</span>
|
||||
<span>发布人:{{ detail.TeaName || "—" }}</span>
|
||||
@@ -480,6 +512,16 @@ function openPreview(item: { name?: string; filename?: string; fileid?: number;
|
||||
.diagram-wrap img {
|
||||
max-width: 100%;
|
||||
}
|
||||
/* 嵌入页 iframe 撑满 Drawer body(body padding 已由 :styles 置 0),嵌入页内部滚动 */
|
||||
.embed-frame-wrap {
|
||||
height: 100%;
|
||||
}
|
||||
.embed-frame-wrap iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
.meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
Reference in New Issue
Block a user