Skip to content

Commit 235341e

Browse files
authored
Merge pull request #787 from qxqzx13/master
fix table odd and even background color
2 parents c7e9490 + f2f21e3 commit 235341e

File tree

9 files changed

+19
-45
lines changed

9 files changed

+19
-45
lines changed

frontend/src/app/components/ChartGraph/BasicTableChart/AntdTableWrapper.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,13 @@ const StyledTable = styled(Table)<{ tableStyleConfig?: TableStyleConfigProps }>`
9292
background: #fafafa;
9393
}
9494
95-
.ant-table .ant-table-container .ant-table-body .ant-table-tbody td {
96-
background: transparent;
97-
}
98-
99-
.odd {
95+
.ant-table .ant-table-container .ant-table-body .odd td{
10096
background: ${p =>
10197
p?.tableStyleConfig?.odd?.backgroundColor || 'transparent'};
10298
color: ${p => p?.tableStyleConfig?.odd?.color || 'auto'};
10399
}
104100
105-
.even {
101+
.ant-table .ant-table-container .ant-table-body .even td{
106102
background: ${p =>
107103
p?.tableStyleConfig?.even?.backgroundColor || 'transparent'};
108104
color: ${p => p?.tableStyleConfig?.even?.color || 'auto'};

frontend/src/app/components/ChartGraph/ClusterBarChart/config.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ const config: ChartConfig = {
436436
],
437437
settings: [
438438
{
439-
label: 'paging.title',
439+
label: 'viz.palette.setting.paging.title',
440440
key: 'paging',
441441
comType: 'group',
442442
rows: [
443443
{
444-
label: 'paging.pageSize',
444+
label: 'viz.palette.setting.paging.pageSize',
445445
key: 'pageSize',
446446
default: 1000,
447447
comType: 'inputNumber',
@@ -537,10 +537,6 @@ const config: ChartConfig = {
537537
title: '参考线',
538538
open: '点击参考线配置',
539539
},
540-
paging: {
541-
title: '常规',
542-
pageSize: '总行数',
543-
},
544540
},
545541
},
546542
{
@@ -612,10 +608,6 @@ const config: ChartConfig = {
612608
title: 'Reference Line',
613609
open: 'Open',
614610
},
615-
paging: {
616-
title: 'Paging',
617-
pageSize: 'Page Size',
618-
},
619611
},
620612
},
621613
],

frontend/src/app/components/ChartGraph/ClusterColumnChart/config.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ const config: ChartConfig = {
436436
],
437437
settings: [
438438
{
439-
label: 'paging.title',
439+
label: 'viz.palette.setting.paging.title',
440440
key: 'paging',
441441
comType: 'group',
442442
rows: [
443443
{
444-
label: 'paging.pageSize',
444+
label: 'viz.palette.setting.paging.pageSize',
445445
key: 'pageSize',
446446
default: 1000,
447447
comType: 'inputNumber',
@@ -537,10 +537,6 @@ const config: ChartConfig = {
537537
title: '参考线',
538538
open: '点击参考线配置',
539539
},
540-
paging: {
541-
title: '常规',
542-
pageSize: '总行数',
543-
},
544540
},
545541
},
546542
{
@@ -612,10 +608,6 @@ const config: ChartConfig = {
612608
title: 'Reference Line',
613609
open: 'Open',
614610
},
615-
paging: {
616-
title: 'Paging',
617-
pageSize: 'Page Size',
618-
},
619611
},
620612
},
621613
],

frontend/src/app/components/ChartGraph/PivotSheetChart/config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,6 @@ const config: ChartConfig = {
377377
subTotalPosition: 'Sub Total Position',
378378
aggregateFields: 'Summary Fields',
379379
},
380-
paging: {
381-
title: 'Paging',
382-
pageSize: 'Page Size',
383-
},
384380
},
385381
},
386382
],

frontend/src/app/components/ChartGraph/ScoreChart/config.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ const config: ChartConfig = {
250250
],
251251
settings: [
252252
{
253-
label: 'paging.title',
253+
label: 'viz.palette.setting.paging.title',
254254
key: 'paging',
255255
comType: 'group',
256256
rows: [
257257
{
258-
label: 'paging.pageSize',
258+
label: 'viz.palette.setting.paging.pageSize',
259259
key: 'pageSize',
260260
default: 1000,
261261
comType: 'inputNumber',
@@ -287,10 +287,6 @@ const config: ChartConfig = {
287287
bodyFontSize: '主体字体大小',
288288
footerFontSize: '尾部字体大小',
289289
},
290-
paging: {
291-
title: '常规',
292-
pageSize: '总行数',
293-
},
294290
},
295291
},
296292
{
@@ -311,10 +307,6 @@ const config: ChartConfig = {
311307
bodyFontSize: 'Body Font Size',
312308
footerFontSize: 'Footer Font Size',
313309
},
314-
paging: {
315-
title: 'Paging',
316-
pageSize: 'Page Size',
317-
},
318310
},
319311
},
320312
],

frontend/src/app/components/FormGenerator/Basic/BasicInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { BW } from './components/BasicWrapper';
2828
const BasicInput: FC<ItemLayoutProps<ChartStyleConfig>> = memo(
2929
({ ancestors, translate: t = title => title, data, onChange }) => {
3030
const [cache, setCache] = useState(data);
31-
const { comType, options, disabled, ...rest } = cache;
31+
const { comType, options, disabled, label, ...rest } = cache;
3232

3333
const debouncedDataChange = useMemo(
3434
() =>
@@ -39,7 +39,7 @@ const BasicInput: FC<ItemLayoutProps<ChartStyleConfig>> = memo(
3939
);
4040

4141
return (
42-
<Wrapper label={t(cache.label, true)}>
42+
<Wrapper label={t(data?.label, true)}>
4343
<Input
4444
disabled={data?.disabled}
4545
{...rest}

frontend/src/app/components/FormGenerator/Basic/BasicInputNumber.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { BW } from './components/BasicWrapper';
2929
const BasicInputNumber: FC<ItemLayoutProps<ChartStyleConfig>> = memo(
3030
({ ancestors, translate: t = title => title, data, onChange }) => {
3131
const [cache, setCache] = useState(data);
32-
const { comType, options, disabled, ...rest } = cache;
32+
const { comType, options, disabled, label, ...rest } = cache;
3333

3434
const debouncedDataChange = useMemo(
3535
() =>
@@ -40,7 +40,7 @@ const BasicInputNumber: FC<ItemLayoutProps<ChartStyleConfig>> = memo(
4040
);
4141

4242
return (
43-
<Wrapper label={t(cache.label, true)}>
43+
<Wrapper label={t(data?.label, true)}>
4444
<InputNumber
4545
disabled={data?.disabled}
4646
{...rest}

frontend/src/app/types/ChartConfigDTO.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type ChartStyleConfigDTO = {
2323
key: string;
2424
value?: any;
2525
rows?: ChartStyleConfigDTO[];
26+
comType?: string;
2627
};
2728

2829
export type ChartDataConfigDTO = ChartDataConfig & {};

frontend/src/app/utils/internalChartHelper.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,12 @@ export function mergeChartStyleConfigs(
413413
const sEle =
414414
'key' in tEle ? source?.find(s => s?.key === tEle.key) : source?.[index];
415415

416-
if (!isUndefined(sEle?.['value'])) {
416+
if (!isUndefined(sEle?.['value']) && (!sEle?.comType || !tEle.comType)) {
417+
tEle['value'] = sEle?.['value'];
418+
} else if (
419+
!isUndefined(sEle?.['value']) &&
420+
sEle?.comType === tEle.comType
421+
) {
417422
tEle['value'] = sEle?.['value'];
418423
}
419424
if (!isEmptyArray(tEle?.rows)) {

0 commit comments

Comments
 (0)