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 import "qrc:///AicsKnowledgeBase/qml/page" import "qrc:///AicsKnowledgeBase/qml/component" import "qrc:///AicsKnowledgeBase/qml/global" FluArea { Popup { id: popup modal: true //模态, 为 true后弹出窗口会叠加一个独特的背景调光效果 focus: true //焦点, 当弹出窗口实际接收到焦点时,activeFocus将为真 padding: 0 closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside property var raiseItem: null background: Rectangle { color: Qt.rgba(0, 0, 0, 0) //背景为无色 } FluArea { width: 350 height: 500 backgroundColor: "#f9f9f9" NoteList { id: noteList onOpen: function handle(noteId) { console.log("open note: " + noteId) } onCreateNote: function handle() { console.log("create note") } } } } id: content_area paddings: 0 backgroundColor: "#f9f9f9" // visible: false property string type: "" property string knowledgeFileId signal back() signal download(string knowledgeFileId) signal clickTags(string tagName) // paddings: { // top: 10 // right: 0 // bottom: 10 // left: 10 // } FluScrollablePage { id: content_page anchors.fill: parent leftPadding: 10 topPadding: 10 rightPadding: 10 bottomPadding: 0 property string fileId property int noteCount: 0 property int favoriteCount: 0 property int shareCount: 0 property int browsCount: 555 property bool isFavorite: false property bool isDownload: false property double fileSize: 455 property string title: "文章标题" property list tags: ["tag 1", "tag 2", "tag 3"] property var publishTime property string brief: "这是一个简介" function getType(suffix) { if(suffix === "md") return "MD" else if(suffix === "mp4" || suffix === "avi" || suffix === "rmvb" || suffix === "rm" || suffix === "wmv" || suffix === "mkv") return "VIDEO" else return "OTHER" } function loadFile(knowledgeFileId) { content_area.knowledgeFileId = knowledgeFileId console.log(knowledgeFileId) Request.get("knowledge/" + knowledgeFileId, function (response, data) { content_page.publishTime = data.createTime content_page.title = data.name content_page.fileId = data.knowledgeFileAttribute.id content_area.type = data.knowledgeFileAttribute.suffix var tagString = "" for (var j = 0; j < data.knowledgeFileAttribute.tags.length; j++) { if (j != 0) tagString = tagString + "," tagString = tagString + data.knowledgeFileAttribute.tags[j].name } content_page.tags = tagString.split(",") content_page.brief = data.knowledgeFileAttribute.brief content_page.browsCount = data.knowledgeFileAttribute.pageView var starers = data.knowledgeFileAttribute.starers for(var i=0; i