From 5102e84556e835db490f6146fd67c14f903082dd Mon Sep 17 00:00:00 2001 From: zhangzhen <525765282@qq.com> Date: Fri, 21 Nov 2025 14:47:27 +0800 Subject: [PATCH] 修改指令集可视化功能; --- src/components/Common/CommonInstructSet.js | 10 ++++++++-- src/components/Common/InstructSetSetting/index.js | 10 ++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/Common/CommonInstructSet.js b/src/components/Common/CommonInstructSet.js index c7c4e41..396a327 100644 --- a/src/components/Common/CommonInstructSet.js +++ b/src/components/Common/CommonInstructSet.js @@ -1229,7 +1229,10 @@ const handleOpenSql = async (props, instruct) => { } = props; const { userinfo } = app; - const { data = [] } = instruct; + let { data = [] } = instruct; + if (!data.length) { + data = [instruct]; + } let result = {}; @@ -1365,7 +1368,10 @@ const handleGetSqlValue = async (props, data, srcDatasetRow = {}) => { /************************* 执行sql exesql ************************/ // 执行sql -> 暂存sql,全部执行完后一起执行 const handleExeSql = (props, instruct) => { - const { data = [] } = instruct; + let { data = [] } = instruct; + if (!data.length) { + data = [instruct]; + } const result = []; data.forEach(item => { const { sql, srcDataset } = item; diff --git a/src/components/Common/InstructSetSetting/index.js b/src/components/Common/InstructSetSetting/index.js index 6f7e7f2..8154c83 100644 --- a/src/components/Common/InstructSetSetting/index.js +++ b/src/components/Common/InstructSetSetting/index.js @@ -14,7 +14,7 @@ const InstructSetSetting = (props = {}) => { const { instructSetSettingVisible } = props; if (!instructSetSettingVisible) return ""; - const { onCancelInstructSetSettingModal, showConfig, dataValue, instructSetSettingId, slave0Data, app } = props; + const { name, sFieldName, onCancelInstructSetSettingModal, showConfig, dataValue, instructSetSettingId, slave0Data, app } = props; const { showName, sName } = showConfig; const { currentPane } = app; const { key, parentPaneKey } = currentPane; @@ -97,12 +97,14 @@ const InstructSetSetting = (props = {}) => { const { command, data } = event.data; if (command === "initData") { - if (!bConfigured && props.name !== "master") return; + // if (!bConfigured && props.name !== "master") return; iframeRef.current.contentWindow.postMessage( { + tableName: name, + sFieldName, command: "initData", - value: instructSet.change || instructSet.blur || (instructSet ? [instructSet] : []), + value: instructSet.change || instructSet.blur || (commonUtils.isNotEmptyObject(instructSet) ? [instructSet] : []), slave0Data, configList: configList.current, srcModelsList: srcModelsList.current, @@ -177,7 +179,7 @@ const InstructSetSetting = (props = {}) => { > 格式化 -