diff --git a/src/api/index.js b/src/api/index.js index 1cda0e0..c039c62 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -114,6 +114,7 @@ export default { saveAnnex: `occupationlab/occupationlab/contest/annex/save`, getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`, disabledEvents: `occupationlab/occupationlab/enterprise/match/contest/disabledEvents`, + batchDeleteContest: `occupationlab/occupationlab/enterprise/match/contest/batchDeleteContest`, // 竞赛进展 addContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/addContestProgress`, diff --git a/src/assets/img/rocket.png b/src/assets/img/rocket.png new file mode 100644 index 0000000..41c2860 Binary files /dev/null and b/src/assets/img/rocket.png differ diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue index e4eab4d..40967bc 100644 --- a/src/pages/achievement/list/index.vue +++ b/src/pages/achievement/list/index.vue @@ -70,23 +70,23 @@ - - + + {{ scope.row.experimentalName }} - - + + {{ projectPermissions ? '考核' : '练习' }} - - + + - + 成绩管理 删除 diff --git a/src/pages/match/add/index.vue b/src/pages/match/add/index.vue index 8f9fe7b..16b0f5b 100644 --- a/src/pages/match/add/index.vue +++ b/src/pages/match/add/index.vue @@ -135,21 +135,38 @@ 保存 - 发布 - 预览 + 发布 + 预览 - + + + closeRange(i)"> + {{tag.label}} + + 取 消 确 定 @@ -202,26 +219,36 @@ export default { } }, rangeVisible: false, - casVisible: true, range: [], rangeInit: [], rangeName: '', + rangeChecked: [], + schools: [], + rangeList: [], // 选择区域懒加载 props: { multiple: true, checkStrictly: true, lazy: true, lazyLoad (node, resolve) { + // 如果是在模糊搜索中,则不再用懒加载请求数据 + const input = document.querySelector('.el-cascader__search-input') + + if (input && input.value.trim()) { + const val = input.value.trim() + return that.schools.filter(e => e.label.includes(val)) + } + const { level, value } = node // 省份 if (!level) { that.$get(that.api.queryProvince).then(({ list }) => { const data = [] list.map(e => { - data.push({ - value: e.provinceId, - label: e.provinceName - }) + e.value = e.provinceId + e.label = e.provinceName + e.children = [] + data.push(e) }) resolve(data) }).catch(res => {}) @@ -232,11 +259,10 @@ export default { }).then(({ list }) => { const data = [] list.map(e => { - data.push({ - provinceId: value, - value: e.cityId, - label: e.cityName - }) + e.value = e.cityId + e.label = e.cityName + e.children = [] + data.push(e) }) resolve(data) }).catch(res => {}) @@ -249,11 +275,10 @@ export default { }).then(({ list }) => { const data = [] list.map(e => { - data.push({ - value: e.schoolId, - label: e.schoolName, - leaf: true - }) + e.value = e.schoolId + e.label = e.schoolName + e.leaf = true + data.push(e) }) resolve(data) }).catch(res => {}) @@ -264,9 +289,6 @@ export default { }, submiting: false, updateTime: 0, - rangeTimer: null, - schools: [], - rangeList: [] }; }, components: { @@ -303,7 +325,7 @@ export default { }, mounted() { this.getData() - // this.getSchool() + this.getSchool() }, methods: { getData() { @@ -357,11 +379,26 @@ export default { showRange() { this.rangeVisible = true }, + rangeChange(val, e) { + const checked = this.$refs.range.getCheckedNodes() + const name = [] + const { rangeChecked } = this + checked.map(e => { + rangeChecked.find(n => n.value === e.value) || name.push(e.data) + }) + this.rangeChecked = checked + }, // 获取学校列表 getSchool() { this.$get(this.api.querySchoolData).then(({ list }) => { - list.map(e => e.label = e.schoolName) - this.schools = list + const result = [] + list.map(e => { + e.value = e.schoolId + e.label = e.schoolName + e.leaf = true + result.push(e) + }) + this.schools = result }).catch(res => {}) }, // 范围模糊查询前置钩子 @@ -370,12 +407,19 @@ export default { }, // 范围筛选 rangeSearch(el) { + const val = el.target.value.trim() + if (!val) { + this.rangeList = [] + return false + } clearTimeout(this.rangeTimer) this.rangeTimer = setTimeout(() => { - const val = el.target.value - let result = this.schools.filter(e => e.schoolName.includes(val)) // 用学校列表做比对 - this.rangeList = val ? result : [] - }, 500) + let result = this.schools.filter(e => e.label.includes(val)) // 用学校列表做比对 + this.rangeList = result + }, 100) + }, + closeRange(i) { + this.rangeChecked.splice(i, 1) }, // 范围确定 rangeSubmit() { @@ -500,7 +544,7 @@ export default { this.submiting = true form.publishStatus = status - form.ztOpen = status ? 0 : 1 // 保存则禁用,发布则启用 + form.isOpen = status ? 0 : 1 // 保存则禁用,发布则启用 if (this.form.id) { this.$post(this.api.editContest, form).then(res => { this.updateTime = 1 @@ -761,4 +805,13 @@ $upload-lg-height: 150px; } } } +.range-check { + display: inline-block; + margin: 0 0 10px 10px; +} +/deep/.range-cas { + .el-tag { + display: none; + } +} \ No newline at end of file diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index 38a2c47..593cdfc 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -40,10 +40,12 @@ 创建竞赛 + 批量删除 + {{ scope.$index + (page - 1) * pageSize + 1 }} @@ -271,6 +273,25 @@ export default { handleSelectionChange(val) { this.multipleSelection = val; }, + // 批量删除 + delAllSelection() { + if (this.multipleSelection.length) { + this.$confirm("确定要删除吗?", "提示", { + type: "warning" + }).then(() => { + let ids = this.multipleSelection.map(i => 'contestIds=' + i.id); + this.$post(`${this.api.batchDeleteContest}?${ids.join('&')}`).then(res => { + this.getData(); + this.$message.success("删除成功"); + this.$refs.table.clearSelection() + }).catch(err => { + }); + }).catch(() => { + }); + } else { + this.$message.warning("请先选择赛事 !"); + } + }, handleCurrentChange(val) { this.page = val; this.$router.push(`list?page=${val}`) @@ -281,18 +302,39 @@ export default { if (date == "0000-00-00 00:00:00") return "---"; return date; }, + disable(val, row) { + this.$post(this.api.disabledEvents, { + contestId: row.id, + isOpen: val, + type: 1 // 禁用平台来源(0中台,1职站) + }).then(res => { + val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') + }).catch(err => {}) + }, switchOff(val, row, index) { - this.$post(this.api.disabledEvents, { - contestId: row.id, - isOpen: val, - type: 1 // 禁用平台来源(0中台,1职站) - }) - .then(res => { + if (val) { + this.disable(val, row) + } else if (!row.publishStatus) { + this.$confirm('是否发布该大赛?', '提示', { + type: 'success' + }).then(() => { + this.$post(this.api.disabledEvents, { + contestId: row.id, + isOpen: val, + type: 1 // 禁用平台来源(0中台,1职站) + }).then(res => { + row.publishStatus = 1 + this.$post(this.api.editContest, row).then(res => { + this.getData() val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') - }) - .catch(err => { - row.isOpen = val ? 0 : 1 - }); + }).catch(err => {}) + }).catch(err => {}) + }).catch(() => { + row.isOpen = 1 + }) + } else { + this.disable(val, row) + } } } }; diff --git a/src/pages/match/manage/matchSignup.vue b/src/pages/match/manage/matchSignup.vue index 3bdefe5..86d4670 100644 --- a/src/pages/match/manage/matchSignup.vue +++ b/src/pages/match/manage/matchSignup.vue @@ -5,7 +5,7 @@ 搜索: - + @@ -28,6 +28,8 @@ + + + 竞赛进展 + + + + {{item.title}} + {{item.description}} + + + + + + + + 暂无数据 + + + + + + 通知公告 + + + {{ item.announcementTitle }} + {{ item.updateTime }} + + + + + + + + 暂无通知公告 + + + @@ -54,7 +99,9 @@ export default { name: '通知公告' } ], - form: util.local.get('match') + form: util.local.get('match'), + progress: [], + notices: [], }; }, components: { @@ -62,6 +109,10 @@ export default { }, mounted() { this.handleAnnex() + if (this.form.id) { + this.getProgress() + this.getNotice() + } }, methods: { // 处理附件 @@ -75,6 +126,19 @@ export default { this.$forceUpdate() } }, + getProgress() { // 获取竞赛进展 + this.$get(this.api.getContestProgress, { + contestId: this.form.id + }).then(res => { + this.progress = res.contestProgressList.reverse() + }).catch(err => {}); + }, + // 公告列表 + getNotice() { + this.$post(`${this.api.queryAnnouncementByContestId}?pageNum=1&pageSize=1000&contestId=${this.form.id}`).then(({ data }) => { + this.notices = data.records.filter(e => e.status) // 只显示已发布的(status 0草稿 1为已发布) + }).catch(res => {}) + }, // 预览附件 previewFile(item) { const { filePath } = item @@ -85,13 +149,17 @@ export default { download(item) { util.downloadFile(item.fileName, item.filePath) }, + // tab切换 + typeChange() { + document.querySelector(`#part${this.curType}`).scrollIntoView() + }, } }; \ No newline at end of file diff --git a/src/pages/student/list/index.vue b/src/pages/student/list/index.vue index e25ec6d..561bcb1 100644 --- a/src/pages/student/list/index.vue +++ b/src/pages/student/list/index.vue @@ -192,7 +192,8 @@ {{ node.label }} handleAdd(node, data)"> diff --git a/src/plugins/auth/index.js b/src/plugins/auth/index.js index c99892d..48a6975 100644 --- a/src/plugins/auth/index.js +++ b/src/plugins/auth/index.js @@ -8,8 +8,8 @@ import store from '@/store' export default { inserted(el, binding, vnode) { const val = binding.value - // 如果有传值,就取传的值,否则,就取按钮名字 - const text = val.includes('/') ? val : vnode.context.$route.path + ':' + (val || el.innerText) + // 如果有传值,判断是否有/,有就说说明传的是完整的值,否则就拿路由拼接传的值;如果没传值,就取按钮名字 + const text = val && val.includes('/') ? val : vnode.context.$route.path + ':' + (val || el.innerText) const { btns } = store.state.auth if (text && btns && btns.length) { // 如果按钮集合里没有该权限,就把该按钮给去除 diff --git a/src/router/modules/match.js b/src/router/modules/match.js index 0db5d7b..99c0f78 100644 --- a/src/router/modules/match.js +++ b/src/router/modules/match.js @@ -30,6 +30,12 @@ export default { path: `manage`, component: () => import("@/pages/match/manage"), meta: { title: "管理赛事" } + }, + { + name: `${pre}noticeDetail`, + path: `noticeDetail`, + component: () => import("@/pages/match/manage/noticeDetail"), + meta: { title: "通知公告" } } ] }; \ No newline at end of file diff --git a/src/setting.js b/src/setting.js index e8fbcf9..1e22972 100644 --- a/src/setting.js +++ b/src/setting.js @@ -23,7 +23,7 @@ if (isPro) { jumpPath = "http://192.168.31.125:8087/"; bankPath = `http://192.168.31.125:8093` host = "http://121.37.12.51/"; // 中台测试服 - host = "http://192.168.31.151:9000/"; // 榕 + // host = "http://192.168.31.151:9000/"; // 榕 // host = 'http://192.168.31.137:9000/'; // 赓 }
{{item.title}}
{{item.description}}
暂无数据
{{ item.updateTime }}
暂无通知公告