Merge branch 'main' of http://101.34.228.45:3000/auto/AicsKnowledgeBase_client
commit
d7f5670700
|
@ -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
|
||||
|
@ -164,7 +165,7 @@ Item {
|
|||
if (model.isDir) {
|
||||
listView.headerItem.add(model.title, model.uuid)
|
||||
} else {
|
||||
emit: open(model.uuid)
|
||||
emit: SignalFileOperation.open(model.uuid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
signal open(string file)
|
||||
signal openNote(string note)
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -54,6 +54,8 @@ int main(int argc, char *argv[])
|
|||
qmlRegisterSingletonInstance<FileTransferManager>("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,
|
||||
|
|
Loading…
Reference in New Issue