const sjsSettingObj = (function () { const FxTreeStyle = { jz: 'jianzhu', }; const setJzFxTreeStyle = function (setting) { setting.selectedBackColor = '#fffacd'; setting.tree = { getFont: function (sheet, data, row, col, defaultFont) { if (sheet.zh_tree && data.level === 1) { return 'bold ' + defaultFont; } else { return defaultFont; } }, getColor: function (sheet, data, row, col, defaultColor) { if (sheet.zh_tree) { if (data.level === 2) { return '#C4CAFB'; } else if ((!data.b_code || data.b_code === '') && data.level > 2) { return '#DFE8F9'; } else { return defaultColor; } } else { return defaultColor; } } } }; const setFxTreeStyle = function (setting, tag) { switch (tag) { case FxTreeStyle.jz: setJzFxTreeStyle(setting); break; } }; const setGridSelectStyle = function (setting) { setting.selectedBackColor = '#fffacd'; }; const setTpThousandthFormat = function (setting, fields = []) { for (const col of setting.cols) { if (col.field === 'total_price' || col.field.indexOf('tp') >= 0 || fields.indexOf(col.field) >= 0) col.formatter = '#,##0.######'; } }; const setThousandthFormat = function (setting, fields) { for (const f of fields) { const col = setting.cols.find(function (x) { return x.field === f }); if (col) col.formatter = '#,##0.######'; } }; const setPropValue = function (setting, fields, prop, value) { for (const f of fields) { const col = setting.cols.find(function (x) { return x.field === f }); if (col) col[prop] = value; } }; return {setFxTreeStyle, FxTreeStyle, setGridSelectStyle, setTpThousandthFormat, setThousandthFormat, setPropValue}; })();