字典树ok
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
></Tree>
|
||||
<el-empty style="width: 100%; padding-top: 300px; box-sizing: border-box" description="请选择角色" v-else />
|
||||
</div>
|
||||
<popupForm ref="popupRef"></popupForm>
|
||||
<PopupForm ref="popupRef"></PopupForm>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -33,7 +33,7 @@ import { getFunctionsByRoleIndex, updateRoleMenu } from '@/api/user-boot/roleFuc
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { del } from '@/api/user-boot/role'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import popupForm from './popupForm.vue'
|
||||
import PopupForm from './popupForm.vue'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
|
||||
const adminInfo = useAdminInfo()
|
||||
@@ -98,16 +98,23 @@ tableStore.table.params.searchValue = ''
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
const filterData = (arr: any[]) => {
|
||||
return arr.filter((item: any) => {
|
||||
// return arr.filter((item: any) => {
|
||||
// item.name = item.title
|
||||
// if (item.children.length) {
|
||||
// item.children = filterData(item.children)
|
||||
// }
|
||||
// return item.type === 0
|
||||
// })
|
||||
arr.forEach((item: any) => {
|
||||
item.name = item.title
|
||||
if (item.children.length) {
|
||||
item.children = filterData(item.children)
|
||||
filterData(item.children)
|
||||
}
|
||||
return item.type === 0
|
||||
})
|
||||
}
|
||||
functionTree().then((res: any) => {
|
||||
menuTree.value = filterData(res.data)
|
||||
filterData(res.data)
|
||||
menuTree.value = res.data
|
||||
})
|
||||
|
||||
const currentChange = (data: any) => {
|
||||
|
||||
Reference in New Issue
Block a user