添加预览

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 NavItems 1.0 NavItems.qml
singleton FooterItems 1.0 FooterItems.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 { NoteList {
id: noteList id: noteList
onOpen: function handle(noteId) { onOpen: function handle(noteId) {
console.log("open note: " + noteId) emit: SignalFileOperation.openNote(noteId)
} }
onCreateNote: function handle() { onCreateNote: function handle() {
console.log("create note") console.log("create note")
@ -40,10 +40,10 @@ FluArea {
id: content_area id: content_area
paddings: 0 paddings: 0
backgroundColor: "#f9f9f9" backgroundColor: "#f9f9f9"
// visible: false // visible: false
property string type: "" property string type: ""
property string knowledgeFileId property string knowledgeFileId
signal back() signal back
signal download(string knowledgeFileId) signal download(string knowledgeFileId)
signal clickTags(string tagName) signal clickTags(string tagName)
@ -53,7 +53,6 @@ FluArea {
// bottom: 10 // bottom: 10
// left: 10 // left: 10
// } // }
FluScrollablePage { FluScrollablePage {
id: content_page id: content_page
anchors.fill: parent anchors.fill: parent
@ -107,11 +106,23 @@ FluArea {
content_page.brief = data.knowledgeFileAttribute.brief content_page.brief = data.knowledgeFileAttribute.brief
content_page.browsCount = data.knowledgeFileAttribute.pageView content_page.browsCount = data.knowledgeFileAttribute.pageView
var starers = data.knowledgeFileAttribute.starers // var starers = data.knowledgeFileAttribute.starers
for (var i = 0; i < starers.length; i++) { // 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 Layout.margins: -5
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: 50 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 Layout.fillWidth: true
backgroundColor: "transparent" implicitHeight: 400
implicitHeight: 200
settings.javascriptEnabled: true
settings.pluginsEnabled: true
url: "https://www.baidu.com"
} }
// StackView { Component {
// id: content_view id: video_view
// Layout.fillWidth: true FluMediaPlayer {
// implicitHeight: 400 width: parent.width
// initialItem: other_view implicitHeight: width * 9 / 16.
// } }
}
// Component { Component {
// id: video_view id: text_view
// FluMediaPlayer { NoteEditPage {
// width: parent.width noteId: "255454"
// implicitHeight: width * 9 / 16. width: parent.width
// } implicitHeight: 400
// } }
// Component { }
// id: text_view Component {
// NoteEditPage { id: other_view
// noteId: "255454" WebEngineView {
// width: parent.width width: parent.width
// implicitHeight: 400 backgroundColor: "transparent"
// } implicitHeight: 200
// } settings.javascriptEnabled: true
// Component { settings.pluginsEnabled: true
// id: other_view url: "https://www.baidu.com"
// 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); auto res = httpDownload(fileUrl, savePath, item);
qDebug() << "End Get" << res; qDebug() << "End Get" << res;
}); });
} }
void FileTransferManager::pause(const QString &fileId) void FileTransferManager::pause(const QString &fileId)