mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 15:51:52 +08:00
perf: dept
This commit is contained in:
parent
bc97bd30a0
commit
5725d4862b
@ -42,7 +42,6 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => {
|
|||||||
/**
|
/**
|
||||||
* grid options 初始化
|
* grid options 初始化
|
||||||
*/
|
*/
|
||||||
console.info(config?.allSchemas.tableSchema)
|
|
||||||
const gridOptions = reactive<VxeGridProps>({
|
const gridOptions = reactive<VxeGridProps>({
|
||||||
loading: true,
|
loading: true,
|
||||||
size: currentSize as any,
|
size: currentSize as any,
|
||||||
|
@ -42,7 +42,12 @@ const crudSchemas = reactive<VxeCrudSchema>({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '负责人',
|
title: '负责人',
|
||||||
field: 'leaderUserId'
|
field: 'leaderUserId',
|
||||||
|
table: {
|
||||||
|
slots: {
|
||||||
|
default: 'leaderUserId_default'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '联系电话',
|
title: '联系电话',
|
||||||
|
@ -14,6 +14,9 @@
|
|||||||
<XButton title="展开所有" @click="xGrid?.setAllTreeExpand(true)" />
|
<XButton title="展开所有" @click="xGrid?.setAllTreeExpand(true)" />
|
||||||
<XButton title="关闭所有" @click="xGrid?.clearTreeExpand()" />
|
<XButton title="关闭所有" @click="xGrid?.clearTreeExpand()" />
|
||||||
</template>
|
</template>
|
||||||
|
<template #leaderUserId_default="{ row }">
|
||||||
|
<span>{{ userNicknameFormat(row) }}</span>
|
||||||
|
</template>
|
||||||
<template #actionbtns_default="{ row }">
|
<template #actionbtns_default="{ row }">
|
||||||
<!-- 操作:修改 -->
|
<!-- 操作:修改 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
@ -200,21 +203,21 @@ const handleDelete = async (rowId: number) => {
|
|||||||
await deleteData(xGrid, rowId)
|
await deleteData(xGrid, rowId)
|
||||||
}
|
}
|
||||||
|
|
||||||
//const userNicknameFormat = (row) => {
|
const userNicknameFormat = (row) => {
|
||||||
// if (!row && !row.row && !row.row.leaderUserId) {
|
if (!row || !row.leaderUserId || row.leaderUserId == null) {
|
||||||
// return '未设置'
|
return '未设置'
|
||||||
// }
|
}
|
||||||
// for (const user of userOption.value) {
|
for (const user of userOption.value) {
|
||||||
// if (row.row.leaderUserId === user.id) {
|
if (row.leaderUserId === user.id) {
|
||||||
// return user.nickname
|
return user.nickname
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// return '未知【' + row.row.leaderUserId + '】'
|
return '未知【' + row.leaderUserId + '】'
|
||||||
//}
|
}
|
||||||
//
|
|
||||||
// ========== 初始化 ==========
|
// ========== 初始化 ==========
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getTree()
|
|
||||||
await getUserList()
|
await getUserList()
|
||||||
|
await getTree()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user