feat: 归档L03与L09审批发布能力
- 新增统一审批中心与审批管理页面,支持流程配置、审批详情与角色/用户审批对象 - 接入聊天助手、知识库、工作流的发布与删除审批,并补齐发布态校验与快照展示
This commit is contained in:
@@ -57,9 +57,11 @@
|
||||
let flowRootEl = $state<HTMLDivElement | null>(null);
|
||||
let inlineNodePickerEl = $state<HTMLDivElement | null>(null);
|
||||
let connectStartPoint = $state<{ x: number; y: number } | null>(null);
|
||||
let canvasLocked = $state(false);
|
||||
const asString = (value: unknown) => (value == null ? '' : String(value));
|
||||
const options = getOptions();
|
||||
const readonly = options.readonly === true;
|
||||
let canvasLocked = $state(readonly);
|
||||
const hideBottomDock = options.hideBottomDock === true;
|
||||
const availableNodes = getAvailableNodes(options);
|
||||
const onRunTest = options.onRunTest;
|
||||
|
||||
@@ -567,6 +569,9 @@
|
||||
};
|
||||
|
||||
function handleGlobalPointerDown(event: PointerEvent) {
|
||||
if (readonly) {
|
||||
return;
|
||||
}
|
||||
if (!nodePickerVisible || !inlineNodePickerEl) {
|
||||
return;
|
||||
}
|
||||
@@ -579,15 +584,19 @@
|
||||
|
||||
onMount(() => {
|
||||
store.updateEdges((edges) => edges.map((edge) => ensureEdgeVisualDefaults(edge)));
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
window.addEventListener('paste', handleGlobalPaste);
|
||||
window.addEventListener('pointerdown', handleGlobalPointerDown);
|
||||
if (!readonly) {
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
window.addEventListener('paste', handleGlobalPaste);
|
||||
window.addEventListener('pointerdown', handleGlobalPointerDown);
|
||||
}
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
window.removeEventListener('keydown', handleKeyDown);
|
||||
window.removeEventListener('paste', handleGlobalPaste);
|
||||
window.removeEventListener('pointerdown', handleGlobalPointerDown);
|
||||
if (!readonly) {
|
||||
window.removeEventListener('keydown', handleKeyDown);
|
||||
window.removeEventListener('paste', handleGlobalPaste);
|
||||
window.removeEventListener('pointerdown', handleGlobalPointerDown);
|
||||
}
|
||||
});
|
||||
|
||||
const customNodeTypes = {
|
||||
@@ -630,24 +639,30 @@
|
||||
nodesDraggable={!canvasLocked}
|
||||
nodesConnectable={!canvasLocked}
|
||||
elementsSelectable={!canvasLocked}
|
||||
panOnDrag={!canvasLocked}
|
||||
zoomOnScroll={!canvasLocked}
|
||||
zoomOnDoubleClick={!canvasLocked}
|
||||
ondrop={onDrop}
|
||||
ondragover={onDragOver}
|
||||
panOnDrag={readonly ? true : !canvasLocked}
|
||||
zoomOnScroll={readonly ? true : !canvasLocked}
|
||||
zoomOnDoubleClick={readonly ? true : !canvasLocked}
|
||||
ondrop={readonly ? undefined : onDrop}
|
||||
ondragover={readonly ? undefined : onDragOver}
|
||||
isValidConnection={isValidConnection}
|
||||
onconnectend={onconnectend}
|
||||
onconnectstart={onconnectstart}
|
||||
onconnect={onconnect}
|
||||
onconnectend={readonly ? undefined : onconnectend}
|
||||
onconnectstart={readonly ? undefined : onconnectstart}
|
||||
onconnect={readonly ? undefined : onconnect}
|
||||
connectionRadius={50}
|
||||
connectionLineComponent={FlowConnectionLine}
|
||||
onedgeclick={(e) => {
|
||||
if (readonly) {
|
||||
return;
|
||||
}
|
||||
showEdgePanel = true;
|
||||
currentEdge = e.edge;
|
||||
}}
|
||||
onbeforeconnect={(edge: any) => normalizeEdgeBeforeConnect(edge)}
|
||||
ondelete={onDelete}
|
||||
ondelete={readonly ? undefined : onDelete}
|
||||
onclick={(e) => {
|
||||
if (readonly) {
|
||||
return;
|
||||
}
|
||||
const el = e.target as HTMLElement;
|
||||
if (el.classList.contains("svelte-flow__edge-interaction")
|
||||
|| el.classList.contains('panel-content')
|
||||
@@ -750,6 +765,7 @@
|
||||
<NodePicker nodes={availableNodes} onSelect={handlePickerSelectNode} />
|
||||
</div>
|
||||
{/if}
|
||||
{#if !hideBottomDock}
|
||||
<div class="tf-bottom-dock">
|
||||
<div class="tf-unified-bar">
|
||||
<!-- 缩放百分比选择器 -->
|
||||
@@ -818,6 +834,7 @@
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user