Commit 1cc7c5b1 authored by FangYuePeng's avatar FangYuePeng

修改图片回显地址

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