+
+
+
+
+
+
+
+
+
+
+
+
+ {{ action.label }}
+
+
+ {{ getPopConfirmProps(action.popConfirm).title }}
+
+
+
+
+
+ {{ action.label }}
+
+
+
+
+
+
+ {{ $t('page.action.more') }}
+
+
+
+
+
+
+
diff --git a/apps/web-naive/src/components/table-action/typing.ts b/apps/web-naive/src/components/table-action/typing.ts
new file mode 100644
index 000000000..ffe4761bc
--- /dev/null
+++ b/apps/web-naive/src/components/table-action/typing.ts
@@ -0,0 +1,28 @@
+import type { ButtonProps } from 'naive-ui/es/button/src/Button';
+import type { TooltipProps } from 'naive-ui/es/tooltip/src/Tooltip';
+
+export interface PopConfirm {
+ title: string;
+ okText?: string;
+ cancelText?: string;
+ confirm: () => void;
+ cancel?: () => void;
+ icon?: string;
+ disabled?: boolean;
+}
+
+export interface ActionItem extends ButtonProps {
+ onClick?: () => void;
+ type?: ButtonProps['type'];
+ label?: string;
+ color?: 'error' | 'success' | 'warning';
+ icon?: string;
+ popConfirm?: PopConfirm;
+ disabled?: boolean;
+ divider?: boolean;
+ // 权限编码控制是否显示
+ auth?: string[];
+ // 业务控制是否显示
+ ifShow?: ((action: ActionItem) => boolean) | boolean;
+ tooltip?: string | TooltipProps;
+}
diff --git a/apps/web-naive/src/utils/index.ts b/apps/web-naive/src/utils/index.ts
new file mode 100644
index 000000000..800284d14
--- /dev/null
+++ b/apps/web-naive/src/utils/index.ts
@@ -0,0 +1 @@
+export * from './rangePickerProps';
diff --git a/apps/web-naive/src/utils/rangePickerProps.ts b/apps/web-naive/src/utils/rangePickerProps.ts
new file mode 100644
index 000000000..d7ecc1dd4
--- /dev/null
+++ b/apps/web-naive/src/utils/rangePickerProps.ts
@@ -0,0 +1,53 @@
+import dayjs from 'dayjs';
+
+import { $t } from '#/locales';
+
+/** 时间段选择器拓展 */
+export function getRangePickerDefaultProps() {
+ return {
+ startPlaceholder: $t('utils.rangePicker.beginTime'),
+ endPlaceholder: $t('utils.rangePicker.endTime'),
+ type: 'datetimerange',
+ // TODO
+ format: 'YYYY-MM-dd HH:mm:ss',
+ valueFormat: 'YYYY-MM-dd HH:mm:ss',
+ defaultTime: ['00:00:00', '23:59:59'],
+ shortcuts: {
+ [$t('utils.rangePicker.today')]: () =>
+ [
+ dayjs().startOf('day').toDate(),
+ dayjs().endOf('day').toDate(),
+ ] as const,
+ [$t('utils.rangePicker.last7Days')]: () =>
+ [
+ dayjs().subtract(7, 'day').startOf('day').toDate(),
+ dayjs().endOf('day').toDate(),
+ ] as const,
+ [$t('utils.rangePicker.last30Days')]: () =>
+ [
+ dayjs().subtract(30, 'day').startOf('day').toDate(),
+ dayjs().endOf('day').toDate(),
+ ] as const,
+ [$t('utils.rangePicker.yesterday')]: () =>
+ [
+ dayjs().subtract(1, 'day').startOf('day').toDate(),
+ dayjs().subtract(1, 'day').endOf('day').toDate(),
+ ] as const,
+ [$t('utils.rangePicker.thisWeek')]: () =>
+ [
+ dayjs().startOf('week').toDate(),
+ dayjs().endOf('day').toDate(),
+ ] as const,
+ [$t('utils.rangePicker.thisMonth')]: () =>
+ [
+ dayjs().startOf('month').toDate(),
+ dayjs().endOf('day').toDate(),
+ ] as const,
+ [$t('utils.rangePicker.lastWeek')]: () =>
+ [
+ dayjs().subtract(1, 'week').startOf('day').toDate(),
+ dayjs().endOf('day').toDate(),
+ ] as const,
+ },
+ };
+}
diff --git a/apps/web-naive/src/views/system/area/data.ts b/apps/web-naive/src/views/system/area/data.ts
new file mode 100644
index 000000000..e6cc06c99
--- /dev/null
+++ b/apps/web-naive/src/views/system/area/data.ts
@@ -0,0 +1,48 @@
+import type { VbenFormSchema } from '#/adapter/form';
+import type { VxeTableGridOptions } from '#/adapter/vxe-table';
+import type { SystemAreaApi } from '#/api/system/area';
+
+import { z } from '#/adapter/form';
+
+/** 查询 IP 的表单 */
+export function useFormSchema(): VbenFormSchema[] {
+ return [
+ {
+ fieldName: 'ip',
+ label: 'IP 地址',
+ component: 'Input',
+ componentProps: {
+ placeholder: '请输入 IP 地址',
+ },
+ rules: z.string().ip({ message: '请输入正确的 IP 地址' }),
+ },
+ {
+ fieldName: 'result',
+ label: '地址',
+ component: 'Input',
+ componentProps: {
+ placeholder: '展示查询 IP 结果',
+ readonly: true,
+ },
+ },
+ ];
+}
+
+/** 列表的字段 */
+export function useGridColumns(): VxeTableGridOptions