@sim-design/training 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +481 -15
- package/dist/{ArrowLeftOutlined-CiSQq3bL.js → ArrowLeftOutlined-BxA84GXs.js} +1 -1
- package/dist/ArrowLeftOutlined-D785XjyB.js +12 -0
- package/dist/{AssessmentPlugin-Bx4VrBdV.js → AssessmentPlugin-D_iesmyg.js} +7 -7
- package/dist/AssessmentPlugin-zRr-IsdA.js +607 -0
- package/dist/CaseAnalysisPlugin-CXuQpkPd.js +2196 -0
- package/dist/CaseAnalysisPlugin-DytlXsRD.js +2196 -0
- package/dist/CaseDetailContent-DT5nCtRT.js +28613 -0
- package/dist/CaseDetailContent-Y7Q430MG.js +28595 -0
- package/dist/{CharacterDialoguePanel-Bvdab3qj.js → CharacterDialoguePanel-CdtUl-Sv.js} +178 -139
- package/dist/CharacterDialoguePanel-D_4YNFZv.js +815 -0
- package/dist/{CheckCircleFilled-Byo8CDfW.js → CheckCircleFilled-CnslIY7j.js} +1 -1
- package/dist/CheckCircleFilled-NvZaC2sk.js +12 -0
- package/dist/DecisionMakingPlugin-B_KQUFzW.js +1385 -0
- package/dist/DecisionMakingPlugin-ILLGek3S.js +1385 -0
- package/dist/{DecisionSelectPlugin-DtQ2KV34.js → DecisionSelectPlugin-BGQiHGBK.js} +20 -11
- package/dist/DecisionSelectPlugin-Bqmh6XGh.js +872 -0
- package/dist/{DecisionShared-Dh9oeQFT.js → DecisionShared-BHq1lEqt.js} +2 -2
- package/dist/DecisionShared-Be-zKZLT.js +65 -0
- package/dist/DeleteOutlined-BvMjU7m5.js +12 -0
- package/dist/DeleteOutlined-Dqy6M2LH.js +12 -0
- package/dist/{CustomLayoutRenderer--rnQrqQ2.js → DialogueFormPlugin-BpCeFadt.js} +22724 -21631
- package/dist/DialogueFormPlugin-CXlbxX-z.js +123617 -0
- package/dist/DialoguePlugin-CO7Nzv0K.js +596 -0
- package/dist/DialoguePlugin-DDNdsylz.js +596 -0
- package/dist/DocumentReviewPlugin-2CnKQwVG.js +1967 -0
- package/dist/DocumentReviewPlugin-qYYrnjvE.js +1967 -0
- package/dist/{EyeOutlined-XvOAKlLs.js → EyeOutlined-BrKCNjui.js} +1 -1
- package/dist/EyeOutlined-CW0tYV0f.js +12 -0
- package/dist/FormFillingPlugin-C3h8ySOZ.js +969 -0
- package/dist/FormFillingPlugin-CPmd76Qr.js +969 -0
- package/dist/HolderOutlined-CH0tShWu.js +12 -0
- package/dist/HolderOutlined-Dm6TBtqf.js +12 -0
- package/dist/ModelEditor-BjEbFloQ.js +11753 -0
- package/dist/ModelEditor-CwR67DFQ.js +11753 -0
- package/dist/{ProcessOperationPlugin-IijngDlX.js → ProcessOperationPlugin-1Lz431aC.js} +12 -12
- package/dist/ProcessOperationPlugin-BkmdG3ch.js +88 -0
- package/dist/QAPlugin-0C4kpq3J.js +172 -0
- package/dist/QAPlugin-UC8uywcg.js +172 -0
- package/dist/{ReloadOutlined-Daor2m11.js → ReloadOutlined-BZ92nlYF.js} +1 -1
- package/dist/ReloadOutlined-CYoPOwLl.js +12 -0
- package/dist/{SettingOutlined-CLEOgXB-.js → SettingOutlined-F466s0Ti.js} +33 -65
- package/dist/SettingOutlined-c2hikCfN.js +60 -0
- package/dist/StarFilled-Bilmj6UK.js +28 -0
- package/dist/StarFilled-CtH30fL0.js +28 -0
- package/dist/StrategyLabPlugin-CvO07sXV.js +12445 -0
- package/dist/StrategyLabPlugin-DUqZYctQ.js +12445 -0
- package/dist/ThunderboltOutlined-BpmoCKdV.js +28 -0
- package/dist/ThunderboltOutlined-DDQFi5Cv.js +28 -0
- package/dist/TrainingModelContainer-DqCsdC7C.js +11241 -0
- package/dist/TrainingModelContainer-yi8W6KFl.js +11241 -0
- package/dist/{UndoOutlined-ChUQYUul.js → UndoOutlined-6JZVzmdX.js} +26 -42
- package/dist/UndoOutlined-Dw6_9_OL.js +68 -0
- package/dist/{WarningFilled-1Rc4hr0C.js → WarningFilled-Cy1tvuQy.js} +1 -1
- package/dist/WarningFilled-lkr453eh.js +12 -0
- package/dist/{adapters-D1FFZFoA.js → adapters-BbCnXSYo.js} +2 -2
- package/dist/{analysisTools-CXyOvSZT.js → analysisTools-Cp5-3DaU.js} +59 -12
- package/dist/creator.js +4 -2
- package/dist/designTokens-walF_QkZ.js +23 -0
- package/dist/images/healthcare/bg.jpg +0 -0
- package/dist/{index-CYjdXPgc.js → index-C71iHgSs.js} +2640 -2722
- package/dist/{index-XuBVjlmu.js → index-CBvqcbIU.js} +7214 -7643
- package/dist/index-D94YNWTb.js +433 -0
- package/dist/index-DSYmOXnQ.js +6486 -0
- package/dist/index-fP97rKeQ.js +433 -0
- package/dist/index.js +8 -6
- package/dist/judgement-xTGXlDcn.js +29 -0
- package/dist/runtime.js +1 -1
- package/dist/sortable.esm-bm_c5vmI.js +3307 -0
- package/dist/types.js +1 -1
- package/dist/useDialogueLogic-D1lkUKUZ.js +576 -0
- package/dist/useDialogueLogic-vOJ9XRNP.js +576 -0
- package/dist-types/client/src/admin/CaseDataEditor.d.ts +20 -0
- package/dist-types/client/src/admin/CaseEditor.d.ts +19 -0
- package/dist-types/client/src/admin/DialogueFormCheckRulesEditor.d.ts +11 -0
- package/dist-types/client/src/admin/DialogueFormInitDataEditor.d.ts +31 -0
- package/dist-types/client/src/admin/InitDataEditors.d.ts +7 -0
- package/dist-types/client/src/admin/ModelEditor.d.ts +11 -0
- package/dist-types/client/src/admin/ModelPreview.d.ts +13 -0
- package/dist-types/client/src/admin/OptionSelector.d.ts +32 -0
- package/dist-types/client/src/admin/StageStepEditor.d.ts +20 -0
- package/dist-types/client/src/admin/StepAnswerKeyEditor.d.ts +19 -0
- package/dist-types/client/src/admin/StepByStepCreator.d.ts +27 -0
- package/dist-types/client/src/admin/components/AbilityMapEditor.d.ts +12 -0
- package/dist-types/client/src/admin/components/CasePreview.d.ts +8 -0
- package/dist-types/client/src/admin/components/StepAbilitySelector.d.ts +9 -0
- package/dist-types/client/src/admin/constants/creatorConstants.d.ts +39 -0
- package/dist-types/client/src/admin/editors/CaseAnalysisEditor.d.ts +11 -0
- package/dist-types/client/src/admin/editors/DecisionMakingEditor.d.ts +7 -0
- package/dist-types/client/src/admin/editors/DialogueEditor.d.ts +12 -0
- package/dist-types/client/src/admin/editors/DocumentReviewEditor.d.ts +7 -0
- package/dist-types/client/src/admin/editors/DocumentReviewRuntimeRulesEditor.d.ts +15 -0
- package/dist-types/client/src/admin/editors/FormFillingEditor.d.ts +33 -0
- package/dist-types/client/src/admin/editors/ModelUIConfigEditor.d.ts +5 -0
- package/dist-types/client/src/admin/editors/QAEditor.d.ts +6 -0
- package/dist-types/client/src/admin/editors/RouterEditors.d.ts +18 -0
- package/dist-types/client/src/admin/editors/StepBriefingEditor.d.ts +14 -0
- package/dist-types/client/src/admin/editors/StrategyLabEditor.d.ts +24 -0
- package/dist-types/client/src/admin/editors/decisionEditorParts.d.ts +18 -0
- package/dist-types/client/src/admin/editors/index.d.ts +8 -0
- package/dist-types/client/src/admin/editors/shared.d.ts +17 -0
- package/dist-types/client/src/admin/hooks/useStep1Intent.d.ts +16 -0
- package/dist-types/client/src/admin/hooks/useStep2Outline.d.ts +41 -0
- package/dist-types/client/src/admin/hooks/useStep3Details.d.ts +123 -0
- package/dist-types/client/src/admin/hooks/useStep4Cases.d.ts +48 -0
- package/dist-types/client/src/admin/hooks/useStep5Validation.d.ts +16 -0
- package/dist-types/client/src/admin/landingValidation.d.ts +74 -0
- package/dist-types/client/src/admin/schemaFieldUtils.d.ts +55 -0
- package/dist-types/client/src/admin/services.d.ts +461 -0
- package/dist-types/client/src/admin/shared-editors.d.ts +31 -0
- package/dist-types/client/src/admin/types/creatorArtifacts.d.ts +140 -0
- package/dist-types/client/src/components/AbilityMapView.d.ts +15 -0
- package/dist-types/client/src/components/CaseDetail/CaseDetailContent.d.ts +12 -0
- package/dist-types/client/src/components/ConversationalDataCollector/IntentConfirmPanel.d.ts +20 -0
- package/dist-types/client/src/components/ConversationalDataCollector/index.d.ts +7 -0
- package/dist-types/client/src/components/ConversationalDataCollector/intentState.d.ts +24 -0
- package/dist-types/client/src/components/ConversationalDataCollector/types.d.ts +95 -0
- package/dist-types/client/src/components/ConversationalDataCollector/utils.d.ts +62 -0
- package/dist-types/client/src/components/CustomLayoutRenderer.d.ts +8 -0
- package/dist-types/client/src/components/MarkdownRenderer.d.ts +15 -0
- package/dist-types/client/src/components/StrategyLabScene/VisualInputComponents.d.ts +85 -0
- package/dist-types/client/src/components/StrategyLabScene/components/AdversarialView.d.ts +18 -0
- package/dist-types/client/src/components/StrategyLabScene/components/BottomBar.d.ts +22 -0
- package/dist-types/client/src/components/StrategyLabScene/components/CharacterCard.d.ts +14 -0
- package/dist-types/client/src/components/StrategyLabScene/components/CharacterDialoguePanel.d.ts +32 -0
- package/dist-types/client/src/components/StrategyLabScene/components/CollaborativeView.d.ts +20 -0
- package/dist-types/client/src/components/StrategyLabScene/components/ComparisonView.d.ts +16 -0
- package/dist-types/client/src/components/StrategyLabScene/components/DecisionInput.d.ts +27 -0
- package/dist-types/client/src/components/StrategyLabScene/components/DecisionSwitcher.d.ts +14 -0
- package/dist-types/client/src/components/StrategyLabScene/components/EvaluationReport.d.ts +13 -0
- package/dist-types/client/src/components/StrategyLabScene/components/NodeChainPanels.d.ts +32 -0
- package/dist-types/client/src/components/StrategyLabScene/components/ProgressSteps.d.ts +15 -0
- package/dist-types/client/src/components/StrategyLabScene/components/SandboxView.d.ts +19 -0
- package/dist-types/client/src/components/StrategyLabScene/components/ScenarioPanel.d.ts +17 -0
- package/dist-types/client/src/components/StrategyLabScene/components/SimulationAnimation.d.ts +13 -0
- package/dist-types/client/src/components/StrategyLabScene/components/SimulationResult.d.ts +15 -0
- package/dist-types/client/src/components/StrategyLabScene/components/StressTestView.d.ts +22 -0
- package/dist-types/client/src/components/StrategyLabScene/themeMatching.d.ts +21 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/education.d.ts +45 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/healthcare.d.ts +7 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/index.d.ts +22 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/professional.d.ts +7 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/technology.d.ts +7 -0
- package/dist-types/client/src/components/StrategyLabScene/types.d.ts +82 -0
- package/dist-types/client/src/components/StrategyLabScene/views/UnifiedStrategyLabView.d.ts +72 -0
- package/dist-types/client/src/components/TrainingEngine/BriefingQAChat.d.ts +19 -0
- package/dist-types/client/src/components/TrainingEngine/CaseInfoModal.d.ts +12 -0
- package/dist-types/client/src/components/TrainingEngine/CaseSelector.d.ts +15 -0
- package/dist-types/client/src/components/TrainingEngine/ClassicView.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/DashboardHomePage.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/EnhancedStudentProfilePanel.d.ts +9 -0
- package/dist-types/client/src/components/TrainingEngine/EvaluationPanel.d.ts +8 -0
- package/dist-types/client/src/components/TrainingEngine/GlobalQAPanel.d.ts +34 -0
- package/dist-types/client/src/components/TrainingEngine/GuidanceHistoryDrawer.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/GuidancePanel.d.ts +3 -0
- package/dist-types/client/src/components/TrainingEngine/ImmersiveGameView.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/PluginRenderer.d.ts +15 -0
- package/dist-types/client/src/components/TrainingEngine/ProgressTracker.d.ts +3 -0
- package/dist-types/client/src/components/TrainingEngine/StageAssessingOverlay.d.ts +17 -0
- package/dist-types/client/src/components/TrainingEngine/StageAssessmentPanel.d.ts +10 -0
- package/dist-types/client/src/components/TrainingEngine/StepExecutor.d.ts +20 -0
- package/dist-types/client/src/components/TrainingEngine/StepNodeMap.d.ts +15 -0
- package/dist-types/client/src/components/TrainingEngine/StudentProfilePanel.d.ts +6 -0
- package/dist-types/client/src/components/TrainingEngine/ThemeContext.d.ts +8 -0
- package/dist-types/client/src/components/TrainingEngine/TrainingMaterialsSidebar.d.ts +21 -0
- package/dist-types/client/src/components/TrainingEngine/TrainingModelContainer.d.ts +42 -0
- package/dist-types/client/src/components/TrainingEngine/ViewProps.d.ts +37 -0
- package/dist-types/client/src/components/TrainingEngine/profileDataSelectors.d.ts +23 -0
- package/dist-types/client/src/components/TrainingEngine/stepInitData.d.ts +42 -0
- package/dist-types/client/src/components/TrainingEngine/targetAbilityUtils.d.ts +11 -0
- package/dist-types/client/src/components/VisualizationRenderer/ChartRenderer.d.ts +12 -0
- package/dist-types/client/src/components/VisualizationRenderer/types.d.ts +41 -0
- package/dist-types/client/src/config/appConfig.d.ts +15 -0
- package/dist-types/client/src/configs/agentConfig.d.ts +66 -0
- package/dist-types/client/src/configs/intentDiscoveryConfig.d.ts +22 -0
- package/dist-types/client/src/data/mockTrainingModel.d.ts +10 -0
- package/dist-types/client/src/hooks/useAIService.d.ts +17 -0
- package/dist-types/client/src/hooks/useDialogueLogic.d.ts +53 -0
- package/dist-types/client/src/hooks/useFormFillingLogic.d.ts +26 -0
- package/dist-types/client/src/hooks/useFormRealtimeGuidance.d.ts +45 -0
- package/dist-types/client/src/hooks/useRealtimeGuidance.d.ts +66 -0
- package/dist-types/client/src/hooks/useStageAssessment.d.ts +8 -0
- package/dist-types/client/src/hooks/useStepExecution.d.ts +14 -0
- package/dist-types/client/src/hooks/useTrainingModel.d.ts +30 -0
- package/dist-types/client/src/lib/creator.d.ts +1 -0
- package/dist-types/client/src/lib/index.d.ts +1 -0
- package/dist-types/client/src/lib/types.d.ts +113 -22
- package/dist-types/client/src/plugins/AssessmentPlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/CaseAnalysisPlugin.d.ts +9 -0
- package/dist-types/client/src/plugins/CaseAnalysisPluginView.d.ts +26 -0
- package/dist-types/client/src/plugins/DecisionSelectPlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/DialogueFormPlugin.d.ts +9 -0
- package/dist-types/client/src/plugins/DialogueFormPluginView.d.ts +37 -0
- package/dist-types/client/src/plugins/DialoguePlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/DialoguePluginView.d.ts +44 -0
- package/dist-types/client/src/plugins/DocumentReview/DocumentCard.d.ts +47 -0
- package/dist-types/client/src/plugins/DocumentReview/LayoutComponents.d.ts +47 -0
- package/dist-types/client/src/plugins/DocumentReview/MarkListPanel.d.ts +51 -0
- package/dist-types/client/src/plugins/DocumentReview/MarkModal.d.ts +37 -0
- package/dist-types/client/src/plugins/DocumentReview/ResultPanel.d.ts +32 -0
- package/dist-types/client/src/plugins/DocumentReview/Toolbar.d.ts +31 -0
- package/dist-types/client/src/plugins/DocumentReview/designTokens.d.ts +76 -0
- package/dist-types/client/src/plugins/DocumentReviewPlugin.d.ts +14 -0
- package/dist-types/client/src/plugins/ProcessOperationPlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/QAPlugin.d.ts +9 -0
- package/dist-types/client/src/plugins/StrategyLabPlugin.d.ts +7 -0
- package/dist-types/client/src/plugins/decision-making/DecisionMakingPlugin.d.ts +4 -0
- package/dist-types/client/src/plugins/decision-making/DecisionWorkspace.d.ts +23 -0
- package/dist-types/client/src/plugins/decision-making/MaterialsPanel.d.ts +18 -0
- package/dist-types/client/src/plugins/decision-making/logic.d.ts +46 -0
- package/dist-types/client/src/plugins/decision-making/scoring.d.ts +79 -0
- package/dist-types/client/src/plugins/decision-making/styles.d.ts +743 -0
- package/dist-types/client/src/plugins/decision-making/types.d.ts +179 -0
- package/dist-types/client/src/plugins/form-filling/DocumentFormLayout.d.ts +22 -0
- package/dist-types/client/src/plugins/form-filling/FormAssistPanel.d.ts +20 -0
- package/dist-types/client/src/plugins/form-filling/FormFillingPlugin.d.ts +15 -0
- package/dist-types/client/src/plugins/form-filling/forms.d.ts +28 -0
- package/dist-types/client/src/plugins/form-filling/scoring.d.ts +86 -0
- package/dist-types/client/src/plugins/form-filling/useFormFilling.d.ts +42 -0
- package/dist-types/client/src/plugins/form-filling/validationRules.d.ts +26 -0
- package/dist-types/client/src/plugins/shared/DecisionShared.d.ts +54 -0
- package/dist-types/client/src/plugins/shared/FrameworkWidget.d.ts +19 -0
- package/dist-types/client/src/plugins/shared/PluginFooter.d.ts +4 -0
- package/dist-types/client/src/plugins/shared/PluginHeader.d.ts +4 -0
- package/dist-types/client/src/plugins/shared/analysisTools.d.ts +30 -0
- package/dist-types/client/src/plugins/shared/disturbanceUtils.d.ts +5 -0
- package/dist-types/client/src/plugins/shared/index.d.ts +5 -0
- package/dist-types/client/src/plugins/shared/jsonRepair.d.ts +39 -0
- package/dist-types/client/src/plugins/shared/judgement.d.ts +46 -0
- package/dist-types/client/src/plugins/shared/nodeChain.d.ts +15 -0
- package/dist-types/client/src/plugins/shared/renderFieldGrid.d.ts +16 -0
- package/dist-types/client/src/plugins/shared/reportBlocks.d.ts +33 -0
- package/dist-types/client/src/plugins/shared/reportEvaluation.d.ts +30 -0
- package/dist-types/client/src/plugins/shared/reportExport.d.ts +12 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/BlockPropertiesPanel.d.ts +9 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/BlockToolbox.d.ts +11 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/ReportWorkbench.d.ts +20 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/SortableBlock.d.ts +15 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/factory.d.ts +14 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/outlineDraft.d.ts +7 -0
- package/dist-types/client/src/plugins/shared/simulationEngine.d.ts +112 -0
- package/dist-types/client/src/plugins/shared/simulationModes.d.ts +21 -0
- package/dist-types/client/src/plugins/shared/themes.d.ts +5 -0
- package/dist-types/client/src/plugins/shared/types.d.ts +1247 -0
- package/dist-types/client/src/services/AICommandHandler.d.ts +68 -0
- package/dist-types/client/src/services/cozeApiClient.d.ts +44 -0
- package/dist-types/client/src/services/mockApi.d.ts +48 -0
- package/dist-types/client/src/services/storageService.d.ts +88 -0
- package/dist-types/client/src/stores/abilityStore.d.ts +33 -0
- package/dist-types/client/src/stores/dialogueStore.d.ts +30 -0
- package/dist-types/client/src/stores/formRegistryStore.d.ts +45 -0
- package/dist-types/client/src/stores/guidanceStore.d.ts +17 -0
- package/dist-types/client/src/stores/stepEvidenceStore.d.ts +14 -0
- package/dist-types/client/src/stores/strategyLabStore.d.ts +46 -0
- package/dist-types/client/src/stores/trainingStore.d.ts +84 -0
- package/dist-types/client/src/types/ai-commands.d.ts +144 -0
- package/dist-types/client/src/types.d.ts +17 -0
- package/dist-types/client/src/utils/abilityMapGenerator.d.ts +27 -0
- package/dist-types/client/src/utils/formUtils.d.ts +66 -0
- package/dist-types/client/src/utils/rule-engine.d.ts +36 -0
- package/dist-types/shared/types/index.d.ts +592 -0
- package/package.json +5 -3
- package/dist/CaseAnalysisPlugin-CQvF9_zr.js +0 -416
- package/dist/DialogueFormPlugin-C9ssnVMr.js +0 -959
- package/dist/DialoguePlugin-DU00QpmQ.js +0 -416
- package/dist/DocumentReviewPlugin-HNOZY1T4.js +0 -977
- package/dist/FormFillingPlugin-DURWsioi.js +0 -445
- package/dist/ModelEditor-BPJsPR0S.js +0 -8264
- package/dist/PluginHeader-B-GESJmT.js +0 -87
- package/dist/QAPlugin-Bh_UjK1N.js +0 -184
- package/dist/RadarChart-C5ZM0kWt.js +0 -24963
- package/dist/StrategyLabPlugin-DGeZsr_7.js +0 -14361
- package/dist/ThunderboltOutlined-nH_FO_4A.js +0 -44
- package/dist/ToolOutlined-DtuNJDB2.js +0 -28
- package/dist/TrainingModelContainer-DpW-uB8O.js +0 -11883
- package/dist/WarningOutlined-5g1d66hO.js +0 -164
- package/dist/judgement-D_9i7x9S.js +0 -20
- package/dist/useDialogueLogic-IHELcN3X.js +0 -368
|
@@ -0,0 +1,2196 @@
|
|
|
1
|
+
import { j as t, i as Ee, a as ze, r as de, g as Ae, c as Re } from "./CaseDetailContent-Y7Q430MG.js";
|
|
2
|
+
import { useRef as ue, useEffect as he, useState as I, useMemo as ce, useCallback as se } from "react";
|
|
3
|
+
import { Button as q, Space as ie, Modal as xe, Spin as ke, Tag as ne, Alert as Ie, Collapse as Te, Card as oe, message as J } from "antd";
|
|
4
|
+
import { r as Ce, f as ae, a as le, p as De } from "./TrainingModelContainer-DqCsdC7C.js";
|
|
5
|
+
import { a as We } from "./judgement-xTGXlDcn.js";
|
|
6
|
+
import { b as P } from "./analysisTools-Cp5-3DaU.js";
|
|
7
|
+
import { u as Le, C as qe, a as Me, b as Oe, D as Pe, c as Ne, S as He, v as Ve, d as Ke, P as Ue } from "./sortable.esm-bm_c5vmI.js";
|
|
8
|
+
import { i as _e } from "./index-CBvqcbIU.js";
|
|
9
|
+
import { R as Ye } from "./HolderOutlined-CH0tShWu.js";
|
|
10
|
+
import { R as we } from "./DeleteOutlined-Dqy6M2LH.js";
|
|
11
|
+
import { R as Ze } from "./EyeOutlined-CW0tYV0f.js";
|
|
12
|
+
import { R as Ge, a as Je, b as me } from "./StarFilled-Bilmj6UK.js";
|
|
13
|
+
import { R as Xe } from "./ReloadOutlined-BZ92nlYF.js";
|
|
14
|
+
let ge = 0;
|
|
15
|
+
function Qe() {
|
|
16
|
+
return ge += 1, `blk_${Date.now().toString(36)}_${ge}`;
|
|
17
|
+
}
|
|
18
|
+
const et = () => ({
|
|
19
|
+
headers: ["对比项", "方案 A", "方案 B"],
|
|
20
|
+
rows: [
|
|
21
|
+
["指标一", "", ""],
|
|
22
|
+
["指标二", "", ""]
|
|
23
|
+
]
|
|
24
|
+
}), tt = () => ({
|
|
25
|
+
headers: ["评估项", "说明", "评分"],
|
|
26
|
+
rows: [
|
|
27
|
+
["维度一", "", "3"],
|
|
28
|
+
["维度二", "", "3"]
|
|
29
|
+
]
|
|
30
|
+
}), rt = () => ({
|
|
31
|
+
headers: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
|
|
32
|
+
rows: [["", "", "", "", "", "", ""]]
|
|
33
|
+
}), st = () => ({
|
|
34
|
+
labels: ["项 1", "项 2"],
|
|
35
|
+
series: [{ name: "系列 1", values: [0, 0] }]
|
|
36
|
+
});
|
|
37
|
+
function Q(e, r) {
|
|
38
|
+
const s = { id: Qe(), sectionId: r == null ? void 0 : r.sectionId, hint: r == null ? void 0 : r.hint };
|
|
39
|
+
switch (e) {
|
|
40
|
+
case "heading":
|
|
41
|
+
return { ...s, kind: "heading", level: 2, text: "" };
|
|
42
|
+
case "paragraph":
|
|
43
|
+
return { ...s, kind: "paragraph", text: "" };
|
|
44
|
+
case "quote":
|
|
45
|
+
return { ...s, kind: "quote", text: "" };
|
|
46
|
+
case "list": {
|
|
47
|
+
const i = (r == null ? void 0 : r.listVariant) || "unordered";
|
|
48
|
+
return {
|
|
49
|
+
...s,
|
|
50
|
+
kind: "list",
|
|
51
|
+
variant: i,
|
|
52
|
+
items: [""],
|
|
53
|
+
...i === "checklist" ? { checked: [!1] } : {}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
case "table": {
|
|
57
|
+
const i = (r == null ? void 0 : r.tableVariant) || "basic", n = i === "comparison" ? et() : i === "rating" ? tt() : i === "calendar" ? rt() : { headers: ["列 1", "列 2"], rows: [["", ""], ["", ""]] };
|
|
58
|
+
return {
|
|
59
|
+
...s,
|
|
60
|
+
kind: "table",
|
|
61
|
+
variant: i,
|
|
62
|
+
headers: n.headers,
|
|
63
|
+
rows: n.rows,
|
|
64
|
+
...i === "rating" ? { ratingColumn: n.headers.length - 1 } : {}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
case "chart":
|
|
68
|
+
return { ...s, kind: "chart", chartType: (r == null ? void 0 : r.chartType) || "bar", data: st() };
|
|
69
|
+
case "framework": {
|
|
70
|
+
const i = (r == null ? void 0 : r.toolKey) || "swot", n = P.find((o) => o.key === i), l = ((n == null ? void 0 : n.dimensions) || []).map((o) => ({ key: o.key, value: "" }));
|
|
71
|
+
return { ...s, kind: "framework", toolKey: i, cells: l };
|
|
72
|
+
}
|
|
73
|
+
case "divider":
|
|
74
|
+
return { ...s, kind: "divider" };
|
|
75
|
+
case "progress":
|
|
76
|
+
return { ...s, kind: "progress", items: [{ label: "进度项", percent: 60 }] };
|
|
77
|
+
case "cover":
|
|
78
|
+
return { ...s, kind: "cover", title: "", subtitle: "", meta: "" };
|
|
79
|
+
case "image":
|
|
80
|
+
return { ...s, kind: "image", url: "", caption: "" };
|
|
81
|
+
case "card":
|
|
82
|
+
return { ...s, kind: "card", title: "", body: "" };
|
|
83
|
+
case "button":
|
|
84
|
+
return { ...s, kind: "button", label: "按钮", href: "" };
|
|
85
|
+
default:
|
|
86
|
+
return { ...s, kind: "paragraph", text: "" };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function Se(e) {
|
|
90
|
+
var s, i;
|
|
91
|
+
if (!e || !((s = e.sections) != null && s.length)) return [];
|
|
92
|
+
const r = [];
|
|
93
|
+
if (e.reportTitle) {
|
|
94
|
+
const n = Q("heading", {});
|
|
95
|
+
n.kind === "heading" && (n.level = 1, n.text = e.reportTitle), r.push(n);
|
|
96
|
+
}
|
|
97
|
+
for (const n of e.sections) {
|
|
98
|
+
const l = Q("heading", { sectionId: n.id });
|
|
99
|
+
l.kind === "heading" && (l.level = 2, l.text = n.title), r.push(l), ((i = n.suggestedBlocks) != null && i.length ? n.suggestedBlocks : [{ component: "paragraph" }]).forEach((a, d) => {
|
|
100
|
+
r.push(
|
|
101
|
+
Q(a.component, {
|
|
102
|
+
toolKey: a.toolKey,
|
|
103
|
+
sectionId: n.id,
|
|
104
|
+
hint: a.note || (d === 0 ? n.hint : void 0)
|
|
105
|
+
})
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return r;
|
|
110
|
+
}
|
|
111
|
+
const it = /[一-龥a-zA-Z]/g;
|
|
112
|
+
function nt(e) {
|
|
113
|
+
return (e.match(it) || []).length;
|
|
114
|
+
}
|
|
115
|
+
function ee(e) {
|
|
116
|
+
var s, i, n, l;
|
|
117
|
+
const r = [];
|
|
118
|
+
for (const o of e)
|
|
119
|
+
switch (o.kind) {
|
|
120
|
+
case "heading":
|
|
121
|
+
r.push(`${"#".repeat(o.level)} ${o.text}`.trim());
|
|
122
|
+
break;
|
|
123
|
+
case "paragraph":
|
|
124
|
+
o.text.trim() && r.push(o.text);
|
|
125
|
+
break;
|
|
126
|
+
case "quote":
|
|
127
|
+
o.text.trim() && r.push(`> ${o.text}`);
|
|
128
|
+
break;
|
|
129
|
+
case "list": {
|
|
130
|
+
const a = o.variant === "ordered" || o.variant === "step";
|
|
131
|
+
o.items.map((c, u) => {
|
|
132
|
+
var p;
|
|
133
|
+
return { it: c, done: (p = o.checked) == null ? void 0 : p[u] };
|
|
134
|
+
}).filter((c) => c.it.trim()).forEach((c, u) => {
|
|
135
|
+
o.variant === "checklist" ? r.push(`- [${c.done ? "x" : " "}] ${c.it}`) : a ? r.push(`${u + 1}. ${c.it}`) : r.push(`- ${c.it}`);
|
|
136
|
+
});
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
case "table":
|
|
140
|
+
o.headers.length && (r.push(`| ${o.headers.join(" | ")} |`), r.push(`| ${o.headers.map(() => "---").join(" | ")} |`), o.rows.forEach((a) => r.push(`| ${a.join(" | ")} |`)));
|
|
141
|
+
break;
|
|
142
|
+
case "framework": {
|
|
143
|
+
const a = P.find((d) => d.key === o.toolKey);
|
|
144
|
+
r.push(`### ${o.title || (a == null ? void 0 : a.name) || o.toolKey}`), o.cells.forEach((d) => {
|
|
145
|
+
var u;
|
|
146
|
+
const c = ((u = a == null ? void 0 : a.dimensions.find((p) => p.key === d.key)) == null ? void 0 : u.label) || d.key;
|
|
147
|
+
r.push(`- ${c}:${d.value || "(未填写)"}`);
|
|
148
|
+
});
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
case "chart": {
|
|
152
|
+
const a = o.data.series.map((d) => `${d.name}: ${d.values.join(", ")}`).join(";");
|
|
153
|
+
r.push(`(图表·${o.chartType})分类:${o.data.labels.join("、")};数据:${a}`);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case "progress": {
|
|
157
|
+
const a = o.items.filter((d) => d.label.trim()).map((d) => `${d.label}:${d.percent}%`).join(";");
|
|
158
|
+
a && r.push(`(进度)${a}`);
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case "cover":
|
|
162
|
+
o.title.trim() && r.push(`# ${o.title}`), (s = o.subtitle) != null && s.trim() && r.push(o.subtitle), (i = o.meta) != null && i.trim() && r.push(o.meta);
|
|
163
|
+
break;
|
|
164
|
+
case "image":
|
|
165
|
+
((o.url || "").trim() || (o.caption || "").trim()) && r.push(``);
|
|
166
|
+
break;
|
|
167
|
+
case "card":
|
|
168
|
+
(n = o.title) != null && n.trim() && r.push(`**${o.title}**`), (l = o.body) != null && l.trim() && r.push(o.body);
|
|
169
|
+
break;
|
|
170
|
+
case "button":
|
|
171
|
+
o.label.trim() && r.push(`[${o.label}]`);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
return r.join(`
|
|
175
|
+
`).trim();
|
|
176
|
+
}
|
|
177
|
+
function fe(e) {
|
|
178
|
+
var r, s, i;
|
|
179
|
+
switch (e.kind) {
|
|
180
|
+
case "heading":
|
|
181
|
+
case "paragraph":
|
|
182
|
+
case "quote":
|
|
183
|
+
return !!e.text.trim();
|
|
184
|
+
case "list":
|
|
185
|
+
return e.items.some((n) => n.trim());
|
|
186
|
+
case "table":
|
|
187
|
+
return e.rows.some((n) => n.some((l) => l.trim()));
|
|
188
|
+
case "framework":
|
|
189
|
+
return e.cells.some((n) => n.value.trim());
|
|
190
|
+
case "chart":
|
|
191
|
+
return e.data.series.some((n) => n.values.some((l) => l !== 0));
|
|
192
|
+
case "progress":
|
|
193
|
+
return e.items.some((n) => n.label.trim());
|
|
194
|
+
case "cover":
|
|
195
|
+
return !!(e.title.trim() || (r = e.subtitle) != null && r.trim());
|
|
196
|
+
case "image":
|
|
197
|
+
return !!((e.url || "").trim() || (e.caption || "").trim());
|
|
198
|
+
case "card":
|
|
199
|
+
return !!((s = e.title) != null && s.trim() || (i = e.body) != null && i.trim());
|
|
200
|
+
case "button":
|
|
201
|
+
return !!e.label.trim();
|
|
202
|
+
case "divider":
|
|
203
|
+
return !0;
|
|
204
|
+
default:
|
|
205
|
+
return !1;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function ye(e, r, s) {
|
|
209
|
+
const i = [], n = ((r == null ? void 0 : r.sections) || []).filter((y) => y.required);
|
|
210
|
+
let l = 0;
|
|
211
|
+
for (const y of n)
|
|
212
|
+
e.filter((w) => w.sectionId === y.id && w.kind !== "heading").some(fe) ? l += 1 : i.push(`必填章节「${y.title}」尚未填写内容`);
|
|
213
|
+
const o = e.filter((y) => y.kind !== "heading" && y.kind !== "divider"), a = o.filter((y) => !fe(y)).length, d = nt(ee(e)), c = s == null ? void 0 : s.minWordCount;
|
|
214
|
+
c && d < c && i.push(`全文字数 ${d} 未达最低要求 ${c} 字`);
|
|
215
|
+
const u = s == null ? void 0 : s.minBlocks;
|
|
216
|
+
u && o.length < u && i.push(`内容块数量不足(${o.length}/${u})`);
|
|
217
|
+
const p = n.length ? l / n.length : 1, h = o.length ? 1 - a / o.length : 1, j = !c || d >= c ? 1 : d / c, b = Math.round((p * 0.7 + h * 0.2 + j * 0.1) * 100);
|
|
218
|
+
return { totalRequired: n.length, filledRequired: l, wordCount: d, emptyBlocks: a, score: b, issues: i };
|
|
219
|
+
}
|
|
220
|
+
function ot(e, r) {
|
|
221
|
+
const s = {
|
|
222
|
+
name: "完整性与规范度",
|
|
223
|
+
score: r.score,
|
|
224
|
+
feedback: r.issues.length ? r.issues.join(";") : `报告结构完整(必填章节 ${r.filledRequired}/${r.totalRequired},约 ${r.wordCount} 字)。`,
|
|
225
|
+
suggestions: r.issues.length ? ["补全标注的缺失项可提升完整性得分"] : void 0
|
|
226
|
+
}, i = Math.round((e.totalScore ?? 0) * 0.85 + r.score * 0.15);
|
|
227
|
+
return {
|
|
228
|
+
...e,
|
|
229
|
+
totalScore: i,
|
|
230
|
+
pass: i >= 60,
|
|
231
|
+
dimensions: [...e.dimensions || [], s],
|
|
232
|
+
highlights: e.highlights || [],
|
|
233
|
+
improvements: e.improvements || [],
|
|
234
|
+
nextStepAdvice: e.nextStepAdvice || ""
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function at(e) {
|
|
238
|
+
var p, h, j;
|
|
239
|
+
const { scenario: r, reportMarkdown: s, referenceAnswer: i, evaluationRules: n, completeness: l } = e, o = (p = n == null ? void 0 : n.requiredPoints) != null && p.length ? `
|
|
240
|
+
【必须涵盖的要点】
|
|
241
|
+
${n.requiredPoints.map((b) => `- ${b}`).join(`
|
|
242
|
+
`)}` : "", a = (h = n == null ? void 0 : n.dimensions) != null && h.length ? `
|
|
243
|
+
【评估维度(整篇报告级)】
|
|
244
|
+
${n.dimensions.map((b) => `- ${b.name}${typeof b.weight == "number" ? `(权重${Math.round(b.weight * 100)}%)` : ""}`).join(`
|
|
245
|
+
`)}` : "", d = (j = n == null ? void 0 : n.businessRules) != null && j.length ? `
|
|
246
|
+
【业务评估规则】
|
|
247
|
+
${n.businessRules.map((b) => `- ${b}`).join(`
|
|
248
|
+
`)}` : "", c = i ? `
|
|
249
|
+
【参考答案 / 结论方向】
|
|
250
|
+
${i}` : "", u = `
|
|
251
|
+
【系统完整性检测(供参考;最终完整性/呈现分由系统另算并入)】
|
|
252
|
+
必填章节 ${l.filledRequired}/${l.totalRequired} 已填,全文约 ${l.wordCount} 字,空块 ${l.emptyBlocks} 个。`;
|
|
253
|
+
return `
|
|
254
|
+
【评估任务】
|
|
255
|
+
请评估学生提交的整篇方案/分析报告质量。报告由学生用结构化组件(标题/正文/表格/图表/分析框架)搭建,已序列化为下方 Markdown。请基于内容质量按维度打分,并给出亮点与改进建议。
|
|
256
|
+
|
|
257
|
+
【任务情景】
|
|
258
|
+
${r}
|
|
259
|
+
|
|
260
|
+
【学生提交的报告】
|
|
261
|
+
${s}
|
|
262
|
+
${c}${o}${a}${d}${u}
|
|
263
|
+
`.trim();
|
|
264
|
+
}
|
|
265
|
+
const lt = ({ config: e, height: r = 400 }) => {
|
|
266
|
+
const s = ue(null), i = ue(null);
|
|
267
|
+
return he(() => {
|
|
268
|
+
if (!s.current) return;
|
|
269
|
+
i.current || (i.current = _e(s.current));
|
|
270
|
+
const n = i.current, l = dt(e);
|
|
271
|
+
n.setOption(l, !0);
|
|
272
|
+
const o = () => {
|
|
273
|
+
n.resize();
|
|
274
|
+
};
|
|
275
|
+
return window.addEventListener("resize", o), () => {
|
|
276
|
+
window.removeEventListener("resize", o);
|
|
277
|
+
};
|
|
278
|
+
}, [e]), he(() => () => {
|
|
279
|
+
i.current && (i.current.dispose(), i.current = null);
|
|
280
|
+
}, []), /* @__PURE__ */ t.jsx("div", { ref: s, style: { width: "100%", height: `${r}px` } });
|
|
281
|
+
};
|
|
282
|
+
function dt(e) {
|
|
283
|
+
const { type: r, data: s, options: i, animation: n } = e, l = {
|
|
284
|
+
animation: ((n == null ? void 0 : n.duration) !== void 0, !0),
|
|
285
|
+
animationDuration: (n == null ? void 0 : n.duration) || 1e3,
|
|
286
|
+
animationEasing: (n == null ? void 0 : n.easing) || "cubicOut",
|
|
287
|
+
animationDelay: (n == null ? void 0 : n.delay) || 0,
|
|
288
|
+
tooltip: {
|
|
289
|
+
trigger: "axis",
|
|
290
|
+
axisPointer: {
|
|
291
|
+
type: "shadow"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
grid: {
|
|
295
|
+
left: "3%",
|
|
296
|
+
right: "4%",
|
|
297
|
+
bottom: "3%",
|
|
298
|
+
containLabel: !0
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
switch (r) {
|
|
302
|
+
case "bar":
|
|
303
|
+
return {
|
|
304
|
+
...l,
|
|
305
|
+
xAxis: {
|
|
306
|
+
type: "category",
|
|
307
|
+
data: s.labels || []
|
|
308
|
+
},
|
|
309
|
+
yAxis: {
|
|
310
|
+
type: "value"
|
|
311
|
+
},
|
|
312
|
+
series: (s.datasets || []).map((o) => ({
|
|
313
|
+
name: o.label,
|
|
314
|
+
type: "bar",
|
|
315
|
+
data: o.data,
|
|
316
|
+
itemStyle: {
|
|
317
|
+
color: o.backgroundColor || "#1890ff"
|
|
318
|
+
}
|
|
319
|
+
})),
|
|
320
|
+
...i
|
|
321
|
+
};
|
|
322
|
+
case "line":
|
|
323
|
+
return {
|
|
324
|
+
...l,
|
|
325
|
+
xAxis: {
|
|
326
|
+
type: "category",
|
|
327
|
+
data: s.labels || []
|
|
328
|
+
},
|
|
329
|
+
yAxis: {
|
|
330
|
+
type: "value"
|
|
331
|
+
},
|
|
332
|
+
series: (s.datasets || []).map((o) => ({
|
|
333
|
+
name: o.label,
|
|
334
|
+
type: "line",
|
|
335
|
+
data: o.data,
|
|
336
|
+
smooth: !0,
|
|
337
|
+
lineStyle: {
|
|
338
|
+
color: o.borderColor || "#1890ff"
|
|
339
|
+
},
|
|
340
|
+
itemStyle: {
|
|
341
|
+
color: o.borderColor || "#1890ff"
|
|
342
|
+
}
|
|
343
|
+
})),
|
|
344
|
+
...i
|
|
345
|
+
};
|
|
346
|
+
case "pie":
|
|
347
|
+
return {
|
|
348
|
+
...l,
|
|
349
|
+
tooltip: {
|
|
350
|
+
trigger: "item",
|
|
351
|
+
formatter: "{a} <br/>{b}: {c} ({d}%)"
|
|
352
|
+
},
|
|
353
|
+
legend: {
|
|
354
|
+
orient: "vertical",
|
|
355
|
+
left: "left"
|
|
356
|
+
},
|
|
357
|
+
series: [
|
|
358
|
+
{
|
|
359
|
+
name: s.name || "数据",
|
|
360
|
+
type: "pie",
|
|
361
|
+
radius: "50%",
|
|
362
|
+
data: (s.labels || []).map((o, a) => {
|
|
363
|
+
var d, c, u;
|
|
364
|
+
return {
|
|
365
|
+
name: o,
|
|
366
|
+
value: ((u = (c = (d = s.datasets) == null ? void 0 : d[0]) == null ? void 0 : c.data) == null ? void 0 : u[a]) || 0
|
|
367
|
+
};
|
|
368
|
+
}),
|
|
369
|
+
emphasis: {
|
|
370
|
+
itemStyle: {
|
|
371
|
+
shadowBlur: 10,
|
|
372
|
+
shadowOffsetX: 0,
|
|
373
|
+
shadowColor: "rgba(0, 0, 0, 0.5)"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
],
|
|
378
|
+
...i
|
|
379
|
+
};
|
|
380
|
+
case "radar":
|
|
381
|
+
return {
|
|
382
|
+
...l,
|
|
383
|
+
tooltip: {
|
|
384
|
+
trigger: "item"
|
|
385
|
+
},
|
|
386
|
+
radar: {
|
|
387
|
+
indicator: (s.labels || []).map((o) => ({
|
|
388
|
+
name: o,
|
|
389
|
+
max: 100
|
|
390
|
+
}))
|
|
391
|
+
},
|
|
392
|
+
series: [
|
|
393
|
+
{
|
|
394
|
+
name: s.name || "数据",
|
|
395
|
+
type: "radar",
|
|
396
|
+
data: (s.datasets || []).map((o) => ({
|
|
397
|
+
name: o.label,
|
|
398
|
+
value: o.data
|
|
399
|
+
}))
|
|
400
|
+
}
|
|
401
|
+
],
|
|
402
|
+
...i
|
|
403
|
+
};
|
|
404
|
+
case "gauge":
|
|
405
|
+
return {
|
|
406
|
+
...l,
|
|
407
|
+
series: [
|
|
408
|
+
{
|
|
409
|
+
type: "gauge",
|
|
410
|
+
progress: {
|
|
411
|
+
show: !0
|
|
412
|
+
},
|
|
413
|
+
detail: {
|
|
414
|
+
valueAnimation: !0,
|
|
415
|
+
formatter: "{value}"
|
|
416
|
+
},
|
|
417
|
+
data: [
|
|
418
|
+
{
|
|
419
|
+
value: s.value || 0,
|
|
420
|
+
name: s.name || ""
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
...i
|
|
426
|
+
};
|
|
427
|
+
case "sankey":
|
|
428
|
+
return {
|
|
429
|
+
...l,
|
|
430
|
+
tooltip: {
|
|
431
|
+
trigger: "item",
|
|
432
|
+
triggerOn: "mousemove"
|
|
433
|
+
},
|
|
434
|
+
series: [
|
|
435
|
+
{
|
|
436
|
+
type: "sankey",
|
|
437
|
+
data: s.nodes || [],
|
|
438
|
+
links: s.links || [],
|
|
439
|
+
emphasis: {
|
|
440
|
+
focus: "adjacency"
|
|
441
|
+
},
|
|
442
|
+
lineStyle: {
|
|
443
|
+
color: "gradient",
|
|
444
|
+
curveness: 0.5
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
...i
|
|
449
|
+
};
|
|
450
|
+
case "heatmap":
|
|
451
|
+
return {
|
|
452
|
+
...l,
|
|
453
|
+
tooltip: {
|
|
454
|
+
position: "top"
|
|
455
|
+
},
|
|
456
|
+
xAxis: {
|
|
457
|
+
type: "category",
|
|
458
|
+
data: s.xAxis || [],
|
|
459
|
+
splitArea: {
|
|
460
|
+
show: !0
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
yAxis: {
|
|
464
|
+
type: "category",
|
|
465
|
+
data: s.yAxis || []
|
|
466
|
+
},
|
|
467
|
+
visualMap: {
|
|
468
|
+
min: s.min || 0,
|
|
469
|
+
max: s.max || 100,
|
|
470
|
+
calculable: !0,
|
|
471
|
+
orient: "horizontal",
|
|
472
|
+
left: "center",
|
|
473
|
+
bottom: "15%"
|
|
474
|
+
},
|
|
475
|
+
series: [
|
|
476
|
+
{
|
|
477
|
+
type: "heatmap",
|
|
478
|
+
data: s.data || [],
|
|
479
|
+
label: {
|
|
480
|
+
show: !0
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
...i
|
|
485
|
+
};
|
|
486
|
+
case "network":
|
|
487
|
+
return {
|
|
488
|
+
...l,
|
|
489
|
+
tooltip: {},
|
|
490
|
+
series: [
|
|
491
|
+
{
|
|
492
|
+
type: "graph",
|
|
493
|
+
layout: s.layout || "force",
|
|
494
|
+
data: (s.nodes || []).map((o) => ({
|
|
495
|
+
...o,
|
|
496
|
+
symbolSize: o.size || 50
|
|
497
|
+
})),
|
|
498
|
+
links: s.edges || s.links || [],
|
|
499
|
+
roam: !0,
|
|
500
|
+
label: {
|
|
501
|
+
show: !0,
|
|
502
|
+
position: "right"
|
|
503
|
+
},
|
|
504
|
+
force: {
|
|
505
|
+
repulsion: 100,
|
|
506
|
+
edgeLength: [50, 200]
|
|
507
|
+
},
|
|
508
|
+
emphasis: {
|
|
509
|
+
focus: "adjacency"
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
],
|
|
513
|
+
...i
|
|
514
|
+
};
|
|
515
|
+
default:
|
|
516
|
+
return {
|
|
517
|
+
...l,
|
|
518
|
+
...i
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
const C = {
|
|
523
|
+
border: "#E5E7EB",
|
|
524
|
+
cellBg: "#F9FAFB",
|
|
525
|
+
label: "#374151",
|
|
526
|
+
text: "#1F2937",
|
|
527
|
+
placeholder: "#9CA3AF",
|
|
528
|
+
accent: "#4F46E5"
|
|
529
|
+
}, ct = ({
|
|
530
|
+
tool: e,
|
|
531
|
+
values: r,
|
|
532
|
+
editable: s = !1,
|
|
533
|
+
onChange: i,
|
|
534
|
+
title: n
|
|
535
|
+
}) => {
|
|
536
|
+
const l = e.layout || "sections", o = l === "quadrant" ? "repeat(2, minmax(0, 1fr))" : l === "columns" ? "repeat(auto-fit, minmax(150px, 1fr))" : "1fr";
|
|
537
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { border: `1px solid ${C.border}`, borderRadius: 12, padding: 16, background: "#fff" }, children: [
|
|
538
|
+
/* @__PURE__ */ t.jsxs(
|
|
539
|
+
"div",
|
|
540
|
+
{
|
|
541
|
+
style: {
|
|
542
|
+
fontSize: 14,
|
|
543
|
+
fontWeight: 600,
|
|
544
|
+
color: C.accent,
|
|
545
|
+
marginBottom: 12,
|
|
546
|
+
display: "flex",
|
|
547
|
+
alignItems: "center",
|
|
548
|
+
gap: 6
|
|
549
|
+
},
|
|
550
|
+
children: [
|
|
551
|
+
/* @__PURE__ */ t.jsx("span", { children: "🧩" }),
|
|
552
|
+
/* @__PURE__ */ t.jsx("span", { children: n || e.name })
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "grid", gridTemplateColumns: o, gap: 10 }, children: e.dimensions.map((a) => {
|
|
557
|
+
const d = r[a.key] || "";
|
|
558
|
+
return /* @__PURE__ */ t.jsxs(
|
|
559
|
+
"div",
|
|
560
|
+
{
|
|
561
|
+
style: { background: C.cellBg, border: `1px solid ${C.border}`, borderRadius: 8, padding: 10 },
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, fontWeight: 600, color: C.label, marginBottom: 4 }, children: a.label }),
|
|
564
|
+
s ? /* @__PURE__ */ t.jsx(
|
|
565
|
+
"textarea",
|
|
566
|
+
{
|
|
567
|
+
value: d,
|
|
568
|
+
placeholder: a.placeholder,
|
|
569
|
+
onChange: (c) => i == null ? void 0 : i(a.key, c.target.value),
|
|
570
|
+
rows: 3,
|
|
571
|
+
style: {
|
|
572
|
+
width: "100%",
|
|
573
|
+
boxSizing: "border-box",
|
|
574
|
+
border: `1px solid ${C.border}`,
|
|
575
|
+
borderRadius: 6,
|
|
576
|
+
padding: 6,
|
|
577
|
+
fontSize: 13,
|
|
578
|
+
color: C.text,
|
|
579
|
+
resize: "vertical",
|
|
580
|
+
fontFamily: "inherit"
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
) : d ? /* @__PURE__ */ t.jsx("div", { style: { fontSize: 13, color: C.text, whiteSpace: "pre-wrap", lineHeight: 1.6 }, children: d }) : /* @__PURE__ */ t.jsx("div", { style: { fontSize: 13, color: C.placeholder, fontStyle: "italic" }, children: a.placeholder })
|
|
584
|
+
]
|
|
585
|
+
},
|
|
586
|
+
a.key
|
|
587
|
+
);
|
|
588
|
+
}) })
|
|
589
|
+
] });
|
|
590
|
+
}, X = ["#4F46E5", "#10B981", "#F59E0B", "#EF4444", "#3B82F6", "#8B5CF6"];
|
|
591
|
+
function pt(e, r) {
|
|
592
|
+
var s;
|
|
593
|
+
return e === "pie" ? {
|
|
594
|
+
type: "pie",
|
|
595
|
+
data: { labels: r.labels, datasets: [{ data: ((s = r.series[0]) == null ? void 0 : s.values) ?? [] }] }
|
|
596
|
+
} : {
|
|
597
|
+
type: e,
|
|
598
|
+
data: {
|
|
599
|
+
labels: r.labels,
|
|
600
|
+
datasets: r.series.map((i, n) => ({
|
|
601
|
+
label: i.name,
|
|
602
|
+
data: i.values,
|
|
603
|
+
backgroundColor: X[n % X.length],
|
|
604
|
+
borderColor: X[n % X.length]
|
|
605
|
+
}))
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
function ut(e) {
|
|
610
|
+
const r = {};
|
|
611
|
+
return e != null && e.align && (r.textAlign = e.align), (e == null ? void 0 : e.marginTop) != null && (r.marginTop = e.marginTop), (e == null ? void 0 : e.marginBottom) != null && (r.marginBottom = e.marginBottom), r;
|
|
612
|
+
}
|
|
613
|
+
function f(e, r, s) {
|
|
614
|
+
return {
|
|
615
|
+
fontSize: (e == null ? void 0 : e.fontSize) ?? r,
|
|
616
|
+
color: (e == null ? void 0 : e.color) ?? s,
|
|
617
|
+
// 对齐直接落到文本元素:表单控件不可靠继承外层 textAlign,必须下沉
|
|
618
|
+
...e != null && e.align ? { textAlign: e.align } : {}
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
const ht = ({ value: e, onPick: r }) => /* @__PURE__ */ t.jsx("span", { style: { whiteSpace: "nowrap", color: "#F59E0B", fontSize: 15, letterSpacing: 1 }, children: [1, 2, 3, 4, 5].map((s) => /* @__PURE__ */ t.jsx(
|
|
622
|
+
"span",
|
|
623
|
+
{
|
|
624
|
+
onClick: r ? () => r(s) : void 0,
|
|
625
|
+
style: { cursor: r ? "pointer" : "default" },
|
|
626
|
+
children: s <= e ? "★" : "☆"
|
|
627
|
+
},
|
|
628
|
+
s
|
|
629
|
+
)) }), $e = ({ block: e, editable: r = !1, onChange: s }) => {
|
|
630
|
+
const i = xt(e, r, s), n = ut(e.style);
|
|
631
|
+
return Object.keys(n).length === 0 ? /* @__PURE__ */ t.jsx(t.Fragment, { children: i }) : /* @__PURE__ */ t.jsx("div", { style: n, children: i });
|
|
632
|
+
};
|
|
633
|
+
function xt(e, r, s) {
|
|
634
|
+
switch (e.kind) {
|
|
635
|
+
case "heading": {
|
|
636
|
+
const i = e.level === 1 ? 24 : e.level === 2 ? 19 : 16, n = e.level === 1 ? "2px solid #E0E7FF" : "none";
|
|
637
|
+
return r ? /* @__PURE__ */ t.jsx(
|
|
638
|
+
"input",
|
|
639
|
+
{
|
|
640
|
+
value: e.text,
|
|
641
|
+
placeholder: e.hint || "标题",
|
|
642
|
+
onChange: (l) => s == null ? void 0 : s({ ...e, text: l.target.value }),
|
|
643
|
+
style: {
|
|
644
|
+
fontWeight: 700,
|
|
645
|
+
border: "none",
|
|
646
|
+
borderBottom: n,
|
|
647
|
+
width: "100%",
|
|
648
|
+
padding: "4px 0",
|
|
649
|
+
outline: "none",
|
|
650
|
+
boxSizing: "border-box",
|
|
651
|
+
...f(e.style, i, "#111827")
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
) : /* @__PURE__ */ t.jsx(
|
|
655
|
+
"div",
|
|
656
|
+
{
|
|
657
|
+
style: {
|
|
658
|
+
fontWeight: 700,
|
|
659
|
+
borderBottom: n,
|
|
660
|
+
paddingBottom: e.level === 1 ? 8 : 0,
|
|
661
|
+
...f(e.style, i, "#111827")
|
|
662
|
+
},
|
|
663
|
+
children: e.text
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
case "paragraph":
|
|
668
|
+
return r ? /* @__PURE__ */ t.jsx(
|
|
669
|
+
"textarea",
|
|
670
|
+
{
|
|
671
|
+
value: e.text,
|
|
672
|
+
placeholder: e.hint || "正文段落...",
|
|
673
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, text: i.target.value }),
|
|
674
|
+
rows: 3,
|
|
675
|
+
style: {
|
|
676
|
+
width: "100%",
|
|
677
|
+
boxSizing: "border-box",
|
|
678
|
+
border: "1px solid #E5E7EB",
|
|
679
|
+
borderRadius: 6,
|
|
680
|
+
padding: 8,
|
|
681
|
+
lineHeight: 1.8,
|
|
682
|
+
resize: "vertical",
|
|
683
|
+
fontFamily: "inherit",
|
|
684
|
+
...f(e.style, 14, "#4B5563")
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
) : /* @__PURE__ */ t.jsx("p", { style: { lineHeight: 1.8, margin: 0, whiteSpace: "pre-wrap", ...f(e.style, 14, "#4B5563") }, children: e.text });
|
|
688
|
+
case "quote":
|
|
689
|
+
return r ? /* @__PURE__ */ t.jsx(
|
|
690
|
+
"textarea",
|
|
691
|
+
{
|
|
692
|
+
value: e.text,
|
|
693
|
+
placeholder: "关键发现或结论...",
|
|
694
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, text: i.target.value }),
|
|
695
|
+
rows: 2,
|
|
696
|
+
style: {
|
|
697
|
+
width: "100%",
|
|
698
|
+
boxSizing: "border-box",
|
|
699
|
+
background: "#EEF2FF",
|
|
700
|
+
borderRadius: "0 8px 8px 0",
|
|
701
|
+
padding: "12px 16px",
|
|
702
|
+
resize: "vertical",
|
|
703
|
+
fontFamily: "inherit",
|
|
704
|
+
border: "none",
|
|
705
|
+
borderLeft: "4px solid #4F46E5",
|
|
706
|
+
...f(e.style, 14, "#4338CA")
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
) : /* @__PURE__ */ t.jsx(
|
|
710
|
+
"blockquote",
|
|
711
|
+
{
|
|
712
|
+
style: {
|
|
713
|
+
borderLeft: "4px solid #4F46E5",
|
|
714
|
+
background: "#EEF2FF",
|
|
715
|
+
borderRadius: "0 8px 8px 0",
|
|
716
|
+
padding: "12px 16px",
|
|
717
|
+
margin: 0,
|
|
718
|
+
fontStyle: "italic",
|
|
719
|
+
whiteSpace: "pre-wrap",
|
|
720
|
+
...f(e.style, 14, "#4338CA")
|
|
721
|
+
},
|
|
722
|
+
children: e.text
|
|
723
|
+
}
|
|
724
|
+
);
|
|
725
|
+
case "list":
|
|
726
|
+
return mt(e, r, s);
|
|
727
|
+
case "table":
|
|
728
|
+
return gt(e, r, s);
|
|
729
|
+
case "chart":
|
|
730
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
731
|
+
/* @__PURE__ */ t.jsx(lt, { config: pt(e.chartType, e.data), height: 280 }),
|
|
732
|
+
r && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "#9CA3AF", textAlign: "center", marginTop: 4 }, children: "图表数据可在属性面板中编辑" })
|
|
733
|
+
] });
|
|
734
|
+
case "framework": {
|
|
735
|
+
const i = P.find((l) => l.key === e.toolKey);
|
|
736
|
+
if (!i)
|
|
737
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { color: "#EF4444", fontSize: 13 }, children: [
|
|
738
|
+
"未知分析框架:",
|
|
739
|
+
e.toolKey
|
|
740
|
+
] });
|
|
741
|
+
const n = {};
|
|
742
|
+
return e.cells.forEach((l) => {
|
|
743
|
+
n[l.key] = l.value;
|
|
744
|
+
}), /* @__PURE__ */ t.jsx(
|
|
745
|
+
ct,
|
|
746
|
+
{
|
|
747
|
+
tool: i,
|
|
748
|
+
values: n,
|
|
749
|
+
title: e.title,
|
|
750
|
+
editable: r,
|
|
751
|
+
onChange: (l, o) => {
|
|
752
|
+
const d = e.cells.some((c) => c.key === l) ? e.cells.map((c) => c.key === l ? { ...c, value: o } : c) : [...e.cells, { key: l, value: o }];
|
|
753
|
+
s == null || s({ ...e, cells: d });
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
case "divider":
|
|
759
|
+
return /* @__PURE__ */ t.jsx("hr", { style: { border: "none", borderTop: "1px solid #E5E7EB", margin: "8px 0" } });
|
|
760
|
+
case "progress":
|
|
761
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 14, padding: "4px 0" }, children: [
|
|
762
|
+
e.items.map((i, n) => /* @__PURE__ */ t.jsxs("div", { children: [
|
|
763
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 6, gap: 8 }, children: [
|
|
764
|
+
r ? /* @__PURE__ */ t.jsx(
|
|
765
|
+
"input",
|
|
766
|
+
{
|
|
767
|
+
value: i.label,
|
|
768
|
+
placeholder: "进度项",
|
|
769
|
+
onChange: (l) => {
|
|
770
|
+
const o = e.items.map((a, d) => d === n ? { ...a, label: l.target.value } : a);
|
|
771
|
+
s == null || s({ ...e, items: o });
|
|
772
|
+
},
|
|
773
|
+
style: { flex: 1, border: "none", borderBottom: "1px dashed #E5E7EB", outline: "none", ...f(e.style, 13, "#6B7280") }
|
|
774
|
+
}
|
|
775
|
+
) : /* @__PURE__ */ t.jsx("span", { style: { ...f(e.style, 13, "#6B7280") }, children: i.label }),
|
|
776
|
+
/* @__PURE__ */ t.jsxs("span", { style: { fontSize: 13, color: "#6B7280" }, children: [
|
|
777
|
+
i.percent,
|
|
778
|
+
"%"
|
|
779
|
+
] })
|
|
780
|
+
] }),
|
|
781
|
+
/* @__PURE__ */ t.jsx("div", { style: { width: "100%", height: 12, background: "#E5E7EB", borderRadius: 6, overflow: "hidden" }, children: /* @__PURE__ */ t.jsx(
|
|
782
|
+
"div",
|
|
783
|
+
{
|
|
784
|
+
style: {
|
|
785
|
+
width: `${Math.max(0, Math.min(100, i.percent))}%`,
|
|
786
|
+
height: "100%",
|
|
787
|
+
background: "linear-gradient(90deg,#4F46E5,#818CF8)",
|
|
788
|
+
borderRadius: 6
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
) })
|
|
792
|
+
] }, n)),
|
|
793
|
+
r && /* @__PURE__ */ t.jsx("div", { style: { fontSize: 12, color: "#9CA3AF" }, children: "进度项与百分比可在属性面板中增删与调整" })
|
|
794
|
+
] });
|
|
795
|
+
case "cover":
|
|
796
|
+
return /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", padding: "32px 16px" }, children: r ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
797
|
+
/* @__PURE__ */ t.jsx(
|
|
798
|
+
"input",
|
|
799
|
+
{
|
|
800
|
+
value: e.title,
|
|
801
|
+
placeholder: "封面标题",
|
|
802
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, title: i.target.value }),
|
|
803
|
+
style: { width: "100%", textAlign: "center", fontWeight: 800, border: "none", borderBottom: "1px dashed #E5E7EB", outline: "none", boxSizing: "border-box", marginBottom: 12, ...f(e.style, 28, "#111827") }
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
/* @__PURE__ */ t.jsx(
|
|
807
|
+
"input",
|
|
808
|
+
{
|
|
809
|
+
value: e.subtitle || "",
|
|
810
|
+
placeholder: "副标题",
|
|
811
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, subtitle: i.target.value }),
|
|
812
|
+
style: { width: "100%", textAlign: "center", border: "none", outline: "none", boxSizing: "border-box", marginBottom: 8, ...f(e.style, 16, "#6B7280") }
|
|
813
|
+
}
|
|
814
|
+
),
|
|
815
|
+
/* @__PURE__ */ t.jsx(
|
|
816
|
+
"input",
|
|
817
|
+
{
|
|
818
|
+
value: e.meta || "",
|
|
819
|
+
placeholder: "编制日期 | 编制人",
|
|
820
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, meta: i.target.value }),
|
|
821
|
+
style: { width: "100%", textAlign: "center", border: "none", outline: "none", boxSizing: "border-box", ...f(e.style, 13, "#9CA3AF") }
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
825
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontWeight: 800, marginBottom: 12, ...f(e.style, 28, "#111827") }, children: e.title }),
|
|
826
|
+
e.subtitle && /* @__PURE__ */ t.jsx("div", { style: { marginBottom: 8, ...f(e.style, 16, "#6B7280") }, children: e.subtitle }),
|
|
827
|
+
e.meta && /* @__PURE__ */ t.jsx("div", { style: { ...f(e.style, 13, "#9CA3AF") }, children: e.meta })
|
|
828
|
+
] }) });
|
|
829
|
+
case "image":
|
|
830
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
831
|
+
e.url ? /* @__PURE__ */ t.jsx("img", { src: e.url, alt: e.alt || e.caption || "", style: { maxWidth: "100%", borderRadius: 8, display: "block", margin: "0 auto" } }) : /* @__PURE__ */ t.jsx("div", { style: { width: "100%", height: 160, background: "linear-gradient(135deg,#EEF2FF,#E0E7FF)", borderRadius: 8, display: "flex", alignItems: "center", justifyContent: "center", color: "#6366F1", fontSize: 13 }, children: "图片 / 多媒体(在属性面板填写图片地址)" }),
|
|
832
|
+
r ? /* @__PURE__ */ t.jsx(
|
|
833
|
+
"input",
|
|
834
|
+
{
|
|
835
|
+
value: e.caption || "",
|
|
836
|
+
placeholder: "图片说明(选填)",
|
|
837
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, caption: i.target.value }),
|
|
838
|
+
style: { width: "100%", textAlign: "center", fontSize: 12, color: "#9CA3AF", border: "none", outline: "none", boxSizing: "border-box", marginTop: 8 }
|
|
839
|
+
}
|
|
840
|
+
) : e.caption && /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", fontSize: 12, color: "#9CA3AF", marginTop: 8 }, children: e.caption })
|
|
841
|
+
] });
|
|
842
|
+
case "card":
|
|
843
|
+
return /* @__PURE__ */ t.jsx("div", { style: { border: "1px solid #E5E7EB", borderRadius: 10, padding: 16, background: "#FAFAFB" }, children: r ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
844
|
+
/* @__PURE__ */ t.jsx(
|
|
845
|
+
"input",
|
|
846
|
+
{
|
|
847
|
+
value: e.title || "",
|
|
848
|
+
placeholder: "卡片标题",
|
|
849
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, title: i.target.value }),
|
|
850
|
+
style: { width: "100%", fontWeight: 700, border: "none", borderBottom: "1px dashed #E5E7EB", outline: "none", boxSizing: "border-box", marginBottom: 8, ...f(e.style, 15, "#111827") }
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
/* @__PURE__ */ t.jsx(
|
|
854
|
+
"textarea",
|
|
855
|
+
{
|
|
856
|
+
value: e.body || "",
|
|
857
|
+
placeholder: "卡片内容...",
|
|
858
|
+
rows: 2,
|
|
859
|
+
onChange: (i) => s == null ? void 0 : s({ ...e, body: i.target.value }),
|
|
860
|
+
style: { width: "100%", boxSizing: "border-box", border: "none", outline: "none", resize: "vertical", fontFamily: "inherit", background: "transparent", ...f(e.style, 14, "#4B5563") }
|
|
861
|
+
}
|
|
862
|
+
)
|
|
863
|
+
] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
864
|
+
e.title && /* @__PURE__ */ t.jsx("div", { style: { fontWeight: 700, marginBottom: 8, ...f(e.style, 15, "#111827") }, children: e.title }),
|
|
865
|
+
e.body && /* @__PURE__ */ t.jsx("div", { style: { whiteSpace: "pre-wrap", ...f(e.style, 14, "#4B5563") }, children: e.body })
|
|
866
|
+
] }) });
|
|
867
|
+
case "button": {
|
|
868
|
+
const i = {
|
|
869
|
+
display: "inline-block",
|
|
870
|
+
padding: "8px 20px",
|
|
871
|
+
background: "#4F46E5",
|
|
872
|
+
borderRadius: 8,
|
|
873
|
+
fontWeight: 600,
|
|
874
|
+
border: "none",
|
|
875
|
+
...f(e.style, 14, "#fff")
|
|
876
|
+
};
|
|
877
|
+
return /* @__PURE__ */ t.jsx("div", { children: r ? /* @__PURE__ */ t.jsx(
|
|
878
|
+
"input",
|
|
879
|
+
{
|
|
880
|
+
value: e.label,
|
|
881
|
+
placeholder: "按钮文字",
|
|
882
|
+
onChange: (n) => s == null ? void 0 : s({ ...e, label: n.target.value }),
|
|
883
|
+
style: { ...i, textAlign: "center", outline: "none", minWidth: 120 }
|
|
884
|
+
}
|
|
885
|
+
) : /* @__PURE__ */ t.jsx("span", { style: i, children: e.label }) });
|
|
886
|
+
}
|
|
887
|
+
default:
|
|
888
|
+
return null;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
function mt(e, r, s) {
|
|
892
|
+
const i = (o, a) => {
|
|
893
|
+
const d = [...e.items];
|
|
894
|
+
d[o] = a, s == null || s({ ...e, items: d });
|
|
895
|
+
};
|
|
896
|
+
if (e.variant === "checklist") {
|
|
897
|
+
const o = e.checked || e.items.map(() => !1), a = (d) => {
|
|
898
|
+
const c = [...o];
|
|
899
|
+
c[d] = !c[d], s == null || s({ ...e, checked: c });
|
|
900
|
+
};
|
|
901
|
+
return /* @__PURE__ */ t.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: e.items.map((d, c) => /* @__PURE__ */ t.jsxs("label", { style: { display: "flex", alignItems: "center", gap: 8, ...f(e.style, 14, "#4B5563") }, children: [
|
|
902
|
+
/* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: !!o[c], onChange: () => a(c), style: { accentColor: "#4F46E5" } }),
|
|
903
|
+
r ? /* @__PURE__ */ t.jsx(
|
|
904
|
+
"input",
|
|
905
|
+
{
|
|
906
|
+
value: d,
|
|
907
|
+
onChange: (u) => i(c, u.target.value),
|
|
908
|
+
style: { flex: 1, border: "none", borderBottom: "1px dashed #E5E7EB", outline: "none", ...f(e.style, 14, "#4B5563") }
|
|
909
|
+
}
|
|
910
|
+
) : /* @__PURE__ */ t.jsx("span", { style: { textDecoration: o[c] ? "line-through" : "none" }, children: d })
|
|
911
|
+
] }, c)) });
|
|
912
|
+
}
|
|
913
|
+
if (e.variant === "step")
|
|
914
|
+
return /* @__PURE__ */ t.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: e.items.map((o, a) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
915
|
+
/* @__PURE__ */ t.jsx(
|
|
916
|
+
"span",
|
|
917
|
+
{
|
|
918
|
+
style: {
|
|
919
|
+
width: 24,
|
|
920
|
+
height: 24,
|
|
921
|
+
borderRadius: "50%",
|
|
922
|
+
background: "#4F46E5",
|
|
923
|
+
color: "#fff",
|
|
924
|
+
fontSize: 12,
|
|
925
|
+
fontWeight: 700,
|
|
926
|
+
display: "flex",
|
|
927
|
+
alignItems: "center",
|
|
928
|
+
justifyContent: "center",
|
|
929
|
+
flexShrink: 0
|
|
930
|
+
},
|
|
931
|
+
children: a + 1
|
|
932
|
+
}
|
|
933
|
+
),
|
|
934
|
+
r ? /* @__PURE__ */ t.jsx(
|
|
935
|
+
"input",
|
|
936
|
+
{
|
|
937
|
+
value: o,
|
|
938
|
+
onChange: (d) => i(a, d.target.value),
|
|
939
|
+
style: { flex: 1, border: "none", borderBottom: "1px dashed #E5E7EB", outline: "none", ...f(e.style, 14, "#4B5563") }
|
|
940
|
+
}
|
|
941
|
+
) : /* @__PURE__ */ t.jsx("span", { style: { ...f(e.style, 14, "#4B5563") }, children: o })
|
|
942
|
+
] }, a)) });
|
|
943
|
+
const n = e.variant === "ordered" ? "ol" : "ul", l = { margin: 0, paddingLeft: 22, lineHeight: 2, ...f(e.style, 14, "#4B5563") };
|
|
944
|
+
return r ? /* @__PURE__ */ t.jsx(n, { style: l, children: e.items.map((o, a) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
945
|
+
"input",
|
|
946
|
+
{
|
|
947
|
+
value: o,
|
|
948
|
+
onChange: (d) => i(a, d.target.value),
|
|
949
|
+
style: { width: "92%", border: "none", borderBottom: "1px dashed #E5E7EB", outline: "none", ...f(e.style, 14, "#4B5563") }
|
|
950
|
+
}
|
|
951
|
+
) }, a)) }) : /* @__PURE__ */ t.jsx(n, { style: l, children: e.items.map((o, a) => /* @__PURE__ */ t.jsx("li", { style: { whiteSpace: "pre-wrap" }, children: o }, a)) });
|
|
952
|
+
}
|
|
953
|
+
function gt(e, r, s) {
|
|
954
|
+
const i = { border: "1px solid #E5E7EB", padding: "8px 12px", fontSize: 13, textAlign: "left" }, n = e.variant === "rating" ? e.ratingColumn ?? e.headers.length - 1 : -1, l = (o, a, d) => {
|
|
955
|
+
const c = e.rows.map((u) => [...u]);
|
|
956
|
+
c[o][a] = d, s == null || s({ ...e, rows: c });
|
|
957
|
+
};
|
|
958
|
+
return /* @__PURE__ */ t.jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
959
|
+
/* @__PURE__ */ t.jsx("thead", { children: /* @__PURE__ */ t.jsx("tr", { style: { background: "#F3F4F6" }, children: e.headers.map((o, a) => /* @__PURE__ */ t.jsx("th", { style: { ...i, fontWeight: 600, ...f(e.style, 13, "#374151") }, children: r ? /* @__PURE__ */ t.jsx(
|
|
960
|
+
"input",
|
|
961
|
+
{
|
|
962
|
+
value: o,
|
|
963
|
+
onChange: (d) => {
|
|
964
|
+
const c = [...e.headers];
|
|
965
|
+
c[a] = d.target.value, s == null || s({ ...e, headers: c });
|
|
966
|
+
},
|
|
967
|
+
style: { border: "none", background: "transparent", fontWeight: 600, width: "100%", outline: "none" }
|
|
968
|
+
}
|
|
969
|
+
) : o }, a)) }) }),
|
|
970
|
+
/* @__PURE__ */ t.jsx("tbody", { children: e.rows.map((o, a) => /* @__PURE__ */ t.jsx("tr", { style: a % 2 ? { background: "#F9FAFB" } : void 0, children: o.map((d, c) => /* @__PURE__ */ t.jsx("td", { style: { ...i, ...f(e.style, 13, "#6B7280") }, children: c === n ? /* @__PURE__ */ t.jsx(
|
|
971
|
+
ht,
|
|
972
|
+
{
|
|
973
|
+
value: Math.max(0, Math.min(5, parseInt(d, 10) || 0)),
|
|
974
|
+
onPick: r ? (u) => l(a, c, String(u)) : void 0
|
|
975
|
+
}
|
|
976
|
+
) : r ? /* @__PURE__ */ t.jsx(
|
|
977
|
+
"input",
|
|
978
|
+
{
|
|
979
|
+
value: d,
|
|
980
|
+
onChange: (u) => l(a, c, u.target.value),
|
|
981
|
+
style: { border: "none", background: "transparent", width: "100%", outline: "none", ...f(e.style, 13, "#6B7280") }
|
|
982
|
+
}
|
|
983
|
+
) : d }, c)) }, a)) })
|
|
984
|
+
] });
|
|
985
|
+
}
|
|
986
|
+
const S = { fontSize: 11, fontWeight: 600, color: "#6B7280", textTransform: "uppercase", margin: "0 0 6px" }, B = { marginBottom: 14 }, A = {
|
|
987
|
+
padding: "4px 10px",
|
|
988
|
+
border: "1px solid #E5E7EB",
|
|
989
|
+
borderRadius: 6,
|
|
990
|
+
background: "#fff",
|
|
991
|
+
cursor: "pointer",
|
|
992
|
+
fontSize: 12
|
|
993
|
+
}, z = {
|
|
994
|
+
width: "100%",
|
|
995
|
+
boxSizing: "border-box",
|
|
996
|
+
border: "1px solid #E5E7EB",
|
|
997
|
+
borderRadius: 6,
|
|
998
|
+
padding: "6px 8px",
|
|
999
|
+
fontSize: 13
|
|
1000
|
+
}, M = { fontSize: 12, color: "#9CA3AF" }, pe = (e) => ({
|
|
1001
|
+
...A,
|
|
1002
|
+
background: e ? "#4F46E5" : "#fff",
|
|
1003
|
+
color: e ? "#fff" : "#374151"
|
|
1004
|
+
}), ft = ["#111827", "#6B7280", "#4F46E5", "#10B981", "#EF4444"], yt = ({ block: e, onChange: r }) => e ? /* @__PURE__ */ t.jsxs("div", { style: { padding: 16 }, children: [
|
|
1005
|
+
vt(e, r),
|
|
1006
|
+
/* @__PURE__ */ t.jsx(jt, { block: e, onChange: r })
|
|
1007
|
+
] }) : /* @__PURE__ */ t.jsx("div", { style: { padding: 20, ...M, textAlign: "center" }, children: "在画布中选中一个块以编辑其属性" });
|
|
1008
|
+
function vt(e, r) {
|
|
1009
|
+
switch (e.kind) {
|
|
1010
|
+
case "heading":
|
|
1011
|
+
return /* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1012
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "标题级别" }),
|
|
1013
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 6 }, children: [1, 2, 3].map((s) => /* @__PURE__ */ t.jsxs("button", { type: "button", style: pe(e.level === s), onClick: () => r({ ...e, level: s }), children: [
|
|
1014
|
+
"H",
|
|
1015
|
+
s
|
|
1016
|
+
] }, s)) })
|
|
1017
|
+
] });
|
|
1018
|
+
case "list": {
|
|
1019
|
+
const s = [
|
|
1020
|
+
{ v: "unordered", label: "无序" },
|
|
1021
|
+
{ v: "ordered", label: "有序" },
|
|
1022
|
+
{ v: "step", label: "步骤" },
|
|
1023
|
+
{ v: "checklist", label: "清单" }
|
|
1024
|
+
], i = () => {
|
|
1025
|
+
const l = [...e.items, ""], o = e.checked ? [...e.checked, !1] : void 0;
|
|
1026
|
+
r({ ...e, items: l, ...o ? { checked: o } : {} });
|
|
1027
|
+
}, n = () => {
|
|
1028
|
+
if (e.items.length <= 1) return;
|
|
1029
|
+
const l = e.items.slice(0, -1), o = e.checked ? e.checked.slice(0, -1) : void 0;
|
|
1030
|
+
r({ ...e, items: l, ...o ? { checked: o } : {} });
|
|
1031
|
+
};
|
|
1032
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1033
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1034
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "列表类型" }),
|
|
1035
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 6, flexWrap: "wrap" }, children: s.map((l) => /* @__PURE__ */ t.jsx(
|
|
1036
|
+
"button",
|
|
1037
|
+
{
|
|
1038
|
+
type: "button",
|
|
1039
|
+
style: pe(e.variant === l.v),
|
|
1040
|
+
onClick: () => r({
|
|
1041
|
+
...e,
|
|
1042
|
+
variant: l.v,
|
|
1043
|
+
...l.v === "checklist" && !e.checked ? { checked: e.items.map(() => !1) } : {}
|
|
1044
|
+
}),
|
|
1045
|
+
children: l.label
|
|
1046
|
+
},
|
|
1047
|
+
l.v
|
|
1048
|
+
)) })
|
|
1049
|
+
] }),
|
|
1050
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1051
|
+
/* @__PURE__ */ t.jsxs("div", { style: S, children: [
|
|
1052
|
+
"列表项(共 ",
|
|
1053
|
+
e.items.length,
|
|
1054
|
+
" 项)"
|
|
1055
|
+
] }),
|
|
1056
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: A, onClick: i, children: "+ 添加项" }),
|
|
1057
|
+
e.items.length > 1 && /* @__PURE__ */ t.jsx("button", { type: "button", style: { ...A, marginLeft: 6 }, onClick: n, children: "- 删除末项" }),
|
|
1058
|
+
/* @__PURE__ */ t.jsx("div", { style: { ...M, marginTop: 6 }, children: "各项文字在画布中直接编辑" })
|
|
1059
|
+
] })
|
|
1060
|
+
] });
|
|
1061
|
+
}
|
|
1062
|
+
case "table": {
|
|
1063
|
+
const s = () => r({ ...e, rows: [...e.rows, e.headers.map(() => "")] }), i = () => e.rows.length > 1 && r({ ...e, rows: e.rows.slice(0, -1) }), n = () => r({ ...e, headers: [...e.headers, `列 ${e.headers.length + 1}`], rows: e.rows.map((o) => [...o, ""]) }), l = () => e.headers.length > 1 && r({ ...e, headers: e.headers.slice(0, -1), rows: e.rows.map((o) => o.slice(0, -1)) });
|
|
1064
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1065
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1066
|
+
/* @__PURE__ */ t.jsxs("div", { style: S, children: [
|
|
1067
|
+
"行(共 ",
|
|
1068
|
+
e.rows.length,
|
|
1069
|
+
" 行)"
|
|
1070
|
+
] }),
|
|
1071
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: A, onClick: s, children: "+ 行" }),
|
|
1072
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: { ...A, marginLeft: 6 }, onClick: i, children: "- 行" })
|
|
1073
|
+
] }),
|
|
1074
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1075
|
+
/* @__PURE__ */ t.jsxs("div", { style: S, children: [
|
|
1076
|
+
"列(共 ",
|
|
1077
|
+
e.headers.length,
|
|
1078
|
+
" 列)"
|
|
1079
|
+
] }),
|
|
1080
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: A, onClick: n, children: "+ 列" }),
|
|
1081
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: { ...A, marginLeft: 6 }, onClick: l, children: "- 列" })
|
|
1082
|
+
] }),
|
|
1083
|
+
e.variant === "rating" && /* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1084
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "星级列(第几列渲染为评分)" }),
|
|
1085
|
+
/* @__PURE__ */ t.jsx(
|
|
1086
|
+
"select",
|
|
1087
|
+
{
|
|
1088
|
+
value: e.ratingColumn ?? e.headers.length - 1,
|
|
1089
|
+
onChange: (o) => r({ ...e, ratingColumn: Number(o.target.value) }),
|
|
1090
|
+
style: z,
|
|
1091
|
+
children: e.headers.map((o, a) => /* @__PURE__ */ t.jsx("option", { value: a, children: o || `列 ${a + 1}` }, a))
|
|
1092
|
+
}
|
|
1093
|
+
)
|
|
1094
|
+
] }),
|
|
1095
|
+
/* @__PURE__ */ t.jsx("div", { style: M, children: "表头与单元格内容在画布中直接编辑" })
|
|
1096
|
+
] });
|
|
1097
|
+
}
|
|
1098
|
+
case "chart": {
|
|
1099
|
+
const s = (a) => r({ ...e, chartType: a }), i = (a) => r({ ...e, data: { ...e.data, labels: a.split(",").map((d) => d.trim()).filter(Boolean) } }), n = (a, d) => r({ ...e, data: { ...e.data, series: e.data.series.map((c, u) => u === a ? { ...c, name: d } : c) } }), l = (a, d) => {
|
|
1100
|
+
const c = d.split(",").map((u) => {
|
|
1101
|
+
const p = parseFloat(u.trim());
|
|
1102
|
+
return Number.isNaN(p) ? 0 : p;
|
|
1103
|
+
});
|
|
1104
|
+
r({ ...e, data: { ...e.data, series: e.data.series.map((u, p) => p === a ? { ...u, values: c } : u) } });
|
|
1105
|
+
}, o = () => r({ ...e, data: { ...e.data, series: [...e.data.series, { name: `系列 ${e.data.series.length + 1}`, values: e.data.labels.map(() => 0) }] } });
|
|
1106
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1107
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1108
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "图表类型" }),
|
|
1109
|
+
/* @__PURE__ */ t.jsxs("select", { value: e.chartType, onChange: (a) => s(a.target.value), style: z, children: [
|
|
1110
|
+
/* @__PURE__ */ t.jsx("option", { value: "bar", children: "柱状图" }),
|
|
1111
|
+
/* @__PURE__ */ t.jsx("option", { value: "line", children: "折线图" }),
|
|
1112
|
+
/* @__PURE__ */ t.jsx("option", { value: "pie", children: "饼图" }),
|
|
1113
|
+
/* @__PURE__ */ t.jsx("option", { value: "radar", children: "雷达图" })
|
|
1114
|
+
] })
|
|
1115
|
+
] }),
|
|
1116
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1117
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "分类标签(逗号分隔)" }),
|
|
1118
|
+
/* @__PURE__ */ t.jsx("input", { style: z, value: e.data.labels.join(", "), onChange: (a) => i(a.target.value) })
|
|
1119
|
+
] }),
|
|
1120
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1121
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "数据系列" }),
|
|
1122
|
+
e.data.series.map((a, d) => /* @__PURE__ */ t.jsxs("div", { style: { marginBottom: 8 }, children: [
|
|
1123
|
+
/* @__PURE__ */ t.jsx("input", { style: { ...z, marginBottom: 4 }, value: a.name, placeholder: "系列名", onChange: (c) => n(d, c.target.value) }),
|
|
1124
|
+
/* @__PURE__ */ t.jsx("input", { style: z, value: a.values.join(", "), placeholder: "数值,逗号分隔", onChange: (c) => l(d, c.target.value) })
|
|
1125
|
+
] }, d)),
|
|
1126
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: A, onClick: o, children: "+ 添加系列" })
|
|
1127
|
+
] })
|
|
1128
|
+
] });
|
|
1129
|
+
}
|
|
1130
|
+
case "progress": {
|
|
1131
|
+
const s = (l, o) => r({ ...e, items: e.items.map((a, d) => d === l ? { ...a, ...o } : a) }), i = () => r({ ...e, items: [...e.items, { label: "进度项", percent: 50 }] }), n = () => e.items.length > 1 && r({ ...e, items: e.items.slice(0, -1) });
|
|
1132
|
+
return /* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1133
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "进度项" }),
|
|
1134
|
+
e.items.map((l, o) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 6, marginBottom: 6, alignItems: "center" }, children: [
|
|
1135
|
+
/* @__PURE__ */ t.jsx("input", { style: { ...z, flex: 1 }, value: l.label, placeholder: "标签", onChange: (a) => s(o, { label: a.target.value }) }),
|
|
1136
|
+
/* @__PURE__ */ t.jsx(
|
|
1137
|
+
"input",
|
|
1138
|
+
{
|
|
1139
|
+
style: { ...z, width: 64 },
|
|
1140
|
+
type: "number",
|
|
1141
|
+
min: 0,
|
|
1142
|
+
max: 100,
|
|
1143
|
+
value: l.percent,
|
|
1144
|
+
onChange: (a) => s(o, { percent: Math.max(0, Math.min(100, Number(a.target.value) || 0)) })
|
|
1145
|
+
}
|
|
1146
|
+
)
|
|
1147
|
+
] }, o)),
|
|
1148
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", style: A, onClick: i, children: "+ 进度项" }),
|
|
1149
|
+
e.items.length > 1 && /* @__PURE__ */ t.jsx("button", { type: "button", style: { ...A, marginLeft: 6 }, onClick: n, children: "- 删除末项" })
|
|
1150
|
+
] });
|
|
1151
|
+
}
|
|
1152
|
+
case "image":
|
|
1153
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1154
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1155
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "图片地址 URL" }),
|
|
1156
|
+
/* @__PURE__ */ t.jsx("input", { style: z, value: e.url || "", placeholder: "https://...", onChange: (s) => r({ ...e, url: s.target.value }) })
|
|
1157
|
+
] }),
|
|
1158
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1159
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "替代文本 alt" }),
|
|
1160
|
+
/* @__PURE__ */ t.jsx("input", { style: z, value: e.alt || "", placeholder: "无障碍描述(选填)", onChange: (s) => r({ ...e, alt: s.target.value }) })
|
|
1161
|
+
] }),
|
|
1162
|
+
/* @__PURE__ */ t.jsx("div", { style: M, children: "图片说明在画布中直接编辑" })
|
|
1163
|
+
] });
|
|
1164
|
+
case "button":
|
|
1165
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1166
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1167
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "链接 URL(选填)" }),
|
|
1168
|
+
/* @__PURE__ */ t.jsx("input", { style: z, value: e.href || "", placeholder: "https://...", onChange: (s) => r({ ...e, href: s.target.value }) })
|
|
1169
|
+
] }),
|
|
1170
|
+
/* @__PURE__ */ t.jsx("div", { style: M, children: "按钮文字在画布中直接编辑" })
|
|
1171
|
+
] });
|
|
1172
|
+
case "framework": {
|
|
1173
|
+
const s = (i) => {
|
|
1174
|
+
const n = P.find((o) => o.key === i), l = ((n == null ? void 0 : n.dimensions) || []).map((o) => {
|
|
1175
|
+
var a;
|
|
1176
|
+
return {
|
|
1177
|
+
key: o.key,
|
|
1178
|
+
value: ((a = e.cells.find((d) => d.key === o.key)) == null ? void 0 : a.value) || ""
|
|
1179
|
+
};
|
|
1180
|
+
});
|
|
1181
|
+
r({ ...e, toolKey: i, cells: l });
|
|
1182
|
+
};
|
|
1183
|
+
return /* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1184
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "分析框架" }),
|
|
1185
|
+
/* @__PURE__ */ t.jsx("select", { value: e.toolKey, onChange: (i) => s(i.target.value), style: z, children: P.map((i) => /* @__PURE__ */ t.jsx("option", { value: i.key, children: i.name }, i.key)) }),
|
|
1186
|
+
/* @__PURE__ */ t.jsx("div", { style: { ...M, marginTop: 6 }, children: "各格内容在画布中直接编辑" })
|
|
1187
|
+
] });
|
|
1188
|
+
}
|
|
1189
|
+
case "cover":
|
|
1190
|
+
case "card":
|
|
1191
|
+
return /* @__PURE__ */ t.jsx("div", { style: M, children: "标题与内容在画布中直接编辑" });
|
|
1192
|
+
default:
|
|
1193
|
+
return /* @__PURE__ */ t.jsx("div", { style: M, children: "该块在画布中直接编辑内容,无额外结构属性" });
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
const jt = ({ block: e, onChange: r }) => {
|
|
1197
|
+
const s = e.style || {}, i = (n) => r({ ...e, style: { ...s, ...n } });
|
|
1198
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { borderTop: "1px solid #F3F4F6", paddingTop: 14, marginTop: 4 }, children: [
|
|
1199
|
+
/* @__PURE__ */ t.jsx("div", { style: { ...S, color: "#4F46E5", marginBottom: 12 }, children: "排版" }),
|
|
1200
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1201
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "字体大小" }),
|
|
1202
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1203
|
+
/* @__PURE__ */ t.jsx(
|
|
1204
|
+
"input",
|
|
1205
|
+
{
|
|
1206
|
+
type: "range",
|
|
1207
|
+
min: 12,
|
|
1208
|
+
max: 40,
|
|
1209
|
+
value: s.fontSize ?? 14,
|
|
1210
|
+
onChange: (n) => i({ fontSize: Number(n.target.value) }),
|
|
1211
|
+
style: { flex: 1, accentColor: "#4F46E5" }
|
|
1212
|
+
}
|
|
1213
|
+
),
|
|
1214
|
+
/* @__PURE__ */ t.jsxs("span", { style: { fontSize: 12, color: "#6B7280", width: 36, textAlign: "right" }, children: [
|
|
1215
|
+
s.fontSize ?? 14,
|
|
1216
|
+
"px"
|
|
1217
|
+
] })
|
|
1218
|
+
] })
|
|
1219
|
+
] }),
|
|
1220
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1221
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "对齐方式" }),
|
|
1222
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 6 }, children: ["left", "center", "right"].map((n) => /* @__PURE__ */ t.jsx("button", { type: "button", style: { ...pe(s.align === n), flex: 1 }, onClick: () => i({ align: n }), children: n === "left" ? "左" : n === "center" ? "中" : "右" }, n)) })
|
|
1223
|
+
] }),
|
|
1224
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1225
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "文本颜色" }),
|
|
1226
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, alignItems: "center" }, children: [
|
|
1227
|
+
ft.map((n) => /* @__PURE__ */ t.jsx(
|
|
1228
|
+
"button",
|
|
1229
|
+
{
|
|
1230
|
+
type: "button",
|
|
1231
|
+
onClick: () => i({ color: n }),
|
|
1232
|
+
style: {
|
|
1233
|
+
width: 24,
|
|
1234
|
+
height: 24,
|
|
1235
|
+
borderRadius: "50%",
|
|
1236
|
+
background: n,
|
|
1237
|
+
border: s.color === n ? "2px solid #4F46E5" : "2px solid transparent",
|
|
1238
|
+
cursor: "pointer"
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
n
|
|
1242
|
+
)),
|
|
1243
|
+
s.color && /* @__PURE__ */ t.jsx("button", { type: "button", style: { ...A, marginLeft: "auto" }, onClick: () => i({ color: void 0 }), children: "默认" })
|
|
1244
|
+
] })
|
|
1245
|
+
] }),
|
|
1246
|
+
/* @__PURE__ */ t.jsxs("div", { style: B, children: [
|
|
1247
|
+
/* @__PURE__ */ t.jsx("div", { style: S, children: "间距(上 / 下,px)" }),
|
|
1248
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
|
|
1249
|
+
/* @__PURE__ */ t.jsx(
|
|
1250
|
+
"input",
|
|
1251
|
+
{
|
|
1252
|
+
style: z,
|
|
1253
|
+
type: "number",
|
|
1254
|
+
placeholder: "上",
|
|
1255
|
+
value: s.marginTop ?? "",
|
|
1256
|
+
onChange: (n) => i({ marginTop: n.target.value === "" ? void 0 : Number(n.target.value) })
|
|
1257
|
+
}
|
|
1258
|
+
),
|
|
1259
|
+
/* @__PURE__ */ t.jsx(
|
|
1260
|
+
"input",
|
|
1261
|
+
{
|
|
1262
|
+
style: z,
|
|
1263
|
+
type: "number",
|
|
1264
|
+
placeholder: "下",
|
|
1265
|
+
value: s.marginBottom ?? "",
|
|
1266
|
+
onChange: (n) => i({ marginBottom: n.target.value === "" ? void 0 : Number(n.target.value) })
|
|
1267
|
+
}
|
|
1268
|
+
)
|
|
1269
|
+
] })
|
|
1270
|
+
] })
|
|
1271
|
+
] });
|
|
1272
|
+
}, bt = [
|
|
1273
|
+
{
|
|
1274
|
+
title: "📝 文本组件",
|
|
1275
|
+
cards: [
|
|
1276
|
+
{ label: "标题文字", icon: "H", kind: "heading" },
|
|
1277
|
+
{ label: "正文段落", icon: "¶", kind: "paragraph" },
|
|
1278
|
+
{ label: "引用文本", icon: "❝", kind: "quote" },
|
|
1279
|
+
{ label: "列表文本", icon: "☰", kind: "list", opts: { listVariant: "unordered" } }
|
|
1280
|
+
]
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
title: "📋 列表组件",
|
|
1284
|
+
cards: [
|
|
1285
|
+
{ label: "有序列表", icon: "1.", kind: "list", opts: { listVariant: "ordered" } },
|
|
1286
|
+
{ label: "无序列表", icon: "•", kind: "list", opts: { listVariant: "unordered" } },
|
|
1287
|
+
{ label: "步骤列表", icon: "①", kind: "list", opts: { listVariant: "step" } },
|
|
1288
|
+
{ label: "检查清单", icon: "☑", kind: "list", opts: { listVariant: "checklist" } }
|
|
1289
|
+
]
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
title: "📊 表格组件",
|
|
1293
|
+
cards: [
|
|
1294
|
+
{ label: "基础表格", icon: "▦", kind: "table", opts: { tableVariant: "basic" } },
|
|
1295
|
+
{ label: "对比表格", icon: "⊞", kind: "table", opts: { tableVariant: "comparison" } },
|
|
1296
|
+
{ label: "日历表格", icon: "📅", kind: "table", opts: { tableVariant: "calendar" } },
|
|
1297
|
+
{ label: "评分表格", icon: "★", kind: "table", opts: { tableVariant: "rating" } }
|
|
1298
|
+
]
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
title: "📈 可视化组件",
|
|
1302
|
+
cards: [
|
|
1303
|
+
{ label: "柱状图", icon: "📊", kind: "chart", opts: { chartType: "bar" } },
|
|
1304
|
+
{ label: "折线图", icon: "📈", kind: "chart", opts: { chartType: "line" } },
|
|
1305
|
+
{ label: "饼状图", icon: "◔", kind: "chart", opts: { chartType: "pie" } },
|
|
1306
|
+
{ label: "进度条", icon: "▭", kind: "progress" }
|
|
1307
|
+
]
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
title: "🎨 其他组件",
|
|
1311
|
+
cards: [
|
|
1312
|
+
{ label: "封面块", icon: "📖", kind: "cover" },
|
|
1313
|
+
{ label: "图片/多媒体", icon: "🖼", kind: "image" },
|
|
1314
|
+
{ label: "分割线", icon: "―", kind: "divider" },
|
|
1315
|
+
{ label: "卡片容器", icon: "▢", kind: "card" },
|
|
1316
|
+
{ label: "按钮", icon: "🔘", kind: "button" },
|
|
1317
|
+
{ label: "引用块", icon: "❝", kind: "quote" }
|
|
1318
|
+
]
|
|
1319
|
+
}
|
|
1320
|
+
], wt = {
|
|
1321
|
+
swot: "📊",
|
|
1322
|
+
pest: "🌐",
|
|
1323
|
+
"porter-five-forces": "🏛️",
|
|
1324
|
+
"bcg-matrix": "📈",
|
|
1325
|
+
"value-proposition": "🎯",
|
|
1326
|
+
persona: "👤",
|
|
1327
|
+
mindmap: "🧠",
|
|
1328
|
+
fishbone: "🐟"
|
|
1329
|
+
}, ve = {
|
|
1330
|
+
display: "flex",
|
|
1331
|
+
alignItems: "center",
|
|
1332
|
+
justifyContent: "space-between",
|
|
1333
|
+
padding: "10px 12px",
|
|
1334
|
+
background: "#F9FAFB",
|
|
1335
|
+
borderRadius: 10,
|
|
1336
|
+
cursor: "pointer",
|
|
1337
|
+
userSelect: "none",
|
|
1338
|
+
fontSize: 13,
|
|
1339
|
+
fontWeight: 600,
|
|
1340
|
+
color: "#374151"
|
|
1341
|
+
}, St = {
|
|
1342
|
+
display: "flex",
|
|
1343
|
+
flexDirection: "column",
|
|
1344
|
+
alignItems: "center",
|
|
1345
|
+
gap: 6,
|
|
1346
|
+
padding: "10px 6px",
|
|
1347
|
+
border: "1px solid #F3F4F6",
|
|
1348
|
+
borderRadius: 12,
|
|
1349
|
+
background: "#F9FAFB",
|
|
1350
|
+
cursor: "pointer",
|
|
1351
|
+
textAlign: "center"
|
|
1352
|
+
}, $t = {
|
|
1353
|
+
width: 36,
|
|
1354
|
+
height: 36,
|
|
1355
|
+
borderRadius: 8,
|
|
1356
|
+
background: "#fff",
|
|
1357
|
+
boxShadow: "0 1px 2px rgba(0,0,0,0.06)",
|
|
1358
|
+
display: "flex",
|
|
1359
|
+
alignItems: "center",
|
|
1360
|
+
justifyContent: "center",
|
|
1361
|
+
fontSize: 16,
|
|
1362
|
+
color: "#6B7280"
|
|
1363
|
+
}, Bt = { fontSize: 11, fontWeight: 500, color: "#4B5563" }, Ft = ({ availableComponents: e, availableFrameworks: r, onAdd: s }) => {
|
|
1364
|
+
const [i, n] = I({ "📝 文本组件": !0 }), l = (p) => n((h) => ({ ...h, [p]: !h[p] })), o = (p) => !e || e.length === 0 || e.includes(p), a = P.filter(
|
|
1365
|
+
(p) => !r || r.length === 0 || r.includes(p.key)
|
|
1366
|
+
), d = (p, h) => /* @__PURE__ */ t.jsxs(
|
|
1367
|
+
"button",
|
|
1368
|
+
{
|
|
1369
|
+
type: "button",
|
|
1370
|
+
onClick: () => s(p.kind, p.opts),
|
|
1371
|
+
style: St,
|
|
1372
|
+
title: p.label,
|
|
1373
|
+
children: [
|
|
1374
|
+
/* @__PURE__ */ t.jsx("span", { style: $t, children: p.icon }),
|
|
1375
|
+
/* @__PURE__ */ t.jsx("span", { style: Bt, children: p.label })
|
|
1376
|
+
]
|
|
1377
|
+
},
|
|
1378
|
+
h
|
|
1379
|
+
), c = [
|
|
1380
|
+
...bt.map((p) => ({ title: p.title, cards: p.cards.filter((h) => o(h.kind)) })).filter(
|
|
1381
|
+
(p) => p.cards.length > 0
|
|
1382
|
+
)
|
|
1383
|
+
], u = o("framework") && a.length > 0;
|
|
1384
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { padding: 14, display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
1385
|
+
c.map((p) => {
|
|
1386
|
+
const h = !!i[p.title];
|
|
1387
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1388
|
+
/* @__PURE__ */ t.jsxs("div", { style: ve, onClick: () => l(p.title), children: [
|
|
1389
|
+
/* @__PURE__ */ t.jsx("span", { children: p.title }),
|
|
1390
|
+
/* @__PURE__ */ t.jsx("span", { style: { transition: "transform 0.2s", transform: h ? "rotate(180deg)" : "none" }, children: "⌄" })
|
|
1391
|
+
] }),
|
|
1392
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: h ? "grid" : "none", gridTemplateColumns: "1fr 1fr", gap: 8, padding: "10px 2px 4px" }, children: p.cards.map((j, b) => d(j, b)) })
|
|
1393
|
+
] }, p.title);
|
|
1394
|
+
}),
|
|
1395
|
+
u && /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1396
|
+
/* @__PURE__ */ t.jsxs("div", { style: ve, onClick: () => l("🔧 分析工具"), children: [
|
|
1397
|
+
/* @__PURE__ */ t.jsx("span", { children: "🔧 分析工具" }),
|
|
1398
|
+
/* @__PURE__ */ t.jsx("span", { style: { transition: "transform 0.2s", transform: i["🔧 分析工具"] ? "rotate(180deg)" : "none" }, children: "⌄" })
|
|
1399
|
+
] }),
|
|
1400
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: i["🔧 分析工具"] ? "grid" : "none", gridTemplateColumns: "1fr 1fr", gap: 8, padding: "10px 2px 4px" }, children: a.map(
|
|
1401
|
+
(p) => d(
|
|
1402
|
+
{ label: p.name, icon: wt[p.key] || "🧩", kind: "framework", opts: { toolKey: p.key } },
|
|
1403
|
+
p.key
|
|
1404
|
+
)
|
|
1405
|
+
) })
|
|
1406
|
+
] })
|
|
1407
|
+
] });
|
|
1408
|
+
}, Et = ({
|
|
1409
|
+
id: e,
|
|
1410
|
+
selected: r,
|
|
1411
|
+
readOnly: s = !1,
|
|
1412
|
+
onSelect: i,
|
|
1413
|
+
onDelete: n,
|
|
1414
|
+
children: l
|
|
1415
|
+
}) => {
|
|
1416
|
+
const { attributes: o, listeners: a, setNodeRef: d, transform: c, transition: u, isDragging: p } = Le({
|
|
1417
|
+
id: e,
|
|
1418
|
+
disabled: s
|
|
1419
|
+
}), [h, j] = I(!1), b = r ? "2px solid #4F46E5" : h && !s ? "2px dashed #4F46E5" : "2px solid transparent", y = {
|
|
1420
|
+
transform: qe.Transform.toString(c),
|
|
1421
|
+
transition: u,
|
|
1422
|
+
opacity: p ? 0.5 : 1,
|
|
1423
|
+
position: "relative",
|
|
1424
|
+
background: r ? "rgba(79,70,229,0.05)" : "#fff",
|
|
1425
|
+
borderRadius: 12,
|
|
1426
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.06)",
|
|
1427
|
+
outline: b,
|
|
1428
|
+
outlineOffset: 2,
|
|
1429
|
+
padding: 20,
|
|
1430
|
+
paddingLeft: s ? 20 : 36
|
|
1431
|
+
}, v = h ? 1 : 0;
|
|
1432
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1433
|
+
"div",
|
|
1434
|
+
{
|
|
1435
|
+
ref: d,
|
|
1436
|
+
style: y,
|
|
1437
|
+
onClick: i,
|
|
1438
|
+
onMouseEnter: () => j(!0),
|
|
1439
|
+
onMouseLeave: () => j(!1),
|
|
1440
|
+
children: [
|
|
1441
|
+
!s && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1442
|
+
/* @__PURE__ */ t.jsx(
|
|
1443
|
+
"span",
|
|
1444
|
+
{
|
|
1445
|
+
...o,
|
|
1446
|
+
...a,
|
|
1447
|
+
title: "拖拽排序",
|
|
1448
|
+
onClick: (w) => w.stopPropagation(),
|
|
1449
|
+
style: {
|
|
1450
|
+
position: "absolute",
|
|
1451
|
+
left: 10,
|
|
1452
|
+
top: 18,
|
|
1453
|
+
cursor: "grab",
|
|
1454
|
+
color: "#D1D5DB",
|
|
1455
|
+
touchAction: "none",
|
|
1456
|
+
opacity: v,
|
|
1457
|
+
transition: "opacity 0.2s ease"
|
|
1458
|
+
},
|
|
1459
|
+
children: /* @__PURE__ */ t.jsx(Ye, {})
|
|
1460
|
+
}
|
|
1461
|
+
),
|
|
1462
|
+
/* @__PURE__ */ t.jsx(
|
|
1463
|
+
"button",
|
|
1464
|
+
{
|
|
1465
|
+
title: "删除该块",
|
|
1466
|
+
onClick: (w) => {
|
|
1467
|
+
w.stopPropagation(), n();
|
|
1468
|
+
},
|
|
1469
|
+
style: {
|
|
1470
|
+
position: "absolute",
|
|
1471
|
+
right: 8,
|
|
1472
|
+
top: 8,
|
|
1473
|
+
border: "none",
|
|
1474
|
+
background: "transparent",
|
|
1475
|
+
cursor: "pointer",
|
|
1476
|
+
color: "#9CA3AF",
|
|
1477
|
+
fontSize: 14,
|
|
1478
|
+
opacity: v,
|
|
1479
|
+
transition: "opacity 0.2s ease"
|
|
1480
|
+
},
|
|
1481
|
+
children: /* @__PURE__ */ t.jsx(we, {})
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
] }),
|
|
1485
|
+
l
|
|
1486
|
+
]
|
|
1487
|
+
}
|
|
1488
|
+
);
|
|
1489
|
+
}, zt = /[一-龥a-zA-Z]/g, je = ({ active: e, onClick: r, children: s }) => /* @__PURE__ */ t.jsx(
|
|
1490
|
+
"button",
|
|
1491
|
+
{
|
|
1492
|
+
type: "button",
|
|
1493
|
+
onClick: r,
|
|
1494
|
+
style: {
|
|
1495
|
+
flex: 1,
|
|
1496
|
+
padding: "14px 0",
|
|
1497
|
+
border: "none",
|
|
1498
|
+
background: "transparent",
|
|
1499
|
+
cursor: "pointer",
|
|
1500
|
+
fontSize: 13,
|
|
1501
|
+
fontWeight: 600,
|
|
1502
|
+
color: e ? "#4F46E5" : "#9CA3AF",
|
|
1503
|
+
borderBottom: e ? "2px solid #4F46E5" : "2px solid transparent"
|
|
1504
|
+
},
|
|
1505
|
+
children: s
|
|
1506
|
+
}
|
|
1507
|
+
), At = ({
|
|
1508
|
+
blocks: e,
|
|
1509
|
+
onChange: r,
|
|
1510
|
+
availableComponents: s,
|
|
1511
|
+
availableFrameworks: i,
|
|
1512
|
+
reportTypeLabel: n,
|
|
1513
|
+
onApplyRecommended: l,
|
|
1514
|
+
readOnly: o = !1
|
|
1515
|
+
}) => {
|
|
1516
|
+
const [a, d] = I(null), [c, u] = I("toolbox"), [p, h] = I(!1), j = Me(Oe(Ue, { activationConstraint: { distance: 5 } })), b = ce(() => e.map((g) => g.id), [e]), y = e.find((g) => g.id === a) || null, v = ce(() => (ee(e).match(zt) || []).length, [e]), w = (g) => {
|
|
1517
|
+
const { active: F, over: E } = g;
|
|
1518
|
+
if (!E || F.id === E.id) return;
|
|
1519
|
+
const H = e.findIndex((O) => O.id === F.id), U = e.findIndex((O) => O.id === E.id);
|
|
1520
|
+
H < 0 || U < 0 || r(Ke(e, H, U));
|
|
1521
|
+
}, $ = (g, F) => {
|
|
1522
|
+
r(e.map((E) => E.id === g ? F : E));
|
|
1523
|
+
}, N = (g) => {
|
|
1524
|
+
r(e.filter((F) => F.id !== g)), a === g && d(null);
|
|
1525
|
+
}, K = (g, F) => {
|
|
1526
|
+
const E = Q(g, F);
|
|
1527
|
+
r([...e, E]), d(E.id), u("props");
|
|
1528
|
+
};
|
|
1529
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", height: "100%", minHeight: 480, background: "#F3F4F6" }, children: [
|
|
1530
|
+
/* @__PURE__ */ t.jsxs("section", { style: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, overflow: "hidden" }, children: [
|
|
1531
|
+
!o && /* @__PURE__ */ t.jsxs(
|
|
1532
|
+
"div",
|
|
1533
|
+
{
|
|
1534
|
+
style: {
|
|
1535
|
+
height: 48,
|
|
1536
|
+
flexShrink: 0,
|
|
1537
|
+
display: "flex",
|
|
1538
|
+
alignItems: "center",
|
|
1539
|
+
justifyContent: "space-between",
|
|
1540
|
+
padding: "0 16px",
|
|
1541
|
+
background: "#fff",
|
|
1542
|
+
borderBottom: "1px solid #E5E7EB"
|
|
1543
|
+
},
|
|
1544
|
+
children: [
|
|
1545
|
+
/* @__PURE__ */ t.jsxs("div", { style: { fontSize: 13, color: "#374151" }, children: [
|
|
1546
|
+
"报告类型:",
|
|
1547
|
+
/* @__PURE__ */ t.jsx("strong", { style: { color: "#111827" }, children: n || "方案设计" })
|
|
1548
|
+
] }),
|
|
1549
|
+
l && /* @__PURE__ */ t.jsx(
|
|
1550
|
+
"button",
|
|
1551
|
+
{
|
|
1552
|
+
type: "button",
|
|
1553
|
+
onClick: l,
|
|
1554
|
+
style: {
|
|
1555
|
+
display: "flex",
|
|
1556
|
+
alignItems: "center",
|
|
1557
|
+
gap: 6,
|
|
1558
|
+
background: "#4F46E5",
|
|
1559
|
+
color: "#fff",
|
|
1560
|
+
border: "none",
|
|
1561
|
+
borderRadius: 8,
|
|
1562
|
+
padding: "7px 16px",
|
|
1563
|
+
fontSize: 12,
|
|
1564
|
+
fontWeight: 600,
|
|
1565
|
+
cursor: "pointer"
|
|
1566
|
+
},
|
|
1567
|
+
children: "✨ 推荐示例"
|
|
1568
|
+
}
|
|
1569
|
+
)
|
|
1570
|
+
]
|
|
1571
|
+
}
|
|
1572
|
+
),
|
|
1573
|
+
/* @__PURE__ */ t.jsx(
|
|
1574
|
+
"div",
|
|
1575
|
+
{
|
|
1576
|
+
style: {
|
|
1577
|
+
flex: 1,
|
|
1578
|
+
overflowY: "auto",
|
|
1579
|
+
padding: 32,
|
|
1580
|
+
backgroundImage: "radial-gradient(#e5e7eb 1px, transparent 1px)",
|
|
1581
|
+
backgroundSize: "20px 20px"
|
|
1582
|
+
},
|
|
1583
|
+
children: /* @__PURE__ */ t.jsx("div", { style: { maxWidth: 896, margin: "0 auto", paddingBottom: 40 }, children: e.length === 0 ? /* @__PURE__ */ t.jsxs(
|
|
1584
|
+
"div",
|
|
1585
|
+
{
|
|
1586
|
+
style: {
|
|
1587
|
+
height: "100%",
|
|
1588
|
+
minHeight: 360,
|
|
1589
|
+
display: "flex",
|
|
1590
|
+
flexDirection: "column",
|
|
1591
|
+
alignItems: "center",
|
|
1592
|
+
justifyContent: "center",
|
|
1593
|
+
textAlign: "center",
|
|
1594
|
+
gap: 20
|
|
1595
|
+
},
|
|
1596
|
+
children: [
|
|
1597
|
+
/* @__PURE__ */ t.jsx(
|
|
1598
|
+
"div",
|
|
1599
|
+
{
|
|
1600
|
+
style: {
|
|
1601
|
+
width: 96,
|
|
1602
|
+
height: 96,
|
|
1603
|
+
borderRadius: 24,
|
|
1604
|
+
background: "#fff",
|
|
1605
|
+
boxShadow: "0 10px 30px rgba(0,0,0,0.08)",
|
|
1606
|
+
display: "flex",
|
|
1607
|
+
alignItems: "center",
|
|
1608
|
+
justifyContent: "center",
|
|
1609
|
+
fontSize: 44,
|
|
1610
|
+
color: "#C7D2FE"
|
|
1611
|
+
},
|
|
1612
|
+
children: "✏️"
|
|
1613
|
+
}
|
|
1614
|
+
),
|
|
1615
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1616
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: 20, fontWeight: 700, color: "#374151", marginBottom: 8 }, children: "空白画布" }),
|
|
1617
|
+
/* @__PURE__ */ t.jsx("div", { style: { color: "#9CA3AF", fontSize: 14, lineHeight: 1.7, maxWidth: 360 }, children: "从右侧组件工具箱选择或点击组件开始搭建你的方案。点击「推荐示例」可快速生成结构骨架。" })
|
|
1618
|
+
] }),
|
|
1619
|
+
l && /* @__PURE__ */ t.jsx(
|
|
1620
|
+
"button",
|
|
1621
|
+
{
|
|
1622
|
+
type: "button",
|
|
1623
|
+
onClick: l,
|
|
1624
|
+
style: {
|
|
1625
|
+
display: "flex",
|
|
1626
|
+
alignItems: "center",
|
|
1627
|
+
gap: 8,
|
|
1628
|
+
background: "#fff",
|
|
1629
|
+
color: "#4F46E5",
|
|
1630
|
+
border: "1px solid #E5E7EB",
|
|
1631
|
+
borderRadius: 12,
|
|
1632
|
+
padding: "10px 22px",
|
|
1633
|
+
fontSize: 14,
|
|
1634
|
+
fontWeight: 600,
|
|
1635
|
+
cursor: "pointer",
|
|
1636
|
+
boxShadow: "0 1px 3px rgba(0,0,0,0.06)"
|
|
1637
|
+
},
|
|
1638
|
+
children: "✨ 推荐示例"
|
|
1639
|
+
}
|
|
1640
|
+
)
|
|
1641
|
+
]
|
|
1642
|
+
}
|
|
1643
|
+
) : /* @__PURE__ */ t.jsx(Pe, { sensors: j, collisionDetection: Ne, onDragEnd: w, children: /* @__PURE__ */ t.jsx(He, { items: b, strategy: Ve, children: /* @__PURE__ */ t.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: e.map((g) => /* @__PURE__ */ t.jsx(
|
|
1644
|
+
Et,
|
|
1645
|
+
{
|
|
1646
|
+
id: g.id,
|
|
1647
|
+
selected: g.id === a,
|
|
1648
|
+
readOnly: o,
|
|
1649
|
+
onSelect: () => {
|
|
1650
|
+
d(g.id), u("props");
|
|
1651
|
+
},
|
|
1652
|
+
onDelete: () => N(g.id),
|
|
1653
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1654
|
+
$e,
|
|
1655
|
+
{
|
|
1656
|
+
block: g,
|
|
1657
|
+
editable: !o,
|
|
1658
|
+
onChange: (F) => $(g.id, F)
|
|
1659
|
+
}
|
|
1660
|
+
)
|
|
1661
|
+
},
|
|
1662
|
+
g.id
|
|
1663
|
+
)) }) }) }) })
|
|
1664
|
+
}
|
|
1665
|
+
)
|
|
1666
|
+
] }),
|
|
1667
|
+
!o && /* @__PURE__ */ t.jsxs(
|
|
1668
|
+
"aside",
|
|
1669
|
+
{
|
|
1670
|
+
style: {
|
|
1671
|
+
position: "relative",
|
|
1672
|
+
width: p ? 0 : 300,
|
|
1673
|
+
flexShrink: 0,
|
|
1674
|
+
background: "#fff",
|
|
1675
|
+
borderLeft: p ? "none" : "1px solid #E5E7EB",
|
|
1676
|
+
display: "flex",
|
|
1677
|
+
flexDirection: "column",
|
|
1678
|
+
transition: "width 0.25s ease"
|
|
1679
|
+
},
|
|
1680
|
+
children: [
|
|
1681
|
+
/* @__PURE__ */ t.jsx(
|
|
1682
|
+
"button",
|
|
1683
|
+
{
|
|
1684
|
+
type: "button",
|
|
1685
|
+
title: p ? "展开面板" : "收起面板",
|
|
1686
|
+
onClick: () => h((g) => !g),
|
|
1687
|
+
style: {
|
|
1688
|
+
position: "absolute",
|
|
1689
|
+
left: -12,
|
|
1690
|
+
top: "50%",
|
|
1691
|
+
transform: "translateY(-50%)",
|
|
1692
|
+
width: 24,
|
|
1693
|
+
height: 48,
|
|
1694
|
+
background: "#fff",
|
|
1695
|
+
border: "1px solid #E5E7EB",
|
|
1696
|
+
borderRadius: 12,
|
|
1697
|
+
cursor: "pointer",
|
|
1698
|
+
color: "#6B7280",
|
|
1699
|
+
zIndex: 5,
|
|
1700
|
+
fontSize: 12
|
|
1701
|
+
},
|
|
1702
|
+
children: p ? "‹" : "›"
|
|
1703
|
+
}
|
|
1704
|
+
),
|
|
1705
|
+
!p && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1706
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", borderBottom: "1px solid #E5E7EB" }, children: [
|
|
1707
|
+
/* @__PURE__ */ t.jsx(je, { active: c === "toolbox", onClick: () => u("toolbox"), children: "组件工具箱" }),
|
|
1708
|
+
/* @__PURE__ */ t.jsx(je, { active: c === "props", onClick: () => u("props"), children: "组件属性" })
|
|
1709
|
+
] }),
|
|
1710
|
+
/* @__PURE__ */ t.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: c === "toolbox" ? /* @__PURE__ */ t.jsx(
|
|
1711
|
+
Ft,
|
|
1712
|
+
{
|
|
1713
|
+
availableComponents: s,
|
|
1714
|
+
availableFrameworks: i,
|
|
1715
|
+
onAdd: K
|
|
1716
|
+
}
|
|
1717
|
+
) : /* @__PURE__ */ t.jsx(
|
|
1718
|
+
yt,
|
|
1719
|
+
{
|
|
1720
|
+
block: y,
|
|
1721
|
+
onChange: (g) => y && $(y.id, g)
|
|
1722
|
+
}
|
|
1723
|
+
) }),
|
|
1724
|
+
/* @__PURE__ */ t.jsx("div", { style: { flexShrink: 0, borderTop: "1px solid #E5E7EB", background: "#F9FAFB", padding: "12px 14px" }, children: /* @__PURE__ */ t.jsxs("div", { style: { fontSize: 13, color: "#6B7280", display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
1725
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1726
|
+
"📦 已添加:",
|
|
1727
|
+
/* @__PURE__ */ t.jsx("strong", { style: { color: "#4F46E5" }, children: e.length }),
|
|
1728
|
+
" 个组件"
|
|
1729
|
+
] }),
|
|
1730
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
1731
|
+
"📝 总字数:",
|
|
1732
|
+
/* @__PURE__ */ t.jsx("strong", { style: { color: "#4F46E5" }, children: v }),
|
|
1733
|
+
" 字"
|
|
1734
|
+
] })
|
|
1735
|
+
] }) })
|
|
1736
|
+
] })
|
|
1737
|
+
]
|
|
1738
|
+
}
|
|
1739
|
+
)
|
|
1740
|
+
] });
|
|
1741
|
+
};
|
|
1742
|
+
function m(e) {
|
|
1743
|
+
return String(e ?? "").replace(/[&<>"]/g, (r) => {
|
|
1744
|
+
switch (r) {
|
|
1745
|
+
case "&":
|
|
1746
|
+
return "&";
|
|
1747
|
+
case "<":
|
|
1748
|
+
return "<";
|
|
1749
|
+
case ">":
|
|
1750
|
+
return ">";
|
|
1751
|
+
case '"':
|
|
1752
|
+
return """;
|
|
1753
|
+
default:
|
|
1754
|
+
return r;
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
function Rt(e) {
|
|
1759
|
+
if (!e) return "";
|
|
1760
|
+
const r = [];
|
|
1761
|
+
return e.fontSize != null && r.push(`font-size:${e.fontSize}px`), e.align && r.push(`text-align:${e.align}`), e.color && r.push(`color:${e.color}`), e.marginTop != null && r.push(`margin-top:${e.marginTop}px`), e.marginBottom != null && r.push(`margin-bottom:${e.marginBottom}px`), r.join(";");
|
|
1762
|
+
}
|
|
1763
|
+
function kt(e) {
|
|
1764
|
+
const r = Math.max(0, Math.min(5, parseInt(e, 10) || 0));
|
|
1765
|
+
return "★".repeat(r) + "☆".repeat(5 - r);
|
|
1766
|
+
}
|
|
1767
|
+
function It(e) {
|
|
1768
|
+
switch (e.kind) {
|
|
1769
|
+
case "heading":
|
|
1770
|
+
return `<h${e.level}>${m(e.text)}</h${e.level}>`;
|
|
1771
|
+
case "paragraph":
|
|
1772
|
+
return e.text.trim() ? `<p>${m(e.text)}</p>` : "";
|
|
1773
|
+
case "quote":
|
|
1774
|
+
return e.text.trim() ? `<blockquote>${m(e.text)}</blockquote>` : "";
|
|
1775
|
+
case "list": {
|
|
1776
|
+
if (e.variant === "checklist") {
|
|
1777
|
+
const i = e.items.map((n, l) => {
|
|
1778
|
+
var o;
|
|
1779
|
+
return n.trim() ? `<li>${(o = e.checked) != null && o[l] ? "☑" : "☐"} ${m(n)}</li>` : "";
|
|
1780
|
+
}).join("");
|
|
1781
|
+
return i ? `<ul class="checklist">${i}</ul>` : "";
|
|
1782
|
+
}
|
|
1783
|
+
const r = e.variant === "ordered" || e.variant === "step" ? "ol" : "ul", s = e.items.filter((i) => i.trim()).map((i) => `<li>${m(i)}</li>`).join("");
|
|
1784
|
+
return s ? `<${r}>${s}</${r}>` : "";
|
|
1785
|
+
}
|
|
1786
|
+
case "table": {
|
|
1787
|
+
const r = e.variant === "rating" ? e.ratingColumn ?? e.headers.length - 1 : -1, s = `<tr>${e.headers.map((n) => `<th>${m(n)}</th>`).join("")}</tr>`, i = e.rows.map((n) => `<tr>${n.map((l, o) => o === r ? `<td>${kt(l)}</td>` : `<td>${m(l)}</td>`).join("")}</tr>`).join("");
|
|
1788
|
+
return `<table><thead>${s}</thead><tbody>${i}</tbody></table>`;
|
|
1789
|
+
}
|
|
1790
|
+
case "framework": {
|
|
1791
|
+
const r = P.find((i) => i.key === e.toolKey), s = e.cells.map((i) => {
|
|
1792
|
+
var o;
|
|
1793
|
+
const n = ((o = r == null ? void 0 : r.dimensions.find((a) => a.key === i.key)) == null ? void 0 : o.label) || i.key, l = m(i.value) || '<span class="muted">(未填写)</span>';
|
|
1794
|
+
return `<div class="fw-cell"><div class="fw-label">${m(n)}</div><div class="fw-val">${l}</div></div>`;
|
|
1795
|
+
}).join("");
|
|
1796
|
+
return `<section class="fw"><h3>${m(e.title || (r == null ? void 0 : r.name) || e.toolKey)}</h3><div class="fw-grid">${s}</div></section>`;
|
|
1797
|
+
}
|
|
1798
|
+
case "chart": {
|
|
1799
|
+
const r = `<tr><th>分类</th>${e.data.series.map((i) => `<th>${m(i.name)}</th>`).join("")}</tr>`, s = e.data.labels.map((i, n) => `<tr><td>${m(i)}</td>${e.data.series.map((l) => `<td>${m(String(l.values[n] ?? ""))}</td>`).join("")}</tr>`).join("");
|
|
1800
|
+
return `<section class="chart"><div class="muted">图表(${m(e.chartType)})数据:</div><table><thead>${r}</thead><tbody>${s}</tbody></table></section>`;
|
|
1801
|
+
}
|
|
1802
|
+
case "progress": {
|
|
1803
|
+
const r = e.items.filter((s) => s.label.trim()).map((s) => {
|
|
1804
|
+
const i = Math.max(0, Math.min(100, s.percent));
|
|
1805
|
+
return `<div class="prog"><div class="prog-row"><span>${m(s.label)}</span><span>${i}%</span></div><div class="prog-bar"><div class="prog-fill" style="width:${i}%"></div></div></div>`;
|
|
1806
|
+
}).join("");
|
|
1807
|
+
return r ? `<section class="progress">${r}</section>` : "";
|
|
1808
|
+
}
|
|
1809
|
+
case "cover":
|
|
1810
|
+
return `<section class="cover"><div class="cover-title">${m(e.title)}</div>${e.subtitle ? `<div class="cover-sub">${m(e.subtitle)}</div>` : ""}${e.meta ? `<div class="cover-meta">${m(e.meta)}</div>` : ""}</section>`;
|
|
1811
|
+
case "image":
|
|
1812
|
+
return e.url ? `<figure><img src="${m(e.url)}" alt="${m(e.alt || e.caption || "")}"/>${e.caption ? `<figcaption>${m(e.caption)}</figcaption>` : ""}</figure>` : e.caption ? `<figure><figcaption>${m(e.caption)}</figcaption></figure>` : "";
|
|
1813
|
+
case "card":
|
|
1814
|
+
return `<section class="card">${e.title ? `<div class="card-title">${m(e.title)}</div>` : ""}${e.body ? `<div class="card-body">${m(e.body)}</div>` : ""}</section>`;
|
|
1815
|
+
case "button":
|
|
1816
|
+
return e.label.trim() ? `<div class="btn-wrap"><span class="btn">${m(e.label)}</span></div>` : "";
|
|
1817
|
+
case "divider":
|
|
1818
|
+
return "<hr/>";
|
|
1819
|
+
default:
|
|
1820
|
+
return "";
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
function Be(e) {
|
|
1824
|
+
const r = [];
|
|
1825
|
+
for (const s of e) {
|
|
1826
|
+
const i = It(s);
|
|
1827
|
+
if (!i) continue;
|
|
1828
|
+
const n = Rt(s.style);
|
|
1829
|
+
r.push(n ? `<div style="${n}">${i}</div>` : i);
|
|
1830
|
+
}
|
|
1831
|
+
return r.join(`
|
|
1832
|
+
`);
|
|
1833
|
+
}
|
|
1834
|
+
const Fe = `
|
|
1835
|
+
body{font-family:-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'PingFang SC','Microsoft YaHei',sans-serif;color:#1f2937;line-height:1.7;margin:0;}
|
|
1836
|
+
.report{max-width:780px;margin:0 auto;padding:32px;}
|
|
1837
|
+
h1{font-size:24px;border-bottom:2px solid #e0e7ff;padding-bottom:10px;}
|
|
1838
|
+
h2{font-size:19px;margin-top:24px;}
|
|
1839
|
+
h3{font-size:16px;margin-top:16px;}
|
|
1840
|
+
p{font-size:14px;}
|
|
1841
|
+
blockquote{border-left:4px solid #4f46e5;background:#eef2ff;border-radius:0 8px 8px 0;padding:10px 14px;margin:12px 0;color:#4338ca;font-style:italic;}
|
|
1842
|
+
ul,ol{font-size:14px;padding-left:22px;line-height:2;}
|
|
1843
|
+
ul.checklist{list-style:none;padding-left:0;}
|
|
1844
|
+
table{width:100%;border-collapse:collapse;font-size:13px;margin:12px 0;}
|
|
1845
|
+
th,td{border:1px solid #e5e7eb;padding:8px 12px;text-align:left;}
|
|
1846
|
+
th{background:#f3f4f6;font-weight:600;}
|
|
1847
|
+
.fw{margin:14px 0;border:1px solid #e5e7eb;border-radius:10px;padding:14px;}
|
|
1848
|
+
.fw-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
|
|
1849
|
+
.fw-cell{background:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;padding:10px;}
|
|
1850
|
+
.fw-label{font-weight:600;font-size:12px;color:#374151;margin-bottom:4px;}
|
|
1851
|
+
.fw-val{font-size:13px;white-space:pre-wrap;}
|
|
1852
|
+
.cover{text-align:center;padding:28px 0;}
|
|
1853
|
+
.cover-title{font-size:28px;font-weight:800;color:#111827;}
|
|
1854
|
+
.cover-sub{font-size:16px;color:#6b7280;margin-top:8px;}
|
|
1855
|
+
.cover-meta{font-size:13px;color:#9ca3af;margin-top:6px;}
|
|
1856
|
+
.progress{margin:12px 0;}
|
|
1857
|
+
.prog{margin-bottom:12px;}
|
|
1858
|
+
.prog-row{display:flex;justify-content:space-between;font-size:13px;color:#6b7280;margin-bottom:4px;}
|
|
1859
|
+
.prog-bar{width:100%;height:10px;background:#e5e7eb;border-radius:5px;overflow:hidden;}
|
|
1860
|
+
.prog-fill{height:100%;background:#4f46e5;border-radius:5px;}
|
|
1861
|
+
figure{margin:12px 0;text-align:center;}
|
|
1862
|
+
figure img{max-width:100%;border-radius:8px;}
|
|
1863
|
+
figcaption{font-size:12px;color:#9ca3af;margin-top:6px;}
|
|
1864
|
+
.card{border:1px solid #e5e7eb;border-radius:10px;padding:16px;background:#fafafb;margin:12px 0;}
|
|
1865
|
+
.card-title{font-size:15px;font-weight:700;color:#111827;margin-bottom:8px;}
|
|
1866
|
+
.card-body{font-size:14px;color:#4b5563;white-space:pre-wrap;}
|
|
1867
|
+
.btn-wrap{margin:12px 0;}
|
|
1868
|
+
.btn{display:inline-block;padding:8px 20px;background:#4f46e5;color:#fff;border-radius:8px;font-size:14px;font-weight:600;}
|
|
1869
|
+
.muted{color:#9ca3af;}
|
|
1870
|
+
hr{border:none;border-top:1px solid #e5e7eb;margin:16px 0;}
|
|
1871
|
+
@media print{body{-webkit-print-color-adjust:exact;print-color-adjust:exact;}.report{padding:0;}}
|
|
1872
|
+
`;
|
|
1873
|
+
function be(e, r) {
|
|
1874
|
+
const s = Be(e), i = r ? `<h1>${m(r)}</h1>` : "", n = `<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"/><title>${m(r || "方案报告")}</title><style>${Fe}</style></head><body><main class="report">${i}${s}</main><script>window.onload=function(){setTimeout(function(){window.print();},300);};<\/script></body></html>`, l = window.open("", "_blank");
|
|
1875
|
+
l && (l.document.open(), l.document.write(n), l.document.close());
|
|
1876
|
+
}
|
|
1877
|
+
function Tt(e, r) {
|
|
1878
|
+
const s = Be(e), i = r ? `<h1>${m(r)}</h1>` : "", n = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head><meta charset="utf-8"/><title>${m(r || "方案报告")}</title><style>${Fe}</style></head><body><div class="report">${i}${s}</div></body></html>`, l = new Blob(["\uFEFF", n], { type: "application/msword" }), o = URL.createObjectURL(l), a = document.createElement("a");
|
|
1879
|
+
a.href = o, a.download = `${(r || "方案报告").replace(/[\\/:*?"<>|]/g, "_")}.doc`, document.body.appendChild(a), a.click(), document.body.removeChild(a), setTimeout(() => URL.revokeObjectURL(o), 1e3);
|
|
1880
|
+
}
|
|
1881
|
+
const Ct = ({
|
|
1882
|
+
phase: e,
|
|
1883
|
+
scenario: r,
|
|
1884
|
+
background: s,
|
|
1885
|
+
referenceDocs: i,
|
|
1886
|
+
reportTitle: n,
|
|
1887
|
+
stepName: l,
|
|
1888
|
+
recommendedOutline: o,
|
|
1889
|
+
blocks: a,
|
|
1890
|
+
onBlocksChange: d,
|
|
1891
|
+
availableComponents: c,
|
|
1892
|
+
availableFrameworks: u,
|
|
1893
|
+
evaluation: p,
|
|
1894
|
+
loading: h,
|
|
1895
|
+
uiConfig: j,
|
|
1896
|
+
onSubmit: b,
|
|
1897
|
+
onRetry: y,
|
|
1898
|
+
onComplete: v
|
|
1899
|
+
}) => {
|
|
1900
|
+
var Z;
|
|
1901
|
+
const w = Ce(j.theme), $ = w.borderRadius, N = j.submitButtonText || "提交评分", K = j.feedbackStyle || "collapse", g = n || l || "方案设计", [F, E] = I(!1), H = () => {
|
|
1902
|
+
xe.confirm({
|
|
1903
|
+
title: "确定要清空当前画布吗?",
|
|
1904
|
+
content: "所有未保存的内容将丢失。",
|
|
1905
|
+
okText: "清空",
|
|
1906
|
+
okButtonProps: { danger: !0 },
|
|
1907
|
+
cancelText: "取消",
|
|
1908
|
+
onOk: () => d([])
|
|
1909
|
+
});
|
|
1910
|
+
}, O = !!((Z = o == null ? void 0 : o.sections) != null && Z.length) ? () => d(Se(o)) : void 0;
|
|
1911
|
+
if (e === "editing")
|
|
1912
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { height: "100%", display: "flex", flexDirection: "column", ...j.styleOverrides }, children: [
|
|
1913
|
+
/* @__PURE__ */ t.jsxs(
|
|
1914
|
+
"div",
|
|
1915
|
+
{
|
|
1916
|
+
style: {
|
|
1917
|
+
display: "flex",
|
|
1918
|
+
alignItems: "center",
|
|
1919
|
+
justifyContent: "space-between",
|
|
1920
|
+
padding: "10px 16px",
|
|
1921
|
+
borderBottom: `1px solid ${w.borderColor}`,
|
|
1922
|
+
background: "#fff"
|
|
1923
|
+
},
|
|
1924
|
+
children: [
|
|
1925
|
+
/* @__PURE__ */ t.jsx(q, { icon: /* @__PURE__ */ t.jsx(we, {}), onClick: H, style: { borderRadius: $ }, children: "清空画布" }),
|
|
1926
|
+
/* @__PURE__ */ t.jsxs(ie, { children: [
|
|
1927
|
+
/* @__PURE__ */ t.jsx(q, { icon: /* @__PURE__ */ t.jsx(Ze, {}), onClick: () => E(!0), style: { borderRadius: $ }, children: "预览" }),
|
|
1928
|
+
/* @__PURE__ */ t.jsx(q, { icon: /* @__PURE__ */ t.jsx(Ge, {}), onClick: () => Tt(a, n), style: { borderRadius: $ }, children: "导出 Word" }),
|
|
1929
|
+
/* @__PURE__ */ t.jsx(q, { icon: /* @__PURE__ */ t.jsx(Je, {}), onClick: () => be(a, n), style: { borderRadius: $ }, children: "导出 PDF" }),
|
|
1930
|
+
/* @__PURE__ */ t.jsx(
|
|
1931
|
+
q,
|
|
1932
|
+
{
|
|
1933
|
+
type: "primary",
|
|
1934
|
+
icon: /* @__PURE__ */ t.jsx(me, {}),
|
|
1935
|
+
loading: h,
|
|
1936
|
+
onClick: b,
|
|
1937
|
+
style: { borderRadius: $, backgroundColor: w.primaryColor, borderColor: w.primaryColor },
|
|
1938
|
+
children: N
|
|
1939
|
+
}
|
|
1940
|
+
)
|
|
1941
|
+
] })
|
|
1942
|
+
]
|
|
1943
|
+
}
|
|
1944
|
+
),
|
|
1945
|
+
/* @__PURE__ */ t.jsx("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ t.jsx(
|
|
1946
|
+
At,
|
|
1947
|
+
{
|
|
1948
|
+
blocks: a,
|
|
1949
|
+
onChange: d,
|
|
1950
|
+
scenario: r,
|
|
1951
|
+
background: s,
|
|
1952
|
+
referenceDocs: i,
|
|
1953
|
+
availableComponents: c,
|
|
1954
|
+
availableFrameworks: u,
|
|
1955
|
+
reportTitle: n,
|
|
1956
|
+
reportTypeLabel: g,
|
|
1957
|
+
onApplyRecommended: O
|
|
1958
|
+
}
|
|
1959
|
+
) }),
|
|
1960
|
+
/* @__PURE__ */ t.jsx(
|
|
1961
|
+
xe,
|
|
1962
|
+
{
|
|
1963
|
+
open: F,
|
|
1964
|
+
title: "方案预览",
|
|
1965
|
+
width: 920,
|
|
1966
|
+
footer: null,
|
|
1967
|
+
onCancel: () => E(!1),
|
|
1968
|
+
styles: { body: { maxHeight: "74vh", overflowY: "auto", background: "#F3F4F6", padding: 24 } },
|
|
1969
|
+
children: a.length === 0 ? /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", color: "#9CA3AF", padding: "48px 0" }, children: "画布还是空的,先添加组件再预览。" }) : /* @__PURE__ */ t.jsx(
|
|
1970
|
+
"div",
|
|
1971
|
+
{
|
|
1972
|
+
style: {
|
|
1973
|
+
maxWidth: 794,
|
|
1974
|
+
margin: "0 auto",
|
|
1975
|
+
background: "#fff",
|
|
1976
|
+
padding: "48px 56px",
|
|
1977
|
+
borderRadius: 4,
|
|
1978
|
+
boxShadow: "0 2px 12px rgba(0,0,0,0.10)",
|
|
1979
|
+
display: "flex",
|
|
1980
|
+
flexDirection: "column",
|
|
1981
|
+
gap: 16
|
|
1982
|
+
},
|
|
1983
|
+
children: a.map((D) => /* @__PURE__ */ t.jsx($e, { block: D }, D.id))
|
|
1984
|
+
}
|
|
1985
|
+
)
|
|
1986
|
+
}
|
|
1987
|
+
)
|
|
1988
|
+
] });
|
|
1989
|
+
if (e === "evaluating")
|
|
1990
|
+
return /* @__PURE__ */ t.jsx("div", { style: { height: "100%", overflow: "auto", padding: 20, textAlign: "center", ...j.styleOverrides }, children: /* @__PURE__ */ t.jsx(ke, { size: "large", tip: "AI 正在评估您的报告..." }) });
|
|
1991
|
+
if (e === "feedback" && p) {
|
|
1992
|
+
const D = p.dimensions || [], W = p.highlights || [], _ = p.improvements || [], Y = p.totalScore >= 80 ? "#52c41a" : p.totalScore >= 60 ? "#faad14" : "#ff4d4f", G = D.map((x, R) => {
|
|
1993
|
+
var L, k;
|
|
1994
|
+
return {
|
|
1995
|
+
key: String(R),
|
|
1996
|
+
label: /* @__PURE__ */ t.jsxs("span", { children: [
|
|
1997
|
+
x.name,
|
|
1998
|
+
/* @__PURE__ */ t.jsxs(ne, { color: x.score >= 80 ? "green" : x.score >= 60 ? "orange" : "red", style: { marginLeft: 8 }, children: [
|
|
1999
|
+
x.score,
|
|
2000
|
+
"分"
|
|
2001
|
+
] })
|
|
2002
|
+
] }),
|
|
2003
|
+
children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
2004
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: 14, lineHeight: 1.8, color: "#595959", marginBottom: (L = x.errors) != null && L.length || (k = x.suggestions) != null && k.length ? 8 : 0 }, children: x.feedback }),
|
|
2005
|
+
x.errors && x.errors.length > 0 && /* @__PURE__ */ t.jsx("div", { style: { marginBottom: 6 }, children: x.errors.map((T, V) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, fontSize: 13, color: "#ff4d4f", marginBottom: 2 }, children: [
|
|
2006
|
+
/* @__PURE__ */ t.jsx(ae, { style: { marginTop: 3 } }),
|
|
2007
|
+
T
|
|
2008
|
+
] }, V)) }),
|
|
2009
|
+
x.suggestions && x.suggestions.length > 0 && /* @__PURE__ */ t.jsx("div", { children: x.suggestions.map((T, V) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, fontSize: 13, color: "#fa8c16", marginBottom: 2 }, children: [
|
|
2010
|
+
/* @__PURE__ */ t.jsx(le, { style: { marginTop: 3 } }),
|
|
2011
|
+
T
|
|
2012
|
+
] }, V)) })
|
|
2013
|
+
] })
|
|
2014
|
+
};
|
|
2015
|
+
});
|
|
2016
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { height: "100%", overflow: "auto", padding: 20, ...j.styleOverrides }, children: [
|
|
2017
|
+
/* @__PURE__ */ t.jsx(
|
|
2018
|
+
Ie,
|
|
2019
|
+
{
|
|
2020
|
+
type: p.pass ? p.totalScore >= 80 ? "success" : "warning" : "error",
|
|
2021
|
+
showIcon: !0,
|
|
2022
|
+
style: { marginBottom: 16, borderRadius: $ },
|
|
2023
|
+
message: /* @__PURE__ */ t.jsxs("span", { style: { fontSize: 16, fontWeight: 600 }, children: [
|
|
2024
|
+
"综合评分:",
|
|
2025
|
+
/* @__PURE__ */ t.jsx("span", { style: { color: Y, fontSize: 24 }, children: p.totalScore }),
|
|
2026
|
+
" 分",
|
|
2027
|
+
/* @__PURE__ */ t.jsx(ne, { color: p.pass ? "green" : "red", style: { marginLeft: 12, fontSize: 13 }, children: p.pass ? "通过" : "未通过" })
|
|
2028
|
+
] }),
|
|
2029
|
+
description: p.nextStepAdvice
|
|
2030
|
+
}
|
|
2031
|
+
),
|
|
2032
|
+
K === "collapse" ? /* @__PURE__ */ t.jsx(Te, { items: G, defaultActiveKey: G.map((x) => x.key), style: { marginBottom: 16, borderRadius: $ } }) : /* @__PURE__ */ t.jsx(ie, { direction: "vertical", style: { width: "100%", marginBottom: 16 }, size: "small", children: D.map((x, R) => {
|
|
2033
|
+
var L, k, T, V;
|
|
2034
|
+
return /* @__PURE__ */ t.jsxs(oe, { size: "small", style: { borderRadius: $, borderColor: w.borderColor }, children: [
|
|
2035
|
+
/* @__PURE__ */ t.jsxs("div", { style: { fontWeight: 600, marginBottom: 4 }, children: [
|
|
2036
|
+
x.name,
|
|
2037
|
+
/* @__PURE__ */ t.jsxs(ne, { color: x.score >= 80 ? "green" : x.score >= 60 ? "orange" : "red", style: { marginLeft: 8 }, children: [
|
|
2038
|
+
x.score,
|
|
2039
|
+
"分"
|
|
2040
|
+
] })
|
|
2041
|
+
] }),
|
|
2042
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: 14, color: "#595959", marginBottom: (L = x.errors) != null && L.length || (k = x.suggestions) != null && k.length ? 6 : 0 }, children: x.feedback }),
|
|
2043
|
+
(T = x.errors) == null ? void 0 : T.map((te, re) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 6, fontSize: 13, color: "#ff4d4f", marginBottom: 2 }, children: [
|
|
2044
|
+
/* @__PURE__ */ t.jsx(ae, { style: { marginTop: 3 } }),
|
|
2045
|
+
te
|
|
2046
|
+
] }, re)),
|
|
2047
|
+
(V = x.suggestions) == null ? void 0 : V.map((te, re) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 6, fontSize: 13, color: "#fa8c16", marginBottom: 2 }, children: [
|
|
2048
|
+
/* @__PURE__ */ t.jsx(le, { style: { marginTop: 3 } }),
|
|
2049
|
+
te
|
|
2050
|
+
] }, re))
|
|
2051
|
+
] }, R);
|
|
2052
|
+
}) }),
|
|
2053
|
+
W.length > 0 && /* @__PURE__ */ t.jsx(oe, { size: "small", style: { marginBottom: 16, borderRadius: $, borderColor: "#b7eb8f", backgroundColor: "#f6ffed" }, title: /* @__PURE__ */ t.jsxs("span", { style: { color: "#52c41a", fontWeight: 600 }, children: [
|
|
2054
|
+
/* @__PURE__ */ t.jsx(me, { style: { marginRight: 8 } }),
|
|
2055
|
+
"分析亮点"
|
|
2056
|
+
] }), children: W.map((x, R) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 4, fontSize: 14, color: "#595959" }, children: [
|
|
2057
|
+
/* @__PURE__ */ t.jsx(Ee, { style: { color: "#52c41a", marginTop: 4 } }),
|
|
2058
|
+
x
|
|
2059
|
+
] }, R)) }),
|
|
2060
|
+
_.length > 0 && /* @__PURE__ */ t.jsx(oe, { size: "small", style: { marginBottom: 16, borderRadius: $, borderColor: "#ffd591", backgroundColor: "#fff7e6" }, title: /* @__PURE__ */ t.jsxs("span", { style: { color: "#fa8c16", fontWeight: 600 }, children: [
|
|
2061
|
+
/* @__PURE__ */ t.jsx(ae, { style: { marginRight: 8 } }),
|
|
2062
|
+
"改进建议"
|
|
2063
|
+
] }), children: _.map((x, R) => /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 4, fontSize: 14, color: "#595959" }, children: [
|
|
2064
|
+
/* @__PURE__ */ t.jsx(le, { style: { color: "#fa8c16", marginTop: 4 } }),
|
|
2065
|
+
x
|
|
2066
|
+
] }, R)) }),
|
|
2067
|
+
/* @__PURE__ */ t.jsx("div", { style: { textAlign: "right", marginTop: 16 }, children: /* @__PURE__ */ t.jsxs(ie, { children: [
|
|
2068
|
+
/* @__PURE__ */ t.jsx(q, { icon: /* @__PURE__ */ t.jsx(Xe, {}), onClick: y, style: { borderRadius: $ }, children: "返回修改" }),
|
|
2069
|
+
/* @__PURE__ */ t.jsx(q, { onClick: () => be(a, n), style: { borderRadius: $ }, children: "导出 PDF" }),
|
|
2070
|
+
/* @__PURE__ */ t.jsx(q, { type: "primary", size: "large", onClick: v, style: { borderRadius: $, backgroundColor: w.primaryColor, borderColor: w.primaryColor }, children: "完成" })
|
|
2071
|
+
] }) })
|
|
2072
|
+
] });
|
|
2073
|
+
}
|
|
2074
|
+
return null;
|
|
2075
|
+
};
|
|
2076
|
+
function Dt(e, r, s) {
|
|
2077
|
+
if (!e) return e;
|
|
2078
|
+
const i = (n) => n != null ? de(n, r, s) : n;
|
|
2079
|
+
return {
|
|
2080
|
+
...e,
|
|
2081
|
+
reportTitle: i(e.reportTitle),
|
|
2082
|
+
sections: (e.sections || []).map((n) => {
|
|
2083
|
+
var l;
|
|
2084
|
+
return {
|
|
2085
|
+
...n,
|
|
2086
|
+
title: i(n.title) ?? n.title,
|
|
2087
|
+
hint: i(n.hint),
|
|
2088
|
+
suggestedBlocks: (l = n.suggestedBlocks) == null ? void 0 : l.map((o) => ({ ...o, note: i(o.note) }))
|
|
2089
|
+
};
|
|
2090
|
+
})
|
|
2091
|
+
};
|
|
2092
|
+
}
|
|
2093
|
+
const Zt = ({ initData: e, runtimeRules: r, onFinish: s }) => {
|
|
2094
|
+
var D;
|
|
2095
|
+
const i = e || {}, { filledData: n } = ze(), l = i.caseData, o = de(i.scenario || "", l, n), a = de(i.background || "", l, n), d = ce(
|
|
2096
|
+
() => Dt(i.recommendedOutline, l, n),
|
|
2097
|
+
[i.recommendedOutline, l, n]
|
|
2098
|
+
), c = d == null ? void 0 : d.reportTitle, u = ((D = i.evaluationRules) == null ? void 0 : D.referenceAnswer) || "", p = r || {}, [h, j] = I(() => Se(d)), [b, y] = I("editing"), [v, w] = I(null), [$, N] = I(!1), K = Ae("CASE_ANALYSIS"), g = i.currentUser || { userId: "student-001", name: "学生" }, { callAI: F, ready: E } = Re(K, g), H = i.uiConfig || {}, U = se(async () => {
|
|
2099
|
+
if (!E) {
|
|
2100
|
+
J.error("AI 服务未就绪");
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
const W = ee(h);
|
|
2104
|
+
if (!W.trim()) {
|
|
2105
|
+
J.warning("请先在画布中填写报告内容");
|
|
2106
|
+
return;
|
|
2107
|
+
}
|
|
2108
|
+
y("evaluating"), N(!0);
|
|
2109
|
+
const _ = ye(h, d, p);
|
|
2110
|
+
try {
|
|
2111
|
+
const Y = at({
|
|
2112
|
+
scenario: o,
|
|
2113
|
+
reportMarkdown: W,
|
|
2114
|
+
referenceAnswer: u,
|
|
2115
|
+
evaluationRules: i.evaluationRules,
|
|
2116
|
+
completeness: _
|
|
2117
|
+
});
|
|
2118
|
+
await F(Y, (G, x) => {
|
|
2119
|
+
if (!x) return;
|
|
2120
|
+
const { command: R, cleanContent: L } = De(G, "evaluation");
|
|
2121
|
+
let k = null;
|
|
2122
|
+
if (R)
|
|
2123
|
+
k = R.data;
|
|
2124
|
+
else
|
|
2125
|
+
try {
|
|
2126
|
+
const T = JSON.parse(L);
|
|
2127
|
+
T.type || (k = T);
|
|
2128
|
+
} catch {
|
|
2129
|
+
}
|
|
2130
|
+
if (!k) {
|
|
2131
|
+
console.error("AI 返回解析失败:", L), J.error("AI 评价结果解析失败,请重试"), y("editing");
|
|
2132
|
+
return;
|
|
2133
|
+
}
|
|
2134
|
+
w(ot(k, _)), y("feedback");
|
|
2135
|
+
});
|
|
2136
|
+
} catch (Y) {
|
|
2137
|
+
console.error("AI 调用失败:", Y), J.error("AI 评价失败,请重试"), y("editing");
|
|
2138
|
+
} finally {
|
|
2139
|
+
N(!1);
|
|
2140
|
+
}
|
|
2141
|
+
}, [E, h, d, p, o, u, i.evaluationRules, F]), O = se(() => {
|
|
2142
|
+
y("editing"), w(null);
|
|
2143
|
+
}, []), Z = se(() => {
|
|
2144
|
+
const W = ye(h, d, p);
|
|
2145
|
+
s({
|
|
2146
|
+
stepId: i.stepId || "unknown",
|
|
2147
|
+
operationType: "case-analysis",
|
|
2148
|
+
operationData: {
|
|
2149
|
+
reportDraft: { blocks: h },
|
|
2150
|
+
reportMarkdown: ee(h),
|
|
2151
|
+
evaluation: v,
|
|
2152
|
+
overallScore: v == null ? void 0 : v.totalScore,
|
|
2153
|
+
completeness: W
|
|
2154
|
+
},
|
|
2155
|
+
operationLog: [],
|
|
2156
|
+
timestamp: Date.now(),
|
|
2157
|
+
evidenceSummary: We({
|
|
2158
|
+
sourceStepId: i.stepId || "unknown",
|
|
2159
|
+
sourceStepName: i.stepName || "方案设计",
|
|
2160
|
+
sourceType: "case-analysis",
|
|
2161
|
+
title: `${i.stepName || "方案设计"}摘要`,
|
|
2162
|
+
summary: `搭建报告含 ${h.length} 个内容块${(v == null ? void 0 : v.totalScore) != null ? `,总分 ${v.totalScore}` : ""}。`,
|
|
2163
|
+
keyFacts: [
|
|
2164
|
+
{ label: "内容块数", value: String(h.length) },
|
|
2165
|
+
{ label: "字数", value: String(W.wordCount) },
|
|
2166
|
+
...(v == null ? void 0 : v.totalScore) != null ? [{ label: "总分", value: String(v.totalScore) }] : []
|
|
2167
|
+
]
|
|
2168
|
+
})
|
|
2169
|
+
});
|
|
2170
|
+
}, [s, i.stepId, i.stepName, h, d, p, v]);
|
|
2171
|
+
return /* @__PURE__ */ t.jsx(
|
|
2172
|
+
Ct,
|
|
2173
|
+
{
|
|
2174
|
+
phase: b,
|
|
2175
|
+
scenario: o,
|
|
2176
|
+
background: a,
|
|
2177
|
+
referenceDocs: i.referenceDocs,
|
|
2178
|
+
reportTitle: c,
|
|
2179
|
+
stepName: i.stepName,
|
|
2180
|
+
recommendedOutline: d,
|
|
2181
|
+
blocks: h,
|
|
2182
|
+
onBlocksChange: j,
|
|
2183
|
+
availableComponents: i.availableComponents,
|
|
2184
|
+
availableFrameworks: i.availableFrameworks,
|
|
2185
|
+
evaluation: v,
|
|
2186
|
+
loading: $,
|
|
2187
|
+
uiConfig: H,
|
|
2188
|
+
onSubmit: U,
|
|
2189
|
+
onRetry: O,
|
|
2190
|
+
onComplete: Z
|
|
2191
|
+
}
|
|
2192
|
+
);
|
|
2193
|
+
};
|
|
2194
|
+
export {
|
|
2195
|
+
Zt as default
|
|
2196
|
+
};
|