diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue index a5836cf..d81e989 100644 --- a/src/pages/achievement/list/project.vue +++ b/src/pages/achievement/list/project.vue @@ -7,7 +7,7 @@
  • + @change="initData"> + @change="initData"> 班级 + @change="initData"> + @change="initData"> import util from "@/libs/util"; +import qs from 'qs' export default { name: "achievement", data () { return { form: { - classId: this.$route.query.class ? +this.$route.query.class : '', + classId: +this.$route.query.classId || '', mallId: +this.$route.query.mallId || '', permissions: this.$route.query.permissions ? +this.$route.query.permissions : 0, month: +this.$route.query.month || '', @@ -309,49 +310,6 @@ export default { this.loading = false }); }, - monthChange () { - this.$router.push({ - path: 'list', - query: { - ...this.$route.query, - month: val - } - }) - this.initData() - }, - // 项目分类回调 - perChange (val) { - this.$router.push({ - path: 'list', - query: { - ...this.$route.query, - permissions: val - } - }) - this.initData() - }, - // 班级回调 - classChange (val) { - this.$router.push({ - path: 'list', - query: { - ...this.$route.query, - classId: val - } - }) - this.initData() - }, - // 课程回调 - mallIdChange (val) { - this.$router.push({ - path: 'list', - query: { - ...this.$route.query, - mallId: val - } - }) - this.initData() - }, initData () { this.$refs.table.clearSelection(); this.page = 1; @@ -363,7 +321,7 @@ export default { }, // 进入实验记录 entry (row) { - this.$store.commit('achievement/setReferrer', this.$route.fullPath) + this.$store.commit('achievement/setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`) this.$router.push(`project?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}&mallId=${this.form.mallId}&classId=${row.classId || ''}`) }, handleDelete (row) { // 删除 diff --git a/src/pages/activity/manage/add/index.vue b/src/pages/activity/manage/add/index.vue index edb3e90..aa0be15 100644 --- a/src/pages/activity/manage/add/index.vue +++ b/src/pages/activity/manage/add/index.vue @@ -400,16 +400,16 @@ export default { this.submiting = true if (form.id) { this.$post(this.api.updateActivity, form).then(res => { - this.pass = true - this.updateTime = 0 - this.$router.back() + this.backList() util.successMsg("修改成功"); }).catch(err => { this.submiting = false }); } else { this.$post(this.api.saveActivity, form).then(res => { - this.backList() + this.pass = true + this.updateTime = 0 + this.$router.push('manage') util.successMsg("创建成功"); }).catch(err => { this.submiting = false diff --git a/src/pages/activity/manage/list/index.vue b/src/pages/activity/manage/list/index.vue index 2f675dd..228877e 100644 --- a/src/pages/activity/manage/list/index.vue +++ b/src/pages/activity/manage/list/index.vue @@ -375,7 +375,7 @@ export default { }, handleCurrentChange (val) { this.page = val; - this.$router.push(`list?page=${val}`) + this.$router.push(`manage?page=${val}`) this.getData() }, transferTime (date, type) { diff --git a/src/pages/activity/manage/manage/notice.vue b/src/pages/activity/manage/manage/notice.vue index aad486c..237b394 100644 --- a/src/pages/activity/manage/manage/notice.vue +++ b/src/pages/activity/manage/manage/notice.vue @@ -76,7 +76,6 @@ export default { return { token: util.local.get(Setting.tokenKey), id: this.$route.query.id, - keyword: "", listData: [], multipleSelection: [], page: +this.$route.query.page || 1, @@ -84,14 +83,6 @@ export default { totals: 0 }; }, - watch: { - keyword: function (val) { - clearTimeout(this.searchTimer); - this.searchTimer = setTimeout(() => { - this.getData(); - }, 500); - } - }, mounted () { this.getData() }, diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index 3017088..0a92046 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -542,7 +542,7 @@ export default { this.$post(this.api.saveAssessment, this.form).then(res => { this.updateTime = 0 util.successMsg("创建成功"); - cb ? cb() : this.backPage() + cb ? cb() : this.$router.push('list') }).catch(err => { this.submiting = false }); diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue index ad5f88e..441bef7 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -435,7 +435,6 @@ export default { async getCourse () { const { data } = await this.$get(this.api.getSchoolEffectiveCourse) this.curs.push(...data) - this.page = 1 this.getData(1) }, // 课程选择回调 diff --git a/src/pages/course/add/index.vue b/src/pages/course/add/index.vue index 09858ff..a945b7d 100644 --- a/src/pages/course/add/index.vue +++ b/src/pages/course/add/index.vue @@ -394,7 +394,7 @@ export default { }).then(() => { this.$router.replace(`/course/contentSettings?id=${courseId}`); }).catch(() => { - cb ? cb() : this.$router.back() + cb ? cb() : this.$router.push('list') }); }).catch(err => { this.submiting = false; diff --git a/src/pages/expSystem/backstage/sourceModel.vue b/src/pages/expSystem/backstage/sourceModel.vue index 1b63438..75fc299 100644 --- a/src/pages/expSystem/backstage/sourceModel.vue +++ b/src/pages/expSystem/backstage/sourceModel.vue @@ -3,7 +3,7 @@
    + @loadData="loadData">
    @@ -198,14 +198,17 @@ export default { this.listData = res.data.records this.total = res.data.total }, + loadData (school) { + this.isSystem = school + this.getData() + }, // 分类点击回调 catetoryClick (school) { this.isSystem = school this.initData() }, initData (school) { - this.page = 1 - this.getData() + this.handleCurrentChange(1) }, // 新增 add () { diff --git a/src/pages/expSystem/backstage/sourceType.vue b/src/pages/expSystem/backstage/sourceType.vue index baf062a..cf71910 100644 --- a/src/pages/expSystem/backstage/sourceType.vue +++ b/src/pages/expSystem/backstage/sourceType.vue @@ -118,7 +118,7 @@ export default { isSystem } }).catch(err => { }) - this.$emit('initData', +isSystem) + this.$emit('loadData', +isSystem) }) }, // 分类类型选择回调 diff --git a/src/pages/information/addarticle/index.vue b/src/pages/information/addarticle/index.vue index 04153e3..8133063 100644 --- a/src/pages/information/addarticle/index.vue +++ b/src/pages/information/addarticle/index.vue @@ -236,7 +236,7 @@ export default { this.submiting = false; util.successMsg("创建成功"); this.updateTime = 0 - cb ? cb() : this.$router.back() + cb ? cb() : this.$router.push('list') }) .catch(err => { this.submiting = false; diff --git a/src/pages/match/add/index.vue b/src/pages/match/add/index.vue index 6bfda41..32c2bfb 100644 --- a/src/pages/match/add/index.vue +++ b/src/pages/match/add/index.vue @@ -270,7 +270,7 @@ export default { this.editing = false } } else { - this.$router.push(`/match?page=${this.$store.state.match.page}`) + this.backPage() } }, back () { diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index 5180033..e6d98e7 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -382,8 +382,7 @@ export default { }) }, initData () { - this.page = 1; - this.getData(); + this.handleCurrentChange(1) }, // 缓存参数及分页 setCache () { @@ -403,6 +402,14 @@ export default { }).then(async () => { await this.$post(`${this.api.copyCompetition}?competitionId=${row.id}`) util.successMsg('复制成功') + this.form = { + keyword: '', + month: '', + publishStatus: '', + startTime: '', + endTime: '', + } + this.date = [] this.initData() }).catch(() => { }) }, diff --git a/src/pages/match/manage/matchArchList.vue b/src/pages/match/manage/matchArchList.vue index 95e0258..9c1f201 100644 --- a/src/pages/match/manage/matchArchList.vue +++ b/src/pages/match/manage/matchArchList.vue @@ -494,7 +494,7 @@ export default { }, handleCurrentChange (val) { // 切换分页 this.$router.push({ - path: 'manage', + path: 'archList', query: { ...this.$route.query, page: val diff --git a/src/pages/match/manage/matchInfo.vue b/src/pages/match/manage/matchInfo.vue index 34f6e4d..eecf844 100644 --- a/src/pages/match/manage/matchInfo.vue +++ b/src/pages/match/manage/matchInfo.vue @@ -146,8 +146,8 @@ 分数{{item.score}} - 查看成绩详情 @@ -268,7 +268,8 @@ {{ item.timeSum }}min {{ item.score }} - 查看 diff --git a/src/pages/match/manage/matchSignup.vue b/src/pages/match/manage/matchSignup.vue index ba9dda0..523c985 100644 --- a/src/pages/match/manage/matchSignup.vue +++ b/src/pages/match/manage/matchSignup.vue @@ -449,12 +449,13 @@ export default { } }, mounted () { - this.initData() + this.getData() this.getInfo() this.getTeam() }, methods: { init () { + this.keyword = '' this.initData() this.getTeam() this.getClient() @@ -496,8 +497,7 @@ export default { }).catch(err => { }) }, initData () { - this.page = 1 - this.getData() + this.handleCurrentChange(1) }, handleSelectionChange (val) { this.multipleSelection = val; @@ -513,7 +513,7 @@ export default { this.page = val; this.getData(); }, - switchOff (val, row, index) { + switchOff (val, row) { this.$put(`${this.api.disableRegistration}?competitionRegistrationId=${row.id}&isDisable=${val}`).then(res => { }).catch(err => { }); }, // 排序回调 @@ -606,7 +606,6 @@ export default { cancelUpload () { this.uploading = false this.$refs.upload.abort() - this.keyword = '' this.init() this.importVisible = false }, @@ -880,9 +879,10 @@ export default { // 批量删除 async batchDel () { const list = this.multipleSelection - const tips = list.length ? (this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?' : '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?') : '删除后参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定删除全部报名人员?' + const tips = list.length ? (this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?' : '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?') : '删除后参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定删除全部报名人员?' this.$confirm(tips, "提示", { - type: "warning" + type: "warning", + dangerouslyUseHTMLString: true }).then(async () => { if (list.length) { await this.$post(this.api.batchDeleteApplicants, { registrationVOS: list }) diff --git a/src/pages/product/list/index.vue b/src/pages/product/list/index.vue index 5b08879..fa49594 100644 --- a/src/pages/product/list/index.vue +++ b/src/pages/product/list/index.vue @@ -295,7 +295,7 @@ export default { this.getSubject() this.getLabel() this.getClass() - this.initData() + this.getData() }, methods: { // 获取banner diff --git a/src/pages/project/list/index.vue b/src/pages/project/list/index.vue index 7842a5d..cd5dec1 100644 --- a/src/pages/project/list/index.vue +++ b/src/pages/project/list/index.vue @@ -302,7 +302,6 @@ export default { projectManage: {} }, // 复制之后,提交到后台的数据 listDataAll: [], - isFirst: true }; }, computed: { @@ -330,7 +329,6 @@ export default { } this.getSystemData() - this.getData() }, methods: { ...mapActions("project", [ @@ -338,14 +336,12 @@ export default { ]), getData () { this.setSystemId(this.form.systemId); - if (this.isFirst) this.page = +this.$route.query.page || 1 let data = { ...this.form, pageNum: this.page, pageSize: this.pageSize, }; this.$post(this.api.queryProjectManage, data).then(res => { - this.isFirst = false this.listData = res.data.records; this.total = res.data.total; }).catch(err => { @@ -372,7 +368,7 @@ export default { e.children = all.filter(n => e.systemId.split(',').includes(n.id + '')) // 筛选出该课程下的系统 }) this.curs = data - this.curChange(this.cid) + this.curChange(this.cid, 1) } }).catch(err => { }) }, @@ -459,12 +455,10 @@ export default { this.$get(`${this.api.updateIsOpen}?isOpen=${row.ccupationlabOpen}&projectId=${row.projectId}&platformId=${this.form.platformId}`).then(res => { util.successMsg("更新启用状态成功"); this.getData(); - }).catch(err => { - console.log(err); - }); + }).catch(err => { }); }, // 课程选择回调 - curChange (val) { + curChange (val, first) { const mallId = val[0] if (val.length === 1) { // 如果选择的是课程,则默认选中下面第一个系统 @@ -473,7 +467,7 @@ export default { this.form.mallId = mallId this.form.cid = this.curs.find(e => e.id === mallId).cid this.form.systemId = this.cid[1] - this.initData() + first ? this.getData() : this.initData() }, copyData (projectId) { // 复制,根据项目id查询详情 this.copyVisible = true; @@ -530,6 +524,11 @@ export default { i.projectId = '' }); this.$post(`${this.api.copyProjectManage}`, row).then(res => { + this.form.projectName = '' + this.form.state = '' + this.form.permissions = '' + this.form.founder = 2 + this.initData(); util.successMsg("复制实验项目成功"); this.copyVisible = false; diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index 87dc58c..11e77d6 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -64,7 +64,7 @@ export default { return { isSq: Setting.isSq, keyword: this.$route.query.keyword || '', - active: 0, + active: +this.$route.query.active || 0, tabs: [ { id: 0, @@ -95,7 +95,7 @@ export default { }).catch(err => { }); }, goPreview (item) { - this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}&keyword=${this.keyword}`); + this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}&keyword=${this.keyword}&active=${this.active}`); }, // tab切换 tabChange (item) { diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index cce8abe..88c7e00 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -3,7 +3,7 @@
    -
    @@ -559,10 +559,11 @@ export default { }, methods: { - goBack () { + back () { + const { query } = this.$route this.fromAdmin ? this.$router.back() : - this.$router.push(`/station?keyword=${this.$route.query.keyword || ''}`) + this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}`) }, init () { this.insertScript(); diff --git a/src/store/modules/activity.js b/src/store/modules/activity.js index 834c429..9616252 100644 --- a/src/store/modules/activity.js +++ b/src/store/modules/activity.js @@ -1,5 +1,5 @@ /** - * 赛事相关 + * 活动相关 * */ export default { namespaced: true, diff --git a/src/store/modules/expSystem.js b/src/store/modules/expSystem.js index 834c429..091a84e 100644 --- a/src/store/modules/expSystem.js +++ b/src/store/modules/expSystem.js @@ -1,5 +1,5 @@ /** - * 赛事相关 + * 实验系统相关 * */ export default { namespaced: true,