提交
This commit is contained in:
@@ -363,6 +363,7 @@ export default {
|
||||
showFactoryTaskDialog: false,
|
||||
factoryDialogInitialJournalId: '',
|
||||
factoryDialogInitialTask: null,
|
||||
routePromotionFactoryId: '',
|
||||
previewForm: {
|
||||
id: '',
|
||||
email: '',
|
||||
@@ -485,6 +486,11 @@ export default {
|
||||
async initPage() {
|
||||
this.hidePage = false;
|
||||
var journal_id = (this.$route.query && this.$route.query.journal_id) || '';
|
||||
var pfid =
|
||||
(this.$route.query && this.$route.query.promotion_factory_id) ||
|
||||
(this.$route.query && this.$route.query.taskId) ||
|
||||
'';
|
||||
this.routePromotionFactoryId = String(pfid || '');
|
||||
this.selectedJournalId = String(journal_id);
|
||||
this.loading = true;
|
||||
try {
|
||||
@@ -675,7 +681,29 @@ export default {
|
||||
},
|
||||
openFactoryTaskDialogFromLogs() {
|
||||
this.factoryDialogInitialJournalId = this.selectedJournalId ? String(this.selectedJournalId) : '';
|
||||
this.factoryDialogInitialTask = this.list && this.list.length ? { ...this.list[0] } : null;
|
||||
const targetTaskId = String(this.routePromotionFactoryId || '').trim();
|
||||
const first = this.list && this.list.length ? this.list[0] : null;
|
||||
const matched = targetTaskId
|
||||
? (this.list || []).find((row) => {
|
||||
const pid = row && row.promotion_factory_id != null ? String(row.promotion_factory_id) : '';
|
||||
const rid = row && row.id != null ? String(row.id) : '';
|
||||
const tid = row && row.task_id != null ? String(row.task_id) : '';
|
||||
return pid === targetTaskId || rid === targetTaskId || tid === targetTaskId;
|
||||
}) || first
|
||||
: first;
|
||||
this.factoryDialogInitialTask = matched
|
||||
? {
|
||||
...matched,
|
||||
promotion_factory_id:
|
||||
matched.promotion_factory_id != null
|
||||
? String(matched.promotion_factory_id)
|
||||
: matched.id != null
|
||||
? String(matched.id)
|
||||
: matched.task_id != null
|
||||
? String(matched.task_id)
|
||||
: ''
|
||||
}
|
||||
: null;
|
||||
this.showFactoryTaskDialog = true;
|
||||
},
|
||||
|
||||
@@ -811,8 +839,15 @@ export default {
|
||||
this.list = rawList.map((item, idx) => {
|
||||
const runAt = item.run_at || item.run_time || item.plan_time || item.execute_time || item.send_date || '';
|
||||
const state = String(item.state != null ? item.state : '');
|
||||
const promotionFactoryId =
|
||||
item.promotion_factory_id != null
|
||||
? item.promotion_factory_id
|
||||
: item.id != null
|
||||
? item.id
|
||||
: item.task_id;
|
||||
return {
|
||||
id: item.id || item.task_id || `task_${idx + 1}`,
|
||||
promotion_factory_id: promotionFactoryId != null ? String(promotionFactoryId) : '',
|
||||
task_id: String(item.task_id != null ? item.task_id : item.id || ''),
|
||||
task_name: item.task_name || item.name || '',
|
||||
scene: item.scene || '',
|
||||
|
||||
Reference in New Issue
Block a user