Compare commits
No commits in common. "db82f35384be816d100b19673b67ecdfe04e6d1d" and "83c05d97c55a776fc24bac3999d4fb298c8cb386" have entirely different histories.
db82f35384
...
83c05d97c5
|
@ -105,12 +105,6 @@ AppFluWindow {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
UserData.username = param.username
|
UserData.username = param.username
|
||||||
|
|
||||||
Request.get("user",
|
|
||||||
function (res, data) {
|
|
||||||
console.log("userId:")
|
|
||||||
console.log(data.id)
|
|
||||||
UserData.userId = data.id
|
|
||||||
})
|
|
||||||
FluApp.navigate("/")
|
FluApp.navigate("/")
|
||||||
window.close()
|
window.close()
|
||||||
}, function (p1, p2) {
|
}, function (p1, p2) {
|
||||||
|
|
|
@ -47,6 +47,7 @@ FluArea {
|
||||||
signal download(string knowledgeFileId)
|
signal download(string knowledgeFileId)
|
||||||
signal clickTags(string tagName)
|
signal clickTags(string tagName)
|
||||||
|
|
||||||
|
|
||||||
// paddings: {
|
// paddings: {
|
||||||
// top: 10
|
// top: 10
|
||||||
// right: 0
|
// right: 0
|
||||||
|
@ -93,9 +94,7 @@ FluArea {
|
||||||
content_page.title = data.name
|
content_page.title = data.name
|
||||||
content_page.fileId = data.knowledgeFileAttribute.id
|
content_page.fileId = data.knowledgeFileAttribute.id
|
||||||
|
|
||||||
content_area.type = getType(
|
content_area.type = data.knowledgeFileAttribute.suffix
|
||||||
data.knowledgeFileAttribute.suffix)
|
|
||||||
console.log(content_area.type)
|
|
||||||
|
|
||||||
var tagString = ""
|
var tagString = ""
|
||||||
for (var j = 0; j < data.knowledgeFileAttribute.tags.length; j++) {
|
for (var j = 0; j < data.knowledgeFileAttribute.tags.length; j++) {
|
||||||
|
@ -113,11 +112,9 @@ FluArea {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// content_page.favoriteCount = starers.length
|
// content_page.favoriteCount = starers.length
|
||||||
if (content_area.type == "MD") {
|
if (content_area.type === "MD") {
|
||||||
console.log(content_area.type)
|
FileTransferManager.getMarkdown(content_page.fileId)
|
||||||
FileTransferManager.getMarkdown(
|
} else if (content_area.type === "VIDEO") {
|
||||||
content_page.fileId)
|
|
||||||
} else if (content_area.type == "VIDEO") {
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Request.get("knowledge/" + knowledgeFileId + "/preview/external",
|
Request.get("knowledge/" + knowledgeFileId + "/preview/external",
|
||||||
|
@ -133,13 +130,11 @@ FluArea {
|
||||||
Connections {
|
Connections {
|
||||||
target: FileTransferManager
|
target: FileTransferManager
|
||||||
onMarkdownData: data => {
|
onMarkdownData: data => {
|
||||||
console.log(data)
|
content_view.push(text_view, {contentMd: data})
|
||||||
content_view.push(text_view, {
|
|
||||||
"contentMd": data
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
loadFile(knowledgeFileId)
|
loadFile(knowledgeFileId)
|
||||||
console.log(content_area.type)
|
console.log(content_area.type)
|
||||||
|
@ -239,6 +234,7 @@ FluArea {
|
||||||
FileTransferManager.download(content_page.fileId,
|
FileTransferManager.download(content_page.fileId,
|
||||||
content_page.title)
|
content_page.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +296,7 @@ FluArea {
|
||||||
StackView {
|
StackView {
|
||||||
id: content_view
|
id: content_view
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
height: 500
|
height: width*10/16
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
@ -315,16 +311,15 @@ FluArea {
|
||||||
NoteEditPage {
|
NoteEditPage {
|
||||||
noteId: "255454"
|
noteId: "255454"
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: width * 9 / 16
|
height: width*9/16
|
||||||
isEditable: true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
id: other_view
|
id: other_view
|
||||||
WebEngineView {
|
WebEngineView {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: width * 9 / 16
|
|
||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
|
implicitHeight: 200
|
||||||
settings.javascriptEnabled: true
|
settings.javascriptEnabled: true
|
||||||
settings.pluginsEnabled: true
|
settings.pluginsEnabled: true
|
||||||
url: "https://www.baidu.com"
|
url: "https://www.baidu.com"
|
||||||
|
|
|
@ -19,10 +19,10 @@ FluArea {
|
||||||
property string noteContent
|
property string noteContent
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
noteTitle = Qt.binding(function () {
|
noteTitle = Qt.binding(function() {
|
||||||
return input_title.text
|
return input_title.text
|
||||||
})
|
})
|
||||||
noteContent = Qt.binding(function () {
|
noteContent = Qt.binding(function() {
|
||||||
return input_md.contentMd
|
return input_md.contentMd
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -60,12 +60,13 @@ FluArea {
|
||||||
FluTextBox {
|
FluTextBox {
|
||||||
id: input_title
|
id: input_title
|
||||||
padding: 10
|
padding: 10
|
||||||
placeholderText: "单行输入框"
|
placeholderText:"单行输入框"
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FluText {
|
FluText {
|
||||||
padding: 10
|
padding: 10
|
||||||
text: "内容"
|
text: "内容"
|
||||||
|
@ -79,9 +80,8 @@ FluArea {
|
||||||
id: input_md
|
id: input_md
|
||||||
noteId: "255454"
|
noteId: "255454"
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: width * 9 / 16
|
height: width*9/16
|
||||||
isEditable: true
|
isEditable: true
|
||||||
isEditing: true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
@ -25,33 +25,16 @@ FluArea {
|
||||||
bottomPadding: 0
|
bottomPadding: 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
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
|
textArea_edit.text = edit_area.contentMd
|
||||||
edit_area.contentMd = Qt.binding(function () {
|
edit_area.contentMd = Qt.binding(
|
||||||
return textArea_edit.text
|
function() {
|
||||||
})
|
return textArea_edit.text
|
||||||
textArea_preview.text = Qt.binding(function () {
|
})
|
||||||
return edit_area.contentMd
|
textArea_preview.text = Qt.binding(
|
||||||
})
|
function() {
|
||||||
|
return edit_area.contentMd
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@ -128,12 +111,12 @@ FluArea {
|
||||||
|
|
||||||
FluIconButton {
|
FluIconButton {
|
||||||
id: button_subfield
|
id: button_subfield
|
||||||
iconSource: md_show_view.isPreviewShowing ? FluentIcons.ClosePane : FluentIcons.OpenPane
|
iconSource: md_show_view.isPreviewShowing ? FluentIcons.ClosePane: FluentIcons.OpenPane
|
||||||
iconSize: 12
|
iconSize: 12
|
||||||
text: "分栏"
|
text: "分栏"
|
||||||
visible: false
|
visible: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (md_show_view.isEditShowing ^ md_show_view.isPreviewShowing) {
|
if(md_show_view.isEditShowing ^ md_show_view.isPreviewShowing) {
|
||||||
md_show_view.isEditShowing = true
|
md_show_view.isEditShowing = true
|
||||||
md_show_view.isPreviewShowing = true
|
md_show_view.isPreviewShowing = true
|
||||||
} else {
|
} else {
|
||||||
|
@ -169,7 +152,7 @@ FluArea {
|
||||||
property bool isPreviewShowing: true
|
property bool isPreviewShowing: true
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: width * 8 / 16
|
implicitHeight: width * 8/16
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
id: edit_show_view
|
id: edit_show_view
|
||||||
|
@ -180,10 +163,10 @@ FluArea {
|
||||||
id: textArea_edit
|
id: textArea_edit
|
||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: customTextArea.focus ? "#E0E0E0" : "white"
|
color: customTextArea.focus ? "#E0E0E0" : "white"
|
||||||
border.color: FluColors.Grey30
|
border.color: FluColors.Grey30
|
||||||
radius: 10
|
radius: 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,10 +180,10 @@ FluArea {
|
||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
textFormat: TextEdit.MarkdownText
|
textFormat: TextEdit.MarkdownText
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: customTextArea.focus ? "#E0E0E0" : "white"
|
color: customTextArea.focus ? "#E0E0E0" : "white"
|
||||||
border.color: FluColors.Grey30
|
border.color: FluColors.Grey30
|
||||||
radius: 10
|
radius: 10
|
||||||
}
|
}
|
||||||
readOnly: true
|
readOnly: true
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -418,7 +418,7 @@ void FileTransferManager::getMarkdown(const QString &fileId)
|
||||||
auto fileUrl = std::format("File/{}?rangeStart={}&rangeEnd={}", fileId.toStdString(), 0, size);
|
auto fileUrl = std::format("File/{}?rangeStart={}&rangeEnd={}", fileId.toStdString(), 0, size);
|
||||||
std::string fileData;
|
std::string fileData;
|
||||||
auto res = httpGet(fileUrl, fileData);
|
auto res = httpGet(fileUrl, fileData);
|
||||||
qDebug() << fileData.c_str();
|
//qDebug() << fileData.c_str();
|
||||||
emit markdownData(QString::fromStdString(fileData));
|
emit markdownData(QString::fromStdString(fileData));
|
||||||
//qDebug() << "End Get" << res;
|
//qDebug() << "End Get" << res;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue