dev_review
yujialong 1 year ago
parent 85ab452faf
commit 3b6aadbd21
  1. 1
      src/components/quill/index.vue
  2. 2
      src/utils/editor.js
  3. 1
      src/views/course/contentSettings.vue
  4. 5
      src/views/information/addArticle/index.vue
  5. 4
      src/views/match/add/step1.vue
  6. 21
      src/views/match/add/step3.vue
  7. 3
      src/views/match/preview/index.vue
  8. 1
      src/views/theoreticalCourse/add/index.vue

@ -43,7 +43,6 @@ import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options' import toolbarOptions from './options'
import axios from 'axios'
import { mavonEditor } from 'mavon-editor' import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css' import 'mavon-editor/dist/css/index.css'
import Upload from '@/components/upload'; import Upload from '@/components/upload';

@ -336,8 +336,6 @@ export default {
input.setAttribute("accept", ".mp4"); input.setAttribute("accept", ".mp4");
input.onchange = function(){ input.onchange = function(){
let file = this.files[0]; let file = this.files[0];
let fd = new FormData();
fd.append("file", file);
const load = Loading.service() const load = Loading.service()
Oss.upload(file).then(res => { Oss.upload(file).then(res => {
load.close() load.close()

@ -348,7 +348,6 @@ import { Loading } from "element-ui";
import Pdf from "@/components/pdf"; import Pdf from "@/components/pdf";
import Upload from '@/components/upload'; import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
import axios from 'axios'
import Util from '@/libs/util' import Util from '@/libs/util'
export default { export default {

@ -174,14 +174,11 @@ export default {
}, },
// //
async handleRequest ({ file }) { async handleRequest ({ file }) {
this.form.coverUrl && Oss.del(this.form.coverUrl)
Oss.upload(file).then(res => { Oss.upload(file).then(res => {
this.form.coverUrl = res.url 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) { uploadError (err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",

@ -271,15 +271,11 @@ import util from "@/libs/util";
import quill from "@/components/quill"; import quill from "@/components/quill";
import Upload from '@/components/upload'; import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js' import Oss from '@/components/upload/upload.js'
import { Loading } from 'element-ui'
export default { export default {
props: ['editing'], props: ['editing'],
data () { data () {
const that = this const that = this
return { return {
headers: {
token: sessionStorage.getItem('token')
},
form: { form: {
id: this.$route.query.id || '', id: this.$route.query.id || '',
platformSource: 0, // (0:1) platformSource: 0, // (0:1)

@ -64,10 +64,8 @@
:on-error="uploadError" :on-error="uploadError"
:before-remove="beforeRemove" :before-remove="beforeRemove"
action="" action=""
:headers="headers"
:file-list="item.competitionStageContentSetting.fileList" :file-list="item.competitionStageContentSetting.fileList"
:http-request="res => handleRequest(res, item)" :http-request="res => handleRequest(res, item)">
name="file">
<el-button size="small" <el-button size="small"
type="primary">上传文件</el-button> type="primary">上传文件</el-button>
</el-upload> </el-upload>
@ -348,11 +346,11 @@ export default {
this.$emit('next', next) this.$emit('next', next)
return return
} }
// let invalid = 0
if (status) { const { playStartTime, playEndTime } = this.step1
let invalid = 0 for (const e of form) {
const { playStartTime, playEndTime } = this.step1 //
for (const e of form) { if (status) {
if (!e.time.length) { if (!e.time.length) {
invalid = 1 invalid = 1
util.errorMsg('请选择比赛时间') util.errorMsg('请选择比赛时间')
@ -363,8 +361,6 @@ export default {
util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
break break
} }
e.startTime = e.time[0]
e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) { if (e.method !== 2 && !e.cid) {
invalid = 1 invalid = 1
util.errorMsg('请选择课程') 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) { for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0 e.offlineButton = e.offlineButton ? 1 : 0

@ -78,7 +78,7 @@
<p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p> <p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p> <p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template> </template>
<p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p> <!-- <p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p> -->
<div v-if="form.rule === 1" <div v-if="form.rule === 1"
class="flex"> class="flex">
<p>晋级规则</p> <p>晋级规则</p>
@ -183,6 +183,7 @@ export default {
}, },
mounted () { mounted () {
this.handleAnnex() this.handleAnnex()
console.log("🚀 ~ file: index.vue:187 ~ mounted ~ this.form:", this.form)
if (this.form.id) { if (this.form.id) {
this.getProgress() this.getProgress()
this.getNotice() this.getNotice()

@ -470,6 +470,7 @@ export default {
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!"); util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
}, },
handleRequest ({ file }) { handleRequest ({ file }) {
this.form.coverUrl && Oss.del(this.form.coverUrl)
Oss.upload(file).then(res => { Oss.upload(file).then(res => {
this.form.coverUrl = res.url this.form.coverUrl = res.url
}) })

Loading…
Cancel
Save