VisActor / VTable

VTable is not just a high-performance multidimensional data analysis table, but also a grid artist that creates art between rows and columns.
https://visactor.io/vtable
MIT License
1.6k stars 130 forks source link

[Bug] transpose后第一列宽度没有撑开. #1136

Closed youngwinds closed 6 months ago

youngwinds commented 6 months ago

Image

Expected:

Image

{
    "columns": [
        {
            "field": "0#LINE_NUMBER_DIM_ID_STR",
            "caption": "序号",
            "dataType": "line_number",
            "width": "auto"
        },
        {
            "firstRow": 8025072.194172859,
            "field": "240223163915019",
            "title": "销售额销售额销售额销售额销售额销售额销售额",
            "showSort": false,
            "style": {
                "textAlign": "right",
                "borderColor": [
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8"
                ],
                "borderLineWidth": [
                    1,
                    1,
                    1,
                    1
                ],
                "borderLineDash": [
                    null,
                    null,
                    null,
                    null
                ],
                "padding": [
                    8.6,
                    12,
                    8.6,
                    12
                ],
                "hover": {
                    "cellBgColor": "rgba(186, 215, 255, 0.2)",
                    "inlineRowBgColor": "rgba(186, 215, 255, 0.2)",
                    "inlineColumnBgColor": "rgba(186, 215, 255, 0.2)"
                },
                "fontFamily": "-apple-system,\"Helvetica Neue\",\"PingFang SC\",\"Microsoft YaHei\",\"Hiragino Sans GB\",Helvetica,Arial,sans-serif,\"apple color emoji\",\"segoe ui emoji\",\"segoe ui\",\"segoe ui symbol\"",
                "fontSize": 12,
                "fontStyle": "normal",
                "fontWeight": "normal",
                "fontVariant": "normal",
                "color": "#141414",
                "lineHeight": 18,
                "underline": false,
                "barPositiveColor": "rgba(92,184,85, 0.5)",
                "barNegativeColor": "rgba(55,114,255, 0.5)",
                "barBgColor": "transparent",
                "barAxisColor": "#f5222d",
                "barHeight": "50%",
                "barPadding": [
                    "25%",
                    10
                ],
                "showBarMark": true,
                "barMarkWidth": 2,
                "barMarkPosition": "right",
                "barMarkPositiveColor": "#5cb855",
                "barMarkNegativeColor": "#3772ff",
                "barRightToLeft": true
            },
            "headerStyle": {
                "textAlign": "right",
                "borderColor": [
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8"
                ],
                "borderLineWidth": [
                    1,
                    1,
                    1,
                    1
                ],
                "borderLineDash": [
                    null,
                    null,
                    null,
                    null
                ],
                "padding": [
                    8.6,
                    12,
                    8.6,
                    12
                ],
                "hover": {
                    "cellBgColor": "rgba(0, 100, 250, 0.16)",
                    "inlineRowBgColor": "rgba(255, 255, 255, 0)",
                    "inlineColumnBgColor": "rgba(255, 255, 255, 0)"
                },
                "frameStyle": {
                    "borderColor": [
                        null,
                        "#E1E4E8",
                        null,
                        null
                    ],
                    "borderLineWidth": 1
                },
                "fontFamily": "-apple-system,\"Helvetica Neue\",\"PingFang SC\",\"Microsoft YaHei\",\"Hiragino Sans GB\",Helvetica,Arial,sans-serif,\"apple color emoji\",\"segoe ui emoji\",\"segoe ui\",\"segoe ui symbol\"",
                "fontSize": 12,
                "fontVariant": "normal",
                "fontStyle": "normal",
                "fontWeight": "bold",
                "color": "#1B1F23",
                "bgColor": "#EEF1F5",
                "lineHeight": 18,
                "underline": false
            },
            "dropDownMenu": [
                {
                    "text": "冻结列",
                    "menuKey": "frozen_col",
                    "icon": {
                        "svg": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M7 3V13\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M2 6L7 3\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 9L7 6\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 12L7 9\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M5 13L7 12\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n  </svg>"
                    },
                    "selectedIcon": {
                        "svg": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M7 3V13\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M2 6L7 3\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 9L7 6\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 12L7 9\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M5 13L7 12\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n  </svg>"
                    }
                }
            ],
            "cellType": "progressbar",
            "min": 2891088.6421899796,
            "max": 8025072.194172859,
            "barType": "negative"
        },
        {
            "field": "240223155414027",
            "title": "细分",
            "showSort": false,
            "style": {
                "textAlign": "left",
                "borderColor": [
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8"
                ],
                "borderLineWidth": [
                    1,
                    1,
                    1,
                    1
                ],
                "borderLineDash": [
                    null,
                    null,
                    null,
                    null
                ],
                "padding": [
                    8.6,
                    12,
                    8.6,
                    12
                ],
                "hover": {
                    "cellBgColor": "rgba(186, 215, 255, 0.2)",
                    "inlineRowBgColor": "rgba(186, 215, 255, 0.2)",
                    "inlineColumnBgColor": "rgba(186, 215, 255, 0.2)"
                },
                "fontFamily": "-apple-system,\"Helvetica Neue\",\"PingFang SC\",\"Microsoft YaHei\",\"Hiragino Sans GB\",Helvetica,Arial,sans-serif,\"apple color emoji\",\"segoe ui emoji\",\"segoe ui\",\"segoe ui symbol\"",
                "fontSize": 12,
                "fontStyle": "normal",
                "fontWeight": "normal",
                "fontVariant": "normal",
                "color": "#141414",
                "lineHeight": 18,
                "underline": false
            },
            "headerStyle": {
                "textAlign": "left",
                "underline": true,
                "underlineDash": [
                    2,
                    1
                ],
                "borderColor": [
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8",
                    "#E1E4E8"
                ],
                "borderLineWidth": [
                    1,
                    1,
                    1,
                    1
                ],
                "borderLineDash": [
                    null,
                    null,
                    null,
                    null
                ],
                "padding": [
                    8.6,
                    12,
                    8.6,
                    12
                ],
                "hover": {
                    "cellBgColor": "rgba(0, 100, 250, 0.16)",
                    "inlineRowBgColor": "rgba(255, 255, 255, 0)",
                    "inlineColumnBgColor": "rgba(255, 255, 255, 0)"
                },
                "frameStyle": {
                    "borderColor": [
                        null,
                        "#E1E4E8",
                        null,
                        null
                    ],
                    "borderLineWidth": 1
                },
                "fontFamily": "-apple-system,\"Helvetica Neue\",\"PingFang SC\",\"Microsoft YaHei\",\"Hiragino Sans GB\",Helvetica,Arial,sans-serif,\"apple color emoji\",\"segoe ui emoji\",\"segoe ui\",\"segoe ui symbol\"",
                "fontSize": 12,
                "fontVariant": "normal",
                "fontStyle": "normal",
                "fontWeight": "bold",
                "color": "#1B1F23",
                "bgColor": "#EEF1F5",
                "lineHeight": 18
            },
            "width": "auto",
            "dropDownMenu": [
                {
                    "text": "冻结列",
                    "menuKey": "frozen_col",
                    "icon": {
                        "svg": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M7 3V13\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M2 6L7 3\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 9L7 6\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 12L7 9\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M5 13L7 12\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n  </svg>"
                    },
                    "selectedIcon": {
                        "svg": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M3 2.5C2.17157 2.5 1.5 3.17157 1.5 4V12C1.5 12.8284 2.17157 13.5 3 13.5H13C13.8284 13.5 14.5 12.8284 14.5 12V4C14.5 3.17157 13.8284 2.5 13 2.5H3Z\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M7 3V13\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n    <path d=\"M2 6L7 3\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 9L7 6\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M2 12L7 9\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n    <path d=\"M5 13L7 12\" stroke=\"currentColor\" stroke-width=\"0.7\" stroke-linecap=\"square\"/>\n  </svg>"
                    }
                }
            ],
            "columnType": "link",
            "linkDetect": true,
            "linkJump": false
        }
    ],
    "records": [
        {
            "240223155414027": "消费者",
            "240223163915019": "8025072.194172859",
            "0#LINE_NUMBER_DIM_ID_STR": 1
        },
        {
            "240223155414027": " 公司 ------- ------- ------- ------- -------------- ------- ------- ------- -------------- ------- ------- - ------- ------- ------- -------------- ------- ------- ------- -------------- ------- ------- ------- -------------- ------- ------- ------- -------",
            "240223163915019": "5152793.296570778",
            "0#LINE_NUMBER_DIM_ID_STR": 2
        },
        {
            "240223155414027": "小型企业",
            "240223163915019": "2891088.6421899796",
            "0#LINE_NUMBER_DIM_ID_STR": 3
        }
    ],
    "transpose": true,
    "widthMode": "standard",
    "autoFillWidth": true,
    "columnResizeMode": "header",
    "heightMode": "autoHeight",
    "autoWrapText": true,
    "maxCharactersNumber": 256,
    "keyboardOptions": {
        "copySelected": false
    },
    "menu": {
        "renderMode": "html",
        "dropDownMenuHighlight": []
    },
    "frozenColCount": 0,
    "theme": {
        "underlayBackgroundColor": "rgba(255,255,255,0)",
        "frameStyle": {
            "innerBorder": true,
            "borderColor": "#E1E4E8",
            "borderLineWidth": 1
        },
        "headerStyle": {
            "borderColor": [
                "#E1E4E8",
                "#E1E4E8",
                "#E1E4E8",
                "#E1E4E8"
            ],
            "borderLineWidth": [
                1,
                1,
                1,
                1
            ],
            "borderLineDash": [
                null,
                null,
                null,
                null
            ],
            "padding": [
                8.6,
                12,
                8.6,
                12
            ],
            "hover": {
                "cellBgColor": "rgba(0, 100, 250, 0.16)",
                "inlineRowBgColor": "rgba(255, 255, 255, 0)",
                "inlineColumnBgColor": "rgba(255, 255, 255, 0)"
            },
            "frameStyle": {
                "borderColor": [
                    null,
                    "#E1E4E8",
                    null,
                    null
                ],
                "borderLineWidth": 1
            },
            "fontFamily": "-apple-system,\"Helvetica Neue\",\"PingFang SC\",\"Microsoft YaHei\",\"Hiragino Sans GB\",Helvetica,Arial,sans-serif,\"apple color emoji\",\"segoe ui emoji\",\"segoe ui\",\"segoe ui symbol\"",
            "fontSize": 12,
            "fontVariant": "normal",
            "fontStyle": "normal",
            "fontWeight": "bold",
            "color": "#1B1F23",
            "bgColor": "#EEF1F5",
            "lineHeight": 18,
            "underline": false
        },
        "bodyStyle": {
            "borderColor": [
                "#E1E4E8",
                "#E1E4E8",
                "#E1E4E8",
                "#E1E4E8"
            ],
            "borderLineWidth": [
                1,
                1,
                1,
                1
            ],
            "borderLineDash": [
                null,
                null,
                null,
                null
            ],
            "padding": [
                8.6,
                12,
                8.6,
                12
            ],
            "hover": {
                "cellBgColor": "rgba(186, 215, 255, 0.2)",
                "inlineRowBgColor": "rgba(186, 215, 255, 0.2)",
                "inlineColumnBgColor": "rgba(186, 215, 255, 0.2)"
            },
            "fontFamily": "-apple-system,\"Helvetica Neue\",\"PingFang SC\",\"Microsoft YaHei\",\"Hiragino Sans GB\",Helvetica,Arial,sans-serif,\"apple color emoji\",\"segoe ui emoji\",\"segoe ui\",\"segoe ui symbol\"",
            "fontSize": 12,
            "fontStyle": "normal",
            "fontWeight": "normal",
            "fontVariant": "normal",
            "color": "#141414",
            "lineHeight": 18,
            "underline": false
        },
        "scrollStyle": {
            "visible": "focus",
            "width": 7,
            "hoverOn": true
        },
        "frozenColumnLine": {
            "shadow": {
                "width": 3,
                "startColor": "rgba(225, 228, 232, 0.6)",
                "endColor": "rgba(225, 228, 232, 0.6)"
            }
        }
    },
    "hash": "2c6defd4865058214f98b5ee18cbc32f"
}
fangsmile commented 6 months ago

defaultHeaderColWidth 设置成auto 转置表格中 width仅针对body单元格内容生效