feat(env): add tag support for environment variables and task injection

- Add generic DataRelation and DataStorage models for tags
- Update EnvService and EnvController to support tag assignment, querying, and filtering
- Integrate EnvTagsConfig in Env settings for managing environment tags
- Enhance TaskDialog environment selection to support searching and displaying env tags
- Fix missing TaskLangConfig import in RepoDialog
This commit is contained in:
duorameng
2026-06-08 17:39:24 +08:00
parent e59761fd87
commit 7f7d109438
14 changed files with 316 additions and 26 deletions
+6 -4
View File
@@ -10,9 +10,11 @@ const props = withDefaults(defineProps<{
icon?: any
multiple?: boolean
clearOnSelect?: boolean
fetchTags?: () => Promise<string[]>
}>(), {
multiple: false,
clearOnSelect: false
clearOnSelect: false,
fetchTags: () => api.tasks.tags()
})
const emit = defineEmits(['update:modelValue', 'enter'])
@@ -27,10 +29,10 @@ watch(() => props.modelValue, (newVal) => {
inputValue.value = newVal
})
async function fetchTags() {
async function fetchTagsData() {
loading.value = true
try {
const res = await api.tasks.tags()
const res = await props.fetchTags()
allTags.value = res || []
} catch (e) {
console.error('Failed to fetch tags', e)
@@ -101,7 +103,7 @@ function handleClickOutside(e: MouseEvent) {
}
onMounted(() => {
fetchTags()
fetchTagsData()
window.addEventListener('mousedown', handleClickOutside)
})