From 6f35f9dc767e99ad701f7f6e2f5d4c52b6cc1d0f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 14:05:26 +0800
Subject: [PATCH] refactor(wls): 将级联选择组件替换为普通输入框

---
 src/adapter/form.ts |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/adapter/form.ts b/src/adapter/form.ts
index 0d5bb16..972af3a 100644
--- a/src/adapter/form.ts
+++ b/src/adapter/form.ts
@@ -8,6 +8,10 @@
 import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
 import { $t } from '@vben/locales';
 import { isMobile } from '@vben/utils';
+import { watch } from 'vue';
+
+import { automaticApproval } from '#/store/audit-policy';
+import { isAuditField } from '#/utils/audit-ui-policy';
 
 async function initSetupVbenForm() {
   setupVbenForm<ComponentType>({
@@ -61,7 +65,16 @@
   });
 }
 
-const useVbenForm = useForm<ComponentType, ComponentPropsMap>;
+const useVbenForm = (options: FormProps<ComponentType, ComponentPropsMap>) => {
+  const result = useForm<ComponentType, ComponentPropsMap>(options);
+  const schema = options.schema;
+  if (schema) {
+    watch(automaticApproval, () => {
+      result[1].setState({ schema: schema.filter((item) => !automaticApproval.value || !isAuditField(item)) });
+    }, { immediate: true });
+  }
+  return result;
+};
 
 export { initSetupVbenForm, useVbenForm, z };
 

--
Gitblit v1.9.3