diff --git a/index.html b/index.html
index c04172b..cb0ff4b 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
-
+
@@ -14,7 +14,7 @@
document.write(
'')
- log=false
+ var log = false;
// 版本检查:如果检测到新版本,清除缓存并刷新
(function() {
diff --git a/src/api/base/zwApi.ts b/src/api/base/zwApi.ts
index aa428c3..b69e9a1 100644
--- a/src/api/base/zwApi.ts
+++ b/src/api/base/zwApi.ts
@@ -78,6 +78,10 @@ export const findAllZw = () => {
+
+
+
+
diff --git a/src/components/BasicForm/components/BasicDateTime.vue b/src/components/BasicForm/components/BasicDateTime.vue
index 55e5a47..5ad3d6c 100644
--- a/src/components/BasicForm/components/BasicDateTime.vue
+++ b/src/components/BasicForm/components/BasicDateTime.vue
@@ -19,6 +19,7 @@
:mode="attrs.componentProps.mode"
:title="attrs.label"
:value="newValue ? newValue : undefined"
+ :onPopupChange="handlePopupChange"
@confirm="confirm"
/>
@@ -94,4 +95,14 @@ function confirm(e: any) {
attrs.componentProps.ok(e, attrs);
}
}
+
+// 处理弹窗状态变化
+function handlePopupChange(e: any) {
+ if (
+ attrs.componentProps.onPopupChange &&
+ typeof attrs.componentProps.onPopupChange === "function"
+ ) {
+ attrs.componentProps.onPopupChange(e);
+ }
+}
diff --git a/src/components/BasicForm/components/BasicPicker.vue b/src/components/BasicForm/components/BasicPicker.vue
index 23775d6..842e2af 100644
--- a/src/components/BasicForm/components/BasicPicker.vue
+++ b/src/components/BasicForm/components/BasicPicker.vue
@@ -35,6 +35,7 @@
v-model="pickerKey"
@ok="ok"
@change="change"
+ @popupChange="handlePopupChange"
/>
@@ -161,6 +162,16 @@ function change(e: any) {
}
}
+// 处理弹窗状态变化
+function handlePopupChange(e: any) {
+ if (
+ attrs.componentProps.onPopupChange &&
+ typeof attrs.componentProps.onPopupChange === "function"
+ ) {
+ attrs.componentProps.onPopupChange(e);
+ }
+}
+
const pickerValue = ref("");
watchEffect(() => {
diff --git a/src/components/BasicForm/components/BasicTree.vue b/src/components/BasicForm/components/BasicTree.vue
index a7ebf80..5711b35 100644
--- a/src/components/BasicForm/components/BasicTree.vue
+++ b/src/components/BasicForm/components/BasicTree.vue
@@ -19,7 +19,8 @@
:rangeKey="rangeKey"
:title="'选择'+ attrs.label"
@confirm="confirm"
- v-bind="attrs.componentProps"
+ :onPopupChange="handlePopupChange"
+ v-bind="treeProps"
/>
@@ -60,6 +61,12 @@
const rangeKey = ref(attrs.componentProps && attrs.componentProps.rangeKey || '')
const savaKey = ref(attrs.componentProps && attrs.componentProps.savaKey || '')
+ // 过滤掉 onPopupChange,避免重复传递
+ const treeProps = computed(() => {
+ const { onPopupChange, ...rest } = attrs.componentProps || {}
+ return rest
+ })
+
const range = computed({
get() {
if (attrs.componentProps && attrs.componentProps.range) {
@@ -106,6 +113,16 @@
}
}
+ // 处理弹窗状态变化
+ function handlePopupChange(e: any) {
+ if (
+ attrs.componentProps.onPopupChange &&
+ typeof attrs.componentProps.onPopupChange === "function"
+ ) {
+ attrs.componentProps.onPopupChange(e);
+ }
+ }
+
function hx(rangeData: any, data: any) {
let valueList = data.split(',')
for (const key in rangeData) {
diff --git a/src/components/BasicPicker/Picker.vue b/src/components/BasicPicker/Picker.vue
index e4de712..3eb1ead 100644
--- a/src/components/BasicPicker/Picker.vue
+++ b/src/components/BasicPicker/Picker.vue
@@ -81,6 +81,11 @@ const props = defineProps({
type: Array,
default: [0],
},
+ // 支持通过 props 传递弹窗状态变化回调
+ onPopupChange: {
+ type: Function,
+ default: null,
+ },
});
const emits = defineEmits([
@@ -132,6 +137,14 @@ function ok() {
function popupChange(e) {
emits("popupChange", e);
+ // 如果传递了回调函数,调用它
+ if (props.onPopupChange) {
+ try {
+ props.onPopupChange(e);
+ } catch (err) {
+ console.error('[BasicPicker] 调用 onPopupChange 失败:', err);
+ }
+ }
}
defineExpose({ open, close });
diff --git a/src/components/BasicPicker/TimePicker/DatetimePicker.vue b/src/components/BasicPicker/TimePicker/DatetimePicker.vue
index 571dcc5..3fd89a2 100644
--- a/src/components/BasicPicker/TimePicker/DatetimePicker.vue
+++ b/src/components/BasicPicker/TimePicker/DatetimePicker.vue
@@ -1,5 +1,5 @@
-