Compare commits
No commits in common. "5928e49884fecabe3f73efcfd0a34f9c584039c7" and "b9a89c8db755ab8e5eb9030c11dc62a72b12a4fe" have entirely different histories.
5928e49884
...
b9a89c8db7
|
@ -4,8 +4,6 @@ import QtQuick.Window
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Controls.Basic
|
import QtQuick.Controls.Basic
|
||||||
import FluentUI
|
import FluentUI
|
||||||
import "qrc:///AicsKnowledgeBase/qml/component"
|
|
||||||
import "qrc:///AicsKnowledgeBase/qml/global"
|
|
||||||
|
|
||||||
FluArea {
|
FluArea {
|
||||||
property string url: ''
|
property string url: ''
|
||||||
|
@ -19,75 +17,4 @@ FluArea {
|
||||||
Layout.topMargin: 20
|
Layout.topMargin: 20
|
||||||
text: "History"
|
text: "History"
|
||||||
}
|
}
|
||||||
FileList {
|
|
||||||
anchors.top: title.bottom
|
|
||||||
disableHeader: true
|
|
||||||
width: parent.width
|
|
||||||
dataModel: listModel
|
|
||||||
}
|
|
||||||
ListModel {
|
|
||||||
id: listModel
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
listModel.clear()
|
|
||||||
for (var i = 0; i < history.length; i++) {
|
|
||||||
Request.get("/knowledge/" + history[i] + "/detailed", response => {
|
|
||||||
var file = JSON.parse(response)
|
|
||||||
|
|
||||||
var modelItem = {
|
|
||||||
"title": file.name,
|
|
||||||
"uuid": file.id,
|
|
||||||
"date"// cut time after 'T'
|
|
||||||
: file.createTime.substring(0, 10),
|
|
||||||
"fuuid": ""
|
|
||||||
}
|
|
||||||
if (file.knowledgeFileAttribute === null) {
|
|
||||||
modelItem.type = "folder"
|
|
||||||
modelItem.isDir = true
|
|
||||||
modelItem.size = 0
|
|
||||||
} else {
|
|
||||||
modelItem.isDir = false
|
|
||||||
modelItem.type = getType(
|
|
||||||
file.knowledgeFileAttribute.suffix)
|
|
||||||
modelItem.size = file.knowledgeFileAttribute.size
|
|
||||||
modelItem.brief = file.knowledgeFileAttribute.brief
|
|
||||||
modelItem.pageView = file.knowledgeFileAttribute.pageView
|
|
||||||
modelItem.stars = 0
|
|
||||||
// merge file.knowledgeFileAttribute.tags array to a string
|
|
||||||
var tagString = ""
|
|
||||||
for (var j = 0; j < file.knowledgeFileAttribute.tags.length; j++) {
|
|
||||||
if (j != 0)
|
|
||||||
tagString = tagString + ","
|
|
||||||
tagString = tagString + file.knowledgeFileAttribute.tags[j].name
|
|
||||||
}
|
|
||||||
modelItem.tags = tagString
|
|
||||||
}
|
|
||||||
listModel.append(modelItem)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getType(suffix) {
|
|
||||||
if (suffix === "ppt" || suffix === "pptx")
|
|
||||||
return "PPT"
|
|
||||||
else if (suffix === "doc" || suffix === "docx")
|
|
||||||
return "WORD"
|
|
||||||
else if (suffix === "pdf")
|
|
||||||
return "PDF"
|
|
||||||
else if (suffix === "txt")
|
|
||||||
return "TXT"
|
|
||||||
else if (suffix === "xls" || suffix === "xlsx")
|
|
||||||
return "EXCEL"
|
|
||||||
else if (suffix === "zip" || suffix === "rar")
|
|
||||||
return "ZIP"
|
|
||||||
else if (suffix === "png" || suffix === "jpg" || suffix === "jpeg"
|
|
||||||
|| suffix === "gif")
|
|
||||||
return "IMAGE"
|
|
||||||
else if (suffix === "mp3" || suffix === "wav")
|
|
||||||
return "AUDIO"
|
|
||||||
else if (suffix === "mp4" || suffix === "avi" || suffix === "rmvb"
|
|
||||||
|| suffix === "rm" || suffix === "wmv" || suffix === "mkv")
|
|
||||||
return "VIDEO"
|
|
||||||
else
|
|
||||||
return "OTHER"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue