diff --git a/dashboard/src/components/shared/ListConfigItem.vue b/dashboard/src/components/shared/ListConfigItem.vue
index 96c0ba372..626218223 100644
--- a/dashboard/src/components/shared/ListConfigItem.vue
+++ b/dashboard/src/components/shared/ListConfigItem.vue
@@ -2,7 +2,7 @@
- 暂无项目
+ {{ t('core.common.list.noItems') }}
@@ -14,7 +14,7 @@
- {{ buttonText }}
+ {{ buttonText || t('core.common.list.modifyButton') }}
@@ -22,17 +22,43 @@
- {{ dialogTitle }}
+ {{ dialogTitle || t('core.common.list.editTitle') }}
+
+
+
+
+
+
+ mdi-import
+ {{ t('core.common.list.batchImport') }}
+
+
+
+
-
+ class="ma-1 list-item-clickable"
+ @click="startEdit(index, item)">
+
{{ item }}
-
-
- mdi-pencil
-
-
- mdi-close
-
-
-
-
+
+
mdi-check
-
+
mdi-close
@@ -69,34 +99,43 @@
mdi-format-list-bulleted
-
暂无项目
-
-
-
-
-
-
-
-
-
- mdi-plus
- {{ t('core.common.list.addButton') }}
-
+
{{ t('core.common.list.noItemsHint') }}
- 取消
- 确认
+ {{ t('core.common.cancel') }}
+ {{ t('core.common.confirm') }}
+
+
+
+
+
+
+
+
+ {{ t('core.common.list.batchImportTitle') }}
+
+
+
+
+
+
+
+
+ {{ t('core.common.cancel') }}
+
+ {{ t('core.common.list.batchImportButton', { count: batchImportPreviewCount }) }}
+
@@ -139,12 +178,24 @@ const originalItems = ref([])
const newItem = ref('')
const editIndex = ref(-1)
const editItem = ref('')
+const showBatchImport = ref(false)
+const batchImportText = ref('')
// 计算要显示的项目
const displayItems = computed(() => {
return props.modelValue.slice(0, props.maxDisplayItems)
})
+// 计算批量导入的项目数量
+const batchImportPreviewCount = computed(() => {
+ if (!batchImportText.value) return 0
+ return batchImportText.value
+ .split('\n')
+ .map(line => line.trim())
+ .filter(line => line.length > 0)
+ .length
+})
+
// 监听 modelValue 变化,同步到 localItems
watch(() => props.modelValue, (newValue) => {
localItems.value = [...(newValue || [])]
@@ -199,6 +250,24 @@ function cancelDialog() {
newItem.value = ''
dialog.value = false
}
+
+function confirmBatchImport() {
+ if (batchImportText.value.trim()) {
+ const newItems = batchImportText.value
+ .split('\n')
+ .map(line => line.trim())
+ .filter(line => line.length > 0)
+
+ localItems.value.push(...newItems)
+ batchImportText.value = ''
+ showBatchImport.value = false
+ }
+}
+
+function cancelBatchImport() {
+ batchImportText.value = ''
+ showBatchImport.value = false
+}