From 611dd8268e40caa4d97e8954b85b5adaaef99afa Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期一, 26 十月 2026 17:45:58 +0800
Subject: [PATCH] feat(hrm): 考勤规则支持地图定位打卡

---
 src/views/hrm/attendance/rule/data.ts |  108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 108 insertions(+), 0 deletions(-)

diff --git a/src/views/hrm/attendance/rule/data.ts b/src/views/hrm/attendance/rule/data.ts
index 718e3b8..6362242 100644
--- a/src/views/hrm/attendance/rule/data.ts
+++ b/src/views/hrm/attendance/rule/data.ts
@@ -128,6 +128,105 @@
       },
     },
     {
+      fieldName: 'locationRequired',
+      label: '瀹氫綅鎵撳崱',
+      component: 'Switch',
+      defaultValue: false,
+      componentProps: {
+        checkedChildren: '鍚敤',
+        unCheckedChildren: '鍏抽棴',
+      },
+      help: '鍚敤鍚庯紝鍛樺伐鎵撳崱蹇呴』鍦ㄤ笅鏂硅瀹氬湴鐐圭殑鍏佽鍗婂緞鍐�',
+    },
+    {
+      fieldName: 'locationName',
+      label: '鎵撳崱鍦扮偣',
+      component: 'Input',
+      componentProps: {
+        placeholder: '渚嬪锛氭柊楂樼數鍔涘巶鍖�',
+        maxlength: 100,
+      },
+      dependencies: {
+        triggerFields: ['locationRequired'],
+        show: (values) => Boolean(values.locationRequired),
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'locationAddress',
+      label: '鍦扮偣鍦板潃',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ缁嗗湴鍧�锛屼究浜庡憳宸ヨ瘑鍒�',
+        maxlength: 255,
+      },
+      dependencies: {
+        triggerFields: ['locationRequired'],
+        show: (values) => Boolean(values.locationRequired),
+      },
+    },
+    {
+      fieldName: 'longitude',
+      label: '缁忓害(WGS84)',
+      component: 'InputNumber',
+      componentProps: {
+        placeholder: '鍦板浘閫夌偣鍚庤嚜鍔ㄥ~鍏�',
+        min: -180,
+        max: 180,
+        precision: 7,
+        style: { width: '100%' },
+      },
+      dependencies: {
+        triggerFields: ['locationRequired'],
+        show: (values) => Boolean(values.locationRequired),
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'latitude',
+      label: '绾害(WGS84)',
+      component: 'InputNumber',
+      componentProps: {
+        placeholder: '鍦板浘閫夌偣鍚庤嚜鍔ㄥ~鍏�',
+        min: -90,
+        max: 90,
+        precision: 7,
+        style: { width: '100%' },
+      },
+      dependencies: {
+        triggerFields: ['locationRequired'],
+        show: (values) => Boolean(values.locationRequired),
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'radiusMeters',
+      label: '鎵撳崱鍗婂緞(绫�)',
+      component: 'InputNumber',
+      defaultValue: 10,
+      componentProps: {
+        min: 10,
+        max: 5000,
+        precision: 0,
+        style: { width: '100%' },
+      },
+      help: '鍏佽鑼冨洿 10~5000 绫筹紝瀹為檯绮惧害鍙栧喅浜庢墜鏈� GPS 涓庣幆澧�',
+      dependencies: {
+        triggerFields: ['locationRequired'],
+        show: (values) => Boolean(values.locationRequired),
+      },
+      rules: 'required',
+    },
+    {
+      fieldName: 'coordinateSystem',
+      component: 'Input',
+      defaultValue: 'WGS84',
+      dependencies: {
+        triggerFields: [''],
+        show: () => false,
+      },
+    },
+    {
       fieldName: 'status',
       label: '鐘舵��',
       component: 'RadioGroup',
@@ -215,6 +314,15 @@
         `${row.effectiveStartDate || '涓嶉檺'} ~ ${row.effectiveEndDate || '涓嶉檺'}`,
     },
     {
+      field: 'locationName',
+      title: '鎵撳崱鑼冨洿',
+      minWidth: 180,
+      formatter: ({ row }) =>
+        row.locationRequired
+          ? `${row.locationName || '-'}锛�${row.radiusMeters ?? 0}绫筹級`
+          : '涓嶉檺鍒朵綅缃�',
+    },
+    {
       field: 'status',
       title: '鐘舵��',
       width: 80,

--
Gitblit v1.9.3