@xuekl/cli-components 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/XklForm.vue +11 -0
  2. package/package.json +1 -1
package/XklForm.vue CHANGED
@@ -68,6 +68,7 @@ import XklSelect from './XklSelect.vue'
68
68
  import XklTreeSelect from './XklTreeSelect.vue'
69
69
  import XklDict from './XklDict.vue'
70
70
  import XklDatePicker from './XklDatePicker.vue'
71
+ import { componentGlobal } from '@xuekl/cli-base/global'
71
72
 
72
73
  const props = defineProps(['form'])
73
74
  const XklFormRef = ref(null)
@@ -158,9 +159,19 @@ searchSpan.value = 24 - toalSpan % 24
158
159
  const regProto = () => {
159
160
  if (XklFormRef.value) {
160
161
  let enableSubmit = true;
162
+ let submitTimer: NodeJS.Timeout
161
163
  form.setSubmit((callback: (call: () => void, feils: any) => void) => {
164
+ if (componentGlobal.enableFormSubmit) {
165
+ enableSubmit = true
166
+ }
167
+ componentGlobal.enableFormSubmit = false
162
168
  if (enableSubmit) {
163
169
  enableSubmit = false;
170
+ clearTimeout(submitTimer)
171
+ submitTimer = setTimeout(() => {
172
+ componentGlobal.enableFormSubmit = true
173
+ enableSubmit = true
174
+ }, 3000)
164
175
  formList.forEach(field => {
165
176
  modeFields[field.prop] = (form as any)[field.prop]
166
177
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuekl/cli-components",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {