|
@@ -41,10 +41,14 @@ const query = ref({
|
|
const headers = [
|
|
const headers = [
|
|
{ title: '企业名称', key: 'showInfo.currentAccountEnterpriseAnotherName', sortable: false },
|
|
{ title: '企业名称', key: 'showInfo.currentAccountEnterpriseAnotherName', sortable: false },
|
|
{ title: '邀请人', key: 'showInfo.currentAccountUserName', sortable: false },
|
|
{ title: '邀请人', key: 'showInfo.currentAccountUserName', sortable: false },
|
|
- { title: 'invited', key: 'showInfo.invited', sortable: false },
|
|
|
|
|
|
+ { title: 'invited', key: 'showInfo.name', sortable: false },
|
|
{ title: t('enterprise.userManagement.invitationTime'), key: 'showInfo.time', sortable: false },
|
|
{ title: t('enterprise.userManagement.invitationTime'), key: 'showInfo.time', sortable: false },
|
|
]
|
|
]
|
|
-headers.forEach(e => { if (e.title === 'invited') e.title = props.inviteType - 0 ? '受邀企业' : '受邀人' })
|
|
|
|
|
|
+headers.forEach(e => {
|
|
|
|
+ if (e.title === 'invited') {
|
|
|
|
+ e.title = props.inviteType - 0 ? '受邀企业' : '受邀人'
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
|
|
// 获取数据
|
|
// 获取数据
|
|
const getData = async () => {
|
|
const getData = async () => {
|
|
@@ -52,37 +56,21 @@ const getData = async () => {
|
|
try {
|
|
try {
|
|
const info = JSON.parse(localStorage.getItem('entBaseInfo')) || null
|
|
const info = JSON.parse(localStorage.getItem('entBaseInfo')) || null
|
|
const { list, total: number } = await enterpriseInviteRecordPage(query.value)
|
|
const { list, total: number } = await enterpriseInviteRecordPage(query.value)
|
|
- // const invitedNames = await Promise.all(list.map(async () => getInvited()))
|
|
|
|
tableData.value = list.map(e => {
|
|
tableData.value = list.map(e => {
|
|
const showInfo = {
|
|
const showInfo = {
|
|
currentAccountEnterpriseAnotherName: info?.enterpriseAnotherName || '--',
|
|
currentAccountEnterpriseAnotherName: info?.enterpriseAnotherName || '--',
|
|
currentAccountUserName: info?.name || '--',
|
|
currentAccountUserName: info?.name || '--',
|
|
- // invited: invitedNames[index] || '--', // 使用预先获取的invited名称
|
|
|
|
- invited: e?.enterpriseUser?.enterpriseName || '--', // 使用预先获取的invited名称
|
|
|
|
|
|
+ name: props.inviteType - 0 ? e?.enterpriseUser?.enterpriseName : e?.enterpriseUser?.name,
|
|
time: e.createTime ? timesTampChange(e.createTime) : '--',
|
|
time: e.createTime ? timesTampChange(e.createTime) : '--',
|
|
}
|
|
}
|
|
return { showInfo, ...e }
|
|
return { showInfo, ...e }
|
|
})
|
|
})
|
|
- console.log('tableData.value', tableData.value)
|
|
|
|
total.value = number
|
|
total.value = number
|
|
} finally {
|
|
} finally {
|
|
loading.value = false
|
|
loading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// const getInvited = async (val) => {
|
|
|
|
-// try {
|
|
|
|
-// if (val) {
|
|
|
|
-// const api = props.inviteType - 0 ? enterpriseInviteRecordPage: enterpriseInviteRecordPage
|
|
|
|
-// const { data } = await api(query.value)
|
|
|
|
-// return data.name
|
|
|
|
-// } else {
|
|
|
|
-// return '-占位-'
|
|
|
|
-// }
|
|
|
|
-// } catch (error) {
|
|
|
|
-// console.log('error', error)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
getData()
|
|
getData()
|
|
|
|
|
|
const handleChangePage = (index) => {
|
|
const handleChangePage = (index) => {
|