解决了FileListItem的警告

main
wuyize 2023-07-07 01:57:39 +08:00
parent b6627ccd2c
commit e10fddb188
4 changed files with 80 additions and 114 deletions

View File

@ -164,47 +164,8 @@ Item {
}
}
}
FluButton {
id: uploadIcon
UploadButton {
Layout.alignment: Qt.AlignRight
text: "上传"
onClicked: function () {
console.log("click")
fileDialog.open()
}
FileDialog {
id: fileDialog
onAccepted: function () {
let name = FileTransferManager.getFileName(
selectedFile)
const size = FileTransferManager.getFileSize(
selectedFile)
const md5 = FileTransferManager.getFileMd5(
selectedFile)
if (size <= 0 || md5 === '')
return
var body = {
"name": name,
"brief": "brief",
"size": size,
"md5": md5,
"tags": [],
"parentId": header.items.length !== 0 ? header.items[header.items.length - 1].uuid : null
}
console.log("begin")
Request.post("knowledge/file",
JSON.stringify(body),
function (res, data) {
console.log(res)
console.log(data)
FileTransferManager.upload(
selectedFile, data.id,
data.ticket, name)
}, function (res, data) {
console.log(res)
})
}
}
}
}
RowLayout {

View File

@ -84,17 +84,8 @@ FluArea {
}
}
ColumnLayout {
id: row
anchors.fill: parent
anchors.margins: 10
spacing: 10
ColumnLayout {
id: clickable
anchors.fill: parent
MouseArea {
anchors.fill: parent
anchors.fill: row
acceptedButtons: Qt.LeftButton | Qt.RightButton
onDoubleClicked: {
fileItem.parent.doubleClicked()
@ -105,6 +96,11 @@ FluArea {
}
}
}
ColumnLayout {
id: clickable
anchors.fill: row
RowLayout {
id: titleRow
Image {
@ -161,6 +157,13 @@ FluArea {
}
}
}
ColumnLayout {
id: row
anchors.fill: parent
anchors.margins: 10
spacing: 10
RowLayout {
visible: !fileItem.isDir
Repeater {

View File

@ -14,7 +14,8 @@ FluButton {
text: "上传"
onClicked: function () {
console.log("click")
fileDialog.open()
//fileDialog.open()
popup.open()
}
FileDialog {
id: fileDialog
@ -52,7 +53,7 @@ FluButton {
}
}
Row {
Column {
id: content
topPadding: 14
leftPadding: 20
@ -68,6 +69,7 @@ FluButton {
width: parent.width - parent.leftPadding - parent.rightPadding
placeholderText: "请输入简介"
}
Tag {}
}
Rectangle {

View File

@ -11,7 +11,7 @@ FileTransferListModel::FileTransferListModel(QObject *parent)
m_roleName.insert(kSpeedRole, "speed");
m_roleName.insert(kPausedRole, "paused");
m_data.append({true, "id", "name", 30, 100, 30});
//m_data.append({true, "id", "name", 30, 100, 30});
}