提交 585c6da1 编写于 作者: chendeli's avatar chendeli

add

上级 acfee2c9
...@@ -49,6 +49,11 @@ export default { ...@@ -49,6 +49,11 @@ export default {
icon: 'el-icon-setting', icon: 'el-icon-setting',
index: 'topic-list' index: 'topic-list'
}, },
{
title: '举报管理',
icon: 'el-icon-setting',
index: 'report-manage'
},
] ]
}, },
......
<template>
<el-dialog title="话题" :visible.sync="dialogFormVisible" @close="optFun('1')">
<el-form :model="form" class="topicOpt">
<el-form-item label="主题" :label-width="formLabelWidth">
<el-input v-model="form.name" auto-complete="off" clearable size="mini"></el-input>
</el-form-item>
<el-form-item label="内容" :label-width="formLabelWidth" required>
<el-input type="textarea" v-model="form.name" auto-complete="off" clearable size="mini"></el-input>
</el-form-item>
<el-form-item label="话题配图" :label-width="formLabelWidth">
<el-upload
action="https://jsonplaceholder.typicode.com/posts/"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible" size="tiny" :modal="false" :close-on-click-modal="false">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="optFun('1')" size="mini">取 消</el-button>
<el-button type="primary" @click="optFun('2')" size="mini">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
import { doUpload, getFilePath } from "../../utils/qiniu-util";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
let vm = null;
export default {
data() {
return {
formLabelWidth:"80px",
form:{},
id:null,
dialogImageUrl:'',
dialogVisible:false,
dialogFormVisible:false,
};
},
props:{
isShow:{
default:false,
type:Boolean
}
},
computed: {
...mapGetters(["_token", "idType"]),
},
created() {
this.id = this.$route.query.id
if(this.id){
this.getDissById(this.id)
}
this.dialogFormVisible = this.isShow
},
// 挂载到Dom完成时
mounted: function() {
},
methods: {
handlePictureCardPreview(file){
console.log(file)
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handleRemove(){
},
optFun(index){
this.dialogFormVisible = false;
this.$emit('setFun',false)
},
//返回
goBack(){
this.$router.back(-1)
},
showError(str){
this.$message({
message: str,
type: 'warning'
});
},
//获取讨论组件详细
getDissById(id){
this.GET('/interaction/discuss/'+id).then((res) => {
// closeLoading(vm)
if( res.code == '000000' ) {
}
})
}
}
};
</script>
<style lang="scss">
.topicOpt{
.el-input__inner,.el-textarea__inner{
width:300px;
}
.el-upload--picture-card{
height: 100px;
width: 100px;
line-height: 100px;
}
.el-upload-list--picture-card .el-upload-list__item{
width: 100px;
height: 100px;
}
.el-form-item__label{
// line-height: 26px;
}
}
</style>
\ No newline at end of file
此差异已折叠。
<template> <template>
<el-dialog title="话题" :visible.sync="dialogFormVisible"> <el-dialog title="话题" :visible.sync="dialogFormVisible" @close="optFun('1')">
<el-form :model="form" class="topicOpt"> <el-form :model="form" class="topicOpt">
<el-form-item label="主题" :label-width="formLabelWidth"> <el-form-item label="主题" :label-width="formLabelWidth">
<el-input v-model="form.name" auto-complete="off" clearable size="mini"></el-input> <el-input v-model="form.name" auto-complete="off" clearable size="mini"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="内容" :label-width="formLabelWidth"> <el-form-item label="内容" :label-width="formLabelWidth" required>
<el-input type="textarea" v-model="form.name" auto-complete="off" clearable size="mini"></el-input> <el-input type="textarea" v-model="form.name" auto-complete="off" clearable size="mini"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="话题配图" :label-width="formLabelWidth"> <el-form-item label="话题配图" :label-width="formLabelWidth">
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
:on-remove="handleRemove"> :on-remove="handleRemove">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
<el-dialog :visible.sync="dialogVisible" size="tiny"> <el-dialog :visible.sync="dialogVisible" size="tiny" :modal="false" :close-on-click-modal="false">
<img width="100%" :src="dialogImageUrl" alt=""> <img width="100%" :src="dialogImageUrl" alt="">
</el-dialog> </el-dialog>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button> <el-button @click="optFun('1')" size="mini">取 消</el-button>
<el-button type="primary" @click="dialogFormVisible = false">确 定</el-button> <el-button type="primary" @click="optFun('2')" size="mini">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
id:null, id:null,
dialogImageUrl:'', dialogImageUrl:'',
dialogVisible:false, dialogVisible:false,
dialogFormVisible:false,
}; };
}, },
props:{ props:{
...@@ -53,7 +53,8 @@ export default { ...@@ -53,7 +53,8 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters(["_token", "idType"]) ...mapGetters(["_token", "idType"]),
}, },
created() { created() {
this.id = this.$route.query.id this.id = this.$route.query.id
...@@ -70,12 +71,19 @@ export default { ...@@ -70,12 +71,19 @@ export default {
}, },
methods: { methods: {
handlePictureCardPreview(){ handlePictureCardPreview(file){
console.log(file)
this.dialogImageUrl = file.url;
this.dialogVisible = true;
}, },
handleRemove(){ handleRemove(){
}, },
optFun(index){
this.dialogFormVisible = false;
this.$emit('setFun',false)
},
//返回 //返回
goBack(){ goBack(){
...@@ -110,6 +118,15 @@ export default { ...@@ -110,6 +118,15 @@ export default {
.el-input__inner,.el-textarea__inner{ .el-input__inner,.el-textarea__inner{
width:300px; width:300px;
} }
.el-upload--picture-card{
height: 100px;
width: 100px;
line-height: 100px;
}
.el-upload-list--picture-card .el-upload-list__item{
width: 100px;
height: 100px;
}
.el-form-item__label{ .el-form-item__label{
// line-height: 26px; // line-height: 26px;
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<el-col style="text-align:right;padding:0 30px 15px 0;"> <el-col style="text-align:right;padding:0 30px 15px 0;">
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="default" size="small" @click="reseat">重置</el-button> <el-button type="default" size="small" @click="reseat">重置</el-button>
<el-button type="primary" size="small" @click="createComponent">新建话题</el-button> <el-button type="primary" size="small" @click="createTopic">新建话题</el-button>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<AddEdit :isShow="isShow"></AddEdit> <AddEdit :isShow="isShow" v-on:setFun="getFun" v-if="isShow"></AddEdit>
</div> </div>
</template> </template>
<script> <script>
...@@ -183,6 +183,11 @@ export default { ...@@ -183,6 +183,11 @@ export default {
this.getData() this.getData()
}, },
getFun(obj){
console.log(obj)
this.isShow = false;
},
//获取数据 //获取数据
getData(){ getData(){
let subject = 0,status = 0,name = 0; let subject = 0,status = 0,name = 0;
...@@ -224,8 +229,8 @@ export default { ...@@ -224,8 +229,8 @@ export default {
}, },
// 新建组件 // 新建组件
createComponent() { createTopic() {
this.$router.push({path: 'creat-discuss'}) this.isShow = true;
}, },
edit(item){ edit(item){
this.$router.push({path: 'creat-discuss',query:{id:item.id}}) this.$router.push({path: 'creat-discuss',query:{id:item.id}})
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册