diff --git a/src/main/resources/views/platform/activity/school/ActivityManage.html b/src/main/resources/views/platform/activity/school/ActivityManage.html index de71dff..646d441 100644 --- a/src/main/resources/views/platform/activity/school/ActivityManage.html +++ b/src/main/resources/views/platform/activity/school/ActivityManage.html @@ -159,12 +159,13 @@ layout("/layouts/platform.html"){ @@ -203,6 +205,11 @@ layout("/layouts/platform.html"){ is_A06: false, is_h10: false, activities: [], + showActivity: false, + activityReady: false, + activityAction: null, + showInfo: false, + infoId: null, unitOptions: [], activityTypeList: [], planList: [], @@ -317,27 +324,57 @@ layout("/layouts/platform.html"){ this.url = `点击参与` this.$refs.sendMsg.openDialog(row.activityGroupId) }, + infoMounted() { + this.loadInfo() + }, + loadInfo(id) { + if (id) { + this.infoId = id + } + if (this.$refs.info && this.infoId) { + const infoId = this.infoId + this.infoId = null + this.$refs.info.getInfo(infoId) + } + }, openView(row) { const { id } = row + this.infoId = id + this.showInfo = true this.$refs.guava.view() - setTimeout(() => { - this.$refs.info.getInfo(id) - }, 500) + this.$nextTick(() => this.loadInfo()) + }, + activityMounted() { + this.activityReady = true + this.handleActivityAction() + }, + handleActivityAction(action) { + if (action) { + this.activityAction = action + } + if (!this.$refs.activity || !this.activityAction) { + return + } + const { type, row } = this.activityAction + this.activityAction = null + if (type === "add") { + this.$refs.activity.openAdd() + } else if (type === "edit") { + this.$refs.activity.openEdit(row, true) + } }, async openAdd() { + this.showActivity = true this.$refs.guava.edit() - setTimeout(() => { - this.$refs.activity.openAdd() - }, 500) + this.handleActivityAction({ type: "add" }) }, async openEdit(row) { const { id, applyStartTime, isSave } = row this.formData.id = id const now = moment().valueOf() + this.showActivity = true this.$refs.guava.edit() - setTimeout(() => { - this.$refs.activity.openEdit(row, true) - }, 500) + this.handleActivityAction({ type: "edit", row }) }, doDelete(row) { const { id } = row