From 5f975a20e2fa9965dbff17c785a8b8642a5a3f39 Mon Sep 17 00:00:00 2001 From: shmily744 <1527550984@qq.com> Date: Wed, 5 Jul 2023 01:59:35 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0tag=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/page/SearchPage.qml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/AicsKnowledgeBase/qml/page/SearchPage.qml b/AicsKnowledgeBase/qml/page/SearchPage.qml index c47cfb0..35dcc49 100644 --- a/AicsKnowledgeBase/qml/page/SearchPage.qml +++ b/AicsKnowledgeBase/qml/page/SearchPage.qml @@ -22,6 +22,7 @@ FluArea { 按标题,内容搜索 */ ColumnLayout{ + width: parent.width RowLayout{ width:parent.width FluDropDownButton{ @@ -54,7 +55,6 @@ FluArea { //placeholderText:"" Layout.fillWidth: true - } FluIconButton{ Layout.alignment: Qt.AlignRight @@ -102,7 +102,7 @@ FluArea { id:selectAudio text:"Audio" onClicked:{ - selectFormat.setAllStatus() + selectFormat.setAllStatus() } } @@ -111,6 +111,22 @@ FluArea { } } + RowLayout{ + width:parent.width + height: 32 + FluText{ + id: tag + Layout.alignment: Qt.AlignLeft + text:"标签: " + } + + + Tag{ + width: 290 + } + + } + FluArea{ backgroundColor: "#f9f9f9" From a9fd98043b2a9963e6130cd07c1a4528a101e8d3 Mon Sep 17 00:00:00 2001 From: shmily744 <1527550984@qq.com> Date: Wed, 5 Jul 2023 02:04:53 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0tag=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/component/Tag.qml | 167 ++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 AicsKnowledgeBase/qml/component/Tag.qml diff --git a/AicsKnowledgeBase/qml/component/Tag.qml b/AicsKnowledgeBase/qml/component/Tag.qml new file mode 100644 index 0000000..f763f40 --- /dev/null +++ b/AicsKnowledgeBase/qml/component/Tag.qml @@ -0,0 +1,167 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Controls.Basic +import FluentUI + +Rectangle { + id: input + + width: 300 + height: 32 + + radius: 5 + clip: true + border.color: textInput.activeFocus ? "#268CDC":"#979592" //gray100 + ListModel { id: tagListModel } + + + + Row { + x: 5 + height: parent.height + spacing: 5 + + Row { + id: rowTag + anchors.verticalCenter: parent.verticalCenter + spacing: 5 + + Repeater { + model: tagListModel + + Loader { + sourceComponent: tagItem + Component.onCompleted: { + item.closeClicked.connect(function(){ + tagListModel.remove(index) + }) + + item.tag = Qt.binding(function(){return tag}) + } + } + } + } + + Item { + width: input.width - rowTag.width + height: parent.height + + TextField { + id:textInput + placeholderText: qsTr("按回车键Enter创建标签") + + + anchors.verticalCenter: parent.verticalCenter + width: parent.width - 15 + clip: true + + background: Rectangle { + } + + Keys.onReturnPressed: { + if (text.length === 0) + return + + + tagListModel.append({"tag": text}) + //console.log(tagListModel.get(0)) + text = "" + } + + Keys.onPressed: { + if (event.key === Qt.Key_Backspace) { + if (text.length === 0 && tagListModel.count) { + tagListModel.remove(tagListModel.count-1) + } + } + } + } + + } + } + + property Component tagItem: + Rectangle { + id: rootTagItem + property alias tag: tagText.text + signal closeClicked() + + width: content.width + height: 25 + radius: 5 + border.color: "#77c7ff" + + MouseArea { + id: mouseArea + property bool hovered: false + anchors.fill: parent + hoverEnabled: true + onEntered: hovered = true + onExited: hovered = false + + Row { + id: content + anchors.verticalCenter: parent.verticalCenter + height: rootTagItem.height + + Item { width: 5; height: 1 } + + Text { + id: tagText + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: rootTagItem.height * 0.5 + text: "Hello" + color: rootTagItem.border.color + } + + Item { visible: mouseArea.hovered; width: 5; height: 1 } + + Item { + anchors.verticalCenter: parent.verticalCenter + width: mouseArea.hovered ? 15 : 0 + height: rootTagItem.height + visible: mouseArea.hovered + Behavior on width { + NumberAnimation {duration: 100} + } + + Behavior on visible { + NumberAnimation {duration: 100} + } + + Rectangle { + width: height + height: parent.height * 0.6 + anchors.centerIn: parent + radius: height + color: closeMouseArea.pressed ? "gray" : "red" + visible: closeMouseArea.hovered + } + + Text { + anchors.centerIn: parent + text: "×" + color: closeMouseArea.hovered ? "white" : rootTagItem.border.color + } + + MouseArea { + id: closeMouseArea + property bool hovered: false + + anchors.fill: parent + hoverEnabled: true + onEntered: hovered = true + onExited: hovered = false + onCanceled: hovered = false + onClicked: rootTagItem.closeClicked() + } + } + + Item { width: 5; height: 1 } + } + } + } +} + From 7be44d40b1889170ab02f9466edfb059ad2e6cd3 Mon Sep 17 00:00:00 2001 From: karlis <2995621482@qq.com> Date: Wed, 5 Jul 2023 13:58:03 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86FileList?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/component/FileList.qml | 76 +++++----- AicsKnowledgeBase/qml/page/FilePage.qml | 4 +- AicsKnowledgeBase/qml/page/SearchPage.qml | 137 +++++++++++-------- 3 files changed, 130 insertions(+), 87 deletions(-) diff --git a/AicsKnowledgeBase/qml/component/FileList.qml b/AicsKnowledgeBase/qml/component/FileList.qml index 9e01396..ab662a5 100644 --- a/AicsKnowledgeBase/qml/component/FileList.qml +++ b/AicsKnowledgeBase/qml/component/FileList.qml @@ -5,19 +5,29 @@ import "qrc:///AicsKnowledgeBase/qml/global" Item { anchors.fill: parent - signal search(string tag) signal open(string file) property bool disableHeader: false + property bool autoRequest: false + property string url: "http://127.0.0.1:4523/m1/2914957-0-5604d062/" + property ListModel dataModel: ListModel {} + function setListData(listmodel) { + listView.model = listmodel + } + ListView { id: listView anchors.fill: parent spacing: 10 - header: disableHeader ? null :fileListItemHeader + header: disableHeader ? null : fileListItemHeader model: fileListModel delegate: fileListItemDelegate Component.onCompleted: { - update() + if (autoRequest) { + update() + } else { + listView.model = dataModel + } } } @@ -114,6 +124,7 @@ Item { } fileListModel.append(modelItem) } + console.log(fileListModel) listView.currentIndex = -1 }) } @@ -140,7 +151,8 @@ Item { size: isDir ? 0 : model.size stars: isDir ? 0 : model.stars // split string to array - tags: isDir ? [] : model.tags.split(",") + tags: isDir ? [] : model.tags.length === 0 ? [] : model.tags.split( + ",") onTagClicked: { emit: search(tag) console.log(tag) @@ -158,33 +170,33 @@ Item { } ListModel { id: fileListModel - ListElement { - title: "File 1" - isDir: true - brief: "This is a test file" - type: "FOLDER" - } - ListElement { - uid: "2" - title: "File 2" - isDir: false - brief: "This is a test file" - size: 500 - type: "WORD" - date: "2020-09-09" - pageView: 100 - stars: 10 - } - ListElement { - uid: "3" - title: "File 3" - isDir: false - brief: "This is a test file" - type: "PPT" - date: "2020-09-09" - pageView: 100 - size: 10200000022 - stars: 10 - } + ListElement { + title: "File 1" + isDir: true + brief: "This is a test file" + type: "FOLDER" + } + ListElement { + uuid: "2" + title: "File 2" + isDir: false + brief: "This is a test file" + size: 500 + type: "WORD" + date: "2020-09-09" + pageView: 100 + stars: 10 + } + ListElement { + uuid: "3" + title: "File 3" + isDir: false + brief: "This is a test file" + type: "PPT" + date: "2020-09-09" + pageView: 100 + size: 10200000022 + stars: 10 + } } } diff --git a/AicsKnowledgeBase/qml/page/FilePage.qml b/AicsKnowledgeBase/qml/page/FilePage.qml index dfdd14b..1d86c48 100644 --- a/AicsKnowledgeBase/qml/page/FilePage.qml +++ b/AicsKnowledgeBase/qml/page/FilePage.qml @@ -37,5 +37,7 @@ FluArea { } } - FileList {} + FileList { + autoRequest: true + } } diff --git a/AicsKnowledgeBase/qml/page/SearchPage.qml b/AicsKnowledgeBase/qml/page/SearchPage.qml index 35dcc49..d5d9761 100644 --- a/AicsKnowledgeBase/qml/page/SearchPage.qml +++ b/AicsKnowledgeBase/qml/page/SearchPage.qml @@ -18,32 +18,34 @@ FluArea { // Layout.topMargin: 20 // text: "Search" // } + + /* 按标题,内容搜索 */ - ColumnLayout{ + ColumnLayout { width: parent.width - RowLayout{ - width:parent.width - FluDropDownButton{ - id:select_model + RowLayout { + width: parent.width + FluDropDownButton { + id: select_model Layout.alignment: Qt.AlignLeft - text:"标题" - items:[ - FluMenuItem{ - text:"标题" + text: "标题" + items: [ + FluMenuItem { + text: "标题" onClicked: { select_model.text = text } }, - FluMenuItem{ - text:"内容" + FluMenuItem { + text: "内容" onClicked: { select_model.text = text } }, - FluMenuItem{ - text:"标签" + FluMenuItem { + text: "标签" onClicked: { select_model.text = text } @@ -51,91 +53,118 @@ FluArea { ] } - FluTextBox{ + FluTextBox { //placeholderText:"" Layout.fillWidth: true - } - FluIconButton{ + FluIconButton { Layout.alignment: Qt.AlignRight - iconSource:FluentIcons.Search + iconSource: FluentIcons.Search } } - //按文件类型 - RowLayout{ - id:selectFormat - width:parent.width - FluText{ + RowLayout { + id: selectFormat + width: parent.width + FluText { Layout.alignment: Qt.AlignLeft - text:"类型: " + text: "类型: " } - FluCheckBox{ - id:selectAllFormat - text:"all" - Component.onCompleted:{ + FluCheckBox { + id: selectAllFormat + text: "all" + Component.onCompleted: { clicked() } - onClicked:{ - selectVideo.checked=true - selectDoc.checked=true - selectAudio.checked=true + onClicked: { + selectVideo.checked = true + selectDoc.checked = true + selectAudio.checked = true } } - FluCheckBox{ - id:selectVideo - text:"Video" - onClicked:{ + FluCheckBox { + id: selectVideo + text: "Video" + onClicked: { selectFormat.setAllStatus() } } - FluCheckBox{ - id:selectDoc - text:"Doc" - onClicked:{ + FluCheckBox { + id: selectDoc + text: "Doc" + onClicked: { selectFormat.setAllStatus() } } - FluCheckBox{ - id:selectAudio - text:"Audio" - onClicked:{ + FluCheckBox { + id: selectAudio + text: "Audio" + onClicked: { selectFormat.setAllStatus() } } function setAllStatus() { - selectAllFormat.checked = selectVideo.checked && selectDoc.checked && selectAudio.checked + selectAllFormat.checked = selectVideo.checked + && selectDoc.checked && selectAudio.checked } } - RowLayout{ - width:parent.width + RowLayout { + width: parent.width height: 32 - FluText{ + FluText { id: tag Layout.alignment: Qt.AlignLeft - text:"标签: " + text: "标签: " } - - Tag{ + Tag { width: 290 } - } - - FluArea{ + FluArea { backgroundColor: "#f9f9f9" border.width: 0 width: parent.width height: 500 - FileList{ + FileList { disableHeader: true + dataModel: ListModel { + ListElement { + uuid: "0" + title: "File 1" + isDir: true + brief: "This is a test file" + type: "FOLDER" + } + ListElement { + uuid: "2" + title: "File 2" + isDir: false + brief: "This is a test file" + size: 500 + type: "WORD" + date: "2020-09-09" + pageView: 100 + stars: 10 + } + ListElement { + uuid: "3" + title: "File 3" + isDir: false + brief: "This is a test file" + type: "PPT" + date: "2020-09-09" + pageView: 100 + size: 10200000022 + stars: 10 + } + } } } } From 16c9e6c6329a6bd3344e46e336fe734ae1db0e39 Mon Sep 17 00:00:00 2001 From: shmily744 <1527550984@qq.com> Date: Wed, 5 Jul 2023 15:39:29 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9search=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E5=96=84tag=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/component/Tag.qml | 17 ++- AicsKnowledgeBase/qml/page/SearchPage.qml | 172 +++++++++++++--------- 2 files changed, 115 insertions(+), 74 deletions(-) diff --git a/AicsKnowledgeBase/qml/component/Tag.qml b/AicsKnowledgeBase/qml/component/Tag.qml index f763f40..47cb448 100644 --- a/AicsKnowledgeBase/qml/component/Tag.qml +++ b/AicsKnowledgeBase/qml/component/Tag.qml @@ -15,7 +15,7 @@ Rectangle { clip: true border.color: textInput.activeFocus ? "#268CDC":"#979592" //gray100 ListModel { id: tagListModel } - + property ListModel tagList: tagListModel Row { @@ -52,6 +52,9 @@ Rectangle { id:textInput placeholderText: qsTr("按回车键Enter创建标签") + onFocusChanged: { + text ="" + } anchors.verticalCenter: parent.verticalCenter width: parent.width - 15 @@ -61,9 +64,14 @@ Rectangle { } Keys.onReturnPressed: { + var presetsTags = ["前端","后端","数据库"] if (text.length === 0) return + if(presetsTags.indexOf(text) === -1){ + text = "" + return + } tagListModel.append({"tag": text}) //console.log(tagListModel.get(0)) @@ -91,7 +99,8 @@ Rectangle { width: content.width height: 25 radius: 5 - border.color: "#77c7ff" + color: "#00aeec" + border.color: "#00aeec" MouseArea { id: mouseArea @@ -113,7 +122,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter font.pixelSize: rootTagItem.height * 0.5 text: "Hello" - color: rootTagItem.border.color + color: "white" } Item { visible: mouseArea.hovered; width: 5; height: 1 } @@ -143,7 +152,7 @@ Rectangle { Text { anchors.centerIn: parent text: "×" - color: closeMouseArea.hovered ? "white" : rootTagItem.border.color + color: "white" } MouseArea { diff --git a/AicsKnowledgeBase/qml/page/SearchPage.qml b/AicsKnowledgeBase/qml/page/SearchPage.qml index d5d9761..56cad27 100644 --- a/AicsKnowledgeBase/qml/page/SearchPage.qml +++ b/AicsKnowledgeBase/qml/page/SearchPage.qml @@ -4,6 +4,7 @@ import QtQuick.Window import QtQuick.Controls import QtQuick.Controls.Basic import FluentUI +import "qrc:///AicsKnowledgeBase/qml/global" import "qrc:///AicsKnowledgeBase/qml/component" FluArea { @@ -18,112 +19,143 @@ FluArea { // Layout.topMargin: 20 // text: "Search" // } - - /* 按标题,内容搜索 - */ - ColumnLayout { + */ + ColumnLayout{ + width: parent.width - RowLayout { - width: parent.width - FluDropDownButton { - id: select_model - Layout.alignment: Qt.AlignLeft - text: "标题" - items: [ - FluMenuItem { - text: "标题" - onClicked: { - select_model.text = text - } - }, - FluMenuItem { - text: "内容" - onClicked: { - select_model.text = text - } - }, - FluMenuItem { - text: "标签" - onClicked: { - select_model.text = text - } + RowLayout{ + width:parent.width + // FluDropDownButton{ + // id:select_model + // Layout.alignment: Qt.AlignLeft + // text:"标题" + // items:[ + // FluMenuItem{ + // text:"标题" + // onClicked: { + // select_model.text = text + // } + // }, + // FluMenuItem{ + // text:"内容" + // onClicked: { + // select_model.text = text + // } + // }, + // FluMenuItem{ + // text:"标题及内容" + // onClicked: { + // select_model.text = text + // } + // } + // ] + // } + + FluTextBox{ + placeholderText:"对标题进行搜索……" + Layout.fillWidth: true + + } + FluIconButton{ + Layout.alignment: Qt.AlignRight + iconSource:FluentIcons.Search + onClicked:{ + var allTags = inputTags.getAllTags(tags.tagList) + var allTagId =[] + console.log(allTags) + + for (var i = 0; i < allTags.length; i++) { + var url = "?name=" + url = url + allTags[i] + console.log(url) + Request.get(url, + function(result, data){ + allTagId.push() + } + + ) } - ] + } } - FluTextBox { - //placeholderText:"" - Layout.fillWidth: true - } - FluIconButton { - Layout.alignment: Qt.AlignRight - iconSource: FluentIcons.Search - } + } + FluCheckBox{ + id:searchTitleAndContent + text:"同时搜索简介和内容" } //按文件类型 - RowLayout { - id: selectFormat - width: parent.width - FluText { + RowLayout{ + id:selectFormat + width:parent.width + FluText{ Layout.alignment: Qt.AlignLeft - text: "类型: " + text:"类型: " } - FluCheckBox { - id: selectAllFormat - text: "all" - Component.onCompleted: { + FluCheckBox{ + id:selectAllFormat + text:"all" + Component.onCompleted:{ clicked() } - onClicked: { - selectVideo.checked = true - selectDoc.checked = true - selectAudio.checked = true + onClicked:{ + selectVideo.checked=true + selectDoc.checked=true + selectAudio.checked=true } } - FluCheckBox { - id: selectVideo - text: "Video" - onClicked: { + FluCheckBox{ + id:selectVideo + text:"Video" + onClicked:{ selectFormat.setAllStatus() } } - FluCheckBox { - id: selectDoc - text: "Doc" - onClicked: { + FluCheckBox{ + id:selectDoc + text:"Doc" + onClicked:{ selectFormat.setAllStatus() } } - FluCheckBox { - id: selectAudio - text: "Audio" - onClicked: { + FluCheckBox{ + id:selectAudio + text:"Audio" + onClicked:{ selectFormat.setAllStatus() } } function setAllStatus() { - selectAllFormat.checked = selectVideo.checked - && selectDoc.checked && selectAudio.checked + selectAllFormat.checked = selectVideo.checked && selectDoc.checked && selectAudio.checked } } - RowLayout { - width: parent.width + RowLayout{ + id:inputTags + width:parent.width height: 32 - FluText { - id: tag + FluText{ Layout.alignment: Qt.AlignLeft - text: "标签: " + text:"标签: " } - Tag { + Tag{ + id:tags width: 290 } + function getAllTags(tagList){ + var allTags=[]; + for (var i = 0; i < tagList.count; i++) { + var item = tagList.get(i); + allTags.push(item.tag) + } + return allTags + //console.log(allTags) + } } FluArea { From 7bdddec934a454e625f0f95e06c7fc183080776a Mon Sep 17 00:00:00 2001 From: "yang.yongquan" <3395816735@qq.com> Date: Wed, 5 Jul 2023 20:04:43 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E7=95=8C=E9=9D=A2=E4=BF=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/component/FileList.qml | 3 ++- AicsKnowledgeBase/qml/global/SignalFileOperation.qml | 8 ++++++++ AicsKnowledgeBase/qml/page/ContentPage.qml | 9 +++++++++ AicsKnowledgeBase/src/main.cpp | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 AicsKnowledgeBase/qml/global/SignalFileOperation.qml diff --git a/AicsKnowledgeBase/qml/component/FileList.qml b/AicsKnowledgeBase/qml/component/FileList.qml index ab662a5..d1fdb2a 100644 --- a/AicsKnowledgeBase/qml/component/FileList.qml +++ b/AicsKnowledgeBase/qml/component/FileList.qml @@ -2,6 +2,7 @@ import QtQuick 2.15 import QtQuick.Layouts import FluentUI import "qrc:///AicsKnowledgeBase/qml/global" +import SignalFileOperation 1.0 Item { anchors.fill: parent @@ -163,7 +164,7 @@ Item { if (model.isDir) { listView.headerItem.add(model.title, model.uuid) } else { - emit: open(model.uuid) + emit: SignalFileOperation.open(model.uuid) } } } diff --git a/AicsKnowledgeBase/qml/global/SignalFileOperation.qml b/AicsKnowledgeBase/qml/global/SignalFileOperation.qml new file mode 100644 index 0000000..e60ce30 --- /dev/null +++ b/AicsKnowledgeBase/qml/global/SignalFileOperation.qml @@ -0,0 +1,8 @@ +pragma Singleton + +import QtQuick + +QtObject { + signal open(string file) + signal openNote(string note) +} diff --git a/AicsKnowledgeBase/qml/page/ContentPage.qml b/AicsKnowledgeBase/qml/page/ContentPage.qml index debb554..aec6663 100644 --- a/AicsKnowledgeBase/qml/page/ContentPage.qml +++ b/AicsKnowledgeBase/qml/page/ContentPage.qml @@ -6,12 +6,14 @@ import QtQuick.Controls.Basic import QtWebEngine 1.2 import FluentUI import AicsKB.FileTransferManager +import SignalFileOperation 1.0 import "qrc:///AicsKnowledgeBase/qml/page" FluArea { id: content_area paddings: 0 backgroundColor: "#f9f9f9" + visible: false property string type: "" property string knowledgeFileId signal download(string knowledgeFileId) @@ -23,6 +25,13 @@ FluArea { // bottom: 10 // left: 10 // } + Connections { + target: SignalFileOperation + function onOpen(file) { + content_area.visible = true + } + } + FluScrollablePage { id: content_page anchors.fill: parent diff --git a/AicsKnowledgeBase/src/main.cpp b/AicsKnowledgeBase/src/main.cpp index ef750eb..90a4c4f 100644 --- a/AicsKnowledgeBase/src/main.cpp +++ b/AicsKnowledgeBase/src/main.cpp @@ -54,6 +54,8 @@ int main(int argc, char *argv[]) qmlRegisterSingletonInstance("AicsKB.FileTransferManager", 1, 0, "FileTransferManager", fileTransferManager); + qmlRegisterSingletonType(QUrl("qrc:/AicsKnowledgeBase/qml/global/SignalFileOperation.qml"), "SignalFileOperation", 1, 0, + "SignalFileOperation"); const QUrl url(u"qrc:/AicsKnowledgeBase/qml/App.qml"_qs); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, From 2706ba50dc009c38d5c8aa0a78f14b5263bc8097 Mon Sep 17 00:00:00 2001 From: karlis <2995621482@qq.com> Date: Wed, 5 Jul 2023 20:59:57 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86FileList?= =?UTF-8?q?=E8=B0=83=E7=94=A8undefined=E5=AF=B9=E8=B1=A1=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AicsKnowledgeBase/qml/component/FileList.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AicsKnowledgeBase/qml/component/FileList.qml b/AicsKnowledgeBase/qml/component/FileList.qml index ab662a5..8ca3732 100644 --- a/AicsKnowledgeBase/qml/component/FileList.qml +++ b/AicsKnowledgeBase/qml/component/FileList.qml @@ -151,8 +151,9 @@ Item { size: isDir ? 0 : model.size stars: isDir ? 0 : model.stars // split string to array - tags: isDir ? [] : model.tags.length === 0 ? [] : model.tags.split( - ",") + tags: isDir ? [] : model.tags === null + || model.tags === undefined + || model.tags === "" ? [] : model.tags.split(",") onTagClicked: { emit: search(tag) console.log(tag)