diff --git a/project/pengliuyang/apps/AppCommunityResource/AppCommunityResource.vue b/project/pengliuyang/apps/AppCommunityResource/AppCommunityResource.vue index 7e69cfee..3afe1f7d 100644 --- a/project/pengliuyang/apps/AppCommunityResource/AppCommunityResource.vue +++ b/project/pengliuyang/apps/AppCommunityResource/AppCommunityResource.vue @@ -27,7 +27,7 @@ export default { return hash == "#resourceClassification" ? resourceClassification : hash == "#resourceManagement" ? resourceManagement : hash == "#resourceMap" ? resourceMap : - hash == "#addResource" ? addResource:resourceList + hash == "#addResource" ? addResource : resourceList } }, components: { diff --git a/project/pengliuyang/apps/AppCommunityResource/components/addResource.vue b/project/pengliuyang/apps/AppCommunityResource/components/addResource.vue index 9d122e86..a1003672 100644 --- a/project/pengliuyang/apps/AppCommunityResource/components/addResource.vue +++ b/project/pengliuyang/apps/AppCommunityResource/components/addResource.vue @@ -1,15 +1,292 @@ - \ No newline at end of file diff --git a/project/pengliuyang/apps/AppCommunityResource/components/resourceClassification.vue b/project/pengliuyang/apps/AppCommunityResource/components/resourceClassification.vue index b9275d3f..61b75300 100644 --- a/project/pengliuyang/apps/AppCommunityResource/components/resourceClassification.vue +++ b/project/pengliuyang/apps/AppCommunityResource/components/resourceClassification.vue @@ -9,13 +9,12 @@ - - + + + - - + - + @@ -67,17 +67,17 @@ export default { dialog: false, form: { categoryName: '', - categoryIcon: '' + categoryIcon: '', } } }, computed: { colConfigs() { return [ - {prop: 'resourceName', label: '分类名称', width: '300px'}, - {prop: 'categoryName', label: '资源数量', align: 'center'}, - // {prop: "merchandisePhoto",slot: "merchandisePhoto",align: "center",label: "商品图"}, - {prop: 'option'} + {prop: 'categoryName', label: '分类名称', width: '300px'}, + {prop: 'resourceNum', label: '资源数量', align: 'center'}, + {slot: "categoryIcon"}, + {slot: 'option'}, ] }, rules() { @@ -100,7 +100,9 @@ export default { }).then(res=> { if(res?.data) { this.tableData = res.data.records - this.total = res.total + this.total = res.data.total + console.log(this.tableData); + } }) }, @@ -108,13 +110,39 @@ export default { onConfirm() { this.$refs.form.validate((valid) => { if(valid) { - this.instance.post(`/app/appresourcecategory/addOrUpdate`, ...this.form).then(res=> { - console.log(res,this.form.categoryIcon); + this.instance.post(`/app/appresourcecategory/addOrUpdate`, {...this.form}).then(res=> { + if(res.code == 0) { + this.$message.success('新增成功') + this.dialog = false + this.getList() + } }) } }) }, - } + handleDelete(ids) { + this.$confirm('确定删除该数据?').then(() => { + this.instance.post(`/app/appresourcecategory/delete?ids=${ids}`).then(res=> { + if (res.code== 0) { + this.$message.success('删除成功!') + this.getList() + } + }) + }) + }, + toEdit(id) { + this.getDetail(id) + this.dialog = true + }, + getDetail(ids) { + this.instance.post(`/app/appresourcecategory/queryDetailById?id=${ids}`).then(res=> { + if(res.data) { + console.log(res.data); + this.form = res.data + } + }) + } + }, } diff --git a/project/pengliuyang/apps/AppCommunityResource/components/resourceList.vue b/project/pengliuyang/apps/AppCommunityResource/components/resourceList.vue index 8a15ca33..1fa69c0b 100644 --- a/project/pengliuyang/apps/AppCommunityResource/components/resourceList.vue +++ b/project/pengliuyang/apps/AppCommunityResource/components/resourceList.vue @@ -21,7 +21,7 @@ import resourceMap from "./resourceMap.vue" import resourceManagement from "./resourceManagement.vue" import resourceClassification from './resourceClassification.vue' -import {mapState} from 'vuex' +import { mapState } from 'vuex' export default { name: 'resourceList', diff --git a/project/pengliuyang/apps/AppCommunityResource/components/resourceManagement.vue b/project/pengliuyang/apps/AppCommunityResource/components/resourceManagement.vue index 5fdbcf80..fadc691b 100644 --- a/project/pengliuyang/apps/AppCommunityResource/components/resourceManagement.vue +++ b/project/pengliuyang/apps/AppCommunityResource/components/resourceManagement.vue @@ -5,7 +5,7 @@ @@ -41,6 +40,7 @@ export default { }, total: 0, tableData: [], + categoryList: [], } }, computed: { @@ -55,30 +55,46 @@ export default { }, created() { this.getList() + this.getCategoryList() }, methods: { getList() { this.instance.post(`/app/appresourceinfo/list`,null,{ params: { ...this.search, - areaId: this.areaId, + // areaId: this.areaId, } }).then(res=> { if(res?.data) { this.tableData = res.data.records - this.total = res.total + this.total = res.data.total } }) }, addResource() { this.$router.push({hash: "#addResource", query: {}}) - } + }, + getCategoryList() { + this.instance.post(`/app/appresourcecategory/list`,null,{ + params: { + current: 1, + size: 3000, + } + }).then(res=> { + if(res?.data) { + this.categoryList = res.data.records.map(item=> { + return { + dictName: item.categoryName, + dictValue: item.id + } + }) + } + }) + }, } } \ No newline at end of file