1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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.000';
- }
- };
- 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.000';
- }
- };
- return {setFxTreeStyle, FxTreeStyle, setGridSelectStyle, setTpThousandthFormat, setThousandthFormat};
- })();
|