AicsKnowledgeBase_client/AicsKnowledgeBase/qml/MainWindow.qml

177 lines
4.6 KiB
QML
Raw Normal View History

2023-06-18 00:06:24 +08:00
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Basic
import FluentUI
2023-07-06 17:16:55 +08:00
import SignalFileOperation 1.0
2023-06-18 00:06:24 +08:00
import org.wangwenx190.FramelessHelper
2023-06-21 21:33:52 +08:00
import "qrc:///AicsKnowledgeBase/qml/global"
2023-06-30 21:30:04 +08:00
import "qrc:///AicsKnowledgeBase/qml/page"
2023-07-02 15:58:02 +08:00
import "qrc:///AicsKnowledgeBase/qml/component"
2023-06-18 00:06:24 +08:00
FluWindow {
id: window
2023-06-21 21:33:52 +08:00
width: 1000
height: 640
2023-06-18 00:06:24 +08:00
2023-07-02 15:58:02 +08:00
CustomAppBar {
2023-06-18 00:06:24 +08:00
id: title_bar
title: window.title
username: UserData.username
2023-06-18 00:06:24 +08:00
anchors {
left: parent.left
right: parent.right
top: parent.top
2023-06-21 21:33:52 +08:00
leftMargin: 35
2023-06-18 00:06:24 +08:00
}
}
2023-06-21 21:33:52 +08:00
RowLayout {
anchors.fill: parent
FluNavigationView {
id: nav_view
Layout.fillHeight: true
Layout.preferredWidth: 400
Layout.bottomMargin: 4
z: 999
items: NavItems
footerItems: FooterItems
topPadding: 5
displayMode: FluNavigationView.Compact
logo: "qrc:/AicsKnowledgeBase/res/logo.png"
title: "智能客服知识库"
Behavior on rotation {
NumberAnimation {
duration: 167
}
}
transformOrigin: Item.Center
Component.onCompleted: {
NavItems.navigationView = nav_view
FooterItems.navigationView = nav_view
setCurrentIndex(0)
}
2023-06-18 00:06:24 +08:00
}
2023-07-06 17:16:55 +08:00
StackView {
id: stack_view
2023-06-30 21:30:04 +08:00
Layout.fillHeight: true
2023-06-30 23:31:28 +08:00
Layout.fillWidth: true
Layout.topMargin: 45
Layout.bottomMargin: 4
Layout.rightMargin: 4
pushEnter: Transition {
PropertyAnimation {
property: "opacity"
from: 0
to: 1
duration: 200
}
}
pushExit: Transition {
PropertyAnimation {
property: "opacity"
from: 1
to: 0
duration: 200
}
}
popEnter: Transition {
PropertyAnimation {
property: "opacity"
from: 0
to: 1
duration: 200
}
}
popExit: Transition {
PropertyAnimation {
property: "opacity"
from: 1
to: 0
duration: 200
}
}
2023-07-06 20:26:47 +08:00
initialItem: create_note_view
2023-07-06 17:16:55 +08:00
}
Connections {
target: SignalFileOperation
function onOpen(file) {
2023-07-06 21:21:15 +08:00
stack_view.clear()
2023-07-07 00:48:58 +08:00
UserData.viewHistory.push(file)
2023-07-06 23:01:10 +08:00
stack_view.push(file_view, {
"knowledgeFileId": file
})
2023-07-06 17:16:55 +08:00
}
function onOpenNote(note) {
stack_view.push(note_view, {
"noteFileId": note
})
2023-07-06 17:16:55 +08:00
}
function onBack() {
if (stack_view.depth > 0)
2023-07-06 17:16:55 +08:00
stack_view.pop()
}
2023-07-06 23:01:10 +08:00
function onCreateNote() {
stack_view.push(create_note_view)
}
2023-06-30 21:30:04 +08:00
}
2023-06-30 23:31:28 +08:00
2023-07-06 17:16:55 +08:00
Component {
id: file_view
ContentPage {}
2023-07-06 17:16:55 +08:00
}
Component {
id: note_view
NotePage {}
2023-07-06 17:16:55 +08:00
}
2023-07-06 20:26:47 +08:00
Component {
id: create_note_view
2023-07-06 23:01:10 +08:00
CreateNotePage {}
2023-07-06 20:26:47 +08:00
}
// ContentPage {
// Layout.fillHeight: true
// Layout.fillWidth: true
// Layout.topMargin: 45
// Layout.bottomMargin: 4
// Layout.rightMargin: 4
// type: "md"
// }
2023-07-06 17:16:55 +08:00
2023-06-30 23:31:28 +08:00
2023-06-30 21:30:04 +08:00
/*
2023-06-21 21:33:52 +08:00
FluArea {
Layout.fillHeight: true
Layout.fillWidth: true
paddings: 10
Layout.topMargin: 45
Layout.bottomMargin: 4
Layout.rightMargin: 4
FluText {
Layout.topMargin: 20
text: "Content"
}
2023-06-30 21:30:04 +08:00
}*/
2023-06-21 21:33:52 +08:00
}
2023-06-18 00:06:24 +08:00
FramelessHelper {
id: framless_helper
onReady: {
setTitleBarItem(title_bar)
moveWindowToDesktopCenter()
2023-07-03 17:13:47 +08:00
title_bar.setHitTestVisibleItems(framless_helper)
2023-06-18 00:06:24 +08:00
title_bar.maximizeButton.visible = true
// window.backgroundVisible = false
window.show()
}
}
}