mirror of
https://github.com/xhongc/music-tag-web.git
synced 2026-04-25 03:00:54 +08:00
feature:新增搜索功能
This commit is contained in:
@@ -70,22 +70,22 @@ TIME_ZONE = "Asia/Shanghai"
|
||||
LANGUAGE_CODE = "zh-hans"
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
}
|
||||
}
|
||||
# DATABASES = {
|
||||
# "default": {
|
||||
# "ENGINE": "django.db.backends.mysql",
|
||||
# "NAME": 'music', # noqa
|
||||
# "USER": "root",
|
||||
# "PASSWORD": "123456",
|
||||
# "HOST": "localhost",
|
||||
# "PORT": "3306",
|
||||
# },
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.sqlite3',
|
||||
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
# }
|
||||
# }
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.mysql",
|
||||
"NAME": 'music', # noqa
|
||||
"USER": "root",
|
||||
"PASSWORD": "123456",
|
||||
"HOST": "localhost",
|
||||
"PORT": "3306",
|
||||
},
|
||||
}
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
behavior="simplicity">
|
||||
</bk-input>
|
||||
</div>
|
||||
<div style="margin-top: 10px;">
|
||||
<bk-input type="text" v-model="searchWord" placeholder="search..." @enter="handleSearch"></bk-input>
|
||||
</div>
|
||||
<transition name="bk-slide-fade-down">
|
||||
<div style="margin-top: 10px;" v-show="fadeShowDir">
|
||||
<bk-tree
|
||||
@@ -273,9 +276,10 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
searchWord: '',
|
||||
treeListOne: [],
|
||||
filePath: '/app/media/',
|
||||
bakDir: '/app/media/',
|
||||
filePath: '/Users/macbookair/Music/my_music',
|
||||
bakDir: '/Users/macbookair/Music/my_music',
|
||||
fileName: '',
|
||||
resource: 'netease',
|
||||
resourceList: [{id: 'netease', name: '网易云音乐'}, {id: 'migu', name: '咪咕音乐'}],
|
||||
@@ -432,6 +436,12 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 过滤搜索
|
||||
handleSearch() {
|
||||
this.$refs.tree1.searchNode(this.searchWord)
|
||||
const searchResult = this.$refs.tree1.getSearchResult()
|
||||
this.isEmpty = searchResult.isEmpty
|
||||
},
|
||||
// 保存音乐信息
|
||||
handleClick() {
|
||||
const params = [{
|
||||
|
||||
Reference in New Issue
Block a user