feat(管理员中心): 对接查询团队总览和检查权限的接口
This commit is contained in:
parent
e4b1bf2f82
commit
4ae8df8c7c
@ -72,7 +72,7 @@ export const cancelInvite = async (userId) => {
|
||||
}
|
||||
}
|
||||
|
||||
//查询BD团队概览
|
||||
//查询团队概览
|
||||
export const apiGetTeamOverview = async (data) => {
|
||||
try {
|
||||
const response = await post('/bd/team/overview', data)
|
||||
@ -84,7 +84,7 @@ export const apiGetTeamOverview = async (data) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询BD团队成员详情(More弹框)
|
||||
// 查询团队成员详情(More弹框)
|
||||
export const apiGetTeamMemberDetail = async (data) => {
|
||||
try {
|
||||
const response = await post('/bd/team/member/detail', data)
|
||||
@ -95,3 +95,27 @@ export const apiGetTeamMemberDetail = async (data) => {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
// 查询团队总览
|
||||
export const apiGetTeamSummary = async (data) => {
|
||||
try {
|
||||
const response = await post('/bd/team/summary', data)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.error('Failed to get team summary:', error)
|
||||
console.error('error:' + error.response.errorMsg)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
// 检查权限
|
||||
export const apiGetTeamPermissionCheck = async (data) => {
|
||||
try {
|
||||
const response = await post('/bd/team/permission/check', data)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.error('Failed to get team permission check:', error)
|
||||
console.error('error:' + error.response.errorMsg)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,10 +85,10 @@
|
||||
white-space: nowrap;
|
||||
"
|
||||
>
|
||||
{{ userInfo.userNickname || userInfo.name }}
|
||||
{{ userInfo.userNickname || '-' }}
|
||||
</div>
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
ID: {{ userInfo.id || userInfo.account }}
|
||||
ID: {{ userInfo.account || '-' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -134,7 +134,7 @@
|
||||
|
||||
<div v-if="taskData.tasks" style="display: flex; flex-direction: column; gap: 4px">
|
||||
<div style="font-weight: 500">
|
||||
{{ taskData.cycleStartDate }}-{{ taskData.cycleEndDate }} :
|
||||
{{ taskData.cycleStartDate }}-{{ taskData.cycleEndDate }}
|
||||
</div>
|
||||
<!-- 任务列表与完成状态 -->
|
||||
<div
|
||||
@ -171,7 +171,9 @@
|
||||
style="display: flex; justify-content: space-between; align-items: center"
|
||||
@click="gotoIncome"
|
||||
>
|
||||
<div style="font-weight: 600">Team earnings this period</div>
|
||||
<div style="font-weight: 600">
|
||||
Team earnings this period: ${{ teamSummary.teamEarningsThisPeriod || 0 }}
|
||||
</div>
|
||||
<img
|
||||
src="../../assets/icon/arrowBlack.png"
|
||||
alt=""
|
||||
@ -183,7 +185,9 @@
|
||||
<!-- 我的BD Leader团队 -->
|
||||
<div style="display: flex; flex-direction: column; gap: 4px">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="font-weight: 600">My BD Leader Teams</div>
|
||||
<div style="font-weight: 600">
|
||||
My BD Leader Teams({{ teamSummary.bdLeaderTeams?.count || 0 }})
|
||||
</div>
|
||||
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
|
||||
<img
|
||||
src="../../assets/icon/addUser.png"
|
||||
@ -202,9 +206,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
Total income:$1500
|
||||
</div> -->
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
Total income: ${{ teamSummary.bdLeaderTeams?.totalIncome || 0 }}
|
||||
</div>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div style="border-bottom: 1px solid #e6e6e6"></div>
|
||||
@ -213,7 +217,7 @@
|
||||
<!-- 我的BD团队 -->
|
||||
<div style="display: flex; flex-direction: column; gap: 4px">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="font-weight: 600">My BD Teams</div>
|
||||
<div style="font-weight: 600">My BD Teams({{ teamSummary.bdTeams?.count || 0 }})</div>
|
||||
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
|
||||
<img
|
||||
src="../../assets/icon/addUser.png"
|
||||
@ -232,9 +236,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
Total income:$1500
|
||||
</div> -->
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
Total income:${{ teamSummary.bdTeams?.totalIncome || 0 }}
|
||||
</div>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div style="border-bottom: 1px solid #e6e6e6"></div>
|
||||
@ -243,7 +247,9 @@
|
||||
<!-- 我的Agency团队 -->
|
||||
<div style="display: flex; flex-direction: column; gap: 4px">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<div style="font-weight: 600">My Agency Teams</div>
|
||||
<div style="font-weight: 600">
|
||||
My Agency Teams({{ teamSummary.agencyTeams?.count || 0 }})
|
||||
</div>
|
||||
<div style="align-self: stretch; display: flex; align-items: center; gap: 4px">
|
||||
<img
|
||||
src="../../assets/icon/addUser.png"
|
||||
@ -262,9 +268,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
Total income:$1500
|
||||
</div> -->
|
||||
<div style="color: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 500">
|
||||
Total income: ${{ teamSummary.agencyTeams?.totalIncome || 0 }}
|
||||
</div>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<div style="border-bottom: 1px solid #e6e6e6"></div>
|
||||
@ -327,7 +333,8 @@
|
||||
</div>
|
||||
|
||||
<!-- 前往用户编辑 -->
|
||||
<!-- <div
|
||||
<div
|
||||
v-if="teamPermissionCheck.hasUserEditingPermission"
|
||||
style="
|
||||
background-color: white;
|
||||
border-radius: 12px;
|
||||
@ -349,10 +356,11 @@
|
||||
style="display: block; width: 1.5em"
|
||||
class="flipImg"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- 前往房间编辑 -->
|
||||
<!-- <div
|
||||
<div
|
||||
v-if="teamPermissionCheck.hasRoomEditingPermission"
|
||||
style="
|
||||
background-color: white;
|
||||
border-radius: 12px;
|
||||
@ -374,7 +382,7 @@
|
||||
style="display: block; width: 1.5em"
|
||||
class="flipImg"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -391,6 +399,8 @@ import { usePageInitializationWithConfig } from '@/utils/pageConfig.js'
|
||||
|
||||
import {
|
||||
apiTaskList, //获取任务列表
|
||||
apiGetTeamSummary, // 查询BD团队总览
|
||||
apiGetTeamPermissionCheck, // 检查权限
|
||||
} from '@/api/admin.js'
|
||||
|
||||
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||
@ -404,6 +414,8 @@ const router = useRouter()
|
||||
locale.value && setDocumentDirection(locale.value)
|
||||
|
||||
const taskData = ref({}) //任务项目数据
|
||||
const teamSummary = ref({}) //团队总览
|
||||
const teamPermissionCheck = ref({}) //团队权限检查
|
||||
|
||||
// 任务名称
|
||||
const taskName = (task) => {
|
||||
@ -461,9 +473,29 @@ const getTaskList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 查询团队总览
|
||||
const getTeamSummary = async () => {
|
||||
const resTeamSummary = await apiGetTeamSummary()
|
||||
console.log('团队总览:', resTeamSummary)
|
||||
if (resTeamSummary.status && resTeamSummary.body) {
|
||||
teamSummary.value = resTeamSummary.body
|
||||
}
|
||||
}
|
||||
|
||||
// 检查权限
|
||||
const getTeamPermissionCheck = async () => {
|
||||
const resTeamPermissionCheck = await apiGetTeamPermissionCheck()
|
||||
console.log('权限列表:', resTeamPermissionCheck)
|
||||
if (resTeamPermissionCheck.status && resTeamPermissionCheck.body) {
|
||||
teamPermissionCheck.value = resTeamPermissionCheck.body
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化数据
|
||||
const init = () => {
|
||||
getTaskList()
|
||||
getTaskList() // 获取任务列表
|
||||
getTeamSummary() // 查询BD团队总览
|
||||
getTeamPermissionCheck() // 检查权限
|
||||
}
|
||||
|
||||
const { userInfo } = usePageInitializationWithConfig('ADMIN Center', {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user