From 3b6aadbd21dbada76c846cff0d8aa792a21b9eb8 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 30 Nov 2023 15:47:52 +0800 Subject: [PATCH] fix --- src/components/quill/index.vue | 1 - src/utils/editor.js | 2 -- src/views/course/contentSettings.vue | 1 - src/views/information/addArticle/index.vue | 5 +---- src/views/match/add/step1.vue | 4 ---- src/views/match/add/step3.vue | 21 ++++++++++----------- src/views/match/preview/index.vue | 3 ++- src/views/theoreticalCourse/add/index.vue | 1 + 8 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/components/quill/index.vue b/src/components/quill/index.vue index 5b3d283..1117f09 100644 --- a/src/components/quill/index.vue +++ b/src/components/quill/index.vue @@ -43,7 +43,6 @@ import 'quill/dist/quill.core.css'; import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.bubble.css'; import toolbarOptions from './options' -import axios from 'axios' import { mavonEditor } from 'mavon-editor' import 'mavon-editor/dist/css/index.css' import Upload from '@/components/upload'; diff --git a/src/utils/editor.js b/src/utils/editor.js index baee08b..037a2c3 100644 --- a/src/utils/editor.js +++ b/src/utils/editor.js @@ -336,8 +336,6 @@ export default { input.setAttribute("accept", ".mp4"); input.onchange = function(){ let file = this.files[0]; - let fd = new FormData(); - fd.append("file", file); const load = Loading.service() Oss.upload(file).then(res => { load.close() diff --git a/src/views/course/contentSettings.vue b/src/views/course/contentSettings.vue index 5136d2c..3053163 100644 --- a/src/views/course/contentSettings.vue +++ b/src/views/course/contentSettings.vue @@ -348,7 +348,6 @@ import { Loading } from "element-ui"; import Pdf from "@/components/pdf"; import Upload from '@/components/upload'; import Oss from '@/components/upload/upload.js' -import axios from 'axios' import Util from '@/libs/util' export default { diff --git a/src/views/information/addArticle/index.vue b/src/views/information/addArticle/index.vue index cfe0c2c..cd020e7 100644 --- a/src/views/information/addArticle/index.vue +++ b/src/views/information/addArticle/index.vue @@ -174,14 +174,11 @@ export default { }, // 封面自定义上传 async handleRequest ({ file }) { + this.form.coverUrl && Oss.del(this.form.coverUrl) Oss.upload(file).then(res => { this.form.coverUrl = res.url }) }, - uploadSuccess (res, file, fileList) { - Oss.del(this.form.coverUrl) - this.form.coverUrl = res.data.filesResult.fileUrl; - }, uploadError (err, file, fileList) { this.$message({ message: "上传出错,请重试!", diff --git a/src/views/match/add/step1.vue b/src/views/match/add/step1.vue index caa4223..1e761f0 100644 --- a/src/views/match/add/step1.vue +++ b/src/views/match/add/step1.vue @@ -271,15 +271,11 @@ import util from "@/libs/util"; import quill from "@/components/quill"; import Upload from '@/components/upload'; import Oss from '@/components/upload/upload.js' -import { Loading } from 'element-ui' export default { props: ['editing'], data () { const that = this return { - headers: { - token: sessionStorage.getItem('token') - }, form: { id: this.$route.query.id || '', platformSource: 0, // 平台来源(0:中台,1:职站) diff --git a/src/views/match/add/step3.vue b/src/views/match/add/step3.vue index d9bb366..f9b2c80 100644 --- a/src/views/match/add/step3.vue +++ b/src/views/match/add/step3.vue @@ -64,10 +64,8 @@ :on-error="uploadError" :before-remove="beforeRemove" action="" - :headers="headers" :file-list="item.competitionStageContentSetting.fileList" - :http-request="res => handleRequest(res, item)" - name="file"> + :http-request="res => handleRequest(res, item)"> 上传文件 @@ -348,11 +346,11 @@ export default { this.$emit('next', next) return } - // 发布才需要判断必填 - if (status) { - let invalid = 0 - const { playStartTime, playEndTime } = this.step1 - for (const e of form) { + let invalid = 0 + const { playStartTime, playEndTime } = this.step1 + for (const e of form) { + // 发布才需要判断必填 + if (status) { if (!e.time.length) { invalid = 1 util.errorMsg('请选择比赛时间') @@ -363,8 +361,6 @@ export default { util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') break } - e.startTime = e.time[0] - e.endTime = e.time[1] if (e.method !== 2 && !e.cid) { invalid = 1 util.errorMsg('请选择课程') @@ -409,8 +405,11 @@ export default { } } } - if (invalid) return + + e.startTime = e.time[0] + e.endTime = e.time[1] } + if (invalid) return // 处理单选框 for (const e of form) { e.offlineButton = e.offlineButton ? 1 : 0 diff --git a/src/views/match/preview/index.vue b/src/views/match/preview/index.vue index 0d4e722..f5daf34 100644 --- a/src/views/match/preview/index.vue +++ b/src/views/match/preview/index.vue @@ -78,7 +78,7 @@

每个团队参赛人数限制:{{ rule.teamNumLimit || '不限制' }}

团队成绩计算方式:{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}

-

阶段比赛结束后{{ rule.resultAnnouncementTime }}小时,公布阶段比赛成绩。

+

晋级规则:

@@ -183,6 +183,7 @@ export default { }, mounted () { this.handleAnnex() + console.log("🚀 ~ file: index.vue:187 ~ mounted ~ this.form:", this.form) if (this.form.id) { this.getProgress() this.getNotice() diff --git a/src/views/theoreticalCourse/add/index.vue b/src/views/theoreticalCourse/add/index.vue index ce2bb0e..9c6651f 100644 --- a/src/views/theoreticalCourse/add/index.vue +++ b/src/views/theoreticalCourse/add/index.vue @@ -470,6 +470,7 @@ export default { util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!"); }, handleRequest ({ file }) { + this.form.coverUrl && Oss.del(this.form.coverUrl) Oss.upload(file).then(res => { this.form.coverUrl = res.url })