update
parent
2c92275290
commit
0ec6a2acc7
|
|
@ -1374,3 +1374,7 @@ export async function fetchmoduleStatInternalPage(params?: any) {
|
||||||
export async function fetchPostList(params?: any) {
|
export async function fetchPostList(params?: any) {
|
||||||
return http.get(`/common/getPostList`, { params })
|
return http.get(`/common/getPostList`, { params })
|
||||||
}
|
}
|
||||||
|
// 内部足迹
|
||||||
|
export async function fetchInternalUserStat(params?: any) {
|
||||||
|
return http.get(`/moduleStat/internalUserStat`, { params })
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> 返回
|
<el-icon class="text-red"><ArrowLeftBold size="18" /></el-icon> 返回
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-tab-pane label="分类管理" name="first">
|
<el-tab-pane v-if="userCode" label="分类管理" name="first">
|
||||||
<div class="h-52px">
|
<div class="h-52px">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="userCode"
|
v-if="userCode"
|
||||||
|
|
@ -401,6 +401,7 @@ async function getTree() {
|
||||||
}
|
}
|
||||||
let cateIds = ref()
|
let cateIds = ref()
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
activeName.value = userCode ? 'first' : 'second'
|
||||||
cateIds.value = database.database.id
|
cateIds.value = database.database.id
|
||||||
// console.log(database.database.id)
|
// console.log(database.database.id)
|
||||||
if (database.database.id) {
|
if (database.database.id) {
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ const openUrl = async (url)=>{
|
||||||
const screenWidth = window.screen.width;
|
const screenWidth = window.screen.width;
|
||||||
const screenHeight = window.screen.height;
|
const screenHeight = window.screen.height;
|
||||||
window.open(url, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0)
|
window.open(url, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'!")
|
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'!")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,12 @@ import {
|
||||||
externalTimeStat,
|
externalTimeStat,
|
||||||
fetchmoduleStatExternalPage,
|
fetchmoduleStatExternalPage,
|
||||||
fetchPostList,
|
fetchPostList,
|
||||||
fetchmoduleStatInternalPage
|
fetchmoduleStatInternalPage,
|
||||||
|
fetchInternalUserStat,
|
||||||
|
deptTree as fetchDeptTree
|
||||||
} from '@/api/daikin/base'
|
} from '@/api/daikin/base'
|
||||||
import { formatDate } from '@/utils/format'
|
import { formatDate } from '@/utils/format'
|
||||||
import { Chart1 } from './indexData'
|
import { Chart1 } from './indexData'
|
||||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
import { NModal } from 'naive-ui'
|
import { NModal } from 'naive-ui'
|
||||||
const currentDate = new Date()
|
const currentDate = new Date()
|
||||||
|
|
@ -65,6 +66,68 @@ const outDetail = ref([])
|
||||||
const postId = ref<any>([])
|
const postId = ref<any>([])
|
||||||
const nickName = ref()
|
const nickName = ref()
|
||||||
const postList = ref<any>([])
|
const postList = ref<any>([])
|
||||||
|
const barOption = {
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
grid: {
|
||||||
|
top: 0,
|
||||||
|
left: 10,
|
||||||
|
right: 10,
|
||||||
|
bottom: 10,
|
||||||
|
containLabel: true
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
data: [],
|
||||||
|
type: 'category',
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // 隐藏原始的 x 轴标签
|
||||||
|
interval: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'value'
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'right',
|
||||||
|
// align: 'center',
|
||||||
|
color: '#333', // 标签文本颜色
|
||||||
|
fontSize: 12, // 标签文本字号
|
||||||
|
formatter: function (value: any) {
|
||||||
|
// console.log(value);
|
||||||
|
return value.name + ' ' + value.value
|
||||||
|
},
|
||||||
|
rotate: 0
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow'
|
||||||
|
},
|
||||||
|
formatter: function ([params]: any) {
|
||||||
|
const title = `<p>${params.name}</p>`
|
||||||
|
const colorDot =
|
||||||
|
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
|
||||||
|
params.color +
|
||||||
|
'"></span>'
|
||||||
|
return title + colorDot + params.value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: [],
|
||||||
|
type: 'bar',
|
||||||
|
sort: 'ascending',
|
||||||
|
itemStyle: {
|
||||||
|
color: function (params: any) {
|
||||||
|
// console.log("🚀 ~ file: index.vue:365 ~ params.dataIndex:", params.dataIndex,params.data)
|
||||||
|
return colorList[9 - params.dataIndex]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
const itemDataList = ref<any>([])
|
||||||
const getPostList = async () => {
|
const getPostList = async () => {
|
||||||
const res: any = await fetchPostList()
|
const res: any = await fetchPostList()
|
||||||
postList.value = res.data || []
|
postList.value = res.data || []
|
||||||
|
|
@ -122,16 +185,23 @@ const state = reactive<any>({
|
||||||
endTime: formatDate(value1.value[1]).substring(0, 10)
|
endTime: formatDate(value1.value[1]).substring(0, 10)
|
||||||
// timeType:1
|
// timeType:1
|
||||||
})
|
})
|
||||||
const dataList = ref()
|
const colorListObj = ref<any>({})
|
||||||
|
const dataList = ref([])
|
||||||
const getDat = async () => {
|
const getDat = async () => {
|
||||||
const { data } = await timeStat(state)
|
const { data } = await timeStat(state)
|
||||||
dataList.value = data
|
dataList.value = data
|
||||||
let xAxisData: any[] = []
|
let xAxisData: any[] = []
|
||||||
let siomesData: any[] = []
|
let siomesData: any[] = []
|
||||||
data.forEach((item: { moduleName: any; visitCount: any }) => {
|
data.forEach(
|
||||||
xAxisData.push(item.moduleName)
|
(
|
||||||
siomesData.push(item.visitCount)
|
item: { moduleName: any; visitCount: any; moduleCode: any },
|
||||||
})
|
i: number
|
||||||
|
) => {
|
||||||
|
xAxisData.push(item.moduleName)
|
||||||
|
siomesData.push(item.visitCount)
|
||||||
|
colorListObj.value[item.moduleCode] = colorList[i]
|
||||||
|
}
|
||||||
|
)
|
||||||
chartOption1.value = Chart1(xAxisData)
|
chartOption1.value = Chart1(xAxisData)
|
||||||
chartOption1.value.series[0] = {
|
chartOption1.value.series[0] = {
|
||||||
data: siomesData,
|
data: siomesData,
|
||||||
|
|
@ -142,6 +212,74 @@ const getDat = async () => {
|
||||||
},
|
},
|
||||||
type: 'bar'
|
type: 'bar'
|
||||||
}
|
}
|
||||||
|
getInternalUserStat(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const deptId = ref('')
|
||||||
|
let isLeaderFlag = 0
|
||||||
|
async function getInternalUserStat(
|
||||||
|
isLeader: number = 0,
|
||||||
|
flag: boolean = false
|
||||||
|
) {
|
||||||
|
if (!flag) {
|
||||||
|
pageInfo.currentPage = 1
|
||||||
|
pageInfo.pageSize = 10
|
||||||
|
}
|
||||||
|
const { currentPage, pageSize } = pageInfo
|
||||||
|
const { rows = [], total }: any = await fetchInternalUserStat({
|
||||||
|
...state,
|
||||||
|
pageNum: currentPage,
|
||||||
|
pageSize: pageSize,
|
||||||
|
isLeader,
|
||||||
|
deptId: deptId.value || ''
|
||||||
|
})
|
||||||
|
isLeaderFlag = isLeader
|
||||||
|
// console.log('🚀 ~ file: index.vue:211 ~ rows:', rows)
|
||||||
|
pageInfo.total = total
|
||||||
|
// 10-100 之间的随机数生产
|
||||||
|
const roundMath = (min: number, max: number) => {
|
||||||
|
return Math.round(Math.random() * (max - min) + min)
|
||||||
|
}
|
||||||
|
// barOption.yAxis.data = data.map((item: any) => item.moduleName)
|
||||||
|
itemDataList.value = rows.map((item: any, index: number) => {
|
||||||
|
let itemData: any = {
|
||||||
|
nickName: item.nickName,
|
||||||
|
userId: item.userId,
|
||||||
|
...barOption,
|
||||||
|
yAxis: {
|
||||||
|
data: item.moduleStatList.map((item: any) => item.moduleName).reverse(),
|
||||||
|
type: 'category',
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // 隐藏原始的 x 轴标签
|
||||||
|
interval: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
...{
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
data: item.moduleStatList
|
||||||
|
.map((item: any) => item.visitCount)
|
||||||
|
.reverse(),
|
||||||
|
// data: new Array(item.moduleStatList.length)
|
||||||
|
// .fill(0)
|
||||||
|
// .map(() => roundMath(10, 100)),
|
||||||
|
type: 'bar',
|
||||||
|
sort: 'descending', //ascending
|
||||||
|
itemStyle: {
|
||||||
|
color: function (params: any) {
|
||||||
|
// console.log('🚀 ~ file: index.vue:255 ~ params:', params)
|
||||||
|
return colorList[8 - params.dataIndex]
|
||||||
|
// return colorListObj.value[item.moduleCode] || '#8F97F8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemData.index = index + 1
|
||||||
|
itemData.sortNum = (currentPage - 1) * pageSize + index + 1
|
||||||
|
return itemData
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const externalList = ref<any>([])
|
const externalList = ref<any>([])
|
||||||
|
|
@ -297,75 +435,9 @@ const echartsItemColor = [
|
||||||
'#6f5553',
|
'#6f5553',
|
||||||
'#c14089'
|
'#c14089'
|
||||||
]
|
]
|
||||||
const barOption = {
|
|
||||||
width: '100%',
|
// console.log(Object.assign(barOption.series[0], { data: [120, 200, 150, 80, 70, 110, 130, 123, 50] }));
|
||||||
height: '100%',
|
|
||||||
grid: {
|
|
||||||
top: 0,
|
|
||||||
left: 10,
|
|
||||||
right: 5,
|
|
||||||
bottom: 10,
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
data: [
|
|
||||||
'Mon',
|
|
||||||
'Tue',
|
|
||||||
'Wed',
|
|
||||||
'Thu',
|
|
||||||
'Fri',
|
|
||||||
'Sat',
|
|
||||||
'Sun',
|
|
||||||
'hour',
|
|
||||||
'month',
|
|
||||||
'year'
|
|
||||||
],
|
|
||||||
axisLabel: {
|
|
||||||
show: false, // 隐藏原始的 x 轴标签
|
|
||||||
interval: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'value'
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'inside',
|
|
||||||
align: 'center',
|
|
||||||
color: '#333', // 标签文本颜色
|
|
||||||
fontSize: 14, // 标签文本字号
|
|
||||||
formatter: function (value: any) {
|
|
||||||
// console.log(value);
|
|
||||||
return value.name + ' ' + value.value
|
|
||||||
},
|
|
||||||
rotate: 0
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
type: 'shadow'
|
|
||||||
},
|
|
||||||
formatter: function ([params]: any) {
|
|
||||||
const title = `<p>${params.name}</p>`
|
|
||||||
const colorDot =
|
|
||||||
'<span style="display:inline-block;margin-right:5px;border-radius:50%;width:10px;height:10px;background-color:' +
|
|
||||||
params.color +
|
|
||||||
'"></span>'
|
|
||||||
return title + colorDot + params.value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
data: [120, 200, 150, 80, 70, 110, 130, 123, 50, 80],
|
|
||||||
type: 'bar',
|
|
||||||
itemStyle: {
|
|
||||||
color: function (params: any) {
|
|
||||||
return colorList[params.dataIndex]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
const showModal = ref(false)
|
const showModal = ref(false)
|
||||||
const setUserList = ref<any>([])
|
const setUserList = ref<any>([])
|
||||||
|
|
||||||
|
|
@ -382,7 +454,29 @@ const CloseThiss = (data?: boolean) => {
|
||||||
// setUserList.value = []
|
// setUserList.value = []
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDev = false
|
const sortArr = [
|
||||||
|
'1ST',
|
||||||
|
'2ND',
|
||||||
|
'3RD',
|
||||||
|
'4TH',
|
||||||
|
'5TH',
|
||||||
|
'6TH',
|
||||||
|
'7TH',
|
||||||
|
'8TH',
|
||||||
|
'9TH',
|
||||||
|
'10TH'
|
||||||
|
]
|
||||||
|
|
||||||
|
const treeData = ref([])
|
||||||
|
const getdeptTree = async () => {
|
||||||
|
const { data = [] }: any = await fetchDeptTree({})
|
||||||
|
treeData.value = data
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleChildChange = (data: any) => {
|
||||||
|
console.log('🚀 ~ file: index.vue:470 ~ data:', data)
|
||||||
|
}
|
||||||
|
getdeptTree()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -527,51 +621,73 @@ const isDev = false
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-30px">
|
<div class="mt-30px">
|
||||||
<div class="flex items-center" v-if="isDev">
|
<div class="flex items-center" v-if="isDev">
|
||||||
<span class="text-#000 mr-10px">模块: </span>
|
<span class="text-#000 mr-10px">部门: </span>
|
||||||
<el-select v-model="moduleCode" placeholder="选择模块" clearable>
|
<!-- <el-select v-model="moduleCode" placeholder="选择部门" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in externalList"
|
v-for="item in externalList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.moduleName"
|
:label="item.moduleName"
|
||||||
:value="item.moduleCode"
|
:value="item.moduleCode"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
|
<el-cascader
|
||||||
|
class="!w-380px"
|
||||||
|
v-model="deptId"
|
||||||
|
:options="treeData"
|
||||||
|
:props="{
|
||||||
|
expandTrigger: 'hover',
|
||||||
|
checkStrictly: true,
|
||||||
|
emitPath: false,
|
||||||
|
value: 'id'
|
||||||
|
}"
|
||||||
|
@change="handleChildChange"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
:icon="Search"
|
:icon="Search"
|
||||||
size="small"
|
size="small"
|
||||||
class="ml20px"
|
class="ml20px"
|
||||||
@click="handleClick({ paneName: activeName })"
|
@click="getInternalUserStat(0)"
|
||||||
>搜索</el-button
|
>搜索</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="warning"
|
||||||
:icon="Search"
|
:icon="Search"
|
||||||
size="small"
|
size="small"
|
||||||
class="ml20px"
|
class="!ml30px"
|
||||||
@click="showModal = true"
|
@click="getInternalUserStat(1)"
|
||||||
>部长以上人员足迹</el-button
|
>部长以上人员足迹</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="pb-14px" v-if="isDev">
|
<div class="pb-14px">
|
||||||
<div class="flex flex-wrap mb-30px">
|
<div class="flex flex-wrap mb-30px">
|
||||||
<div
|
<div
|
||||||
class="m-4 flex items-center justify-between w-45% h-full"
|
class="m-4 flex items-center justify-between w-45% h-full"
|
||||||
v-for="i in 10"
|
v-for="(item, i) in itemDataList"
|
||||||
:key="i"
|
:key="i"
|
||||||
>
|
>
|
||||||
<div class="flex items-center text-#000 text-22px">
|
<div class="flex items-center text-#000 text-18px">
|
||||||
<p class="text-bold text-40px">{{ i }}TH</p>
|
<p class="text-bold text-40px mr-15px w-80px">
|
||||||
|
{{ sortArr[item.sortNum - 1] || item.sortNum + 'TH' }}
|
||||||
|
</p>
|
||||||
<div class="mx-10px flex-col items-center">
|
<div class="mx-10px flex-col items-center">
|
||||||
<img src="@/views/extermal/images/zanwly2.png" alt="" />
|
<img
|
||||||
<p class="text-center mt-10">测试 {{ i }}</p>
|
v-if="i % 2 == 0"
|
||||||
|
class="rounded-md h-150px object-contain"
|
||||||
|
src="@/views/home/images/nan.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
class="rounded-md h-150px object-contain"
|
||||||
|
src="@/views/home/images/nv.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<p class="text-center mt-20px">{{ item.nickName }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<VChart
|
<VChart class="h-300px w-65% ml-auto" :option="item" />
|
||||||
class="h-300px w-65% pb-10px ml-auto"
|
|
||||||
key="yyy1"
|
|
||||||
:option="barOption"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="absolute bottom-2px right-30px z-20 bg-#fff">
|
<div class="absolute bottom-2px right-30px z-20 bg-#fff">
|
||||||
|
|
@ -580,8 +696,8 @@ const isDev = false
|
||||||
v-model:page-size="pageInfo.pageSize"
|
v-model:page-size="pageInfo.pageSize"
|
||||||
layout="prev, pager, next, jumper"
|
layout="prev, pager, next, jumper"
|
||||||
:total="pageInfo.total"
|
:total="pageInfo.total"
|
||||||
@size-change="getInsideListPage"
|
@size-change="getInternalUserStat(isLeaderFlag, true)"
|
||||||
@current-change="getInsideListPage"
|
@current-change="getInternalUserStat(isLeaderFlag, true)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -606,7 +722,11 @@ const isDev = false
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
'font-size': '24px'
|
'font-size': '24px'
|
||||||
}"
|
}"
|
||||||
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
|
:cell-style="{
|
||||||
|
'text-align': 'center',
|
||||||
|
'overflow-y': 'auto',
|
||||||
|
height: '60px'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column prop="moduleName" label="模块名称" />
|
<el-table-column prop="moduleName" label="模块名称" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -662,7 +782,11 @@ const isDev = false
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
'font-size': '24px'
|
'font-size': '24px'
|
||||||
}"
|
}"
|
||||||
:cell-style="{ 'text-align': 'center', 'overflow-y': 'auto' }"
|
:cell-style="{
|
||||||
|
'text-align': 'center',
|
||||||
|
'overflow-y': 'auto',
|
||||||
|
height: '60px'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="title"
|
prop="title"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue