添加预览

main
wuyize 2023-07-06 19:43:57 +08:00
parent f40c6b2865
commit 36250d9615
5 changed files with 75 additions and 50 deletions

View File

@ -0,0 +1,8 @@
pragma Singleton
import QtQuick
QtObject {
property string username
property string userId
}

View File

@ -1,3 +1,4 @@
singleton NavItems 1.0 NavItems.qml
singleton FooterItems 1.0 FooterItems.qml
singleton Request 1.0 Request.qml
singleton Request 1.0 Request.qml
singleton UserData 1.0 UserData.qml

View File

@ -29,7 +29,7 @@ FluArea {
NoteList {
id: noteList
onOpen: function handle(noteId) {
console.log("open note: " + noteId)
emit: SignalFileOperation.openNote(noteId)
}
onCreateNote: function handle() {
console.log("create note")
@ -40,10 +40,10 @@ FluArea {
id: content_area
paddings: 0
backgroundColor: "#f9f9f9"
// visible: false
// visible: false
property string type: ""
property string knowledgeFileId
signal back()
signal back
signal download(string knowledgeFileId)
signal clickTags(string tagName)
@ -53,7 +53,6 @@ FluArea {
// bottom: 10
// left: 10
// }
FluScrollablePage {
id: content_page
anchors.fill: parent
@ -107,11 +106,23 @@ FluArea {
content_page.brief = data.knowledgeFileAttribute.brief
content_page.browsCount = data.knowledgeFileAttribute.pageView
var starers = data.knowledgeFileAttribute.starers
for (var i = 0; i < starers.length; i++) {
// var starers = data.knowledgeFileAttribute.starers
// for (var i = 0; i < starers.length; i++) {
// }
// content_page.favoriteCount = starers.length
if (content_area.type === "MD") {
} else if (content_area.type === "VIDEO") {
} else {
Request.get("knowledge/" + knowledgeFileId + "/preview/external",
function (res) {
content_view.push(other_view, {
"url": res
})
})
}
content_page.favoriteCount = starers.length
})
}
@ -129,7 +140,6 @@ FluArea {
Layout.margins: -5
}
Item {
Layout.fillWidth: true
implicitHeight: 50
@ -268,47 +278,45 @@ FluArea {
}
}
WebEngineView {
// WebEngineView {
// Layout.fillWidth: true
// backgroundColor: "transparent"
// implicitHeight: 200
// settings.javascriptEnabled: true
// settings.pluginsEnabled: true
// url: "https://www.baidu.com"
// }
StackView {
id: content_view
Layout.fillWidth: true
backgroundColor: "transparent"
implicitHeight: 200
settings.javascriptEnabled: true
settings.pluginsEnabled: true
url: "https://www.baidu.com"
implicitHeight: 400
}
// StackView {
// id: content_view
// Layout.fillWidth: true
// implicitHeight: 400
// initialItem: other_view
// }
// Component {
// id: video_view
// FluMediaPlayer {
// width: parent.width
// implicitHeight: width * 9 / 16.
// }
// }
// Component {
// id: text_view
// NoteEditPage {
// noteId: "255454"
// width: parent.width
// implicitHeight: 400
// }
// }
// Component {
// id: other_view
// WebEngineView {
// width: parent.width
// backgroundColor: "transparent"
// implicitHeight: 200
// settings.javascriptEnabled: true
// settings.pluginsEnabled: true
// url: "https://www.baidu.com"
// }
// }
Component {
id: video_view
FluMediaPlayer {
width: parent.width
implicitHeight: width * 9 / 16.
}
}
Component {
id: text_view
NoteEditPage {
noteId: "255454"
width: parent.width
implicitHeight: 400
}
}
Component {
id: other_view
WebEngineView {
width: parent.width
backgroundColor: "transparent"
implicitHeight: 200
settings.javascriptEnabled: true
settings.pluginsEnabled: true
url: "https://www.baidu.com"
}
}
}
}

View File

@ -0,0 +1,10 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtWebEngine 1.2
import FluentUI
import AicsKB.FileTransferManager
import SignalFileOperation 1.0

View File

@ -361,8 +361,6 @@ void FileTransferManager::download(const QString &fileId, const QString &fileNam
auto res = httpDownload(fileUrl, savePath, item);
qDebug() << "End Get" << res;
});
}
void FileTransferManager::pause(const QString &fileId)