diff --git a/src/api/daikin/base.ts b/src/api/daikin/base.ts index f0e76c1..8a3c5a3 100755 --- a/src/api/daikin/base.ts +++ b/src/api/daikin/base.ts @@ -1374,3 +1374,7 @@ export async function fetchmoduleStatInternalPage(params?: any) { export async function fetchPostList(params?: any) { return http.get(`/common/getPostList`, { params }) } +// 内部足迹 +export async function fetchInternalUserStat(params?: any) { + return http.get(`/moduleStat/internalUserStat`, { params }) +} diff --git a/src/views/home/database/modify.vue b/src/views/home/database/modify.vue index 58fa941..6710f72 100755 --- a/src/views/home/database/modify.vue +++ b/src/views/home/database/modify.vue @@ -19,7 +19,7 @@ 返回 - +
{ + activeName.value = userCode ? 'first' : 'second' cateIds.value = database.database.id // console.log(database.database.id) if (database.database.id) { diff --git a/src/views/home/diffspace/Overview.vue b/src/views/home/diffspace/Overview.vue index edc8b13..bbd351b 100755 --- a/src/views/home/diffspace/Overview.vue +++ b/src/views/home/diffspace/Overview.vue @@ -188,7 +188,7 @@ const openUrl = async (url)=>{ const screenWidth = window.screen.width; const screenHeight = window.screen.height; window.open(url, '', 'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0) - } + } else{ message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'!") } diff --git a/src/views/home/footprint/index.vue b/src/views/home/footprint/index.vue index 4173c9b..6bc1e20 100755 --- a/src/views/home/footprint/index.vue +++ b/src/views/home/footprint/index.vue @@ -6,11 +6,12 @@ import { externalTimeStat, fetchmoduleStatExternalPage, fetchPostList, - fetchmoduleStatInternalPage + fetchmoduleStatInternalPage, + fetchInternalUserStat, + deptTree as fetchDeptTree } from '@/api/daikin/base' import { formatDate } from '@/utils/format' import { Chart1 } from './indexData' -import zhCn from 'element-plus/lib/locale/lang/zh-cn' import { Search } from '@element-plus/icons-vue' import { NModal } from 'naive-ui' const currentDate = new Date() @@ -65,6 +66,68 @@ const outDetail = ref([]) const postId = ref([]) const nickName = ref() const postList = ref([]) +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 = `

${params.name}

` + const colorDot = + '' + 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([]) const getPostList = async () => { const res: any = await fetchPostList() postList.value = res.data || [] @@ -122,16 +185,23 @@ const state = reactive({ endTime: formatDate(value1.value[1]).substring(0, 10) // timeType:1 }) -const dataList = ref() +const colorListObj = ref({}) +const dataList = ref([]) const getDat = async () => { const { data } = await timeStat(state) dataList.value = data let xAxisData: any[] = [] let siomesData: any[] = [] - data.forEach((item: { moduleName: any; visitCount: any }) => { - xAxisData.push(item.moduleName) - siomesData.push(item.visitCount) - }) + data.forEach( + ( + 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.series[0] = { data: siomesData, @@ -142,6 +212,74 @@ const getDat = async () => { }, 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([]) @@ -297,75 +435,9 @@ const echartsItemColor = [ '#6f5553', '#c14089' ] -const barOption = { - width: '100%', - 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 = `

${params.name}

` - const colorDot = - '' - 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] - } - } - } - ] -} + +// console.log(Object.assign(barOption.series[0], { data: [120, 200, 150, 80, 70, 110, 130, 123, 50] })); + const showModal = ref(false) const setUserList = ref([]) @@ -382,7 +454,29 @@ const CloseThiss = (data?: boolean) => { // 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()