From 0245e64a9dff794903e546c3bdf9fef7efeefdf1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 十二月 2022 16:09:04 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/utils/utils-custom.js | 63 ++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 11 deletions(-) diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 77d77ab..a7a4398 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -277,6 +277,31 @@ } /** + * @description 鑾峰彇涓婄骇妯″潡 + * @return {String} selfId 褰撳墠缁勪欢id + */ + static checkSupModules (modules, supId) { + let has = false + + let check = (list) => { + list.forEach(m => { + if (has) return + if (supId === m.value) { + has = true + return + } + if (m.children) { + check(m.children) + } + }) + } + + check(modules) + + return has + } + + /** * @description 鑾峰彇鍙叧鑱旀ā鍧� */ static getLinkModules (components) { @@ -598,6 +623,9 @@ if (em) { item.setting.supModule = '' } + if (item.wrap && item.wrap.supModule) { + item.wrap.supModule = item.setting.supModule + } } if (item.wrap && item.wrap.doubleClick) { @@ -805,16 +833,10 @@ } if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { - let em = false - item.setting.supModule = item.setting.supModule.map(c => { - if (!uuids[c]) { - em = true - } - return uuids[c] || '' - }) - if (em) { - item.setting.supModule = '' - } + item.setting.supModule = '' + } + if (item.wrap && item.wrap.supModule) { + item.wrap.supModule = '' } if (item.wrap && item.wrap.doubleClick) { @@ -850,6 +872,25 @@ } /** + * @description 鑾峰彇鍥捐〃楂樺害 + */ +export function getHeight (val) { + if (typeof(val) === 'string') { + if (val.indexOf('px') > -1) { + val = parseFloat(val) + } else if (val.indexOf('vw') > -1) { + val = parseFloat(val) + val = document.body.clientWidth * val / 100 + } else if (val.indexOf('vh') > -1) { + val = parseFloat(val) + val = document.body.clientHeight * val / 100 + } + } + + return parseInt(val || 400) - 30 +} + +/** * @description 鑾峰彇琛ㄥ悕 */ export function getTables (config, pops) { @@ -860,7 +901,7 @@ if (config.setting && (!config.wrap || !config.wrap.datatype || config.wrap.datatype === 'dynamic')) { if (config.setting.interType === 'system') { - if (config.setting.execute !== 'false') { + if (config.setting.execute !== 'false' && config.setting.dataresource) { let tbs = config.setting.dataresource.match(cutreg) tbs && cuts.push(...tbs) } -- Gitblit v1.8.0