feat: FluTableView增加startRowIndex属性,以支持分页数据场景下正确计算行序号,避免仅依赖表格数据量进行编号
This commit is contained in:
parent
a787a733c4
commit
f2c2beb90a
|
@ -2368,7 +2368,7 @@ Some contents...</source>
|
|||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="176"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="503"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="504"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -2418,37 +2418,37 @@ Some contents...</source>
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="508"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="509"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="522"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="523"/>
|
||||
<source>Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="530"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="531"/>
|
||||
<source>Nickname</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="537"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="538"/>
|
||||
<source>Long String</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="545"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="546"/>
|
||||
<source>Options</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="563"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="564"/>
|
||||
<source><Previous</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="564"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="565"/>
|
||||
<source>Next></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -2557,7 +2557,7 @@ Some contents...</source>
|
|||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="176"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="503"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="504"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished">名称</translation>
|
||||
</message>
|
||||
|
@ -2597,37 +2597,37 @@ Some contents...</source>
|
|||
<translation type="unfinished">焦点未获取:请点击表格中的任意一项,作为插入的靶点!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="508"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="509"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished">头像</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="522"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="523"/>
|
||||
<source>Address</source>
|
||||
<translation type="unfinished">地址</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="530"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="531"/>
|
||||
<source>Nickname</source>
|
||||
<translation type="unfinished">昵称</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="537"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="538"/>
|
||||
<source>Long String</source>
|
||||
<translation type="unfinished">长字符串</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="545"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="546"/>
|
||||
<source>Options</source>
|
||||
<translation type="unfinished">操作</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="563"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="564"/>
|
||||
<source><Previous</source>
|
||||
<translation type="unfinished"><上一页</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TableView.qml" line="564"/>
|
||||
<location filename="qml/page/T_TableView.qml" line="565"/>
|
||||
<source>Next></source>
|
||||
<translation type="unfinished">下一页></translation>
|
||||
</message>
|
||||
|
|
|
@ -493,6 +493,7 @@ FluContentPage{
|
|||
onRowsChanged: {
|
||||
root.checkBoxChanged()
|
||||
}
|
||||
startRowIndex: (gagination.pageCurrent - 1) * gagination.__itemPerPage + 1
|
||||
columnSource:[
|
||||
{
|
||||
title: table_view.customItem(com_column_checbox,{checked:true}),
|
||||
|
|
|
@ -17,6 +17,7 @@ Rectangle {
|
|||
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
|
||||
property bool horizonalHeaderVisible: true
|
||||
property bool verticalHeaderVisible: true
|
||||
property int startRowIndex: 1
|
||||
property color selectedBorderColor: FluTheme.primaryColor
|
||||
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
||||
property alias view: table_view
|
||||
|
@ -841,7 +842,13 @@ Rectangle {
|
|||
Connections{
|
||||
target: table_view
|
||||
function onRowsChanged(){
|
||||
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
|
||||
header_vertical.updateRowIndex()
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: control
|
||||
function onStartRowIndexChanged(){
|
||||
header_vertical.updateRowIndex()
|
||||
}
|
||||
}
|
||||
Timer{
|
||||
|
@ -851,6 +858,9 @@ Rectangle {
|
|||
header_vertical.forceLayout()
|
||||
}
|
||||
}
|
||||
function updateRowIndex(){
|
||||
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+control.startRowIndex}))
|
||||
}
|
||||
}
|
||||
Item{
|
||||
anchors{
|
||||
|
|
|
@ -2778,7 +2778,7 @@ Module {
|
|||
}
|
||||
Property {
|
||||
name: "layoutMacosButtons"
|
||||
type: "FluLoader_QMLTYPE_11"
|
||||
type: "FluLoader_QMLTYPE_12"
|
||||
isReadonly: true
|
||||
isPointer: true
|
||||
}
|
||||
|
@ -3486,8 +3486,8 @@ Module {
|
|||
Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true }
|
||||
Property { name: "topPadding"; type: "int" }
|
||||
Property { name: "pageMode"; type: "int" }
|
||||
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_37"; isPointer: true }
|
||||
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_37"; isPointer: true }
|
||||
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_49"; isPointer: true }
|
||||
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_49"; isPointer: true }
|
||||
Property { name: "navCompactWidth"; type: "int" }
|
||||
Property { name: "navTopMargin"; type: "int" }
|
||||
Property { name: "cellHeight"; type: "int" }
|
||||
|
@ -4092,6 +4092,7 @@ Module {
|
|||
Property { name: "borderColor"; type: "QColor" }
|
||||
Property { name: "horizonalHeaderVisible"; type: "bool" }
|
||||
Property { name: "verticalHeaderVisible"; type: "bool" }
|
||||
Property { name: "startRowIndex"; type: "int" }
|
||||
Property { name: "selectedBorderColor"; type: "QColor" }
|
||||
Property { name: "selectedColor"; type: "QColor" }
|
||||
Property { name: "columnWidthProvider"; type: "QVariant" }
|
||||
|
|
|
@ -17,6 +17,7 @@ Rectangle {
|
|||
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
|
||||
property bool horizonalHeaderVisible: true
|
||||
property bool verticalHeaderVisible: true
|
||||
property int startRowIndex: 1
|
||||
property color selectedBorderColor: FluTheme.primaryColor
|
||||
property color selectedColor: FluTools.withOpacity(FluTheme.primaryColor,0.3)
|
||||
property alias view: table_view
|
||||
|
@ -841,7 +842,13 @@ Rectangle {
|
|||
Connections{
|
||||
target: table_view
|
||||
function onRowsChanged(){
|
||||
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
|
||||
header_vertical.updateRowIndex()
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: control
|
||||
function onStartRowIndexChanged(){
|
||||
header_vertical.updateRowIndex()
|
||||
}
|
||||
}
|
||||
Timer{
|
||||
|
@ -851,6 +858,9 @@ Rectangle {
|
|||
header_vertical.forceLayout()
|
||||
}
|
||||
}
|
||||
function updateRowIndex(){
|
||||
header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+control.startRowIndex}))
|
||||
}
|
||||
}
|
||||
Item{
|
||||
anchors{
|
||||
|
|
Loading…
Reference in New Issue