Compare commits

..

No commits in common. "db82f35384be816d100b19673b67ecdfe04e6d1d" and "83c05d97c55a776fc24bac3999d4fb298c8cb386" have entirely different histories.

5 changed files with 36 additions and 64 deletions

View File

@ -105,12 +105,6 @@ AppFluWindow {
console.log(data)
UserData.username = param.username
Request.get("user",
function (res, data) {
console.log("userId:")
console.log(data.id)
UserData.userId = data.id
})
FluApp.navigate("/")
window.close()
}, function (p1, p2) {

View File

@ -47,6 +47,7 @@ FluArea {
signal download(string knowledgeFileId)
signal clickTags(string tagName)
// paddings: {
// top: 10
// right: 0
@ -93,9 +94,7 @@ FluArea {
content_page.title = data.name
content_page.fileId = data.knowledgeFileAttribute.id
content_area.type = getType(
data.knowledgeFileAttribute.suffix)
console.log(content_area.type)
content_area.type = data.knowledgeFileAttribute.suffix
var tagString = ""
for (var j = 0; j < data.knowledgeFileAttribute.tags.length; j++) {
@ -113,11 +112,9 @@ FluArea {
// }
// content_page.favoriteCount = starers.length
if (content_area.type == "MD") {
console.log(content_area.type)
FileTransferManager.getMarkdown(
content_page.fileId)
} else if (content_area.type == "VIDEO") {
if (content_area.type === "MD") {
FileTransferManager.getMarkdown(content_page.fileId)
} else if (content_area.type === "VIDEO") {
} else {
Request.get("knowledge/" + knowledgeFileId + "/preview/external",
@ -133,13 +130,11 @@ FluArea {
Connections {
target: FileTransferManager
onMarkdownData: data => {
console.log(data)
content_view.push(text_view, {
"contentMd": data
})
content_view.push(text_view, {contentMd: data})
}
}
Component.onCompleted: {
loadFile(knowledgeFileId)
console.log(content_area.type)
@ -239,6 +234,7 @@ FluArea {
FileTransferManager.download(content_page.fileId,
content_page.title)
}
}
}
@ -300,7 +296,7 @@ FluArea {
StackView {
id: content_view
Layout.fillWidth: true
height: 500
height: width*10/16
}
Component {
@ -316,15 +312,14 @@ FluArea {
noteId: "255454"
width: parent.width
height: width*9/16
isEditable: true
}
}
Component {
id: other_view
WebEngineView {
width: parent.width
height: width * 9 / 16
backgroundColor: "transparent"
implicitHeight: 200
settings.javascriptEnabled: true
settings.pluginsEnabled: true
url: "https://www.baidu.com"

View File

@ -66,6 +66,7 @@ FluArea {
}
}
FluText {
padding: 10
text: "内容"
@ -81,7 +82,6 @@ FluArea {
width: parent.width
height: width*9/16
isEditable: true
isEditing: true
}
RowLayout {

View File

@ -25,31 +25,14 @@ FluArea {
bottomPadding: 0
Component.onCompleted: {
if (isEditing) {
button_edit.visible = false
button_save.visible = true
button_preview.visible = true
button_subfield.visible = true
button_editing.visible = true
button_cancel.visible = true
md_show_view.isEditShowing = true
md_show_view.isPreviewShowing = false
} else {
button_edit.visible = edit_area.isEditable
button_save.visible = false
button_preview.visible = false
button_subfield.visible = false
button_editing.visible = false
button_cancel.visible = false
md_show_view.isEditShowing = false
md_show_view.isPreviewShowing = true
}
textArea_edit.text = edit_area.contentMd
edit_area.contentMd = Qt.binding(function () {
edit_area.contentMd = Qt.binding(
function() {
return textArea_edit.text
})
textArea_preview.text = Qt.binding(function () {
textArea_preview.text = Qt.binding(
function() {
return edit_area.contentMd
})
}

View File

@ -418,7 +418,7 @@ void FileTransferManager::getMarkdown(const QString &fileId)
auto fileUrl = std::format("File/{}?rangeStart={}&rangeEnd={}", fileId.toStdString(), 0, size);
std::string fileData;
auto res = httpGet(fileUrl, fileData);
qDebug() << fileData.c_str();
//qDebug() << fileData.c_str();
emit markdownData(QString::fromStdString(fileData));
//qDebug() << "End Get" << res;
});