Commit 15c92254 authored by 杨硕's avatar 杨硕

修改公告编辑回显问题

parent 5b0e15ed
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
toolbar: { toolbar: {
container: toolbarOptions, container: toolbarOptions,
handlers: { handlers: {
image: function (value) { image: function(value) {
if (value) { if (value) {
// 调用element的图片上传组件 // 调用element的图片上传组件
document.querySelector('.avatar-uploader input').click() document.querySelector('.avatar-uploader input').click()
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
created() { created() {
// TODO: clear this log // TODO: clear this log
console.log(`this.value`, this.value) console.log(`this.value`, this.value, this.type)
// this.content = '' // this.content = ''
if (this.type === '1' || this.type === '2') { if (this.type === '1' || this.type === '2') {
this.content = this.value this.content = this.value
......
...@@ -271,6 +271,7 @@ export default { ...@@ -271,6 +271,7 @@ export default {
} else if (this.type === 1) { } else if (this.type === 1) {
this.form = this.$route.query.data this.form = this.$route.query.data
this.style = this.$route.query.data.style this.style = this.$route.query.data.style
this.isRestrictions = Number(this.$route.query.data.isRestrictions)
this.imageUrl = baseURL + this.form.imgUrl this.imageUrl = baseURL + this.form.imgUrl
this.richtexttype = '1' this.richtexttype = '1'
this.formdisable = false this.formdisable = false
...@@ -278,6 +279,7 @@ export default { ...@@ -278,6 +279,7 @@ export default {
} else if (this.type === 2) { } else if (this.type === 2) {
this.form = this.$route.query.data this.form = this.$route.query.data
this.style = this.$route.query.data.style this.style = this.$route.query.data.style
this.isRestrictions = Number(this.$route.query.data.isRestrictions)
this.imageUrl = baseURL + this.form.imgUrl this.imageUrl = baseURL + this.form.imgUrl
this.richtexttype = '2' this.richtexttype = '2'
this.formdisable = true this.formdisable = true
......
<template> <template>
<div style="padding: 0 20px"> <div style="padding: 0 20px">
<div v-if="type === 0" class="add-title">新增活动</div> <div v-if="type === 0" class="add-title">新增公告</div>
<div v-if="type === 1" class="add-title">编辑活动</div> <div v-if="type === 1" class="add-title">编辑公告</div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="公告标题" prop="title"> <el-form-item label="公告标题" prop="title">
<el-input v-model.trim="form.title" :maxlength="30" placeholder="请输入公告标题" /> <el-input v-model.trim="form.title" :maxlength="30" placeholder="请输入公告标题" />
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</template> </template>
<script> <script>
import { announcementadd, announcementupdate } from '@/api/announcement' import { announcementadd, announcementupdate, queryannounceDetailById } from '@/api/announcement'
import quilleditor from '@/components/quilleditor' import quilleditor from '@/components/quilleditor'
export default { export default {
name: 'Annoceaddorupdate', name: 'Annoceaddorupdate',
......
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
</el-table-column> </el-table-column>
<el-table-column label="公告状态" align="center" prop="status"> <el-table-column label="公告状态" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <span v-if="scope.row.status === 0" style="color: #D84848 ">未发布</span>--> <!-- <span v-if="scope.row.status === 0" style="color: #D84848 ">未发布</span>-->
<!-- <span v-if="scope.row.status === 1" style="color: #42AE5B">已发布</span>--> <!-- <span v-if="scope.row.status === 1" style="color: #42AE5B">已发布</span>-->
<el-switch <el-switch
:value="scope.row.status" :value="scope.row.status"
class="switchDisabledStyle" class="switchDisabledStyle"
...@@ -104,15 +104,15 @@ ...@@ -104,15 +104,15 @@
type="text" type="text"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
<!-- <el-switch--> <!-- <el-switch-->
<!-- :value="scope.row.status"--> <!-- :value="scope.row.status"-->
<!-- class="switchDisabledStyle"--> <!-- class="switchDisabledStyle"-->
<!-- :active-value="1"--> <!-- :active-value="1"-->
<!-- :inactive-value="0"--> <!-- :inactive-value="0"-->
<!-- active-text="发布"--> <!-- active-text="发布"-->
<!-- style="margin-left: 10px"--> <!-- style="margin-left: 10px"-->
<!-- @change="handleStatusChange(scope.row)"--> <!-- @change="handleStatusChange(scope.row)"-->
<!-- />--> <!-- />-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -170,7 +170,7 @@ import { ...@@ -170,7 +170,7 @@ import {
announcementdel, announcementdel,
announcementList, announcementList,
announcementpublish, announcementpublish,
announcementupdate announcementupdate, queryannounceDetailById
} from '@/api/announcement' } from '@/api/announcement'
export default { export default {
...@@ -219,8 +219,9 @@ export default { ...@@ -219,8 +219,9 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
page: 1, page: 1,
rows: 10 rows: 10
}, },
data: {},
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
...@@ -332,12 +333,15 @@ export default { ...@@ -332,12 +333,15 @@ export default {
// this.form = row // this.form = row
// this.open = true // this.open = true
// this.type = '1' // this.type = '1'
this.$router.push({ const id = row.businessId
path: '/announcements/annoceaddorupdate', queryannounceDetailById(id).then(res => {
query: { this.$router.push({
type: 1, path: '/announcements/annoceaddorupdate',
data: row query: {
} type: 1,
data: res.data
}
})
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
......
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