diff --git a/src/views/home/footprint/index.vue b/src/views/home/footprint/index.vue index b4f3267..4173c9b 100755 --- a/src/views/home/footprint/index.vue +++ b/src/views/home/footprint/index.vue @@ -12,7 +12,7 @@ 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' +import { NModal } from 'naive-ui' const currentDate = new Date() const currentDates = new Date() const value1 = ref<[Date, Date]>([ @@ -36,6 +36,26 @@ const pageInfo = reactive({ pageSize: 10, total: 10 }) +const colorList: any = [ + '#2592F3', + '#EF8C43', + '#5FCBC5', + '#E5B625', + '#E74848', + '#8E97F8', + '#73ECA5', + '#E7CD3B', + '#E04E89', + '#4EA4E0', + '#C34EE0', + '#8BCF54', + '#56B1FD', + '#24BFBA', + '#44CF8C', + '#6266F8', + '#FA6B39', + '#F05F96' +] const moduleCode = ref() const imoduleCode = ref() const visitDay = ref() @@ -112,7 +132,16 @@ const getDat = async () => { xAxisData.push(item.moduleName) siomesData.push(item.visitCount) }) - chartOption1.value = Chart1(xAxisData, siomesData) + chartOption1.value = Chart1(xAxisData) + chartOption1.value.series[0] = { + data: siomesData, + itemStyle: { + color: function (params: any) { + return colorList[params.dataIndex] || '#8F97F8' + } + }, + type: 'bar' + } } const externalList = ref([]) @@ -123,17 +152,26 @@ const getExternalTimeStat = async () => { let xAxisData: any[] = [] let siomesData: any[] = [] data.forEach( - (item: { moduleName: any; visitCount: any; moduleCode: any }) => { + ( + item: { moduleName: any; visitCount: any; moduleCode: any }, + i: number + ) => { externalObj.value[item.moduleCode] = item.moduleName + externalObj.value[item.moduleCode + 'color'] = colorList[9 + i] xAxisData.push(item.moduleName) siomesData.push(item.visitCount) } ) - chartOption2.value = Chart1(xAxisData, siomesData) - console.log( - '🚀 ~ file: index.vue:131 ~ Chart1(xAxisData, siomesData):', - Chart1(xAxisData, siomesData) - ) + chartOption2.value = Chart1(xAxisData) + chartOption2.value.series[0] = { + data: siomesData, + itemStyle: { + color: function (params: any) { + return colorList[9 + params.dataIndex] || '#8F97F8' + } + }, + type: 'bar' + } // chartOption2.value.height=3000 // chartOption2.value.width=1000 } @@ -270,15 +308,26 @@ const barOption = { containLabel: true }, yAxis: { - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun','hour','month','year'], + data: [ + 'Mon', + 'Tue', + 'Wed', + 'Thu', + 'Fri', + 'Sat', + 'Sun', + 'hour', + 'month', + 'year' + ], axisLabel: { show: false, // 隐藏原始的 x 轴标签 - interval: 0, + interval: 0 } }, xAxis: { - type: 'value' - }, + type: 'value' + }, label: { show: true, position: 'inside', @@ -307,11 +356,11 @@ const barOption = { }, series: [ { - data: [120, 200, 150, 80, 70, 110, 130,123,50,80], + data: [120, 200, 150, 80, 70, 110, 130, 123, 50, 80], type: 'bar', itemStyle: { color: function (params: any) { - return echartsItemColor[params.dataIndex] + return colorList[params.dataIndex] } } } @@ -327,7 +376,6 @@ const handleChild = async (data: any) => { multipleSelection.value.forEach((i: { userId: any }) => { userIdList.push(i.userId) }) - console.log("🚀 ~ file: index.vue:328 ~ userIdList:", userIdList) } const CloseThiss = (data?: boolean) => { showModal.value = data || false @@ -449,9 +497,10 @@ const isDev = false
{{ i.moduleName }}
@@ -477,41 +526,37 @@ const isDev = false
-
- 模块: - - - - 搜索 - 部长以上人员足迹 -
+
+ 模块: + + + + 搜索 + 部长以上人员足迹 +
-
+
@@ -522,7 +567,11 @@ const isDev = false

测试 {{ i }}

- +
@@ -659,9 +708,10 @@ const isDev = false
{{ i.moduleName }}
@@ -678,21 +728,30 @@ const isDev = false
- - + +