feat:【ele】【crm】初始化界面

This commit is contained in:
YunaiV
2025-11-17 09:28:32 +08:00
parent a273ab2882
commit 32ffc2e556
26 changed files with 2705 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
export { default as OperateLog } from './operate-log.vue';
export type { OperateLogProps } from './typing';

View File

@@ -0,0 +1,50 @@
<script setup lang="ts">
import type { OperateLogProps } from './typing';
import { DICT_TYPE } from '@vben/constants';
import { getDictLabel, getDictObj } from '@vben/hooks';
import { formatDateTime } from '@vben/utils';
import { ElTag, ElTimeline, ElTimelineItem } from 'element-plus';
defineOptions({ name: 'OperateLogV2' });
withDefaults(defineProps<OperateLogProps>(), {
logList: () => [],
});
function getUserTypeColor(userType: number) {
const dict = getDictObj(DICT_TYPE.USER_TYPE, userType);
if (dict && dict.colorType) {
return `hsl(var(--${dict.colorType}))`;
}
return 'hsl(var(--primary))';
}
</script>
<template>
<div>
<ElTimeline>
<ElTimelineItem
v-for="log in logList"
:key="log.id"
:color="getUserTypeColor(log.userType)"
>
<template #dot>
<p
:style="{ backgroundColor: getUserTypeColor(log.userType) }"
class="absolute left-1 top-0 flex h-5 w-5 items-center justify-center rounded-full text-xs text-white"
>
{{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }}
</p>
</template>
<p class="ml-2">{{ formatDateTime(log.createTime) }}</p>
<p class="ml-2 mt-2">
<ElTag :color="getUserTypeColor(log.userType)">
{{ log.userName }}
</ElTag>
{{ log.action }}
</p>
</ElTimelineItem>
</ElTimeline>
</div>
</template>

View File

@@ -0,0 +1,5 @@
import type { SystemOperateLogApi } from '#/api/system/operate-log';
export interface OperateLogProps {
logList: SystemOperateLogApi.OperateLog[]; // 操作日志列表
}