Przeglądaj źródła

Merge branch 'master' of https://s-20coaj910c.zht2.com/cmy/data-marketing-platform into dev-ly

luoy 3 tygodni temu
rodzic
commit
27ed6b6d15

+ 1 - 0
package.json

@@ -24,6 +24,7 @@
 		"china-area-data": "^5.0.1",
 		"codemirror": "5.65.18",
 		"crypto-js": "4.2.0",
+		"dayjs": "^1.11.13",
 		"driver.js": "1.3.1",
 		"echarts": "5.5.1",
 		"element-plus": "2.8.7",

+ 9 - 0
src/api/marketing/statistics.ts

@@ -0,0 +1,9 @@
+import request from '/@/utils/request';
+
+export function pageList(query: object) {
+    return request({
+        url: 'https://m1.apifoxmock.com/m1/6687089-6396408-default/marketing/statistics/page',
+        method: 'get',
+        data: query,
+    });
+}

BIN
src/assets/avatar.png


BIN
src/assets/logo.png


+ 2 - 2
src/i18n/lang/en.ts

@@ -1,6 +1,6 @@
 export default {
 	router: {
-		home: 'Home',
+		home: 'Dashboard',
 		system: 'System',
 		systemMenu: 'System Menu',
 		systemRole: 'System Role',
@@ -92,7 +92,7 @@ export default {
 		dropdownLarge: 'Large',
 		dropdownDefault: 'Default',
 		dropdownSmall: 'Small',
-		dropdown1: 'Home Page',
+		dropdown1: 'Dashboard', // 'Home Page',
 		dropdown2: 'Personal Center',
 		dropdown5: 'Log Out',
 		searchPlaceholder: 'Menu Search: Supports Chinese and Routing Path',

+ 2 - 2
src/i18n/lang/zh-cn.ts

@@ -1,7 +1,7 @@
 // 定义内容
 export default {
 	router: {
-		home: '首页',
+		home: '仪表盘',
 		system: '系统设置',
 		systemMenu: '菜单管理',
 		systemRole: '角色管理',
@@ -85,7 +85,7 @@ export default {
 		dropdownLarge: '大型',
 		dropdownDefault: '默认',
 		dropdownSmall: '小型',
-		dropdown1: '首页',
+		dropdown1: '仪表盘',
 		dropdown2: '个人中心',
 		dropdown5: '退出登录',
 		searchPlaceholder: '菜单搜索:支持中文、路由路径',

+ 4 - 4
src/layout/logo/index.vue

@@ -1,15 +1,15 @@
 <template>
 	<div class="layout-logo" v-if="setShowLogo" @click="onThemeConfigChange">
-		<span>{{ themeConfig.globalTitle }}</span>
+		<img :src="logo" class="layout-logo-img" width="73px"/>
 	</div>
 	<div class="layout-logo-size" v-else @click="onThemeConfigChange">
-		<img :src="logoMini" class="layout-logo-size-img" />
+		<img :src="logo" class="layout-logo-size-img"/>
 	</div>
 </template>
 
 <script setup lang="ts" name="layoutLogo">
 import { useThemeConfig } from '/@/stores/themeConfig';
-import logoMini from '/@/assets/logo-mini.svg';
+import logo from '/@/assets/logo.png';
 
 // 定义变量内容
 const storesThemeConfig = useThemeConfig();
@@ -35,7 +35,7 @@ const onThemeConfigChange = () => {
 	align-items: center;
 	justify-content: center;
 	box-shadow: rgb(0 21 41 / 2%) 0px 1px 4px;
-	color: var(--el-color-primary);
+	color: var(--menu-bar-active-color);
 	font-size: 16px;
 	cursor: pointer;
 	animation: logoAnimation 0.3s ease-in-out;

+ 12 - 0
src/layout/navBars/breadcrumb/setings.vue

@@ -75,6 +75,12 @@
 						<el-color-picker v-model="getThemeConfig.menuBarActiveColor" show-alpha @change="onBgColorPickerChange('menuBarActiveColor')" />
 					</div>
 				</div>
+				<div class="layout-breadcrumb-seting-bar-flex">
+					<div class="layout-breadcrumb-seting-bar-flex-label">菜单高亮字体颜色</div>
+					<div class="layout-breadcrumb-seting-bar-flex-value">
+						<el-color-picker v-model="getThemeConfig.menuBarActiveFontColor" @change="onBgColorPickerChange('menuBarActiveFontColor')" />
+					</div>
+				</div>
 				<div class="layout-breadcrumb-seting-bar-flex mt14">
 					<div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('layout.twoIsMenuBarColorGradual') }}</div>
 					<div class="layout-breadcrumb-seting-bar-flex-value">
@@ -469,6 +475,12 @@ const onBgColorPickerChange = (bg: string) => {
 	if (bg === 'menuBar') {
 		document.documentElement.style.setProperty(`--next-bg-menuBar-light-1`, getLightColor(getThemeConfig.value.menuBar, 0.05));
 	}
+	if (bg === 'menuBarActiveFontColor') {
+		document.documentElement.style.setProperty(`--menu-bar-active-font-color`, themeConfig.value.menuBarActiveFontColor);
+	}
+	if (bg === 'menuBarActiveColor') {
+		document.documentElement.style.setProperty(`--menu-bar-active-color`, themeConfig.value.menuBarActiveColor);
+	}
 	onTopBarGradualChange();
 	onMenuBarGradualChange();
 	onColumnsMenuBarGradualChange();

+ 2 - 2
src/layout/navBars/breadcrumb/user.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="layout-navbars-breadcrumb-user pr15" :style="{ flex: layoutUserFlexNum }">
-		<el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
+		<!-- <el-dropdown :show-timeout="70" :hide-timeout="50" trigger="click" @command="onLanguageChange">
 			<div class="layout-navbars-breadcrumb-user-icon">
 				<i class="iconfont" :class="state.disabledI18n === 'en' ? 'icon-fuhao-yingwen' : 'icon-fuhao-zhongwen'" :title="$t('user.title1')"></i>
 			</div>
@@ -44,7 +44,7 @@
 				:title="state.isScreenfull ? $t('user.title6') : $t('user.title5')"
 				:class="!state.isScreenfull ? 'icon-fullscreen' : 'icon-tuichuquanping'"
 			></i>
-		</div>
+		</div> -->
 		<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
 			<span class="layout-navbars-breadcrumb-user-link">
 				<img :src="baseURL + userInfos.user.avatar" class="layout-navbars-breadcrumb-user-link-photo mr5" />

+ 12 - 2
src/layout/navMenu/horizontal.vue

@@ -5,7 +5,9 @@
 				<template v-for="val in menuLists">
 					<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
 						<template #title>
-							<SvgIcon :name="val.meta.icon" />
+							<navIcon v-if="val.path == '/marketing'" :val=val style="margin-right: 8px;" />
+							<navIcon v-else-if="val.path == '/system'" :val=val style="margin-right: 8px;" />
+							<SvgIcon v-else :name="val.meta.icon" />
 							<span>{{ other.setMenuI18n(val) }}</span>
 						</template>
 						<SubItem :chil="val.children" />
@@ -13,7 +15,8 @@
 					<template v-else>
 						<el-menu-item :index="val.path" :key="val.path">
 							<template #title v-if="!val.meta.isLink || (val.meta.isLink && val.meta.isIframe)">
-								<SvgIcon :name="val.meta.icon" />
+								<navIcon v-if="val.path == '/home'" :val=val style="margin-right: 8px;" />
+								<SvgIcon v-else :name="val.meta.icon" />
 								{{ other.setMenuI18n(val) }}
 							</template>
 							<template #title v-else>
@@ -38,6 +41,7 @@ import other from '/@/utils/other';
 import mittBus from '/@/utils/mitt';
 
 // 引入组件
+const navIcon = defineAsyncComponent(() => import('/@/layout/navMenu/navIcon.vue'));
 const SubItem = defineAsyncComponent(() => import('/@/layout/navMenu/subItem.vue'));
 
 // 定义父组件传过来的值
@@ -49,6 +53,10 @@ const props = defineProps({
 	},
 });
 
+props.menuList.forEach((item) => {
+    console.log(JSON.stringify(item));
+})
+
 // 定义变量内容
 const elMenuHorizontalScrollRef = ref();
 const stores = useRoutesList();
@@ -148,6 +156,7 @@ onBeforeMount(() => {
 // 页面加载时
 onMounted(() => {
 	initElMenuOffsetLeft();
+	document.documentElement.style.setProperty('--menu-bar-active-font-color', themeConfig.value.menuBarActiveFontColor);
 });
 // 路由更新时
 onBeforeRouteUpdate((to) => {
@@ -157,6 +166,7 @@ onBeforeRouteUpdate((to) => {
 	if (layout === 'classic' && isClassicSplitMenu) {
 		mittBus.emit('setSendClassicChildren', setSendClassicChildren(to.path));
 	}
+	document.documentElement.style.setProperty('--menu-bar-active-font-color', themeConfig.value.menuBarActiveFontColor);
 });
 </script>
 

Plik diff jest za duży
+ 7 - 0
src/layout/navMenu/navIcon.vue


+ 2 - 0
src/layout/navMenu/vertical.vue

@@ -78,12 +78,14 @@ const onALinkClick = (val: RouteItem) => {
 // 页面加载时
 onMounted(() => {
 	state.defaultActive = setParentHighlight(route);
+	document.documentElement.style.setProperty('--menu-bar-active-font-color', themeConfig.value.menuBarActiveFontColor);
 });
 // 路由更新时
 onBeforeRouteUpdate((to) => {
 	state.defaultActive = setParentHighlight(to);
 	const clientWidth = document.body.clientWidth;
 	if (clientWidth < 1000) themeConfig.value.isCollapse = false;
+	document.documentElement.style.setProperty('--menu-bar-active-font-color', themeConfig.value.menuBarActiveFontColor);
 });
 // 设置菜单的收起/展开
 watch(

+ 8 - 6
src/stores/themeConfig.ts

@@ -23,9 +23,9 @@ export const useThemeConfig = defineStore('themeConfig', {
 			 * 顶栏设置
 			 */
 			// 默认顶栏导航背景颜色
-			topBar: '#ffffff',
+			topBar: '#167af0',
 			// 默认顶栏导航字体颜色
-			topBarColor: '#606266',
+			topBarColor: '#ffffff',
 			// 是否开启顶栏背景颜色渐变
 			isTopBarColorGradual: false,
 
@@ -33,11 +33,13 @@ export const useThemeConfig = defineStore('themeConfig', {
 			 * 菜单设置
 			 */
 			// 默认菜单导航背景颜色
-			menuBar: '#FFFFFF',
+			menuBar: '#167af0',
 			// 默认菜单导航字体颜色
-			menuBarColor: '#505968',
+			menuBarColor: '#ffffff',
 			// 默认菜单高亮背景色
-			menuBarActiveColor: 'rgba(242, 243, 245, 1)',
+			menuBarActiveColor: '#ffffff',
+			// 新增:默认菜单高亮字体颜色
+			menuBarActiveFontColor: '#167af0',
 			// 是否开启菜单背景颜色渐变
 			isMenuBarColorGradual: false,
 
@@ -122,7 +124,7 @@ export const useThemeConfig = defineStore('themeConfig', {
 			 * 中的 `initSetLayoutChange(设置布局切换,重置主题样式)` 方法
 			 */
 			// 布局切换:可选值"<defaults|classic|transverse|columns>",默认 defaults
-			layout: 'defaults',
+			layout: 'transverse',
 
 			/**
 			 * 后端控制路由

+ 55 - 0
src/theme/app.scss

@@ -335,3 +335,58 @@ body,
 		padding-left: #{$i}px !important;
 	}
 }
+
+/* 竖向 菜单 */
+.el-menu.el-menu--vertical {
+	.el-menu-item:hover,
+	.el-sub-menu.is-active>.el-sub-menu__title,
+	.el-menu-item.is-active {
+		background-color: var(--menu-bar-active-color) !important;
+		color: var(--menu-bar-active-font-color) !important;
+	}
+}
+
+/* 横向 菜单 */
+.el-menu.el-menu--horizontal {
+	.el-menu-item,
+	.el-sub-menu,
+	.el-sub-menu__title {
+		height: 48px;
+		border-bottom: 2px solid transparent !important;
+	}
+	.el-menu-item:hover,
+	.el-sub-menu:hover>.el-sub-menu__title,
+	.el-sub-menu.is-active>.el-sub-menu__title,
+	.el-menu-item.is-active {
+		height: 48px;
+		background-color: var(--menu-bar-active-color) !important;
+		color: var(--menu-bar-active-font-color) !important;
+		border-bottom: 2px solid var(--el-color-primary) !important;
+	}
+	/* 自定义菜单icon */
+	.el-menu-item svg,
+	.el-sub-menu svg {
+	    path {
+	        fill: #ffffff !important;
+		}
+	}
+	.el-menu-item.is-active svg,
+	.el-menu-item:hover svg,
+	.el-sub-menu.is-active svg,
+	.el-sub-menu:hover svg {
+	    path {
+	        fill: rgba(22, 122, 240, 1) !important;
+		}
+	}
+}
+
+/* 横向菜单下拉弹出层菜单项高亮字体颜色 */
+.el-popper .el-menu--horizontal>.el-menu {
+	.el-menu-item.is-active,
+	.el-menu-item:hover,
+	.el-sub-menu:hover>.el-sub-menu__title,
+	.el-sub-menu.is-opened>.el-sub-menu__title {
+		background-color: var(--menu-bar-active-color) !important;
+		color: var(--menu-bar-active-font-color) !important;
+	}
+}

+ 1 - 1
src/theme/element.scss

@@ -226,7 +226,7 @@
 
 	.el-menu-item,
 	.el-sub-menu__title {
-		height: 50px !important;
+		height: 48px !important;
 		color: var(--next-bg-topBarColor);
 	}
 

+ 1 - 0
src/types/pinia.d.ts

@@ -50,6 +50,7 @@ declare interface ThemeConfigState {
 		menuBar: string;
 		menuBarColor: string;
 		menuBarActiveColor: string;
+		menuBarActiveFontColor: string;
 		isMenuBarColorGradual: boolean;
 		columnsMenuBar: string;
 		columnsMenuBarColor: string;

+ 54 - 0
src/views/home/custom-panel.vue

@@ -0,0 +1,54 @@
+<template>
+  <el-card>
+    <div class="panel-top">
+      <div class="panel-name">{{prop.title}}</div>
+      <div class="cursor-pointer"  @click="$emit('reload')">
+        <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+          <path d="M16.7167 6.66667C15.4895 4.19712 12.9411 2.5 9.99637 2.5C7.05158 2.5 4.56062 4.19712 3.33337 6.66667" stroke="#ADBFD7" stroke-linecap="round"/>
+          <path d="M3.33337 3.33334V6.66667" stroke="#ADBFD7" stroke-linecap="round"/>
+          <path d="M6.15845 6.66666H3.33337" stroke="#ADBFD7" stroke-linecap="round"/>
+          <path d="M3.33337 13.3333C4.56062 15.8029 7.109 17.5 10.0538 17.5C12.9985 17.5 15.4895 15.8029 16.7167 13.3333" stroke="#ADBFD7" stroke-linecap="round"/>
+          <path d="M16.7167 16.6667V13.3333" stroke="#ADBFD7" stroke-linecap="round"/>
+          <path d="M13.8916 13.3333H16.7167" stroke="#ADBFD7" stroke-linecap="round"/>
+        </svg>
+      </div>
+    </div>
+    <slot></slot>
+  </el-card>
+</template>
+
+<script setup lang="ts" name="panel-top">
+const prop = defineProps({
+  title: {
+    type: String,
+    default: ''
+  }
+})
+</script>
+
+<style scoped lang="scss">
+.panel-top {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+.panel-name {
+  line-height: 22px;
+  font-family: Source Han Sans SC;
+  font-weight: 500;
+  font-size: 18px;
+  color: rgba(18, 18, 18, 1);
+  position: relative;
+  padding-left: 12px;
+  &::after {
+    content: '';
+    position: absolute;
+    left: 0;
+    top: 50%;
+    transform: translateY(-50%);
+    width: 4px;
+    height: 14px;
+    background-color: rgb(22, 122, 240, 1);
+  }
+}
+</style>

+ 134 - 0
src/views/home/echarts/keyword-frequency.vue

@@ -0,0 +1,134 @@
+<!-- 访客趋势图组件 -->
+<template>
+	<div class="visitor-trend">
+		<div ref="chartRef" style="width: 100%; height: 300px"></div>
+		<div style="position: absolute; top: 20px; right: 0">
+			<el-select v-model="value" style="width: 84px" @change="initChart">
+				<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+			</el-select>
+		</div>
+	</div>
+</template>
+
+<script setup lang="ts" name="keywordFrequency">
+import { ref, onMounted, onUnmounted, watch } from 'vue';
+import * as echarts from 'echarts';
+
+const chartData = ref([
+	{ name: '下载', value: 30, color: '#ff6384' },
+	{ name: '宅六', value: 10, color: '#4bc0c0' },
+
+	{ name: '张三', value: 20, color: '#36a2eb' },
+	{ name: '里斯', value: 25, color: '#cc65fe' },
+	{ name: '王五', value: 15, color: '#ffce56' },
+]);
+
+const value = ref('7');
+const options = [
+	{
+		value: '7',
+		label: '7天',
+		selected: true,
+	},
+	{
+		value: '30',
+		label: '30天',
+	},
+];
+
+const chartRef = ref(null);
+let chartInstance: echarts.ECharts | null = null;
+console.log(chartInstance);
+
+// 初始化图表
+const initChart = () => {
+	if (!chartRef.value) return;
+
+	// 销毁旧实例(如果存在)
+	if (chartInstance) {
+		chartInstance.dispose();
+	}
+
+	// 创建新实例
+	chartInstance = echarts.init(chartRef.value);
+	console.log(chartInstance);
+
+	// 处理数据
+	const scatterData = chartData.value.map((item) => ({
+		value: [Math.random() * 100, Math.random() * 100, 30 + Math.random() * 20],
+		itemStyle: { color: item.color },
+		name: `${item.name}\n${item.value}`,
+	}));
+
+	// 配置项
+	const option = {
+		tooltip: {
+			trigger: 'item',
+			formatter: '{b}',
+		},
+		grid: {
+            top: '40%',
+		},
+		xAxis: { show: false },
+		yAxis: { show: false },
+		series: [
+			{
+				type: 'scatter',
+				data: scatterData,
+				symbolSize: (value: any) => {
+					return Math.sqrt(value[2]) * 10; // 根据值计算气泡大小
+				},
+				label: {
+					show: true,
+					position: 'inside',
+					color: '#fff',
+					fontSize: 14,
+					formatter: '{b}',
+				},
+				emphasis: {
+					label: { show: true },
+				},
+			},
+		],
+	};
+
+	// 设置配置项
+	chartInstance.setOption(option);
+
+	// 添加响应式
+	window.addEventListener('resize', handleResize);
+};
+
+// 响应窗口大小变化
+const handleResize = () => {
+	if (chartInstance) {
+		chartInstance.resize();
+	}
+};
+
+// 生命周期钩子
+onMounted(() => {
+	initChart();
+});
+
+onUnmounted(() => {
+	if (chartInstance) {
+		window.removeEventListener('resize', handleResize);
+		chartInstance.dispose();
+		chartInstance = null;
+	}
+});
+</script>
+
+<style scoped lang="scss">
+.bubble-chart-container {
+	width: 465px;
+	height: 330px;
+	min-height: 330px;
+}
+
+.chart {
+	width: 100%;
+	height: 100%;
+}
+</style>    

+ 38 - 31
src/views/home/index.vue

@@ -1,35 +1,42 @@
 <template>
-  <div class="layout-padding">
-    <div class="layout-padding-auto layout-padding-view">
-      <splitpanes>
-        <pane size="70">
-          <splitpanes horizontal>
-            <pane size="25">
-              <current-user/>
-            </pane>
-            <pane size="75">
-              <favorite/>
-            </pane>
-          </splitpanes>
-        </pane>
-        <pane size="30">
-          <splitpanes horizontal>
-            <pane size="58">
-              <schedule/>
-            </pane>
-            <pane size="42">
-              <sys-log/>
-            </pane>
-          </splitpanes>
-        </pane>
-      </splitpanes>
-    </div>
-  </div>
+  <el-row :gutter="12" style="padding: 12px; row-gap: 12px;">
+    <el-col :xs="24" :sm="10" :md="8" :lg="6" :xl="5">
+      <userInfo />
+    </el-col>
+    <el-col :xs="24" :sm="24" :md="16" :lg="10" :xl="10">
+      <custom-panel :title="'访客趋势图'">
+        <visitor-trend />
+      </custom-panel>
+    </el-col>
+    <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="9">
+      <custom-panel :title="'引用域'">
+        <traffic-sources />
+      </custom-panel>
+    </el-col>
+    <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="9">
+      <custom-panel :title="'访客地图'">
+        <traffic-sources />
+      </custom-panel>
+    </el-col>
+    <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="9">
+      <custom-panel :title="'访客概览'">
+        <traffic-sources />
+      </custom-panel>
+    </el-col>
+    <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="9">
+      <custom-panel :title="'关键词频率'">
+        <keyword-frequency />
+      </custom-panel>
+    </el-col>
+  </el-row>
 </template>
 
 <script setup lang="ts" name="home">
-const CurrentUser = defineAsyncComponent(() => import('./current-user.vue'));
-const Favorite = defineAsyncComponent(() => import('./favorite.vue'));
-const Schedule = defineAsyncComponent(() => import('./schedule.vue'));
-const SysLog = defineAsyncComponent(() => import('./sys-log.vue'));
-</script>
+import { defineAsyncComponent,ref } from 'vue';
+
+const customPanel = defineAsyncComponent(() => import('./custom-panel.vue'));
+const userInfo = defineAsyncComponent(() => import('./user-info.vue'));
+const visitorTrend = defineAsyncComponent(() => import('./visitor-trend.vue'));
+const trafficSources = defineAsyncComponent(() => import('./traffic-sources.vue'));
+const keywordFrequency = defineAsyncComponent(() => import('./echarts/keyword-frequency.vue'));
+</script>

+ 142 - 0
src/views/home/traffic-sources.vue

@@ -0,0 +1,142 @@
+<!-- 引用域 -->
+<template>
+  <div class="visitor-trend">
+    <div ref="chartRef" style="width: 100%; height: 300px;"></div>
+    <div style="position: absolute;top: 20px;right: 0;">
+      <el-select v-model="value" style="width: 84px;">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+      </el-select>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { ref, onMounted, onBeforeUnmount } from 'vue';
+import * as echarts from 'echarts';
+
+const value = ref('7');
+const options = [
+  {
+    value: '7',
+    label: '7天',
+    selected: true,
+  },
+  {
+    value: '30',
+    label: '30天',
+  },
+]
+
+const chartRef = ref(null);
+let chartInstance = null;
+
+// 生成随机数据
+const generateRandomData = () => {
+  const categories = Array.from({ length: 6 }, (_, i) => i + 1);
+  return categories.map(item => ({
+    y: '192.168.3.' + item,
+    x: Math.floor(Math.random() * 10000) + 1 // 生成1-100的随机数
+  }));
+};
+
+// 初始化图表
+const initChart = () => {
+  if (chartInstance) {
+    chartInstance.dispose();
+  }
+  
+  chartInstance = echarts.init(chartRef.value);
+  const data = generateRandomData();
+  
+  const option = {
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      },
+      formatter: '{b}[{c}]'
+    },
+    grid: {
+      left: '0%',
+      right: '5%',
+      bottom: '0%',
+      containLabel: true,
+    },
+    xAxis: {
+      type: 'value',
+      boundaryGap: [0, 0.01],
+      axisLabel: {
+        color: 'rgba(100, 100, 100, 1)',
+      },
+      axisLine: {
+        lineStyle: {
+          color: '#999'
+        }
+      },
+      splitLine: {
+        lineStyle: {
+          color: 'rgba(230, 230, 230, 1)',
+          type: 'dashed',
+        }
+      }
+    },
+    yAxis: {
+      type: 'category',
+      data: data.map(item => item.y),
+      axisLabel: {
+        color: 'rgba(100, 100, 100, 1)',
+        formatter: function(value) {
+          return value.match(/.{1,15}/g).join('\n');;
+        }
+      },
+      axisLine: {
+        lineStyle: {
+          color: 'rgba(230, 230, 230, 1)',
+        }
+      },
+      axisTick: {
+        alignWithLabel: true,
+        show: false,
+      }
+    },
+    series: [
+      {
+        name: '数值',
+        type: 'bar',
+        data: data.map(item => item.x),
+        itemStyle: {
+          color: 'rgba(22, 122, 240, 1)',
+          borderRadius: [0, 8, 8, 0] // 右上和右下圆角
+        },
+        barWidth: '16',
+        label: {
+          show: false,
+          // position: 'right',
+          // formatter: '{c}'
+        }
+      }
+    ]
+  };
+  
+  chartInstance.setOption(option);
+  
+  // 响应式调整
+  window.addEventListener('resize', () => {
+    chartInstance.resize();
+  });
+};
+
+onMounted(() => {
+  initChart();
+});
+
+onBeforeUnmount(() => {
+  if (chartInstance) {
+    window.removeEventListener('resize', () => {
+      chartInstance.resize();
+    });
+    chartInstance.dispose();
+  }
+});
+
+</script>

+ 167 - 0
src/views/home/user-info.vue

@@ -0,0 +1,167 @@
+<template>
+  <div class="user-info">
+    <el-card>
+      <div class="flex" style="height: 226px; ">
+        <el-avatar :size="100" style="margin-top: 8px;" :src="user.avatar" @error="errorHandler">
+          <img :src="user.avatar" />
+        </el-avatar>
+        <div class="detail">
+          <div class="nickname">{{ user.nickname }}</div>
+          <div class="username">@{{ user.username }}</div>
+          <div class="email">{{ user.email }}</div>
+          <div class="postName">{{ user.postList[0].postName }}</div>
+          <div class="dept">
+            <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+              <g clip-path="url(#clip0_1_110)">
+                <path d="M5.25 3.25L2.75 5V11" stroke="#167AF0" stroke-linecap="round" stroke-linejoin="round" />
+                <path fill-rule="evenodd" clip-rule="evenodd" d="M5.25 1L7.75 2.75V6L9.5 7.25V11H5.25V1Z"
+                  stroke="#167AF0" stroke-linecap="round" stroke-linejoin="round" />
+                <path d="M1 11H11" stroke="#167AF0" stroke-linecap="round" stroke-linejoin="round" />
+              </g>
+              <defs>
+                <clipPath id="clip0_1_110">
+                  <rect width="12" height="12" fill="white" />
+                </clipPath>
+              </defs>
+            </svg>
+            {{ user.dept.name }}
+          </div>
+        </div>
+      </div>
+      <div class="task-list">
+        <div class="task-item">
+          <div class="task-title">代办任务</div>
+          <div class="task-num">0</div>
+          <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
+            <path d="M3.125 11.875H26.875V25.625C26.875 26.3154 26.3154 26.875 25.625 26.875H4.375C3.68464 26.875 3.125 26.3154 3.125 25.625V11.875Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
+            <path d="M3.125 6.25C3.125 5.55964 3.68464 5 4.375 5H25.625C26.3154 5 26.875 5.55964 26.875 6.25V11.875H3.125V6.25Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
+            <path d="M10 19.375L13.75 23.125L21.25 15.625" stroke="#167AF0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+            <path d="M10 3.125V8.125" stroke="#167AF0" stroke-width="2" stroke-linecap="round"/>
+            <path d="M20 3.125V8.125" stroke="#167AF0" stroke-width="2" stroke-linecap="round"/>
+          </svg>
+        </div>
+        <div class="task-item">
+          <div class="task-title">抄送任务</div>
+          <div class="task-num">0</div>
+          <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
+            <path d="M26.875 3.125L18.5625 26.875L13.8125 16.1875L3.125 11.4375L26.875 3.125Z" stroke="#167AF0" stroke-width="2" stroke-linejoin="round"/>
+            <path d="M26.8751 3.125L13.8126 16.1875" stroke="#167AF0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
+          </svg>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script setup lang="ts">
+const errorHandler = () => {
+  return './src/assets/avatar.png'
+}
+const postName = computed(() => {
+  return user.postList?.forEach((item: any) => {
+    return item.postName
+  })?.join('|')
+})
+
+const user = {
+  "userId": "1",
+  "username": "admin",
+  "avatar": "/admin/sys-file/s3demo/063a1ea1f6714226851de23f1329672b.png",
+  "dept": {
+    "deptId": "4",
+    "name": "销售部",
+  },
+  "postList": [
+    {
+      "postName": "CTO",
+    }
+  ],
+  "nickname": "管理员",
+  "name": "管理员",
+  "email": "[email protected]"
+}
+</script>
+<style scoped lang="scss">
+.user-info {
+  .flex {
+    padding-top: 44px;
+    display: flex;
+    justify-content: center;
+    box-sizing: border-box;
+
+    .detail {
+      .nickname {
+        font-size: 20px;
+        font-weight: 600;
+      }
+
+      .username {
+        font-size: 12px;
+        line-height: 14px;
+        color: rgba(136, 136, 136, 1);
+        margin-top: 8px;
+      }
+
+      .email {
+        font-size: 12px;
+        line-height: 14px;
+        color: rgba(136, 136, 136, 1);
+        margin-top: 8px;
+      }
+
+      .postName {
+        display: inline-block;
+        font-size: 12px;
+        line-height: 14px;
+        color: rgba(136, 136, 136, 1);
+        margin-top: 8px;
+        border: 1px solid rgba(22, 122, 240, 1);
+        line-height: 20px;
+        border-width: 1px;
+        border-radius: 4px;
+        font-family: Source Han Sans SC;
+        font-size: 11px;
+        color: rgba(22, 122, 240, 1);
+        padding: 0 4px;
+      }
+
+      .dept {
+        font-size: 12px;
+        line-height: 14px;
+        color: rgba(136, 136, 136, 1);
+        margin-top: 8px;
+      }
+    }
+  }
+
+  .task-list {
+    height: 140px; 
+    padding-top: 60px; 
+    width: 100%; 
+    max-width: 280px;
+    margin: 0 auto; 
+    display: flex; 
+    justify-content: space-between; 
+    border-top: 1px solid rgba(230, 230, 230, 1);
+    .task-item {
+      position: relative;
+      padding-left: 42px;
+      svg {
+        position: absolute;
+        left: 0;
+        top: 0;
+      }
+    }
+    .task-title {
+      line-height: 17px;
+      color: rgba(100, 100, 100, 1);
+      font-size: 14px;
+    }
+    .task-num {
+      font-size: 18px;
+      line-height: 22px;
+      color: rgba(18, 18, 18, 1);
+    }
+  }
+}
+</style>

+ 39 - 0
src/views/home/visitor-overview.vue

@@ -0,0 +1,39 @@
+<!-- 
+UserInfoPanel 或 UserProfileCard
+显示当前用户的基本信息和权限
+
+访客趋势图组件
+VisitorTrendChart 或 TrafficTrendGraph
+展示访客数量随时间变化的折线图/面积图
+
+引用域组件
+ReferralDomainsTable 或 TrafficSourcesPanel
+显示流量来源域名的列表和占比
+
+访客地图组件
+VisitorMap 或 GeoTrackingMap
+地理分布可视化的地图组件
+
+访客概览组件
+VisitorOverview 或 TrafficSummaryCard
+关键指标的概览统计卡片
+
+关键词频率组件
+KeywordFrequencyChart 或 SearchTermsTable
+展示搜索关键词及其频率的组件 
+-->
+
+
+
+<template>
+  <el-calendar v-model="value"/>
+</template>
+
+<script setup lang="ts" name="systemSysSchedule">
+const value = ref(new Date())
+</script>
+<style>
+.el-calendar-table .el-calendar-day{
+  height: 40px;
+}
+</style>

+ 221 - 0
src/views/home/visitor-trend.vue

@@ -0,0 +1,221 @@
+<template>
+  <div class="visitor-trend">
+    <div ref="chartRef" style="width: 100%; height: 300px;"></div>
+    <div style="position: absolute;top: 20px;right: 0;">
+      <el-select v-model="value" style="width: 84px;">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
+      </el-select>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { ref, onMounted, onBeforeUnmount } from 'vue';
+import * as echarts from 'echarts';
+import dayjs from 'dayjs';
+
+const value = ref('7');
+const options = [
+  {
+    value: '7',
+    label: '7天',
+    selected: true,
+  },
+  {
+    value: '30',
+    label: '30天',
+  },
+]
+const chartRef = ref(null);
+let chartInstance = null;
+
+// 示例数据
+const data = [
+  { date: '2025-01-01', visit: 12, visitor: 80, user: 50, duration: 3.2, bounceRate: 32 },
+  { date: '2025-01-02', visit: 13, visitor: 92, user: 62, duration: 4.1, bounceRate: 28 },
+  { date: '2025-01-03', visit: 10, visitor: 71, user: 41, duration: 3.8, bounceRate: 35 },
+  { date: '2025-01-04', visit: 13, visitor: 94, user: 64, duration: 4.5, bounceRate: 26 },
+  { date: '2025-01-05', visit: 9, visitor: 60, user: 30, duration: 2.9, bounceRate: 42 },
+  { date: '2025-01-06', visit: 23, visitor: 30, user: 60, duration: 5.2, bounceRate: 22 },
+  { date: '2025-01-07', visit: 21, visitor: 10, user: 70, duration: 4.8, bounceRate: 25 },
+];
+
+// 配置颜色
+const colorList = [
+  'rgba(255, 154, 95, 1)',   // 访问量
+  'rgba(91, 88, 225, 1)',    // 访客量
+  'rgba(88, 206, 82, 1)',    // 用户管理
+  'rgba(237, 49, 168, 1)',   // 平均停留时长
+  'rgba(22, 122, 240, 1)'    // 跳出率
+];
+
+onMounted(() => {
+  chartInstance = echarts.init(chartRef.value);
+
+  // 准备数据
+  const dateList = data.map(item => item.date);
+
+  const WEEK_DAYS = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'];
+
+  const option = {
+    tooltip: {
+      trigger: 'axis',
+      backgroundColor: 'rgba(255, 255, 255, 0.5)',
+      borderColor: 'rgba(204, 204, 204, 1)',
+      borderWidth: 1,
+      borderRadius: 0,
+      formatter: function (params) {
+        const date = params[0].axisValue;
+        let result = `<div style="font-weight: bold; font-size: 12px; color: rgba(18, 18, 18, 1); margin-bottom: 5px;">${dayjs(date).format('YYYY年MM月DD日')}&nbsp;${WEEK_DAYS[dayjs(date).day()]}</div>`;
+        params.forEach(item => {
+          let value = item.value;
+          // // 特殊处理不同指标的单位
+          // if (item.seriesName === '平均停留时长') {
+          //   value = value + ' 分钟';
+          // } else if (item.seriesName === '跳出率') {
+          //   value = value + '%';
+          // }
+          result += `<div style="font-size: 12px; color: #666; margin-top: 2px;">${item.marker} <span style="font-weight: bold; color: #000000;">${value}</span> ${item.seriesName}</div>`;
+        });
+        return result;
+      },
+    },
+    legend: {
+      data: ['访问量', '访客量', '用户管理', '平均停留时间(秒)', '跳出率'],
+      top: 0,
+      left: 0,
+    },
+    grid: {
+      left: '0%',
+      right: '5%',
+      bottom: '0%',
+      containLabel: true
+    },
+    xAxis: {
+      type: 'category',
+      boundaryGap: false,
+      data: dateList,
+      axisLabel: {
+        formatter: function (value) {
+          // 格式化日期显示
+          return value.split('-').slice(1).join('-');
+        },
+        // rotate: 30  // 日期标签旋转30度防止重叠
+        color: 'rgba(100, 100, 100, 1)',
+      },
+      axisLine: {
+        lineStyle: {
+          // color: 'rgba(22, 122, 240, 1)',
+          // width: 2,
+        },
+      },
+      axisTick: {
+        show: false,
+      },
+    },
+    yAxis: {
+      type: 'value',
+    },
+    series: [
+      {
+        name: '访问量',
+        type: 'line',
+        data: data.map(item => item.visit),
+        symbol: 'circle',
+        symbolSize: 2,
+        itemStyle: {
+          color: colorList[0]
+        },
+        lineStyle: {
+          width: 2
+        }
+      },
+      {
+        name: '访客量',
+        type: 'line',
+        data: data.map(item => item.visitor),
+        symbol: 'circle',
+        symbolSize: 2,
+        itemStyle: {
+          color: colorList[1]
+        },
+        lineStyle: {
+          width: 2
+        }
+      },
+      {
+        name: '用户管理',
+        type: 'line',
+        data: data.map(item => item.user),
+        symbol: 'circle',
+        symbolSize: 2,
+        itemStyle: {
+          color: colorList[2]
+        },
+        lineStyle: {
+          width: 2
+        }
+      },
+      {
+        name: '平均停留时间(秒)',
+        type: 'line',
+        data: data.map(item => item.duration),
+        symbol: 'circle',
+        symbolSize: 2,
+        itemStyle: {
+          color: colorList[3]
+        },
+        lineStyle: {
+          width: 2
+        }
+      },
+      {
+        name: '跳出率',
+        type: 'line',
+        data: data.map(item => item.bounceRate),
+        symbol: 'circle',
+        symbolSize: 2,
+        itemStyle: {
+          color: colorList[4]
+        },
+        lineStyle: {
+          width: 2
+        }
+      }
+    ],
+    color: colorList
+  };
+
+  chartInstance.setOption(option);
+
+  // 响应式调整
+  const handleResize = () => chartInstance?.resize();
+  window.addEventListener('resize', handleResize);
+});
+
+onBeforeUnmount(() => {
+  window.removeEventListener('resize', handleResize);
+  chartInstance?.dispose();
+});
+</script>
+
+<style>
+.visitor-trend {
+  position: relative;
+  padding-top: 20px;
+  height: 340px;
+}
+
+/* 下拉框整体样式 */
+.visitor-trend .el-select__wrapper {
+  border: 1px solid rgba(22, 122, 240, 1);
+}
+
+.visitor-trend .el-select__selected-item {
+  color: rgba(22, 122, 240, 1); /* 文字颜色 */
+}
+
+.visitor-trend .el-select__caret {
+  color: rgba(22, 122, 240, 1); /* 三角形颜色 */
+}
+</style>

+ 14 - 0
src/views/marketing/statistics/i18n/en.ts

@@ -0,0 +1,14 @@
+export default {
+	systoken: {
+		index: '#',
+		userId: 'userId',
+		username: 'username',
+		clientId: 'clientId',
+		accessToken: 'accessToken',
+		expiresAt: 'expiresAt',
+		inputUsernameTip: 'input Username',
+		offlineBtn: 'offline',
+		offlineConfirmText: 'offline confirm',
+		offlineSuccessText: 'offline success',
+	},
+};

+ 13 - 0
src/views/marketing/statistics/i18n/zh-cn.ts

@@ -0,0 +1,13 @@
+export default {
+	systoken: {
+		ip: 'IP',
+		domain: '域名',
+		content: '访问量',
+		active: '日活',
+		source: '来源',
+		inputIpTip: '请输入IP地址',
+		inputDomainTip: '请输入域名',
+		queryBtn: '查询',
+		resetBtn: '重置',
+	},
+};

+ 68 - 0
src/views/marketing/statistics/index.vue

@@ -0,0 +1,68 @@
+<template>
+	<div class="layout-padding">
+		<div class="layout-padding-auto layout-padding-view">
+			<el-row class="ml10" v-show="showSearch">
+				<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
+					<el-form-item :label="$t('systoken.ip')" prop="ip">
+						<el-input :placeholder="$t('systoken.inputIpTip')" v-model="state.queryForm.ip"></el-input>
+					</el-form-item>
+                    <el-form-item :label="$t('systoken.domain')" prop="domain">
+						<el-input :placeholder="$t('systoken.inputDomainTip')" v-model="state.queryForm.domain"></el-input>
+					</el-form-item>
+					<el-form-item>
+						<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn') }} </el-button>
+						<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
+					</el-form-item>
+				</el-form>
+			</el-row>
+			<el-table
+				:data="state.dataList"
+				@sort-change="sortChangeHandle"
+				style="width: 100%"
+				v-loading="state.loading"
+				border
+				:cell-style="tableStyle.cellStyle"
+				:header-cell-style="tableStyle.headerCellStyle"
+			>
+				<!-- <el-table-column align="center" type="selection" width="40" /> -->
+				<el-table-column :label="$t('systoken.ip')" prop="ip" show-overflow-tooltip></el-table-column>
+				<el-table-column :label="$t('systoken.domain')" prop="domain" show-overflow-tooltip ></el-table-column>
+				<el-table-column :label="$t('systoken.content')" prop="content" show-overflow-tooltip></el-table-column>
+				<el-table-column :label="$t('systoken.active')" prop="active" show-overflow-tooltip></el-table-column>
+			</el-table>
+
+			<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination"> </pagination>
+		</div>
+	</div>
+</template>
+
+<script lang="ts" setup>
+import { BasicTableProps, useTable } from '/@/hooks/table';
+import { pageList } from '/@/api/marketing/statistics';
+
+import { useI18n } from 'vue-i18n';
+import { useMessage, useMessageBox } from '/@/hooks/message';
+import { Session } from '/@/utils/storage';
+
+const { t } = useI18n();
+// 定义变量内容
+const queryRef = ref();
+const showSearch = ref(true);
+
+//  table hook
+const state: BasicTableProps = reactive<BasicTableProps>({
+	queryForm: {
+		ip: '',
+        domain:''
+	},
+	pageList: pageList,
+});
+const { getDataList, currentChangeHandle, sortChangeHandle, sizeChangeHandle, tableStyle } = useTable(state);
+
+// 清空搜索条件
+const resetQuery = () => {
+	queryRef.value?.resetFields();
+	getDataList();
+};
+
+</script>

+ 1 - 1
tsconfig.json

@@ -69,6 +69,6 @@
 		"skipLibCheck": true /* Skip type checking of declaration files. */,
 		"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
 	},
-	"include": ["src/**/*.ts", "src/**/*.vue", "src/**/*.tsx", "src/**/*.d.ts", "auto-imports.d.ts"], // **Represents any directory, and * represents any file. Indicates that all files in the src directory will be compiled
+	"include": ["src/**/*.ts", "src/**/*.vue", "src/**/*.tsx", "src/**/*.d.ts", "auto-imports.d.ts", "src/api/marketing/statistics.ts"], // **Represents any directory, and * represents any file. Indicates that all files in the src directory will be compiled
 	"exclude": ["node_modules", "dist"] // Indicates the file directory that does not need to be compiled
 }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików