diff --git a/apps/web-antd/src/api/report/progress/index.ts b/apps/web-antd/src/api/report/progress/index.ts new file mode 100644 index 0000000..a3f0826 --- /dev/null +++ b/apps/web-antd/src/api/report/progress/index.ts @@ -0,0 +1,47 @@ +import type { Dayjs } from 'dayjs'; + +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ProgressApi { + /** 客户进展信息 */ + export interface Progress { + id: number; // 主键 + projectId?: number; // 项目ID + userId?: number; // 用户ID + parentId?: number; // 父评论ID + author?: string; // 评论人 + avatar?: string; // 头像 + replyUserId?: number; // 回复用户ID + replyUser?: string; // 回复用户 + updateTime?: Dayjs; // 更新时间 + startTime?: Dayjs; // 项目时间 + depth?: number; // 评论深度 + content?: string; // 评论内容 + children?: Comment[]; // 子评论 + projectName?: string; // 项目名称 + status?: string; + serialNo?: string; + businessOwnerName?: string; + technicalOwnerAName?: string; + technicalOwnerBName?: string; + customerName?: string; + } +} + +/** 查询项目进展(项目维度)分页 */ +export function getProgressByProjectPage(params: PageParam) { + return requestClient.get>( + '/license/report/progress/project-page', + { params }, + ); +} + +/** 查询项目进展(人员维度)分页 */ +export function getProgressByStaffPage(params: PageParam) { + return requestClient.get>( + '/license/report/progress/staff-page', + { params }, + ); +} diff --git a/apps/web-antd/src/locales/langs/en-US/menu.json b/apps/web-antd/src/locales/langs/en-US/menu.json index b82cfcf..c35e2be 100644 --- a/apps/web-antd/src/locales/langs/en-US/menu.json +++ b/apps/web-antd/src/locales/langs/en-US/menu.json @@ -85,5 +85,10 @@ "customer": "Customer Management", "project": "Project Management", "license": "License Management", - "alert": "Alarm Management" + "alert": "Alarm Management", + "report": { + "base": "Report Center", + "progress": "Project Progress", + "license": "License Expire" + } } diff --git a/apps/web-antd/src/locales/langs/zh-CN/menu.json b/apps/web-antd/src/locales/langs/zh-CN/menu.json index 546f065..979aafc 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/menu.json +++ b/apps/web-antd/src/locales/langs/zh-CN/menu.json @@ -85,5 +85,10 @@ "customer": "客户管理", "project": "项目管理", "license": "License管理", - "alert": "告警管理" + "alert": "告警管理", + "report": { + "base": "报表中心", + "progress": "项目进展", + "license": "License到期" + } } diff --git a/apps/web-antd/src/views/license/license/data.ts b/apps/web-antd/src/views/license/license/data.ts index f03031f..7be35b3 100644 --- a/apps/web-antd/src/views/license/license/data.ts +++ b/apps/web-antd/src/views/license/license/data.ts @@ -258,14 +258,12 @@ export function useGridFormSchema(): VbenFormSchema[] { allowClear: true, api: async () => { const data = await getSimpleUserList(); - return data.map((item) => ({ - label: item.nickname, - value: item.id, - })); + return data.filter((item) => item.nickname !== '管理员'); }, + fieldNames: { label: 'nickname', value: 'id' }, showSearch: true, filterOption: (input: string, option: any) => - option.label.toLowerCase().includes(input.toLowerCase()), + option.nickname.toLowerCase().includes(input.toLowerCase()), }, }, { diff --git a/apps/web-antd/src/views/report/progress/data.ts b/apps/web-antd/src/views/report/progress/data.ts new file mode 100644 index 0000000..bdd8314 --- /dev/null +++ b/apps/web-antd/src/views/report/progress/data.ts @@ -0,0 +1,300 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { ProgressApi } from '#/api/report/progress'; + +import dayjs from 'dayjs'; + +import { getCustomerList } from '#/api/license/customer'; +import { getProjectList } from '#/api/license/project'; +import { getSimpleUserList } from '#/api/system/user'; +import { $t } from '#/locales'; +import { DICT_TYPE, getRangePickerDefaultProps } from '#/utils'; + +// ==================== 项目进展(项目维度) ==================== + +/** 列表的搜索表单 */ +export function useProjectGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'customerId', + label: $t('license.customer'), + component: 'ApiSelect', + componentProps: { + api: getCustomerList, + allowClear: true, + fieldNames: { label: 'name', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.name.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'projectId', + label: $t('license.project'), + component: 'ApiSelect', + componentProps: { + api: getProjectList, + allowClear: true, + fieldNames: { label: 'name', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.name.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'serialNo', + label: 'SN', + component: 'Input', + componentProps: { + allowClear: true, + }, + }, + { + fieldName: 'authorId', + label: '处理人', + component: 'ApiSelect', + componentProps: { + allowClear: true, + api: async () => { + const data = await getSimpleUserList(); + return data.filter((item) => item.nickname !== '管理员'); + }, + fieldNames: { label: 'nickname', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.nickname.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'updateTime', + label: '更新时间', + component: 'RangePicker', + defaultValue: [dayjs().subtract(7, 'days'), dayjs()], + componentProps: { + ...getRangePickerDefaultProps(), + format: 'YYYY-MM-DD', + showTime: false, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useProjectGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'customerName', + title: '客户名称', + showOverflow: false, + minWidth: 60, + }, + { + field: 'projectName', + title: '项目名称', + showOverflow: false, + minWidth: 80, + }, + { + field: 'status', + title: $t('project.status'), + minWidth: 40, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.LIC_PROJECT_STATUS }, + }, + }, + { + field: 'serialNo', + title: 'SN', + showOverflow: false, + minWidth: 40, + }, + { + field: 'businessOwnerName', + title: '业务负责人', + minWidth: 40, + }, + { + field: 'technicalOwnerAName', + title: '技术负责人1', + minWidth: 40, + }, + { + field: 'technicalOwnerBName', + title: '技术负责人2', + visible: false, + minWidth: 40, + }, + { + field: 'startTime', + title: '项目开始时间', + minWidth: 80, + visible: false, + formatter: 'formatDateTime', + }, + { + field: 'author', + title: '处理人', + minWidth: 40, + }, + { + field: 'content', + title: '进展记录', + type: 'html', + showOverflow: false, + align: 'left', + // headerAlign: 'center', + minWidth: 800, + }, + { + field: 'updateTime', + title: '更新时间', + minWidth: 80, + formatter: 'formatDateTime', + }, + ]; +} + +// ==================== 项目进展(项目维度) ==================== +/** 列表的搜索表单 */ +export function useStaffGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'authorId', + label: '处理人', + component: 'ApiSelect', + componentProps: { + allowClear: true, + api: async () => { + const data = await getSimpleUserList(); + return data.filter((item) => item.nickname !== '管理员'); + }, + fieldNames: { label: 'nickname', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.nickname.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'customerId', + label: $t('license.customer'), + component: 'ApiSelect', + componentProps: { + api: getCustomerList, + allowClear: true, + fieldNames: { label: 'name', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.name.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'projectId', + label: $t('license.project'), + component: 'ApiSelect', + componentProps: { + api: getProjectList, + allowClear: true, + fieldNames: { label: 'name', value: 'id' }, + showSearch: true, + filterOption: (input: string, option: any) => + option.name.toLowerCase().includes(input.toLowerCase()), + }, + }, + { + fieldName: 'serialNo', + label: 'SN', + component: 'Input', + componentProps: { + allowClear: true, + }, + }, + { + fieldName: 'updateTime', + label: '更新时间', + component: 'RangePicker', + defaultValue: [dayjs().subtract(7, 'days'), dayjs()], + componentProps: { + ...getRangePickerDefaultProps(), + format: 'YYYY-MM-DD', + showTime: false, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useStaffGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'author', + title: '处理人', + minWidth: 40, + }, + { + field: 'customerName', + title: '客户名称', + showOverflow: false, + minWidth: 60, + }, + { + field: 'projectName', + title: '项目名称', + showOverflow: false, + minWidth: 80, + }, + { + field: 'status', + title: $t('project.status'), + minWidth: 40, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.LIC_PROJECT_STATUS }, + }, + }, + { + field: 'serialNo', + title: 'SN', + showOverflow: false, + minWidth: 40, + }, + { + field: 'businessOwnerName', + title: '业务负责人', + minWidth: 40, + }, + { + field: 'technicalOwnerAName', + title: '技术负责人1', + minWidth: 40, + }, + { + field: 'technicalOwnerBName', + title: '技术负责人2', + visible: false, + minWidth: 40, + }, + { + field: 'startTime', + title: '项目开始时间', + minWidth: 80, + visible: false, + formatter: 'formatDateTime', + }, + { + field: 'content', + title: '进展记录', + type: 'html', + showOverflow: false, + align: 'left', + // headerAlign: 'center', + minWidth: 800, + }, + { + field: 'updateTime', + title: '更新时间', + minWidth: 80, + formatter: 'formatDateTime', + }, + ]; +} diff --git a/apps/web-antd/src/views/report/progress/index.vue b/apps/web-antd/src/views/report/progress/index.vue new file mode 100644 index 0000000..afc6943 --- /dev/null +++ b/apps/web-antd/src/views/report/progress/index.vue @@ -0,0 +1,30 @@ + + + diff --git a/apps/web-antd/src/views/report/progress/modules/project.vue b/apps/web-antd/src/views/report/progress/modules/project.vue new file mode 100644 index 0000000..fa15f79 --- /dev/null +++ b/apps/web-antd/src/views/report/progress/modules/project.vue @@ -0,0 +1,97 @@ + + + diff --git a/apps/web-antd/src/views/report/progress/modules/staff.vue b/apps/web-antd/src/views/report/progress/modules/staff.vue new file mode 100644 index 0000000..8696a70 --- /dev/null +++ b/apps/web-antd/src/views/report/progress/modules/staff.vue @@ -0,0 +1,97 @@ + + +