diff --git a/package/component/src/component/switch/index.less b/package/component/src/component/switch/index.less index d871c191..2e3e6da3 100644 --- a/package/component/src/component/switch/index.less +++ b/package/component/src/component/switch/index.less @@ -85,13 +85,12 @@ .layui-form-switch em { position: relative; - top: 0; - width: 25px; - padding: 0 !important; text-align: center !important; color: #999 !important; font-style: normal !important; font-size: 12px; + width: 25px; + top: 0; } .layui-form-onswitch { diff --git a/package/component/src/component/table/TableRow.vue b/package/component/src/component/table/TableRow.vue index 0c57e91f..f70da8db 100644 --- a/package/component/src/component/table/TableRow.vue +++ b/package/component/src/component/table/TableRow.vue @@ -176,7 +176,7 @@ const renderFixedStyle = (column: any, columnIndex: number) => { if (column.fixed == "left") { var left = 0; for (var i = 0; i < columnIndex; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "left") { + if (props.columns[i].fixed && props.columns[i].fixed == "left" && props.tableColumnKeys.includes(props.columns[i].key)) { left = left + props.columns[i]?.width.replace("px", ""); } } @@ -184,7 +184,7 @@ const renderFixedStyle = (column: any, columnIndex: number) => { } else { var right = 0; for (var i = columnIndex + 1; i < props.columns.length; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "right") { + if (props.columns[i].fixed && props.columns[i].fixed == "right" && props.tableColumnKeys.includes(props.columns[i].key)) { right = right + props.columns[i]?.width.replace("px", ""); } } @@ -193,7 +193,7 @@ const renderFixedStyle = (column: any, columnIndex: number) => { } else { var isLast = true; for (var i = columnIndex + 1; i < props.columns.length; i++) { - if (props.columns[i].fixed == undefined) { + if (props.columns[i].fixed == undefined && props.tableColumnKeys.includes(props.columns[i].key)) { isLast = false; } } @@ -207,7 +207,7 @@ const renderFixedClassName = (column: any, columnIndex: number) => { if (column.fixed == "left") { var left = true; for (var i = columnIndex + 1; i < props.columns.length; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "left") { + if (props.columns[i].fixed && props.columns[i].fixed == "left" && props.tableColumnKeys.includes(props.columns[i].key)) { left = false; } } @@ -215,7 +215,7 @@ const renderFixedClassName = (column: any, columnIndex: number) => { } else { var right = true; for (var i = 0; i < columnIndex; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "right") { + if (props.columns[i].fixed && props.columns[i].fixed == "right" && props.tableColumnKeys.includes(props.columns[i].key)) { right = false; } } diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index fde78057..bb8a94cb 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -473,12 +473,15 @@ props.dataSource.map((value: any) => { } }); +/** + * @remark 排除 hide 列 + */ const renderFixedStyle = (column: any, columnIndex: number) => { if (column.fixed) { if (column.fixed == "left") { var left = 0; for (var i = 0; i < columnIndex; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "left") { + if (props.columns[i].fixed && props.columns[i].fixed == "left" && tableColumnKeys.value.includes(props.columns[i].key)) { left = left + props.columns[i]?.width.replace("px", ""); } } @@ -486,7 +489,7 @@ const renderFixedStyle = (column: any, columnIndex: number) => { } else { var right = 0; for (var i = columnIndex + 1; i < props.columns.length; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "right") { + if (props.columns[i].fixed && props.columns[i].fixed == "right" && tableColumnKeys.value.includes(props.columns[i].key)) { right = right + props.columns[i]?.width.replace("px", ""); } } @@ -495,7 +498,7 @@ const renderFixedStyle = (column: any, columnIndex: number) => { } else { var isLast = true; for (var i = columnIndex + 1; i < props.columns.length; i++) { - if (props.columns[i].fixed == undefined) { + if (props.columns[i].fixed == undefined && tableColumnKeys.value.includes(props.columns[i].key)) { isLast = false; } } @@ -504,12 +507,15 @@ const renderFixedStyle = (column: any, columnIndex: number) => { return {} as StyleValue; }; +/** + * @remark 排除 hide 列 + */ const renderFixedClassName = (column: any, columnIndex: number) => { if (column.fixed) { if (column.fixed == "left") { var left = true; for (var i = columnIndex + 1; i < props.columns.length; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "left") { + if (props.columns[i].fixed && props.columns[i].fixed == "left" && tableColumnKeys.value.includes(props.columns[i].key)) { left = false; } } @@ -517,7 +523,7 @@ const renderFixedClassName = (column: any, columnIndex: number) => { } else { var right = true; for (var i = 0; i < columnIndex; i++) { - if (props.columns[i].fixed && props.columns[i].fixed == "right") { + if (props.columns[i].fixed && props.columns[i].fixed == "right" && tableColumnKeys.value.includes(props.columns[i].key)) { right = false; } }