Compare commits

..

No commits in common. "9ced807900513a82164d040be52adbea7aa42ebb" and "32198c2026b11f985337e7dd6c63c1fb7a94c134" have entirely different histories.

18 changed files with 57 additions and 354 deletions

View File

@ -86,8 +86,6 @@ AppFluWindow {
} }
} }
FluFilledButton { FluFilledButton {
id: btn_login
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
//normalColor: FluColors.Green.normal //normalColor: FluColors.Green.normal
//normalColor: "#ffffff" //normalColor: "#ffffff"
@ -97,8 +95,7 @@ AppFluWindow {
"username": account.text, "username": account.text,
"password": password.text "password": password.text
} }
btn_login.disabled = true
btn_login.text = "登录中"
Request.post("login", Request.post("login",
JSON.stringify(param), JSON.stringify(param),
function (result, data) { function (result, data) {
@ -111,8 +108,6 @@ AppFluWindow {
console.log(p2) console.log(p2)
//FluApp.navigate("/"); //FluApp.navigate("/");
//window.close(); //window.close();
btn_login.disabled = false
btn_login.text = "登录"
}) })
//HttpClient.doGetRequest( //HttpClient.doGetRequest(

View File

@ -7,14 +7,13 @@ import FluentUI
import org.wangwenx190.FramelessHelper import org.wangwenx190.FramelessHelper
import "qrc:///AicsKnowledgeBase/qml/global" import "qrc:///AicsKnowledgeBase/qml/global"
import "qrc:///AicsKnowledgeBase/qml/page" import "qrc:///AicsKnowledgeBase/qml/page"
import "qrc:///AicsKnowledgeBase/qml/component"
FluWindow { FluWindow {
id: window id: window
width: 1000 width: 1000
height: 640 height: 640
CustomAppBar { FluAppBar {
id: title_bar id: title_bar
title: window.title title: window.title
@ -27,7 +26,6 @@ FluWindow {
} }
RowLayout { RowLayout {
id: tool_bar
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 140 anchors.rightMargin: 140
@ -40,6 +38,24 @@ FluWindow {
// anchors.fill: parent // anchors.fill: parent
// color: "red" // color: "red"
// } // }
Rectangle {
color: FluColors.White
radius: 50
width: 32
height: 32
}
Text {
Layout.margins: {
right: 10
}
text: "用户名"
}
Image {
height: 30
source: "qrc:/AicsKnowledgeBase/res/transfer.svg"
}
} }
RowLayout { RowLayout {
@ -104,7 +120,6 @@ FluWindow {
setHitTestVisible(title_bar.minimizeButton()) setHitTestVisible(title_bar.minimizeButton())
setHitTestVisible(title_bar.maximizeButton()) setHitTestVisible(title_bar.maximizeButton())
setHitTestVisible(title_bar.closeButton()) setHitTestVisible(title_bar.closeButton())
setHitTestVisible(title_bar.transferButton())
title_bar.maximizeButton.visible = true title_bar.maximizeButton.visible = true
// window.backgroundVisible = false // window.backgroundVisible = false
window.show() window.show()

View File

@ -1,200 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Window
import QtQuick.Layouts
import FluentUI
Rectangle {
property string title: ""
property string darkText: "夜间模式"
property string minimizeText: "最小化"
property string restoreText: "向下还原"
property string maximizeText: "最大化"
property string closeText: "关闭"
property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000"
property color minimizeNormalColor: Qt.rgba(0, 0, 0, 0)
property color minimizeHoverColor: FluTheme.dark ? Qt.rgba(1, 1, 1,
0.1) : Qt.rgba(
0, 0, 0, 0.06)
property color maximizeNormalColor: Qt.rgba(0, 0, 0, 0)
property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1, 1, 1,
0.1) : Qt.rgba(
0, 0, 0, 0.06)
property color closeNormalColor: Qt.rgba(0, 0, 0, 0)
property color closeHoverColor: Qt.rgba(251 / 255, 115 / 255, 115 / 255, 1)
property bool showDark: false
property bool titleVisible: true
property bool isMac: FluTools.isMacos()
property color borerlessColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property var maxClickListener: function () {
if (d.win.visibility === Window.Maximized)
d.win.visibility = Window.Windowed
else
d.win.visibility = Window.Maximized
}
property var minClickListener: function () {
d.win.visibility = Window.Minimized
}
property var closeClickListener: function () {
d.win.close()
}
property var darkClickListener: function () {
if (FluTheme.dark) {
FluTheme.darkMode = FluDarkMode.Light
} else {
FluTheme.darkMode = FluDarkMode.Dark
}
}
id: root
color: Qt.rgba(0, 0, 0, 0)
height: visible ? 44 : 0
opacity: visible
z: 65535
Item {
id: d
property var win: Window.window
property bool isRestore: win && Window.Maximized === win.visibility
property bool resizable: win
&& !(win.minimumHeight === win.maximumHeight
&& win.maximumWidth === win.minimumWidth)
}
TapHandler {
onTapped: if (tapCount === 2)
btn_maximize.clicked()
gesturePolicy: TapHandler.DragThreshold
}
DragHandler {
target: null
grabPermissions: TapHandler.CanTakeOverFromAnything
onActiveChanged: if (active) {
d.win.startSystemMove()
}
}
FluText {
text: title
anchors {
verticalCenter: parent.verticalCenter
left: isMac ? undefined : parent.left
leftMargin: isMac ? undefined : 10
horizontalCenter: isMac ? parent.horizontalCenter : undefined
}
visible: root.titleVisible
color: root.textColor
}
RowLayout {
anchors.right: parent.right
height: root.height
spacing: 0
Item {
height: 32
width: 32
Layout.rightMargin: 10
FluIconButton {
id: btn_transfer
anchors.fill: parent
onClicked: {
transferList_popup.open()
}
}
Image {
height: 18
width: 18
anchors.centerIn: parent
source: "qrc:/AicsKnowledgeBase/res/transfer.svg"
}
TransferListPopup {
id: transferList_popup
}
}
Text {
Layout.margins: {
right: 10
}
text: "用户名"
}
Rectangle {
Layout.rightMargin: 10
color: FluColors.White
radius: 50
width: 32
height: 32
}
RowLayout {
Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: 5
visible: showDark
spacing: 5
FluText {
text: darkText
color: root.textColor
}
FluToggleSwitch {
id: btn_dark
checked: FluTheme.dark
clickListener: () => darkClickListener(btn_dark)
}
}
FluIconButton {
id: btn_minimize
width: 40
height: 30
iconSource: FluentIcons.ChromeMinimize
Layout.alignment: Qt.AlignTop
iconSize: 11
text: minimizeText
radius: 0
visible: !isMac
iconColor: root.textColor
color: hovered ? minimizeHoverColor : minimizeNormalColor
onClicked: minClickListener()
}
FluIconButton {
id: btn_maximize
width: 40
height: 30
iconSource: d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
color: hovered ? maximizeHoverColor : maximizeNormalColor
Layout.alignment: Qt.AlignTop
visible: d.resizable && !isMac
radius: 0
iconColor: root.textColor
text: d.isRestore ? restoreText : maximizeText
iconSize: 11
onClicked: maxClickListener()
}
FluIconButton {
id: btn_close
iconSource: FluentIcons.ChromeClose
Layout.alignment: Qt.AlignTop
text: closeText
width: 40
height: 30
visible: !isMac
radius: 0
iconSize: 10
iconColor: hovered ? Qt.rgba(1, 1, 1, 1) : root.textColor
color: hovered ? closeHoverColor : closeNormalColor
onClicked: closeClickListener()
}
}
function minimizeButton() {
return btn_minimize
}
function maximizeButton() {
return btn_maximize
}
function closeButton() {
return btn_close
}
function transferButton() {
return btn_transfer
}
}

View File

@ -1,66 +0,0 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Window
import QtQuick.Layouts
import FluentUI
Popup {
id: transfer_popup
x: parent ? (parent.width - implicitWidth) / 2 : 0
y: parent ? parent.height : 0
background: FluArea {
implicitWidth: 300
implicitHeight: 200
color: "#f8f8f8"
radius: 5
FluShadow {}
}
contentItem: Item {
anchors.top: parent.top
ListModel //-
{
id: itemModel
ListElement {
name: "Apple"
progressValue: 0.1
}
ListElement {
name: "Orange"
progressValue: 1
}
ListElement {
name: "Banana"
progressValue: 0.6
}
}
Component //-
{
id: itemDelegate
ColumnLayout {
spacing: 10
width: parent.width
Text {
Layout.topMargin: 10
text: name
}
FluProgressBar {
Layout.fillWidth: true
progress: progressValue
indeterminate: false
}
}
}
ListView //-
{
anchors.fill: parent
model: itemModel
delegate: itemDelegate
}
}
}

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true

View File

@ -9,7 +9,7 @@ import FluentUI
FluArea { FluArea {
id: content_area id: content_area
paddings: 0 paddings: 0
backgroundColor: "#f9f9f9" color: "#f9f9f9"
property string type: null property string type: null
property int knowledgeFileId property int knowledgeFileId
signal download(string knowledgeFileId) signal download(string knowledgeFileId)

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
paddings: 10 paddings: 10

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
paddings: 10 paddings: 10

View File

@ -8,7 +8,7 @@ import "qrc:///AicsKnowledgeBase/qml/component"
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@ -20,9 +20,5 @@ FluArea {
text: "" text: ""
} }
FluButton {
text: "上传"
}
FileList {} FileList {}
} }

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
paddings: 10 paddings: 10

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
paddings: 10 paddings: 10

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
paddings: 10 paddings: 10

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 20 Layout.topMargin: 20

View File

@ -7,7 +7,7 @@ import FluentUI
FluArea { FluArea {
property string url: '' property string url: ''
backgroundColor: "#f9f9f9" color: "#f9f9f9"
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
paddings: 10 paddings: 10

View File

@ -1,10 +0,0 @@
//
// Created by wuyiz on 2023/7/1.
//
#include "FileTransferManager.h"
FileTransferManager::FileTransferManager(QObject *parent) : QObject(parent)
{
}

View File

@ -1,20 +0,0 @@
//
// Created by wuyiz on 2023/7/1.
//
#ifndef AICSKNOWLEDGEBASE_FILETRANSFERMANAGER_H
#define AICSKNOWLEDGEBASE_FILETRANSFERMANAGER_H
#include <QObject>
class FileTransferManager: public QObject
{
Q_OBJECT
public:
explicit FileTransferManager(QObject *parent = nullptr);
};
#endif //AICSKNOWLEDGEBASE_FILETRANSFERMANAGER_H

View File

@ -8,11 +8,10 @@
#include <FramelessHelper/Quick/framelessquickmodule.h> #include <FramelessHelper/Quick/framelessquickmodule.h>
#include <FramelessHelper/Core/private/framelessconfig_p.h> #include <FramelessHelper/Core/private/framelessconfig_p.h>
#include "HttpClient.h" #include "HttpClient.h"
#include "FileTransferManager.h"
FRAMELESSHELPER_USE_NAMESPACE FRAMELESSHELPER_USE_NAMESPACE
int main(int argc, char *argv[]) int main(int argc, char* argv[])
{ {
//将样式设置为Basic不然会导致组件显示异常 //将样式设置为Basic不然会导致组件显示异常
qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
@ -22,8 +21,8 @@ int main(int argc, char *argv[])
FramelessHelper::Quick::initialize(); FramelessHelper::Quick::initialize();
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
QGuiApplication::setOrganizationName("HFUT Software"); app.setOrganizationName("HFUT Software");
QGuiApplication::setApplicationName("Aics Knowledge"); app.setApplicationName("Aics Knowledge");
#ifdef Q_OS_WIN // 此设置仅在Windows下生效 #ifdef Q_OS_WIN // 此设置仅在Windows下生效
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder); FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
@ -38,24 +37,18 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
FramelessHelper::Quick::registerTypes(&engine); FramelessHelper::Quick::registerTypes(&engine);
auto httpClient = new HttpClient(engine); HttpClient* httpClient = new HttpClient(engine);
auto fileTransferManager = new FileTransferManager();
qmlRegisterSingletonInstance<HttpClient>("AicsKB.HttpClient", 1, 0, "HttpClient", httpClient); qmlRegisterSingletonInstance<HttpClient>("AicsKB.HttpClient", 1, 0, "HttpClient", httpClient);
qmlRegisterSingletonInstance<FileTransferManager>("AicsKB.FileTransferManager", 1, 0, "FileTransferManager",
fileTransferManager);
const QUrl url(u"qrc:/AicsKnowledgeBase/qml/App.qml"_qs); const QUrl url(u"qrc:/AicsKnowledgeBase/qml/App.qml"_qs);
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) { &app, [url](QObject* obj, const QUrl& objUrl) {
if (!obj && url == objUrl) if (!obj && url == objUrl)
QCoreApplication::exit(-1); QCoreApplication::exit(-1);
}, Qt::QueuedConnection); }, Qt::QueuedConnection);
engine.load(url); engine.load(url);
auto result = QGuiApplication::exec(); auto result = app.exec();
httpClient->deleteLater(); httpClient->deleteLater();
fileTransferManager->deleteLater();
return result; return result;
} }

@ -1 +1 @@
Subproject commit 04dc772cb4f99415687d5a4292917837c39d9874 Subproject commit 7b30ccfd22823c51f5ed8e3ff649737c76ae0ce6