修改一些bug

main
bibi 3 years ago
parent 12fe818f6f
commit 553e108b46

@ -1,6 +1,6 @@
import httpService from "@/request"
// 任务列表
// 动态列表
export function dynamicList(params) {
return httpService({
url: `/user/dynamic/list`,
@ -8,3 +8,43 @@ export function dynamicList(params) {
params: params,
})
}
// 删除
export function dynamicDel(params) {
return httpService({
url: `/user/dynamic/delete`,
method: 'post',
data: params,
})
}
// 恢复
export function dynamicRecover(params) {
return httpService({
url: `/user/dynamic/recover`,
method: 'post',
data: params,
})
}
// 评论list
export function commentList(params) {
return httpService({
url: `/user/comment/list`,
method: 'get',
params: params,
})
}
// 删除
export function commentDel(params) {
return httpService({
url: `/user/comment/delete`,
method: 'post',
data: params,
})
}
// 恢复
export function commentRecover(params) {
return httpService({
url: `/user/comment/recover`,
method: 'post',
data: params,
})
}

@ -0,0 +1,10 @@
import httpService from "@/request"
// 话题列表
export function topicList(params) {
return httpService({
url: `/user/topic/list`,
method: 'get',
params: params,
})
}

@ -1,11 +1,12 @@
<template>
<div class="formbox">
<a-form-model ref="ruleForm" :model="form" v-bind="layout">
<div class="form-box">
<a-form-model ref="ruleForm" :model="form" layout='inline' v-if="itemList.length > 0">
<a-form-model-item
v-for="item in formItem"
v-for="item in itemList"
:key="item.prop"
:label="item.label"
:prop="item.prop"
style="margin-left:32px"
>
<a-input v-if="item.type === 'input'" v-model="form[item.prop]" :placeholder="item.placeholder" />
<a-select
@ -21,11 +22,9 @@
>
</a-select>
</a-form-model-item>
<a-form-model-item :wrapper-col="{ span: 12, offset: 2 }">
<a-button type="primary" @click="getSearch"> </a-button>
<a-button style="margin-left: 10px" @click="resetForm"> </a-button>
</a-form-model-item>
</a-form-model>
<div class="btn-box"><a-button type="primary" @click="getSearch"> </a-button>
<a-button style="margin-left: 10px" @click="resetForm"> </a-button></div>
</div>
</template>
@ -36,13 +35,23 @@ export default {
type:Array,
}
},
watch: {
formItem: {
handler(val){
this.itemList = val
let obj = {}
for(let k of val){
obj[k.prop] = undefined;
}
this.form = obj;
},
immediate: true
}
},
data() {
return {
itemList: [],
form: {},
layout: {
labelCol: { span: 2 },
wrapperCol: { span: 4 },
},
};
},
methods: {
@ -58,10 +67,19 @@ export default {
</script>
<style lang="less" scoped>
.formbox {
.form-box {
text-align: left;
background: #f9f9f9;
padding-top: 25px;
padding-bottom: 1px;
}
.btn-box{
margin:10px 0 15px 100px;
}
/deep/.ant-input{
min-width: 150px;
}
/deep/.ant-select{
min-width: 150px;
}
</style>

@ -15,6 +15,13 @@ Router.prototype.push = function push(location) {
}
Vue.use(Router);
// 枚举文件
// const files = require.context('./', true, /\.js/)
// let configRouters = []
// console.log(files.keys());
// files.keys().forEach((key, index) => {
// console.log(files(key).default,files);
// })
import Layout from "@/views/Layout"
import basic from "./basic" // 基础功能
import payment from "./payment" // 缴费管理
@ -39,7 +46,7 @@ const router = [
name: "shop",
title: "智慧商城",
component: Layout,
redirect: '/OrderManage',
redirect: '/GoodsManage/GoodsList',
meta: {title: '智慧商城'},
children: [
...shop,

@ -53,6 +53,14 @@ export default [
component: resolve => require(['@/views/Operation/BBS/_dynamic'], resolve),
meta: {title: '社区动态'},
},
{
path: '/BBS/DynamicDetail',
name: "DynamicDetail",
title: "社区动态详情",
hide: true,
component: resolve => require(['@/views/Operation/BBS/_dynamic/detail'], resolve),
meta: {title: '社区动态详情'},
},
{
path: '/BBS/Topic',
name: "Topic",

@ -31,7 +31,9 @@
#commonTable {
margin: 24px;
}
.action {
margin-top: -50px;
}
.search-box {
margin: 20px;
}

@ -130,8 +130,9 @@
<!-- tags -->
<span v-for="item,index in typeList" :key="item.id">
<a-input
v-if="item.show===true"
v-if="item.show==true"
ref="input"
v-focus
type="text"
size="small"
:style="{ width: '78px','padding-bottom':'3px','margin-right':'7px' }"
@ -140,7 +141,7 @@
@keyup.enter="editType(item)"
/>
<a-tag
v-else closable @close="delType(item.id)"
v-else-if="item.show==false" closable @close.prevent="delType(item.id)"
@click="editInput(item,index)" >
{{item.name}}
</a-tag>
@ -180,6 +181,14 @@ export default {
components: {
vueForm,
},
directives: {
focus: {
//
inserted: function (el) {
el.focus()
}
}
},
data() {
return {
drawerConfig: {
@ -286,26 +295,16 @@ export default {
let res = await estateTypeDel({manageEstateTypeIds:[id]})
if(res.code=== 200){
this.$message.success(res.msg);
this.getType()
}else{
this.$message.error(res.msg);
this.getType()
}
},
onCancel:()=>{
this.getType() //
}
})
},
// input
editInput(obj,i) {
// this.$set(obj,'show',false)
obj.show = true; // v-if show = trueinput
console.log(this.typeList);
// this.$nextTick(function(){ //nextTickrefs.inputundefineddom
// console.log(this.$refs.input[0]);
// this.$refs.input[0].focus() //
// })
this.$set(this.typeList[i],'show',true)
this.$forceUpdate()
},
//
async editType(item){
@ -314,8 +313,9 @@ export default {
name: item.name
})
if(res.code === 200){
this.$message.success(res.msg)
item.show = false
this.$forceUpdate()
this.$message.success(res.msg)
}else{
this.$message.error(res.msg)
}

@ -45,14 +45,14 @@ export default {
yMenu,
},
mounted(){
this.$router.push({ name: sessionStorage.getItem('routerName') });
this.$router.push({ path: JSON.parse(sessionStorage.getItem('selectedKeys'))[0] });
this.tagActive = Number(sessionStorage.getItem('index'))
},
watch: {
$route: {
handler(val) {
// console.log(val);
this.tags = val.matched;
sessionStorage.setItem('routerName',val.name)
},
immediate: true,
},
@ -68,6 +68,7 @@ export default {
return {
collapsed: false,
tagActive: 0,
tags: [],
menuTags: [
{
label: "基础功能",
@ -85,10 +86,10 @@ export default {
label: "运营管理",
value: "operation"
},
{
label: "设置",
value: "setting"
}
// {
// label: "",
// value: "setting"
// }
],
};
},

@ -55,7 +55,7 @@ export default {
csd: {
type: Boolean,
default: false,
indexPath: 0
indexPath: 1
},
num:Number,
},
@ -92,7 +92,7 @@ export default {
collapsed: false,
openKeys: [],
selectedKeys: [],
defaultSelectedKeys: []
defaultSelectedKeys: [],
};
},
created() {
@ -123,8 +123,11 @@ export default {
let menus = [];
this.routerToMenu(arr, menus);
this.list = menus;
let path = farr[0].redirect
this.$router.push({path:path})
if(modal) {
let path = farr[0].redirect
this.$router.push({path:path})
}
},
//
routerToMenu(arr = [], menus) {

@ -75,7 +75,7 @@ export const columns = [
title: "操作",
dataIndex: "action",
key: "action",
width: "200",
width: "150",
fixed: "right",
scopedSlots: { customRender: "action" },
},
@ -84,5 +84,6 @@ export const options = {
isTrue: [
{ id:1,name:'是'},
{ id:0,name:'否'},
{ id:null,name:'全部'},
]
}

@ -0,0 +1,313 @@
<template>
<div>
<div class="content">
<div class="cardTitle">动态信息</div>
<div class="content">
<span class="title">动态内容</span>
<a-row>
<a-col class="text-content">{{ detailData.content }}</a-col>
<a-col class="img-box">
<!-- <img
:src="$ImgUrl(img.url)"
class="contentImg"
v-for="(img, index) in detailData.imgList"
:key="index"
/> -->
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
<img src="https://img0.baidu.com/it/u=2560936835,1792581374&fm=253&fmt=auto&app=138&f=JPEG?w=658&h=403" class="contentImg" alt="">
</a-col>
<a-col :span="4">
<span class="title">发布者</span>
<a-card style="width: 60%;margin:10px;border-radius:4px;height:190px;text-align:center">
<div><a-avatar :size="64" icon="user" /></div>
<div class="text-content" style="margin-top:20px">{{detailData.createName}}</div>
</a-card>
</a-col>
<a-col :span="20">
<span class="title">其他信息</span>
<a-card style="width: 60%;margin:10px;border-radius:4px;height:190px">
<a-descriptions layout="vertical">
<a-descriptions-item label="浏览数量">
{{detailData.views}}
</a-descriptions-item>
<a-descriptions-item label="点赞数量">
{{detailData.likes}}
</a-descriptions-item>
<a-descriptions-item label="发布时间">
{{detailData.createDate}}
</a-descriptions-item>
<a-descriptions-item label="是否公开">
{{detailData.isPublic===1?'是':'否'}}
</a-descriptions-item>
<a-descriptions-item label="是否可评论">
{{detailData.isComment===1?'是':'否'}}
</a-descriptions-item>
</a-descriptions>
</a-card>
</a-col>
<a-col>
<div class="title">关联话题</div>
<div class='topic-box'>
<a-button class='topic'>#{{detailData.content}}</a-button>
<a-button class='topic'>#{{detailData.content}}</a-button>
<a-button class='topic'>#{{detailData.content}}</a-button>
<a-button class='topic'>#{{detailData.content}}</a-button>
</div>
</a-col>
</a-row>
</div>
</div>
<div class="content">
<div class="cardTitle">评论列表</div>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1200 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
<span slot="action" slot-scope="text, row">
<a-space>
<a
class="ant-dropdown-link"
v-if="row.isDelete === 1"
@click="del([row.id])"
>删除</a
>
<a
class="ant-dropdown-link"
v-if="row.isDelete === 0"
@click="recover([row.id])"
>恢复</a
>
</a-space>
</span>
</a-table>
<div style="margin-bottom: 16px" class="action">
<!-- 批量操作 -->
<a-select
type="primary"
v-model="activeAction"
:disabled="!hasSelected"
:loading="loading"
style="width: 120px"
@change="Actions"
placeholder="请选择操作"
>
批量
<a-select-option v-for="item in ActionsList" :key="item.value">
{{ item.label }}
</a-select-option>
</a-select>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
</div>
</div>
</template>
<script>
import {
commentList,
commentRecover,
commentDel,
} from "@/api/operation/dynamic";
export default {
data() {
return {
detailData: {},
tableData: [],
selectedRowKeys: [],
activeAction: undefined,
loading: false,
ActionsList: [
{
value: 1,
label: "批量删除",
},
{
value: 2,
label: "批量恢复",
},
],
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
columns: [
{
title: "评论内容",
width: "20%",
dataIndex: "content",
},
{
title: "评论人名称",
width: "15%",
dataIndex: "createName",
},
{
title: "评论人时间",
width: "15%",
dataIndex: "createDate",
},
{
title: "点赞数",
width: "12%",
dataIndex: "likes",
},
{
title: "是否删除",
width: "15%",
dataIndex: "isDelete",
customRender: function (isDelete) {
switch (isDelete) {
case 1:
return "否";
case 0:
return "是";
}
},
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "150",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
};
},
mounted() {
this.detailData = this.$route.params.data;
console.log(this.detailData);
this.getComment();
},
methods: {
async getComment() {
let res = await commentList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
},
del(ids) {
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await commentDel({ commentIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getComment();
} else {
this.$message.error(res.msg);
}
},
});
},
recover(ids) {
this.$confirm({
title: "是否恢复",
// okText:'',
// cancelText:'',
icon: "undo",
onOk: async () => {
let res = await commentRecover({ commentIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getComment();
} else {
this.$message.error(res.msg);
}
},
});
},
selectionChoosed(data) {
console.log(data);
this.selectedRowKeys = data;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
Actions(data) {
console.log(data);
console.log(this.selectedRowKeys);
this.activeAction = undefined;
if (data === 1) {
this.del(this.selectedRowKeys);
} else {
this.recover(this.selectedRowKeys);
}
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
.action {
margin-top: -50px;
}
.title {
color: #000000a6;
font-weight: 500;
line-height: 19px;
}
.text-content {
color: #000000d9;
font-weight: 400;
line-height: 22px;
font-size: 16px;
}
.contentImg {
width: 168px;
height: 92px;
border-radius: 4px;
margin:10px;
}
.img-box{
display: flex;
justify-content:flex-start;
}
.topic-box{
display: flex;
justify-content:flex-start;
}
.topic{
margin:5px;
border-radius:44px;
}
</style>

@ -47,7 +47,7 @@
}"
:row-key="
(record, index) => {
return index;
return record.id;
}
"
>
@ -60,12 +60,14 @@
>
<a
class="ant-dropdown-link"
@click="detail(row)"
v-if="row.isDelete===1"
@click="del([row.id])"
>删除</a
>
<a
class="ant-dropdown-link"
@click="detail(row)"
v-if="row.isDelete===0"
@click="recover([row.id])"
>恢复</a
>
</a-space>
@ -99,7 +101,7 @@
<script>
import { pagination, columns, options } from "./depend/config";
import { dynamicList } from "@/api/operation/dynamic";
import { dynamicList, dynamicRecover, dynamicDel } from "@/api/operation/dynamic";
export default {
data() {
return {
@ -111,8 +113,16 @@ export default {
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
ActionsList: [],
ActionsList: [
{
value:1,
label:'批量删除'
},
{
value:2,
label:'批量恢复'
},
],
layout: {
labelCol: { span: 2 },
wrapperCol: { span: 4 },
@ -149,11 +159,57 @@ export default {
},
Actions(data) {
console.log(data);
console.log(this.selectedRowKeys);
this.activeAction = undefined;
if(data===1){
this.del(this.selectedRowKeys)
}else{
this.recover(this.selectedRowKeys)
}
},
detail(data){
this.$router.push({name:'DynamicDetail',params:{data:data}})
},
del(ids){
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async() => {
let res = await dynamicDel({dynamicIds:ids})
if(res.code === 200){
this.$message.success(res.msg)
this.getData()
}else{
this.$message.error(res.msg)
}
},
});
},
recover(ids){
this.$confirm({
title: "是否恢复",
// okText:'',
// cancelText:'',
icon: "undo",
onOk: async() => {
let res = await dynamicRecover({dynamicIds:ids})
if(res.code === 200){
this.$message.success(res.msg)
this.getData()
}else{
this.$message.error(res.msg)
}
},
});
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
this.selectedRowKeys = data;
},
handleTableChange(pagination) {
console.log(pagination);
@ -163,6 +219,7 @@ export default {
this.pagination = pager;
this.getData();
},
handleMenuClick(){}
},
computed: {
hasSelected() {
@ -173,13 +230,11 @@ export default {
</script>
<style lang="less" scoped>
.action {
margin-top: -50px;
}
.formbox {
text-align: left;
background: #f9f9f9;
padding-top: 25px;
padding-bottom: 1px;
margin:24px;
}
</style>

@ -0,0 +1,124 @@
export const formItem = [
{
type: 'input',
label:'话题标题',
prop:'title',
placeholder:'请输入标题'
},
{
type: 'select',
label:'状态',
prop:'status',
option:[{ id:1,name:'启用中'},{ id:2,name:'禁用中'}],
placeholder:'请选择状态'
},
{
type: 'select',
label:'是否公开',
prop:'isPublic',
placeholder:'请选择',
option:[{ id:1,name:'是'},{ id:0,name:'否'}]
},
{
type: 'select',
label:'是否评论',
prop:'isRating',
placeholder:'请选择',
option:[{ id:1,name:'是'},{ id:0,name:'否'}]
},
]
export const columns = [
{
title: "话题标题",
dataIndex: "title",
width: "12%",
},
{
title: "内容",
dataIndex: "content",
width: "16%",
},
{
title: "状态",
dataIndex: "status",
width: "10%",
customRender: function (status) {
switch (status) {
case 1:
return '启用中'
case 2:
return '禁用中'
}
}
},
{
title: "是否公开",
dataIndex: "isPublic",
width: "9%",
customRender: function (isPublic) {
switch (isPublic) {
case 1:
return '是'
case 0:
return '否'
}
}
},
{
title: "是否可以评论",
dataIndex: "isRating",
width: "10%",
customRender: function (isRating) {
switch (isRating) {
case 1:
return '是'
case 0:
return '否'
}
}
},
{
title: "用户类型",
dataIndex: "userType",
width: "10%",
customRender: function (userType) {
switch (userType) {
case 1:
return '住户'
case 2:
return '物业'
}
}
},
{
title: "发布人",
dataIndex: "createName",
width: "8%",
},
{
title: "发布时间",
dataIndex: "createDate",
width: "12%",
},
{
title: "是否开启租赁",
dataIndex: "isEnableLease",
scopedSlots: { customRender: "switch" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,102 @@
<template>
<div>
<div class="cardTitle">社区话题</div>
<searchForm :formItem="formItem" @getSearch="getData"></searchForm>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1400 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
<span slot="switch" slot-scope="switchV, row">
<a-switch
:checked="switchV === 1"
@change="handleEnable(row)"
></a-switch>
</span>
</a-table>
<div class="action">
<a-dropdown :disabled='!hasSelected'>
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="1"> 批量删除 </a-menu-item>
<a-menu-item key="2"> 2nd item </a-menu-item>
</a-menu>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
</div>
</template>
<script>
import { topicList } from "@/api/operation/dynamic/topic.js";
import { formItem, columns, pagination } from "./depend/config";
export default {
data() {
return {
tableData: [],
searchForm: {},
formItem,
columns,
pagination,
// index
selectedRowKeys: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData(data) {
this.searchForm = data;
let res = await topicList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
},
selectionChoosed(data) {
console.log(data);
this.selectedRowKeys = data;
},
handleMenuClick(data) {
console.log(data);
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style lang="less" scoped>
</style>
Loading…
Cancel
Save