From 59c66707753f81d369d952caee9ebc65d29bc472 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 14 Dec 2023 18:18:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/operatelog/index.ts | 25 +++ src/components/OperateLogV2/index.ts | 3 + .../OperateLogV2/src/OperateLogV2.vue | 170 ++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 src/components/OperateLogV2/index.ts create mode 100644 src/components/OperateLogV2/src/OperateLogV2.vue diff --git a/src/api/system/operatelog/index.ts b/src/api/system/operatelog/index.ts index 848a5333..cb47d18c 100644 --- a/src/api/system/operatelog/index.ts +++ b/src/api/system/operatelog/index.ts @@ -23,6 +23,31 @@ export type OperateLogVO = { resultData: string } +export type OperateLogV2VO = { + id: number + userNickname: string + traceId: string + userType: number + userId: number + module: string + name: string + bizId: number + content: string + extra: string + requestMethod: string + requestUrl: string + userIp: string + userAgent: string + creator: string + creatorName: string + createTime: Date + // 数据扩展-渲染时使用 + title: string // 操作标题(如果为空则取 name 值) + colSize: number // 变更记录行数 + contentStrList: string[] + tagsContentList: string[] +} + // 查询操作日志列表 export const getOperateLogPage = (params: PageParam) => { return request.get({ url: '/system/operate-log/page', params }) diff --git a/src/components/OperateLogV2/index.ts b/src/components/OperateLogV2/index.ts new file mode 100644 index 00000000..f69c222e --- /dev/null +++ b/src/components/OperateLogV2/index.ts @@ -0,0 +1,3 @@ +import OperateLogV2 from './src/OperateLogV2.vue' + +export { OperateLogV2 } diff --git a/src/components/OperateLogV2/src/OperateLogV2.vue b/src/components/OperateLogV2/src/OperateLogV2.vue new file mode 100644 index 00000000..dd9e8cdf --- /dev/null +++ b/src/components/OperateLogV2/src/OperateLogV2.vue @@ -0,0 +1,170 @@ + + + + + From 455688eaa88ba8f3754a26cd6d28217758f81eeb Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 14 Dec 2023 18:19:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?crm-=E5=AE=A2=E6=88=B7=EF=BC=9A=E9=9B=86?= =?UTF-8?q?=E6=88=90=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/customer/index.ts | 5 ++++ src/views/crm/customer/CustomerForm.vue | 18 ++++++------- .../customer/detail/CustomerDetailsHeader.vue | 9 ++++--- .../customer/detail/CustomerDetailsInfo.vue | 25 ++++++++++--------- src/views/crm/customer/detail/index.vue | 18 ++++++++++--- 5 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 5ef43950..bedb61f5 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -67,3 +67,8 @@ export const exportCustomer = async (params) => { export const queryAllList = async () => { return await request.get({ url: `/crm/customer/query-all-list` }) } + +// 查询客户操作日志 +export const getOperateLog = async (id: number) => { + return await request.get({ url: `/crm/customer/operate-log?id=` + id }) +} diff --git a/src/views/crm/customer/CustomerForm.vue b/src/views/crm/customer/CustomerForm.vue index 99f7e858..1730ef45 100644 --- a/src/views/crm/customer/CustomerForm.vue +++ b/src/views/crm/customer/CustomerForm.vue @@ -1,11 +1,11 @@ - - + diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue index f21a6ac3..626d30ae 100644 --- a/src/views/crm/customer/detail/index.vue +++ b/src/views/crm/customer/detail/index.vue @@ -5,7 +5,9 @@ - TODO 待开发 + + + @@ -38,24 +40,34 @@ import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表 import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限) import { BizTypeEnum } from '@/api/crm/permission' +import { OperateLogV2VO } from '@/api/system/operatelog' defineOptions({ name: 'CrmCustomerDetail' }) const route = useRoute() const id = Number(route.params.id) // 客户编号 const loading = ref(true) // 加载中 - /** 获取详情 */ const customer = ref({} as CustomerApi.CustomerVO) // 客户详情 const getCustomer = async (id: number) => { loading.value = true try { customer.value = await CustomerApi.getCustomer(id) + await getOperateLog(id) } finally { loading.value = false } } - +const logList = ref([]) // 操作日志列表 +/** + * 获取操作日志 + */ +const getOperateLog = async (customerId: number) => { + if (!customerId) { + return + } + logList.value = await CustomerApi.getOperateLog(customerId) +} /** 初始化 */ const { delView } = useTagsViewStore() // 视图操作 const { currentRoute } = useRouter() // 路由 From 261d8b2aa4775b8453dc2368eb1ecb78e8ee4cbf Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 30 Dec 2023 17:06:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?crm-=E5=AE=A2=E6=88=B7=EF=BC=9A=E9=9B=86?= =?UTF-8?q?=E6=88=90=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/customer/index.ts | 4 ++-- src/api/system/operatelog/index.ts | 7 ++++--- src/components/OperateLogV2/src/OperateLogV2.vue | 8 ++++---- src/views/crm/customer/detail/index.vue | 7 ++++++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index bedb61f5..50eebd64 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -69,6 +69,6 @@ export const queryAllList = async () => { } // 查询客户操作日志 -export const getOperateLog = async (id: number) => { - return await request.get({ url: `/crm/customer/operate-log?id=` + id }) +export const getOperateLogPage = async (params) => { + return await request.get({ url: '/crm/customer/operate-log-page', params }) } diff --git a/src/api/system/operatelog/index.ts b/src/api/system/operatelog/index.ts index cb47d18c..0ebe0d33 100644 --- a/src/api/system/operatelog/index.ts +++ b/src/api/system/operatelog/index.ts @@ -29,10 +29,11 @@ export type OperateLogV2VO = { traceId: string userType: number userId: number - module: string - name: string + userName: string + type: string + subType: string bizId: number - content: string + action: string extra: string requestMethod: string requestUrl: string diff --git a/src/components/OperateLogV2/src/OperateLogV2.vue b/src/components/OperateLogV2/src/OperateLogV2.vue index dd9e8cdf..cb5663b2 100644 --- a/src/components/OperateLogV2/src/OperateLogV2.vue +++ b/src/components/OperateLogV2/src/OperateLogV2.vue @@ -4,14 +4,14 @@
======================= - {{ log.creatorName }} + {{ log.userName }} {{ log.title }} ======================= @@ -91,11 +91,11 @@ const renderTags = (content: string) => { } const initLog = () => { logDataList.value = props.logList.map((logItem) => { - const keyValue = renderTags(logItem.content) + const keyValue = renderTags(logItem.action) // 挂载数据 logItem.contentStrList = keyValue[0] if (keyValue[0][0] === '从') { - logItem.title = logItem.name + logItem.title = logItem.subType } else { logItem.title = keyValue[0][0] logItem.contentStrList.splice(0, 1) diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue index 626d30ae..e8d73582 100644 --- a/src/views/crm/customer/detail/index.vue +++ b/src/views/crm/customer/detail/index.vue @@ -66,7 +66,12 @@ const getOperateLog = async (customerId: number) => { if (!customerId) { return } - logList.value = await CustomerApi.getOperateLog(customerId) + const data = await CustomerApi.getOperateLogPage({ + pageNo: 1, + pageSize: 10, + bizId: customerId + }) + logList.value = data.list } /** 初始化 */ const { delView } = useTagsViewStore() // 视图操作