diff --git a/src/pages/account/login/index.vue b/src/pages/account/login/index.vue index ba7fa4d..ce9e7b1 100644 --- a/src/pages/account/login/index.vue +++ b/src/pages/account/login/index.vue @@ -1,189 +1,317 @@ \ No newline at end of file diff --git a/src/pages/activity/manage/manage/index.vue b/src/pages/activity/manage/manage/index.vue index d6a2e35..e2a5246 100644 --- a/src/pages/activity/manage/manage/index.vue +++ b/src/pages/activity/manage/manage/index.vue @@ -1,20 +1,28 @@ @@ -26,122 +34,122 @@ import notice from "./notice"; import MatchSignup from "./matchSignup"; import { mapState } from "vuex"; export default { - name: "matchManage", - data() { - return { - name: this.$route.query.name, - active: this.$route.query.tab || "tab1", - tabs: { - tab1: "项目详情", - tab2: "项目进展", - tab3: "公告通知", - tab4: "报名人员" - }, - }; - }, - components: { - MatchDetail, - MatchProgress, - notice, - MatchSignup + name: "matchManage", + data () { + return { + name: this.$route.query.name, + active: this.$route.query.tab || "tab1", + tabs: { + tab1: "项目详情", + tab2: "项目进展", + tab3: "公告通知", + tab4: "报名人员" + }, + }; + }, + components: { + MatchDetail, + MatchProgress, + notice, + MatchSignup + }, + beforeRouteLeave (to, from, next) { + const detail = this.$refs.detail + if (detail && detail.updateTime) { + this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示.......', { + type: 'warning' + }).then(() => { + detail.save(detail.form.publishStatus) + }).catch(() => { + next() + }) + } else { + next() + } + }, + mounted () { + + }, + methods: { + back () { + this.handleSave(0) && this.backPage() }, - beforeRouteLeave(to, from, next) { - const detail = this.$refs.detail - if (detail && detail.updateTime) { - this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示.......', { - type: 'warning' - }).then(() => { - detail.save(detail.form.publishStatus) - }).catch(() => { - next() - }) + // 判断是否需要confirm + handleSave (i) { + // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 + if (this.active === 'tab1') { + const detail = this.$refs.detail + if (detail && detail.updateTime) { + this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { + type: 'warning' + }).then(() => { + detail.save(detail.form.publishStatus) + this.backOrTab(i) + }).catch(() => { + this.backOrTab(i) + }) + } else { + this.backOrTab(i) + } + return false } else { - next() + return true } }, - mounted() { - + // 返回列表 + backPage () { + this.$router.push(`/activity/manage?page=${this.$store.state.activity.page}`) }, - methods: { - back() { - this.handleSave(0) && this.backPage() - }, - // 判断是否需要confirm - handleSave(i) { - // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 - if (this.active === 'tab1') { - const detail = this.$refs.detail - if (detail && detail.updateTime) { - this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { - type: 'warning' - }).then(() => { - detail.save(detail.form.publishStatus) - this.backOrTab(i) - }).catch(() => { - this.backOrTab(i) - }) - } else { - this.backOrTab(i) - } - return false - } else { - return true - } - }, - // 返回列表 - backPage(){ - this.$router.push(`/activity/manage?page=${this.$store.state.activity.page}`) - }, - // tab切换 - tabSwitch(i) { - this.active = i - this.$router.push(`manageDetail?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) - }, - // 判断返回还是tab - backOrTab(i) { - i ? this.tabSwitch(i) : this.backPage() - }, - // tab回调 - tabChange(i) { - this.handleSave(i) && this.tabSwitch(i) - } + // tab切换 + tabSwitch (i) { + this.active = i + this.$router.push(`manageDetail?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) + }, + // 判断返回还是tab + backOrTab (i) { + i ? this.tabSwitch(i) : this.backPage() + }, + // tab回调 + tabChange (i) { + this.handleSave(i) && this.tabSwitch(i) } + } }; \ No newline at end of file diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 914ba50..ade0b56 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -1,241 +1,354 @@