|
|
@@ -59,21 +59,27 @@
|
|
|
}
|
|
|
</style>
|
|
|
<template>
|
|
|
- <section class="add">
|
|
|
- <p>内容管理 > 新增公告</p>
|
|
|
- <div class="content">
|
|
|
+ <section class="content">
|
|
|
+ <h4>新增公告</h4>
|
|
|
+ <el-divider></el-divider>
|
|
|
<el-form label-width="80px">
|
|
|
<el-form-item label="标题">
|
|
|
- <el-input placeholder="标题" v-model="form.title"></el-input>
|
|
|
+ <el-input placeholder="标题" v-model="form.name"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="详情">
|
|
|
<fuEditor v-model="form.content" :isClear="isClear" @change="change"></fuEditor>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <el-select v-model="form.status" placeholder="请选择状态">
|
|
|
+ <el-option key='1' label="编辑中" :value="1"></el-option>
|
|
|
+ <el-option key='2' label="上线" :value="2"></el-option>
|
|
|
+ <el-option key='-1' label="下线" :value="-1"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label=" ">
|
|
|
<el-button type="primary" @click="save">保存</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </div>
|
|
|
</section>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -107,10 +113,6 @@ export default {
|
|
|
getData() {
|
|
|
this.$api.getArticleById({ id: this.form.id }).then(res => {
|
|
|
this.form = res.data.data;
|
|
|
- this.point={
|
|
|
- lng:this.form.point.split(',')[0],
|
|
|
- lat:this.form.point.split(',')[1]
|
|
|
- }
|
|
|
});
|
|
|
},
|
|
|
getContent(){
|
|
|
@@ -153,7 +155,7 @@ export default {
|
|
|
this.$api.editArticle(parm).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.$message({ message: "修改成功!", type: "success" });
|
|
|
- this.$router.push({ path: "/article" });
|
|
|
+ this.$router.push({ path: "/notice" });
|
|
|
} else {
|
|
|
this.$message.error(res.data.message);
|
|
|
}
|
|
|
@@ -162,7 +164,7 @@ export default {
|
|
|
this.$api.addArticle(parm).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.$message({ message: "添加成功!", type: "success" });
|
|
|
- this.$router.push({ path: "/article" });
|
|
|
+ this.$router.push({ path: "/notice" });
|
|
|
} else {
|
|
|
this.$message.error(res.data.message);
|
|
|
}
|
|
|
@@ -207,7 +209,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- this.getContent()
|
|
|
+ // this.getContent()
|
|
|
if (this.$route.query.id) {
|
|
|
this.form.id = this.$route.query.id;
|
|
|
this.id = this.$route.query.id;
|