소스 검색

app 更多应用分类排序问题

娄底高职分支
yxq 1 년 전
부모
커밋
a709c1eaea
1개의 변경된 파일22개의 추가작업 그리고 10개의 파일을 삭제
  1. +22
    -10
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home/more.vue

+ 22
- 10
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/home/more.vue 파일 보기

@@ -35,14 +35,14 @@
</view>

<!-- 分块显示功能区 -->
<template v-for="(group, title) in groupList">
<view :key="title" class="margin-bottom">
<template v-for="gitem in groupList">
<view :key="gitem[0]" class="margin-bottom">
<!-- 区块标题 -->
<l-title>{{ title }}</l-title>
<l-title>{{ gitem[0] }}</l-title>
<!-- 按钮组 -->
<view class="function-list cu-list grid no-border col-4">
<view
v-for="(item, index) in group"
v-for="(item, index) in gitem[1]"
:key="index"
class="cu-item text-center flex flex-wrap justify-center align-center"
>
@@ -78,6 +78,7 @@ import keyBy from 'lodash/keyBy'
import mapKeys from 'lodash/mapKeys'
import mapValues from 'lodash/mapValues'
import groupBy from 'lodash/groupBy'
import { forEach } from 'lodash'

export default {
data() {
@@ -185,7 +186,21 @@ export default {
}

this.editList = concat(this.editList, id)
}
},
// 菜单分组
groupBy_(arr,field,typeTable){
let res = groupBy(arr, field)
let cateArr = []
let res_ = []
forEach(arr,(v,i)=>{
if(!cateArr.includes(v[field])){
cateArr.push(v[field])
res_.push([typeTable[v[field]],res[v[field]]])
}
})
return res_
}
},

computed: {
@@ -198,11 +213,8 @@ export default {
// 获取列表分组
groupList() {
const typeTable = mapValues(keyBy(Object.values(this.GET_GLOBAL('dataDictionary')?this.GET_GLOBAL('dataDictionary').function:()=>{}), 'value'), 'text')

return mapKeys(
groupBy(this.allList.filter(item => item.F_Name.includes(this.searchText)), 'F_Type'),
(v, k) => typeTable[k]
)
return this.groupBy_(this.allList.filter(item => item.F_Name.includes(this.searchText)), 'F_Type',typeTable)
}
}
}


불러오는 중...
취소
저장