dream-num / univer

Univer is an Isomorphic Full-Stack Framework for Creating and Editing Spreadsheets, Docs, and Slides Across Web and Server
https://univer.ai
Apache License 2.0
7.07k stars 619 forks source link

[Bug] When creating a worksheet, the data validation parameter renderMode=1 is displayed; the selection arrow is displayed, but the style is still a bar label #3066

Closed jiongjiongkui closed 2 months ago

jiongjiongkui commented 2 months ago

在您提交此问题之前,您是否检查了以下内容?

受影响的包和版本

Release v0.2.7

复现链接

https://stackblitz.com/edit/vitejs-vite-xd2gtb?file=src%2FApp.vue


const data = {
    "id": "workbook-01",
    "name": "Sheets Feature",
    "sheetOrder": [
        "sheet-01"
    ],
    "sheets": {
        "sheet-01": {
            "id": "sheet-01",
            "name": "sheet001",
            "cellData": {
                "1": {
                    "2": {
                        "v": "3",
                        "s": {
                            "n": {}
                        },
                        "t": 1
                    },
                    "3": {
                        "v": "6"
                    }
                },
                "2": {
                    "2": {
                        "v": "32",
                        "s": {
                            "n": {}
                        },
                        "t": 1
                    },
                    "3": {
                        "v": "6"
                    }
                },
                "3": {
                    "2": {
                        "v": "37.0",
                        "s": {
                            "n": {}
                        },
                        "t": 1
                    },
                    "3": {
                        "v": "6"
                    }
                }
            },
            "tabColor": "",
            "hidden": 0,
            "rowCount": 1000,
            "columnCount": 20,
            "zoomRatio": 1,
            "freeze": {
                "xSplit": 0,
                "ySplit": 0,
                "startRow": -1,
                "startColumn": -1
            },
            "scrollTop": 0,
            "scrollLeft": 0,
            "defaultColumnWidth": 88,
            "defaultRowHeight": 24,
            "mergeData": [],
            "rowData": {},
            "columnData": {},
            "showGridlines": 1,
            "rowHeader": {
                "width": 46,
                "hidden": 0
            },
            "columnHeader": {
                "height": 20,
                "hidden": 0
            },
            "selections": [
                "A1"
            ],
            "rightToLeft": 0
        }
    },
    "resources": [
        {
            "name": "SHEET_DATA_VALIDATION_PLUGIN",
            "data": "{\"sheet-01\":[{\"uid\":\"Ib_-Us\",\"type\":\"list\",\"ranges\":[{\"startRow\":0,\"startColumn\":2,\"endRow\":6,\"endColumn\":2}],\"formula1\":\"3\",\"formula2\":\"transparent\",\"renderMode\":\"1\",\"bizInfo\":{}}]}"
        }
    ]
}

univer.createUnit(UniverInstanceType.UNIVER_SHEET, data);

预期行为

{ startRow: 0, startColumn: 2, endRow: 6, endColumn: 2 } 范围里的单元格, 数据验证样式是 “箭

实际行为

image

{ startRow: 0, startColumn: 2, endRow: 6, endColumn: 2 } 范围里的单元格, 数据验证样式是 “条状标签”

运行环境

Chrome

系统信息

No response

univer-bot[bot] commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

Origin Title: [Bug] 创建工作表时,数据验证传参数 renderMode=1;有显示选中箭头,但是样式还是条状标签

Title: [Bug] When creating a worksheet, the data validation parameter renderMode=1 is displayed; the selection arrow is displayed, but the style is still a bar label


Before you submitted this question, did you check the following?

Affected packages and versions

Release v0.2.7

Recurrence link

https://stackblitz.com/edit/vitejs-vite-xd2gtb?file=src%2FApp.vue


const data = {
    "id": "workbook-01",
    "name": "Sheets Feature",
    "sheetOrder": [
        "sheet-01"
    ],
    "sheets": {
        "sheet-01": {
            "id": "sheet-01",
            "name": "sheet001",
            "cellData": {
                "1": {
                    "2": {
                        "v": "3",
                        "s": {
                            "n": {}
                        },
                        "t": 1
                    },
                    "3": {
                        "v": "6"
                    }
                },
                "2": {
                    "2": {
                        "v": "32",
                        "s": {
                            "n": {}
                        },
                        "t": 1
                    },
                    "3": {
                        "v": "6"
                    }
                },
                "3": {
                    "2": {
                        "v": "37.0",
                        "s": {
                            "n": {}
                        },
                        "t": 1
                    },
                    "3": {
                        "v": "6"
                    }
                }
            },
            "tabColor": "",
            "hidden": 0,
            "rowCount": 1000,
            "columnCount": 20,
            "zoomRatio": 1,
            "freeze": {
                "xSplit": 0,
                "ySplit": 0,
                "startRow": -1,
                "startColumn": -1
            },
            "scrollTop": 0,
            "scrollLeft": 0,
            "defaultColumnWidth": 88,
            "defaultRowHeight": 24,
            "mergeData": [],
            "rowData": {},
            "columnData": {},
            "showGridlines": 1,
            "rowHeader": {
                "width": 46,
                "hidden": 0
            },
            "columnHeader": {
                "height": 20,
                "hidden": 0
            },
            "selections": [
                "A1"
            ],
            "rightToLeft": 0
        }
    },
    "resources": [
        {
            "name": "SHEET_DATA_VALIDATION_PLUGIN",
            "data": "{\"sheet-01\":[{\"uid\":\"Ib_-Us\",\"type\":\"list\",\"ranges\":[{ \"startRow\":0,\"startColumn\":2,\"endRow\":6,\"endColumn\":2}],\"formula1\":\"3\",\"formula2\ ":\"transparent\",\"renderMode\":\"1\",\"bizInfo\":{}}]}"
        }
    ]
}

univer.createUnit(UniverInstanceType.UNIVER_SHEET, data);

Expected behavior

{ startRow: 0, startColumn: 2, endRow: 6, endColumn: 2 } For cells in the range, the data validation style is "arrow

Actual behavior

image

{ startRow: 0, startColumn: 2, endRow: 6, endColumn: 2 } Cells in the range, the data validation style is "bar label"

Running environment

Chrome

System information

No response

weird94 commented 2 months ago
{
    id: 'workbook-01',
    name: 'Sheets Feature',
    sheetOrder: [
        'sheet-01',
    ],
    sheets: {
        'sheet-01': {
            id: 'sheet-01',
            name: 'sheet001',
            cellData: {
                1: {
                    2: {
                        v: '3',
                        s: {
                            n: {},
                        },
                        t: 1,
                    },
                    3: {
                        v: '6',
                    },
                },
                2: {
                    2: {
                        v: '32',
                        s: {
                            n: {},
                        },
                        t: 1,
                    },
                    3: {
                        v: '6',
                    },
                },
                3: {
                    2: {
                        v: '37.0',
                        s: {
                            n: {},
                        },
                        t: 1,
                    },
                    3: {
                        v: '6',
                    },
                },
            },
            tabColor: '',
            hidden: 0,
            rowCount: 1000,
            columnCount: 20,
            zoomRatio: 1,
            freeze: {
                xSplit: 0,
                ySplit: 0,
                startRow: -1,
                startColumn: -1,
            },
            scrollTop: 0,
            scrollLeft: 0,
            defaultColumnWidth: 88,
            defaultRowHeight: 24,
            mergeData: [],
            rowData: {},
            columnData: {},
            showGridlines: 1,
            rowHeader: {
                width: 46,
                hidden: 0,
            },
            columnHeader: {
                height: 20,
                hidden: 0,
            },
            selections: [
                'A1',
            ],
            rightToLeft: 0,
        },
    },
    resources: [
        {
            name: 'SHEET_DATA_VALIDATION_PLUGIN',
            data: '{"sheet-01":[{"uid":"Ib_-Us","type":"list","ranges":[{"startRow":0,"startColumn":2,"endRow":6,"endColumn":2}],"formula1":"3","formula2":"transparent","renderMode":1,"bizInfo":{}}]}',
        },
    ],
};

使用这个snapshot 主要的问题在于renderMode的类型是一个number,而你的数据里面错误的使用了string类型

univer-bot[bot] commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

{
    id: 'workbook-01',
    name: 'Sheets Feature',
    sheetOrder: [
        'sheet-01',
    ],
    sheets: {
        'sheet-01': {
            id: 'sheet-01',
            name: 'sheet001',
            cellData: {
                1: {
                    2: {
                        v: '3',
                        s: {
                            n: {},
                        },
                        t: 1,
                    },
                    3: {
                        v: '6',
                    },
                },
                2: {
                    2: {
                        v: '32',
                        s: {
                            n: {},
                        },
                        t: 1,
                    },
                    3: {
                        v: '6',
                    },
                },
                3: {
                    2: {
                        v: '37.0',
                        s: {
                            n: {},
                        },
                        t: 1,
                    },
                    3: {
                        v: '6',
                    },
                },
            },
            tabColor: '',
            hidden: 0,
            rowCount: 1000,
            columnCount: 20,
            zoomRatio: 1,
            freeze: {
                xSplit: 0,
                ySplit: 0,
                startRow: -1,
                startColumn: -1,
            },
            scrollTop: 0,
            scrollLeft: 0,
            defaultColumnWidth: 88,
            defaultRowHeight: 24,
            mergeData: [],
            rowData: {},
            columnData: {},
            showGridlines: 1,
            rowHeader: {
                width: 46,
                hidden: 0,
            },
            columnHeader: {
                height: 20,
                hidden: 0,
            },
            selections: [
                'A1',
            ],
            rightToLeft: 0,
        },
    },
    resources: [
        {
            name: 'SHEET_DATA_VALIDATION_PLUGIN',
            data: '{"sheet-01":[{"uid":"Ib_-Us","type":"list","ranges":[{"startRow":0,"startColumn":2,"endRow":6,"endColumn":2}],"formula1":"3","formula2":"transparent","renderMode":1,"bizInfo":{}}]}',
        },
    ],
};

使用这个snapshot 主要的问题在于renderMode的类型是一个number,而你的数据里面错误的使用了string类型