onTagClick?.(tag.id)} style={{
- background: isSelected(tag.id) ? tagStore.getColor(tag.name) : 'var(--zp-primary-background)',
- color: !isSelected(tag.id) ? tagStore.getColor(tag.name) : 'white',
- border: `2px solid ${tagStore.getColor(tag.name)}`,
+ background: isSelected(tag.id) ? tagStore.getColor(tag) : 'var(--zp-primary-background)',
+ color: !isSelected(tag.id) ? tagStore.getColor(tag) : 'white',
+ border: `2px solid ${tagStore.getColor(tag)}`,
...tagBaseStyle
}}>
{ tag.name }
diff --git a/vue/src/page/TagSearch/TagSearch.vue b/vue/src/page/TagSearch/TagSearch.vue
index 941efef..ea5a894 100644
--- a/vue/src/page/TagSearch/TagSearch.vue
+++ b/vue/src/page/TagSearch/TagSearch.vue
@@ -9,7 +9,8 @@ import {
removeCustomTag,
getExpiredDirs,
type MatchImageByTagsReq,
- type TagId
+ type TagId,
+ updateTag
} from '@/api/db'
import { SearchSelect, delay } from 'vue3-ts-util'
import { PlusOutlined, ArrowRightOutlined } from '@/icon'
@@ -23,9 +24,11 @@ import TagSearchItem from './TagSearchItem.vue'
import { reactive, nextTick } from 'vue'
import { watch } from 'vue'
import { tagSearchHistory } from '@/store/searchHistory'
+import { useTagStore } from '@/store/useTagStore'
const props = defineProps<{ tabIdx: number; paneIdx: number, searchScope?: string }>()
const global = useGlobalStore()
+const tagStore = useTagStore()
const queue = createReactiveQueue()
const loading = computed(() => !queue.isIdle)
const info = ref
()
@@ -181,6 +184,13 @@ const toggleTag = (tag_id: TagId, taglist: TagId[]) => {
} else {
taglist.splice(idx, 1)
}
+
+}
+
+const onTagColorChange = async (tag: Tag, color: string) => {
+ tag.color = color
+ tagStore.notifyCacheUpdate(tag)
+ await updateTag(tag)
}
const tagListFilter = (list: Tag[], name: string) => {
@@ -286,6 +296,7 @@ const tagIdsToString = (tagIds: TagId[]) => {
diff --git a/vue/src/page/TagSearch/TagSearchItem.vue b/vue/src/page/TagSearch/TagSearchItem.vue
index da50a9c..8b57e0a 100644
--- a/vue/src/page/TagSearch/TagSearchItem.vue
+++ b/vue/src/page/TagSearch/TagSearchItem.vue
@@ -8,12 +8,17 @@
{{ $t('exclude')
}}
-