feat(shipping, admin, workspace, docs): 迭代货代模块、补充文档并处理合并冲突问题

This commit is contained in:
hugo committed 2026-08-12 09:27:33 +08:00
1 parent 4587b56900
commit 3c0e08377c
94 files changed
+29222 -1218

No files matched your search

@@ -9,6 +9,7 @@ import { ref, onMounted, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { Plus, Trash2, Edit2, Play, FileText, Image as ImageIcon } from 'lucide-vue-next';
import { listAdminAgents, listAdminAgentGuides, createAdminAgentGuide, updateAdminAgentGuide, deleteAdminAgentGuide, uploadAdminAgentGuideFile } from '@/features/admin/api/admin.api';
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
const { t } = useI18n();
@@ -34,6 +35,8 @@ const form = ref({
const isUploading = ref(false);
const uploadError = ref('');
const deleteDialogOpen = ref(false);
const pendingDeleteGuideId = ref<number | null>(null);
/**
* 拉取 Agent 列表并默认选中第一项,再加载其指南。
@@ -169,17 +172,26 @@ const submitForm = async () => {
}
};
const deleteGuide = (id: number) => {
pendingDeleteGuideId.value = id;
deleteDialogOpen.value = true;
};
/**
* 确认后删除指南。
* @param id - 指南主键
* 确认后删除指南(由 DeleteConfirmDialog 的 @confirm 触发)。
* @param id - 指南主键,取自 pendingDeleteGuideId
*/
const deleteGuide = async (id: number) => {
if (!confirm(t('admin.platformApps.confirmDelete'))) return;
const confirmDeleteGuide = async () => {
const id = pendingDeleteGuideId.value;
if (!id) return;
try {
await deleteAdminAgentGuide(id);
await fetchGuides();
} catch (error) {
console.error('Failed to delete guide:', error);
} finally {
pendingDeleteGuideId.value = null;
deleteDialogOpen.value = false;
}
};
@@ -391,5 +403,6 @@ const getIcon = (type: string) => {
</div>
</div>
</div>
<DeleteConfirmDialog v-model="deleteDialogOpen" title="{{ t('admin.platformApps.deleteGuide') }}" message="{{ t('admin.platformApps.confirmDelete') }}" confirm-tone="danger" @confirm="confirmDeleteGuide" />
</div>
</template>