Commit 1cc7c5b1 authored by FangYuePeng's avatar FangYuePeng

修改图片回显地址

parent 6b1ba1da
......@@ -59,8 +59,8 @@
<div :id="step(scope.$index)">
<el-image
style="width:100%;height:100%;"
:src="imagePath+scope.row.url"
:preview-src-list="[imagePath+scope.row.url]"
:src="scope.row.url"
:preview-src-list="[scope.row.url]"
@click="handleClickStop(scope.$index)"
@mouseover="justEnter($event)"
@mouseout="justOut($event)"
......@@ -214,7 +214,7 @@ export default {
data() {
return {
imageUrl: '',
imagePath: 'http://49.232.167.247:20020/teaServer/',
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'development',
// 遮罩层
loading: true,
......@@ -399,7 +399,7 @@ export default {
const id = row.businessId
getCmsBanner(id).then(response => {
this.form = response.data
this.imageUrl = this.imagePath + response.data.url
this.imageUrl = response.data.url
this.open = true
this.title = '修改banner'
})
......
......@@ -56,7 +56,7 @@
<el-table-column label="封面" prop="path">
<template slot-scope="scope">
<div :id="step(scope.$index)">
<el-image :src="imagePath+scope.row.path" :preview-src-list="scope.row.srclist" style="width:100%;height:100%;" @click="handleClickStop(scope.$index)" @mouseover="justEnter($event)" @mouseout="justOut($event)" />
<el-image :src="scope.row.path" :preview-src-list="scope.row.srclist" style="width:100%;height:100%;" @click="handleClickStop(scope.$index)" @mouseover="justEnter($event)" @mouseout="justOut($event)" />
</div>
</template>
</el-table-column>
......@@ -125,7 +125,6 @@ export default {
hasAddPerm: ['sys:contentNewssInformation:add'],
hasUpdatePerm: ['sys:contentNewssInformation:update'],
imageSrc: require('@/assets/image/test.png'),
imagePath: 'http://49.232.167.247:20020/teaServer/',
// 显示开关
showSwitch: {
courseContent: true,
......@@ -253,7 +252,7 @@ export default {
_this.bussid = []
res.rows.forEach(item => {
item.srclist = []
item.srclist.push(this.imagePath + item.path)
item.srclist.push(item.path)
console.log(item.srclist)
})
_this.tableData = res.rows
......
......@@ -123,7 +123,6 @@ export default {
},
data() {
return {
imagePath: 'http://49.232.167.247:20020/teaServer/',
businessId: null,
// 变更字段存储数组
formChanges: [],
......@@ -234,7 +233,7 @@ export default {
console.log('res', res.data)
if (res.code === 200) {
this.form = res.data
this.imageUrl = this.imagePath + res.data.path
this.imageUrl = res.data.path
console.log('this.form.imageUrl', this.form.imageUrl)
}
})
......
......@@ -2,21 +2,21 @@
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="大赛时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 250px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- type="date"-->
<!-- placeholder="选择日期">-->
<!-- </el-date-picker>-->
<el-date-picker
v-model="dateRange"
size="small"
style="width: 250px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- type="date"-->
<!-- placeholder="选择日期">-->
<!-- </el-date-picker>-->
</el-form-item>
<el-form-item>
<el-button
......@@ -24,13 +24,15 @@
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery">查询
@click="handleQuery"
>查询
</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery">重置
@click="resetQuery"
>重置
</el-button>
</el-form-item>
<div style="float: right">
......@@ -40,7 +42,8 @@
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd">新增
@click="handleAdd"
>新增
</el-button>
<!-- <el-button-->
<!-- :class="commonField.exportClass"-->
......@@ -51,15 +54,20 @@
</el-form-item>
</div>
</el-form>
<div class="placeholder"/>
<div class="placeholder" />
<div style="padding:5px 10px">
<el-table class="table" v-loading="loading" border :data="cmsContestList">
<el-table-column type="index" label="序号" width="60" align="center"/>
<el-table v-loading="loading" class="table" border :data="cmsContestList">
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column label="封面" prop="contestPicture" width="150">
<template slot-scope="scope">
<div :id="step(scope.$index)" class="img">
<el-image @click="handleClickStop(scope.$index)" style="width:100px;height:100%;" :src="imagePath+scope.row.url" :preview-src-list="[imagePath+scope.row.url]"/>
<!-- <el-image :src="imagePath+scope.row.url" :preview-src-list="scope.row.srclist" style="width:100%;height:100%;" @click="handleClickStop(scope.$index)" @mouseover="justEnter($event)" @mouseout="justOut($event)" />-->
<el-image
style="width:100px;height:100%;"
:src="scope.row.url"
:preview-src-list="[scope.row.url]"
@click=" eClickStop(scope.$index)"
/>
</div>
</template>
</el-table-column>
......@@ -133,16 +141,23 @@
value-format="yyyy-MM-dd"
type="date"
style="width: 100%"
placeholder="选择日期">
</el-date-picker>
placeholder="选择日期"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="大赛描述" prop="contestDiscribe">
<el-input type="textarea" :rows="8" v-model.trim="form.contestDiscribe"
placeholder="请输入大赛描述" resize="none" maxlength="200" show-word-limit></el-input>
<el-input
v-model.trim="form.contestDiscribe"
type="textarea"
:rows="8"
placeholder="请输入大赛描述"
resize="none"
maxlength="200"
show-word-limit
/>
</el-form-item>
</el-col>
</el-row>
......@@ -157,7 +172,7 @@
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<!-- <img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px">-->
<!-- <img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px">-->
<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>
......@@ -168,20 +183,28 @@
<el-row>
<el-col :span="12">
<el-form-item label="排序" prop="weight">
<el-input-number v-model="form.weight" controls-position="right" @change="handleChange" :min="1" :max="10" placeholder="请输入排序" style="width: 100%"/>
<el-input-number
v-model="form.weight"
controls-position="right"
:min="1"
:max="10"
placeholder="请输入排序"
style="width: 100%"
@change="handleChange"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="状态">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -236,8 +259,7 @@ export default {
}
],
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'competitionSupport',
// imagePath: 'http://49.232.167.247:20020/eduServer/',
imagePath: 'http://49.232.167.247:20020/teaServer/',
imageUrl: '',
// 日期范围
dateRange: [],
......@@ -256,14 +278,14 @@ export default {
// 表单校验
rules: {
contestDate: [
{required: true, message: '大赛时间不能为空', trigger: 'change'}
{ required: true, message: '大赛时间不能为空', trigger: 'change' }
],
contestDiscribe: [
{required: true, message: '大赛描述不能为空', trigger: 'blur'}
{ required: true, message: '大赛描述不能为空', trigger: 'blur' }
],
contestPicture: [
{required: true, message: '大赛封面不能为空', trigger: 'change'},
{validator: validateCover}
{ required: true, message: '大赛封面不能为空', trigger: 'change' },
{ validator: validateCover }
]
}
}
......@@ -289,7 +311,7 @@ export default {
formData.append('temp', 'competitionSupport')
uploadPublic(formData).then(res => {
this.form.contestPicture = res.data.businessId
// this.imageUrl = this.imagePath + res.data.path
this.form.url = res.data.url
})
},
......@@ -300,10 +322,8 @@ export default {
response => {
this.cmsContestList = response.rows
this.total = response.total
// this.imageUrl = this.imagePath + response.rows.url
// console.log("this.imageUrl",this.imageUrl)
this.loading = false
this.loading = false
}
)
},
......@@ -311,7 +331,7 @@ export default {
return 'step' + index
},
handleChange(value) {
console.log(value);
console.log(value)
},
/**
* @description: 点击蒙版关闭预览图片
......@@ -379,7 +399,7 @@ export default {
const id = row.businessId
getCmsContest(id).then(response => {
this.form = response.data
this.form.url = this.imagePath + response.data.url
this.form.url = response.data.url
this.open = true
this.title = '修改大赛支持'
})
......@@ -391,19 +411,19 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
}).then(function() {
return updateCmsContest(row)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
}).catch(function () {
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
})
},
/** 提交按钮 */
submitForm: function () {
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
......@@ -429,7 +449,7 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
}).then(function() {
return delCmsContest(id)
}).then(() => {
this.getList()
......@@ -437,7 +457,7 @@ export default {
message: '删除成功',
type: 'success'
})
}).catch(function () {
}).catch(function() {
})
},
/** 导出按钮操作 */
......@@ -447,7 +467,7 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
}).then(function() {
return exportCmsContest(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
......@@ -465,7 +485,7 @@ export default {
console.log('res', res)
this.imageUrl = URL.createObjectURL(file.raw)
// this.form.url = res.data.url
this.form.contestPicture= res.data.businessId
this.form.contestPicture = res.data.businessId
console.log('this.form.contestPicture', this.form.contestPicture)
},
beforeAvatarUpload(file) {
......@@ -495,7 +515,7 @@ export default {
//}
::v-deep .el-table td:nth-child(2) .cell {
margin: 10px;
text-align: center!important;
text-align: center !important;
}
.placeholder {
......
......@@ -94,8 +94,8 @@
<div :id="step(scope.$index)">
<el-image
style="width:100%;height:100%;"
:src="imagePath+scope.row.url"
:preview-src-list="[imagePath+scope.row.url]"
:src="scope.row.url"
:preview-src-list="[scope.row.url]"
@click="handleClickStop(scope.$index)"
@mouseover="justEnter($event)"
@mouseout="justOut($event)"
......@@ -241,7 +241,7 @@ export default {
data() {
return {
imageUrl: '',
imagePath: 'http://49.232.167.247:20020/teaServer/',
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
......@@ -450,7 +450,7 @@ export default {
const id = row.businessId
getCmsDevelopment(id).then(response => {
this.form = response.data
this.form.url = this.imagePath + response.data.url
this.form.url = response.data.url
this.open = true
this.title = '修改发展历程'
})
......
......@@ -79,7 +79,7 @@
<el-table-column align="left" label="新闻标题图" prop="pictureId">
<template slot-scope="scope">
<div :id="step(scope.$index)">
<el-image :src="imagePath+scope.row.path" :preview-src-list="scope.row.srclist" style="width:100%;height:100%;" @click="handleClickStop(scope.$index)" @mouseover="justEnter($event)" @mouseout="justOut($event)" />
<el-image :src="scope.row.path" :preview-src-list="scope.row.srclist" style="width:100%;height:100%;" @click="handleClickStop(scope.$index)" @mouseover="justEnter($event)" @mouseout="justOut($event)" />
</div>
</template>
</el-table-column>
......@@ -185,7 +185,7 @@ export default {
hasUpdatePerm: ['sys:contentNewsInformation:update'],
hasDetailPerm: ['sys:contentNewsInformation:query'],
imageSrc: require('@/assets/image/test.png'),
imagePath: 'http://49.232.167.247:20020/teaServer/',
// 显示开关
showSwitch: {
courseContent: true,
......@@ -364,7 +364,7 @@ export default {
_this.bussid = []
res.rows.forEach(item => {
item.srclist = []
item.srclist.push(this.imagePath + item.pictureId)
item.srclist.push( item.pictureId)
})
_this.tableData = res.rows
_this.fullscreenLoading = false
......
......@@ -165,7 +165,7 @@ export default {
data() {
return {
title: '新增新闻',
imagePath: 'http://49.232.167.247:20020/teaServer/',
businessId: null,
// 变更字段存储数组
formChanges: [],
......@@ -305,7 +305,7 @@ export default {
console.log('res', res.data)
if (res.code === 200) {
this.form = res.data
this.imageUrl = this.imagePath + res.data.path
this.imageUrl = res.data.path
}
})
}
......
......@@ -222,7 +222,7 @@ export default {
name: 'Index',
data() {
return {
imagePath: 'http://49.232.167.247:20020/teaServer/',
// 方案集合
optionList: [],
// 岗位集合
......
......@@ -57,8 +57,7 @@
<el-table-column label="头像" prop="avatarId" width="150">
<template slot-scope="scope">
<div :id="step(scope.$index)" class="img">
<!-- <el-image @click="handleClickStop(scope.$index)" style="width:100px;height:100%;" :src="imagePath+scope.row.avatarUrl" :preview-src-list="[imagePath+scope.row.avatarUrl]"/>-->
<el-image fit="fill" class="self-avatar" :src="imagePath+scope.row.avatarUrl" :preview-src-list="[imagePath+scope.row.avatarUrl]" @click="handleClickStop(scope.$index)" />
<el-image fit="fill" class="self-avatar" :src="scope.row.avatarUrl" :preview-src-list="[scope.row.avatarUrl]" @click="handleClickStop(scope.$index)" />
</div>
</template>
</el-table-column>
......@@ -220,8 +219,8 @@ export default {
// 讲师信息表表格数据
cmsLecturerList: [],
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'lecturerManagement',
// imagePath: 'http://49.232.167.247:20020/eduServer/',
imagePath: 'http://49.232.167.247:20020/teaServer/',
imageUrl: '',
// 弹出层标题
title: '',
......
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