diff --git a/package-lock.json b/package-lock.json index 9eff37d..ba66ec7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4711,6 +4711,11 @@ "schema-utils": "^1.0.0" } }, + "file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" + }, "filesize": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", diff --git a/package.json b/package.json index 8b5ec85..f82f47c 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "clipboard": "^2.0.11", "element-theme": "^2.0.1", "element-ui": "^2.13.0", + "file-saver": "^2.0.5", "js-cookie": "^3.0.1", "mavon-editor": "^2.6.17", "postcss-px2rem": "^0.3.0", diff --git a/src/assets/img/none.png b/src/assets/img/none.png new file mode 100644 index 0000000..88c0085 Binary files /dev/null and b/src/assets/img/none.png differ 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/views/match/add/index.vue b/src/views/match/add/index.vue index 44a6589..6340ce4 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -143,26 +143,29 @@ - -
- - {{tag.label}} - +
+ + + {{tag.label}} +
@@ -216,11 +219,13 @@ export default { } }, rangeVisible: false, - casVisible: true, range: [], rangeInit: [], rangeName: '', rangeChecked: [], + schools: [], + rangeList: [], + rangeTimer: null, // 选择区域懒加载 props: { multiple: true, @@ -229,20 +234,22 @@ export default { lazyLoad (node, resolve) { // 如果是在模糊搜索中,则不再用懒加载请求数据 const input = document.querySelector('.el-cascader__search-input') - console.log("🚀 ~ file: index.vue ~ line 219 ~ lazyLoad ~ input", input, node) - if (input && input.value) return resolve([]) + + if (input && input.value.trim()) { + const val = input.value.trim() + return that.schools.filter(e => e.label.includes(val)) + } + const { level, value } = node // 省份 - console.log('lazy', node, that.range) if (!level) { that.$get(that.api.queryProvince).then(({ list }) => { const data = [] list.map(e => { - data.push({ - value: e.provinceId, - label: e.provinceName, - children: [] - }) + e.value = e.provinceId + e.label = e.provinceName + e.children = [] + data.push(e) }) resolve(data) }).catch(res => {}) @@ -253,11 +260,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 => {}) @@ -270,11 +276,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 => {}) @@ -285,9 +290,6 @@ export default { }, submiting: false, updateTime: 0, - rangeTimer: null, - schools: [], - rangeList: [] }; }, components: { @@ -360,7 +362,6 @@ export default { range.push(item) }) this.range = range - console.log("🚀 ~ file: matchDetail.vue ~ line 327 ~ this.$post ~ this.range", this.range) } // 选择范围name @@ -379,36 +380,24 @@ export default { showRange() { this.rangeVisible = true }, - rangeViChange(boolean){ - console.log(33, this.$refs.range.$refs.panel) - //true下拉框展开 false下拉框收起 展开时清掉上次搜索结果 恢复如初 - if(boolean){ - this.$refs.range.$refs.panel.activePath=[]; - // this.getCascader("region", null); - } - }, rangeChange(val, e) { - console.log("🚀 ~ file: index.vue ~ line 388 ~ rangeChange ~ val", val, this.$refs.range.getCheckedNodes()) const checked = this.$refs.range.getCheckedNodes() const name = [] + const { rangeChecked } = this checked.map(e => { - name.push({ - value: e.value, - label: e.label - }) + rangeChecked.find(n => n.value === e.value) || name.push(e.data) }) - this.rangeChecked = name + this.rangeChecked = checked }, // 获取学校列表 getSchool() { this.$get(this.api.querySchoolData).then(({ list }) => { const result = [] list.map(e => { - result.push({ - value: e.schoolId, - label: e.schoolName, - leaf: true - }) + e.value = e.schoolId + e.label = e.schoolName + e.leaf = true + result.push(e) }) this.schools = result }).catch(res => {}) @@ -419,15 +408,19 @@ export default { }, // 范围筛选 rangeSearch(el) { - const val = el.target.value - if (!val) return false + const val = el.target.value.trim() + if (!val) { + this.rangeList = [] + return false + } clearTimeout(this.rangeTimer) this.rangeTimer = setTimeout(() => { - // this.$refs.range.$refs.panel.activePath = [] let result = this.schools.filter(e => e.label.includes(val)) // 用学校列表做比对 - console.log("🚀 ~ file: index.vue ~ line 428 ~ this.rangeTimer=setTimeout ~ result",this.schools.filter(e => e.label.includes(val)), this.schools) this.rangeList = result - }, 500) + }, 100) + }, + closeRange(i) { + this.rangeChecked.splice(i, 1) }, // 范围确定 rangeSubmit() { @@ -737,9 +730,12 @@ $upload-lg-height: 150px; } } .range-check { - margin-top: 10px; + display: inline-block; + margin: 0 0 10px 10px; +} +/deep/.range-cas { .el-tag { - margin-right: 10px; + display: none; } } \ No newline at end of file diff --git a/src/views/match/list/index.vue b/src/views/match/list/index.vue index c0e7b17..a782b13 100644 --- a/src/views/match/list/index.vue +++ b/src/views/match/list/index.vue @@ -318,17 +318,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: 0 // 禁用平台来源(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: 0 // 禁用平台来源(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: 0 // 禁用平台来源(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 => { - }); + }).catch(err => {}) + }).catch(err => {}) + }).catch(() => { + row.ztOpen = 1 + }) + } else { + this.disable(val, row) + } } } }; diff --git a/src/views/match/manage/matchSignup.vue b/src/views/match/manage/matchSignup.vue index f6a0f3f..61a47be 100644 --- a/src/views/match/manage/matchSignup.vue +++ b/src/views/match/manage/matchSignup.vue @@ -5,7 +5,7 @@
  • - +
diff --git a/src/views/match/preview/index.vue b/src/views/match/preview/index.vue index 5c76c94..207d0b9 100644 --- a/src/views/match/preview/index.vue +++ b/src/views/match/preview/index.vue @@ -5,7 +5,7 @@
- +
等待报名
@@ -27,6 +27,51 @@ + + + +
竞赛进展
+
    +
  • + +

    {{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