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

add

上级 585c6da1
src/assets/image/mm.jpg

17.6 KB | W: | H:

src/assets/image/mm.jpg

45.8 KB | W: | H:

src/assets/image/mm.jpg
src/assets/image/mm.jpg
src/assets/image/mm.jpg
src/assets/image/mm.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,6 +7,9 @@ const blank = r => require.ensure([], () => r(require('../views/blank')), 'blank
const discuss = r => require.ensure([], () => r(require('../views/discuss/index.vue')), 'index')
const creatDiscuss = r => require.ensure([], () => r(require('../views/discuss/add-edit.vue')), 'creatDiscuss')
const topicList = r => require.ensure([], () => r(require('../views/topicManage/index.vue')), 'topicList')
const reportSet = r => require.ensure([], () => r(require('../views/report/reportSet.vue')), 'reportSet')
export default [{
path: '/',
component: App,
......@@ -30,5 +33,15 @@ export default [{
path: '/creat-discuss',
component: creatDiscuss
},
{
path: '/topic-list',
component: topicList
},
{
path: '/report-set',
component: reportSet
},
]
}]
\ No newline at end of file
......@@ -9,7 +9,7 @@ export const envConfig = {
// baseUrl: 'https://test1-sc.yunqueyi.com/',
//baseUrl: 'https://uat-sc.yunqueyi.com/',
baseUrl: 'https://dev-sc.yunqueyi.com',
baseUrl: 'https://dev-sc.yunqueyi.com',
qiniuFileUrl: "http://localhost:10201/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com",
......
......@@ -58,11 +58,11 @@
<el-form-item label="发布按钮文案" required>
<div>
<span class="label-name label-f">首页按钮</span>
<el-input v-model="form.topicBtnText" size="mini" style="width: 100px;"></el-input>
<el-input v-model="form.topicBtnText" size="mini" style="width: 100px;" :maxLength="maxBtn"></el-input>
</div>
<div>
<span class="label-name label-f">二级页按钮</span>
<el-input v-model="form.commentBtnText" size="mini" style="width: 100px;"></el-input>
<el-input v-model="form.commentBtnText" size="mini" style="width: 100px;" :maxLength="maxBtn"></el-input>
</div>
</el-form-item>
......@@ -105,6 +105,7 @@ export default {
label:'积木'
}
],
maxBtn:4,
form:{
subject:'',
ht:'1',
......@@ -201,7 +202,7 @@ export default {
"commentbtntext": this.form.commentBtnText,
//"deleteflag": 0,
//"derivedid": 0,
//"derivername": "string",
"category": this.form.deriverName,
"dispalycommentbtn": this.form.pl == 1 ? true : false,
"displaytopicbtn": this.form.ht == 1 ? true : false,
//"id": 0,
......
......@@ -10,18 +10,18 @@
<el-form ref="serchForm" :model="searchParam" label-width="75px" style="width:100%;">
<el-col :span="6">
<el-form-item label="讨论主题:">
<el-input clearable v-model="searchParam.theme" size="mini" placeholder="请输入组件名称"></el-input>
<el-input clearable v-model="searchParam.theme" size="mini" placeholder="请输入主题"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="创建人:">
<el-input clearable v-model="searchParam.name" size="mini" placeholder="请输入组件名称"></el-input>
<el-input clearable v-model="searchParam.name" size="mini" placeholder="请输入创建人名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="分类:">
<el-select v-model="searchParam.category" size="mini" placeholder="请选择发布状态">
<el-select v-model="searchParam.category" size="mini" placeholder="请选择分类">
<el-option
v-for="(item,index) in category"
:key="index"
......@@ -46,7 +46,8 @@
<el-col style="text-align:right;padding:0 30px 15px 0;">
<el-button type="primary" size="small" @click="search">查询</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="creatFun('1')">举报设置</el-button>
<el-button type="primary" size="small" @click="creatFun('2')">新建讨论组件</el-button>
</el-col>
</el-form>
</el-row>
......@@ -220,17 +221,20 @@ export default {
})
this.getData()
},
// 新建组件
createComponent() {
this.$router.push({path: 'creat-discuss'})
},
creatFun(index){
if(index == 1){
this.$router.push({path: '/report-set'})
}else if(index == 2){
this.$router.push({path: '/creat-discuss'})
}
},
edit(item){
this.$router.push({path: 'creat-discuss',query:{id:item.id}})
this.$router.push({path: '/creat-discuss',query:{id:item.id}})
},
topicManage(item){
this.$router.push({path: '/topic-list',query:{id:item.id}})
},
// 发布、下线
......
......@@ -49,11 +49,7 @@ export default {
icon: 'el-icon-setting',
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
......@@ -104,11 +104,11 @@ import { validateWord } from "../../utils/validate.js"
import { mapGetters } from 'vuex'
import { openLoading, closeLoading } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
import AddEdit from './add-edit.vue'
let vm = null
export default {
components: {
BreadCrumb,AddEdit
BreadCrumb
},
data() {
return {
......
<template>
<div class="item-component-wrap">
<bread-crumb
:curmbFirst="curmbFirst"
:curmbSecond="curmbSecond">
</bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="search-title">预警邮箱</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;" v-for="(item,index) in reportData" :key="index">
<el-form label-width="75px" style="width:100%;">
<el-col :span="5">
<el-form-item label="姓名:">
<el-input clearable v-model="item.userName" size="mini" placeholder="请输入接收人姓名"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="Dr.id:">
<el-input clearable v-model="item.doctorId" size="mini" placeholder="请输入doctorId"></el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="邮箱地址:">
<el-col :span="12" style="padding-right: 5px;">
<el-input clearable v-model="item.email" size="mini" placeholder="请输入邮箱前缀"></el-input>
</el-col>
<div class='email-h'>@picahealth.com</div>
</el-form-item>
</el-col>
<el-col :span="2">
<div class="opt-icon">
<i class="el-icon-circle-plus-outline" @click="add"></i>
<i class="el-icon-remove-outline" @click="remove(index)" v-if="index > 0"></i>
</div>
</el-col>
</el-form>
</el-row>
<div class="opt-btn">
<el-button type="primary" size="small" @click="save">保存</el-button>
<el-button size="small" class="button-white" @click="goBack">返回</el-button>
</div>
</div>
</div>
</template>
<script>
import BreadCrumb from '../../components/breadcrumb.vue'
import { doUpload, getFilePath } from "../../utils/qiniu-util"
import { validateWord } from "../../utils/validate.js"
import { mapGetters } from 'vuex'
import { openLoading, closeLoading } from '../../utils/utils'
import * as commonUtil from '../../utils/utils'
let vm = null
export default {
components: {
BreadCrumb
},
data() {
return {
curmbFirst: '组件',
curmbSecond: '举报设置',
reportData:[],
}
},
computed: {
...mapGetters([
'_token',
'idType'
])
},
created() {
this.getData()
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight()
},
methods: {
//返回
goBack(){
this.$router.back(-1)
},
//保存
save(){
let index = this.handelData(this.reportData)
console.log(index)
if(index == 1){
this.$message({
message: '姓名、邮箱或doctorId不能为空!',
type: 'warning'
});
return;
}
if(index == 2){
this.$message({
message: '姓名、doctorId不能重复!',
type: 'warning'
});
return;
}
if(index == 3){
this.$message({
message: 'doctorId只能是大于0的纯数字!',
type: 'warning',
});
return;
}
let d = this.handelEmail(this.reportData ,2)
let parm = {
informConfigs:d
}
//JSON.stringify(this.reportData)
this.loading = true;
this.POST('/interaction/informConfig/insertAdmin',parm).then((res) => {
this.loading = false
if( res.code == '000000' ) {
this.$message({
message: '保存成功!',
type: 'success'
});
}else{
this.$message({
message: res.message,
type: 'warning'
});
}
})
},
add(){
this.reportData.push(
{
"doctorId": '',
"email": "",
"userName": ""
},
)
},
remove(index){
this.reportData.splice(index, 1);
},
//保存
saveFun(){
},
handelData(d){
let index = null,hash = [],r = /^[1-9]+\d*$/;
for(let i=0;i<d.length;i++){
let parm = d[i].userName + String(d[i].doctorId)
if(d[i].doctorId == '' || d[i].userName == '' || d[i].email == ''){
index = 1
break;
}
if(!r.test(d[i].doctorId)){
index = 3
break;
}
if(hash.indexOf(parm) == -1){
hash.push(parm)
}else{
index = 2;
break;
}
}
return index;
},
//处理邮箱展示
handelEmail(d,str){
let A = [],parm = {};
for(let i=0;i<d.length;i++){
parm = {...d[i]}
if(str == 1){
parm['email'] = d[i].email.split("@")[0]
}else if(str == 2){
parm['email'] = d[i].email + '@picahealth.com'
}
A.push(parm)
}
console.log(A)
return A;
},
//获取数据
getData(){
let parm = {
pageNo:1,
pageSize:20
}
this.GET('/interaction/informConfig/getInformList',parm).then((res) => {
if( res.code == '000000' ) {
this.reportData = this.handelEmail(res.data,1) || []
}else{
this.$message({
message: res.message,
type: 'warning'
});
}
})
},
}
}
</script>
<style lang="scss">
.item-component-wrap {
.component-content {
padding: 10px;
background: #fff;
// margin: 84px 20px 20px;
.search-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.create-button {
padding: 0 0 15px;
margin-top: 0 !important;
text-align: right;
}
.table-empty {
img{
width: 100px;
}
p {
margin-top: -50px;
}
}
.opt-icon{
line-height: 40px;
i{
margin-right: 10px;
}
}
.opt-btn{
text-align: center
}
.email-h{
float: left;
}
}
}
</style>
<template>
<el-dialog title="话题" :visible.sync="dialogFormVisible" @close="optFun('1')">
<el-dialog :title="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-input v-model="objInfo.topic.subject" 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-input type="textarea" v-model="objInfo.topic.content" 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/"
<!-- <el-upload
action="#"
list-type="picture-card"
:file-list="fileList"
:on-change="selectImg"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove">
<i class="el-icon-plus"></i>
<i class="el-icon-plus"></i> -->
<el-upload
action="#"
list-type="picture-card"
:auto-upload="false"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-change="selectImg">
<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="">
......@@ -44,26 +55,49 @@ export default {
dialogImageUrl:'',
dialogVisible:false,
dialogFormVisible:false,
fileList:[],
title:'编辑话题',
objInfo:{
topic:{
subject:'',
content:''
},
images:[]
}
};
},
props:{
isShow:{
default:false,
type:Boolean
},
editInfo:{
default:()=>{},
type:Object
}
},
computed: {
...mapGetters(["_token", "idType"]),
},
created() {
this.id = this.$route.query.id
if(this.id){
this.getDissById(this.id)
}
this.dialogFormVisible = this.isShow
if(this.editInfo.topic){
this.objInfo = this.editInfo;
}else{
this.title = '新增话题'
}
console.log(this.editInfo);
if(this.objInfo.images.length > 0){
for(let i=0;i<this.objInfo.images.length;i++){
this.fileList.push({
url:this.objInfo.images[i].imageurl,
})
}
}
},
// 挂载到Dom完成时
......@@ -76,12 +110,39 @@ export default {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
handleRemove(){
selectImg(file){
console.log(file)
this.fileList.push({
url:file.url,
imageurl:file.url,
})
},
handleRemove(file, fileList){
let index = null;
if(this.fileList.length>0){
for(let i=0;i<this.fileList.length;i++){
if(file.url == this.fileList[i].url){
index = i;
break;
}
}
if(index != null){
this.fileList.splice(index,1)
}
console.log(file)
console.log(this.fileList)
}
},
optFun(index){
this.dialogFormVisible = false;
this.$emit('setFun',false)
if(index == 1){
this.dialogFormVisible = false;
this.$emit('setFun',false)
}else if(index == 2){
this.subFun()
}
},
......@@ -91,6 +152,7 @@ export default {
},
showError(str){
console.log(str)
this.$message({
message: str,
type: 'warning'
......@@ -100,9 +162,20 @@ export default {
//获取讨论组件详细
getDissById(id){
this.GET('/interaction/discuss/'+id).then((res) => {
subFun(id){
if(this.objInfo.topic.content.length == 0){
this.showError('主题内容不能为空!');
return;
}
let parm = {
topic:{
subject:this.objInfo.topic.subject,
content:this.objInfo.topic.content,
discussid:this.objInfo.topic.id
},
images:this.fileList
}
this.PUT('/interaction/topic/',parm).then((res) => {
// closeLoading(vm)
if( res.code == '000000' ) {
......
......@@ -52,25 +52,26 @@
<el-table
:data="tableData"
style="width: 100%" v-loading="loading">
<el-table-column prop="id" label="排序" min-width="50" align="center"></el-table-column>
<el-table-column type="index" prop="topOrder" label="排序" min-width="50" align="center"></el-table-column>
<el-table-column prop="subject" label="话题名称" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdusername" label="创建人" min-width="50" align="center"></el-table-column>
<el-table-column prop="remark" label="创建日期" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="最后修改人" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="修改日期" min-width="100" align="center"></el-table-column>
<el-table-column prop="createdName" label="创建人" min-width="50" align="center"></el-table-column>
<el-table-column prop="createdtime" label="创建日期" min-width="100" align="center"></el-table-column>
<el-table-column prop="modifiedName" label="最后修改人" min-width="100" align="center"></el-table-column>
<el-table-column prop="modifiedtime" label="修改日期" min-width="100" align="center"></el-table-column>
<el-table-column prop="status" label="状态" min-width="80" align="center">
<template slot-scope="scope">
<span>{{ scope.row.status | filteFun}}</span>
<span>{{ scope.row.official ? '已发布' : '未发布'}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="edit(scope.row)">编辑</el-button> <el-button type="primary" v-if="scope.row.status == 3 || scope.row.status == 1" size="small" @click="optFun(scope.row,'发布')">发布</el-button>
<el-button type="primary" v-if="scope.row.status == 2" size="small" @click="optFun(scope.row,'下线')">下线</el-button>
<el-button type="primary" size="small" @click="topicManage(scope.row)">置顶</el-button>
<el-button type="primary" size="small" @click="edit(scope.row)">编辑</el-button> <el-button type="primary" v-if="scope.row.releaseStatus == 0" size="small" @click="optFun(scope.row)">发布</el-button>
<el-button type="primary" v-if="scope.row.releaseStatus == 1" size="small" @click="optFun(scope.row)">下线</el-button>
<el-button disabled v-if="scope.$index == 0" type="info" size="small" @click="topicManage(scope.row)">置顶</el-button>
<el-button v-else type="primary" size="small" @click="topicManage(scope.row)">置顶</el-button>
</template>
</el-table-column>
<div slot="empty">
......@@ -94,7 +95,7 @@
</el-pagination>
</div>
</div>
<AddEdit :isShow="isShow" v-on:setFun="getFun" v-if="isShow"></AddEdit>
<AddEdit :isShow="isShow" v-on:setFun="getFun" v-if="isShow" :editInfo="editInfo"></AddEdit>
</div>
</template>
<script>
......@@ -144,11 +145,16 @@ export default {
tableData: [],
totalRows: 0,
loading:false,
isShow:true,
isShow:false,
discussId:null,
pageNo:1,
pageSize:20,
editInfo:{}
}
},
computed: {
...mapGetters([
'_token',
'idType'
......@@ -170,6 +176,8 @@ export default {
}
},
created() {
this.discussId = this.$route.query.id;
this.getData()
//this.sun()
},
......@@ -190,25 +198,25 @@ export default {
//获取数据
getData(){
let subject = 0,status = 0,name = 0;
if(this.searchParam.theme != ''){
subject = this.searchParam.theme
}
if(this.searchParam.status != ''){
status = this.searchParam.status
}
if(this.searchParam.name != ''){
name = this.searchParam.name
}
this.loading = true;
let url = '/interaction/discuss/'+subject+'/'+name+'/'+status+'/'+this.searchParam.pageNo+'/'+this.searchParam.pageSize
this.GET(url).then((res) => {
let parm = {
discussId:this.discussId,
pageNo:this.pageNo,
pageSize:this.pageSize
}
this.GET('/interaction/topic/getTopicList',parm).then((res) => {
this.loading = false
if( res.code == '000000' ) {
this.tableData = res.data.discuss || []
this.tableData = res.data.topics || []
this.totalRows = res.data.count
}
}else{
this.$message({
message: res.message,
type: 'warning'
});
}
})
},
......@@ -230,54 +238,97 @@ export default {
// 新建组件
createTopic() {
this.editInfo = {}
this.isShow = true;
},
edit(item){
this.$router.push({path: 'creat-discuss',query:{id:item.id}})
///topic/getTopicDetailsById
this.GET('/interaction/topic/getTopicDetailsById',{topicId: item.id}).then((res) => {
if(res.code == "000000") {
this.editInfo = res.data;
this.isShow = true;
}else{
this.$message({
message: res.message,
type: 'warning'
});
}
}).catch(function (error) {
// this.$message.error(error);
});
},
topicManage(item){
///topic/topicTop
console.log(item)
let _this = this;
_this.GET('/interaction/topic/topicTop',{topicId: item.id}).then((res) => {
if(res.code == "000000") {
_this.$message({
type: 'success',
message: '操作成功!'
});
_this.setTimeFun()
}
}).catch(function (error) {
// this.$message.error(error);
});
},
setTimeFun(){
setTimeout(()=>{
this.getData()
},2000)
},
// 发布、下线
optFun(row,str) {
let status = 0;
if(str == '发布'){
status = 2
}else if(str == '下线'){
status = 3
}
optFun(row) {
let status = 0,str = '',_this = this,index = 0;
str = row.releaseStatus == 1 ? '下架' : '发布'
if(row.releaseStatus == 1){
index = 0
}else if(row.releaseStatus == 0){
index = 1
}
let parm = {
topic:{
id: row.id,official:index
}
}
this.$confirm('确定要'+str+'该讨论吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.PUT('/interaction/discuss/',{id: row.id,status:status}).then((res) => {
_this.PUT('/interaction/topic/updateRelease',parm).then((res) => {
if(res.code == "000000") {
this.$message({
_this.$message({
type: 'success',
message: '操作成功!'
});
this.getData()
_this.setTimeFun()
}
}).catch(function (error) {
this.$message.error(error);
// this.$message.error(error);
});
}).catch(() => {
this.$message({
_this.$message({
type: 'info',
message: '已取消'
})
})
},
handleSizeChange(value) {
this.searchParam.pageSize = value
this.pageSize = value
this.getData()
},
handleCurrentChange(value) {
this.searchParam.pageNo = value
this.pageNo = value
this.getData()
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册