大哥建联统计
This commit is contained in:
@@ -5,9 +5,9 @@ VITE_DEV=true
|
|||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
# VITE_BASE_URL='http://172.16.214.222:48080'
|
# VITE_BASE_URL='http://172.16.214.222:48080'
|
||||||
# VITE_BASE_URL='http://192.168.1.144:48080'
|
VITE_BASE_URL='http://192.168.1.144:48080'
|
||||||
# VITE_BASE_URL='http://47.79.98.113:48080'
|
# VITE_BASE_URL='http://47.79.98.113:48080'
|
||||||
VITE_BASE_URL='https://backstageapi.yolozs.com'
|
# VITE_BASE_URL='https://backstageapi.yolozs.com'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export interface EmployeeHostsVO {
|
|||||||
fllowernum: number // 关注数量
|
fllowernum: number // 关注数量
|
||||||
yesterdayCoins: number // 昨日金币
|
yesterdayCoins: number // 昨日金币
|
||||||
country: string // 主播国家
|
country: string // 主播国家
|
||||||
hostsKind: string // 直播类型 娱乐,游戏
|
hostsKind: string // 直播类型 娱乐,游戏
|
||||||
operationStatus: number // 操作状态
|
operationStatus: number // 操作状态
|
||||||
createTime: string // 创建时间
|
createTime: string // 创建时间
|
||||||
updateTime: string // 创建时间
|
updateTime: string // 创建时间
|
||||||
@@ -22,26 +22,39 @@ export interface EmployeeHostsVO {
|
|||||||
uid: string // 用户id
|
uid: string // 用户id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 员工分配主播 API
|
// 员工分配主播 API
|
||||||
export const EmployeeHostsApi = {
|
export const EmployeeHostsApi = {
|
||||||
// 查询员工分配主播分页
|
// 查询员工分配主播分页
|
||||||
// getEmployeeHostsPage: async (params: any) => {
|
// getEmployeeHostsPage: async (params: any) => {
|
||||||
// return await request.get({ url: `/server/employee-hosts/page`, params })
|
// return await request.get({ url: `/server/employee-hosts/page`, params })
|
||||||
// },
|
// },
|
||||||
// 查询员工分配主播分页
|
// 查询员工分配主播分页
|
||||||
getEmployeeHostsPage: async (params: any) => {
|
getEmployeeHostsPage: async (params: any) => {
|
||||||
return await request.get({ url: `/server/employee-hosts/self_page`, params })
|
return await request.get({ url: `/server/employee-hosts/self_page`, params })
|
||||||
},
|
},
|
||||||
// 查询员工分配主播分页
|
// 查询员工分配大哥分页
|
||||||
employeeCompleteBarChart: async (params: number[],days: number) => {
|
getEmployeeHostsPageDsec: async (params: any) => {
|
||||||
return await request.post({ url: `/server/employee-hosts/employeeCompleteBarChart`, data: {userId:params,days:days} })
|
return await request.get({ url: `/server/employee-big-brother/self_complete` })
|
||||||
},
|
},
|
||||||
// 查询管理员工分配主播分页
|
// 查询员工分配主播分页
|
||||||
getMeangeEmployeeHostsPage: async (params: any) => {
|
employeeCompleteBarChart: async (params: number[], days: number) => {
|
||||||
return await request.get({ url: `server/employee-hosts/page`, params })
|
return await request.post({
|
||||||
},
|
url: `/server/employee-hosts/employeeCompleteBarChart`,
|
||||||
|
data: { userId: params, days: days }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询员工分配大哥分页
|
||||||
|
employeeCompleteBarChartDsec: async (params: number[], days: number) => {
|
||||||
|
return await request.post({
|
||||||
|
url: `/server/employee-big-brother/employeeCompleteBarChart`,
|
||||||
|
data: { userId: params, days: days }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询管理员工分配主播分页
|
||||||
|
getMeangeEmployeeHostsPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `server/employee-hosts/page`, params })
|
||||||
|
},
|
||||||
// 查询员工分配主播详情
|
// 查询员工分配主播详情
|
||||||
getEmployeeHosts: async (id: number) => {
|
getEmployeeHosts: async (id: number) => {
|
||||||
return await request.get({ url: `/server/employee-hosts/get?id=` + id })
|
return await request.get({ url: `/server/employee-hosts/get?id=` + id })
|
||||||
@@ -60,18 +73,21 @@ export const EmployeeHostsApi = {
|
|||||||
updateBatchEmployeeHosts: async (data: EmployeeHostsVO[]) => {
|
updateBatchEmployeeHosts: async (data: EmployeeHostsVO[]) => {
|
||||||
return await request.put({ url: `/server/employee-hosts/batch_update`, data })
|
return await request.put({ url: `/server/employee-hosts/batch_update`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除员工分配主播
|
// 删除员工分配主播
|
||||||
deleteEmployeeHosts: async (id: number) => {
|
deleteEmployeeHosts: async (id: number) => {
|
||||||
return await request.delete({ url: `/server/employee-hosts/delete?id=` + id })
|
return await request.delete({ url: `/server/employee-hosts/delete?id=` + id })
|
||||||
},
|
},
|
||||||
// 删除员工分配主播
|
// 删除员工分配主播
|
||||||
deleteEmployeeHostsList: async (ids: number[]) => {
|
deleteEmployeeHostsList: async (ids: number[]) => {
|
||||||
return await request.delete({ url: `/server/employee-hosts/delete-list`, params: { ids: ids.join(',') } })
|
return await request.delete({
|
||||||
|
url: `/server/employee-hosts/delete-list`,
|
||||||
|
params: { ids: ids.join(',') }
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导出员工分配主播 Excel
|
// 导出员工分配主播 Excel
|
||||||
exportEmployeeHosts: async (params) => {
|
exportEmployeeHosts: async (params) => {
|
||||||
return await request.download({ url: `/server/employee-hosts/export-employee-excel`, params })
|
return await request.download({ url: `/server/employee-hosts/export-employee-excel`, params })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ export const getUserPage = (params: PageParam) => {
|
|||||||
}
|
}
|
||||||
// 查询租户下用户
|
// 查询租户下用户
|
||||||
export const getUserByTenant = (tenantId: number) => {
|
export const getUserByTenant = (tenantId: number) => {
|
||||||
return request.get({ url: 'system/user/list-tenant-user?tenantId='+tenantId })
|
return request.get({ url: 'system/user/list-tenant-user?tenantId=' + tenantId })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户管理列表
|
// 查询用户管理列表
|
||||||
export const getAllocation = (id: number) => {
|
export const getAllocation = (id: number) => {
|
||||||
return request.get({ url: '/system/user/list-all-simple-dept?deptId='+id })
|
return request.get({ url: '/system/user/list-all-simple-dept?deptId=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户详情
|
// 查询用户详情
|
||||||
@@ -101,17 +101,16 @@ export const getSimpleUserListPage = (params: PageParam): Promise<UserVO[]> => {
|
|||||||
return request.get({ url: '/system/user/page', params })
|
return request.get({ url: '/system/user/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取国家
|
// 获取国家
|
||||||
export const getCountry = (country) => {
|
export const getCountry = (country) => {
|
||||||
return request.get({ url: '/server/country-info/get?region='+ country })
|
return request.get({ url: '/server/country-info/get?region=' + country })
|
||||||
}
|
}
|
||||||
// 获取本人建联率
|
// 获取本人建联率
|
||||||
export const getComplete = () => {
|
export const getComplete = () => {
|
||||||
return request.get({ url: '/server/employee-hosts/self_complete'})
|
return request.get({ url: '/server/employee-hosts/self_complete' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取员工建联率
|
// 获取员工建联率
|
||||||
export const getEmployeeComplete = (id) => {
|
export const getEmployeeComplete = (id) => {
|
||||||
return request.get({ url: '/server/employee-hosts/employeeComplete?userId='+id})
|
return request.get({ url: '/server/employee-hosts/employeeComplete?userId=' + id })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default {
|
|||||||
copy: 'Copy',
|
copy: 'Copy',
|
||||||
copySuccess: 'Copy Success',
|
copySuccess: 'Copy Success',
|
||||||
copyError: 'Copy Error',
|
copyError: 'Copy Error',
|
||||||
perPage: 'Number page',
|
perPage: 'Number page'
|
||||||
},
|
},
|
||||||
lock: {
|
lock: {
|
||||||
lockScreen: 'Lock screen',
|
lockScreen: 'Lock screen',
|
||||||
@@ -142,9 +142,9 @@ export default {
|
|||||||
qrcode: 'Scan the QR code to log in',
|
qrcode: 'Scan the QR code to log in',
|
||||||
btnRegister: 'Sign up',
|
btnRegister: 'Sign up',
|
||||||
SmsSendMsg: 'code has been sent',
|
SmsSendMsg: 'code has been sent',
|
||||||
resetPassword: "Reset Password",
|
resetPassword: 'Reset Password',
|
||||||
resetPasswordSuccess: "Reset Password Success",
|
resetPasswordSuccess: 'Reset Password Success',
|
||||||
invalidTenantName:"Invalid Tenant Name"
|
invalidTenantName: 'Invalid Tenant Name'
|
||||||
},
|
},
|
||||||
captcha: {
|
captcha: {
|
||||||
verification: 'Please complete security verification',
|
verification: 'Please complete security verification',
|
||||||
@@ -165,7 +165,7 @@ export default {
|
|||||||
BigBrotherManage: 'BigBrotherManage',
|
BigBrotherManage: 'BigBrotherManage',
|
||||||
BigBrotherDataManage: 'BigBrotherDataManage',
|
BigBrotherDataManage: 'BigBrotherDataManage',
|
||||||
BigBrotherList: 'BigBrotherList',
|
BigBrotherList: 'BigBrotherList',
|
||||||
staffBigBrotherManage: 'StaffBigBrotherManage',
|
staffBigBrotherManage: 'StaffBigBrotherManage'
|
||||||
},
|
},
|
||||||
analysis: {
|
analysis: {
|
||||||
newUser: 'New user',
|
newUser: 'New user',
|
||||||
@@ -193,10 +193,11 @@ export default {
|
|||||||
allianceAdvertising: 'Alliance advertising',
|
allianceAdvertising: 'Alliance advertising',
|
||||||
videoAdvertising: 'Video advertising',
|
videoAdvertising: 'Video advertising',
|
||||||
searchEngines: 'Search engines',
|
searchEngines: 'Search engines',
|
||||||
weeklyUserActivity: 'Weekly user activity',
|
weeklyUserActivity: 'The number of live-streamers in Jianlian',
|
||||||
|
weeklyUserActivityDesc: 'The number of Jianlian big brothers',
|
||||||
activeQuantity: 'Active quantity',
|
activeQuantity: 'Active quantity',
|
||||||
alreadyJianlian:'Already alliance',
|
alreadyJianlian: 'Already alliance',
|
||||||
noAlliance:'No alliance',
|
noAlliance: 'No alliance',
|
||||||
monday: 'Monday',
|
monday: 'Monday',
|
||||||
tuesday: 'Tuesday',
|
tuesday: 'Tuesday',
|
||||||
wednesday: 'Wednesday',
|
wednesday: 'Wednesday',
|
||||||
@@ -431,7 +432,7 @@ export default {
|
|||||||
man: 'Man',
|
man: 'Man',
|
||||||
woman: 'Woman',
|
woman: 'Woman',
|
||||||
createTime: 'Created Date',
|
createTime: 'Created Date',
|
||||||
updateTime: 'Update Time',
|
updateTime: 'Update Time'
|
||||||
},
|
},
|
||||||
info: {
|
info: {
|
||||||
title: 'Basic Information',
|
title: 'Basic Information',
|
||||||
@@ -488,8 +489,8 @@ export default {
|
|||||||
placeHostsKind: 'Please enter live type, e.g., game',
|
placeHostsKind: 'Please enter live type, e.g., game',
|
||||||
isAssigned: 'Assigned',
|
isAssigned: 'Assigned',
|
||||||
aiOperation: 'Ai Operation',
|
aiOperation: 'Ai Operation',
|
||||||
sortType:'Sort Type',
|
sortType: 'Sort Type',
|
||||||
sortName:'Sort Name',
|
sortName: 'Sort Name',
|
||||||
placeIsAssigned: 'Please select assignment status',
|
placeIsAssigned: 'Please select assignment status',
|
||||||
placeaiOperation: 'Please select Ai operation',
|
placeaiOperation: 'Please select Ai operation',
|
||||||
createTime: 'Created Time',
|
createTime: 'Created Time',
|
||||||
@@ -509,9 +510,9 @@ export default {
|
|||||||
edit: 'Edit',
|
edit: 'Edit',
|
||||||
delete: 'Del',
|
delete: 'Del',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
confirm: 'Confirm',
|
confirm: 'Confirm'
|
||||||
},
|
},
|
||||||
employee:{
|
employee: {
|
||||||
hostsId: 'Host ID',
|
hostsId: 'Host ID',
|
||||||
placeHostId: 'Please enter host ID',
|
placeHostId: 'Please enter host ID',
|
||||||
hostsLevel: 'Host Level',
|
hostsLevel: 'Host Level',
|
||||||
@@ -550,11 +551,10 @@ export default {
|
|||||||
primaryKey: 'ID',
|
primaryKey: 'ID',
|
||||||
action: 'Action',
|
action: 'Action',
|
||||||
remark: 'Remark',
|
remark: 'Remark',
|
||||||
flag:'Flag',
|
flag: 'Flag',
|
||||||
loadNext:'Next',
|
loadNext: 'Next',
|
||||||
previous: 'Previous',
|
previous: 'Previous',
|
||||||
updateTime: 'Update Time',
|
updateTime: 'Update Time'
|
||||||
|
|
||||||
},
|
},
|
||||||
country: {
|
country: {
|
||||||
greece: 'Greece Region',
|
greece: 'Greece Region',
|
||||||
@@ -591,23 +591,21 @@ export default {
|
|||||||
onlineFans: 'Online Fans',
|
onlineFans: 'Online Fans',
|
||||||
fllowernum: 'Followers',
|
fllowernum: 'Followers',
|
||||||
updateTime: 'Update Time'
|
updateTime: 'Update Time'
|
||||||
|
|
||||||
},
|
},
|
||||||
hostsInvitationType:{
|
hostsInvitationType: {
|
||||||
eliteTicket:'elite ticket',
|
eliteTicket: 'elite ticket',
|
||||||
regularTicket:'regular ticket',
|
regularTicket: 'regular ticket'
|
||||||
|
|
||||||
},
|
},
|
||||||
Assigned:{
|
Assigned: {
|
||||||
yes:'yes',
|
yes: 'yes',
|
||||||
no: 'no'
|
no: 'no'
|
||||||
},
|
},
|
||||||
sortState:{
|
sortState: {
|
||||||
asc: 'asc',
|
asc: 'asc',
|
||||||
desc: 'desc'
|
desc: 'desc'
|
||||||
},
|
},
|
||||||
operational:{
|
operational: {
|
||||||
contact: 'contact',
|
contact: 'contact',
|
||||||
noContact: 'noContact',
|
noContact: 'noContact'
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { BigBrotherApi } from "@/api/server/bigbrother";
|
import { BigBrotherApi } from '@/api/server/bigbrother'
|
||||||
import Search from "@/components/Search/src/Search.vue";
|
import Search from '@/components/Search/src/Search.vue'
|
||||||
import { max } from "lodash-es";
|
import { max } from 'lodash-es'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
common: {
|
common: {
|
||||||
@@ -59,8 +59,7 @@ export default {
|
|||||||
copy: '复制',
|
copy: '复制',
|
||||||
copySuccess: '复制成功',
|
copySuccess: '复制成功',
|
||||||
copyError: '复制失败',
|
copyError: '复制失败',
|
||||||
perPage: '每页',
|
perPage: '每页'
|
||||||
|
|
||||||
},
|
},
|
||||||
lock: {
|
lock: {
|
||||||
lockScreen: '锁定屏幕',
|
lockScreen: '锁定屏幕',
|
||||||
@@ -172,8 +171,7 @@ export default {
|
|||||||
BigBrotherManage: '大哥管理',
|
BigBrotherManage: '大哥管理',
|
||||||
BigBrotherDataManage: '大哥数据管理(管理)',
|
BigBrotherDataManage: '大哥数据管理(管理)',
|
||||||
BigBrotherList: '大哥列表(员工)',
|
BigBrotherList: '大哥列表(员工)',
|
||||||
staffBigBrotherManage: '员工大哥管理(管理)',
|
staffBigBrotherManage: '员工大哥管理(管理)'
|
||||||
|
|
||||||
},
|
},
|
||||||
analysis: {
|
analysis: {
|
||||||
newUser: '新增用户',
|
newUser: '新增用户',
|
||||||
@@ -201,10 +199,11 @@ export default {
|
|||||||
allianceAdvertising: '联盟广告',
|
allianceAdvertising: '联盟广告',
|
||||||
videoAdvertising: '视频广告',
|
videoAdvertising: '视频广告',
|
||||||
searchEngines: '搜索引擎',
|
searchEngines: '搜索引擎',
|
||||||
weeklyUserActivity: '当日建联数',
|
weeklyUserActivity: '建联主播数',
|
||||||
|
weeklyUserActivityDesc: '建联大哥数',
|
||||||
activeQuantity: '建联数',
|
activeQuantity: '建联数',
|
||||||
alreadyJianlian:'已建联',
|
alreadyJianlian: '已建联',
|
||||||
noAlliance:'未建联',
|
noAlliance: '未建联',
|
||||||
monday: '周一',
|
monday: '周一',
|
||||||
tuesday: '周二',
|
tuesday: '周二',
|
||||||
wednesday: '周三',
|
wednesday: '周三',
|
||||||
@@ -488,8 +487,8 @@ export default {
|
|||||||
placeHostsKind: '请输入直播类型 如:游戏 ',
|
placeHostsKind: '请输入直播类型 如:游戏 ',
|
||||||
isAssigned: '是否分配',
|
isAssigned: '是否分配',
|
||||||
aiOperation: '是否AI介入',
|
aiOperation: '是否AI介入',
|
||||||
sortType:'排序类型',
|
sortType: '排序类型',
|
||||||
sortName:'排序名字',
|
sortName: '排序名字',
|
||||||
placeIsAssigned: '请选择是否已经分配给员工',
|
placeIsAssigned: '请选择是否已经分配给员工',
|
||||||
placeaiOperation: '请筛选是否AI介入',
|
placeaiOperation: '请筛选是否AI介入',
|
||||||
createTime: '创建时间',
|
createTime: '创建时间',
|
||||||
@@ -509,9 +508,9 @@ export default {
|
|||||||
edit: '编辑',
|
edit: '编辑',
|
||||||
delete: '删除',
|
delete: '删除',
|
||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
confirm: '确定',
|
confirm: '确定'
|
||||||
},
|
},
|
||||||
employee:{
|
employee: {
|
||||||
hostsId: '主播id',
|
hostsId: '主播id',
|
||||||
placeHostId: '请输入主播id',
|
placeHostId: '请输入主播id',
|
||||||
hostsLevel: '主播等级',
|
hostsLevel: '主播等级',
|
||||||
@@ -552,8 +551,8 @@ export default {
|
|||||||
action: '操作',
|
action: '操作',
|
||||||
remark: '备注',
|
remark: '备注',
|
||||||
flag: '旗帜',
|
flag: '旗帜',
|
||||||
loadNext:'下一页',
|
loadNext: '下一页',
|
||||||
previous:'上一页',
|
previous: '上一页'
|
||||||
},
|
},
|
||||||
country: {
|
country: {
|
||||||
greece: '希腊大区',
|
greece: '希腊大区',
|
||||||
@@ -591,21 +590,21 @@ export default {
|
|||||||
fllowernum: '关注数',
|
fllowernum: '关注数',
|
||||||
updateTime: '更新时间'
|
updateTime: '更新时间'
|
||||||
},
|
},
|
||||||
hostsInvitationType:{
|
hostsInvitationType: {
|
||||||
eliteTicket:'金票',
|
eliteTicket: '金票',
|
||||||
regularTicket:'普票',
|
regularTicket: '普票'
|
||||||
},
|
},
|
||||||
Assigned:{
|
Assigned: {
|
||||||
yes:'是',
|
yes: '是',
|
||||||
no: '否'
|
no: '否'
|
||||||
},
|
},
|
||||||
sortState:{
|
sortState: {
|
||||||
asc: '升序',
|
asc: '升序',
|
||||||
desc: '降序'
|
desc: '降序'
|
||||||
},
|
},
|
||||||
operational:{
|
operational: {
|
||||||
contact: '转化',
|
contact: '转化',
|
||||||
noContact: '未转化',
|
noContact: '未转化'
|
||||||
},
|
},
|
||||||
'OAuth 2.0': 'OAuth 2.0' // 避免菜单名是 OAuth 2.0 时,一直 warn 报错
|
'OAuth 2.0': 'OAuth 2.0' // 避免菜单名是 OAuth 2.0 时,一直 warn 报错
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,13 +108,45 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-else :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
|
<el-col v-else :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
|
||||||
<el-card shadow="hover" class="mb-8px">
|
<el-card shadow="hover" class="mb-8px">
|
||||||
<div>当日建联数量</div>
|
<div>当日建联主播数量</div>
|
||||||
{{ HostsOperationNum }}
|
{{ HostsOperationNum }}
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 当日建联大哥数 -->
|
||||||
|
<el-card shadow="never" class="mt-8px">
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<el-row :gutter="20" justify="space-between">
|
||||||
|
<el-col
|
||||||
|
v-if="wsCache.get('roleRouters').find(item => item.id === 1)?.children.find(item => item.id === 100)"
|
||||||
|
:xl="20" :lg="20" :md="24" :sm="24" :xs="24">
|
||||||
|
<el-card shadow="hover" class="mb-8px">
|
||||||
|
<el-select style="width: 200px;" v-model="daysDsec" @change="updataDaysDsec">
|
||||||
|
<el-option :value="1" label="当日">当日</el-option>
|
||||||
|
|
||||||
|
<el-option :value="7" label="近7日">近7日</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<Echart style="width: 100%;" :options="barOptionsDataDsec" :height="280" />
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col v-else :xl="14" :lg="14" :md="24" :sm="24" :xs="24">
|
||||||
|
<el-card shadow="hover" class="mb-8px">
|
||||||
|
<div>当日建联大哥数量</div>
|
||||||
|
|
||||||
|
{{ HostsOperationNumDsec }}
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
|
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-8px">
|
||||||
<!-- 快捷入口 -->
|
<!-- 快捷入口 -->
|
||||||
@@ -177,7 +209,7 @@ import { formatTime } from '@/utils'
|
|||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
// import { useWatermark } from '@/hooks/web/useWatermark'
|
// import { useWatermark } from '@/hooks/web/useWatermark'
|
||||||
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
|
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types'
|
||||||
import { pieOptions, barOptions } from './echarts-data'
|
import { pieOptions, barOptions, bigbrotherbarOptions } from './echarts-data'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { getComplete, getEmployeeComplete } from '@/api/system/user'
|
import { getComplete, getEmployeeComplete } from '@/api/system/user'
|
||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
@@ -185,35 +217,61 @@ import { getSimpleUserListPage, getSimpleUserList } from '@/api/system/user'
|
|||||||
import { EmployeeHostsApi } from '@/api/server/employeehosts'
|
import { EmployeeHostsApi } from '@/api/server/employeehosts'
|
||||||
import { ref, reactive, onMounted, onActivated } from 'vue'
|
import { ref, reactive, onMounted, onActivated } from 'vue'
|
||||||
import WxMusic from '../mp/components/wx-music'
|
import WxMusic from '../mp/components/wx-music'
|
||||||
let HostsOperationNum = ref(0)
|
|
||||||
|
|
||||||
|
let HostsOperationNum = ref(0)//当日建联主播数量
|
||||||
|
|
||||||
|
let HostsOperationNumDsec = ref(0)//当日建联大哥数量
|
||||||
|
|
||||||
|
let days = ref(1)//当日
|
||||||
|
|
||||||
|
let daysDsec = ref(1)//当日
|
||||||
|
|
||||||
|
//初始
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getAllApi()
|
await getAllApi()
|
||||||
|
|
||||||
await getAllocationList()
|
await getAllocationList()
|
||||||
|
|
||||||
if (wsCache.get('roleRouters').find(item => item.id === 1)?.children.find(item => item.id === 100)) {
|
if (wsCache.get('roleRouters').find(item => item.id === 1)?.children.find(item => item.id === 100)) {
|
||||||
await fetchAllHostsCount(1)
|
await fetchAllHostsCount(1)
|
||||||
|
|
||||||
|
await fetchAllHostsCountDesc(1)
|
||||||
} else {
|
} else {
|
||||||
await fetchDailyHostsCount()
|
await fetchDailyHostsCount()
|
||||||
|
|
||||||
|
await fetchDailyHostsCountDesc()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
let days = ref(1)
|
|
||||||
// 每次页面“再次显示”时都会触发(前提:该路由组件被 keep-alive 缓存)
|
// 每次页面“再次显示”时都会触发(前提:该路由组件被 keep-alive 缓存)
|
||||||
onActivated(async () => {
|
onActivated(async () => {
|
||||||
await fetchDailyHostsCount()
|
await fetchDailyHostsCount()
|
||||||
|
|
||||||
|
await fetchDailyHostsCountDesc()
|
||||||
|
|
||||||
await fetchAllHostsCount(1)
|
await fetchAllHostsCount(1)
|
||||||
|
|
||||||
|
await fetchAllHostsCountDesc(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 天数切换
|
||||||
async function updataDays(val) {
|
async function updataDays(val) {
|
||||||
await fetchAllHostsCount(val)
|
await fetchAllHostsCount(val)
|
||||||
}
|
}
|
||||||
|
//大哥天数切换
|
||||||
|
async function updataDaysDsec(val: any) {
|
||||||
|
await fetchAllHostsCountDesc(val)
|
||||||
|
}
|
||||||
|
|
||||||
// import { useGlobalWebSocket } from '@/components/useGlobalWebSocket'
|
// import { useGlobalWebSocket } from '@/components/useGlobalWebSocket'
|
||||||
// let messageList = useGlobalWebSocket().messageList
|
// let messageList = useGlobalWebSocket().messageList
|
||||||
// console.log(messageList.value)
|
// console.log(messageList.value)
|
||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
|
|
||||||
let allocationUser = ref('') //选中的分配用户
|
let allocationUser = ref('') //选中的分配用户
|
||||||
|
|
||||||
let allocationUserList = ref([
|
let allocationUserList = ref([
|
||||||
{
|
{
|
||||||
label: '分配用户1',
|
label: '分配用户1',
|
||||||
@@ -229,14 +287,23 @@ defineOptions({ name: 'Index' })
|
|||||||
|
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
// const { open } = useGlobalWebSocket()
|
// const { open } = useGlobalWebSocket()
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
// const { setWatermark } = useWatermark()
|
// const { setWatermark } = useWatermark()
|
||||||
|
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
|
|
||||||
const avatar = userStore.getUser.avatar
|
const avatar = userStore.getUser.avatar
|
||||||
|
|
||||||
const username = userStore.getUser.nickname
|
const username = userStore.getUser.nickname
|
||||||
|
|
||||||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
||||||
|
|
||||||
// 获取统计数
|
// 获取统计数
|
||||||
let totalSate = reactive<WorkplaceTotal>({
|
let totalSate = reactive<WorkplaceTotal>({
|
||||||
project: 0,
|
project: 0,
|
||||||
@@ -244,6 +311,7 @@ let totalSate = reactive<WorkplaceTotal>({
|
|||||||
todo: 0
|
todo: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const getCount = async () => {
|
const getCount = async () => {
|
||||||
const data = {
|
const data = {
|
||||||
project: 40,
|
project: 40,
|
||||||
@@ -311,6 +379,7 @@ const getProject = async () => {
|
|||||||
|
|
||||||
// 获取通知公告
|
// 获取通知公告
|
||||||
let notice = reactive<Notice[]>([])
|
let notice = reactive<Notice[]>([])
|
||||||
|
|
||||||
const getNotice = async () => {
|
const getNotice = async () => {
|
||||||
const data = [
|
const data = [
|
||||||
// {
|
// {
|
||||||
@@ -383,14 +452,18 @@ const getShortcut = async () => {
|
|||||||
color: '#1a73e8'
|
color: '#1a73e8'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
shortcut = Object.assign(shortcut, data)
|
shortcut = Object.assign(shortcut, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户来源
|
// 用户来源
|
||||||
const getUserAccessSource = async (id) => {
|
const getUserAccessSource = async (id) => {
|
||||||
const res = id ? await getEmployeeComplete(id) : await getComplete()
|
const res = id ? await getEmployeeComplete(id) : await getComplete()
|
||||||
|
|
||||||
const completeData = res ?? { unfinishedNum: 0, finishedNum: 0 }
|
const completeData = res ?? { unfinishedNum: 0, finishedNum: 0 }
|
||||||
|
|
||||||
console.log('completeData', completeData)
|
console.log('completeData', completeData)
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
{ value: completeData.unfinishedNum, name: 'analysis.noAlliance' },
|
{ value: completeData.unfinishedNum, name: 'analysis.noAlliance' },
|
||||||
{ value: completeData.finishedNum, name: 'analysis.alreadyJianlian' },
|
{ value: completeData.finishedNum, name: 'analysis.alreadyJianlian' },
|
||||||
@@ -398,11 +471,13 @@ const getUserAccessSource = async (id) => {
|
|||||||
// { value: 135, name: 'analysis.videoAdvertising' },
|
// { value: 135, name: 'analysis.videoAdvertising' },
|
||||||
// { value: 1548, name: 'analysis.searchEngines' }
|
// { value: 1548, name: 'analysis.searchEngines' }
|
||||||
]
|
]
|
||||||
|
|
||||||
set(
|
set(
|
||||||
pieOptionsData,
|
pieOptionsData,
|
||||||
'legend.data',
|
'legend.data',
|
||||||
data.map((v) => t(v.name))
|
data.map((v) => t(v.name))
|
||||||
)
|
)
|
||||||
|
|
||||||
pieOptionsData!.series![0].data = data.map((v) => {
|
pieOptionsData!.series![0].data = data.map((v) => {
|
||||||
return {
|
return {
|
||||||
name: t(v.name),
|
name: t(v.name),
|
||||||
@@ -410,21 +485,30 @@ const getUserAccessSource = async (id) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
|
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption
|
||||||
|
|
||||||
|
const barOptionsDataDsec = reactive<EChartsOption>(bigbrotherbarOptions) as EChartsOption
|
||||||
|
|
||||||
type EmpBarItem = {
|
type EmpBarItem = {
|
||||||
userId: number
|
userId: number
|
||||||
finishedNum: number | null
|
finishedNum: number | null
|
||||||
totalNum: number | null
|
totalNum: number | null
|
||||||
unfinishedNum: number | null
|
unfinishedNum: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
// 传入希望展示的用户 id 列表 + 后端原始返回,补齐未返回的用户为 0
|
// 传入希望展示的用户 id 列表 + 后端原始返回,补齐未返回的用户为 0
|
||||||
function mergeZeroUsers(ids: number[], resList: EmpBarItem[]): EmpBarItem[] {
|
function mergeZeroUsers(ids: number[], resList: EmpBarItem[]): EmpBarItem[] {
|
||||||
const map = new Map<number, EmpBarItem>(resList.map(it => [it.userId, it]))
|
const map = new Map<number, EmpBarItem>(resList.map(it => [it.userId, it]))
|
||||||
|
|
||||||
return ids.map(id => {
|
return ids.map(id => {
|
||||||
const it = map.get(id)
|
const it = map.get(id)
|
||||||
|
|
||||||
const finished = it?.finishedNum ?? 0
|
const finished = it?.finishedNum ?? 0
|
||||||
|
|
||||||
// 未建联:优先用后端给的 unfinishedNum;若没有且提供了 totalNum,则用 totalNum - finished;否则 0
|
// 未建联:优先用后端给的 unfinishedNum;若没有且提供了 totalNum,则用 totalNum - finished;否则 0
|
||||||
const total = it?.totalNum ?? 0
|
const total = it?.totalNum ?? 0
|
||||||
|
|
||||||
const unfinished = it?.unfinishedNum ?? (it?.totalNum != null && it?.finishedNum != null
|
const unfinished = it?.unfinishedNum ?? (it?.totalNum != null && it?.finishedNum != null
|
||||||
? Math.max(Number(total) - Number(finished), 0)
|
? Math.max(Number(total) - Number(finished), 0)
|
||||||
: 0)
|
: 0)
|
||||||
@@ -437,23 +521,28 @@ function mergeZeroUsers(ids: number[], resList: EmpBarItem[]): EmpBarItem[] {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 把后端返回的数据渲染到柱状图
|
// 把后端返回的数据渲染到柱状图
|
||||||
function updateEmployeeBarChart(list: EmpBarItem[]) {
|
function updateEmployeeBarChart(list: EmpBarItem[]) {
|
||||||
// 建立 id -> 昵称 的映射
|
// 建立 id -> 昵称 的映射
|
||||||
const id2label = new Map(allocationUserList.value.map(u => [u.value, u.label]))
|
const id2label = new Map(allocationUserList.value.map(u => [u.value, u.label]))
|
||||||
|
|
||||||
const labels = list.map(it => id2label.get(it.userId) || String(it.userId))
|
const labels = list.map(it => id2label.get(it.userId) || String(it.userId))
|
||||||
|
|
||||||
const finished = list.map(it => it.finishedNum ?? 0)
|
const finished = list.map(it => it.finishedNum ?? 0)
|
||||||
|
|
||||||
const unfinished = list.map(it => it.unfinishedNum ?? 0)
|
const unfinished = list.map(it => it.unfinishedNum ?? 0)
|
||||||
|
|
||||||
// legend
|
// legend
|
||||||
const legendNames = []
|
const legendNames = []
|
||||||
|
|
||||||
set(barOptionsData, 'legend.data', legendNames)
|
set(barOptionsData, 'legend.data', legendNames)
|
||||||
|
|
||||||
set(barOptionsData, 'xAxis.data', labels)
|
set(barOptionsData, 'xAxis.data', labels)
|
||||||
|
|
||||||
// 1) 轴标签强制全部显示 + 不自动隐藏
|
// 1) 轴标签强制全部显示 + 不自动隐藏
|
||||||
set(barOptionsData, 'xAxis.axisLabel.interval', 0)
|
set(barOptionsData, 'xAxis.axisLabel.interval', 0)
|
||||||
|
|
||||||
set(barOptionsData, 'xAxis.axisLabel.hideOverlap', false)
|
set(barOptionsData, 'xAxis.axisLabel.hideOverlap', false)
|
||||||
|
|
||||||
// 2) 适当旋转,避免重叠(不想旋转可设为 0)
|
// 2) 适当旋转,避免重叠(不想旋转可设为 0)
|
||||||
@@ -461,9 +550,10 @@ function updateEmployeeBarChart(list: EmpBarItem[]) {
|
|||||||
|
|
||||||
// 3) 防止被裁剪:让 grid 预留标签空间
|
// 3) 防止被裁剪:让 grid 预留标签空间
|
||||||
set(barOptionsData, 'grid.containLabel', true)
|
set(barOptionsData, 'grid.containLabel', true)
|
||||||
set(barOptionsData, 'grid.bottom', 60) // 视情况调大/调小
|
|
||||||
set(barOptionsData, 'xAxis.axisTick.alignWithLabel', true)
|
|
||||||
|
|
||||||
|
set(barOptionsData, 'grid.bottom', 60) // 视情况调大/调小
|
||||||
|
|
||||||
|
set(barOptionsData, 'xAxis.axisTick.alignWithLabel', true)
|
||||||
|
|
||||||
set(barOptionsData, 'series', [
|
set(barOptionsData, 'series', [
|
||||||
{
|
{
|
||||||
@@ -478,17 +568,67 @@ function updateEmployeeBarChart(list: EmpBarItem[]) {
|
|||||||
// }
|
// }
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 周活跃量 大哥图表数据
|
||||||
|
function updateEmployeeBarChartDesc(lists: EmpBarItem[]) {
|
||||||
|
// 建立 id -> 昵称 的映射
|
||||||
|
const id2label = new Map(allocationUserList.value.map(u => [u.value, u.label]))
|
||||||
|
|
||||||
|
const labels = lists.map(it => id2label.get(it.userId) || String(it.userId))
|
||||||
|
|
||||||
|
const finished = lists.map(it => it.finishedNum ?? 0)
|
||||||
|
|
||||||
|
const unfinished = lists.map(it => it.unfinishedNum ?? 0)
|
||||||
|
|
||||||
|
// legend
|
||||||
|
const legendNames = []
|
||||||
|
|
||||||
|
set(barOptionsDataDsec, 'legend.data', legendNames)
|
||||||
|
|
||||||
|
set(barOptionsDataDsec, 'xAxis.data', labels)
|
||||||
|
|
||||||
|
// 1) 轴标签强制全部显示 + 不自动隐藏
|
||||||
|
set(barOptionsDataDsec, 'xAxis.axisLabel.interval', 0)
|
||||||
|
|
||||||
|
set(barOptionsDataDsec, 'xAxis.axisLabel.hideOverlap', false)
|
||||||
|
|
||||||
|
// 2) 适当旋转,避免重叠(不想旋转可设为 0)
|
||||||
|
set(barOptionsDataDsec, 'xAxis.axisLabel.rotate', 30)
|
||||||
|
|
||||||
|
// 3) 防止被裁剪:让 grid 预留标签空间
|
||||||
|
set(barOptionsDataDsec, 'grid.containLabel', true)
|
||||||
|
|
||||||
|
set(barOptionsDataDsec, 'grid.bottom', 60) // 视情况调大/调小
|
||||||
|
|
||||||
|
set(barOptionsDataDsec, 'xAxis.axisTick.alignWithLabel', true)
|
||||||
|
|
||||||
|
set(barOptionsDataDsec, 'series', [
|
||||||
|
{
|
||||||
|
name: t('analysis.alreadyJianlian'),
|
||||||
|
type: 'bar',
|
||||||
|
data: finished
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: t('analysis.noAlliance'),
|
||||||
|
// type: 'bar',
|
||||||
|
// data: unfinished
|
||||||
|
// }
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
// 周活跃量 图表数据
|
// 周活跃量 图表数据
|
||||||
const getWeeklyUserActivity = async () => {
|
const getWeeklyUserActivity = async () => {
|
||||||
const data = [
|
const data = [
|
||||||
{ value: HostsOperationNum.value, name: 'analysis.monday' },
|
{ value: HostsOperationNum.value, name: 'analysis.monday' },
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
set(
|
set(
|
||||||
barOptionsData,
|
barOptionsData,
|
||||||
'xAxis.data',
|
'xAxis.data',
|
||||||
data.map((v) => t(v.name))
|
data.map((v) => t(v.name))
|
||||||
)
|
)
|
||||||
|
|
||||||
set(barOptionsData, 'series', [
|
set(barOptionsData, 'series', [
|
||||||
{
|
{
|
||||||
name: t('analysis.activeQuantity'),
|
name: t('analysis.activeQuantity'),
|
||||||
@@ -507,6 +647,7 @@ const getAllApi = async () => {
|
|||||||
getUserAccessSource(null),
|
getUserAccessSource(null),
|
||||||
getWeeklyUserActivity()
|
getWeeklyUserActivity()
|
||||||
])
|
])
|
||||||
|
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -521,10 +662,14 @@ const handleShortcutClick = (url: string) => {
|
|||||||
/** 查询员工 */
|
/** 查询员工 */
|
||||||
const getAllocationList = async () => {
|
const getAllocationList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
allocationUserList.value = []
|
allocationUserList.value = []
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await getSimpleUserList()
|
const data = await getSimpleUserList()
|
||||||
|
|
||||||
console.log('data', data)
|
console.log('data', data)
|
||||||
|
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
if (wsCache.get('user').user.id == item.id) {
|
if (wsCache.get('user').user.id == item.id) {
|
||||||
|
|
||||||
@@ -534,9 +679,8 @@ const getAllocationList = async () => {
|
|||||||
value: item.id
|
value: item.id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(allocationUserList.value)
|
console.log(allocationUserList.value)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@@ -545,6 +689,7 @@ const getAllocationList = async () => {
|
|||||||
// 获取当前日期,格式为 YYYY-MM-DD
|
// 获取当前日期,格式为 YYYY-MM-DD
|
||||||
const getFormattedDate = () => {
|
const getFormattedDate = () => {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
|
|
||||||
return now.toISOString().split('T')[0] + ' 00:00:00'
|
return now.toISOString().split('T')[0] + ' 00:00:00'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,16 +702,30 @@ async function fetchDailyHostsCount() {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
updateTime: getFormattedDate()
|
updateTime: getFormattedDate()
|
||||||
})
|
})
|
||||||
|
|
||||||
HostsOperationNum.value = res.total ?? 0
|
HostsOperationNum.value = res.total ?? 0
|
||||||
// 如果柱状图依赖这个值,顺便刷新一次图表数据
|
// 如果柱状图依赖这个值,顺便刷新一次图表数据
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchDailyHostsCountDesc() {
|
||||||
|
const res = await EmployeeHostsApi.getEmployeeHostsPageDsec({
|
||||||
|
operationStatus: 1,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
updateTime: getFormattedDate()
|
||||||
|
})
|
||||||
|
|
||||||
|
HostsOperationNumDsec.value = res.finishedNum ?? 0
|
||||||
|
// 如果柱状图依赖这个值,顺便刷新一次图表数据
|
||||||
|
}
|
||||||
|
|
||||||
// ✅ 抽成函数:每天所有员工数量(用于多人柱状图)
|
// ✅ 抽成函数:每天所有员工数量(用于多人柱状图)
|
||||||
async function fetchAllHostsCount(val) {
|
async function fetchAllHostsCount(val) {
|
||||||
// 以“传入的用户 id”为准展示(顺序也按这里来)
|
// 以“传入的用户 id”为准展示(顺序也按这里来)
|
||||||
const ids = allocationUserList.value.map(item => item.value)
|
const ids = allocationUserList.value.map(item => item.value)
|
||||||
|
|
||||||
const res = await EmployeeHostsApi.employeeCompleteBarChart(ids, val)
|
const res = await EmployeeHostsApi.employeeCompleteBarChart(ids, val)
|
||||||
|
|
||||||
const rawList: EmpBarItem[] = Array.isArray(res) ? res : (res?.data ?? [])
|
const rawList: EmpBarItem[] = Array.isArray(res) ? res : (res?.data ?? [])
|
||||||
|
|
||||||
// 补齐后端未返回的用户为 0
|
// 补齐后端未返回的用户为 0
|
||||||
@@ -575,4 +734,23 @@ async function fetchAllHostsCount(val) {
|
|||||||
// 渲染
|
// 渲染
|
||||||
updateEmployeeBarChart(list)
|
updateEmployeeBarChart(list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchAllHostsCountDesc(val) {
|
||||||
|
// 以“传入的用户 id”为准展示(顺序也按这里来)
|
||||||
|
const idss = allocationUserList.value.map(item => item.value)
|
||||||
|
|
||||||
|
const ress = await EmployeeHostsApi.employeeCompleteBarChartDsec(idss, val)
|
||||||
|
|
||||||
|
console.log('fetchAllHostsCountDesc', ress);
|
||||||
|
|
||||||
|
const rawLists: EmpBarItem[] = Array.isArray(ress) ? ress : (ress?.data ?? [])
|
||||||
|
|
||||||
|
// 补齐后端未返回的用户为 0
|
||||||
|
const lists = mergeZeroUsers(idss, rawLists)
|
||||||
|
|
||||||
|
// 渲染
|
||||||
|
updateEmployeeBarChartDesc(lists)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -108,8 +108,6 @@ export const pieOptions: EChartsOption = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const barOptions: EChartsOption = {
|
export const barOptions: EChartsOption = {
|
||||||
title: {
|
title: {
|
||||||
text: t('analysis.weeklyUserActivity'),
|
text: t('analysis.weeklyUserActivity'),
|
||||||
@@ -152,6 +150,48 @@ export const barOptions: EChartsOption = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
export const bigbrotherbarOptions: EChartsOption = {
|
||||||
|
title: {
|
||||||
|
text: t('analysis.weeklyUserActivityDesc'),
|
||||||
|
left: 'center'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: 50,
|
||||||
|
right: 20,
|
||||||
|
bottom: 20
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: [
|
||||||
|
t('analysis.monday'),
|
||||||
|
t('analysis.tuesday'),
|
||||||
|
t('analysis.wednesday'),
|
||||||
|
t('analysis.thursday'),
|
||||||
|
t('analysis.friday'),
|
||||||
|
t('analysis.saturday'),
|
||||||
|
t('analysis.sunday')
|
||||||
|
],
|
||||||
|
axisTick: {
|
||||||
|
alignWithLabel: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: t('analysis.activeQuantity'),
|
||||||
|
data: [0, 0, 0, 0, 0, 0, 0],
|
||||||
|
type: 'bar'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export const radarOption: EChartsOption = {
|
export const radarOption: EChartsOption = {
|
||||||
legend: {
|
legend: {
|
||||||
|
|||||||
Reference in New Issue
Block a user