diff --git a/src/components/Report/ListReport.vue b/src/components/Report/ListReport.vue index ecba6955..9313a444 100644 --- a/src/components/Report/ListReport.vue +++ b/src/components/Report/ListReport.vue @@ -95,6 +95,7 @@ import WithScroll from '../WithScroll.vue'; export default defineComponent({ props: { report: Report, + direction: String, }, data() { return { @@ -140,9 +141,9 @@ export default defineComponent({ getCellStyle(cell, i) { const styles = {}; const width = cell.width ?? 1; - const align = cell.align ?? 'left'; + // const align = cell.align ?? this.direction == 'rtl' ? 'right' : 'left'; styles['width'] = `${width * this.wconst}rem`; - styles['text-align'] = align; + styles['text-align'] = this.direction == 'rtl' ? 'right' : 'left'; if (cell.bold) { styles['font-weight'] = 'bold'; @@ -153,7 +154,11 @@ export default defineComponent({ } if (i === 0) { - styles['padding-left'] = '0px'; + if(this.direction == 'rtl'){ + styles['padding-right'] = '0px'; + }else{ + styles['padding-left'] = '0px'; + } } if ( @@ -164,15 +169,23 @@ export default defineComponent({ FieldTypeEnum.Float, ].includes(cell.fieldtype) ) { - styles['text-align'] = 'right'; + styles['text-align'] = this.direction == 'rtl' ? 'right' : 'left'; } if (i === this.report.columns.length - 1) { - styles['padding-right'] = '0px'; + if(this.direction == 'rtl'){ + styles['padding-left'] = '0px'; + }else{ + styles['padding-right'] = '0px'; + } } if (cell.indent) { - styles['padding-left'] = `${cell.indent * 2}rem`; + if(this.direction == 'rtl'){ + styles['padding-right'] = `${cell.indent * 2}rem`; + }else{ + styles['padding-left'] = `${cell.indent * 2}rem`; + } } return styles; diff --git a/src/pages/ChartOfAccounts.vue b/src/pages/ChartOfAccounts.vue index 7dd9d502..2149f494 100644 --- a/src/pages/ChartOfAccounts.vue +++ b/src/pages/ChartOfAccounts.vue @@ -31,7 +31,7 @@ account.level !== 0 ? 'text-base' : 'text-lg', isQuickEditOpen(account) ? 'bg-gray-200' : '', ]" - :style="`height: calc(var(--h-row-mid) + 1px); padding-left: calc(1rem + 2rem * ${account.level})`" + :style="getItemStyle(account.level)" @click="onClick(account)" > @@ -88,9 +88,7 @@ items-center text-base " - :style="`height: calc(var(--h-row-mid) + 1px); padding-left: calc(1rem + 2rem * ${ - account.level + 1 - })`" + :style="getGroupStyle(account.level+1)" :key="account.name + '-adding-account'" > { this.refetchTotals = true; @@ -460,6 +462,28 @@ export default { template: icons[account.name] || icon, }; }, + getItemStyle(level){ + const styles = { + "height": "calc(var(--h-row-mid) + 1px)" + }; + if(this.direction == 'rtl'){ + styles['padding-right'] = `calc(1rem + 2rem * ${level})`; + }else{ + styles['padding-left'] = `calc(1rem + 2rem * ${level})`; + } + return styles + }, + getGroupStyle(level){ + const styles = { + "height": "height: calc(var(--h-row-mid) + 1px)" + }; + if(this.direction == 'rtl'){ + styles['padding-right'] = `calc(1rem + 2rem * ${level})`; + }else{ + styles['padding-left'] = `calc(1rem + 2rem * ${level})`; + } + return styles + } }, computed: { allAccounts() { diff --git a/src/pages/Report.vue b/src/pages/Report.vue index 3f306770..029ef7e7 100644 --- a/src/pages/Report.vue +++ b/src/pages/Report.vue @@ -33,7 +33,7 @@ - +