|
@@ -11,11 +11,12 @@
|
|
|
<!-- :immediate-check='false' -->
|
|
|
<div class='container' v-for='(item,index) in list' :key='index'>
|
|
|
<!-- 政府部门 -->
|
|
|
- <div class='government-department' v-if='item.department.indexOf("其他")'>
|
|
|
+ <div class='government-department'>
|
|
|
+ <!-- <div class='government-department' v-if='item.department.indexOf("其他")'> -->
|
|
|
<van-cell :title='item.department' is-link :value='`${item.count}`' @click='goToMattersFetail(item,1)' />
|
|
|
</div>
|
|
|
<!-- 其他部门 -->
|
|
|
- <div class='other-department' v-else>
|
|
|
+ <!-- <div class='other-department' v-else>
|
|
|
<van-cell title='其他' :arrow-direction='item.arrowDirection ||"up"' is-link @click='changeOtherShowStatus(item)' />
|
|
|
<div class='other-container' v-if='item.showOther'>
|
|
|
<van-cell
|
|
@@ -28,7 +29,7 @@
|
|
|
:key='dIndex'
|
|
|
/>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div>-->
|
|
|
</div>
|
|
|
</van-list>
|
|
|
</div>
|
|
@@ -150,7 +151,7 @@ export default {
|
|
|
this.count = res.count //TODO: count
|
|
|
this.currentCount += data.length
|
|
|
data.map((item) => {
|
|
|
- item.children = []
|
|
|
+ // item.children = []
|
|
|
|
|
|
if (item.cnt) {
|
|
|
item.count = item.cnt + '项'
|
|
@@ -158,36 +159,40 @@ export default {
|
|
|
item.count = '--'
|
|
|
item.disabled = true
|
|
|
}
|
|
|
+ if (item.otherdescription) {
|
|
|
+ let otherdescription = item.otherdescription.replace(/(\(无\)|\(无\))/g, '')
|
|
|
+ otherdescription && (item.department = item.department + ' ' + otherdescription)
|
|
|
+ }
|
|
|
})
|
|
|
- if (['其他部门', '其他', '其它'].includes(data[0].department)) {
|
|
|
- let item = data[0]
|
|
|
- item.showOther = true
|
|
|
- item.children.push({ department: item.department, count: item.count, cnt: item.cnt, otherdescription: item.otherdescription })
|
|
|
- }
|
|
|
+ // if (['其他部门', '其他', '其它'].includes(data[0].department)) {
|
|
|
+ // let item = data[0]
|
|
|
+ // item.showOther = true
|
|
|
+ // item.children.push({ department: item.department, count: item.count, cnt: item.cnt, otherdescription: item.otherdescription })
|
|
|
+ // }
|
|
|
// 处理其他部门,将在一起的其他部门,合并到一起
|
|
|
- for (let index = 1, len = data.length; index < len; index++) {
|
|
|
- const item = data[index]
|
|
|
- // 出现的第一个其他部门加入children
|
|
|
- if (['其他部门', '其他', '其它'].includes(item.department) && !['其他部门', '其他', '其它'].includes(data[index - 1].department)) {
|
|
|
- item.showOther = true
|
|
|
- if (
|
|
|
- !item.children.some(({ department, count, otherdescription }) => {
|
|
|
- return item.otherdescription === otherdescription && item.count === count && item.department === item.department
|
|
|
- })
|
|
|
- ) {
|
|
|
- item.children.push({ department: item.department, count: item.count, cnt: item.cnt, otherdescription: item.otherdescription })
|
|
|
- }
|
|
|
- } else if (data[index - 1].department === item.department && ['其他部门', '其他', '其它'].includes(item.department)) {
|
|
|
- data[index - 1].children.push({
|
|
|
- department: item.department,
|
|
|
- count: item.count,
|
|
|
- cnt: item.cnt,
|
|
|
- otherdescription: item.otherdescription,
|
|
|
- })
|
|
|
- data.splice(index--, 1)
|
|
|
- len--
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let index = 1, len = data.length; index < len; index++) {
|
|
|
+ // const item = data[index]
|
|
|
+ // // 出现的第一个其他部门加入children
|
|
|
+ // if (['其他部门', '其他', '其它'].includes(item.department) && !['其他部门', '其他', '其它'].includes(data[index - 1].department)) {
|
|
|
+ // item.showOther = true
|
|
|
+ // if (
|
|
|
+ // !item.children.some(({ department, count, otherdescription }) => {
|
|
|
+ // return item.otherdescription === otherdescription && item.count === count && item.department === item.department
|
|
|
+ // })
|
|
|
+ // ) {
|
|
|
+ // item.children.push({ department: item.department, count: item.count, cnt: item.cnt, otherdescription: item.otherdescription })
|
|
|
+ // }
|
|
|
+ // } else if (data[index - 1].department === item.department && ['其他部门', '其他', '其它'].includes(item.department)) {
|
|
|
+ // data[index - 1].children.push({
|
|
|
+ // department: item.department,
|
|
|
+ // count: item.count,
|
|
|
+ // cnt: item.cnt,
|
|
|
+ // otherdescription: item.otherdescription,
|
|
|
+ // })
|
|
|
+ // data.splice(index--, 1)
|
|
|
+ // len--
|
|
|
+ // }
|
|
|
+ // }
|
|
|
if (this.page === 1) {
|
|
|
this.list = data
|
|
|
} else {
|
|
@@ -297,6 +302,7 @@ export default {
|
|
|
background: #f1f1f1;
|
|
|
border-radius: 16px;
|
|
|
border: 1px solid #dcdcdc;
|
|
|
+ padding: 0 !important;
|
|
|
}
|
|
|
.active {
|
|
|
background-color: #025baa !important;
|