diff --git a/src/pages-system/area/components/area-tree-item.vue b/src/pages-system/area/components/area-tree-item.vue
new file mode 100644
index 0000000..e3b402e
--- /dev/null
+++ b/src/pages-system/area/components/area-tree-item.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+ 编码:{{ item.id }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages-system/area/components/ip-query-form.vue b/src/pages-system/area/components/ip-query-form.vue
new file mode 100644
index 0000000..c3e2a5d
--- /dev/null
+++ b/src/pages-system/area/components/ip-query-form.vue
@@ -0,0 +1,74 @@
+
+
+
+
+ IP 查询
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+
diff --git a/src/pages-system/area/index.vue b/src/pages-system/area/index.vue
new file mode 100644
index 0000000..0e8b1db
--- /dev/null
+++ b/src/pages-system/area/index.vue
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts
index 9f48a97..f404f7e 100644
--- a/src/pages/index/index.ts
+++ b/src/pages/index/index.ts
@@ -149,6 +149,13 @@ const menuGroupsData: MenuGroup[] = [
iconColor: '#faad14',
permission: 'system:dict:query',
},
+ {
+ key: 'area',
+ name: '地区管理',
+ icon: 'location',
+ url: '/pages-system/area/index',
+ iconColor: '#d50f0f',
+ },
],
},
{
diff --git a/src/utils/validator.ts b/src/utils/validator.ts
index 1a35beb..db12000 100644
--- a/src/utils/validator.ts
+++ b/src/utils/validator.ts
@@ -4,6 +4,10 @@ const MOBILE_REGEX = /^1[3-9]\d{9}$/
/** 邮箱正则表达式 */
const EMAIL_REGEX = /^[\w-]+(?:\.[\w-]+)*@[\w-]+(?:\.[\w-]+)+$/
+/** IP 地址正则表达式(IPv4) */
+// eslint-disable-next-line regexp/no-unused-capturing-group
+const IP_REGEX = /^(\d{1,3}\.){3}\d{1,3}$/
+
/**
* 判断字符串是否为空白(null、undefined、空字符串或仅包含空白字符)
*
@@ -39,3 +43,16 @@ export function isEmail(value?: null | string): boolean {
}
return EMAIL_REGEX.test(value)
}
+
+/**
+ * 验证是否为 IP 地址(IPv4)
+ *
+ * @param value 值
+ * @returns 是否为 IP 地址
+ */
+export function isIp(value?: null | string): boolean {
+ if (!value) {
+ return false
+ }
+ return IP_REGEX.test(value)
+}