diff --git a/src/components/page/autoPromotionLogs.vue b/src/components/page/autoPromotionLogs.vue
index c523790..19f5b41 100644
--- a/src/components/page/autoPromotionLogs.vue
+++ b/src/components/page/autoPromotionLogs.vue
@@ -17,7 +17,7 @@
{{ $t('autoPromotion.journal') }} :
{{ currentJournalName }}
- {{ config.initialized ? $t('autoPromotionLogs.editConfig') : $t('autoPromotionLogs.startConfig') }}
+ {{ $t('autoPromotionLogs.editConfig') }}
-
+
-
-
-
-
-
+
-
-
import CkeditorMail from '@/components/page/components/email/CkeditorMail.vue';
import TemplateSelectorDialog from '@/components/page/components/email/TemplateSelectorDialog.vue';
-import AutoPromotionWizard from '@/components/page/components/autoPromotion/AutoPromotionWizard.vue';
import PromotionFactoryTaskDialog from '@/components/page/components/autoPromotion/PromotionFactoryTaskDialog.vue';
import PromotionDetailDrawer from '@/components/page/components/autoPromotion/PromotionDetailDrawer.vue';
// 这里假设你已经定义了 API 地址
@@ -373,8 +324,8 @@ const API = {
};
export default {
- name: 'autoPromotion',
- components: { TemplateSelectorDialog, AutoPromotionWizard, PromotionFactoryTaskDialog, CkeditorMail, PromotionDetailDrawer },
+ name: 'autoPromotionLogs',
+ components: { TemplateSelectorDialog, PromotionFactoryTaskDialog, CkeditorMail, PromotionDetailDrawer },
data() {
return {
handleRefreshList: [],
@@ -482,12 +433,17 @@ export default {
}
},
watch: {
+ '$route.query.journal_id'(val) {
+ const s = String(val != null ? val : '').trim();
+ if (s === String(this.selectedJournalId || '').trim()) return;
+ this.initPage();
+ },
'$route.query.promotion_factory_id'(val) {
const s = String(val != null ? val : '').trim();
if (s === String(this.headerPromotionFactoryId || '').trim()) return;
this.headerPromotionFactoryId = s;
this.routePromotionFactoryId = s;
- if (this.config.initialized && this.selectedJournalId) {
+ if (this.selectedJournalId) {
this.query.pageIndex = 1;
this.fetchList();
}
@@ -496,6 +452,28 @@ export default {
created() {
this.initPage();
},
+ activated() {
+ const routeJid = String((this.$route.query && this.$route.query.journal_id) || '').trim();
+ const curJid = String(this.selectedJournalId || '').trim();
+ if (routeJid && routeJid !== curJid) {
+ this.initPage();
+ return;
+ }
+ const routePid = String(
+ (this.$route.query && this.$route.query.promotion_factory_id) ||
+ (this.$route.query && this.$route.query.taskId) ||
+ ''
+ ).trim();
+ const curPid = String(this.headerPromotionFactoryId || '').trim();
+ if (routePid && routePid !== curPid) {
+ this.headerPromotionFactoryId = routePid;
+ this.routePromotionFactoryId = routePid;
+ if (this.selectedJournalId) {
+ this.query.pageIndex = 1;
+ this.fetchList();
+ }
+ }
+ },
methods: {
mapFactoryTaskTypeLabel(type) {
const t = String(type || '');
@@ -635,10 +613,6 @@ export default {
try {
await this.fetchJournalDetail();
if (this.selectedJournalId) {
- this.loadPromotionFields(this.selectedJournalId);
- }
- if (this.config.initialized) {
- await this.fetchTemplates();
await this.fetchFactoryTasksForHeader();
await this.fetchList();
}
@@ -764,7 +738,7 @@ export default {
}
},
async fetchFactoryTasksForHeader() {
- if (!this.selectedJournalId || !this.config.initialized) {
+ if (!this.selectedJournalId) {
this.factoryTaskOptions = [];
return;
}