调整村务公开

This commit is contained in:
aixianling
2022-03-14 12:21:24 +08:00
parent f2508c5823
commit edf03dbb5d
4 changed files with 274 additions and 269 deletions

View File

@@ -0,0 +1,33 @@
<template>
<section class="AppArticles">
<component :is="currentComponent" :instance="instance" :dict="dict" :permissions="permissions"/>
</section>
</template>
<script>
import Add from "./components/Add";
import Detail from "./components/Detail";
import Event from "./components/Event";
export default {
name: "AppArticles",
label: "村务公开(运营版)",
components: {Event, Detail, Add},
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentComponent() {
return this.$route.hash == "#add" ? Add :
!!this.$route.query?.id ? Detail : Event
}
}
}
</script>
<style lang="scss" scoped>
.AppArticles {
}
</style>

View File

@@ -54,7 +54,6 @@ export default {
props: {
dict: Object,
params: Object,
instance: Function,
areaId: String
},
@@ -78,7 +77,10 @@ export default {
},
computed: {
...mapState(['user'])
...mapState(['user']),
params() {
return this.$route.query
}
},
created() {
@@ -89,7 +91,7 @@ export default {
methods: {
onBack() {
this.cancel()
this.$router.push({})
},
getInfo() {
@@ -124,13 +126,6 @@ export default {
}
})
},
cancel(isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
</script>

View File

@@ -22,12 +22,10 @@
<script>
export default {
name: 'detail',
props: {
instance: Function,
dict: Object,
permissions: Function,
params: Object
},
data() {
@@ -35,7 +33,11 @@
info: {}
}
},
computed: {
params() {
return this.$route.query
}
},
mounted() {
this.getInfo()
},
@@ -43,7 +45,7 @@
methods: {
getInfo() {
this.instance.post(`/appvillageinfo/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code === 0) {
if (res?.data) {
this.info = res.data
if (res.data.thumbUrl) {
this.info.thumbUrl = JSON.parse(res.data.thumbUrl)
@@ -53,9 +55,7 @@
},
onBack() {
this.$emit('change', {
type: 'list'
})
this.$router.push({})
}
}
}

View File

@@ -5,7 +5,7 @@
<template slot="content">
<ai-search-bar>
<template slot="left">
<el-button icon="iconfont iconAdd" type="primary" size="small" @click="add">添加</el-button>
<el-button icon="iconfont iconAdd" type="primary" size="small" @click="toAdd">添加</el-button>
</template>
<template slot="right">
<el-input
@@ -44,7 +44,7 @@
<el-button
type="text"
title="编辑"
@click="toAdd(row.id)">
@click="toEdit(row.id)">
编辑
</el-button>
<el-button
@@ -83,7 +83,8 @@
</el-select>
</el-form-item>
<el-form-item required label="地区" prop="areaId" :rules="[{required: true, message: '请选择发布地区'}]">
<ai-area-get :instance="instance" v-model="dialogForm.areaId" :root="rootId" :name.sync="dialogForm.areaName" />
<ai-area-get :instance="instance" v-model="dialogForm.areaId" :root="rootId"
:name.sync="dialogForm.areaName"/>
</el-form-item>
</el-form>
</ai-dialog>
@@ -190,42 +191,15 @@
this.dialog = true
},
toAdd (id) {
this.$emit('change', {
type: 'add',
params: {
id
}
})
toAdd() {
this.$router.push({hash: "#add"})
},
add () {
this.$emit('change', {
type: 'add',
params: {
id: ''
}
})
},
toEdit(id) {
this.$emit('change', {
type: 'add',
params: {
type: 'ReportAdd',
id
}
})
this.$router.push({hash: "#add", query: {id}})
},
toDetail(id) {
this.$emit('change', {
type: 'detail',
params: {
type: 'eventDetail',
id
}
})
this.$router.push({query: {id}})
},
remove(id) {
@@ -261,15 +235,18 @@
<style lang="scss" scoped>
.event {
height: 100%;
::v-deep th {
font-weight: bold !important;
}
::v-deep .table-options {
span {
font-size: 14px !important;
}
}
}
.table-btn {
margin-right: 16px;
font-size: 14px;