|
|
@@ -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) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|