From 5e871a4164869bac7927ea6884dbadd650b1cadf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 25 五月 2023 11:25:28 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/custom/index.jsx | 172 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 92 insertions(+), 80 deletions(-) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 1ddc4d0..f10ec65 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -473,53 +473,6 @@ item.search = Utils.initSearchVal(item.search) } - if (item.type === 'table') { - let statFields = [] - let getCols = (cols) => { - return cols.filter(col => { - if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { - return false - } else if (col.Hide === 'true') { - return false - } - - if (col.type === 'number') { - if (col.sum === 'true' && !statFields.includes(col.field)) { - statFields.push(col) - } - if (typeof(col.decimal) === 'number') { - col.round = Math.pow(10, col.decimal) - if (col.format === 'percent') { - col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 - } - } - } else if (col.type === 'colspan') { - col.subcols = getCols(col.subcols || []) - if (col.subcols.length === 0) { - return false - } - } else if (col.type === 'custom') { - col.elements = col.elements.map(cell => { - cell = this.resetElement(cell) - return cell - }) - } - - if (col.linkmenu && col.linkmenu.length > 0) { - let menu_id = col.linkmenu.pop() - col.linkThdMenu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menu_id)[0] || '' - } else { - col.linkThdMenu = '' - } - - return true - }) - } - - item.cols = getCols(item.cols) - item.statFields = statFields - } - let mutil = false if (item.wrap && item.wrap.supType === 'multi') { // 鏁版嵁鍗″涓婄骇缁勪欢 mutil = true @@ -531,6 +484,12 @@ } else { item.setting.supModule = '' } + } + + let pass = skip + + if (item.wrap && item.wrap.permission === 'false') { + pass = true } // 鏉冮檺杩囨护 @@ -553,11 +512,90 @@ cell = this.getPrinter(cell, item.uuid) } - return skip || permAction[cell.uuid] + return pass || permAction[cell.uuid] }) } - if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { + if (item.type === 'table') { + let statFields = [] + let getCols = (cols) => { + return cols.filter(col => { + if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { + return false + } else if (col.Hide === 'true') { + return false + } else if (col.type === 'action') { + col.type = 'custom' + } + + if (col.type === 'number') { + if (col.sum === 'true' && !statFields.includes(col.field)) { + statFields.push(col) + } + if (typeof(col.decimal) === 'number') { + col.round = Math.pow(10, col.decimal) + if (col.format === 'percent') { + col.decimal = col.decimal > 2 ? col.decimal - 2 : 0 + } + } + } else if (col.type === 'formula') { + if (typeof(col.decimal) === 'number') { + col.round = Math.pow(10, col.decimal) + } + } else if (col.type === 'colspan') { + col.subcols = getCols(col.subcols || []) + if (col.subcols.length === 0) { + return false + } + } else if (col.type === 'custom') { + col.elements = col.elements.filter(cell => { + if (cell.eleType === 'button') { + if (cell.hidden === 'true') return false + + cell = this.resetButton(item, cell, popview) + + if (cell.syncComponentId === item.setting.supModule) { + cell.syncComponentId = '' + if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { + cell.execSuccess = 'mainline' + } + } + + if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� + cell = this.getPrinter(cell, item.uuid) + } + + return pass || permAction[cell.uuid] + } else { + cell = this.resetElement(cell) + } + return true + }) + + if (col.elements.length === 0) { + return false + } + } + + if (col.linkmenu && col.linkmenu.length > 0) { + let menu_id = col.linkmenu.pop() + col.linkThdMenu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menu_id)[0] || '' + } else { + col.linkThdMenu = '' + } + + return true + }) + } + + item.cols = getCols(item.cols) + item.statFields = statFields + + if (item.subtype === 'editable') { + item.submit.logLabel = item.$menuname + '-鎻愪氦' + item.submit.$menuId = item.uuid + } + } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { item.subcards && item.subcards.forEach(card => { if (card.style.boxShadow) { delete card.style.hShadow @@ -586,7 +624,7 @@ cell = this.resetElement(cell) } - return cell.eleType !== 'button' || skip || permAction[cell.uuid] + return cell.eleType !== 'button' || pass || permAction[cell.uuid] }) if (!card.backElements || card.backElements.length === 0) return @@ -611,7 +649,7 @@ cell = this.resetElement(cell) } - return cell.eleType !== 'button' || skip || permAction[cell.uuid] + return cell.eleType !== 'button' || pass || permAction[cell.uuid] }) }) } else if (item.type === 'balcony') { @@ -642,36 +680,8 @@ cell = this.resetElement(cell) } - return cell.eleType !== 'button' || skip || permAction[cell.uuid] + return cell.eleType !== 'button' || pass || permAction[cell.uuid] }) - } else if (item.type === 'table') { - item.cols = item.cols.filter(col => { - if (col.type !== 'action') return true - col.elements = col.elements.filter(cell => { - if (cell.hidden === 'true') return false - - cell = this.resetButton(item, cell, popview) - - if (cell.syncComponentId === item.setting.supModule) { - cell.syncComponentId = '' - if (cell.execSuccess === 'line' || cell.execSuccess === 'grid') { - cell.execSuccess = 'mainline' - } - } - - if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 鎵撳嵃鏈鸿缃� - cell = this.getPrinter(cell, item.uuid) - } - - return skip || permAction[cell.uuid] - }) - return col.elements.length !== 0 - }) - - if (item.subtype === 'editable') { - item.submit.logLabel = item.$menuname + '-鎻愪氦' - item.submit.$menuId = item.uuid - } } else if (item.type === 'form') { item.subcards = item.subcards.map(group => { group.subButton.uuid = group.uuid @@ -805,6 +815,8 @@ if (cell.format === 'percent') { cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 } + } else if (cell.eleType === 'formula' && typeof(cell.decimal) === 'number') { + cell.round = Math.pow(10, cell.decimal) } } else if (cell.eleType === 'icon') { if (!cell.innerHeight) { // 鍏煎 -- Gitblit v1.8.0