2023-06-30 18:37:17 +08:00
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Window
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
|
import FluentUI
|
2023-07-05 15:39:29 +08:00
|
|
|
|
import "qrc:///AicsKnowledgeBase/qml/global"
|
2023-07-03 10:38:59 +08:00
|
|
|
|
import "qrc:///AicsKnowledgeBase/qml/component"
|
2023-06-30 18:37:17 +08:00
|
|
|
|
|
|
|
|
|
FluArea {
|
|
|
|
|
property string url: ''
|
2023-07-02 15:58:02 +08:00
|
|
|
|
backgroundColor: "#f9f9f9"
|
2023-06-30 18:37:17 +08:00
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 20
|
|
|
|
|
paddings: 10
|
|
|
|
|
|
2023-07-03 16:12:26 +08:00
|
|
|
|
// FluText {
|
|
|
|
|
// Layout.topMargin: 20
|
|
|
|
|
// text: "Search"
|
|
|
|
|
// }
|
2023-07-03 10:38:59 +08:00
|
|
|
|
/*
|
|
|
|
|
按标题,内容搜索
|
2023-07-05 15:39:29 +08:00
|
|
|
|
*/
|
|
|
|
|
ColumnLayout{
|
|
|
|
|
|
2023-07-05 01:59:35 +08:00
|
|
|
|
width: parent.width
|
2023-07-05 15:39:29 +08:00
|
|
|
|
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
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// ]
|
|
|
|
|
// }
|
2023-07-03 10:38:59 +08:00
|
|
|
|
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluTextBox{
|
|
|
|
|
placeholderText:"对标题进行搜索……"
|
2023-07-03 16:12:26 +08:00
|
|
|
|
Layout.fillWidth: true
|
2023-07-05 15:39:29 +08:00
|
|
|
|
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluIconButton{
|
2023-07-03 16:12:26 +08:00
|
|
|
|
Layout.alignment: Qt.AlignRight
|
2023-07-05 15:39:29 +08:00
|
|
|
|
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()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
FluCheckBox{
|
|
|
|
|
id:searchTitleAndContent
|
|
|
|
|
text:"同时搜索简介和内容"
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
2023-07-04 12:40:04 +08:00
|
|
|
|
|
2023-07-03 16:12:26 +08:00
|
|
|
|
//按文件类型
|
2023-07-05 15:39:29 +08:00
|
|
|
|
RowLayout{
|
|
|
|
|
id:selectFormat
|
|
|
|
|
width:parent.width
|
|
|
|
|
FluText{
|
2023-07-03 16:12:26 +08:00
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
2023-07-05 15:39:29 +08:00
|
|
|
|
text:"类型: "
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluCheckBox{
|
|
|
|
|
id:selectAllFormat
|
|
|
|
|
text:"all"
|
|
|
|
|
Component.onCompleted:{
|
2023-07-03 16:12:26 +08:00
|
|
|
|
clicked()
|
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
onClicked:{
|
|
|
|
|
selectVideo.checked=true
|
|
|
|
|
selectDoc.checked=true
|
|
|
|
|
selectAudio.checked=true
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluCheckBox{
|
|
|
|
|
id:selectVideo
|
|
|
|
|
text:"Video"
|
|
|
|
|
onClicked:{
|
2023-07-04 12:40:04 +08:00
|
|
|
|
selectFormat.setAllStatus()
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluCheckBox{
|
|
|
|
|
id:selectDoc
|
|
|
|
|
text:"Doc"
|
|
|
|
|
onClicked:{
|
2023-07-04 12:40:04 +08:00
|
|
|
|
selectFormat.setAllStatus()
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-03 10:38:59 +08:00
|
|
|
|
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluCheckBox{
|
|
|
|
|
id:selectAudio
|
|
|
|
|
text:"Audio"
|
|
|
|
|
onClicked:{
|
2023-07-05 01:59:35 +08:00
|
|
|
|
selectFormat.setAllStatus()
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-04 12:40:04 +08:00
|
|
|
|
|
|
|
|
|
function setAllStatus() {
|
2023-07-05 15:39:29 +08:00
|
|
|
|
selectAllFormat.checked = selectVideo.checked && selectDoc.checked && selectAudio.checked
|
2023-07-04 12:40:04 +08:00
|
|
|
|
}
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
2023-07-03 10:38:59 +08:00
|
|
|
|
|
2023-07-05 15:39:29 +08:00
|
|
|
|
RowLayout{
|
|
|
|
|
id:inputTags
|
|
|
|
|
width:parent.width
|
2023-07-05 01:59:35 +08:00
|
|
|
|
height: 32
|
2023-07-05 15:39:29 +08:00
|
|
|
|
FluText{
|
2023-07-05 01:59:35 +08:00
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
2023-07-05 15:39:29 +08:00
|
|
|
|
text:"标签: "
|
2023-07-05 01:59:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-05 15:39:29 +08:00
|
|
|
|
Tag{
|
|
|
|
|
id:tags
|
2023-07-05 01:59:35 +08:00
|
|
|
|
width: 290
|
|
|
|
|
}
|
2023-07-05 15:39:29 +08:00
|
|
|
|
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)
|
|
|
|
|
}
|
2023-07-05 01:59:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-05 13:58:03 +08:00
|
|
|
|
FluArea {
|
2023-07-04 13:38:01 +08:00
|
|
|
|
backgroundColor: "#f9f9f9"
|
|
|
|
|
border.width: 0
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 500
|
2023-07-03 10:38:59 +08:00
|
|
|
|
|
2023-07-05 13:58:03 +08:00
|
|
|
|
FileList {
|
2023-07-04 13:38:01 +08:00
|
|
|
|
disableHeader: true
|
2023-07-05 13:58:03 +08:00
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-03 16:12:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-06-30 18:37:17 +08:00
|
|
|
|
}
|