diff --git a/web/index.html b/web/index.html index f45113c..eb3c54d 100644 --- a/web/index.html +++ b/web/index.html @@ -271,7 +271,7 @@ - + diff --git a/web/main.js b/web/main.js index e289487..5159c77 100644 --- a/web/main.js +++ b/web/main.js @@ -295,13 +295,13 @@ const app = createApp({ * 加载分销商列表 */ const loadResellers = async () => { - const ids = state.exportForm.creatorIds; - if (!ids?.length) { + const id = state.exportForm.creatorId; + if (!id) { resellerOptions.value = []; return; } try { - resellerOptions.value = await Api.fetchResellers(ids); + resellerOptions.value = await Api.fetchResellers([id]); } catch (error) { console.error('加载分销商列表失败:', error); resellerOptions.value = []; @@ -360,7 +360,7 @@ const app = createApp({ }; // ==================== 导出相关计算属性 ==================== - const hasCreators = Vue.computed(() => state.exportForm.creatorIds?.length > 0); + const hasCreators = Vue.computed(() => !!state.exportForm.creatorId); const hasReseller = Vue.computed(() => !!state.exportForm.resellerId); const hasPlan = Vue.computed(() => !!state.exportForm.planId); const hasKeyBatch = Vue.computed(() => !!state.exportForm.keyBatchId); @@ -702,7 +702,9 @@ const app = createApp({ } } - if (creatorIds?.length) { + if (creatorId) { + filters.creator_in = [Number(creatorId)]; + } else if (creatorIds?.length) { filters.creator_in = creatorIds.map(Number); } else if (creatorIdsRaw) { const arr = String(creatorIdsRaw).split(',').map(s => s.trim()).filter(Boolean); @@ -923,6 +925,14 @@ const app = createApp({ }); // 导出筛选条件变化 + Vue.watch(() => state.exportForm.creatorId, () => { + state.exportForm.resellerId = null; + state.exportForm.planId = null; + state.exportForm.keyBatchId = null; + state.exportForm.codeBatchId = null; + loadResellers(); + }); + Vue.watch(() => state.exportForm.creatorIds, () => { state.exportForm.resellerId = null; state.exportForm.planId = null;