Commit 6ecb3da5 authored by YuY's avatar YuY

大赛描述页面提交

parent 6a2fe6bf
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</el-table-column> </el-table-column>
<el-table-column label="大赛时间" prop="contestDate" :show-overflow-tooltip="true" width="200px"> <el-table-column label="大赛时间" prop="contestDate" :show-overflow-tooltip="true" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.contestDate | transformDateByFormat('YYYY-MM-DD') }}</span> <span>{{ scope.row.contestDate | transformDateByFormat('YYYY-MM-DD hh:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="文字描述" prop="contestDiscribe" :show-overflow-tooltip="true"> <el-table-column label="文字描述" prop="contestDiscribe" :show-overflow-tooltip="true">
...@@ -79,11 +79,11 @@ ...@@ -79,11 +79,11 @@
</el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="contestDate" :show-overflow-tooltip="true" width="200px"> <el-table-column label="创建时间" prop="contestDate" :show-overflow-tooltip="true" width="200px">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD') }}</span> <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD hh:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="120" label="状态" prop="flag"> <el-table-column width="90" label="状态" prop="flag">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="100px"> <el-table-column label="操作" class-name="small-padding fixed-width" width="130px">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:class="commonField.updateClass" :class="commonField.updateClass"
...@@ -138,13 +138,22 @@ ...@@ -138,13 +138,22 @@
placeholder="请输入大赛描述"></el-input> placeholder="请输入大赛描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="封面:"> <el-form-item label="封面:">
<!-- <el-upload-->
<!-- class="avatar-uploader"-->
<!-- :action="fileUpload"-->
<!-- :show-file-list="false"-->
<!-- :on-success="handleAvatarSuccess"-->
<!-- :before-upload="beforeAvatarUpload"-->
<!-- >-->
<!-- <img v-if="form.url" :src="form.url" style="height: 200px;width: 200px">-->
<!-- <i v-else class="el-icon-plus avatar-uploader-icon" />-->
<!-- </el-upload>-->
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="fileUpload" :action="fileUpload"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
v-model.trim="form.contestPicture"
> >
<img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px"> <img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px">
<i v-else class="el-icon-plus avatar-uploader-icon" /> <i v-else class="el-icon-plus avatar-uploader-icon" />
...@@ -202,6 +211,8 @@ export default { ...@@ -202,6 +211,8 @@ export default {
} }
], ],
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'temp', fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'temp',
// imagePath: 'http://49.232.167.247:20020/eduServer/',
imagePath: 'http://192.168.1.12:8888/eduServer/',
imageUrl: '', imageUrl: '',
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
...@@ -241,6 +252,7 @@ export default { ...@@ -241,6 +252,7 @@ export default {
response => { response => {
this.cmsContestList = response.rows this.cmsContestList = response.rows
this.total = response.total this.total = response.total
// this.imageUrl = this.imagePath + res.data.url
this.loading = false this.loading = false
} }
) )
...@@ -397,11 +409,22 @@ export default { ...@@ -397,11 +409,22 @@ export default {
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
console.log('res', res) console.log('res', res)
// this.imageUrl = URL.createObjectURL(file.raw) this.imageUrl = URL.createObjectURL(file.raw)
this.imageUrl = res.data.url // this.form.url = res.data.url
this.form.contestPicture= res.data.businessId this.form.contestPicture= res.data.businessId
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
// 判断文件是否为图片类型
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) {
this.$message.error('只能上传图片格式的文件!')
return false
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 2MB!')
return false
}
this.file = file this.file = file
} }
} }
...@@ -412,6 +435,14 @@ export default { ...@@ -412,6 +435,14 @@ export default {
font-size: 18px; font-size: 18px;
padding: 0; padding: 0;
::v-deep .el-table th .cell{
justify-content: center!important;
}
::v-deep .el-table td .cell{
margin: 10px;
text-align: center!important;
}
.placeholder { .placeholder {
height: 1.3vh; height: 1.3vh;
background-color: #F4F4F4; background-color: #F4F4F4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment