diff --git a/src/api/operation/dynamic/index.js b/src/api/operation/dynamic/index.js index 5e72389..868232d 100644 --- a/src/api/operation/dynamic/index.js +++ b/src/api/operation/dynamic/index.js @@ -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, + }) +} diff --git a/src/api/operation/dynamic/topic.js b/src/api/operation/dynamic/topic.js new file mode 100644 index 0000000..5abca96 --- /dev/null +++ b/src/api/operation/dynamic/topic.js @@ -0,0 +1,10 @@ +import httpService from "@/request" + +// 话题列表 +export function topicList(params) { + return httpService({ + url: `/user/topic/list`, + method: 'get', + params: params, + }) +} diff --git a/src/components/searchForm/index.vue b/src/components/searchForm/index.vue index 861fc71..2ff30b0 100644 --- a/src/components/searchForm/index.vue +++ b/src/components/searchForm/index.vue @@ -1,11 +1,12 @@ @@ -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 { \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index e114a7e..6de256f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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, diff --git a/src/router/operation.js b/src/router/operation.js index 67f8eec..03a8a32 100644 --- a/src/router/operation.js +++ b/src/router/operation.js @@ -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", diff --git a/src/styles/index.less b/src/styles/index.less index 89c619d..a203e2d 100644 --- a/src/styles/index.less +++ b/src/styles/index.less @@ -31,7 +31,9 @@ #commonTable { margin: 24px; } - +.action { + margin-top: -50px; +} .search-box { margin: 20px; } diff --git a/src/views/Basic/EstateInfo/_houseManage/index.vue b/src/views/Basic/EstateInfo/_houseManage/index.vue index 9d32d7c..7a3b4ae 100644 --- a/src/views/Basic/EstateInfo/_houseManage/index.vue +++ b/src/views/Basic/EstateInfo/_houseManage/index.vue @@ -130,8 +130,9 @@ {{item.name}} @@ -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 = true时候渲染input - console.log(this.typeList); - // this.$nextTick(function(){ //如果不加nextTick。这个refs.input打印为undefined,估计是页面dom还没渲染完成 - // 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) } diff --git a/src/views/Layout/index.vue b/src/views/Layout/index.vue index 03d0cb9..7c93c81 100644 --- a/src/views/Layout/index.vue +++ b/src/views/Layout/index.vue @@ -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" + // } ], }; }, diff --git a/src/views/Layout/yMenu/index.vue b/src/views/Layout/yMenu/index.vue index e5ffbba..a283e74 100644 --- a/src/views/Layout/yMenu/index.vue +++ b/src/views/Layout/yMenu/index.vue @@ -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) { diff --git a/src/views/Operation/BBS/_dynamic/depend/config.js b/src/views/Operation/BBS/_dynamic/depend/config.js index 6b4807b..901e21f 100644 --- a/src/views/Operation/BBS/_dynamic/depend/config.js +++ b/src/views/Operation/BBS/_dynamic/depend/config.js @@ -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:'全部'}, ] } \ No newline at end of file diff --git a/src/views/Operation/BBS/_dynamic/detail.vue b/src/views/Operation/BBS/_dynamic/detail.vue new file mode 100644 index 0000000..4c7d4b8 --- /dev/null +++ b/src/views/Operation/BBS/_dynamic/detail.vue @@ -0,0 +1,313 @@ + + + + + \ No newline at end of file diff --git a/src/views/Operation/BBS/_dynamic/index.vue b/src/views/Operation/BBS/_dynamic/index.vue index 02f530c..82e81ca 100644 --- a/src/views/Operation/BBS/_dynamic/index.vue +++ b/src/views/Operation/BBS/_dynamic/index.vue @@ -47,7 +47,7 @@ }" :row-key=" (record, index) => { - return index; + return record.id; } " > @@ -60,12 +60,14 @@ > 删除 恢复 @@ -99,7 +101,7 @@ \ No newline at end of file diff --git a/src/views/Operation/BBS/_topic/depend/config.js b/src/views/Operation/BBS/_topic/depend/config.js new file mode 100644 index 0000000..e3fce81 --- /dev/null +++ b/src/views/Operation/BBS/_topic/depend/config.js @@ -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, +} \ No newline at end of file diff --git a/src/views/Operation/BBS/_topic/index.vue b/src/views/Operation/BBS/_topic/index.vue index e69de29..c196f38 100644 --- a/src/views/Operation/BBS/_topic/index.vue +++ b/src/views/Operation/BBS/_topic/index.vue @@ -0,0 +1,102 @@ + + + + \ No newline at end of file