diff --git a/apps/web-antd/src/api/infra/job/index.ts b/apps/web-antd/src/api/infra/job/index.ts index fcec25c83..3bd20fdb5 100644 --- a/apps/web-antd/src/api/infra/job/index.ts +++ b/apps/web-antd/src/api/infra/job/index.ts @@ -15,6 +15,7 @@ export namespace InfraJobApi { retryInterval: number; monitorTimeout: number; createTime?: Date; + nextTimes?: Date[]; } } diff --git a/apps/web-antd/src/components/table-action/icons.ts b/apps/web-antd/src/components/table-action/icons.ts index 471b7eb86..985871956 100644 --- a/apps/web-antd/src/components/table-action/icons.ts +++ b/apps/web-antd/src/components/table-action/icons.ts @@ -9,4 +9,5 @@ export const ACTION_ICON = { FILTER: 'lucide:filter', MORE: 'lucide:ellipsis-vertical', VIEW: 'lucide:eye', + COPY: 'lucide:copy', }; diff --git a/apps/web-antd/src/views/crm/customer/index.vue b/apps/web-antd/src/views/crm/customer/index.vue index 31d27777d..cac8566da 100644 --- a/apps/web-antd/src/views/crm/customer/index.vue +++ b/apps/web-antd/src/views/crm/customer/index.vue @@ -59,14 +59,16 @@ function onEdit(row: CrmCustomerApi.Customer) { async function onDelete(row: CrmCustomerApi.Customer) { const hideLoading = message.loading({ content: $t('ui.actionMessage.deleting', [row.name]), - duration: 0, - key: 'action_process_msg', + key: 'action_key_msg', }); try { await deleteCustomer(row.id as number); - message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + message.success({ + content: $t('ui.actionMessage.deleteSuccess', [row.name]), + key: 'action_key_msg', + }); onRefresh(); - } catch { + } finally { hideLoading(); } } diff --git a/apps/web-antd/src/views/infra/apiAccessLog/data.ts b/apps/web-antd/src/views/infra/apiAccessLog/data.ts index e924c2470..df569c12c 100644 --- a/apps/web-antd/src/views/infra/apiAccessLog/data.ts +++ b/apps/web-antd/src/views/infra/apiAccessLog/data.ts @@ -1,13 +1,8 @@ import type { VbenFormSchema } from '#/adapter/form'; -import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { InfraApiAccessLogApi } from '#/api/infra/api-access-log'; - -import { useAccess } from '@vben/access'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; -const { hasAccessByCodes } = useAccess(); - /** 列表的搜索表单 */ export function useGridFormSchema(): VbenFormSchema[] { return [ @@ -70,9 +65,7 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 列表的字段 */ -export function useGridColumns( - onActionClick: OnActionClickFn, -): VxeTableGridOptions['columns'] { +export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { field: 'id', @@ -148,26 +141,10 @@ export function useGridColumns( }, }, { - field: 'operation', title: '操作', - minWidth: 80, - align: 'center', + width: 80, fixed: 'right', - cellRender: { - attrs: { - nameField: 'id', - nameTitle: 'API访问日志', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'detail', - text: '详情', - show: hasAccessByCodes(['infra:api-access-log:query']), - }, - ], - }, + slots: { default: 'actions' }, }, ]; } diff --git a/apps/web-antd/src/views/infra/apiAccessLog/index.vue b/apps/web-antd/src/views/infra/apiAccessLog/index.vue index 3cc0ee5b4..0410df045 100644 --- a/apps/web-antd/src/views/infra/apiAccessLog/index.vue +++ b/apps/web-antd/src/views/infra/apiAccessLog/index.vue @@ -1,17 +1,11 @@ diff --git a/apps/web-antd/src/views/infra/job/modules/detail.vue b/apps/web-antd/src/views/infra/job/modules/detail.vue index bd7f39b02..9a0c2f71d 100644 --- a/apps/web-antd/src/views/infra/job/modules/detail.vue +++ b/apps/web-antd/src/views/infra/job/modules/detail.vue @@ -4,13 +4,11 @@ import type { InfraJobApi } from '#/api/infra/job'; import { ref } from 'vue'; import { useVbenModal } from '@vben/common-ui'; -import { formatDateTime } from '@vben/utils'; - -import { Descriptions, Timeline } from 'ant-design-vue'; import { getJob, getJobNextTimes } from '#/api/infra/job'; -import { DictTag } from '#/components/dict-tag'; -import { DICT_TYPE } from '#/utils'; +import { useDescription } from '#/components/description'; + +import { useDetailSchema } from '../data'; const formData = ref(); // 任务详情 const nextTimes = ref([]); // 下一次执行时间 @@ -31,11 +29,21 @@ const [Modal, modalApi] = useVbenModal({ formData.value = await getJob(data.id); // 获取下一次执行时间 nextTimes.value = await getJobNextTimes(data.id); + formData.value.nextTimes = nextTimes.value; } finally { modalApi.unlock(); } }, }); + +const [Description] = useDescription({ + componentProps: { + bordered: true, + column: 1, + class: 'mx-4', + }, + schema: useDetailSchema(), +}); diff --git a/apps/web-antd/src/views/infra/redis/index.vue b/apps/web-antd/src/views/infra/redis/index.vue index 687284db1..d3bf1eda8 100644 --- a/apps/web-antd/src/views/infra/redis/index.vue +++ b/apps/web-antd/src/views/infra/redis/index.vue @@ -17,16 +17,16 @@ import Memory from './modules/memory.vue'; const redisData = ref(); /** 统一加载 Redis 数据 */ -const loadRedisData = async () => { +async function loadRedisData() { try { redisData.value = await getRedisMonitorInfo(); } catch (error) { console.error('加载 Redis 数据失败', error); } -}; +} -onMounted(() => { - loadRedisData(); +onMounted(async () => { + await loadRedisData(); }); @@ -37,9 +37,11 @@ onMounted(() => { - - - +
+ + + +
diff --git a/apps/web-antd/src/views/infra/redis/modules/commands.vue b/apps/web-antd/src/views/infra/redis/modules/commands.vue index 5c7e375b8..25c263e68 100644 --- a/apps/web-antd/src/views/infra/redis/modules/commands.vue +++ b/apps/web-antd/src/views/infra/redis/modules/commands.vue @@ -15,7 +15,7 @@ const chartRef = ref(); const { renderEcharts } = useEcharts(chartRef); /** 渲染命令统计图表 */ -const renderCommandStats = () => { +function renderCommandStats() { if (!props.redisData?.commandStats) { return; } @@ -76,7 +76,7 @@ const renderCommandStats = () => { }, ], }); -}; +} /** 监听数据变化,重新渲染图表 */ watch( @@ -97,7 +97,5 @@ onMounted(() => { diff --git a/apps/web-antd/src/views/infra/redis/modules/memory.vue b/apps/web-antd/src/views/infra/redis/modules/memory.vue index 04f26756c..5220c4631 100644 --- a/apps/web-antd/src/views/infra/redis/modules/memory.vue +++ b/apps/web-antd/src/views/infra/redis/modules/memory.vue @@ -15,7 +15,7 @@ const chartRef = ref(); const { renderEcharts } = useEcharts(chartRef); /** 解析内存值,移除单位,转为数字 */ -const parseMemoryValue = (memStr: string | undefined): number => { +function parseMemoryValue(memStr: string | undefined): number { if (!memStr) { return 0; } @@ -27,10 +27,10 @@ const parseMemoryValue = (memStr: string | undefined): number => { } catch { return 0; } -}; +} /** 渲染内存使用图表 */ -const renderMemoryChart = () => { +function renderMemoryChart() { if (!props.redisData?.info) { return; } @@ -94,7 +94,7 @@ const renderMemoryChart = () => { detail: { show: true, offsetCenter: [0, '50%'], - color: 'auto', + color: 'inherit', fontSize: 30, formatter: usedMemory, }, @@ -110,7 +110,7 @@ const renderMemoryChart = () => { }, ], }); -}; +} /** 监听数据变化,重新渲染图表 */ watch( @@ -131,7 +131,5 @@ onMounted(() => { diff --git a/apps/web-antd/src/views/infra/webSocket/index.vue b/apps/web-antd/src/views/infra/webSocket/index.vue index d3f00737c..178300f96 100644 --- a/apps/web-antd/src/views/infra/webSocket/index.vue +++ b/apps/web-antd/src/views/infra/webSocket/index.vue @@ -100,7 +100,7 @@ watchEffect(() => { /** 发送消息 */ const sendText = ref(''); // 发送内容 const sendUserId = ref(''); // 发送人 -const handlerSend = () => { +function handlerSend() { if (!sendText.value.trim()) { message.warning('消息内容不能为空'); return; @@ -119,19 +119,19 @@ const handlerSend = () => { // 2. 最后发送消息 send(jsonMessage); sendText.value = ''; -}; +} /** 切换 websocket 连接状态 */ -const toggleConnectStatus = () => { +function toggleConnectStatus() { if (getIsOpen.value) { close(); } else { open(); } -}; +} /** 获取消息类型的徽标颜色 */ -const getMessageBadgeColor = (type?: string) => { +function getMessageBadgeColor(type?: string) { switch (type) { case 'group': { return 'green'; @@ -146,10 +146,10 @@ const getMessageBadgeColor = (type?: string) => { return 'default'; } } -}; +} /** 获取消息类型的文本 */ -const getMessageTypeText = (type?: string) => { +function getMessageTypeText(type?: string) { switch (type) { case 'group': { return '群发'; @@ -164,7 +164,7 @@ const getMessageTypeText = (type?: string) => { return '未知'; } } -}; +} /** 初始化 */ const userList = ref([]); // 用户列表 diff --git a/packages/locales/src/langs/en-US/common.json b/packages/locales/src/langs/en-US/common.json index 5ccfda4c9..0d289b3ab 100644 --- a/packages/locales/src/langs/en-US/common.json +++ b/packages/locales/src/langs/en-US/common.json @@ -16,6 +16,7 @@ "disabled": "Disabled", "edit": "Edit", "delete": "Delete", + "deleteBatch": "Delete Batch", "create": "Create", "detail": "Detail", "yes": "Yes", diff --git a/packages/locales/src/langs/zh-CN/common.json b/packages/locales/src/langs/zh-CN/common.json index d5f81349c..b90087f1a 100644 --- a/packages/locales/src/langs/zh-CN/common.json +++ b/packages/locales/src/langs/zh-CN/common.json @@ -16,6 +16,7 @@ "disabled": "已禁用", "edit": "修改", "delete": "删除", + "deleteBatch": "批量删除", "create": "新增", "detail": "详情", "yes": "是",