From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
src/components/OperateLogV2/src/OperateLogV2.vue | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 105 insertions(+), 0 deletions(-)
diff --git a/src/components/OperateLogV2/src/OperateLogV2.vue b/src/components/OperateLogV2/src/OperateLogV2.vue
new file mode 100644
index 0000000..6acc1cc
--- /dev/null
+++ b/src/components/OperateLogV2/src/OperateLogV2.vue
@@ -0,0 +1,105 @@
+<!-- 鏌愪釜璁板綍鐨勬搷浣滄棩蹇楀垪琛紝鐩墠涓昏鐢ㄤ簬 CRM 瀹㈡埛銆佸晢鏈虹瓑璇︽儏鐣岄潰 -->
+<template>
+ <div class="pt-20px">
+ <el-timeline>
+ <el-timeline-item
+ v-for="(log, index) in logList"
+ :key="index"
+ :timestamp="formatDate(log.createTime)"
+ placement="top"
+ >
+ <div class="el-timeline-right-content">
+ <el-tag class="mr-10px" type="success">{{ log.userName }}</el-tag>
+ {{ log.action }}
+ </div>
+ <template #dot>
+ <span :style="{ backgroundColor: getUserTypeColor(log.userType) }" class="dot-node-style">
+ {{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }}
+ </span>
+ </template>
+ </el-timeline-item>
+ </el-timeline>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { OperateLogVO } from '@/api/system/operatelog'
+import { formatDate } from '@/utils/formatTime'
+import { DICT_TYPE, getDictLabel, getDictObj } from '@/utils/dict'
+import { ElTag } from 'element-plus'
+
+defineOptions({ name: 'OperateLogV2' })
+
+interface Props {
+ logList: OperateLogVO[] // 鎿嶄綔鏃ュ織鍒楄〃
+}
+
+withDefaults(defineProps<Props>(), {
+ logList: () => []
+})
+
+/** 鑾峰緱 userType 棰滆壊 */
+const getUserTypeColor = (type: number) => {
+ const dict = getDictObj(DICT_TYPE.USER_TYPE, type)
+ switch (dict?.colorType) {
+ case 'success':
+ return '#67C23A'
+ case 'info':
+ return '#909399'
+ case 'warning':
+ return '#E6A23C'
+ case 'danger':
+ return '#F56C6C'
+ }
+ return '#409EFF'
+}
+</script>
+
+<style lang="scss" scoped>
+// 鏃堕棿绾挎牱寮忚皟鏁�
+:deep(.el-timeline) {
+ margin: 10px 0 0 110px;
+
+ .el-timeline-item__wrapper {
+ position: relative;
+ top: -20px;
+
+ .el-timeline-item__timestamp {
+ position: absolute !important;
+ top: 10px;
+ left: -150px;
+ }
+ }
+
+ .el-timeline-right-content {
+ display: flex;
+ align-items: center;
+ min-height: 30px;
+ padding: 10px;
+ background-color: #fff;
+
+ &::before {
+ position: absolute;
+ top: 10px;
+ left: 13px; /* 灏嗕吉鍏冪礌姘村钩灞呬腑 */
+ border-color: transparent #fff transparent transparent; /* 灏栬棰滆壊锛屽乏渚ф湞鍚� */
+ border-style: solid;
+ border-width: 8px; /* 璋冩暣灏栬澶у皬 */
+ content: ''; /* 蹇呴』璁剧疆 content 灞炴�� */
+ }
+ }
+}
+
+.dot-node-style {
+ position: absolute;
+ left: -5px;
+ display: flex;
+ width: 20px;
+ height: 20px;
+ font-size: 10px;
+ color: #fff;
+ border-radius: 50%;
+ justify-content: center;
+ align-items: center;
+}
+</style>
--
Gitblit v1.8.0