dev_review
yujialong 1 year ago
parent 7b11aa9960
commit 4036589adb
  1. 2
      src/setting.js
  2. 2
      src/utils/api.js
  3. 4
      src/utils/core.js
  4. 33
      src/views/course/contentSettings.vue
  5. 422
      src/views/information/addArticle/index.vue
  6. 11
      src/views/match/add/step1.vue
  7. 32
      src/views/match/add/step3.vue
  8. 18
      src/views/match/manage/matchArchList.vue
  9. 40
      src/views/match/manage/matchRank.vue
  10. 315
      src/views/match/manage/noticeDetail.vue
  11. 34
      src/views/order/AddOrder.vue
  12. 29
      src/views/parnerOperation/learnMg.vue
  13. 31
      src/views/parnerOperation/schemeSet.vue
  14. 37
      src/views/shop/addProduct/index.vue
  15. 23
      src/views/shop/list/market/index.vue
  16. 437
      src/views/system/addLog.vue
  17. 990
      src/views/theoreticalCourse/add/index.vue
  18. 31
      src/views/theoreticalCourse/contentSettings/index.vue

@ -13,7 +13,7 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.217:9000/'// 榕
// host = 'http://192.168.31.217:9000/'// 榕
// host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'

@ -415,6 +415,8 @@ export default {
cCompetitionStageFileList: `competition/cCompetitionStageFile/listByEntity`,
derive: `${host}competition/cCompetitionStageFile/deriveAll`,
allExperimentalResultsAreDerived: `${host}competition/competition/performance/allExperimentalResultsAreDerived`,
derivedRanking: `${host}competition/competition/rank/derivedRanking`,
individualDerivedRanking: `${host}competition/competition/rank/individualDerivedRanking`,
gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`,

@ -1,5 +1,3 @@
import { Loading } from 'element-ui'
const pad2 = str => ('0' + str).substr(-2)
function fMoney (s, n) {
@ -205,7 +203,6 @@ function formatDate(fmt,date) {
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
function downloadFile(fileName, url) {
const loadIns = Loading.service()
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = "blob"
@ -215,7 +212,6 @@ function downloadFile(fileName, url) {
a.href = url
a.download = fileName
a.click()
loadIns.close()
}
x.send()
}

@ -162,6 +162,7 @@
@submit.native.prevent>
<el-form-item label="资源添加">
<Upload :max-size="100000"
:file-list="uploadList"
:on-remove="handleRemove"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
@ -192,6 +193,7 @@
@close="closeSwitch">
<div style="text-align: center">
<Upload :max-size="100000"
:file-list="uploadList"
:on-remove="handleRemove"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
@ -528,34 +530,6 @@ export default {
this.fileUrl = file.url
this.fileName = file.name
},
//
handleRequest (data) {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data'
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false
this.fileId = fileId
this.fileType = fileType
this.fileUrl = fileUrl
this.fileName = ossFileName
})
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
@ -568,7 +542,8 @@ export default {
return this.$confirm(`确定移除 ${file.name}`);
}
},
handleRemove (file, fileList) {
handleRemove () {
Oss.del(this.fileUrl)
this.fileUrl = ''
},
uploadSure () {

@ -1,211 +1,238 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="'新增文章'"></el-page-header>
<div>
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack"
:content="'新增文章'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<el-form :model="form"
:rules="rules"
ref="form"
label-width="90px"
label-suffix=":"
size="small">
<el-form-item prop="coverUrl"
label="封面图">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
action=""
:http-request="handleRequest">
<img v-if="form.coverUrl"
:src="form.coverUrl"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<el-form :model="form" :rules="rules" ref="form" label-width="90px" label-suffix=":" size="small">
<el-form-item prop="coverUrl" label="封面图">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
</el-upload>
</el-form-item>
<el-form-item prop="author" label="作者">
<div class="d-inline-block">
<el-input placeholder="请输入作者" v-model="form.author" clearable></el-input>
</div>
</el-form-item>
<el-form-item prop="date" label="日期">
<div class="d-inline-block">
<el-date-picker v-model="form.date" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker>
</div>
</el-form-item>
<el-form-item prop="title" label="文章标题">
<el-input placeholder="请输入文章标题" v-model="form.title" clearable></el-input>
</el-form-item>
<el-form-item prop="content" label="文章内容">
<quill :border="true" v-model="form.content" :uploading.sync="uploading" :height="400" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="saveData">确定</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</el-upload>
</el-form-item>
<el-form-item prop="author"
label="作者">
<div class="d-inline-block">
<el-input placeholder="请输入作者"
v-model="form.author"
clearable></el-input>
</div>
</el-form-item>
<el-form-item prop="date"
label="日期">
<div class="d-inline-block">
<el-date-picker v-model="form.date"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</div>
</el-form-item>
<el-form-item prop="title"
label="文章标题">
<el-input placeholder="请输入文章标题"
v-model="form.title"
clearable></el-input>
</el-form-item>
<el-form-item prop="content"
label="文章内容">
<quill :border="true"
v-model="form.content"
:uploading.sync="uploading"
:height="400" />
</el-form-item>
<el-form-item>
<el-button type="primary"
@click="saveData">确定</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import Oss from '@/components/upload/upload.js'
import quill from "@/components/quill";
import util from "@/libs/util";
export default {
name: "addarticle",
data() {
return {
headers: {
token: sessionStorage.getItem('token')
},
form: {
columnId: +this.$route.query.columnId,
sort: +this.$route.query.sort,
id: '',
coverUrl: '',
author: '',
date: '',
title: '',
content: '',
createUser: this.$store.state.userName
},
rules: {
coverUrl: [
{ required: true, message: '请上传封面', trigger: 'change' }
],
author: [
{ required: true, message: '请输入作者', trigger: 'blur' }
],
date: [
{ required: true, message: '请选择日期', trigger: 'change' }
],
title: [
{ required: true, message: '请输入文章标题', trigger: 'blur' }
],
content: [
{ required: true, message: '请输入文章内容', trigger: 'blur' }
],
},
uploadList: [],
uploadDataList: [],
submiting: false,
uploading: false
};
name: "addarticle",
data () {
return {
headers: {
token: sessionStorage.getItem('token')
},
form: {
columnId: +this.$route.query.columnId,
sort: +this.$route.query.sort,
id: '',
coverUrl: '',
author: '',
date: '',
title: '',
content: '',
createUser: this.$store.state.userName
},
rules: {
coverUrl: [
{ required: true, message: '请上传封面', trigger: 'change' }
],
author: [
{ required: true, message: '请输入作者', trigger: 'blur' }
],
date: [
{ required: true, message: '请选择日期', trigger: 'change' }
],
title: [
{ required: true, message: '请输入文章标题', trigger: 'blur' }
],
content: [
{ required: true, message: '请输入文章内容', trigger: 'blur' }
],
},
uploadList: [],
uploadDataList: [],
submiting: false,
uploading: false
};
},
components: {
quill
},
mounted () {
this.id = this.$route.query.id;
this.id && this.getData();
},
methods: {
//
goBack () {
this.$router.back();
},
components: {
quill
getData () {
this.$get(`${this.api.getArticle}?articleId=${this.id}`).then(({ article }) => {
this.form = article
}).catch(err => { })
},
mounted() {
this.id = this.$route.query.id;
this.id && this.getData();
},
methods: {
//
goBack() {
this.$router.back();
},
getData() {
this.$get(`${this.api.getArticle}?articleId=${this.id}`).then(({ article }) => {
this.form = article
}).catch(err => {})
},
saveData() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
const { form } = this
if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.submiting = true
if (form.id) {
this.$put(this.api.editArticle, form).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addArticle, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
}
}
})
},
handleCurrentChange(val) {
this.currPage = val;
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
uploadSuccess(res, file, fileList) {
if (this.form.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
}
this.form.coverUrl = res.data.filesResult.fileUrl;
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.coverUrl = "";
}).catch(res => {
});
},
uploadSure() {
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
this.getData();
},
back() {
this.$router.back();
},
goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
saveData () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
const { form } = this
if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.submiting = true
if (form.id) {
this.$put(this.api.editArticle, form).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.back();
})
.then(() => {
this.back();
})
.catch(() => {
});
},
addSponsor() {
this.sponsorList.push("");
},
delSponsor(index) {
this.sponsorList.splice(index, 1);
},
addOrganizer() {
this.organzinerList.push("");
},
delOrganizer(index) {
this.organzinerList.splice(index, 1);
.catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addArticle, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
}
}
})
},
handleCurrentChange (val) {
this.currPage = val;
},
handleExceed (files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
//
async handleRequest ({ file }) {
Oss.upload(file).then(res => {
this.form.coverUrl = res.url
})
},
uploadSuccess (res, file, fileList) {
if (this.form.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
}
this.form.coverUrl = res.data.filesResult.fileUrl;
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList) {
Oss.del(this.form.coverUrl)
this.form.coverUrl = ''
},
uploadSure () {
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
this.getData();
},
back () {
this.$router.back();
},
goback () {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
})
.then(() => {
this.back();
})
.catch(() => {
});
},
addSponsor () {
this.sponsorList.push("");
},
delSponsor (index) {
this.sponsorList.splice(index, 1);
},
addOrganizer () {
this.organzinerList.push("");
},
delOrganizer (index) {
this.organzinerList.splice(index, 1);
}
}
};
</script>
@ -221,7 +248,7 @@ $avatar-width: 104px;
overflow: hidden;
&:hover {
border-color: #409EFF;
border-color: #409eff;
}
.uploader-default {
@ -272,7 +299,8 @@ $avatar-width: 104px;
/deep/ .d-inline-block {
width: 216px;
.el-select, .el-input {
.el-select,
.el-input {
width: 100%;
}
}

@ -36,7 +36,6 @@
accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleLgRemove"
:on-error="uploadError"
:on-success="uploadLgSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
@ -598,16 +597,6 @@ export default {
this.form.carouselUrl = res.url
})
},
uploadSuccess (res) {
const { coverUrl } = this.form
coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => { }).catch(res => { })
this.form.coverUrl = res.data.filesResult.fileUrl
},
uploadLgSuccess (res) {
const { carouselUrl } = this.form
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => { }).catch(res => { })
this.form.carouselUrl = res.data.filesResult.fileUrl
},
//
uploadAnnexSuccess (file) {
const { id } = this.form

@ -62,11 +62,11 @@
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles">
<el-upload :on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError"
:on-success="res => uploadSuccess(res, item)"
:before-remove="beforeRemove"
:action="api.fileUploadNakadai"
action=""
:headers="headers"
:file-list="item.competitionStageContentSetting.fileList"
:http-request="res => handleRequest(res, item)"
name="file">
<el-button size="small"
type="primary">上传文件</el-button>
@ -140,6 +140,7 @@
</template>
<script>
import Oss from '@/components/upload/upload.js'
import util from "@/libs/util";
import set from './set'
export default {
@ -235,11 +236,12 @@ export default {
fileList: []
}
}
form.competitionStageContentSetting.fileList = []
//
if (form.competitionStageContentSetting.fileUrl) {
const urls = form.competitionStageContentSetting.fileUrl.split('|')
const names = form.competitionStageContentSetting.fileName.split('|')
form.competitionStageContentSetting.fileList = []
urls.map((n, i) => {
form.competitionStageContentSetting.fileList.push({
name: names[i],
@ -320,14 +322,17 @@ export default {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList, item) {
Oss.del(file.url)
const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url)
item.competitionStageContentSetting.fileList.splice(i, 1)
},
uploadSuccess (res, item) {
const { originalFileName, fileUrl } = res.filesResult
item.competitionStageContentSetting.fileList.push({
name: originalFileName,
url: fileUrl
//
async handleRequest ({ file }, item) {
Oss.upload(file).then(res => {
item.competitionStageContentSetting.fileList.push({
name: res.name,
url: res.url
})
})
},
//
@ -410,9 +415,14 @@ export default {
for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
if (e.competitionStageContentSetting && e.competitionStageContentSetting.fileList && e.competitionStageContentSetting.fileList.length) {
e.competitionStageContentSetting.fileName = e.competitionStageContentSetting.fileList.map(n => n.name).join('|')
e.competitionStageContentSetting.fileUrl = e.competitionStageContentSetting.fileList.map(n => n.url).join('|')
if (e.competitionStageContentSetting) {
if (e.competitionStageContentSetting.fileList && e.competitionStageContentSetting.fileList.length) {
e.competitionStageContentSetting.fileName = e.competitionStageContentSetting.fileList.map(n => n.name).join('|')
e.competitionStageContentSetting.fileUrl = e.competitionStageContentSetting.fileList.map(n => n.url).join('|')
} else {
e.competitionStageContentSetting.fileName = ''
e.competitionStageContentSetting.fileUrl = ''
}
}
}
this.$parent.showLoad()

@ -190,7 +190,7 @@
align="center">
</el-table-column>
<el-table-column label="操作"
width="160">
width="200">
<template slot-scope="scope">
<el-button v-if="!isCompress(scope.row.fileFormat)"
type="text"
@ -324,6 +324,7 @@ export default {
keyWord: this.keyword,
}).then(({ data }) => {
data.records.forEach(e => {
e.loading = false
e.fileType = '其他'
if (util.isVideo(e.fileFormat)) {
e.fileType = '视频'
@ -557,8 +558,19 @@ export default {
//
exportFile (item) {
item.loading = true
util.downloadFile(item.userName + '-' + item.fileName, item.filePath)
item.loading = false
const url = item.filePath
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = "blob"
x.onload = function (e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement("a")
a.href = url
a.download = item.userName + '-' + item.fileName
a.click()
item.loading = false
}
x.send()
},
}
};

@ -39,18 +39,28 @@
<el-button v-if="!published"
type="primary"
@click="cancelPublish(1)">发布排名</el-button>
<div v-else>
<template v-else>
<span style="margin-right: 10px">{{ publishTime }}发布排名</span>
<el-button type="primary"
@click="cancelPublish(0)">取消发布</el-button>
</div>
</template>
<el-button v-if="list.length"
type="primary"
:loading="loading"
@click="exportData">{{ loading ? '正在导出' : '批量导出' }}</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
stripe
row-key="scoreId"
@selection-change="handleSelectionChange"
header-align="center">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="排名"
@ -312,7 +322,9 @@ export default {
return [`${hour}:${minute}:${second} - 23:59:59`]
})(),
},
uploaded: 0
uploaded: 0,
multipleSelection: [],
loading: false
};
},
mounted () {
@ -487,10 +499,32 @@ export default {
toReport (row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.page = val;
this.getData();
},
// ()
exportData () {
let { list } = this
if (this.multipleSelection.length) {
list = this.multipleSelection
}
this.loading = true
list.forEach((e, i) => {
e.serialNumber = i + 1
if (e.leaderName) e.userName = e.leaderName
})
axios.post(this.api[this.competitionType ? 'derivedRanking' : 'individualDerivedRanking'], list, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data]))
this.loading = false
}).catch(res => { })
},
//
publishSubmit () {
if (this.type) { //

@ -1,174 +1,170 @@
<template>
<!-- 大赛详情 -->
<div>
<el-card shadow="hover" style="margin-bottom: 20px">
<div class="flex-between">
<el-page-header @back="back" :content="(form.id ? '编辑' : '创建') + '公告'"></el-page-header>
</div>
</el-card>
<div class="page">
<div class="page-content">
<el-form label-width="170px" label-suffix=":" size="small">
<el-form-item label="公告标题">
<div class="d-inline-block">
<el-input placeholder="请输入公告名称" v-model="form.announcementTitle" clearable></el-input>
</div>
</el-form-item>
<el-form-item label="正文">
<quill :border="true" v-model="form.announcementText" :height="400" />
</el-form-item>
<el-form-item label="附件">
<el-upload
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:before-remove="beforeRemove"
:limit="5"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
:file-list="fileList"
name="file"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-button v-if="!form.id" @click="save(0)" v-auth="'/match:管理:公告通知:草稿'">草稿</el-button>
<el-button type="primary" @click="save(1)" v-auth="'/match:管理:公告通知:发布'">发布</el-button>
<el-button @click="back">取消</el-button>
</el-form-item>
</el-form>
</div>
<!-- 大赛详情 -->
<div>
<el-card shadow="hover"
style="margin-bottom: 20px">
<div class="flex-between">
<el-page-header @back="back"
:content="(form.id ? '编辑' : '创建') + '公告'"></el-page-header>
</div>
</el-card>
<div class="page">
<div class="page-content">
<el-form label-width="170px"
label-suffix=":"
size="small">
<el-form-item label="公告标题">
<div class="d-inline-block">
<el-input placeholder="请输入公告名称"
v-model="form.announcementTitle"
clearable></el-input>
</div>
</el-form-item>
<el-form-item label="正文">
<quill :border="true"
v-model="form.announcementText"
:height="400" />
</el-form-item>
<el-form-item label="附件">
<Upload :limit="5"
:file-list="fileList"
:on-remove="handleRemove"
@onSuccess="uploadSuccess" />
</el-form-item>
<el-form-item>
<el-button v-if="!form.id"
@click="save(0)"
v-auth="'/match:管理:公告通知:草稿'">草稿</el-button>
<el-button type="primary"
@click="save(1)"
v-auth="'/match:管理:公告通知:发布'">发布</el-button>
<el-button @click="back">取消</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import quill from "@/components/quill";
import util from "@/libs/util";
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
export default {
name: "matchDetail",
data() {
return {
headers: {
token: sessionStorage.getItem('token')
},
form: {
id: this.$route.query.id,
competitionId: this.$route.query.competitionId,
announcementText: '',
announcementTitle: '',
announcementAnnexList: [],
isOpen: 1
},
updateTime: 0,
fileName: '',
fileList: [],
};
name: "matchDetail",
data () {
return {
headers: {
token: sessionStorage.getItem('token')
},
form: {
id: this.$route.query.id,
competitionId: this.$route.query.competitionId,
announcementText: '',
announcementTitle: '',
announcementAnnexList: [],
isOpen: 1
},
updateTime: 0,
fileName: '',
fileList: [],
};
},
components: {
quill,
Upload
},
watch: {
// ,
form: {
handler () {
this.updateTime++
if (this.updateTime > 1) this.$store.commit('match/setWait', 0)
},
deep: true
},
components: {
quill
},
mounted () {
this.form.id && this.getData()
},
methods: {
getData () {
this.$post(`${this.api.queryAnnouncementDetails}?id=${this.form.id}`).then(({ data }) => {
this.form = data
//
const fileList = data.announcementAnnexList
if (fileList) {
const files = []
fileList.map(e => {
files.push({
name: e.fileName,
url: e.filePath
})
})
this.fileList = files
} else {
data.announcementAnnexList = []
}
}).catch(err => { })
},
watch: {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$store.commit('match/setWait', 0)
},
deep:true
},
//
save (status) {
const form = this.form
if (!form.announcementTitle) return util.warningMsg('请填写公告标题')
if (!form.announcementText) return util.warningMsg('请填写正文')
form.status = status
if (form.id) {
form.isOpen = 0
delete form.announcementAnnexList
this.$post(this.api.amendmentAnnouncement, form).then(res => {
util.successMsg("修改成功")
this.$router.back()
}).catch(err => { })
} else {
form.isOpen = status ? 0 : 1
this.$post(this.api.addAnnouncement, form).then(res => {
util.successMsg("创建成功")
this.$router.back()
}).catch(err => { })
}
},
mounted() {
this.form.id && this.getData()
handleExceed (files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
methods: {
getData() {
this.$post(`${this.api.queryAnnouncementDetails}?id=${this.form.id}`).then(({ data }) => {
this.form = data
//
const fileList = data.announcementAnnexList
if (fileList) {
const files = []
fileList.map(e => {
files.push({
name: e.fileName,
url: e.filePath
})
})
this.fileList = files
} else {
data.announcementAnnexList = []
}
}).catch(err => {})
},
//
save(status) {
const form = this.form
if (!form.announcementTitle) return util.warningMsg('请填写公告标题')
if (!form.announcementText) return util.warningMsg('请填写正文')
form.status = status
if (form.id) {
form.isOpen = 0
delete form.announcementAnnexList
this.$post(this.api.amendmentAnnouncement, form).then(res => {
util.successMsg("修改成功")
this.$router.back()
}).catch(err => {})
} else {
form.isOpen = status ? 0 : 1
this.$post(this.api.addAnnouncement, form).then(res => {
util.successMsg("创建成功")
this.$router.back()
}).catch(err => {})
}
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
//
uploadSuccess(res) {
const file = res.data.filesResult
const { id } = this.form
const data = {
announcementId: id || '',
fileName: this.fileName,
filePath: file.fileUrl || file.fileId
}
this.form.announcementAnnexList.push(data)
//
id && this.$post(this.api.saveAnnouncementAnnex, data).then(res => {}).catch(res => {})
},
//
beforeUpload(file) {
this.fileName = file.name
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
if (file.url) {
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {})
const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.delAnnex}?id=${id}`).then(res => {}).catch(res => {})
}
},
back() {
this.$router.back()
}
//
uploadSuccess (file) {
const { id } = this.form
const data = {
announcementId: id || '',
fileName: file.name,
filePath: file.url
}
this.form.announcementAnnexList.push(data)
//
id && this.$post(this.api.saveAnnouncementAnnex, data).then(res => { }).catch(res => { })
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList) {
if (file.url) {
Oss.del(file.url)
const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.delAnnex}?id=${id}`).then(res => { }).catch(res => { })
}
},
back () {
this.$router.back()
}
}
};
</script>
@ -255,7 +251,8 @@ $upload-lg-height: 150px;
/deep/ .d-inline-block {
width: 216px;
.el-select, .el-input {
.el-select,
.el-input {
width: 100%;
}
}
@ -275,7 +272,7 @@ $upload-lg-height: 150px;
.remove {
width: 16px;
height: 16px;
background: url("../../../assets/img/close.png") 0 0/cover no-repeat;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat;
cursor: pointer;
}
}

@ -1498,21 +1498,11 @@
:offset="4"
class="flex-start">
<el-form-item label="上传合同">
<el-upload class="contract"
:headers="{token}"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-upload="beforeAvatarUpload"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="api.fileupload"
:file-list="uploadList">
<el-button size="medium"
type="plain"
class="uploadTitle">上传</el-button>
</el-upload>
<Upload :on-remove="handleRemove"
:file-list="uploadList"
@onSuccess="uploadSuccess">
<div slot="tip"></div>
</Upload>
</el-form-item>
<!-- <el-form-item>
<el-button size="medium" type="plain" style="height:40px">重新上传</el-button>
@ -1702,10 +1692,13 @@
<script>
import selectClient from "./selectClient.vue";
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
export default {
components: {
selectClient
selectClient,
Upload
},
data () {
return {
@ -2979,8 +2972,8 @@ export default {
return str && size;
},
//
uploadSuccess (res, file, fileList) {
this.contract.contractFile = res.data.filesResult.fileUrl;
uploadSuccess (file) {
this.contract.contractFile = file.url
},
//
uploadError (err, file, fileList) {
@ -3002,8 +2995,9 @@ export default {
}
},
//
handleRemove (file, fileList) {
this.contract.contractFile = "";
handleRemove () {
Oss.del(this.contract.contractFile)
this.contract.contractFile = ''
},
configure () {
this.ipVisible = true;

@ -125,7 +125,7 @@
accept=".jpg,.png,.jpeg,.gif"
:on-change="changeFile"
:show-file-list="false"
:action="this.api.fileupload"
action=""
:auto-upload="false">
<img v-if="form.bannerImg"
:src="form.bannerImg"
@ -581,24 +581,17 @@ export default {
},
//
customUpload (data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
data.name = this.file.name
this.imgUpload(data)
},
//
imgUpload (formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.fileUploadNakadai,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
...this.headers
},
}).then(({ data }) => {
this.form.bannerImg = data.filesResult.fileUrl
}).catch(res => { })
Oss.upload(formData).then(res => {
this.form.bannerImg && Oss.del(this.form.bannerImg)
this.form.bannerImg = res.url
})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
@ -631,12 +624,6 @@ export default {
this.form.fileList = fileList
}).catch(res => { }) : (this.form.fileList = fileList)
},
// banner
uploadSuccessBanner (res) {
let url = this.form.bannerImg
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => { }).catch(e => { })
this.form.bannerImg = res.url
},
//
fileBeforeUpload (file) {
this.uploading++

@ -77,15 +77,10 @@
</el-form-item>
<el-form-item prop="schemeFile"
label="方案文件">
<el-upload :before-upload="fileBeforeUpload"
:on-success="uploadSuccessFile"
:action="this.api.fileUploadNakadai"
:file-list="fileList"
:limit="1"
:on-exceed="handleExceed"
:headers="headers">
<el-button>上传</el-button>
</el-upload>
<Upload :max-size="100000"
:file-list.sync="fileList"
:on-remove="handleRemove"
@onSuccess="uploadSuccessFile" />
</el-form-item>
</el-form>
<div class="btns">
@ -264,6 +259,8 @@ import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper'
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
import Axios from 'axios'
export default {
data () {
@ -332,7 +329,8 @@ export default {
},
components: {
Editor,
Cropper
Cropper,
Upload
},
watch: {
// ,
@ -556,10 +554,17 @@ export default {
fileBeforeUpload (file) {
this.uploading++
},
//
handleRemove () {
Oss.del(this.form.schemeFile)
this.fileList = []
this.form.fileName = ''
this.form.schemeFile = ''
},
//
uploadSuccessFile ({ filesResult }) {
this.form.fileName = filesResult.originalFileName
this.form.schemeFile = filesResult.fileUrl
uploadSuccessFile (file) {
this.form.fileName = file.name
this.form.schemeFile = file.url
},
//
handleExceed (files, fileList) {

@ -245,10 +245,9 @@
label="封面图">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:before-remove="beforeCoverRemove"
:on-change="file => changeFile(file, 1)"
:auto-upload="false"
:action="api.fileupload"
action=""
:show-file-list="false"
:headers="headers"
name="file">
@ -274,7 +273,7 @@
:before-upload="beforeUpload"
:on-change="file => changeFile(file, 2)"
:auto-upload="false"
:action="api.fileupload"
action=""
:headers="headers"
:show-file-list="false"
name="file">
@ -294,7 +293,7 @@
class="pic">
<img :src="item">
<i class="el-icon-close close"
@click="form.mall.interfaceDiagrams.splice(i, 1)"></i>
@click="delInterface(item, i)"></i>
</div>
</div>
</el-form-item>
@ -307,7 +306,7 @@
:auto-upload="false"
:limit="1"
:on-exceed="handleExceed"
:action="api.fileupload"
action=""
:headers="headers"
:file-list="appletList"
name="file">
@ -1433,29 +1432,20 @@ export default {
//
customUpload (data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
data.name = this.file.name
this.imgUpload(data)
},
//
imgUpload (formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.fileUploadNakadai,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
...this.headers
},
}).then(({ data }) => {
const url = data.filesResult.fileUrl
Oss.upload(formData).then(({ url }) => {
if (this.picType == 2) {
this.form.mall.interfaceDiagrams.push(url)
} else {
this.form.mall[this.picType == 1 ? 'coverDrawing' : 'appletIcon'] = url
}
}).catch(res => { })
})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
@ -1491,18 +1481,17 @@ export default {
Util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
beforeCoverRemove () {
this.form.mall.coverDrawing = ''
delInterface (item, i) {
Oss.del(item)
this.form.mall.interfaceDiagrams.splice(i, 1)
},
uploadSuccessMini (res) {
this.form.mall.appletIcon = res.data.filesResult.fileUrl;
},
handleMiniRemove () {
Oss.del(this.form.mall.appletIcon)
this.form.mall.appletIcon = ''
},
uploadSuccessInterface (res) { //
this.form.mall.interfaceDiagrams.push(res.data.filesResult.fileUrl)
},
uploadSuccessFile (file) { //
this.form.mallAnnex.push({
mallId: this.id,

@ -72,7 +72,7 @@
accept=".jpg,.png,.jpeg,.gif"
:on-change="changeFile"
:show-file-list="false"
:action="this.api.fileupload"
action=""
:auto-upload="false">
<img v-if="form.banner"
:src="form.banner"
@ -131,6 +131,7 @@ import Util from "@/libs/util";
import Setting from '@/setting'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
import Oss from '@/components/upload/upload.js'
export default {
data () {
return {
@ -171,24 +172,16 @@ export default {
},
//
customUpload (data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
data.name = this.file.name
this.imgUpload(data)
},
//
imgUpload (formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.fileUploadNakadai,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
...this.headers
},
}).then(({ data }) => {
this.form.banner = data.filesResult.fileUrl
}).catch(res => { })
Oss.upload(formData).then(res => {
this.form.banner && Oss.del(this.form.banner)
this.form.banner = res.url
})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false

@ -1,209 +1,234 @@
<template>
<div class="wrap">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="id ? '编辑更新日志' : '新增更新日志'"></span>
</div>
<div>
<el-button type="primary" round v-preventReClick @click="submit(0)">发布</el-button>
<el-button v-if="draft || !id" type="primary" round v-preventReClick @click="submit(1)">草稿</el-button>
<div class="wrap">
<el-card shadow="hover"
class="mgb20">
<div class="flex-between">
<div class="per_title"
v-preventReClick
@click="$router.back()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school"
v-text="id ? '编辑更新日志' : '新增更新日志'"></span>
</div>
<div>
<el-button type="primary"
round
v-preventReClick
@click="submit(0)">发布</el-button>
<el-button v-if="draft || !id"
type="primary"
round
v-preventReClick
@click="submit(1)">草稿</el-button>
</div>
</div>
</el-card>
<el-card class="page"
shadow="hover">
<el-form class="form"
ref="form"
label-width="120px"
center>
<el-form-item class="required"
label="版本标题">
<el-input placeholder="请输入版本标题"
v-model="form.versionName"
maxlength="30"
style="width: 400px"
@change="nameChange"></el-input>
</el-form-item>
<el-form-item label="封面图片">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
action=""
:http-request="handleRequest">
<img v-if="form.coverUrl"
:src="form.coverUrl"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
</el-upload>
</el-form-item>
<el-form-item class="required"
label="更新内容">
<ul class="contents">
<li v-for="(item, i) in form.logContents"
:key="i">
<div class="action">
<el-select v-model="item.type"
size="small"
placeholder="请选择">
<el-option v-for="item in funcList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<div class="btns">
<i v-if="i === form.logContents.length - 1"
class="el-icon-circle-plus-outline"
@click="add"></i>
<i class="el-icon-delete"
@click="del(i)"></i>
</div>
</div>
</el-card>
<el-card class="page" shadow="hover">
<el-form class="form" ref="form" label-width="120px" center>
<el-form-item class="required" label="版本标题">
<el-input placeholder="请输入版本标题" v-model="form.versionName" maxlength="30" style="width: 400px" @change="nameChange"></el-input>
</el-form-item>
<el-form-item label="封面图片">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
</el-upload>
</el-form-item>
<el-form-item class="required" label="更新内容">
<ul class="contents">
<li v-for="(item, i) in form.logContents" :key="i">
<div class="action">
<el-select v-model="item.type" size="small" placeholder="请选择">
<el-option
v-for="item in funcList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<div class="btns">
<i v-if="i === form.logContents.length - 1" class="el-icon-circle-plus-outline" @click="add"></i>
<i class="el-icon-delete" @click="del(i)"></i>
</div>
</div>
<el-input
type="textarea"
:rows="5"
placeholder="请输入"
v-model="item.content">
</el-input>
</li>
</ul>
</el-form-item>
</el-form>
</el-card>
</div>
</div>
<el-input type="textarea"
:rows="5"
placeholder="请输入"
v-model="item.content">
</el-input>
</li>
</ul>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import Setting from '@/setting'
import Oss from '@/components/upload/upload.js'
export default {
data() {
return {
id : this.$route.query.id,
platformId: this.$route.query.platformId,
draft : this.$route.query.draft === '1',
headers: {
token: sessionStorage.getItem("token")
},
funcList: [
{
id: 0,
name: '新功能'
},
{
id: 1,
name: '修复'
},
{
id: 2,
name: '优化'
}
],
nameRepeat: false,
originName: '',
form: {
versionName: '',
coverUrl: '',
logContents: []
},
originContent: {
type: '',
content: ''
},
submiting: false
};
},
mounted() {
this.id ? this.getData() : this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
},
methods: {
//
getData() {
this.$get(`${this.api.logGet}?logId=${this.id}`).then(res => {
const { log } = res
this.form = {
versionName: log.versionName,
coverUrl: log.coverUrl,
logContents: log.logContents.length ? log.logContents : [JSON.parse(JSON.stringify(this.originContent))]
}
this.originName = log.versionName
}).catch(res => {})
},
//
nameChange(val) {
if (this.originName === val) {
this.nameRepeat = false
} else {
this.$get(`${this.api.checkRepeat}?platformId=${this.platformId}&versionName=${val}`).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}
},
//
add() {
this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
},
//
del(i) {
this.form.logContents.splice(i, 1)
},
handleExceed(files, fileList) { //
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
data () {
return {
id: this.$route.query.id,
platformId: this.$route.query.platformId,
draft: this.$route.query.draft === '1',
headers: {
token: sessionStorage.getItem("token")
},
funcList: [
{
id: 0,
name: '新功能'
},
uploadSuccess(res, file, fileList) {
this.form.coverUrl = res.data.filesResult.fileUrl
{
id: 1,
name: '修复'
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = ''
}).catch(res => {});
},
//
submit(draft){
if (this.submiting) return false
const { versionName, logContents } = this.form
const id = this.id
if (!versionName) return this.$message.error('请输入版本标题')
if (this.nameRepeat) return this.$message.error('版本名称已存在!')
if (!logContents.length || !logContents.find(e => e.type !== '' && e.content)) return this.$message.error('请输入更新内容')
this.submiting = true
const data = {
platformId: this.platformId,
versionName,
coverUrl: this.form.coverUrl,
logContents,
withdraw: 0,
open: draft, // 0:1:
draft // 0:1:稿
}
if (id) {
data.logId = id
this.$post(this.api.listUpdate, data).then(res => {
this.$message.success('编辑成功')
this.$router.back()
}).catch(res => {
this.submiting = false
})
} else {
this.$post(this.api.logAdd, data).then(res => {
this.$message.success('新增成功')
this.$router.back()
}).catch(res => {
this.submiting = false
})
}
},
}
{
id: 2,
name: '优化'
}
],
nameRepeat: false,
originName: '',
form: {
versionName: '',
coverUrl: '',
logContents: []
},
originContent: {
type: '',
content: ''
},
submiting: false
};
},
mounted () {
this.id ? this.getData() : this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
},
methods: {
//
getData () {
this.$get(`${this.api.logGet}?logId=${this.id}`).then(res => {
const { log } = res
this.form = {
versionName: log.versionName,
coverUrl: log.coverUrl,
logContents: log.logContents.length ? log.logContents : [JSON.parse(JSON.stringify(this.originContent))]
}
this.originName = log.versionName
}).catch(res => { })
},
//
nameChange (val) {
if (this.originName === val) {
this.nameRepeat = false
} else {
this.$get(`${this.api.checkRepeat}?platformId=${this.platformId}&versionName=${val}`).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}
},
//
add () {
this.form.logContents.push(JSON.parse(JSON.stringify(this.originContent)))
},
//
del (i) {
this.form.logContents.splice(i, 1)
},
handleExceed (files, fileList) { //
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
},
handleRequest ({ file }) {
Oss.upload(file).then(res => {
this.form.coverUrl = res.url
})
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList) {
Oss.del(this.form.coverUrl)
this.form.coverUrl = res.url
},
//
submit (draft) {
if (this.submiting) return false
const { versionName, logContents } = this.form
const id = this.id
if (!versionName) return this.$message.error('请输入版本标题')
if (this.nameRepeat) return this.$message.error('版本名称已存在!')
if (!logContents.length || !logContents.find(e => e.type !== '' && e.content)) return this.$message.error('请输入更新内容')
this.submiting = true
const data = {
platformId: this.platformId,
versionName,
coverUrl: this.form.coverUrl,
logContents,
withdraw: 0,
open: draft, // 0:1:
draft // 0:1:稿
}
if (id) {
data.logId = id
this.$post(this.api.listUpdate, data).then(res => {
this.$message.success('编辑成功')
this.$router.back()
}).catch(res => {
this.submiting = false
})
} else {
this.$post(this.api.logAdd, data).then(res => {
this.$message.success('新增成功')
this.$router.back()
}).catch(res => {
this.submiting = false
})
}
},
}
};
</script>
@ -213,12 +238,12 @@ export default {
justify-content: center;
min-height: calc(100vh - 310px);
/deep/.required {
label:before {
content: '*';
margin-right: 5px;
vertical-align: middle;
color: #f00;
}
label:before {
content: '*';
margin-right: 5px;
vertical-align: middle;
color: #f00;
}
}
}
$avatar-width: 104px;
@ -233,7 +258,7 @@ $avatar-width: 104px;
overflow: hidden;
&:hover {
border-color: #409EFF;
border-color: #409eff;
}
.uploader-default {
@ -296,10 +321,10 @@ $avatar-width: 104px;
.btns {
i {
margin-left: 10px;
color: #9076FF;
color: #9076ff;
cursor: pointer;
&:hover {
opacity: .9;
opacity: 0.9;
}
}
}

File diff suppressed because it is too large Load Diff

@ -157,6 +157,7 @@
<el-form label-width="80px">
<el-form-item label="资源添加">
<Upload :max-size="100000"
:file-list="uploadList"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<template slot="tip">
@ -185,6 +186,7 @@
@close="closeSwitch">
<div style="text-align: center">
<Upload :max-size="100000"
:file-list="uploadList"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<template slot="tip">
@ -499,35 +501,6 @@ export default {
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
//
handleRequest (data) {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data',
token: sessionStorage.getItem("token")
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false
this.fileId = fileId
this.fileType = fileType
this.fileUrl = fileUrl
this.fileName = ossFileName
})
},
uploadSuccess (file) {
this.uploading = false;
this.fileId = ''

Loading…
Cancel
Save