更新7日建联数
This commit is contained in:
@@ -35,8 +35,8 @@ export const EmployeeHostsApi = {
|
|||||||
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[]) => {
|
employeeCompleteBarChart: async (params: number[],days: number) => {
|
||||||
return await request.post({ url: `/server/employee-hosts/employeeCompleteBarChart`, data: params })
|
return await request.post({ url: `/server/employee-hosts/employeeCompleteBarChart`, data: {userId:params,days:days} })
|
||||||
},
|
},
|
||||||
// 查询管理员工分配主播分页
|
// 查询管理员工分配主播分页
|
||||||
getMeangeEmployeeHostsPage: async (params: any) => {
|
getMeangeEmployeeHostsPage: async (params: any) => {
|
||||||
|
|||||||
@@ -487,9 +487,11 @@ export default {
|
|||||||
hostsKind: 'Host Type',
|
hostsKind: 'Host Type',
|
||||||
placeHostsKind: 'Please enter live type, e.g., game',
|
placeHostsKind: 'Please enter live type, e.g., game',
|
||||||
isAssigned: 'Assigned',
|
isAssigned: 'Assigned',
|
||||||
|
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',
|
||||||
createTime: 'Created Time',
|
createTime: 'Created Time',
|
||||||
updateTime: 'Update Time',
|
updateTime: 'Update Time',
|
||||||
invitationType: 'Invitation Type',
|
invitationType: 'Invitation Type',
|
||||||
|
|||||||
@@ -487,9 +487,11 @@ export default {
|
|||||||
hostsKind: '主播类型',
|
hostsKind: '主播类型',
|
||||||
placeHostsKind: '请输入直播类型 如:游戏 ',
|
placeHostsKind: '请输入直播类型 如:游戏 ',
|
||||||
isAssigned: '是否分配',
|
isAssigned: '是否分配',
|
||||||
|
aiOperation: '是否AI介入',
|
||||||
sortType:'排序类型',
|
sortType:'排序类型',
|
||||||
sortName:'排序名字',
|
sortName:'排序名字',
|
||||||
placeIsAssigned: '请选择是否已经分配给员工',
|
placeIsAssigned: '请选择是否已经分配给员工',
|
||||||
|
placeaiOperation: '请筛选是否AI介入',
|
||||||
createTime: '创建时间',
|
createTime: '创建时间',
|
||||||
updateTime: '更新时间',
|
updateTime: '更新时间',
|
||||||
invitationType: '邀请类型',
|
invitationType: '邀请类型',
|
||||||
|
|||||||
@@ -94,10 +94,15 @@
|
|||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col
|
<el-col
|
||||||
v-if="wsCache.get('roleRouters').find(item => item.id === 1)?.children.find(item => item.id === 100)"
|
v-if="wsCache.get('roleRouters').find(item => item.id === 1)?.children.find(item => item.id === 100)"
|
||||||
:xl="14" :lg="20" :md="24" :sm="24" :xs="24">
|
:xl="20" :lg="20" :md="24" :sm="24" :xs="24">
|
||||||
<el-card shadow="hover" class="mb-8px">
|
<el-card shadow="hover" class="mb-8px">
|
||||||
|
<el-select style="width: 200px;" v-model="days" @change="updataDays">
|
||||||
|
<el-option :value="1" label="近1天">近1天</el-option>
|
||||||
|
<el-option :value="7" label="近7天">近7天</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
<el-skeleton :loading="loading" animated>
|
<el-skeleton :loading="loading" animated>
|
||||||
<Echart :options="barOptionsData" :height="280" />
|
<Echart style="width: 100%;" :options="barOptionsData" :height="280" />
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -179,12 +184,13 @@ import { useCache } from '@/hooks/web/useCache'
|
|||||||
import { getSimpleUserListPage, getSimpleUserList } from '@/api/system/user'
|
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'
|
||||||
let HostsOperationNum = ref(0)
|
let HostsOperationNum = ref(0)
|
||||||
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()
|
await fetchAllHostsCount(1)
|
||||||
} else {
|
} else {
|
||||||
await fetchDailyHostsCount()
|
await fetchDailyHostsCount()
|
||||||
}
|
}
|
||||||
@@ -193,12 +199,16 @@ onMounted(async () => {
|
|||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
let days = ref()
|
||||||
// 每次页面“再次显示”时都会触发(前提:该路由组件被 keep-alive 缓存)
|
// 每次页面“再次显示”时都会触发(前提:该路由组件被 keep-alive 缓存)
|
||||||
onActivated(async () => {
|
onActivated(async () => {
|
||||||
await fetchDailyHostsCount()
|
await fetchDailyHostsCount()
|
||||||
await fetchAllHostsCount()
|
await fetchAllHostsCount(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function updataDays(val) {
|
||||||
|
await fetchAllHostsCount(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)
|
||||||
@@ -552,11 +562,11 @@ async function fetchDailyHostsCount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 抽成函数:每天所有员工数量(用于多人柱状图)
|
// ✅ 抽成函数:每天所有员工数量(用于多人柱状图)
|
||||||
async function fetchAllHostsCount() {
|
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)
|
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
|
||||||
|
|||||||
@@ -100,6 +100,15 @@
|
|||||||
:label="t(dict.label)" :value="dict.value" />
|
:label="t(dict.label)" :value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item :label="t('newHosts.aiOperation')" prop="aiOperation">
|
||||||
|
<el-select v-model="queryParams.aiOperation" :placeholder="t('newHosts.placeaiOperation')" clearable
|
||||||
|
class="!w-240px">
|
||||||
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.INT_TRUE_FLASE)" :key="dict.value"
|
||||||
|
:label="t(dict.label)" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item :label="t('newHosts.createTime')" prop="createTime">
|
<el-form-item :label="t('newHosts.createTime')" prop="createTime">
|
||||||
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="date"
|
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="date"
|
||||||
class="!w-240px" />
|
class="!w-240px" />
|
||||||
@@ -331,6 +340,7 @@ const queryParams = reactive({
|
|||||||
country: undefined,
|
country: undefined,
|
||||||
hostsKind: undefined,
|
hostsKind: undefined,
|
||||||
isAssigned: undefined,
|
isAssigned: undefined,
|
||||||
|
aiOperation: undefined,
|
||||||
sortName: "createTime", //排序字段
|
sortName: "createTime", //排序字段
|
||||||
sort: 'desc', //排序方式
|
sort: 'desc', //排序方式
|
||||||
createTime: new Date().toISOString().split('T')[0] + ' 00:00:00',
|
createTime: new Date().toISOString().split('T')[0] + ' 00:00:00',
|
||||||
|
|||||||
Reference in New Issue
Block a user