mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:02:17 +08:00
update
This commit is contained in:
@ -475,46 +475,51 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="430"/>
|
||||
<source>QRCode</source>
|
||||
<source>CodeEditor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="436"/>
|
||||
<source>Tour</source>
|
||||
<source>QRCode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="442"/>
|
||||
<source>Timeline</source>
|
||||
<source>Tour</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
|
||||
<source>Captcha</source>
|
||||
<source>Timeline</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
|
||||
<source>Captcha</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="460"/>
|
||||
<source>Network</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="461"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="467"/>
|
||||
<source>Remote Loader</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="475"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="481"/>
|
||||
<source>Hot Loader</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="481"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<source>3D</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="493"/>
|
||||
<source>Test Crash</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -2376,13 +2381,23 @@ Some contents...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="44"/>
|
||||
<source>Total %1 data, %2 data currently displayed</source>
|
||||
<location filename="qml/page/T_TreeView.qml" line="230"/>
|
||||
<source>Title</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="48"/>
|
||||
<source>A total of %1 data items are selected</source>
|
||||
<location filename="qml/page/T_TreeView.qml" line="238"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="242"/>
|
||||
<source>Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="234"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
@ -475,46 +475,51 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="430"/>
|
||||
<source>CodeEditor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="436"/>
|
||||
<source>QRCode</source>
|
||||
<translation type="unfinished">二维码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="436"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="442"/>
|
||||
<source>Tour</source>
|
||||
<translation type="unfinished">游览</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="442"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
|
||||
<source>Timeline</source>
|
||||
<translation type="unfinished">时间轴</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
|
||||
<source>Captcha</source>
|
||||
<translation type="unfinished">验证码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="460"/>
|
||||
<source>Network</source>
|
||||
<translation type="unfinished">网络</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="461"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="467"/>
|
||||
<source>Remote Loader</source>
|
||||
<translation type="unfinished">远程加载</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="475"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="481"/>
|
||||
<source>Hot Loader</source>
|
||||
<translation type="unfinished">热加载</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="481"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<source>3D</source>
|
||||
<translation type="unfinished">3D</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="493"/>
|
||||
<source>Test Crash</source>
|
||||
<translation type="unfinished">测试崩溃</translation>
|
||||
</message>
|
||||
@ -2459,14 +2464,32 @@ Some contents...</source>
|
||||
<translation type="unfinished">树</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="44"/>
|
||||
<source>Total %1 data, %2 data currently displayed</source>
|
||||
<translation type="unfinished">共计%1条数据,当前显示的%2条数据</translation>
|
||||
<translation type="obsolete">共计%1条数据,当前显示的%2条数据</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="48"/>
|
||||
<source>A total of %1 data items are selected</source>
|
||||
<translation type="unfinished">共计选中%1条数据</translation>
|
||||
<translation type="obsolete">共计选中%1条数据</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="230"/>
|
||||
<source>Title</source>
|
||||
<translation type="unfinished">标题</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="242"/>
|
||||
<source>Address</source>
|
||||
<translation type="unfinished">地址</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="238"/>
|
||||
<source>Avatar</source>
|
||||
<translation type="unfinished">头像</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_TreeView.qml" line="234"/>
|
||||
<source>Name</source>
|
||||
<translation type="unfinished">名称</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -426,6 +426,12 @@ FluObject{
|
||||
FluPaneItemExpander{
|
||||
title: qsTr("Other")
|
||||
icon: FluentIcons.Shop
|
||||
FluPaneItem{
|
||||
title: qsTr("CodeEditor")
|
||||
menuDelegate: paneItemMenu
|
||||
url: "qrc:/example/qml/page/T_CodeEditor.qml"
|
||||
onTap: { navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title: qsTr("QRCode")
|
||||
menuDelegate: paneItemMenu
|
||||
|
@ -9,14 +9,34 @@ FluContentPage {
|
||||
|
||||
title: qsTr("TreeView")
|
||||
|
||||
|
||||
|
||||
function treeData(){
|
||||
const dig = (path = '0', level = 4) => {
|
||||
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
|
||||
function getRandomName(){
|
||||
var randomIndex = Math.floor(Math.random() * names.length)
|
||||
return names[randomIndex]
|
||||
}
|
||||
const addresses = ["傲来国界花果山水帘洞","傲来国界坎源山脏水洞","大唐国界黑风山黑风洞","大唐国界黄风岭黄风洞","大唐国界骷髅山白骨洞","宝象国界碗子山波月洞","宝象国界平顶山莲花洞","宝象国界压龙山压龙洞","乌鸡国界号山枯松涧火云洞","乌鸡国界衡阳峪黑水河河神府"]
|
||||
function getRandomAddresses(){
|
||||
var randomIndex = Math.floor(Math.random() * addresses.length)
|
||||
return addresses[randomIndex]
|
||||
}
|
||||
const avatars = ["qrc:/example/res/svg/avatar_1.svg", "qrc:/example/res/svg/avatar_2.svg", "qrc:/example/res/svg/avatar_3.svg", "qrc:/example/res/svg/avatar_4.svg","qrc:/example/res/svg/avatar_5.svg","qrc:/example/res/svg/avatar_6.svg","qrc:/example/res/svg/avatar_7.svg","qrc:/example/res/svg/avatar_8.svg","qrc:/example/res/svg/avatar_9.svg","qrc:/example/res/svg/avatar_10.svg","qrc:/example/res/svg/avatar_11.svg","qrc:/example/res/svg/avatar_12.svg"]
|
||||
function getRandomAvatar(){
|
||||
var randomIndex = Math.floor(Math.random() * avatars.length);
|
||||
return avatars[randomIndex];
|
||||
}
|
||||
const dig = (path = '0', level = 5) => {
|
||||
const list = [];
|
||||
for (let i = 0; i < 6; i += 1) {
|
||||
for (let i = 0; i < 5; i += 1) {
|
||||
const key = `${path}-${i}`;
|
||||
const treeNode = {
|
||||
title: key,
|
||||
key,
|
||||
_key: key,
|
||||
name: getRandomName(),
|
||||
avatar:tree_view.customItem(com_avatar,{avatar:getRandomAvatar()}),
|
||||
address: getRandomAddresses()
|
||||
};
|
||||
if (level > 0) {
|
||||
treeNode.children = dig(key, level - 1);
|
||||
@ -28,99 +48,202 @@ FluContentPage {
|
||||
return dig();
|
||||
}
|
||||
|
||||
Column{
|
||||
id: layout_column
|
||||
spacing: 12
|
||||
width: 300
|
||||
anchors{
|
||||
top:parent.top
|
||||
left: parent.left
|
||||
leftMargin: 10
|
||||
bottom:parent.bottom
|
||||
bottomMargin: 20
|
||||
}
|
||||
// Row{
|
||||
// id: layout_column
|
||||
// spacing: 12
|
||||
// width: 340
|
||||
// anchors{
|
||||
// top:parent.top
|
||||
// left: parent.left
|
||||
// leftMargin: 10
|
||||
// bottom:parent.bottom
|
||||
// bottomMargin: 20
|
||||
// }
|
||||
// RowLayout{
|
||||
// spacing: 10
|
||||
// FluText{
|
||||
// text: "cellHeight:"
|
||||
// Layout.alignment: Qt.AlignVCenter
|
||||
// }
|
||||
// FluSlider{
|
||||
// id: slider_cell_height
|
||||
// value: 30
|
||||
// from: 30
|
||||
// to:100
|
||||
// }
|
||||
// }
|
||||
// RowLayout{
|
||||
// spacing: 10
|
||||
// FluText{
|
||||
// text: "depthPadding:"
|
||||
// Layout.alignment: Qt.AlignVCenter
|
||||
// }
|
||||
// FluSlider{
|
||||
// id: slider_depth_padding
|
||||
// value: 15
|
||||
// from: 15
|
||||
// to:100
|
||||
// }
|
||||
// }
|
||||
// FluToggleSwitch{
|
||||
// id: switch_showline
|
||||
// text:"showLine"
|
||||
// checked: false
|
||||
// }
|
||||
// FluToggleSwitch{
|
||||
// id: switch_checkable
|
||||
// text:"checkable"
|
||||
// checked: false
|
||||
// }
|
||||
// FluButton{
|
||||
// text: "all expand"
|
||||
// onClicked: {
|
||||
// tree_view.allExpand()
|
||||
// }
|
||||
// }
|
||||
// FluButton{
|
||||
// text: "all collapse"
|
||||
// onClicked: {
|
||||
// tree_view.allCollapse()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
FluText{
|
||||
text: qsTr("Total %1 data, %2 data currently displayed").arg(tree_view.count()).arg(tree_view.visibleCount())
|
||||
}
|
||||
|
||||
FluText{
|
||||
text: qsTr("A total of %1 data items are selected").arg(tree_view.selectionModel().length)
|
||||
}
|
||||
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "cellHeight:"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
id: slider_cell_height
|
||||
value: 30
|
||||
from: 30
|
||||
to:100
|
||||
}
|
||||
}
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "depthPadding:"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
id: slider_depth_padding
|
||||
value: 30
|
||||
from: 30
|
||||
to:100
|
||||
}
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: switch_showline
|
||||
text:"showLine"
|
||||
checked: false
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: switch_draggable
|
||||
text:"draggable"
|
||||
checked: false
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: switch_checkable
|
||||
text:"checkable"
|
||||
checked: false
|
||||
}
|
||||
FluButton{
|
||||
text: "all expand"
|
||||
onClicked: {
|
||||
tree_view.allExpand()
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text: "all collapse"
|
||||
onClicked: {
|
||||
tree_view.allCollapse()
|
||||
Component{
|
||||
id:com_avatar
|
||||
Item{
|
||||
FluClip{
|
||||
anchors.centerIn: parent
|
||||
width: height
|
||||
height: parent.height/3*2
|
||||
radius: [height/2,height/2,height/2,height/2]
|
||||
Image{
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
if(options && options.avatar){
|
||||
return options.avatar
|
||||
}
|
||||
return ""
|
||||
}
|
||||
sourceSize: Qt.size(80,80)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FluFrame{
|
||||
id:layout_controls
|
||||
anchors{
|
||||
left: layout_column.right
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
topMargin: 10
|
||||
}
|
||||
height: 80
|
||||
clip: true
|
||||
Row{
|
||||
spacing: 12
|
||||
anchors{
|
||||
left: parent.left
|
||||
leftMargin: 10
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
Column{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "cellHeight:"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
id: slider_cell_height
|
||||
value: 38
|
||||
from: 38
|
||||
to:100
|
||||
}
|
||||
}
|
||||
RowLayout{
|
||||
spacing: 10
|
||||
FluText{
|
||||
text: "depthPadding:"
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
FluSlider{
|
||||
id: slider_depth_padding
|
||||
value: 15
|
||||
from: 15
|
||||
to:100
|
||||
}
|
||||
}
|
||||
}
|
||||
Column{
|
||||
spacing: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluToggleSwitch{
|
||||
id: switch_showline
|
||||
text:"showLine"
|
||||
checked: false
|
||||
}
|
||||
FluToggleSwitch{
|
||||
id: switch_checkable
|
||||
text:"checkable"
|
||||
checked: false
|
||||
}
|
||||
}
|
||||
Column{
|
||||
spacing: 8
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FluButton{
|
||||
text: "all expand"
|
||||
onClicked: {
|
||||
tree_view.allExpand()
|
||||
}
|
||||
}
|
||||
FluButton{
|
||||
text: "all collapse"
|
||||
onClicked: {
|
||||
tree_view.allCollapse()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FluFrame{
|
||||
anchors{
|
||||
left: parent.left
|
||||
top: layout_controls.bottom
|
||||
topMargin: 10
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
rightMargin: 5
|
||||
topMargin: 5
|
||||
bottomMargin: 5
|
||||
}
|
||||
FluShadow{}
|
||||
FluTreeView{
|
||||
id:tree_view
|
||||
anchors.fill: parent
|
||||
cellHeight: slider_cell_height.value
|
||||
draggable:switch_draggable.checked
|
||||
showLine: switch_showline.checked
|
||||
checkable:switch_checkable.checked
|
||||
depthPadding: slider_depth_padding.value
|
||||
columnSource:[
|
||||
{
|
||||
title: qsTr("Title"),
|
||||
dataIndex: 'title',
|
||||
width: 300
|
||||
},{
|
||||
title: qsTr("Name"),
|
||||
dataIndex: 'name',
|
||||
width: 100
|
||||
},{
|
||||
title: qsTr("Avatar"),
|
||||
dataIndex: 'avatar',
|
||||
width: 100
|
||||
},{
|
||||
title: qsTr("Address"),
|
||||
dataIndex: 'address',
|
||||
width: 200
|
||||
},
|
||||
]
|
||||
Component.onCompleted: {
|
||||
var data = treeData()
|
||||
dataSource = data
|
||||
|
Reference in New Issue
Block a user